workflow-editor 0.9.68-dw → 0.9.68

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.
Files changed (120) hide show
  1. package/lib/workflow-editor.css +1 -1
  2. package/lib/workflow-editor.umd.min.js +10 -10
  3. package/package.json +2 -2
  4. package/packages/index.js +34 -0
  5. package/packages/plugins/formValidatorUtil.js +533 -0
  6. package/packages/plugins/index.js +8 -0
  7. package/packages/workflow-editor/index.js +14 -0
  8. package/packages/workflow-editor/src/api.js +7 -0
  9. package/packages/workflow-editor/src/assets/wf-editor-icons.js +2 -0
  10. package/packages/workflow-editor/src/constant.js +8 -0
  11. package/packages/workflow-editor/src/json-object-templates/auto-task.js +70 -0
  12. package/packages/workflow-editor/src/json-object-templates/copy-task.js +72 -0
  13. package/packages/workflow-editor/src/json-object-templates/decision.js +11 -0
  14. package/packages/workflow-editor/src/json-object-templates/end.js +14 -0
  15. package/packages/workflow-editor/src/json-object-templates/fork.js +10 -0
  16. package/packages/workflow-editor/src/json-object-templates/human-decision.js +9 -0
  17. package/packages/workflow-editor/src/json-object-templates/human-task.js +199 -0
  18. package/packages/workflow-editor/src/json-object-templates/join.js +10 -0
  19. package/packages/workflow-editor/src/json-object-templates/process.js +98 -0
  20. package/packages/workflow-editor/src/json-object-templates/start.js +13 -0
  21. package/packages/workflow-editor/src/json-object-templates/subprocess.js +31 -0
  22. package/packages/workflow-editor/src/json-object-templates/transition.js +26 -0
  23. package/packages/workflow-editor/src/main/admin-save-dialog.vue +66 -0
  24. package/packages/workflow-editor/src/main/canvas.vue +483 -0
  25. package/packages/workflow-editor/src/main/context-menu.vue +132 -0
  26. package/packages/workflow-editor/src/main/icon-svg.vue +32 -0
  27. package/packages/workflow-editor/src/main/selection-region.vue +66 -0
  28. package/packages/workflow-editor/src/main/tache-history-tooltip.vue +38 -0
  29. package/packages/workflow-editor/src/main/tache-name-input.vue +19 -0
  30. package/packages/workflow-editor/src/main/tache-subprocess-history-dialog.vue +35 -0
  31. package/packages/workflow-editor/src/main/toolbox.vue +60 -0
  32. package/packages/workflow-editor/src/main/wf-history-canvas.vue +304 -0
  33. package/packages/workflow-editor/src/process-json.js +623 -0
  34. package/packages/workflow-editor/src/process-service.js +31 -0
  35. package/packages/workflow-editor/src/properties-editors/auto-task/basic-properties.vue +81 -0
  36. package/packages/workflow-editor/src/properties-editors/auto-task/permission-settings.vue +155 -0
  37. package/packages/workflow-editor/src/properties-editors/auto-task.vue +73 -0
  38. package/packages/workflow-editor/src/properties-editors/common/additional-condition-utils.js +556 -0
  39. package/packages/workflow-editor/src/properties-editors/common/additional-condition.vue +276 -0
  40. package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields-utils.js +34 -0
  41. package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields.vue +239 -0
  42. package/packages/workflow-editor/src/properties-editors/common/common-notice-tool.vue +67 -0
  43. package/packages/workflow-editor/src/properties-editors/common/common-user-condition.vue +241 -0
  44. package/packages/workflow-editor/src/properties-editors/common/form-fields-utils.js +23 -0
  45. package/packages/workflow-editor/src/properties-editors/common/form-fields.vue +116 -0
  46. package/packages/workflow-editor/src/properties-editors/common/i18n-input.vue +75 -0
  47. package/packages/workflow-editor/src/properties-editors/common/i18n-set-dialog.vue +125 -0
  48. package/packages/workflow-editor/src/properties-editors/common/notice-reminder.vue +72 -0
  49. package/packages/workflow-editor/src/properties-editors/common/notice.vue +101 -0
  50. package/packages/workflow-editor/src/properties-editors/common/reminder.vue +185 -0
  51. package/packages/workflow-editor/src/properties-editors/common/select-mail-template.vue +83 -0
  52. package/packages/workflow-editor/src/properties-editors/common/standard-fields.vue +65 -0
  53. package/packages/workflow-editor/src/properties-editors/common/system-role-tree-inline.vue +355 -0
  54. package/packages/workflow-editor/src/properties-editors/common/system-role-tree.vue +63 -0
  55. package/packages/workflow-editor/src/properties-editors/common/task-title.vue +148 -0
  56. package/packages/workflow-editor/src/properties-editors/common/transactor-settings.vue +275 -0
  57. package/packages/workflow-editor/src/properties-editors/common/user-selection.vue +386 -0
  58. package/packages/workflow-editor/src/properties-editors/common/value-selection-dialog.vue +209 -0
  59. package/packages/workflow-editor/src/properties-editors/common/variables.vue +135 -0
  60. package/packages/workflow-editor/src/properties-editors/copy-task/basic-properties.vue +90 -0
  61. package/packages/workflow-editor/src/properties-editors/copy-task/permission-settings.vue +155 -0
  62. package/packages/workflow-editor/src/properties-editors/copy-task.vue +94 -0
  63. package/packages/workflow-editor/src/properties-editors/decision.vue +90 -0
  64. package/packages/workflow-editor/src/properties-editors/fork.vue +72 -0
  65. package/packages/workflow-editor/src/properties-editors/human-decision.vue +44 -0
  66. package/packages/workflow-editor/src/properties-editors/human-task/additional-condition-dialog.vue +60 -0
  67. package/packages/workflow-editor/src/properties-editors/human-task/basic-properties.vue +160 -0
  68. package/packages/workflow-editor/src/properties-editors/human-task/componentsConfigUtil.js +291 -0
  69. package/packages/workflow-editor/src/properties-editors/human-task/custom-actions.vue +249 -0
  70. package/packages/workflow-editor/src/properties-editors/human-task/editable-child-field-setting.vue +392 -0
  71. package/packages/workflow-editor/src/properties-editors/human-task/editable-child-fields.vue +241 -0
  72. package/packages/workflow-editor/src/properties-editors/human-task/editable-field-selection.vue +220 -0
  73. package/packages/workflow-editor/src/properties-editors/human-task/editable-fields.vue +204 -0
  74. package/packages/workflow-editor/src/properties-editors/human-task/events.vue +59 -0
  75. package/packages/workflow-editor/src/properties-editors/human-task/permission-settings.vue +207 -0
  76. package/packages/workflow-editor/src/properties-editors/human-task/selection-conditions.vue +390 -0
  77. package/packages/workflow-editor/src/properties-editors/human-task.vue +109 -0
  78. package/packages/workflow-editor/src/properties-editors/join.vue +44 -0
  79. package/packages/workflow-editor/src/properties-editors/process/basic-properties.vue +273 -0
  80. package/packages/workflow-editor/src/properties-editors/process/events.vue +76 -0
  81. package/packages/workflow-editor/src/properties-editors/process/notice-settings.vue +60 -0
  82. package/packages/workflow-editor/src/properties-editors/process/parameter-settings.vue +95 -0
  83. package/packages/workflow-editor/src/properties-editors/process/permission-settings.vue +28 -0
  84. package/packages/workflow-editor/src/properties-editors/process/selectPage.vue +81 -0
  85. package/packages/workflow-editor/src/properties-editors/process.vue +115 -0
  86. package/packages/workflow-editor/src/properties-editors/subprocess/basic-properties.vue +199 -0
  87. package/packages/workflow-editor/src/properties-editors/subprocess/events.vue +26 -0
  88. package/packages/workflow-editor/src/properties-editors/subprocess/field-mappings.vue +206 -0
  89. package/packages/workflow-editor/src/properties-editors/subprocess/transactor-settings.vue +64 -0
  90. package/packages/workflow-editor/src/properties-editors/subprocess.vue +79 -0
  91. package/packages/workflow-editor/src/properties-editors/transition/basic-properties.vue +53 -0
  92. package/packages/workflow-editor/src/properties-editors/transition.vue +74 -0
  93. package/packages/workflow-editor/src/properties-editors/user-condition.js +183 -0
  94. package/packages/workflow-editor/src/store/getters.js +27 -0
  95. package/packages/workflow-editor/src/store/workflow-editor.js +125 -0
  96. package/packages/workflow-editor/src/taches/auto-task.vue +99 -0
  97. package/packages/workflow-editor/src/taches/common-methods.js +21 -0
  98. package/packages/workflow-editor/src/taches/copy-task.vue +99 -0
  99. package/packages/workflow-editor/src/taches/custom-task.vue +88 -0
  100. package/packages/workflow-editor/src/taches/decision.vue +102 -0
  101. package/packages/workflow-editor/src/taches/end.vue +76 -0
  102. package/packages/workflow-editor/src/taches/fork.vue +102 -0
  103. package/packages/workflow-editor/src/taches/human-decision.vue +102 -0
  104. package/packages/workflow-editor/src/taches/human-task.vue +113 -0
  105. package/packages/workflow-editor/src/taches/join.vue +91 -0
  106. package/packages/workflow-editor/src/taches/joint.vue +177 -0
  107. package/packages/workflow-editor/src/taches/start.vue +76 -0
  108. package/packages/workflow-editor/src/taches/subprocess.vue +99 -0
  109. package/packages/workflow-editor/src/taches/tache-resizer.vue +80 -0
  110. package/packages/workflow-editor/src/transitions/broken-line.vue +91 -0
  111. package/packages/workflow-editor/src/transitions/curve-line.vue +91 -0
  112. package/packages/workflow-editor/src/transitions/straight-line.vue +26 -0
  113. package/packages/workflow-editor/src/transitions/transition.vue +212 -0
  114. package/packages/workflow-editor/src/transitions/virtual-transition.vue +43 -0
  115. package/packages/workflow-editor/src/util.js +489 -0
  116. package/packages/workflow-editor/src/workflow-editor.vue +607 -0
  117. package/packages/workflow-editor/src/workflow-history.vue +153 -0
  118. package/src/i18n/i18n.js +1 -1
  119. package/src/i18n/langs/cn.js +43 -24
  120. package/src/i18n/langs/en.js +23 -7
