workflow-editor 0.9.67-dw → 0.9.67

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 (114) 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 +528 -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/copy-task.js +67 -0
  12. package/packages/workflow-editor/src/json-object-templates/decision.js +11 -0
  13. package/packages/workflow-editor/src/json-object-templates/end.js +14 -0
  14. package/packages/workflow-editor/src/json-object-templates/fork.js +10 -0
  15. package/packages/workflow-editor/src/json-object-templates/human-decision.js +9 -0
  16. package/packages/workflow-editor/src/json-object-templates/human-task.js +199 -0
  17. package/packages/workflow-editor/src/json-object-templates/join.js +10 -0
  18. package/packages/workflow-editor/src/json-object-templates/process.js +98 -0
  19. package/packages/workflow-editor/src/json-object-templates/start.js +13 -0
  20. package/packages/workflow-editor/src/json-object-templates/subprocess.js +30 -0
  21. package/packages/workflow-editor/src/json-object-templates/transition.js +26 -0
  22. package/packages/workflow-editor/src/main/admin-save-dialog.vue +66 -0
  23. package/packages/workflow-editor/src/main/canvas.vue +479 -0
  24. package/packages/workflow-editor/src/main/context-menu.vue +132 -0
  25. package/packages/workflow-editor/src/main/icon-svg.vue +32 -0
  26. package/packages/workflow-editor/src/main/selection-region.vue +66 -0
  27. package/packages/workflow-editor/src/main/tache-history-tooltip.vue +38 -0
  28. package/packages/workflow-editor/src/main/tache-name-input.vue +19 -0
  29. package/packages/workflow-editor/src/main/tache-subprocess-history-dialog.vue +35 -0
  30. package/packages/workflow-editor/src/main/toolbox.vue +60 -0
  31. package/packages/workflow-editor/src/main/wf-history-canvas.vue +302 -0
  32. package/packages/workflow-editor/src/process-json.js +622 -0
  33. package/packages/workflow-editor/src/process-service.js +31 -0
  34. package/packages/workflow-editor/src/properties-editors/common/additional-condition-utils.js +531 -0
  35. package/packages/workflow-editor/src/properties-editors/common/additional-condition.vue +276 -0
  36. package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields-utils.js +34 -0
  37. package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields.vue +239 -0
  38. package/packages/workflow-editor/src/properties-editors/common/common-notice-tool.vue +47 -0
  39. package/packages/workflow-editor/src/properties-editors/common/common-user-condition.vue +241 -0
  40. package/packages/workflow-editor/src/properties-editors/common/form-fields-utils.js +23 -0
  41. package/packages/workflow-editor/src/properties-editors/common/form-fields.vue +116 -0
  42. package/packages/workflow-editor/src/properties-editors/common/i18n-input.vue +75 -0
  43. package/packages/workflow-editor/src/properties-editors/common/i18n-set-dialog.vue +125 -0
  44. package/packages/workflow-editor/src/properties-editors/common/notice.vue +98 -0
  45. package/packages/workflow-editor/src/properties-editors/common/reminder.vue +179 -0
  46. package/packages/workflow-editor/src/properties-editors/common/select-mail-template.vue +83 -0
  47. package/packages/workflow-editor/src/properties-editors/common/standard-fields.vue +65 -0
  48. package/packages/workflow-editor/src/properties-editors/common/system-role-tree-inline.vue +355 -0
  49. package/packages/workflow-editor/src/properties-editors/common/system-role-tree.vue +63 -0
  50. package/packages/workflow-editor/src/properties-editors/common/task-title.vue +148 -0
  51. package/packages/workflow-editor/src/properties-editors/common/transactor-settings.vue +233 -0
  52. package/packages/workflow-editor/src/properties-editors/common/user-selection.vue +386 -0
  53. package/packages/workflow-editor/src/properties-editors/common/value-selection-dialog.vue +209 -0
  54. package/packages/workflow-editor/src/properties-editors/common/variables.vue +135 -0
  55. package/packages/workflow-editor/src/properties-editors/copy-task/basic-properties.vue +90 -0
  56. package/packages/workflow-editor/src/properties-editors/copy-task/permission-settings.vue +155 -0
  57. package/packages/workflow-editor/src/properties-editors/copy-task.vue +80 -0
  58. package/packages/workflow-editor/src/properties-editors/decision.vue +90 -0
  59. package/packages/workflow-editor/src/properties-editors/fork.vue +72 -0
  60. package/packages/workflow-editor/src/properties-editors/human-decision.vue +44 -0
  61. package/packages/workflow-editor/src/properties-editors/human-task/additional-condition-dialog.vue +60 -0
  62. package/packages/workflow-editor/src/properties-editors/human-task/basic-properties.vue +156 -0
  63. package/packages/workflow-editor/src/properties-editors/human-task/componentsConfigUtil.js +291 -0
  64. package/packages/workflow-editor/src/properties-editors/human-task/custom-actions.vue +249 -0
  65. package/packages/workflow-editor/src/properties-editors/human-task/editable-child-field-setting.vue +392 -0
  66. package/packages/workflow-editor/src/properties-editors/human-task/editable-child-fields.vue +241 -0
  67. package/packages/workflow-editor/src/properties-editors/human-task/editable-field-selection.vue +220 -0
  68. package/packages/workflow-editor/src/properties-editors/human-task/editable-fields.vue +204 -0
  69. package/packages/workflow-editor/src/properties-editors/human-task/events.vue +59 -0
  70. package/packages/workflow-editor/src/properties-editors/human-task/permission-settings.vue +207 -0
  71. package/packages/workflow-editor/src/properties-editors/human-task/selection-conditions.vue +390 -0
  72. package/packages/workflow-editor/src/properties-editors/human-task.vue +103 -0
  73. package/packages/workflow-editor/src/properties-editors/join.vue +44 -0
  74. package/packages/workflow-editor/src/properties-editors/process/basic-properties.vue +273 -0
  75. package/packages/workflow-editor/src/properties-editors/process/events.vue +76 -0
  76. package/packages/workflow-editor/src/properties-editors/process/notice-settings.vue +60 -0
  77. package/packages/workflow-editor/src/properties-editors/process/parameter-settings.vue +95 -0
  78. package/packages/workflow-editor/src/properties-editors/process/permission-settings.vue +28 -0
  79. package/packages/workflow-editor/src/properties-editors/process/selectPage.vue +81 -0
  80. package/packages/workflow-editor/src/properties-editors/process.vue +109 -0
  81. package/packages/workflow-editor/src/properties-editors/subprocess/basic-properties.vue +187 -0
  82. package/packages/workflow-editor/src/properties-editors/subprocess/events.vue +26 -0
  83. package/packages/workflow-editor/src/properties-editors/subprocess/field-mappings.vue +206 -0
  84. package/packages/workflow-editor/src/properties-editors/subprocess/transactor-settings.vue +64 -0
  85. package/packages/workflow-editor/src/properties-editors/subprocess.vue +79 -0
  86. package/packages/workflow-editor/src/properties-editors/transition/basic-properties.vue +53 -0
  87. package/packages/workflow-editor/src/properties-editors/transition.vue +74 -0
  88. package/packages/workflow-editor/src/properties-editors/user-condition.js +177 -0
  89. package/packages/workflow-editor/src/store/getters.js +27 -0
  90. package/packages/workflow-editor/src/store/workflow-editor.js +125 -0
  91. package/packages/workflow-editor/src/taches/common-methods.js +21 -0
  92. package/packages/workflow-editor/src/taches/copy-task.vue +99 -0
  93. package/packages/workflow-editor/src/taches/custom-task.vue +88 -0
  94. package/packages/workflow-editor/src/taches/decision.vue +102 -0
  95. package/packages/workflow-editor/src/taches/end.vue +76 -0
  96. package/packages/workflow-editor/src/taches/fork.vue +102 -0
  97. package/packages/workflow-editor/src/taches/human-decision.vue +102 -0
  98. package/packages/workflow-editor/src/taches/human-task.vue +113 -0
  99. package/packages/workflow-editor/src/taches/join.vue +91 -0
  100. package/packages/workflow-editor/src/taches/joint.vue +177 -0
  101. package/packages/workflow-editor/src/taches/start.vue +76 -0
  102. package/packages/workflow-editor/src/taches/subprocess.vue +99 -0
  103. package/packages/workflow-editor/src/taches/tache-resizer.vue +80 -0
  104. package/packages/workflow-editor/src/transitions/broken-line.vue +91 -0
  105. package/packages/workflow-editor/src/transitions/curve-line.vue +91 -0
  106. package/packages/workflow-editor/src/transitions/straight-line.vue +26 -0
  107. package/packages/workflow-editor/src/transitions/transition.vue +212 -0
  108. package/packages/workflow-editor/src/transitions/virtual-transition.vue +43 -0
  109. package/packages/workflow-editor/src/util.js +493 -0
  110. package/packages/workflow-editor/src/workflow-editor.vue +605 -0
  111. package/packages/workflow-editor/src/workflow-history.vue +153 -0
  112. package/src/i18n/i18n.js +1 -1
  113. package/src/i18n/langs/cn.js +6 -1
  114. package/src/i18n/langs/en.js +6 -1
