workflow-editor 0.0.80-up → 0.0.81-up-tmp1

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 (175) hide show
  1. package/dist/index.full.min.js +3237 -0
  2. package/dist/style.css +1 -0
  3. package/es/_virtual/FileSaver.min.mjs +4 -0
  4. package/es/_virtual/___vite-browser-external.mjs +6 -0
  5. package/es/_virtual/__vite-browser-external.mjs +4 -0
  6. package/es/_virtual/_commonjsHelpers.mjs +30 -0
  7. package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
  8. package/es/_virtual/clipboard.mjs +4 -0
  9. package/es/_virtual/dayjs.min.mjs +4 -0
  10. package/es/_virtual/index.mjs +4 -0
  11. package/es/_virtual/nprogress.mjs +4 -0
  12. package/es/_virtual/prism.mjs +4 -0
  13. package/es/_virtual/sax.mjs +4 -0
  14. package/es/_virtual/string_decoder.mjs +4 -0
  15. package/es/_virtual/tinymce.mjs +4 -0
  16. package/es/_virtual/weekOfYear.mjs +4 -0
  17. package/es/index.mjs +20 -0
  18. package/es/plugins/formValidatorUtil.mjs +391 -0
  19. package/es/plugins/index.mjs +9 -0
  20. package/es/style.css +1 -0
  21. package/es/vite.svg +1 -0
  22. package/es/workflow-editor/index.mjs +14 -0
  23. package/lib/_virtual/FileSaver.min.cjs +1 -0
  24. package/lib/_virtual/___vite-browser-external.cjs +1 -0
  25. package/lib/_virtual/__vite-browser-external.cjs +1 -0
  26. package/lib/_virtual/_commonjsHelpers.cjs +1 -0
  27. package/lib/_virtual/_plugin-vue_export-helper.cjs +1 -0
  28. package/lib/_virtual/clipboard.cjs +1 -0
  29. package/lib/_virtual/dayjs.min.cjs +1 -0
  30. package/lib/_virtual/index.cjs +1 -0
  31. package/lib/_virtual/nprogress.cjs +1 -0
  32. package/lib/_virtual/prism.cjs +1 -0
  33. package/lib/_virtual/sax.cjs +1 -0
  34. package/lib/_virtual/string_decoder.cjs +1 -0
  35. package/lib/_virtual/tinymce.cjs +1 -0
  36. package/lib/_virtual/weekOfYear.cjs +1 -0
  37. package/lib/index.cjs +1 -0
  38. package/lib/plugins/formValidatorUtil.cjs +1 -0
  39. package/lib/plugins/index.cjs +1 -0
  40. package/lib/style.css +1 -0
  41. package/lib/workflow-editor/index.cjs +1 -0
  42. package/package.json +5 -3
  43. package/vite.config.js +44 -10
  44. package/lib/401-d594cba0.js +0 -101
  45. package/lib/404-c88c55f1.js +0 -26
  46. package/lib/authredirect-ae6e75b4.js +0 -10
  47. package/lib/iframe-page-f8737ba6.js +0 -33
  48. package/lib/index-369eae4a.js +0 -13
  49. package/lib/index-9b4d762a.js +0 -31387
  50. package/lib/tab-content-iframe-index-5455fdb0.js +0 -33
  51. package/lib/tab-content-index-5d75237c.js +0 -1241
  52. package/lib/tache-subprocess-history-26084654.js +0 -56
  53. package/lib/workflow-editor.css +0 -1
  54. package/lib/workflow-editor.js +0 -5
  55. package/lib/workflow-editor.umd.cjs +0 -85
  56. package/packages/index.js +0 -34
  57. package/packages/plugins/formValidatorUtil.js +0 -723
  58. package/packages/plugins/index.js +0 -8
  59. package/packages/workflow-editor/index.js +0 -14
  60. package/packages/workflow-editor/src/api.js +0 -7
  61. package/packages/workflow-editor/src/assets/tab-select.png +0 -0
  62. package/packages/workflow-editor/src/assets/tab-selectWhite.png +0 -0
  63. package/packages/workflow-editor/src/assets/wf-editor-icons.js +0 -2
  64. package/packages/workflow-editor/src/constant.js +0 -8
  65. package/packages/workflow-editor/src/json-object-templates/auto-task.js +0 -70
  66. package/packages/workflow-editor/src/json-object-templates/copy-task.js +0 -72
  67. package/packages/workflow-editor/src/json-object-templates/decision.js +0 -11
  68. package/packages/workflow-editor/src/json-object-templates/end.js +0 -14
  69. package/packages/workflow-editor/src/json-object-templates/fork.js +0 -10
  70. package/packages/workflow-editor/src/json-object-templates/human-decision.js +0 -9
  71. package/packages/workflow-editor/src/json-object-templates/human-task.js +0 -208
  72. package/packages/workflow-editor/src/json-object-templates/join.js +0 -10
  73. package/packages/workflow-editor/src/json-object-templates/process.js +0 -99
  74. package/packages/workflow-editor/src/json-object-templates/start.js +0 -13
  75. package/packages/workflow-editor/src/json-object-templates/subprocess.js +0 -31
  76. package/packages/workflow-editor/src/json-object-templates/transition.js +0 -26
  77. package/packages/workflow-editor/src/main/admin-save-dialog.vue +0 -67
  78. package/packages/workflow-editor/src/main/canvas.vue +0 -493
  79. package/packages/workflow-editor/src/main/context-menu.vue +0 -147
  80. package/packages/workflow-editor/src/main/icon-svg.vue +0 -32
  81. package/packages/workflow-editor/src/main/selection-region.vue +0 -66
  82. package/packages/workflow-editor/src/main/tache-history-tooltip.vue +0 -38
  83. package/packages/workflow-editor/src/main/tache-name-input.vue +0 -19
  84. package/packages/workflow-editor/src/main/tache-subprocess-history-dialog.vue +0 -40
  85. package/packages/workflow-editor/src/main/toolbox.vue +0 -60
  86. package/packages/workflow-editor/src/main/wf-history-canvas.vue +0 -309
  87. package/packages/workflow-editor/src/process-json.js +0 -624
  88. package/packages/workflow-editor/src/process-service.js +0 -69
  89. package/packages/workflow-editor/src/properties-editors/auto-task/basic-properties.vue +0 -81
  90. package/packages/workflow-editor/src/properties-editors/auto-task/permission-settings.vue +0 -155
  91. package/packages/workflow-editor/src/properties-editors/auto-task.vue +0 -74
  92. package/packages/workflow-editor/src/properties-editors/common/additional-condition-utils.js +0 -568
  93. package/packages/workflow-editor/src/properties-editors/common/additional-condition.vue +0 -320
  94. package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields-utils.js +0 -34
  95. package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields.vue +0 -239
  96. package/packages/workflow-editor/src/properties-editors/common/common-notice-tool.vue +0 -81
  97. package/packages/workflow-editor/src/properties-editors/common/common-user-condition.vue +0 -242
  98. package/packages/workflow-editor/src/properties-editors/common/form-fields-utils.js +0 -23
  99. package/packages/workflow-editor/src/properties-editors/common/form-fields.vue +0 -117
  100. package/packages/workflow-editor/src/properties-editors/common/i18n-input.vue +0 -88
  101. package/packages/workflow-editor/src/properties-editors/common/i18n-set-dialog.vue +0 -143
  102. package/packages/workflow-editor/src/properties-editors/common/notice-reminder.vue +0 -149
  103. package/packages/workflow-editor/src/properties-editors/common/notice.vue +0 -108
  104. package/packages/workflow-editor/src/properties-editors/common/reminder.vue +0 -272
  105. package/packages/workflow-editor/src/properties-editors/common/select-mail-template.vue +0 -92
  106. package/packages/workflow-editor/src/properties-editors/common/standard-fields.vue +0 -66
  107. package/packages/workflow-editor/src/properties-editors/common/system-role-tree-inline.vue +0 -354
  108. package/packages/workflow-editor/src/properties-editors/common/system-role-tree.vue +0 -68
  109. package/packages/workflow-editor/src/properties-editors/common/task-title.vue +0 -165
  110. package/packages/workflow-editor/src/properties-editors/common/transactor-settings.vue +0 -275
  111. package/packages/workflow-editor/src/properties-editors/common/user-selection.vue +0 -426
  112. package/packages/workflow-editor/src/properties-editors/common/value-selection-dialog.vue +0 -272
  113. package/packages/workflow-editor/src/properties-editors/common/variables.vue +0 -138
  114. package/packages/workflow-editor/src/properties-editors/copy-task/basic-properties.vue +0 -90
  115. package/packages/workflow-editor/src/properties-editors/copy-task/permission-settings.vue +0 -155
  116. package/packages/workflow-editor/src/properties-editors/copy-task.vue +0 -95
  117. package/packages/workflow-editor/src/properties-editors/decision.vue +0 -95
  118. package/packages/workflow-editor/src/properties-editors/fork.vue +0 -77
  119. package/packages/workflow-editor/src/properties-editors/human-decision.vue +0 -49
  120. package/packages/workflow-editor/src/properties-editors/human-task/additional-condition-dialog.vue +0 -62
  121. package/packages/workflow-editor/src/properties-editors/human-task/basic-properties.vue +0 -184
  122. package/packages/workflow-editor/src/properties-editors/human-task/componentsConfigUtil.js +0 -359
  123. package/packages/workflow-editor/src/properties-editors/human-task/custom-actions.vue +0 -256
  124. package/packages/workflow-editor/src/properties-editors/human-task/editable-child-field-setting.vue +0 -405
  125. package/packages/workflow-editor/src/properties-editors/human-task/editable-child-fields.vue +0 -257
  126. package/packages/workflow-editor/src/properties-editors/human-task/editable-field-selection.vue +0 -430
  127. package/packages/workflow-editor/src/properties-editors/human-task/editable-fields.vue +0 -206
  128. package/packages/workflow-editor/src/properties-editors/human-task/events.vue +0 -60
  129. package/packages/workflow-editor/src/properties-editors/human-task/permission-settings.vue +0 -224
  130. package/packages/workflow-editor/src/properties-editors/human-task/selection-conditions.vue +0 -499
  131. package/packages/workflow-editor/src/properties-editors/human-task.vue +0 -116
  132. package/packages/workflow-editor/src/properties-editors/join.vue +0 -49
  133. package/packages/workflow-editor/src/properties-editors/process/basic-properties.vue +0 -336
  134. package/packages/workflow-editor/src/properties-editors/process/events.vue +0 -79
  135. package/packages/workflow-editor/src/properties-editors/process/notice-settings.vue +0 -68
  136. package/packages/workflow-editor/src/properties-editors/process/parameter-settings.vue +0 -106
  137. package/packages/workflow-editor/src/properties-editors/process/permission-settings.vue +0 -28
  138. package/packages/workflow-editor/src/properties-editors/process/selectPage.vue +0 -88
  139. package/packages/workflow-editor/src/properties-editors/process.vue +0 -115
  140. package/packages/workflow-editor/src/properties-editors/subprocess/basic-properties.vue +0 -201
  141. package/packages/workflow-editor/src/properties-editors/subprocess/events.vue +0 -26
  142. package/packages/workflow-editor/src/properties-editors/subprocess/field-mappings.vue +0 -216
  143. package/packages/workflow-editor/src/properties-editors/subprocess/transactor-settings.vue +0 -66
  144. package/packages/workflow-editor/src/properties-editors/subprocess.vue +0 -80
  145. package/packages/workflow-editor/src/properties-editors/transition/basic-properties.vue +0 -53
  146. package/packages/workflow-editor/src/properties-editors/transition.vue +0 -75
  147. package/packages/workflow-editor/src/properties-editors/user-condition.js +0 -183
  148. package/packages/workflow-editor/src/store/getters.js +0 -33
  149. package/packages/workflow-editor/src/store/workflow-editor.js +0 -153
  150. package/packages/workflow-editor/src/taches/auto-task.vue +0 -99
  151. package/packages/workflow-editor/src/taches/common-methods.js +0 -21
  152. package/packages/workflow-editor/src/taches/copy-task.vue +0 -99
  153. package/packages/workflow-editor/src/taches/custom-task.vue +0 -88
  154. package/packages/workflow-editor/src/taches/decision.vue +0 -102
  155. package/packages/workflow-editor/src/taches/end.vue +0 -76
  156. package/packages/workflow-editor/src/taches/fork.vue +0 -102
  157. package/packages/workflow-editor/src/taches/human-decision.vue +0 -102
  158. package/packages/workflow-editor/src/taches/human-task.vue +0 -113
  159. package/packages/workflow-editor/src/taches/join.vue +0 -91
  160. package/packages/workflow-editor/src/taches/joint.vue +0 -177
  161. package/packages/workflow-editor/src/taches/start.vue +0 -76
  162. package/packages/workflow-editor/src/taches/subprocess.vue +0 -99
  163. package/packages/workflow-editor/src/taches/tache-resizer.vue +0 -80
  164. package/packages/workflow-editor/src/transitions/broken-line.vue +0 -91
  165. package/packages/workflow-editor/src/transitions/curve-line.vue +0 -91
  166. package/packages/workflow-editor/src/transitions/straight-line.vue +0 -26
  167. package/packages/workflow-editor/src/transitions/transition.vue +0 -209
  168. package/packages/workflow-editor/src/transitions/virtual-transition.vue +0 -43
  169. package/packages/workflow-editor/src/util.js +0 -499
  170. package/packages/workflow-editor/src/workflow-editor.vue +0 -852
  171. package/packages/workflow-editor/src/workflow-history.vue +0 -153
  172. package/src/i18n/i18n.js +0 -16
  173. package/src/i18n/langs/cn.js +0 -521
  174. package/src/i18n/langs/en.js +0 -529
  175. /package/{public → dist}/vite.svg +0 -0
