vue2-client 1.15.6 → 1.15.7

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.15.6",
3
+ "version": "1.15.7",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -966,19 +966,7 @@ export default {
966
966
  submitUser: this.currUser.name,
967
967
  submitUserId: this.currUser.id,
968
968
  // 新增:分支节点信息
969
- branchInfo: this.isWfResultBranch ? {
970
- isWfResultBranch: true,
971
- branchChargePersons: this.branchChargePersons,
972
- branchNodes: this.branchNodes.map(node => ({
973
- stepId: node.stepId,
974
- stepName: node.stepName,
975
- selectedPersonId: this.branchChargePersons[node.stepId],
976
- selectedPersonName: this.getBranchPersonName(node.stepId)
977
- }))
978
- } : {
979
- isWfResultBranch: false,
980
- calculatedTargetNode: this.calculatedTargetNode
981
- }
969
+ branchChargePersons: this.branchChargePersons
982
970
  }
983
971
  },
984
972
  // 获取当前选择的负责人
@@ -1170,7 +1158,6 @@ export default {
1170
1158
  const result = await this.evaluateExpression(action.expression, formData)
1171
1159
  if (result) {
1172
1160
  this.calculatedTargetNode = action.to
1173
-
1174
1161
  // 设置对应节点的人员选择
1175
1162
  const stepDefine = this.stepsDefine.find(step => step.id === action.to)
1176
1163
  if (stepDefine?.properties?.chargePerson?.needSelectPerson) {
@@ -1273,6 +1260,7 @@ export default {
1273
1260
  for (const action of conditionalActions) {
1274
1261
  const stepDefine = this.stepsDefine.find(step => step.id === action.to)
1275
1262
  if (stepDefine?.properties?.chargePerson?.needSelectPerson) {
1263
+ // 都使用多分支了 肯定是新数据 那么不用做兼容处理
1276
1264
  this.chargePerson = stepDefine?.properties?.chargePerson
1277
1265
  // 获取这个节点的人员选项
1278
1266
  const chargePersonOptions = await this.getChargePersonOptionsForStep(action.to)
@@ -1283,9 +1271,10 @@ export default {
1283
1271
  chargePerson: stepDefine.properties.chargePerson,
1284
1272
  chargePersonOptions: chargePersonOptions
1285
1273
  })
1286
-
1287
1274
  // 初始化选择值
1288
1275
  this.branchChargePersons[action.to] = undefined
1276
+ } else {
1277
+ this.branchChargePersons[action.to] = stepDefine?.properties?.chargePerson
1289
1278
  }
1290
1279
  }
1291
1280
 
@@ -1300,6 +1289,7 @@ export default {
1300
1289
  targetStepId = this.stepNextBtnTo
1301
1290
  }
1302
1291
 
1292
+ this.calculatedTargetNode = targetStepId
1303
1293
  const stepDefine = this.stepsDefine.find(step => step.id === targetStepId)
1304
1294
  const defineProperties = stepDefine.properties
1305
1295
  this.chargePerson = defineProperties?.chargePerson
@@ -1323,6 +1313,7 @@ export default {
1323
1313
  this.needSelectPerson = true
1324
1314
  console.warn('设置人员选择,选项数量:', this.chargePersonOptions.length)
1325
1315
  } else {
1316
+ this.branchChargePersons[targetStepId] = stepDefine?.properties?.chargePerson
1326
1317
  this.needSelectPerson = false
1327
1318
  this.chargePersonOptions = []
1328
1319
  console.warn('无需选择人员')
@@ -222,7 +222,7 @@ export default {
222
222
  // 动态展示时间线节点颜色
223
223
  getStepIconColor (index) {
224
224
  // 根据index找到stepId
225
- const stepId = this.displaySteps[index - 1].id
225
+ const stepId = this.displaySteps[index - 1]?.id
226
226
 
227
227
  if (this.changeAble && stepId === this.displayStepId) {
228
228
  return 'yellow'
@@ -9,12 +9,18 @@
9
9
  required
10
10
  >
11
11
  <a-select
12
- v-model="workflowHandleWrap.branchChargePersons[node.stepId]"
12
+ :value="getBranchPersonValue(node.stepId)"
13
+ @change="setBranchPersonValue(node.stepId, $event, node.chargePersonOptions)"
13
14
  :placeholder="`请选择${node.stepName}的处理人`"
14
15
  :options="node.chargePersonOptions"
15
16
  :filter-option="filterOption"
16
17
  style="width: 300px"
17
- />
18
+ show-search
19
+ >
20
+ <a-select-option v-for="option in node.chargePersonOptions" :key="option.value" :value="option.value">
21
+ {{ option.label }}
22
+ </a-select-option>
23
+ </a-select>
18
24
  </a-form-item>
19
25
  </template>
20
26
 
@@ -24,13 +30,14 @@
24
30
  v-model="workflowHandleWrap.checkedChargePerson"
25
31
  placeholder="请选择或搜索"
26
32
  :options="workflowHandleWrap.chargePersonOptions"
33
+ @change="setBranchPersonValue(workflowHandleWrap.calculatedTargetNode, $event, workflowHandleWrap.chargePersonOptions)"
27
34
  :filter-option="filterOption"
28
35
  style="width: 300px"
29
36
  />
30
- <div v-if="workflowHandleWrap.calculatedTargetNode" style="margin-top: 8px; color: #52c41a; font-size: 12px;">
31
- <a-icon type="check-circle"/>
32
- 根据当前表单数据,将进入:{{ workflowHandleWrap.getStepNameByStepId(workflowHandleWrap.calculatedTargetNode) }}
33
- </div>
37
+ <!-- <div v-if="workflowHandleWrap.calculatedTargetNode" style="margin-top: 8px; color: #52c41a; font-size: 12px;">-->
38
+ <!-- <a-icon type="check-circle"/>-->
39
+ <!-- 根据当前表单数据,将进入:{{ workflowHandleWrap.getStepNameByStepId(workflowHandleWrap.calculatedTargetNode) }}-->
40
+ <!-- </div>-->
34
41
  </a-form-item>
35
42
  </div>
36
43
  </template>
@@ -40,7 +47,9 @@ export default {
40
47
  name: 'WorkflowPersonSelector',
41
48
  inject: ['workflowHandleWrap'],
42
49
  data () {
43
- return { }
50
+ return {}
51
+ },
52
+ mounted () {
44
53
  },
45
54
  methods: {
46
55
  // 选择框过滤
@@ -49,6 +58,33 @@ export default {
49
58
  option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
50
59
  )
51
60
  },
61
+
62
+ // 获取分支处理人值
63
+ getBranchPersonValue (stepId) {
64
+ if (!this.workflowHandleWrap.branchChargePersons) {
65
+ // 确保 branchChargePersons 对象存在
66
+ this.$set(this.workflowHandleWrap, 'branchChargePersons', {})
67
+ }
68
+ const value = this.workflowHandleWrap.branchChargePersons[stepId]?.handlerId
69
+ console.log('获取分支处理人值:', stepId, value)
70
+ return value
71
+ },
72
+
73
+ // 设置分支处理人值
74
+ setBranchPersonValue (stepId, value, options) {
75
+ if (!stepId) return
76
+ if (!this.workflowHandleWrap.branchChargePersons) {
77
+ this.$set(this.workflowHandleWrap, 'branchChargePersons', {})
78
+ }
79
+ // 使用 $set 确保响应式更新
80
+ this.$set(this.workflowHandleWrap.branchChargePersons, stepId, Object.assign({ ...this.workflowHandleWrap.branchChargePersons[stepId] }, {
81
+ handler: options.find(item => item.value === value).label,
82
+ handlerId: value
83
+ }))
84
+ // 强制更新组件
85
+ this.$forceUpdate()
86
+ },
87
+
52
88
  // 获取分支选择标签文本
53
89
  getBranchSelectionLabel () {
54
90
  if (this.workflowHandleWrap.isWfResultBranch) {
@@ -58,8 +94,7 @@ export default {
58
94
  } else {
59
95
  return '下一环节处理人'
60
96
  }
61
- },
62
-
97
+ }
63
98
  }
64
99
  }
65
100
  </script>