vue2-client 1.19.57 → 1.19.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -81,6 +81,7 @@
|
|
|
81
81
|
key="workFlowTab"
|
|
82
82
|
tab="表单"
|
|
83
83
|
>
|
|
84
|
+
<work-flow-preview v-if="historyFormCompletedDataPreview" :form-completed-data-preview="historyFormCompletedDataPreview" :showTitle="false"/>
|
|
84
85
|
<x-add-native-form
|
|
85
86
|
ref="xAddForm"
|
|
86
87
|
@x-form-item-emit-func="formItemEmitFunc"
|
|
@@ -486,6 +487,7 @@ export default {
|
|
|
486
487
|
formCompletedData: {},
|
|
487
488
|
// 用于展示提交的数据
|
|
488
489
|
formCompletedDataPreview: null,
|
|
490
|
+
historyFormCompletedDataPreview: null,
|
|
489
491
|
// 切换至目标流程时,目标流程定义
|
|
490
492
|
targetStepDefine: [],
|
|
491
493
|
// 控制历史记录加载
|
|
@@ -953,8 +955,78 @@ export default {
|
|
|
953
955
|
// 获取当前步骤定义内容,构建组件
|
|
954
956
|
async buildComp (stepId) {
|
|
955
957
|
const properties = this.stepsDefine.find(item => item.id === stepId).properties
|
|
958
|
+
this.historyFormCompletedDataPreview = null
|
|
956
959
|
// 表单的渲染
|
|
957
960
|
if (properties.form && properties.form.formJson) {
|
|
961
|
+
if (properties.otherProperty && properties.otherProperty.historyFormData) {
|
|
962
|
+
const historyFormDataConfig = properties.otherProperty.historyFormData
|
|
963
|
+
|
|
964
|
+
// 收集所有需要查询的步骤和字段映射关系
|
|
965
|
+
const configItems = []
|
|
966
|
+
const stepIdSet = new Set()
|
|
967
|
+
|
|
968
|
+
for (const historyFormConfig of historyFormDataConfig) {
|
|
969
|
+
const stepConfig = this.stepsDefine.find(item => item.name === historyFormConfig.stepName)
|
|
970
|
+
if (!stepConfig) {
|
|
971
|
+
continue
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
const stepId = stepConfig.id
|
|
975
|
+
const stepFormJson = stepConfig?.properties?.form?.formJson
|
|
976
|
+
if (!stepFormJson) {
|
|
977
|
+
continue
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
const formItem = stepFormJson.find(item => item.name === historyFormConfig.formLabel)
|
|
981
|
+
const model = formItem?.model
|
|
982
|
+
|
|
983
|
+
if (!model) {
|
|
984
|
+
continue
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
// 收集配置项和需要查询的 stepId
|
|
988
|
+
configItems.push({
|
|
989
|
+
stepId,
|
|
990
|
+
model,
|
|
991
|
+
displayLabel: historyFormConfig.displayLabel
|
|
992
|
+
})
|
|
993
|
+
stepIdSet.add(stepId)
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
// 批量查询:每个 stepId 只查询一次,并行执行
|
|
997
|
+
const formDataCache = new Map()
|
|
998
|
+
const queryPromises = Array.from(stepIdSet).map(async stepId => {
|
|
999
|
+
try {
|
|
1000
|
+
const formData = await postByServiceName(
|
|
1001
|
+
workFlowViewApi.getWorkFlowCompletedStepData,
|
|
1002
|
+
{ workflowId: this.workflowId, stepId }
|
|
1003
|
+
)
|
|
1004
|
+
formDataCache.set(stepId, formData.data || {})
|
|
1005
|
+
} catch (error) {
|
|
1006
|
+
console.error(`查询步骤 ${stepId} 的数据失败:`, error)
|
|
1007
|
+
formDataCache.set(stepId, {})
|
|
1008
|
+
}
|
|
1009
|
+
})
|
|
1010
|
+
|
|
1011
|
+
// 等待所有查询完成
|
|
1012
|
+
await Promise.all(queryPromises)
|
|
1013
|
+
|
|
1014
|
+
// 组装历史表单数据
|
|
1015
|
+
const historyFormData = configItems.map(configItem => {
|
|
1016
|
+
const cachedFormData = formDataCache.get(configItem.stepId)
|
|
1017
|
+
return {
|
|
1018
|
+
label: configItem.displayLabel,
|
|
1019
|
+
value: cachedFormData?.[configItem.model]
|
|
1020
|
+
}
|
|
1021
|
+
})
|
|
1022
|
+
|
|
1023
|
+
this.historyFormCompletedDataPreview = {
|
|
1024
|
+
data: historyFormData,
|
|
1025
|
+
images: [],
|
|
1026
|
+
files: [],
|
|
1027
|
+
note: ''
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
958
1030
|
this.stepDefine = properties.form.formJson
|
|
959
1031
|
this.showForm = true
|
|
960
1032
|
this.$nextTick(() => {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
bordered
|
|
8
8
|
class="descriptionPreviewItem"
|
|
9
9
|
>
|
|
10
|
-
<p slot="title" class="descriptionTitle">
|
|
10
|
+
<p slot="title" class="descriptionTitle" v-if="showTitle">
|
|
11
11
|
填写历史
|
|
12
12
|
</p>
|
|
13
13
|
<template v-if="legacyMode">
|
|
@@ -97,7 +97,11 @@ export default {
|
|
|
97
97
|
legacyMode: {
|
|
98
98
|
type: Boolean,
|
|
99
99
|
default: false
|
|
100
|
-
}
|
|
100
|
+
},
|
|
101
|
+
showTitle: {
|
|
102
|
+
type: Boolean,
|
|
103
|
+
default: true
|
|
104
|
+
},
|
|
101
105
|
},
|
|
102
106
|
computed: {
|
|
103
107
|
noData () {
|