@@ -1,256 +0,0 @@
1
- <template>
2
- <div>
3
- <el-row>
4
- <el-button type="primary" size="small" plain :icon="CirclePlus" @click="add">
5
- {{ $t('workflowEditorPublicModel.add') }}
6
- </el-button>
7
- <el-button type="primary" size="small" plain :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 v-slot="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 v-slot="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 v-slot="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 v-slot="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 setup>
73
- import {
74
- CirclePlus,
75
- Delete
76
- } from '@element-plus/icons-vue'
77
- </script>
78
- <script>
79
- import { getI18n } from '../../../../workflow-editor/src/util'
80
- import AdditionalConditionDialog from './additional-condition-dialog'
81
- import { parseCondition, displayCondition } from '../common/additional-condition-utils'
82
- export default {
83
- name: 'CustomActions',
84
- components: {
85
- AdditionalConditionDialog
86
- },
87
- props: {
88
- model: {
89
- type: Object,
90
- default: null
91
- }
92
- },
93
- data() {
94
- const actions = []
95
- let count = 1
96
- if (this.model.action) {
97
- if (Array.isArray(this.model.action)) {
98
- for (const action of this.model.action) {
99
- actions.push({
100
- ...action,
101
- id: count
102
- })
103
- count++
104
- }
105
- } else {
106
- actions.push({
107
- ...this.model.action,
108
- id: count
109
- })
110
- count++
111
- }
112
- }
113
- return {
114
- actions,
115
- actionTypes: [{
116
- type: 'SAVE',
117
- label: getI18n().t('workflowEditor.task.save')
118
- }, {
119
- type: 'SUBMIT',
120
- label: getI18n().t('workflowEditor.task.submission')
121
- }, {
122
- type: 'APPROVE',
123
- label: getI18n().t('workflowEditor.task.agree')
124
- }, {
125
- type: 'REFUSE',
126
- label: getI18n().t('workflowEditor.task.disagree')
127
- }, {
128
- type: 'AGREEMENT',
129
- label: getI18n().t('workflowEditor.task.favor')
130
- }, {
131
- type: 'OPPOSE',
132
- label: getI18n().t('workflowEditor.task.opposition')
133
- }, {
134
- type: 'KIKEN',
135
- label: getI18n().t('workflowEditor.task.waiver')
136
- }, {
137
- type: 'DRAW',
138
- label: getI18n().t('workflowEditor.task.receive')
139
- }, {
140
- type: 'ABANDON_DRAW',
141
- label: getI18n().t('workflowEditor.task.giveUp')
142
- }, {
143
- type: 'ADD_SIGN',
144
- label: getI18n().t('workflowEditor.task.additionalSignature')
145
- }, {
146
- type: 'REMOVE_SIGN',
147
- label: getI18n().t('workflowEditor.task.reductionOfSignature')
148
- }, {
149
- type: 'ASSIGN_TASK',
150
- label: getI18n().t('workflowEditor.task.assignTask')
151
- }, {
152
- type: 'COPY',
153
- label: getI18n().t('workflowEditor.task.copyTask')
154
- }, {
155
- type: 'GET_BACK_BUTTON',
156
- label: getI18n().t('workflowEditor.task.retrieveTask')
157
- }, {
158
- type: 'READED',
159
- label: getI18n().t('workflowEditor.task.readTask')
160
- }, {
161
- type: 'EXPORT_REPORT',
162
- label: getI18n().t('workflowEditor.task.exportReport')
163
- }],
164
- currentRow: null,
165
- count,
166
- showAdditionalCondition: false
167
- }
168
- },
169
- mounted() {
170
- if (this.actions.length > 0) {
171
- this.selectRow(this.actions[this.actions.length - 1])
172
- }
173
- this.$watch('actions', function(newVal, oldVal) {
174
- const actions = []
175
- for (const action of this.actions) {
176
- const row = {
177
- ...action
178
- }
179
- delete row['id']
180
- actions.push(row)
181
- }
182
- this.$emit('updateAction', actions)
183
- }, {
184
- deep: true
185
- })
186
- },
187
- methods: {
188
- selectRow(row) {
189
- this.$refs.table.setCurrentRow(row)
190
- },
191
- getRowIndex(row) {
192
- for (let i = 0; i < this.actions.length; i++) {
193
- if (this.actions[i].id === row.id) {
194
- return i
195
- }
196
- }
197
- return -1
198
- },
199
- handleCurrentChange(val) {
200
- this.currentRow = val
201
- },
202
- isDuplicated(val) {
203
- const index = this.getRowIndex(this.currentRow)
204
- console.log('index:' + index)
205
- for (let i = 0; i < this.actions.length; i++) {
206
- if (i === index) continue
207
- if (this.actions[i].type === val) {
208
- this.$alert(this.$t('workflowEditorMessage.duplicateOperationTypeWithLinePleaseReselect', { row: (i + 1) }))
209
- this.currentRow.type = ''
210
- }
211
- }
212
- },
213
- add() {
214
- for (let i = 0; i < this.actions.length; i++) {
215
- const action = this.actions[i]
216
- if (action.type === '' || action.label === '') {
217
- this.$alert(this.$t('workflowEditorMessage.theOperationTypeOrNameInLineIsEmpty', { row: (i + 1) }))
218
- return
219
- }
220
- }
221
- const newRow = {
222
- id: this.count,
223
- type: '',
224
- label: '',
225
- visible: true,
226
- condition: ''
227
- }
228
- this.actions.push(newRow)
229
- this.selectRow(newRow)
230
- this.count++
231
- },
232
- remove() {
233
- let index = this.getRowIndex(this.currentRow)
234
- this.actions.splice(index, 1)
235
- if (this.actions.length > 0) {
236
- index = (index <= (this.actions.length - 1) ? index : (this.actions.length - 1))
237
- this.$refs.table.setCurrentRow(this.actions[index])
238
- }
239
- },
240
- formatCondition(value) {
241
- if (value === '' || !value) return this.$t('workflowEditor.task.nothing')
242
- const conditions = []
243
- parseCondition(conditions, value)
244
- return displayCondition(conditions)
245
- },
246
- selectCondition(row) {
247
- this.selectRow(row)
248
- if (!this.currentRow) {
249
- this.currentRow.condition = ''
250
- // this.$set(this.currentRow, 'condition', '')
251
- }
252
- this.showAdditionalCondition = true
253
- }
254
- }
255
- }
256
- </script>
@@ -1,405 +0,0 @@
1
- <template>
2
- <div>
3
- <div>
4
- <el-checkbox-group v-model="actionArr" @change="changeActionArr">
5
- <el-row>
6
- <el-col :span="6">
7
- <el-checkbox label="notEmpty">
8
- {{ $t('workflowEditor.condition.tableDataNotEmpty') }}
9
- <el-icon v-if="actionArr && actionArr.indexOf('notEmpty') !== -1" @click="showButtonVisible('notEmpty')"
10
- ><Tools
11
- /></el-icon>
12
- </el-checkbox>
13
- </el-col>
14
- <el-col :span="6">
15
- <el-checkbox label="add">
16
- {{ $t('workflowEditor.condition.rowsCanBeAdded') }}
17
- <el-icon v-if="actionArr && actionArr.indexOf('add') !== -1" @click="showButtonVisible('add')"
18
- ><Tools
19
- /></el-icon>
20
- </el-checkbox>
21
- </el-col>
22
- <el-col :span="6">
23
- <el-checkbox label="delete">
24
- {{ $t('workflowEditor.condition.deleteLine') }}
25
- <el-icon v-if="actionArr && actionArr.indexOf('delete') !== -1" @click="showButtonVisible('delete')"
26
- ><Tools
27
- /></el-icon>
28
- </el-checkbox>
29
- </el-col>
30
- <el-col :span="6">
31
- <el-checkbox label="update">
32
- {{ $t('workflowEditor.condition.modifiableHistoricalData') }}
33
- <el-icon v-if="actionArr && actionArr.indexOf('update') !== -1" @click="showButtonVisible('update')"
34
- ><Tools
35
- /></el-icon>
36
- </el-checkbox>
37
- </el-col>
38
- </el-row>
39
- </el-checkbox-group>
40
- <!-- <el-col :span="4">
41
- <el-radio v-model="permission" label="fieldControl" @change="combinationParameters()">
42
- {{ $t('workflowEditor.condition.controlByField') }}
43
- </el-radio>
44
- </el-col>
45
- <el-col :span="4">
46
- <el-radio v-model="permission" label="allForbidden" @change="combinationParameters()">
47
- {{ $t('workflowEditor.condition.allReadOnly') }}
48
- </el-radio>
49
- </el-col>
50
- <el-col :span="4">
51
- <el-radio v-model="permission" label="allRequired" @change="combinationParameters()">
52
- {{ $t('workflowEditor.condition.allRequired') }}
53
- </el-radio>
54
- </el-col> -->
55
- <selection-conditions
56
- v-if="showButtonVisibleFlag"
57
- :attribute-map="subtableConditionItem"
58
- :condition-list="buttonVisibleCon.condition"
59
- :parent-condition="buttonVisibleCon.parentCondition"
60
- :user-condition="buttonVisibleCon.userCondition"
61
- :button-type="buttonType"
62
- @close="saveButtonVisible"
63
- />
64
- </div>
65
- <div>
66
- <el-row>
67
- <el-button type="primary" size="small" plain icon="CirclePlus" @click="add">
68
- {{ $t('workflowEditorPublicModel.add') }}
69
- </el-button>
70
- <el-button type="primary" size="small" plain icon="Delete" @click="remove">
71
- {{ $t('workflowEditorPublicModel.delete') }}
72
- </el-button>
73
- </el-row>
74
- <el-table
75
- ref="table"
76
- :data="fieldArr"
77
- border
78
- highlight-current-row
79
- style="width: 100%"
80
- @selection-change="handleSelectionChange"
81
- @current-change="handleCurrentChange"
82
- >
83
- <el-table-column type="selection" width="55" align="center" />
84
- <el-table-column type="index" width="50" align="center" />
85
- <el-table-column prop="name" :label="$t('workflowEditor.task.propertyName')" width="280" align="center">
86
- <template v-slot="scope">
87
- <el-select v-model="scope.row.name" size="small" filterable @change="combinationParameters">
88
- <el-option :label="$t('workflowEditor.condition.allFields')" value="all_fields" />
89
- <el-option v-for="item in attributeArr" :key="item.value" :label="item.label" :value="item.value" />
90
- </el-select>
91
- </template>
92
- </el-table-column>
93
- <el-table-column
94
- prop="constraintRule"
95
- :label="$t('workflowEditor.task.editingMethod')"
96
- width="380"
97
- align="center"
98
- >
99
- <template v-slot="scope">
100
- <el-radio-group v-model="scope.row.constraintRule" @change="combinationParameters">
101
- <el-radio label="REQUIRED">
102
- {{ $t('workflowEditorMessage.mustFill') }}
103
- </el-radio>
104
- <el-radio label="READ_ONLY">
105
- {{ $t('workflowEditorMessage.readOnly') }}
106
- </el-radio>
107
- </el-radio-group>
108
- </template>
109
- </el-table-column>
110
- <el-table-column prop="condition" :label="$t('workflowEditor.task.condition')" align="center">
111
- <template v-slot="scope">
112
- <el-icon @click="selectCondition(scope.row)"><Tools /></el-icon>
113
- <!-- <el-input
114
- :value="formatConditionList(scope.row.condition)"
115
- type="textarea"
116
- autosize
117
- @focus="selectCondition(scope.row)"
118
- /> -->
119
- </template>
120
- </el-table-column>
121
- </el-table>
122
- <selection-conditions
123
- v-if="showAdditionalCondition"
124
- :attribute-map="subtableConditionItem"
125
- :condition-list="currentRow.condition"
126
- :parent-condition="currentRow.parentCondition"
127
- :user-condition="currentRow.userCondition"
128
- @close="savebuttonSetting"
129
- />
130
- </div>
131
- </div>
132
- </template>
133
-
134
- <script>
135
- import { mapGetters } from 'vuex'
136
- import selectionConditions from './selection-conditions'
137
- import componentsConfigUtil from './componentsConfigUtil'
138
- import { CirclePlus, Delete } from '@element-plus/icons-vue'
139
-
140
- export default {
141
- name: 'EditableChildFieldSetting',
142
- components: {
143
- selectionConditions
144
- },
145
- props: {
146
- setting: {
147
- type: Object,
148
- default: null
149
- },
150
- tableName: {
151
- type: String,
152
- default: null
153
- }
154
- },
155
- data() {
156
- let actionArr = []
157
- if (this.setting && this.setting.actionArr) {
158
- actionArr = this.setting.actionArr
159
- }
160
- let fieldArr = []
161
- if (this.setting && this.setting.fieldArr) {
162
- fieldArr = this.setting.fieldArr
163
- }
164
- let actionVisibleConditionArr
165
- if (this.setting && this.setting.visibleConditionArr) {
166
- actionVisibleConditionArr = this.setting.visibleConditionArr
167
- }
168
- let modelName
169
- if (this.setting && this.setting.modelName) {
170
- modelName = this.setting.modelName
171
- }
172
- let sumPermission
173
- if (this.setting && this.setting.sumPermission !== null) {
174
- sumPermission = this.setting.sumPermission
175
- }
176
- return {
177
- sumPermission,
178
- subtableConditionItem: null,
179
- attributeArr: null,
180
- showAdditionalCondition: false,
181
- currentRow: null,
182
- multipleSelection: null,
183
- actionArr,
184
- fieldArr,
185
- queryList: null,
186
- fieldMap: null,
187
- fieldNameMap: null,
188
- actionVisibleConditionArr,
189
- buttonType: null,
190
- buttonVisibleCon: null,
191
- showButtonVisibleFlag: false,
192
- clickButton: false,
193
- operationArr: [],
194
- modelName
195
- }
196
- },
197
- watch: {
198
- setting: {
199
- handler(newValue, oldValue) {
200
- if (newValue && newValue.actionArr) {
201
- this.actionArr = newValue.actionArr
202
- }
203
- if (newValue && newValue.fieldArr) {
204
- this.fieldArr = newValue.fieldArr
205
- }
206
- if (newValue && newValue.actionVisibleConditionArr) {
207
- this.actionVisibleConditionArr = newValue.actionVisibleConditionArr
208
- }
209
- this.modelName = newValue.modelName
210
- this.sumPermission = newValue.sumPermission
211
- this.combinationParameters()
212
- },
213
- deep: true
214
- }
215
- // permission: {
216
- // handler(newValue, oldValue) {
217
- // console.log(11111111111111)
218
- // this.combinationParameters()
219
- // }
220
- // },
221
- // actionArr: {
222
- // handler(newValue, oldValue) {
223
- // console.log(22222222222222)
224
- // this.combinationParameters()
225
- // }
226
- // },
227
- // fieldArr: {
228
- // handler(newValue, oldValue) {
229
- // console.log(333333333333333)
230
- // this.combinationParameters()
231
- // },
232
- // deep: true
233
- // },
234
- // actionVisibleConditionArr: {
235
- // handler(newValue, oldValue) {
236
- // console.log(4444444444444444)
237
- // this.combinationParameters()
238
- // },
239
- // deep: true
240
- // }
241
- },
242
- computed: {
243
- ...mapGetters('wfEditor', ['subtableConditionMap'])
244
- },
245
- created() {
246
- if (this.subtableConditionMap) {
247
- if (this.tableName) {
248
- this.subtableConditionItem = this.subtableConditionMap[this.tableName]
249
- this.getAttributeArr()
250
- }
251
- }
252
- },
253
- mounted() {
254
- if (this.subtableConditionMap) {
255
- if (this.tableName) {
256
- this.subtableConditionItem = this.subtableConditionMap[this.tableName]
257
- if (this.subtableConditionMap[this.tableName]) {
258
- this.attributeArr = this.subtableConditionItem.attributeArr
259
- }
260
- }
261
- }
262
- },
263
- methods: {
264
- ...componentsConfigUtil,
265
- getAttributeArr() {
266
- if (this.subtableConditionItem && this.subtableConditionItem.attributeArr) {
267
- this.queryList = this.subtableConditionItem.attributeArr
268
- this.fieldMap = this.subtableConditionItem.fieldMap
269
- this.fieldNameMap = this.subtableConditionItem.fieldNameMap
270
- }
271
- },
272
- savebuttonSetting(param) {
273
- if (param) {
274
- this.currentRow.condition = param.condition
275
- this.currentRow.userCondition = param.userCondition
276
- this.currentRow.parentCondition = param.parentCondition
277
- // this.$set(this.currentRow, 'condition', param.condition)
278
- // this.$set(this.currentRow, 'userCondition', param.userCondition)
279
- // this.$set(this.currentRow, 'parentCondition', param.parentCondition)
280
- this.combinationParameters()
281
- }
282
- this.showAdditionalCondition = false
283
- },
284
- handleCurrentChange(val) {
285
- this.currentRow = val
286
- },
287
- handleSelectionChange(val) {
288
- this.multipleSelection = val
289
- },
290
- selectRow(row) {
291
- this.$refs.table.setCurrentRow(row)
292
- },
293
- add() {
294
- if (!this.fieldArr) {
295
- this.fieldArr = []
296
- }
297
- this.fieldArr.push({
298
- name: null,
299
- constraintRule: null,
300
- condition: null
301
- })
302
- this.combinationParameters()
303
- },
304
- getCurrentRowIndex() {
305
- let index = -1
306
- for (let i = 0; i < this.fieldArr.length; i++) {
307
- if (this.fieldArr[i].name === this.currentRow.name) {
308
- index = i
309
- break
310
- }
311
- }
312
- return index
313
- },
314
- remove() {
315
- if (this.multipleSelection && this.multipleSelection.length > 0) {
316
- for (var i = 0; i < this.multipleSelection.length; i++) {
317
- const selectRow = this.multipleSelection[i]
318
- this.selectRow(selectRow)
319
- const index = this.getCurrentRowIndex()
320
- this.fieldArr.splice(index, 1)
321
- }
322
- // this.$emit('input', this.selectedFields)
323
- this.combinationParameters()
324
- }
325
- },
326
- selectCondition(row) {
327
- this.selectRow(row)
328
- this.showAdditionalCondition = true
329
- },
330
- showButtonVisible(type) {
331
- this.clickButton = true
332
- this.buttonType = type
333
- if (this.actionVisibleConditionArr && this.actionVisibleConditionArr[type]) {
334
- this.buttonVisibleCon = this.actionVisibleConditionArr[type]
335
- // this.$set(this, 'buttonVisibleCon', this.actionVisibleConditionArr[type])
336
- } else {
337
- this.buttonVisibleCon = {}
338
- // this.$set(this, 'buttonVisibleCon', {})
339
- }
340
- this.showButtonVisibleFlag = true
341
- // this.$set(this, 'showButtonVisibleFlag', true)
342
- },
343
- saveButtonVisible(param) {
344
- if (param) {
345
- if (!this.actionVisibleConditionArr) {
346
- this.actionVisibleConditionArr = {}
347
- }
348
- this.actionVisibleConditionArr[this.buttonType] = param
349
- // this.$set(this.actionVisibleConditionArr, this.buttonType, param)
350
- this.combinationParameters()
351
- }
352
- this.showButtonVisibleFlag = false
353
- },
354
- changeActionArr() {
355
- if (this.clickButton) {
356
- this.actionArr.push(this.buttonType)
357
- this.clickButton = false
358
- } else {
359
- this.combinationParameters()
360
- }
361
- },
362
- // 组合参数
363
- combinationParameters() {
364
- const subTableItem = {}
365
- subTableItem.modelName = this.modelName
366
- subTableItem.tableName = this.tableName
367
- subTableItem.permission = this.sumPermission
368
- const actions = []
369
- if (this.actionArr && this.actionArr.length > 0) {
370
- this.actionArr.forEach((type) => {
371
- const action = {}
372
- action.name = type
373
- if (this.actionVisibleConditionArr && this.actionVisibleConditionArr[type]) {
374
- const param = this.actionVisibleConditionArr[type]
375
- action.condition = this.dataToXml(param.condition)
376
- action.parentCondition = param.parentCondition
377
- action.userCondition = param.userCondition
378
- }
379
- actions.push(action)
380
- })
381
- subTableItem.action = actions
382
- }
383
- if (this.fieldArr && this.fieldArr.length > 0) {
384
- const field = []
385
- this.fieldArr.forEach((item) => {
386
- const fieldItem = {}
387
- fieldItem.name = item.name
388
- fieldItem.constraintRule = item.constraintRule
389
- if (item.condition) {
390
- fieldItem.condition = this.dataToXml(item.condition)
391
- }
392
- fieldItem.userCondition = item.userCondition
393
- fieldItem.parentCondition = item.parentCondition
394
- field.push(fieldItem)
395
- })
396
- subTableItem.field = field
397
- }
398
- console.log('触发combinationParameters', subTableItem)
399
- this.$emit('combinationParameters', subTableItem)
400
- }
401
- }
402
- }
403
- </script>
404
-
405
- <style lang="scss" scoped></style>