workflow-editor 0.9.84-dw-tmp8 → 0.9.84-dw-tmp9

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 (109) hide show
  1. package/package.json +1 -1
  2. package/packages/index.js +0 -34
  3. package/packages/plugins/formValidatorUtil.js +0 -528
  4. package/packages/plugins/index.js +0 -8
  5. package/packages/workflow-editor/index.js +0 -14
  6. package/packages/workflow-editor/src/api.js +0 -7
  7. package/packages/workflow-editor/src/assets/wf-editor-icons.js +0 -2
  8. package/packages/workflow-editor/src/constant.js +0 -8
  9. package/packages/workflow-editor/src/json-object-templates/copy-task.js +0 -67
  10. package/packages/workflow-editor/src/json-object-templates/decision.js +0 -11
  11. package/packages/workflow-editor/src/json-object-templates/end.js +0 -14
  12. package/packages/workflow-editor/src/json-object-templates/fork.js +0 -10
  13. package/packages/workflow-editor/src/json-object-templates/human-decision.js +0 -9
  14. package/packages/workflow-editor/src/json-object-templates/human-task.js +0 -199
  15. package/packages/workflow-editor/src/json-object-templates/join.js +0 -10
  16. package/packages/workflow-editor/src/json-object-templates/process.js +0 -98
  17. package/packages/workflow-editor/src/json-object-templates/start.js +0 -13
  18. package/packages/workflow-editor/src/json-object-templates/subprocess.js +0 -30
  19. package/packages/workflow-editor/src/json-object-templates/transition.js +0 -26
  20. package/packages/workflow-editor/src/main/admin-save-dialog.vue +0 -66
  21. package/packages/workflow-editor/src/main/canvas.vue +0 -479
  22. package/packages/workflow-editor/src/main/context-menu.vue +0 -132
  23. package/packages/workflow-editor/src/main/icon-svg.vue +0 -32
  24. package/packages/workflow-editor/src/main/selection-region.vue +0 -66
  25. package/packages/workflow-editor/src/main/tache-history-tooltip.vue +0 -38
  26. package/packages/workflow-editor/src/main/tache-name-input.vue +0 -19
  27. package/packages/workflow-editor/src/main/tache-subprocess-history-dialog.vue +0 -35
  28. package/packages/workflow-editor/src/main/toolbox.vue +0 -60
  29. package/packages/workflow-editor/src/main/wf-history-canvas.vue +0 -302
  30. package/packages/workflow-editor/src/process-json.js +0 -622
  31. package/packages/workflow-editor/src/process-service.js +0 -31
  32. package/packages/workflow-editor/src/properties-editors/common/additional-condition-utils.js +0 -522
  33. package/packages/workflow-editor/src/properties-editors/common/additional-condition.vue +0 -276
  34. package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields-utils.js +0 -34
  35. package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields.vue +0 -239
  36. package/packages/workflow-editor/src/properties-editors/common/common-notice-tool.vue +0 -47
  37. package/packages/workflow-editor/src/properties-editors/common/common-user-condition.vue +0 -241
  38. package/packages/workflow-editor/src/properties-editors/common/form-fields-utils.js +0 -23
  39. package/packages/workflow-editor/src/properties-editors/common/form-fields.vue +0 -116
  40. package/packages/workflow-editor/src/properties-editors/common/i18n-input.vue +0 -75
  41. package/packages/workflow-editor/src/properties-editors/common/i18n-set-dialog.vue +0 -125
  42. package/packages/workflow-editor/src/properties-editors/common/notice.vue +0 -98
  43. package/packages/workflow-editor/src/properties-editors/common/reminder.vue +0 -179
  44. package/packages/workflow-editor/src/properties-editors/common/select-mail-template.vue +0 -83
  45. package/packages/workflow-editor/src/properties-editors/common/standard-fields.vue +0 -65
  46. package/packages/workflow-editor/src/properties-editors/common/system-role-tree-inline.vue +0 -355
  47. package/packages/workflow-editor/src/properties-editors/common/system-role-tree.vue +0 -63
  48. package/packages/workflow-editor/src/properties-editors/common/task-title.vue +0 -148
  49. package/packages/workflow-editor/src/properties-editors/common/transactor-settings.vue +0 -220
  50. package/packages/workflow-editor/src/properties-editors/common/user-selection.vue +0 -386
  51. package/packages/workflow-editor/src/properties-editors/common/value-selection-dialog.vue +0 -209
  52. package/packages/workflow-editor/src/properties-editors/common/variables.vue +0 -135
  53. package/packages/workflow-editor/src/properties-editors/copy-task/basic-properties.vue +0 -90
  54. package/packages/workflow-editor/src/properties-editors/copy-task/permission-settings.vue +0 -155
  55. package/packages/workflow-editor/src/properties-editors/copy-task.vue +0 -80
  56. package/packages/workflow-editor/src/properties-editors/decision.vue +0 -90
  57. package/packages/workflow-editor/src/properties-editors/fork.vue +0 -72
  58. package/packages/workflow-editor/src/properties-editors/human-decision.vue +0 -44
  59. package/packages/workflow-editor/src/properties-editors/human-task/additional-condition-dialog.vue +0 -60
  60. package/packages/workflow-editor/src/properties-editors/human-task/basic-properties.vue +0 -156
  61. package/packages/workflow-editor/src/properties-editors/human-task/componentsConfigUtil.js +0 -291
  62. package/packages/workflow-editor/src/properties-editors/human-task/custom-actions.vue +0 -249
  63. package/packages/workflow-editor/src/properties-editors/human-task/editable-child-field-setting.vue +0 -392
  64. package/packages/workflow-editor/src/properties-editors/human-task/editable-child-fields.vue +0 -241
  65. package/packages/workflow-editor/src/properties-editors/human-task/editable-field-selection.vue +0 -220
  66. package/packages/workflow-editor/src/properties-editors/human-task/editable-fields.vue +0 -204
  67. package/packages/workflow-editor/src/properties-editors/human-task/events.vue +0 -59
  68. package/packages/workflow-editor/src/properties-editors/human-task/permission-settings.vue +0 -207
  69. package/packages/workflow-editor/src/properties-editors/human-task/selection-conditions.vue +0 -390
  70. package/packages/workflow-editor/src/properties-editors/human-task.vue +0 -103
  71. package/packages/workflow-editor/src/properties-editors/join.vue +0 -44
  72. package/packages/workflow-editor/src/properties-editors/process/basic-properties.vue +0 -273
  73. package/packages/workflow-editor/src/properties-editors/process/events.vue +0 -76
  74. package/packages/workflow-editor/src/properties-editors/process/notice-settings.vue +0 -60
  75. package/packages/workflow-editor/src/properties-editors/process/parameter-settings.vue +0 -95
  76. package/packages/workflow-editor/src/properties-editors/process/permission-settings.vue +0 -28
  77. package/packages/workflow-editor/src/properties-editors/process/selectPage.vue +0 -81
  78. package/packages/workflow-editor/src/properties-editors/process.vue +0 -109
  79. package/packages/workflow-editor/src/properties-editors/subprocess/basic-properties.vue +0 -176
  80. package/packages/workflow-editor/src/properties-editors/subprocess/events.vue +0 -26
  81. package/packages/workflow-editor/src/properties-editors/subprocess/field-mappings.vue +0 -206
  82. package/packages/workflow-editor/src/properties-editors/subprocess/transactor-settings.vue +0 -64
  83. package/packages/workflow-editor/src/properties-editors/subprocess.vue +0 -79
  84. package/packages/workflow-editor/src/properties-editors/transition/basic-properties.vue +0 -53
  85. package/packages/workflow-editor/src/properties-editors/transition.vue +0 -74
  86. package/packages/workflow-editor/src/properties-editors/user-condition.js +0 -177
  87. package/packages/workflow-editor/src/store/getters.js +0 -27
  88. package/packages/workflow-editor/src/store/workflow-editor.js +0 -125
  89. package/packages/workflow-editor/src/taches/common-methods.js +0 -21
  90. package/packages/workflow-editor/src/taches/copy-task.vue +0 -99
  91. package/packages/workflow-editor/src/taches/custom-task.vue +0 -88
  92. package/packages/workflow-editor/src/taches/decision.vue +0 -102
  93. package/packages/workflow-editor/src/taches/end.vue +0 -76
  94. package/packages/workflow-editor/src/taches/fork.vue +0 -102
  95. package/packages/workflow-editor/src/taches/human-decision.vue +0 -102
  96. package/packages/workflow-editor/src/taches/human-task.vue +0 -113
  97. package/packages/workflow-editor/src/taches/join.vue +0 -91
  98. package/packages/workflow-editor/src/taches/joint.vue +0 -177
  99. package/packages/workflow-editor/src/taches/start.vue +0 -76
  100. package/packages/workflow-editor/src/taches/subprocess.vue +0 -99
  101. package/packages/workflow-editor/src/taches/tache-resizer.vue +0 -80
  102. package/packages/workflow-editor/src/transitions/broken-line.vue +0 -91
  103. package/packages/workflow-editor/src/transitions/curve-line.vue +0 -91
  104. package/packages/workflow-editor/src/transitions/straight-line.vue +0 -26
  105. package/packages/workflow-editor/src/transitions/transition.vue +0 -212
  106. package/packages/workflow-editor/src/transitions/virtual-transition.vue +0 -43
  107. package/packages/workflow-editor/src/util.js +0 -493
  108. package/packages/workflow-editor/src/workflow-editor.vue +0 -605
  109. package/packages/workflow-editor/src/workflow-history.vue +0 -153