@@ -0,0 +1,392 @@
1
+ <template>
2
+ <div>
3
+ <div>
4
+ <el-row>
5
+ <el-checkbox-group v-model="actionArr" @change="changeActionArr">
6
+ <el-col :span="8">
7
+ <el-checkbox label="add">
8
+ {{ $t('workflowEditor.condition.rowsCanBeAdded') }}
9
+ <i v-if="actionArr && actionArr.indexOf('add') !== -1" class="el-icon-s-tools" @click="showButtonVisible('add')" />
10
+ </el-checkbox>
11
+ </el-col>
12
+ <el-col :span="8">
13
+ <el-checkbox label="delete">
14
+ {{ $t('workflowEditor.condition.deleteLine') }}
15
+ <i v-if="actionArr && actionArr.indexOf('delete') !== -1" class="el-icon-s-tools" @click="showButtonVisible('delete')" />
16
+ </el-checkbox>
17
+ </el-col>
18
+ <el-col :span="8">
19
+ <el-checkbox label="update">
20
+ {{ $t('workflowEditor.condition.modifiableHistoricalData') }}
21
+ <i v-if="actionArr && actionArr.indexOf('update') !== -1" class="el-icon-s-tools" @click="showButtonVisible('update')" />
22
+ </el-checkbox>
23
+ </el-col>
24
+ </el-checkbox-group>
25
+ <!-- <el-col :span="4">
26
+ <el-radio v-model="permission" label="fieldControl" @change="combinationParameters()">
27
+ {{ $t('workflowEditor.condition.controlByField') }}
28
+ </el-radio>
29
+ </el-col>
30
+ <el-col :span="4">
31
+ <el-radio v-model="permission" label="allForbidden" @change="combinationParameters()">
32
+ {{ $t('workflowEditor.condition.allReadOnly') }}
33
+ </el-radio>
34
+ </el-col>
35
+ <el-col :span="4">
36
+ <el-radio v-model="permission" label="allRequired" @change="combinationParameters()">
37
+ {{ $t('workflowEditor.condition.allRequired') }}
38
+ </el-radio>
39
+ </el-col> -->
40
+ </el-row>
41
+ <selection-conditions v-if="showButtonVisibleFlag" :attribute-map="subtableConditionItem" :condition-list="buttonVisibleCon.condition" :parent-condition="buttonVisibleCon.parentCondition" :user-condition="buttonVisibleCon.userCondition" :is-add="buttonType && buttonType=== 'add'" @close="saveButtonVisible" />
42
+ </div>
43
+ <div>
44
+ <el-row>
45
+ <el-button type="primary" size="mini" plain icon="el-icon-circle-plus-outline" @click="add">
46
+ {{ $t('workflowEditorPublicModel.add') }}
47
+ </el-button>
48
+ <el-button type="primary" size="mini" plain icon="el-icon-delete" @click="remove">
49
+ {{ $t('workflowEditorPublicModel.delete') }}
50
+ </el-button>
51
+ </el-row>
52
+ <el-table
53
+ ref="table"
54
+ :data="fieldArr"
55
+ border
56
+ highlight-current-row
57
+ style="width: 100%"
58
+ @selection-change="handleSelectionChange"
59
+ @current-change="handleCurrentChange"
60
+ >
61
+ <el-table-column
62
+ type="selection"
63
+ width="55"
64
+ />
65
+ <el-table-column
66
+ type="index"
67
+ width="50"
68
+ />
69
+ <el-table-column
70
+ prop="name"
71
+ :label="$t('workflowEditor.task.propertyName')"
72
+ width="280"
73
+ >
74
+ <template slot-scope="scope">
75
+ <el-select v-model="scope.row.name" size="small" filterable @change="combinationParameters">
76
+ <el-option :label="$t('workflowEditor.condition.allFields')" value="all_fields" />
77
+ <el-option
78
+ v-for="item in attributeArr"
79
+ :key="item.value"
80
+ :label="item.label"
81
+ :value="item.value"
82
+ />
83
+ </el-select>
84
+ </template>
85
+ </el-table-column>
86
+ <el-table-column
87
+ prop="constraintRule"
88
+ :label="$t('workflowEditor.task.editingMethod')"
89
+ width="380"
90
+ >
91
+ <template slot-scope="scope">
92
+ <el-radio-group v-model="scope.row.constraintRule" @change="combinationParameters">
93
+ <el-radio label="REQUIRED">
94
+ {{ $t('workflowEditorMessage.mustFill') }}
95
+ </el-radio>
96
+ <el-radio label="READ_ONLY">
97
+ {{ $t('workflowEditorMessage.readOnly') }}
98
+ </el-radio>
99
+ </el-radio-group>
100
+ </template>
101
+ </el-table-column>
102
+ <el-table-column
103
+ prop="condition"
104
+ :label="$t('workflowEditor.task.condition')"
105
+ >
106
+ <template slot-scope="scope">
107
+ <i class="el-icon-s-tools" @click="selectCondition(scope.row)" />
108
+ <!-- <el-input
109
+ :value="formatConditionList(scope.row.condition)"
110
+ type="textarea"
111
+ autosize
112
+ @focus="selectCondition(scope.row)"
113
+ /> -->
114
+ </template>
115
+ </el-table-column>
116
+ </el-table>
117
+ <selection-conditions v-if="showAdditionalCondition" :attribute-map="subtableConditionItem" :condition-list="currentRow.condition" :parent-condition="currentRow.parentCondition" :user-condition="currentRow.userCondition" @close="savebuttonSetting" />
118
+ </div>
119
+ </div>
120
+ </template>
121
+
122
+ <script>
123
+ import { mapGetters } from 'vuex'
124
+ import selectionConditions from './selection-conditions'
125
+ import componentsConfigUtil from './componentsConfigUtil'
126
+
127
+ export default {
128
+ name: 'EditableChildFieldSetting',
129
+ components: {
130
+ selectionConditions
131
+ },
132
+ props: {
133
+ setting: {
134
+ type: Object,
135
+ default: null
136
+ },
137
+ tableName: {
138
+ type: String,
139
+ default: null
140
+ }
141
+ },
142
+ data() {
143
+ let actionArr = []
144
+ if (this.setting && this.setting.actionArr) {
145
+ actionArr = this.setting.actionArr
146
+ }
147
+ let fieldArr = []
148
+ if (this.setting && this.setting.fieldArr) {
149
+ fieldArr = this.setting.fieldArr
150
+ }
151
+ let actionVisibleConditionArr
152
+ if (this.setting && this.setting.visibleConditionArr) {
153
+ actionVisibleConditionArr = this.setting.visibleConditionArr
154
+ }
155
+ let modelName
156
+ if (this.setting && this.setting.modelName) {
157
+ modelName = this.setting.modelName
158
+ }
159
+ let sumPermission
160
+ if (this.setting && this.setting.sumPermission !== null) {
161
+ sumPermission = this.setting.sumPermission
162
+ }
163
+ return {
164
+ sumPermission,
165
+ subtableConditionItem: null,
166
+ attributeArr: null,
167
+ showAdditionalCondition: false,
168
+ currentRow: null,
169
+ multipleSelection: null,
170
+ actionArr,
171
+ fieldArr,
172
+ queryList: null,
173
+ fieldMap: null,
174
+ fieldNameMap: null,
175
+ actionVisibleConditionArr,
176
+ buttonType: null,
177
+ buttonVisibleCon: null,
178
+ showButtonVisibleFlag: false,
179
+ clickButton: false,
180
+ operationArr: [],
181
+ modelName
182
+ }
183
+ },
184
+ watch: {
185
+ setting: {
186
+ handler(newValue, oldValue) {
187
+ if (newValue && newValue.actionArr) {
188
+ this.actionArr = newValue.actionArr
189
+ }
190
+ if (newValue && newValue.fieldArr) {
191
+ this.fieldArr = newValue.fieldArr
192
+ }
193
+ if (newValue && newValue.actionVisibleConditionArr) {
194
+ this.actionVisibleConditionArr = newValue.actionVisibleConditionArr
195
+ }
196
+ this.modelName = newValue.modelName
197
+ this.sumPermission = newValue.sumPermission
198
+ this.combinationParameters()
199
+ },
200
+ deep: true
201
+ }
202
+ // permission: {
203
+ // handler(newValue, oldValue) {
204
+ // console.log(11111111111111)
205
+ // this.combinationParameters()
206
+ // }
207
+ // },
208
+ // actionArr: {
209
+ // handler(newValue, oldValue) {
210
+ // console.log(22222222222222)
211
+ // this.combinationParameters()
212
+ // }
213
+ // },
214
+ // fieldArr: {
215
+ // handler(newValue, oldValue) {
216
+ // console.log(333333333333333)
217
+ // this.combinationParameters()
218
+ // },
219
+ // deep: true
220
+ // },
221
+ // actionVisibleConditionArr: {
222
+ // handler(newValue, oldValue) {
223
+ // console.log(4444444444444444)
224
+ // this.combinationParameters()
225
+ // },
226
+ // deep: true
227
+ // }
228
+ },
229
+ computed: {
230
+ ...mapGetters('wfEditor', [
231
+ 'subtableConditionMap'
232
+ ])
233
+ },
234
+ created() {
235
+ if (this.subtableConditionMap) {
236
+ if (this.tableName) {
237
+ this.subtableConditionItem = this.subtableConditionMap[this.tableName]
238
+ this.getAttributeArr()
239
+ }
240
+ }
241
+ },
242
+ mounted() {
243
+ if (this.subtableConditionMap) {
244
+ if (this.tableName) {
245
+ this.subtableConditionItem = this.subtableConditionMap[this.tableName]
246
+ if (this.subtableConditionMap[this.tableName]) {
247
+ this.attributeArr = this.subtableConditionItem.attributeArr
248
+ }
249
+ }
250
+ }
251
+ },
252
+ methods: {
253
+ ...componentsConfigUtil,
254
+ getAttributeArr() {
255
+ if (this.subtableConditionItem && this.subtableConditionItem.attributeArr) {
256
+ this.queryList = this.subtableConditionItem.attributeArr
257
+ this.fieldMap = this.subtableConditionItem.fieldMap
258
+ this.fieldNameMap = this.subtableConditionItem.fieldNameMap
259
+ }
260
+ },
261
+ savebuttonSetting(param) {
262
+ if (param) {
263
+ this.$set(this.currentRow, 'condition', param.condition)
264
+ this.$set(this.currentRow, 'userCondition', param.userCondition)
265
+ this.$set(this.currentRow, 'parentCondition', param.parentCondition)
266
+ this.combinationParameters()
267
+ }
268
+ this.showAdditionalCondition = false
269
+ },
270
+ handleCurrentChange(val) {
271
+ this.currentRow = val
272
+ },
273
+ handleSelectionChange(val) {
274
+ this.multipleSelection = val
275
+ },
276
+ selectRow(row) {
277
+ this.$refs.table.setCurrentRow(row)
278
+ },
279
+ add() {
280
+ if (!this.fieldArr) {
281
+ this.fieldArr = []
282
+ }
283
+ this.fieldArr.push(
284
+ {
285
+ name: null,
286
+ constraintRule: null,
287
+ condition: null
288
+ }
289
+ )
290
+ this.combinationParameters()
291
+ },
292
+ getCurrentRowIndex() {
293
+ let index = -1
294
+ for (let i = 0; i < this.fieldArr.length; i++) {
295
+ if (this.fieldArr[i].name === this.currentRow.name) {
296
+ index = i
297
+ break
298
+ }
299
+ }
300
+ return index
301
+ },
302
+ remove() {
303
+ if (this.multipleSelection && this.multipleSelection.length > 0) {
304
+ for (var i = 0; i < this.multipleSelection.length; i++) {
305
+ const selectRow = this.multipleSelection[i]
306
+ this.selectRow(selectRow)
307
+ const index = this.getCurrentRowIndex()
308
+ this.fieldArr.splice(index, 1)
309
+ }
310
+ // this.$emit('input', this.selectedFields)
311
+ this.combinationParameters()
312
+ }
313
+ },
314
+ selectCondition(row) {
315
+ this.selectRow(row)
316
+ this.showAdditionalCondition = true
317
+ },
318
+ showButtonVisible(type) {
319
+ this.clickButton = true
320
+ this.buttonType = type
321
+ if (this.actionVisibleConditionArr && this.actionVisibleConditionArr[type]) {
322
+ this.buttonVisibleCon = this.actionVisibleConditionArr[type]
323
+ this.$set(this, 'buttonVisibleCon', this.actionVisibleConditionArr[type])
324
+ } else {
325
+ this.$set(this, 'buttonVisibleCon', {})
326
+ }
327
+ this.$set(this, 'showButtonVisibleFlag', true)
328
+ },
329
+ saveButtonVisible(param) {
330
+ if (param) {
331
+ if (!this.actionVisibleConditionArr) {
332
+ this.actionVisibleConditionArr = {}
333
+ }
334
+ this.$set(this.actionVisibleConditionArr, this.buttonType, param)
335
+ this.combinationParameters()
336
+ }
337
+ this.showButtonVisibleFlag = false
338
+ },
339
+ changeActionArr() {
340
+ if (this.clickButton) {
341
+ this.actionArr.push(this.buttonType)
342
+ this.clickButton = false
343
+ } else {
344
+ this.combinationParameters()
345
+ }
346
+ },
347
+ // 组合参数
348
+ combinationParameters() {
349
+ const subTableItem = {}
350
+ subTableItem.modelName = this.modelName
351
+ subTableItem.tableName = this.tableName
352
+ subTableItem.permission = this.sumPermission
353
+ const actions = []
354
+ if (this.actionArr && this.actionArr.length > 0) {
355
+ this.actionArr.forEach(type => {
356
+ const action = {}
357
+ action.name = type
358
+ if (this.actionVisibleConditionArr && this.actionVisibleConditionArr[type]) {
359
+ const param = this.actionVisibleConditionArr[type]
360
+ action.condition = this.dataToXml(param.condition)
361
+ action.parentCondition = param.parentCondition
362
+ action.userCondition = param.userCondition
363
+ }
364
+ actions.push(action)
365
+ })
366
+ subTableItem.action = actions
367
+ }
368
+ if (this.fieldArr && this.fieldArr.length > 0) {
369
+ const field = []
370
+ this.fieldArr.forEach(item => {
371
+ const fieldItem = {}
372
+ fieldItem.name = item.name
373
+ fieldItem.constraintRule = item.constraintRule
374
+ if (item.condition) {
375
+ fieldItem.condition = this.dataToXml(item.condition)
376
+ }
377
+ fieldItem.userCondition = item.userCondition
378
+ fieldItem.parentCondition = item.parentCondition
379
+ field.push(fieldItem)
380
+ })
381
+ subTableItem.field = field
382
+ }
383
+ console.log('触发combinationParameters', subTableItem)
384
+ this.$emit('combinationParameters', subTableItem)
385
+ }
386
+ }
387
+ }
388
+ </script>
389
+
390
+ <style lang="scss" scoped>
391
+
392
+ </style>
@@ -0,0 +1,241 @@
1
+ <template>
2
+ <div>
3
+ <el-card class="box-card">
4
+ <span v-for="(mapValue, key) in subtableConditionMap" :key="key">
5
+ <div slot="header" class="clearfix">
6
+ <el-row>
7
+ <el-col :span="12">
8
+ <span>{{ key }}</span>
9
+ </el-col>
10
+ <el-col v-if="selectedFieldMap[key]" :span="12">
11
+ <el-switch
12
+ v-model="selectedFieldMap[key].sumPermission"
13
+ :inactive-text="$t('workflowEditor.condition.accessControl')"
14
+ @change="changeSumPermission(key)"
15
+ />
16
+ </el-col>
17
+ </el-row>
18
+ <el-row>
19
+ <el-col>
20
+ <span v-if="selectedFieldMap[key] && selectedFieldMap[key].sumPermission">
21
+ <span style="color: cornflowerblue">{{ $t('workflowEditor.condition.formBindingModel') }}:</span>
22
+ <span style="padding-left:5px"><el-input v-model="selectedFieldMap[key].modelName" style="width:300px" /></span>
23
+ <el-button icon="el-icon-refresh" type="text" @click="refreshModelName(key)" />
24
+ </span>
25
+ </el-col>
26
+ </el-row>
27
+ <!-- <span>{{ selectedFieldMap }}</span> -->
28
+ </div>
29
+ <div v-if="selectedFieldMap[key] && selectedFieldMap[key].sumPermission">
30
+ <editable-child-field-setting :setting="selectedFieldMap[key]" :table-name="key" @combinationParameters="combinationParameters" />
31
+ </div>
32
+ </span>
33
+ </el-card>
34
+ </div>
35
+ </template>
36
+
37
+ <script>
38
+ import editableChildFieldSetting from './editable-child-field-setting'
39
+ import componentsConfigUtil from './componentsConfigUtil'
40
+ import { mapGetters } from 'vuex'
41
+ export default {
42
+ name: 'EditableChildFields',
43
+ components: {
44
+ editableChildFieldSetting
45
+ },
46
+ props: {
47
+ value: {
48
+ type: [Array, Object],
49
+ default: null
50
+ }
51
+ },
52
+ data() {
53
+ let selectedFields = []
54
+ if (this.value !== '' && this.value !== null && this.value !== undefined) {
55
+ if (Array.isArray(this.value)) {
56
+ selectedFields = this.value
57
+ } else {
58
+ // 只有一个字段时其实是field对象
59
+ selectedFields.push(this.value)
60
+ }
61
+ }
62
+ return {
63
+ selectedFields,
64
+ selectedFieldMap: {}
65
+ }
66
+ },
67
+ computed: {
68
+ ...mapGetters('wfEditor', [
69
+ 'subtableConditionMap'
70
+ ])
71
+ },
72
+ watch: {
73
+ },
74
+ created() {
75
+ if (this.selectedFields && this.selectedFields.length > 0) {
76
+ this.selectedFields.forEach(item => {
77
+ const sss = {}
78
+ const tableName = item.tableName
79
+ if (item.action) {
80
+ if (Array.isArray(item.action)) {
81
+ if (item.action.length > 0) {
82
+ const sssActionArr = []
83
+ const actionVisibleCondition = {}
84
+ item.action.forEach(item1 => {
85
+ sssActionArr.push(item1.name)
86
+ const param = {}
87
+ if (item1.condition) {
88
+ param.condition = this.xmlToData(item1.condition)
89
+ }
90
+ param.parentCondition = item1.parentCondition
91
+ param.userCondition = item1.userCondition
92
+ actionVisibleCondition[item1.name] = param
93
+ // actionVisibleCondition[item1.name] = item1.visibleCondition
94
+ })
95
+ sss.actionArr = sssActionArr
96
+ sss.visibleConditionArr = actionVisibleCondition
97
+ }
98
+ } else {
99
+ const sssActionArr = []
100
+ const actionVisibleCondition = {}
101
+ sssActionArr.push(item.action.name)
102
+ const param = {}
103
+ if (item.action.condition) {
104
+ param.condition = this.xmlToData(item.action.condition)
105
+ }
106
+ param.parentCondition = item.action.parentCondition
107
+ param.userCondition = item.action.userCondition
108
+ actionVisibleCondition[item.action.name] = param
109
+ sss.actionArr = sssActionArr
110
+ sss.visibleConditionArr = actionVisibleCondition
111
+ }
112
+ }
113
+ if (item.field) {
114
+ if (Array.isArray(item.field)) {
115
+ if (item.field.length > 0) {
116
+ const sssFieldArr = []
117
+ item.field.forEach(item2 => {
118
+ const fieldItem = {}
119
+ fieldItem.name = item2.name
120
+ fieldItem.constraintRule = item2.constraintRule
121
+ fieldItem.condition = this.xmlToData(item2.condition)
122
+ fieldItem.userCondition = item2.userCondition
123
+ fieldItem.parentCondition = item2.parentCondition
124
+ sssFieldArr.push(fieldItem)
125
+ })
126
+ sss.fieldArr = sssFieldArr
127
+ }
128
+ } else {
129
+ const sssFieldArr = []
130
+ const fieldItem = {}
131
+ fieldItem.name = item.field.name
132
+ fieldItem.constraintRule = item.field.constraintRule
133
+ fieldItem.condition = this.xmlToData(item.field.condition)
134
+ fieldItem.userCondition = item.field.userCondition
135
+ fieldItem.parentCondition = item.field.parentCondition
136
+ sssFieldArr.push(fieldItem)
137
+ sss.fieldArr = sssFieldArr
138
+ }
139
+ }
140
+ if (item.modelName) {
141
+ sss.modelName = item.modelName
142
+ } else {
143
+ sss.modelName = null
144
+ }
145
+ if (item.permission) {
146
+ sss.sumPermission = item.permission
147
+ } else {
148
+ sss.sumPermission = false
149
+ }
150
+ this.$set(this.selectedFieldMap, tableName, sss)
151
+ })
152
+ }
153
+ if (this.subtableConditionMap) {
154
+ for (var key in this.subtableConditionMap) {
155
+ if (!this.selectedFieldMap[key]) {
156
+ const sss = {}
157
+ sss.tableName = key
158
+ sss.modelName = this.subtableConditionMap[key].modelName
159
+ sss.sumPermission = false
160
+ this.$set(this.selectedFieldMap, key, sss)
161
+ }
162
+ }
163
+ }
164
+ },
165
+ mounted() {
166
+
167
+ },
168
+ methods: {
169
+ ...componentsConfigUtil,
170
+ combinationParameters(subTableItem) {
171
+ if (subTableItem && subTableItem.tableName) {
172
+ if (this.selectedFields && this.selectedFields.length > 0) {
173
+ const index = this.selectedFields.findIndex((fie) => fie.tableName === subTableItem.tableName)
174
+ if (index !== -1) {
175
+ // this.selectedFields[index] = subTableItem
176
+ this.$set(this.selectedFields, index, subTableItem)
177
+ } else {
178
+ this.selectedFields.push(subTableItem)
179
+ }
180
+ } else {
181
+ this.selectedFields = []
182
+ this.selectedFields.push(subTableItem)
183
+ }
184
+ this.$emit('input', this.selectedFields)
185
+ }
186
+ },
187
+ refreshModelName(key) {
188
+ if (this.subtableConditionMap && this.subtableConditionMap[key] && this.subtableConditionMap[key].modelName) {
189
+ if (this.selectedFieldMap[key]) {
190
+ const sss = this.selectedFieldMap[key]
191
+ sss.modelName = this.subtableConditionMap[key].modelName
192
+ } else {
193
+ const sss = {}
194
+ sss.modelName = this.subtableConditionMap[key].modelName
195
+ this.$set(this.selectedFieldMap, key, sss)
196
+ }
197
+ this.$message({
198
+ showClose: true,
199
+ type: 'success',
200
+ message: this.$t('workflowEditorMessage.updateSuccessful')
201
+ })
202
+ }
203
+ },
204
+ changeSumPermission(key) {
205
+ if (key && this.selectedFieldMap[key]) {
206
+ if (!this.selectedFields) {
207
+ this.$set(this, 'selectedFields', [])
208
+ }
209
+ if (this.selectedFieldMap[key].sumPermission === false) {
210
+ const index = this.selectedFields.findIndex((fie) => fie.tableName === key)
211
+ if (index !== null && index !== undefined && index !== -1) {
212
+ // this.$delete(this.selectedFields, index)
213
+ this.$set(this.selectedFields[index], 'permission', false)
214
+ } else {
215
+ this.$set(this.selectedFields, this.selectedFields.length, {
216
+ permission: false,
217
+ tableName: key
218
+ })
219
+ }
220
+ } else {
221
+ const index = this.selectedFields.findIndex((fie) => fie.tableName === key)
222
+ if (index !== null && index !== undefined && index !== -1) {
223
+ // this.$delete(this.selectedFields, index)
224
+ this.$set(this.selectedFields[index], 'permission', true)
225
+ } else {
226
+ this.$set(this.selectedFields, this.selectedFields.length, {
227
+ permission: true,
228
+ tableName: key
229
+ })
230
+ }
231
+ }
232
+ }
233
+ this.$emit('input', this.selectedFields)
234
+ }
235
+ }
236
+ }
237
+ </script>
238
+
239
+ <style lang="scss" scoped>
240
+
241
+ </style>