|
@@ -133,7 +133,7 @@ const props = defineProps({
|
|
type: Boolean,
|
|
type: Boolean,
|
|
default: false
|
|
default: false
|
|
},
|
|
},
|
|
- taskObj: {
|
|
|
|
|
|
+ taskObj: {
|
|
type: Object,
|
|
type: Object,
|
|
default: () => ({})
|
|
default: () => ({})
|
|
}
|
|
}
|
|
@@ -164,9 +164,9 @@ const taskId = computed(() => {
|
|
return props.taskObj.taskId || ''
|
|
return props.taskObj.taskId || ''
|
|
})
|
|
})
|
|
const descItemsData = ref({
|
|
const descItemsData = ref({
|
|
- origin: undefined,
|
|
|
|
- list: [],
|
|
|
|
- loading: false
|
|
|
|
|
|
+ origin: undefined,
|
|
|
|
+ list: [],
|
|
|
|
+ loading: false
|
|
})
|
|
})
|
|
// 关闭按钮
|
|
// 关闭按钮
|
|
const closeDrawer = () => {
|
|
const closeDrawer = () => {
|
|
@@ -204,48 +204,47 @@ const openComment = (type, item) => {
|
|
}
|
|
}
|
|
|
|
|
|
nextTick(() => {
|
|
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>
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|