Przeglądaj źródła

fix: merge master

lanceJiang 1 rok temu
rodzic
commit
09035f47a8

+ 5 - 5
src/api/flow/processTask.ts

@@ -105,10 +105,10 @@ export function processApprovalInfoApi(taskId: string): AxiosPromise {
 
 // 查看审批信息
 export function processTaskApprovalInfo(taskId: string): AxiosPromise {
-    return request({
-        url: `/v1/process-task/approval-info-${taskId}`,
-        method: 'post'
-    })
+	return request({
+		url: `/v1/process-task/approval-info-${taskId}`,
+		method: 'post'
+	})
 }
 
 export default {
@@ -119,5 +119,5 @@ export default {
 	processRejectionTaskApi,
 	processReviewTaskApi,
 	processApprovalInfoApi,
-    processTaskApprovalInfo
+	processTaskApprovalInfo
 }

+ 44 - 45
src/views/approve/pendingApproval/detail.vue

@@ -133,7 +133,7 @@ const props = defineProps({
 		type: Boolean,
 		default: false
 	},
-  taskObj: {
+	taskObj: {
 		type: Object,
 		default: () => ({})
 	}
@@ -164,9 +164,9 @@ const taskId = computed(() => {
 	return props.taskObj.taskId || ''
 })
 const descItemsData = ref({
-  origin: undefined,
-  list: [],
-  loading: false
+	origin: undefined,
+	list: [],
+	loading: false
 })
 // 关闭按钮
 const closeDrawer = () => {
@@ -204,48 +204,47 @@ const openComment = (type, item) => {
 }
 
 nextTick(() => {
-  const cur = props.taskObj || {}
-  processApprovalInfoApi(cur.taskId).then(data => {
-    console.log(JSON.stringify(data))
-    activeData.value = data
-  })
-  // 提交的表单 数据展示
-  descItemsData.value.loading = true
-  processTaskApprovalInfo(cur.taskId)
-      .then(data => {
-        // console.log(data, 'data.......')
-        descItemsData.value.origin = data
-        try {
-          descItemsData.value.list = JSON.parse(data.formContent).map(item => {
-            const showLabel = item.title
-            let showValue = item.local_value
-            const options = item.options
-            if (Array.isArray(options) && showValue !== undefined) {
-              if (Array.isArray(showValue)) {
-                showValue = showValue.reduce(val => {
-                  const cur = options.find(option => option.value === val)
-                  return cur?.label || val
-                }, [])
-              } else {
-                const cur = options.find(option => option.value === showValue)
-                showValue = cur?.label || showValue
-              }
-            }
-            return {
-              showLabel,
-              showValue
-            }
-          })
-        } catch (e) {
-          console.error('解析 descItems 数据出现问题', e)
-          descItemsData.value.list = []
-        }
-      })
-      .finally(() => {
-        descItemsData.value.loading = false
-      })
+	const cur = props.taskObj || {}
+	processApprovalInfoApi(cur.taskId).then(data => {
+		// console.log(JSON.stringify(data))
+		activeData.value = data
+	})
+	// 提交的表单 数据展示
+	descItemsData.value.loading = true
+	processTaskApprovalInfo(cur.taskId)
+		.then(data => {
+			// console.log(data, 'data.......')
+			descItemsData.value.origin = data
+			try {
+				descItemsData.value.list = JSON.parse(data.formContent).map(item => {
+					const showLabel = item.title
+					let showValue = item.local_value
+					const options = item.options
+					if (Array.isArray(options) && showValue !== undefined) {
+						if (Array.isArray(showValue)) {
+							showValue = showValue.reduce(val => {
+								const cur = options.find(option => option.value === val)
+								return cur?.label || val
+							}, [])
+						} else {
+							const cur = options.find(option => option.value === showValue)
+							showValue = cur?.label || showValue
+						}
+					}
+					return {
+						showLabel,
+						showValue
+					}
+				})
+			} catch (e) {
+				console.error('解析 descItems 数据出现问题', e)
+				descItemsData.value.list = []
+			}
+		})
+		.finally(() => {
+			descItemsData.value.loading = false
+		})
 })
-
 </script>
 
 <style scoped lang="scss">