@@ -1,276 +0,0 @@
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-arrow-right" @click="insert">
8
- {{ $t('workflowEditorPublicModel.insert') }}
9
- </el-button>
10
- <!-- <el-button type="primary" size="mini" plain @click="modify">
11
- 修改
12
- </el-button> -->
13
- <el-button type="primary" size="mini" plain icon="el-icon-delete" @click="remove">
14
- {{ $t('workflowEditorPublicModel.delete') }}
15
- </el-button>
16
- <el-button type="primary" size="mini" plain icon="el-icon-view" @click="view">
17
- {{ $t('workflowEditorPublicModel.viewConditions') }}
18
- </el-button>
19
- </el-row>
20
- <el-table
21
- ref="table"
22
- :data="tableData"
23
- row-key="id"
24
- border
25
- style="width: 100%;padding-top:10px"
26
- highlight-current-row
27
- @current-change="handleCurrentChange"
28
- >
29
- <el-table-column prop="leftBracket" label="(" width="90">
30
- <template slot-scope="scope">
31
- <el-select v-model="scope.row.leftBracket" placeholder="" @focus="selectRow(scope.row)">
32
- <el-option label="" value="" />
33
- <el-option label="(" value="(" />
34
- <el-option label="((" value="((" />
35
- <el-option label="(((" value="(((" />
36
- </el-select>
37
- </template>
38
- </el-table-column>
39
- <el-table-column :label="$t('workflowEditor.common.fieldName')" width="200">
40
- <template slot-scope="scope">
41
- <el-input :value="format(scope.row.key)" @focus="selectField(scope.row)" />
42
- </template>
43
- </el-table-column>
44
- <el-table-column :label="$t('workflowEditor.common.operator')" width="110">
45
- <template slot-scope="scope">
46
- <el-select v-model="scope.row.operator" placeholder="" @focus="selectRow(scope.row)">
47
- <el-option v-for="option in getOperatorOptions(scope.row.key)" :key="option.name" :label="option.label" :value="option.name" />
48
- </el-select>
49
- </template>
50
- </el-table-column>
51
- <el-table-column :label="$t('workflowEditor.common.value')">
52
- <template slot-scope="scope">
53
- <el-input v-if="scope.row.key.indexOf('${field[')>=0 || isTransitionOtherField(scope.row.key)" v-model.trim="scope.row.value" />
54
- <el-select v-else-if="scope.row.key === '${approvalResult}'" v-model.trim="scope.row.value">
55
- <el-option value="同意" :label="$t('workflowEditorPublicModel.agree')" />
56
- <el-option value="不同意" :label="$t('workflowEditorPublicModel.disagree')" />
57
- </el-select>
58
- <el-input v-else :value="format(scope.row.value,scope.row)" readonly @focus="selectValue" />
59
- </template>
60
- </el-table-column>
61
- <el-table-column prop="rightBracket" label=")" width="90" @focus="selectRow(scope.row)">
62
- <template slot-scope="scope">
63
- <el-select v-model="scope.row.rightBracket" placeholder="">
64
- <el-option label="" value="" />
65
- <el-option label=")" value=")" />
66
- <el-option label="))" value="))" />
67
- <el-option label=")))" value=")))" />
68
- </el-select>
69
- </template>
70
- </el-table-column>
71
- <el-table-column prop="logicOperator" :label="$t('workflowEditorPublicModel.andOr')" width="110">
72
- <template slot-scope="scope">
73
- <el-select v-model="scope.row.logicOperator" :placeholder="$t('workflowEditorMessage.pleaseSelect')" @focus="selectRow(scope.row)">
74
- <el-option :label="$t('workflowEditor.process.perhaps')" value="condition.operator.or" />
75
- <el-option :label="$t('workflowEditor.process.also')" value="condition.operator.and" />
76
- </el-select>
77
- </template>
78
- </el-table-column>
79
- </el-table>
80
- <value-selection-dialog
81
- v-if="currentInput"
82
- :title="valueDialogTitle"
83
- :show-organization="showOrganization"
84
- :standard-fields="availableStandardFields"
85
- :org-type="orgType"
86
- @close="closeValueDialog"
87
- />
88
- </div>
89
- </template>
90
- <script>
91
- import { getFieldLabel, parseCondition, generateCondition, displayCondition, getRelatedStandardFields, getOperators, getStandardFieldsByTacheType, isTransitionOtherField } from './additional-condition-utils'
92
- import { standardFields } from './additional-condition-utils'
93
- import ValueSelectionDialog from '../common/value-selection-dialog'
94
- import { mapGetters } from 'vuex'
95
- export default {
96
- name: 'AdditionalCondition',
97
- components: {
98
- ValueSelectionDialog
99
- },
100
- props: {
101
- value: {
102
- type: String,
103
- default: null
104
- },
105
- isTransition: {
106
- type: Boolean,
107
- default: false
108
- }
109
- },
110
- data() {
111
- const tableData = []
112
- const count = parseCondition(tableData, this.value)
113
-
114
- return {
115
- standardFields,
116
- tableData,
117
- count: count,
118
- currentRow: null,
119
- currentInput: null,
120
- options: [],
121
- valueDialogTitle: null,
122
- showOrganization: true,
123
- orgType: null
124
- }
125
- },
126
- computed: {
127
- ...mapGetters('wfEditor', [
128
- 'formFields'
129
- ]),
130
- availableStandardFields() {
131
- if (this.currentInput === 'key') {
132
- return getStandardFieldsByTacheType(this.isTransition)
133
- } else {
134
- return getRelatedStandardFields(this.currentRow.key)
135
- }
136
- }
137
- },
138
- mounted() {
139
- if (this.tableData.length > 0) {
140
- this.$refs.table.setCurrentRow(this.tableData[this.tableData.length - 1])
141
- }
142
- this.$watch('tableData', function(newVal, oldVal) {
143
- this.$emit('input', generateCondition(this.tableData))
144
- }, {
145
- deep: true
146
- })
147
- },
148
- methods: {
149
- format(value, row) {
150
- console.log('row', row)
151
- if (value === '' || value === undefined || value === null) return ''
152
- return getFieldLabel(value)
153
- },
154
- getOperatorOptions(fieldName) {
155
- // console.log('---getOperatorOptions---fieldName=', fieldName)
156
- return getOperators(fieldName)
157
- },
158
- selectRow(row) {
159
- this.$refs.table.setCurrentRow(row)
160
- },
161
- openValueDialog(row) {
162
- this.showValueDialog = true
163
- this.selectRow(row)
164
- },
165
- closeValueDialog(selectedValue) {
166
- if (selectedValue !== undefined && selectedValue !== '') {
167
- // 改变字段时需要清空value
168
- if (this.currentInput === 'key' && this.currentRow.key !== selectedValue) {
169
- this.currentRow.operator = ''
170
- this.currentRow.value = ''
171
- }
172
- // currentInput为key或者value
173
- this.currentRow[this.currentInput] = selectedValue
174
- }
175
- this.currentInput = ''
176
- },
177
- getCondition(row) {
178
- return row.key + ' ' + row.operator + ' ' + row.value
179
- },
180
- handleCurrentChange(val) {
181
- this.currentRow = val
182
- },
183
- getRowIndex(row) {
184
- for (let i = 0; i < this.tableData.length; i++) {
185
- if (this.tableData[i].id === row.id) {
186
- return i
187
- }
188
- }
189
- return -1
190
- },
191
- add() {
192
- if (this.count === null || this.count === undefined || this.count.isNaN || this.count === 'NaN') {
193
- this.count = 0
194
- }
195
- const newRow = {
196
- id: this.count,
197
- leftBracket: '',
198
- key: '',
199
- operator: '',
200
- value: '',
201
- rightBracket: '',
202
- logicOperator: 'condition.operator.or'
203
- }
204
- this.tableData.push(newRow)
205
- this.$refs.table.setCurrentRow(newRow)
206
- this.count++
207
- },
208
- insert() {
209
- if (this.currentRow === null) {
210
- this.$alert(this.$t('workflowEditorMessage.pleaseSelectARow'))
211
- return
212
- }
213
- const newRow = {
214
- id: this.count,
215
- leftBracket: '',
216
- key: '',
217
- operator: 'operator.text.eq',
218
- value: '',
219
- rightBracket: '',
220
- logicOperator: 'condition.operator.or'
221
- }
222
- this.tableData.splice(this.getRowIndex(this.currentRow), 0, newRow)
223
- this.$refs.table.setCurrentRow(newRow)
224
- this.count++
225
- },
226
- remove() {
227
- if (this.currentRow === null) {
228
- this.$alert(this.$t('workflowEditorMessage.pleaseSelectARow'))
229
- return
230
- }
231
- let index = this.getRowIndex(this.currentRow)
232
- this.tableData.splice(index, 1)
233
- if (this.tableData.length > 0) {
234
- index = (index <= (this.tableData.length - 1) ? index : (this.tableData.length - 1))
235
- this.$refs.table.setCurrentRow(this.tableData[index])
236
- }
237
- },
238
- view() {
239
- let result = displayCondition(this.tableData)
240
- if (result === '') {
241
- result = this.$t('workflowEditorMessage.conditionsHaveNotBeenSet')
242
- }
243
- this.$confirm(result, this.$t('workflowEditorMessage.viewConditions'), {
244
- showConfirmButton: false,
245
- showCancelButton: false,
246
- // 增加这个空的回退函数防止报错
247
- callback: function() {}
248
- })
249
- },
250
- selectField(row) {
251
- this.selectRow(row)
252
- this.currentInput = 'key'
253
- this.valueDialogTitle = this.$t('workflowEditorMessage.fieldSettings')
254
- this.showOrganization = false
255
- },
256
- selectValue() {
257
- this.currentInput = 'value'
258
- this.valueDialogTitle = this.$t('workflowEditorMessage.valueSetting')
259
- this.showOrganization = true
260
- this.orgType = this.getStandardFieldOrgType()
261
- },
262
- getStandardFieldOrgType() {
263
- const fields = this.standardFields.filter(standardField => {
264
- return standardField.name === this.currentRow.key
265
- })
266
- if (fields.length > 0) {
267
- return fields[0].orgType
268
- }
269
- return ''
270
- },
271
- isTransitionOtherField(fieldName) {
272
- return isTransitionOtherField(fieldName)
273
- }
274
- }
275
- }
276
- </script>
@@ -1,34 +0,0 @@
1
- import {getI18n} from '../../../../workflow-editor/src/util'
2
- export const standardValues = {
3
- '${currentTime}': getI18n().t('workflowEditor.process.handlingTimeOfThisLink'),
4
- '${currentTransactorId}': getI18n().t('workflowEditor.process.handlerIDOfThisLink'),
5
- '${currentTransactorMainDepartmentId}': getI18n().t('workflowEditor.process.currentHandlerPrincipalDepartmentID'),
6
- '${currentTransactorDirectSuperiorId}': getI18n().t('workflowEditor.process.iDOfTheImmediateSuperiorOfTheCurrentHandler'),
7
- '${currentTransactorDirectSuperiorMainDepartmentId}': getI18n().t('workflowEditor.process.iDOfTheSuperiorDepartmentDirectlyUnderTheCurrentHandler'),
8
- '${currentTransactor}': getI18n().t('workflowEditor.process.loginNameOfTheHandlerInThisLink'),
9
- '${currentTransactorName }': getI18n().t('workflowEditor.process.NameOfCurrentHandler'),
10
- '${currentTransactorDepartment }': getI18n().t('workflowEditor.process.CurrentHandlerDepartment'),
11
- '${currentTransactorDepartmentId}': getI18n().t('workflowEditor.process.CurrentHandlerDepartmentID'),
12
- '${currentTransactorMainDepartment}': getI18n().t('workflowEditor.process.CurrentManagersPrincipalDepartment'),
13
- '${currentTransactorSuperiorDepartmentId}': getI18n().t('workflowEditor.process.iDOfSsuperiorDepartmentOfCurrentHandler'),
14
- '${currentTransactorSuperiorDepartment}': getI18n().t('workflowEditor.process.CurrentHandlersSuperiorDepartment'),
15
- '${currentTransactorUpstageDepartment}': getI18n().t('workflowEditor.process.TopDepartmentOfCurrentHandler'),
16
- '${currentTransactorUpstageDepartmentId}': getI18n().t('workflowEditor.process.TopDepartmentIDOfCurrentHandler'),
17
- '${currentTransactorRole}': getI18n().t('workflowEditor.process.CurrentHandlerRole'),
18
- '${currentTransactorRoleId}': getI18n().t('workflowEditor.process.CurrentHandlerRoleID'),
19
- '${currentTransactorWorkGroup}': getI18n().t('workflowEditor.process.currentHandlerWorkingGroup'),
20
- '${currentTransactorWorkGroupId}': getI18n().t('workflowEditor.process.CurrentHandlerWorkingGroupID'),
21
- '${currentTransactorDirectSuperior}': getI18n().t('workflowEditor.process.LoginNameOfTheImmediateSuperiorOfTheCurrentHandler'),
22
- '${currentTransactorDirectSuperiorName}': getI18n().t('workflowEditor.process.nameOfTheImmediateSuperiorOfTheCurrentHandler'),
23
- '${currentTransactorDirectSuperiorDepartment}': getI18n().t('workflowEditor.process.currentHandlersDirectSuperiorDepartment'),
24
- '${currentTransactorDirectSuperiorDepartmentId}': getI18n().t('workflowEditor.process.currentManagersIdDirectlyUnderTheSuperior'),
25
- '${currentTransactorDirectSuperiorMainDepartment}': getI18n().t('workflowEditor.process.currentManagersDirectSuperiorDepartment'),
26
- '${currentTransactorDirectSuperiorRole}': getI18n().t('workflowEditor.process.currentManagersDirectSuperiorRole'),
27
- '${currentTransactorDirectSuperiorRoleId}': getI18n().t('workflowEditor.process.currentHandlersDirectSuperiorRoleID'),
28
- '${currentTransactorDirectSuperiorWorkGroup}': getI18n().t('workflowEditor.process.currentManagersDirectSuperiorWork'),
29
- '${currentTransactorDirectSuperiorWorkGroupId}': getI18n().t('workflowEditor.process.iDOfTheWorkingGroupDirectlyUnderTheCurrentHandler'),
30
- '${currentOperation}': getI18n().t('workflowEditor.process.operationsPerformedInThisPhase'),
31
- '${previousTransactorId}': getI18n().t('workflowEditor.process.handlerIDOfThePreviousLink'),
32
- '${previousTransactor}': getI18n().t('workflowEditor.process.lastLinkHandlerLogin'),
33
- '${previousTransactorName}': getI18n().t('workflowEditor.process.nameOfHandlerInThePreviousLink')
34
- }
@@ -1,239 +0,0 @@
1
- <template>
2
- <div>
3
- <el-row style="margin-bottom:5px">
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-row>
11
- <el-table
12
- ref="table"
13
- :data="tableData"
14
- border
15
- highlight-current-row
16
- style="width: 100%"
17
- @current-change="handleCurrentChange"
18
- >
19
- <el-table-column
20
- type="index"
21
- width="50"
22
- />
23
- <el-table-column
24
- prop="name"
25
- :label="$t('workflowEditor.common.name')"
26
- width="150"
27
- >
28
- <template slot-scope="scope">
29
- <el-input
30
- :value="getFieldLabel(scope.row.name)"
31
- :placeholder="$t('workflowEditorMessage.pleaseEnterContent')"
32
- readonly
33
- @focus="showFormFields=true"
34
- @blur="checkName(scope.row.name)"
35
- />
36
- </template>
37
- </el-table-column>
38
- <el-table-column
39
- prop="value"
40
- :label="$t('workflowEditor.common.fieldValue')"
41
- width="200"
42
- >
43
- <template slot-scope="scope">
44
- <el-select
45
- v-model="scope.row.value"
46
- multiple
47
- filterable
48
- allow-create
49
- default-first-option
50
- :placeholder="$t('workflowEditorMessage.pleaseSelect')"
51
- @blur="checkValue(scope.row.value)"
52
- >
53
- <el-option
54
- v-for="key in keys"
55
- :key="key"
56
- :label="standardValues[key]"
57
- :value="key"
58
- />
59
- </el-select>
60
- </template>
61
- </el-table-column>
62
- <el-table-column
63
- prop="separator"
64
- :label="$t('workflowEditor.common.separator')"
65
- >
66
- <template slot-scope="scope">
67
- <el-input v-model.trim="scope.row.separator" />
68
- </template>
69
- </el-table-column>
70
- <el-table-column
71
- prop="fillType"
72
- :label="$t('workflowEditor.common.fillInMethod')"
73
- >
74
- <template slot-scope="scope">
75
- <el-select v-model="scope.row.fillType">
76
- <el-option :label="$t('workflowEditor.common.cover')" value="cover" />
77
- <el-option :label="$t('workflowEditor.common.append')" value="append" />
78
- <el-option :label="$t('workflowEditor.common.insertToFront')" value="prepend" />
79
- </el-select>
80
- </template>
81
- </el-table-column>
82
- <el-table-column
83
- prop="fillTime"
84
- :label="$t('workflowEditor.common.fillInTime')"
85
- >
86
- <template slot-scope="scope">
87
- <el-select v-model="scope.row.fillTime">
88
- <el-option :label="$t('workflowEditor.common.fillInBeforeHandling')" value="before" />
89
- <el-option :label="$t('workflowEditor.common.fillInAfterHandling')" value="after" />
90
- </el-select>
91
- </template>
92
- </el-table-column>
93
- </el-table>
94
- <form-fields v-if="showFormFields" @close="setField" />
95
- </div>
96
- </template>
97
- <script>
98
- import { standardValues } from './auto-filled-fields-utils'
99
- import FormFields from '../common/form-fields'
100
- import { getFormFieldLabel } from '../common/form-fields-utils'
101
- export default {
102
- name: 'AutoFilledFields',
103
- components: {
104
- FormFields
105
- },
106
- props: {
107
- value: {
108
- type: Object,
109
- default: () => { return {} }
110
- }
111
- },
112
- data() {
113
- const tableData = []
114
- if (this.value.field !== undefined && this.value.field !== null) {
115
- // xml中有多个field时是数组,只有一个field时是Object
116
- if (Array.isArray(this.value.field)) {
117
- this.value.field.map(field => {
118
- const row = { ...field }
119
- if (typeof (field.value) === 'string' && field.value.indexOf('+') !== -1) {
120
- row.value = field.value.split('+')
121
- } else {
122
- row.value = []
123
- row.value.push(field.value)
124
- }
125
- tableData.push(row)
126
- })
127
- } else {
128
- const row = { ...this.value.field }
129
- if (typeof (this.value.field.value) === 'string' && this.value.field.value.indexOf('+') !== -1) {
130
- row.value = this.value.field.value.split('+')
131
- } else {
132
- row.value = []
133
- row.value.push(this.value.field.value)
134
- }
135
- tableData.push(row)
136
- }
137
- }
138
- return {
139
- tableData,
140
- currentRow: null,
141
- standardValues,
142
- showFormFields: false
143
- }
144
- },
145
- computed: {
146
- keys() {
147
- return Object.keys(this.standardValues)
148
- }
149
- },
150
- watch: {
151
-
152
- },
153
- mounted() {
154
- if (this.tableData && this.tableData.length > 0) {
155
- this.setCurrentRow(this.tableData[0])
156
- }
157
- this.$watch('tableData', function() {
158
- const fields = []
159
- this.tableData.map(row => {
160
- if (row.name !== '' && row.value.length > 0) {
161
- const field = { ...row }
162
- field.value = row.value.join('+')
163
- fields.push(field)
164
- }
165
- })
166
-
167
- this.$emit('input', {
168
- field: fields
169
- })
170
- }, {
171
- // deep为true可以监控数组中的元素的某个属性的变化
172
- deep: true
173
- })
174
- },
175
- created() {
176
- },
177
- methods: {
178
- add() {
179
- for (let i = 0; i < this.tableData.length; i++) {
180
- if (this.tableData[i].name === '' || this.tableData[i].value === '') {
181
- this.$alert(this.$t('workflowEditorMessage.theFieldNameOrFieldValueInLineCannotBeEmpty', { row: (i + 1) }))
182
- return
183
- }
184
- }
185
- const newRow = {
186
- name: '',
187
- value: [],
188
- separator: '',
189
- fillType: 'cover',
190
- fillTime: 'after'
191
- }
192
- this.tableData.push(newRow)
193
- this.setCurrentRow(newRow)
194
- },
195
- remove() {
196
- if (this.currentRow === null) {
197
- this.$alert(this.$t('workflowEditorMessage.pleaseSelectARow'))
198
- return
199
- }
200
- let index
201
- for (let i = 0; i < this.tableData.length; i++) {
202
- if (this.tableData[i].name === this.currentRow.name) {
203
- index = i
204
- break
205
- }
206
- }
207
- this.tableData.splice(index, 1)
208
- // 当前选中的index如果是最后一行,那么删除后,index会等于length造成下标越界,因此需要让index等于新的最后一行
209
- index = (index <= (this.tableData.length - 1) ? index : (this.tableData.length - 1))
210
- this.setCurrentRow(this.tableData[index])
211
- },
212
- setCurrentRow(row) {
213
- this.$refs.table.setCurrentRow(row)
214
- },
215
- handleCurrentChange(val) {
216
- this.currentRow = val
217
- },
218
- checkName(name) {
219
- if (!this.showFormFields && name === '') {
220
- this.$alert(this.$t('workflowEditorMessage.fieldNameCannotBeEmpty'))
221
- }
222
- },
223
- checkValue(value) {
224
- if (value.length === 0) {
225
- this.$alert(this.$t('workflowEditorMessage.fieldValueCannotBeEmpty'))
226
- }
227
- },
228
- setField(name) {
229
- if (name !== undefined) {
230
- this.currentRow.name = name
231
- }
232
- this.showFormFields = false
233
- },
234
- getFieldLabel(name) {
235
- return getFormFieldLabel(name)
236
- }
237
- }
238
- }
239
- </script>
@@ -1,47 +0,0 @@
1
- <template>
2
- <el-form-item :label="label">
3
- <el-checkbox-group v-model="tools">
4
- <el-checkbox label="mail">
5
- {{ $t('workflowEditorPublicModel.mail') }}
6
- </el-checkbox>
7
- <el-checkbox label="sms">
8
- {{ $t('workflowEditorPublicModel.message') }}
9
- </el-checkbox>
10
- <el-checkbox label="app">
11
- {{ $t('workflowEditorPublicModel.App') }}
12
- </el-checkbox>
13
- <el-checkbox label="dingding">
14
- {{ $t('workflowEditorPublicModel.dingding') }}
15
- </el-checkbox>
16
- </el-checkbox-group>
17
- </el-form-item>
18
- </template>
19
- <script>
20
- export default {
21
- name: 'CommonNoticeTool',
22
- props: {
23
- label: {
24
- type: String,
25
- default: null
26
- },
27
- value: {
28
- type: String,
29
- default: null
30
- }
31
- },
32
- data() {
33
- let tools = []
34
- if (this.value && this.value !== '' && this.value !== null) {
35
- tools = this.value.split(',')
36
- }
37
- return {
38
- tools
39
- }
40
- },
41
- watch: {
42
- tools(val) {
43
- this.$emit('input', this.tools.join(','))
44
- }
45
- }
46
- }
47
- </script>