@@ -0,0 +1,249 @@
1
+ <template>
2
+ <div>
3
+ <el-row>
4
+ <el-button type="primary" size="mini" plain icon="el-icon-circle-plus-outline" @click="add">
5
+ {{ $t('workflowEditorPublicModel.add') }}
6
+ </el-button>
7
+ <el-button type="primary" size="mini" plain icon="el-icon-delete" @click="remove">
8
+ {{ $t('workflowEditorPublicModel.delete') }}
9
+ </el-button>
10
+ <el-table
11
+ ref="table"
12
+ :data="actions"
13
+ row-key="type"
14
+ border
15
+ highlight-current-row
16
+ style="width: 100%"
17
+ @current-change="handleCurrentChange"
18
+ >
19
+ <el-table-column
20
+ type="index"
21
+ />
22
+ <el-table-column
23
+ :label="$t('workflowEditor.task.operationType')"
24
+ width="180"
25
+ >
26
+ <template slot-scope="scope">
27
+ <el-select v-model="scope.row.type" @change="isDuplicated">
28
+ <el-option
29
+ v-for="item in actionTypes"
30
+ :key="item.id"
31
+ :value="item.type"
32
+ :label="item.label"
33
+ />
34
+ </el-select>
35
+ </template>
36
+ </el-table-column>
37
+ <el-table-column
38
+ prop="label"
39
+ :label="$t('workflowEditor.task.name')"
40
+ width="180"
41
+ >
42
+ <template slot-scope="scope">
43
+ <el-input v-model="scope.row.label" />
44
+ </template>
45
+ </el-table-column>
46
+ <el-table-column
47
+ prop="visible"
48
+ :label="$t('workflowEditor.task.visibleOrNot')"
49
+ >
50
+ <template slot-scope="scope">
51
+ <el-checkbox v-model="scope.row.visible" />
52
+ </template>
53
+ </el-table-column>
54
+ <el-table-column
55
+ prop="condition"
56
+ :label="$t('workflowEditor.task.condition')"
57
+ >
58
+ <template slot-scope="scope">
59
+ <el-input
60
+ :value="formatCondition(scope.row.condition)"
61
+ type="textarea"
62
+ autosize
63
+ @focus="selectCondition(scope.row)"
64
+ />
65
+ </template>
66
+ </el-table-column>
67
+ </el-table>
68
+ </el-row>
69
+ <additional-condition-dialog v-if="showAdditionalCondition" v-model="currentRow.condition" @close="showAdditionalCondition=false" />
70
+ </div>
71
+ </template>
72
+ <script>
73
+ import { getI18n } from '../../../../workflow-editor/src/util'
74
+ import AdditionalConditionDialog from './additional-condition-dialog'
75
+ import { parseCondition, displayCondition } from '../common/additional-condition-utils'
76
+ export default {
77
+ name: 'CustomActions',
78
+ components: {
79
+ AdditionalConditionDialog
80
+ },
81
+ props: {
82
+ value: {
83
+ type: Object,
84
+ default: null
85
+ }
86
+ },
87
+ data() {
88
+ const actions = []
89
+ let count = 1
90
+ if (this.value.action) {
91
+ if (Array.isArray(this.value.action)) {
92
+ for (const action of this.value.action) {
93
+ actions.push({
94
+ ...action,
95
+ id: count
96
+ })
97
+ count++
98
+ }
99
+ } else {
100
+ actions.push({
101
+ ...this.value.action,
102
+ id: count
103
+ })
104
+ count++
105
+ }
106
+ }
107
+ return {
108
+ actions,
109
+ actionTypes: [{
110
+ type: 'SAVE',
111
+ label: getI18n().t('workflowEditor.task.save')
112
+ }, {
113
+ type: 'SUBMIT',
114
+ label: getI18n().t('workflowEditor.task.submission')
115
+ }, {
116
+ type: 'APPROVE',
117
+ label: getI18n().t('workflowEditor.task.agree')
118
+ }, {
119
+ type: 'REFUSE',
120
+ label: getI18n().t('workflowEditor.task.disagree')
121
+ }, {
122
+ type: 'AGREEMENT',
123
+ label: getI18n().t('workflowEditor.task.favor')
124
+ }, {
125
+ type: 'OPPOSE',
126
+ label: getI18n().t('workflowEditor.task.opposition')
127
+ }, {
128
+ type: 'KIKEN',
129
+ label: getI18n().t('workflowEditor.task.waiver')
130
+ }, {
131
+ type: 'DRAW',
132
+ label: getI18n().t('workflowEditor.task.receive')
133
+ }, {
134
+ type: 'ABANDON_DRAW',
135
+ label: getI18n().t('workflowEditor.task.giveUp')
136
+ }, {
137
+ type: 'ADD_SIGN',
138
+ label: getI18n().t('workflowEditor.task.additionalSignature')
139
+ }, {
140
+ type: 'REMOVE_SIGN',
141
+ label: getI18n().t('workflowEditor.task.reductionOfSignature')
142
+ }, {
143
+ type: 'ASSIGN_TASK',
144
+ label: getI18n().t('workflowEditor.task.assignTask')
145
+ }, {
146
+ type: 'COPY',
147
+ label: getI18n().t('workflowEditor.task.copyTask')
148
+ }, {
149
+ type: 'GET_BACK_BUTTON',
150
+ label: getI18n().t('workflowEditor.task.retrieveTask')
151
+ }, {
152
+ type: 'READED',
153
+ label: getI18n().t('workflowEditor.task.readTask')
154
+ }, {
155
+ type: 'EXPORT_REPORT',
156
+ label: getI18n().t('workflowEditor.task.exportReport')
157
+ }],
158
+ currentRow: null,
159
+ count,
160
+ showAdditionalCondition: false
161
+ }
162
+ },
163
+ mounted() {
164
+ if (this.actions.length > 0) {
165
+ this.selectRow(this.actions[this.actions.length - 1])
166
+ }
167
+ this.$watch('actions', function(newVal, oldVal) {
168
+ const actions = []
169
+ for (const action of this.actions) {
170
+ const row = {
171
+ ...action
172
+ }
173
+ delete row['id']
174
+ actions.push(row)
175
+ }
176
+ this.$emit('input', { action: actions })
177
+ }, {
178
+ deep: true
179
+ })
180
+ },
181
+ methods: {
182
+ selectRow(row) {
183
+ this.$refs.table.setCurrentRow(row)
184
+ },
185
+ getRowIndex(row) {
186
+ for (let i = 0; i < this.actions.length; i++) {
187
+ if (this.actions[i].id === row.id) {
188
+ return i
189
+ }
190
+ }
191
+ return -1
192
+ },
193
+ handleCurrentChange(val) {
194
+ this.currentRow = val
195
+ },
196
+ isDuplicated(val) {
197
+ const index = this.getRowIndex(this.currentRow)
198
+ console.log('index:' + index)
199
+ for (let i = 0; i < this.actions.length; i++) {
200
+ if (i === index) continue
201
+ if (this.actions[i].type === val) {
202
+ this.$alert(this.$t('workflowEditorMessage.duplicateOperationTypeWithLinePleaseReselect', { row: (i + 1) }))
203
+ this.currentRow.type = ''
204
+ }
205
+ }
206
+ },
207
+ add() {
208
+ for (let i = 0; i < this.actions.length; i++) {
209
+ const action = this.actions[i]
210
+ if (action.type === '' || action.label === '') {
211
+ this.$alert(this.$t('workflowEditorMessage.theOperationTypeOrNameInLineIsEmpty', { row: (i + 1) }))
212
+ return
213
+ }
214
+ }
215
+ const newRow = {
216
+ id: this.count,
217
+ type: '',
218
+ label: '',
219
+ visible: true,
220
+ condition: ''
221
+ }
222
+ this.actions.push(newRow)
223
+ this.selectRow(newRow)
224
+ this.count++
225
+ },
226
+ remove() {
227
+ let index = this.getRowIndex(this.currentRow)
228
+ this.actions.splice(index, 1)
229
+ if (this.actions.length > 0) {
230
+ index = (index <= (this.actions.length - 1) ? index : (this.actions.length - 1))
231
+ this.$refs.table.setCurrentRow(this.actions[index])
232
+ }
233
+ },
234
+ formatCondition(value) {
235
+ if (value === '' || !value) return this.$t('workflowEditor.task.nothing')
236
+ const conditions = []
237
+ parseCondition(conditions, value)
238
+ return displayCondition(conditions)
239
+ },
240
+ selectCondition(row) {
241
+ this.selectRow(row)
242
+ if (!this.currentRow) {
243
+ this.$set(this.currentRow, 'condition', '')
244
+ }
245
+ this.showAdditionalCondition = true
246
+ }
247
+ }
248
+ }
249
+ </script>
@@ -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>