workflow-editor 0.9.68-dw → 0.9.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/workflow-editor.css +1 -1
- package/lib/workflow-editor.umd.min.js +10 -10
- package/package.json +2 -2
- package/packages/index.js +34 -0
- package/packages/plugins/formValidatorUtil.js +533 -0
- package/packages/plugins/index.js +8 -0
- package/packages/workflow-editor/index.js +14 -0
- package/packages/workflow-editor/src/api.js +7 -0
- package/packages/workflow-editor/src/assets/wf-editor-icons.js +2 -0
- package/packages/workflow-editor/src/constant.js +8 -0
- package/packages/workflow-editor/src/json-object-templates/auto-task.js +70 -0
- package/packages/workflow-editor/src/json-object-templates/copy-task.js +72 -0
- package/packages/workflow-editor/src/json-object-templates/decision.js +11 -0
- package/packages/workflow-editor/src/json-object-templates/end.js +14 -0
- package/packages/workflow-editor/src/json-object-templates/fork.js +10 -0
- package/packages/workflow-editor/src/json-object-templates/human-decision.js +9 -0
- package/packages/workflow-editor/src/json-object-templates/human-task.js +199 -0
- package/packages/workflow-editor/src/json-object-templates/join.js +10 -0
- package/packages/workflow-editor/src/json-object-templates/process.js +98 -0
- package/packages/workflow-editor/src/json-object-templates/start.js +13 -0
- package/packages/workflow-editor/src/json-object-templates/subprocess.js +31 -0
- package/packages/workflow-editor/src/json-object-templates/transition.js +26 -0
- package/packages/workflow-editor/src/main/admin-save-dialog.vue +66 -0
- package/packages/workflow-editor/src/main/canvas.vue +483 -0
- package/packages/workflow-editor/src/main/context-menu.vue +132 -0
- package/packages/workflow-editor/src/main/icon-svg.vue +32 -0
- package/packages/workflow-editor/src/main/selection-region.vue +66 -0
- package/packages/workflow-editor/src/main/tache-history-tooltip.vue +38 -0
- package/packages/workflow-editor/src/main/tache-name-input.vue +19 -0
- package/packages/workflow-editor/src/main/tache-subprocess-history-dialog.vue +35 -0
- package/packages/workflow-editor/src/main/toolbox.vue +60 -0
- package/packages/workflow-editor/src/main/wf-history-canvas.vue +304 -0
- package/packages/workflow-editor/src/process-json.js +623 -0
- package/packages/workflow-editor/src/process-service.js +31 -0
- package/packages/workflow-editor/src/properties-editors/auto-task/basic-properties.vue +81 -0
- package/packages/workflow-editor/src/properties-editors/auto-task/permission-settings.vue +155 -0
- package/packages/workflow-editor/src/properties-editors/auto-task.vue +73 -0
- package/packages/workflow-editor/src/properties-editors/common/additional-condition-utils.js +556 -0
- package/packages/workflow-editor/src/properties-editors/common/additional-condition.vue +276 -0
- package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields-utils.js +34 -0
- package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields.vue +239 -0
- package/packages/workflow-editor/src/properties-editors/common/common-notice-tool.vue +67 -0
- package/packages/workflow-editor/src/properties-editors/common/common-user-condition.vue +241 -0
- package/packages/workflow-editor/src/properties-editors/common/form-fields-utils.js +23 -0
- package/packages/workflow-editor/src/properties-editors/common/form-fields.vue +116 -0
- package/packages/workflow-editor/src/properties-editors/common/i18n-input.vue +75 -0
- package/packages/workflow-editor/src/properties-editors/common/i18n-set-dialog.vue +125 -0
- package/packages/workflow-editor/src/properties-editors/common/notice-reminder.vue +72 -0
- package/packages/workflow-editor/src/properties-editors/common/notice.vue +101 -0
- package/packages/workflow-editor/src/properties-editors/common/reminder.vue +185 -0
- package/packages/workflow-editor/src/properties-editors/common/select-mail-template.vue +83 -0
- package/packages/workflow-editor/src/properties-editors/common/standard-fields.vue +65 -0
- package/packages/workflow-editor/src/properties-editors/common/system-role-tree-inline.vue +355 -0
- package/packages/workflow-editor/src/properties-editors/common/system-role-tree.vue +63 -0
- package/packages/workflow-editor/src/properties-editors/common/task-title.vue +148 -0
- package/packages/workflow-editor/src/properties-editors/common/transactor-settings.vue +275 -0
- package/packages/workflow-editor/src/properties-editors/common/user-selection.vue +386 -0
- package/packages/workflow-editor/src/properties-editors/common/value-selection-dialog.vue +209 -0
- package/packages/workflow-editor/src/properties-editors/common/variables.vue +135 -0
- package/packages/workflow-editor/src/properties-editors/copy-task/basic-properties.vue +90 -0
- package/packages/workflow-editor/src/properties-editors/copy-task/permission-settings.vue +155 -0
- package/packages/workflow-editor/src/properties-editors/copy-task.vue +94 -0
- package/packages/workflow-editor/src/properties-editors/decision.vue +90 -0
- package/packages/workflow-editor/src/properties-editors/fork.vue +72 -0
- package/packages/workflow-editor/src/properties-editors/human-decision.vue +44 -0
- package/packages/workflow-editor/src/properties-editors/human-task/additional-condition-dialog.vue +60 -0
- package/packages/workflow-editor/src/properties-editors/human-task/basic-properties.vue +160 -0
- package/packages/workflow-editor/src/properties-editors/human-task/componentsConfigUtil.js +291 -0
- package/packages/workflow-editor/src/properties-editors/human-task/custom-actions.vue +249 -0
- package/packages/workflow-editor/src/properties-editors/human-task/editable-child-field-setting.vue +392 -0
- package/packages/workflow-editor/src/properties-editors/human-task/editable-child-fields.vue +241 -0
- package/packages/workflow-editor/src/properties-editors/human-task/editable-field-selection.vue +220 -0
- package/packages/workflow-editor/src/properties-editors/human-task/editable-fields.vue +204 -0
- package/packages/workflow-editor/src/properties-editors/human-task/events.vue +59 -0
- package/packages/workflow-editor/src/properties-editors/human-task/permission-settings.vue +207 -0
- package/packages/workflow-editor/src/properties-editors/human-task/selection-conditions.vue +390 -0
- package/packages/workflow-editor/src/properties-editors/human-task.vue +109 -0
- package/packages/workflow-editor/src/properties-editors/join.vue +44 -0
- package/packages/workflow-editor/src/properties-editors/process/basic-properties.vue +273 -0
- package/packages/workflow-editor/src/properties-editors/process/events.vue +76 -0
- package/packages/workflow-editor/src/properties-editors/process/notice-settings.vue +60 -0
- package/packages/workflow-editor/src/properties-editors/process/parameter-settings.vue +95 -0
- package/packages/workflow-editor/src/properties-editors/process/permission-settings.vue +28 -0
- package/packages/workflow-editor/src/properties-editors/process/selectPage.vue +81 -0
- package/packages/workflow-editor/src/properties-editors/process.vue +115 -0
- package/packages/workflow-editor/src/properties-editors/subprocess/basic-properties.vue +199 -0
- package/packages/workflow-editor/src/properties-editors/subprocess/events.vue +26 -0
- package/packages/workflow-editor/src/properties-editors/subprocess/field-mappings.vue +206 -0
- package/packages/workflow-editor/src/properties-editors/subprocess/transactor-settings.vue +64 -0
- package/packages/workflow-editor/src/properties-editors/subprocess.vue +79 -0
- package/packages/workflow-editor/src/properties-editors/transition/basic-properties.vue +53 -0
- package/packages/workflow-editor/src/properties-editors/transition.vue +74 -0
- package/packages/workflow-editor/src/properties-editors/user-condition.js +183 -0
- package/packages/workflow-editor/src/store/getters.js +27 -0
- package/packages/workflow-editor/src/store/workflow-editor.js +125 -0
- package/packages/workflow-editor/src/taches/auto-task.vue +99 -0
- package/packages/workflow-editor/src/taches/common-methods.js +21 -0
- package/packages/workflow-editor/src/taches/copy-task.vue +99 -0
- package/packages/workflow-editor/src/taches/custom-task.vue +88 -0
- package/packages/workflow-editor/src/taches/decision.vue +102 -0
- package/packages/workflow-editor/src/taches/end.vue +76 -0
- package/packages/workflow-editor/src/taches/fork.vue +102 -0
- package/packages/workflow-editor/src/taches/human-decision.vue +102 -0
- package/packages/workflow-editor/src/taches/human-task.vue +113 -0
- package/packages/workflow-editor/src/taches/join.vue +91 -0
- package/packages/workflow-editor/src/taches/joint.vue +177 -0
- package/packages/workflow-editor/src/taches/start.vue +76 -0
- package/packages/workflow-editor/src/taches/subprocess.vue +99 -0
- package/packages/workflow-editor/src/taches/tache-resizer.vue +80 -0
- package/packages/workflow-editor/src/transitions/broken-line.vue +91 -0
- package/packages/workflow-editor/src/transitions/curve-line.vue +91 -0
- package/packages/workflow-editor/src/transitions/straight-line.vue +26 -0
- package/packages/workflow-editor/src/transitions/transition.vue +212 -0
- package/packages/workflow-editor/src/transitions/virtual-transition.vue +43 -0
- package/packages/workflow-editor/src/util.js +489 -0
- package/packages/workflow-editor/src/workflow-editor.vue +607 -0
- package/packages/workflow-editor/src/workflow-history.vue +153 -0
- package/src/i18n/i18n.js +1 -1
- package/src/i18n/langs/cn.js +43 -24
- package/src/i18n/langs/en.js +23 -7
|
@@ -0,0 +1,276 @@
|
|
|
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>
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,239 @@
|
|
|
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>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-form-item :label="label">
|
|
4
|
+
<el-checkbox-group v-model="tools">
|
|
5
|
+
<el-checkbox label="mail">
|
|
6
|
+
{{ $t('workflowEditorPublicModel.mail') }}
|
|
7
|
+
</el-checkbox>
|
|
8
|
+
<!-- <el-checkbox label="sms">
|
|
9
|
+
{{ $t('workflowEditorPublicModel.message') }}
|
|
10
|
+
</el-checkbox>
|
|
11
|
+
<el-checkbox label="app">
|
|
12
|
+
{{ $t('workflowEditorPublicModel.App') }}
|
|
13
|
+
</el-checkbox>
|
|
14
|
+
<el-checkbox label="dingding">
|
|
15
|
+
{{ $t('workflowEditorPublicModel.dingding') }}
|
|
16
|
+
</el-checkbox> -->
|
|
17
|
+
<el-checkbox label="custom">
|
|
18
|
+
{{ $t('workflowEditorPublicModel.custom') }}
|
|
19
|
+
</el-checkbox>
|
|
20
|
+
</el-checkbox-group>
|
|
21
|
+
</el-form-item>
|
|
22
|
+
<el-form-item v-if="tools.indexOf('custom')>=0" :label="$t('workflowEditor.common.customMsg')">
|
|
23
|
+
<el-input v-model="myCustomMsg" />
|
|
24
|
+
</el-form-item>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
<script>
|
|
28
|
+
export default {
|
|
29
|
+
name: 'CommonNoticeTool',
|
|
30
|
+
props: {
|
|
31
|
+
label: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: null
|
|
34
|
+
},
|
|
35
|
+
value: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: null
|
|
38
|
+
},
|
|
39
|
+
customMsg: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: null
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
data() {
|
|
45
|
+
let tools = []
|
|
46
|
+
if (this.value && this.value !== '' && this.value !== null) {
|
|
47
|
+
tools = this.value.split(',')
|
|
48
|
+
}
|
|
49
|
+
let myCustomMsg = ''
|
|
50
|
+
if (this.customMsg && this.customMsg !== '' && this.customMsg !== null) {
|
|
51
|
+
myCustomMsg = this.customMsg
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
tools,
|
|
55
|
+
myCustomMsg
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
watch: {
|
|
59
|
+
tools(val) {
|
|
60
|
+
this.$emit('input', this.tools.join(','))
|
|
61
|
+
},
|
|
62
|
+
myCustomMsg(val) {
|
|
63
|
+
this.$emit('input-msg', this.myCustomMsg)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
</script>
|