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,275 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-form :model="formModel">
|
|
3
|
+
<el-form-item label="">
|
|
4
|
+
<el-radio-group v-model="formModel.transactor">
|
|
5
|
+
<el-radio label="${instanceCreator}">
|
|
6
|
+
{{ $t('workflowEditor.process.processInitiator') }}
|
|
7
|
+
</el-radio>
|
|
8
|
+
<el-radio v-if="usedIn==='HumanTask'" label="${previousTransactorAssignment}">
|
|
9
|
+
{{ $t('workflowEditor.process.appointmentOfHandlerInThePreviousLink') }}
|
|
10
|
+
</el-radio>
|
|
11
|
+
<el-radio label="byField">
|
|
12
|
+
{{ $t('workflowEditor.process.personSpecifiedInFormField') }}
|
|
13
|
+
</el-radio>
|
|
14
|
+
<el-radio label="byDeptField">
|
|
15
|
+
{{ $t('workflowEditor.process.deptSpecifiedInFormField') }}
|
|
16
|
+
</el-radio>
|
|
17
|
+
<el-radio label="byCondition">
|
|
18
|
+
{{ $t('workflowEditor.process.filterByCriteria') }}
|
|
19
|
+
</el-radio>
|
|
20
|
+
</el-radio-group>
|
|
21
|
+
<div v-if="formModel.transactor==='byCondition'">
|
|
22
|
+
<common-user-condition v-model="formModel.userCondition" used-in="transactor" />
|
|
23
|
+
</div>
|
|
24
|
+
<el-form-item
|
|
25
|
+
v-if="formModel.transactor==='byField' || formModel.transactor==='byDeptField' "
|
|
26
|
+
:label="$t('workflowEditor.process.fieldName')"
|
|
27
|
+
prop="selectedField"
|
|
28
|
+
required
|
|
29
|
+
label-width="80px"
|
|
30
|
+
>
|
|
31
|
+
<el-input :value="formatLabel(formModel.selectedField)" @focus="showFormFields=true" />
|
|
32
|
+
<form-fields v-if="showFormFields" @close="setField" />
|
|
33
|
+
</el-form-item>
|
|
34
|
+
<div v-if="formModel.transactor==='byCondition' || formModel.transactor==='byField' || formModel.transactor==='byDeptField'">
|
|
35
|
+
<el-form-item :label="$t('workflowEditor.process.additionalConditions')">
|
|
36
|
+
<el-checkbox v-model="formModel.additionalCondition.onlyInCreatorDepartment">
|
|
37
|
+
{{ $t('workflowEditor.process.handlingYyThePersonnelOfTheDepartmentOfTheInitiator') }}
|
|
38
|
+
</el-checkbox>
|
|
39
|
+
<el-checkbox v-model="formModel.additionalCondition.withCreatorDepartment">
|
|
40
|
+
{{ $t('workflowEditor.process.personnelOfTheDepartmentWhereTheInitiatorWorksParticipateInTheHandling') }}
|
|
41
|
+
</el-checkbox>
|
|
42
|
+
<el-checkbox v-model="formModel.additionalCondition.selectOneFromMultiple">
|
|
43
|
+
{{ $t('workflowEditor.process.selectSpecificHandler') }}
|
|
44
|
+
</el-checkbox>
|
|
45
|
+
<el-checkbox v-model="formModel.additionalCondition.selectOneFromDept">
|
|
46
|
+
{{ $t('workflowEditor.process.selectOneFromDept') }}
|
|
47
|
+
</el-checkbox>
|
|
48
|
+
<el-checkbox v-if="isSubprocess" v-model="formModel.additionalCondition.generateOneInstanceFromDept">
|
|
49
|
+
{{ $t('workflowEditor.process.generateOneInstanceFromDept') }}
|
|
50
|
+
</el-checkbox>
|
|
51
|
+
<el-checkbox v-if="isCountersign" v-model="formModel.additionalCondition.activateOneVoteVeto">
|
|
52
|
+
{{ $t('workflowEditor.process.activateOneVoteVeto') }}
|
|
53
|
+
</el-checkbox>
|
|
54
|
+
</el-form-item>
|
|
55
|
+
<div v-if="formModel.additionalCondition.selectOneFromMultiple">
|
|
56
|
+
<el-form-item :label="$t('workflowEditor.process.selectionMethod')">
|
|
57
|
+
<el-radio-group v-model="formModel.additionalCondition.selectType">
|
|
58
|
+
<el-radio label="customType">
|
|
59
|
+
{{ $t('workflowEditor.process.manualSelection') }}
|
|
60
|
+
</el-radio>
|
|
61
|
+
<el-radio label="autoType">
|
|
62
|
+
{{ $t('workflowEditor.process.autoSelect') }}
|
|
63
|
+
</el-radio>
|
|
64
|
+
</el-radio-group>
|
|
65
|
+
</el-form-item>
|
|
66
|
+
<el-form-item
|
|
67
|
+
v-show="formModel.additionalCondition.selectType==='autoType'"
|
|
68
|
+
:label="$t('workflowEditor.process.callbackURL')"
|
|
69
|
+
:rules="[{ required: true, message: this.$t('workflowEditor.process.cannotBeEmpty'), trigger: 'blur' }]"
|
|
70
|
+
prop="additionalCondition.selectUrl"
|
|
71
|
+
>
|
|
72
|
+
<el-input v-model="formModel.additionalCondition.selectUrl" />
|
|
73
|
+
</el-form-item>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</el-form-item>
|
|
77
|
+
<el-form-item
|
|
78
|
+
v-if="usedIn==='HumanTask' && formModel.transactor==='${previousTransactorAssignment}'"
|
|
79
|
+
:rules="[{ required: true, message: this.$t('workflowEditor.process.cannotBeEmpty'), trigger: 'blur' }]"
|
|
80
|
+
:label="$t('workflowEditor.process.selectURL')"
|
|
81
|
+
prop="url"
|
|
82
|
+
label-width="80px"
|
|
83
|
+
>
|
|
84
|
+
<el-input v-model.trim="formModel.url" @change="handleUrlChange" />
|
|
85
|
+
</el-form-item>
|
|
86
|
+
</el-form>
|
|
87
|
+
</template>
|
|
88
|
+
<script>
|
|
89
|
+
import CommonUserCondition from '../common/common-user-condition'
|
|
90
|
+
import FormFields from '../common/form-fields'
|
|
91
|
+
import { getFormFieldLabel } from '../common/form-fields-utils.js'
|
|
92
|
+
export default {
|
|
93
|
+
name: 'TransactorSettings',
|
|
94
|
+
components: {
|
|
95
|
+
CommonUserCondition,
|
|
96
|
+
FormFields
|
|
97
|
+
},
|
|
98
|
+
props: {
|
|
99
|
+
model: {
|
|
100
|
+
type: Object,
|
|
101
|
+
default: null
|
|
102
|
+
},
|
|
103
|
+
usedIn: {
|
|
104
|
+
type: String,
|
|
105
|
+
default: 'HumanTask'// 取值为HumanTask,CopyTask
|
|
106
|
+
},
|
|
107
|
+
// 是否是子流程
|
|
108
|
+
isSubprocess: {
|
|
109
|
+
type: Boolean,
|
|
110
|
+
default: false
|
|
111
|
+
},
|
|
112
|
+
// basicProperties
|
|
113
|
+
basicProperties: {
|
|
114
|
+
type: Object,
|
|
115
|
+
default: null
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
data() {
|
|
119
|
+
/**
|
|
120
|
+
* 这个页签上有很多的动态效果,为了保持这些效果切换时,值不丢失,不能直接使用传进来的model对象,
|
|
121
|
+
* 而是要复制一份数据保存到formModel中,这样动态改变model时,formModel中的数据还存在,
|
|
122
|
+
* 用户在不同选项间切换时,数据得以保留,这样用户体验能好点。但是细节的处理确实比较繁琐,需要注意。
|
|
123
|
+
*/
|
|
124
|
+
const formModel = { selectedField: '' }
|
|
125
|
+
// 不直接使用model.userCondition是为了在流程发起人等四个方式间切换时,设置的筛选条件不丢失
|
|
126
|
+
this.initFormModel(formModel)
|
|
127
|
+
return {
|
|
128
|
+
showFormFields: false,
|
|
129
|
+
formModel,
|
|
130
|
+
isCountersign: false
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
mounted() {
|
|
134
|
+
// formModel.additionalCondition和userCondition的变化需要回写到xml中
|
|
135
|
+
this.$watch('formModel', function() {
|
|
136
|
+
this.setTransactor(this.formModel.transactor)
|
|
137
|
+
const additionalCondition = { ...this.formModel.additionalCondition }
|
|
138
|
+
if (additionalCondition.selectOneFromMultiple) {
|
|
139
|
+
if (additionalCondition.selectType === 'customType') {
|
|
140
|
+
delete additionalCondition['selectUrl']
|
|
141
|
+
}
|
|
142
|
+
} else {
|
|
143
|
+
delete additionalCondition['selectType']
|
|
144
|
+
delete additionalCondition['selectUrl']
|
|
145
|
+
}
|
|
146
|
+
this.model.additionalCondition = additionalCondition
|
|
147
|
+
}, {
|
|
148
|
+
deep: true
|
|
149
|
+
})
|
|
150
|
+
this.$watch('basicProperties', function() {
|
|
151
|
+
this.showActivateOneVoteVeto()
|
|
152
|
+
}, {
|
|
153
|
+
deep: true
|
|
154
|
+
})
|
|
155
|
+
this.showActivateOneVoteVeto()
|
|
156
|
+
},
|
|
157
|
+
methods: {
|
|
158
|
+
formatLabel(name) {
|
|
159
|
+
return getFormFieldLabel(name)
|
|
160
|
+
},
|
|
161
|
+
initFormModel(formModel) {
|
|
162
|
+
formModel.userCondition = ''
|
|
163
|
+
const userCondition = this.model.userCondition
|
|
164
|
+
if (typeof (userCondition) === 'undefined' || userCondition === '' || userCondition === null) {
|
|
165
|
+
// 表示是初始化时
|
|
166
|
+
formModel.transactor = '${instanceCreator}'
|
|
167
|
+
this.model.userCondition = '${instanceCreator}'
|
|
168
|
+
} else {
|
|
169
|
+
if (userCondition === '${instanceCreator}' || userCondition === '${previousTransactorAssignment}') {
|
|
170
|
+
formModel.transactor = userCondition
|
|
171
|
+
} else if (userCondition.startsWith('${field[') && userCondition.indexOf('${field[') >= 0 && userCondition.indexOf('"selectedField": "${field[') < 2) {
|
|
172
|
+
formModel.transactor = 'byField'
|
|
173
|
+
formModel.selectedField = userCondition
|
|
174
|
+
} else if (userCondition.startsWith('${deptField[')) {
|
|
175
|
+
formModel.transactor = 'byDeptField'
|
|
176
|
+
formModel.selectedField = userCondition
|
|
177
|
+
} else {
|
|
178
|
+
formModel.transactor = 'byCondition'
|
|
179
|
+
formModel.userCondition = userCondition
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
this.initAdditionalCondition(formModel)
|
|
183
|
+
if (this.model.url !== undefined) {
|
|
184
|
+
formModel.url = this.model.url
|
|
185
|
+
} else {
|
|
186
|
+
formModel.url = ''
|
|
187
|
+
}
|
|
188
|
+
// this.changeA(formModel.transactor)
|
|
189
|
+
},
|
|
190
|
+
initAdditionalCondition(formModel) {
|
|
191
|
+
// 由于xml中的additionalCondition可能没有,这时就需要自己构造一个additionalCondition
|
|
192
|
+
if (this.model.additionalCondition === undefined) {
|
|
193
|
+
formModel.additionalCondition = {
|
|
194
|
+
onlyInCreatorDepartment: false,
|
|
195
|
+
withCreatorDepartment: false,
|
|
196
|
+
selectOneFromMultiple: false,
|
|
197
|
+
selectType: 'customType', // customType表示由办理用户选择,autoType表示由程序bean自动选择
|
|
198
|
+
selectUrl: ''// 类型为autoType时,输入的URL
|
|
199
|
+
}
|
|
200
|
+
} else {
|
|
201
|
+
// 直接复制已有的值,不要指向同一个对象
|
|
202
|
+
formModel.additionalCondition = { ...this.model.additionalCondition }
|
|
203
|
+
// 如果xml中没有selectType,需要给selectType合适的默认值
|
|
204
|
+
if (formModel.additionalCondition.selectType === undefined) {
|
|
205
|
+
formModel.additionalCondition.selectType = 'customType'
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
changeA(transactor) {
|
|
210
|
+
this.setTransactor(transactor)
|
|
211
|
+
},
|
|
212
|
+
// 把url的值赋值给xml
|
|
213
|
+
handleUrlChange(val) {
|
|
214
|
+
this.model.url = val
|
|
215
|
+
},
|
|
216
|
+
setTransactor(val) {
|
|
217
|
+
if (val === '${instanceCreator}' || val === '${previousTransactorAssignment}') {
|
|
218
|
+
this.model.userCondition = val
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (val === 'byField') {
|
|
222
|
+
this.model.userCondition = this.formModel.selectedField
|
|
223
|
+
}
|
|
224
|
+
if (val === 'byCondition') {
|
|
225
|
+
this.model.userCondition = this.formModel.userCondition
|
|
226
|
+
}
|
|
227
|
+
// 不是上一环节办理人指定时,需要清空xml中的url
|
|
228
|
+
if (val === '${previousTransactorAssignment}') {
|
|
229
|
+
this.model.url = this.formModel.url
|
|
230
|
+
} else {
|
|
231
|
+
this.model.url = ''
|
|
232
|
+
}
|
|
233
|
+
// if (val === 'byDeptField') {
|
|
234
|
+
// this.model.userCondition = this.formModel.selectedField
|
|
235
|
+
// }
|
|
236
|
+
|
|
237
|
+
// 不是按条件筛选的时候,需要清空xml中additionalCondition
|
|
238
|
+
if (val === 'byCondition') {
|
|
239
|
+
// 把值复制到xml中,不要直接指向同一个对象,否则回调url这些值就不能正确同步了
|
|
240
|
+
this.model.additionalCondition = { ...this.formModel.additionalCondition }
|
|
241
|
+
} else {
|
|
242
|
+
this.model.additionalCondition = undefined
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
handleFieldSelection(val) {
|
|
246
|
+
|
|
247
|
+
},
|
|
248
|
+
setField(name) {
|
|
249
|
+
if (name !== undefined) {
|
|
250
|
+
if (this.formModel.transactor === 'byDeptField') {
|
|
251
|
+
this.formModel.selectedField = '${deptField[' + name + ']}'
|
|
252
|
+
this.model.userCondition = this.formModel.selectedField
|
|
253
|
+
} else {
|
|
254
|
+
this.formModel.selectedField = '${field[' + name + ']}'
|
|
255
|
+
this.model.userCondition = this.formModel.selectedField
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
this.showFormFields = false
|
|
259
|
+
},
|
|
260
|
+
/**
|
|
261
|
+
* 会签时显示一票否决配置
|
|
262
|
+
*/
|
|
263
|
+
showActivateOneVoteVeto() {
|
|
264
|
+
if (this.basicProperties && this.basicProperties.processingMode) {
|
|
265
|
+
if (this.basicProperties.processingMode.type === 'COUNTERSIGN') {
|
|
266
|
+
this.isCountersign = true
|
|
267
|
+
} else {
|
|
268
|
+
this.isCountersign = false
|
|
269
|
+
this.formModel.additionalCondition.activateOneVoteVeto = false
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
</script>
|
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-form-item :label="label" :label-width="labelWidth">
|
|
3
|
+
<el-col>
|
|
4
|
+
<el-checkbox-group v-model="checkList">
|
|
5
|
+
<el-checkbox label="${instanceCreator}">
|
|
6
|
+
{{ $t('workflowEditor.process.processInitiator') }}
|
|
7
|
+
</el-checkbox>
|
|
8
|
+
<el-checkbox label="${processAdmin}">
|
|
9
|
+
{{ $t('workflowEditor.process.processAdministrator') }}
|
|
10
|
+
</el-checkbox>
|
|
11
|
+
<el-checkbox v-if="currentTransactor" label="${currentTransactor}">
|
|
12
|
+
{{ $t('workflowEditor.process.currentHandler') }}
|
|
13
|
+
</el-checkbox>
|
|
14
|
+
<el-checkbox v-else label="${allHandleTransactors}">
|
|
15
|
+
{{ $t('workflowEditor.process.allHandlingPersonnel') }}
|
|
16
|
+
</el-checkbox>
|
|
17
|
+
<el-checkbox label="assignUser" @change="toggleUserList">
|
|
18
|
+
{{ $t('workflowEditor.process.designatedPersonnel') }}
|
|
19
|
+
</el-checkbox>
|
|
20
|
+
</el-checkbox-group>
|
|
21
|
+
</el-col>
|
|
22
|
+
<div v-if="showUserList">
|
|
23
|
+
<el-col>
|
|
24
|
+
<el-row>
|
|
25
|
+
<el-col :span="4">
|
|
26
|
+
{{ $t('workflowEditor.process.listOfDesignatedPersons') }}
|
|
27
|
+
</el-col>
|
|
28
|
+
<el-col :span="5">
|
|
29
|
+
<el-dropdown size="mini" split-button type="primary" plain @command="handleCommand">
|
|
30
|
+
<span class="el-dropdown-link">
|
|
31
|
+
<i class="el-icon-search" /> {{ $t('workflowEditorPublicModel.choice') }}
|
|
32
|
+
</span>
|
|
33
|
+
<el-dropdown-menu slot="dropdown">
|
|
34
|
+
<el-dropdown-item command="selectUser" @click="selectPointUser()">
|
|
35
|
+
{{ $t('workflowEditor.common.selectusers') }}
|
|
36
|
+
</el-dropdown-item>
|
|
37
|
+
<el-dropdown-item command="selectDepartment" @click="selectPointDepartment()">
|
|
38
|
+
{{ $t('workflowEditor.common.selectDepartment') }}
|
|
39
|
+
</el-dropdown-item>
|
|
40
|
+
<el-dropdown-item command="selectWorkgroup" @click="selectPointWorkgroup()">
|
|
41
|
+
{{ $t('workflowEditor.common.selectTeam') }}
|
|
42
|
+
</el-dropdown-item>
|
|
43
|
+
<el-dropdown-item command="selectRole" @click="selectPointRole()">
|
|
44
|
+
{{ $t('workflowEditor.common.selectRole') }}
|
|
45
|
+
</el-dropdown-item>
|
|
46
|
+
<el-dropdown-item command="selectField" @click="selectPointField()">
|
|
47
|
+
{{ $t('workflowEditor.common.selectField') }}
|
|
48
|
+
</el-dropdown-item>
|
|
49
|
+
</el-dropdown-menu>
|
|
50
|
+
</el-dropdown>
|
|
51
|
+
</el-col>
|
|
52
|
+
<el-col :span="3">
|
|
53
|
+
<el-button type="primary" size="mini" plain icon="el-icon-delete" @click="resetSelectedUsers">
|
|
54
|
+
{{ $t('workflowEditorPublicModel.empty') }}
|
|
55
|
+
</el-button>
|
|
56
|
+
</el-col>
|
|
57
|
+
</el-row>
|
|
58
|
+
<el-row>
|
|
59
|
+
<el-col>
|
|
60
|
+
<el-input
|
|
61
|
+
v-model="selectedUsersShowValue"
|
|
62
|
+
type="textarea"
|
|
63
|
+
:rows="2"
|
|
64
|
+
:placeholder="$t('workflowEditorMessage.pleaseSelectPersonnel')"
|
|
65
|
+
/>
|
|
66
|
+
</el-col>
|
|
67
|
+
</el-row>
|
|
68
|
+
</el-col>
|
|
69
|
+
<department-user-tree v-if="showSelectUser" width="60%" :multiple="true" @close="addPointUsers" />
|
|
70
|
+
<department-tree v-if="showSelectDepartment" width="30%" :multiple="true" @close="addPointDepartments" />
|
|
71
|
+
<workgroup-tree v-if="showSelectWorkgroup" width="30%" :multiple="true" @close="addPointWorkgroups" />
|
|
72
|
+
<system-role-tree v-if="showSelectRole" :multiple="true" @close="addPointRoles" />
|
|
73
|
+
<form-fields v-if="showSelectField" @close="setField" />
|
|
74
|
+
</div>
|
|
75
|
+
</el-form-item>
|
|
76
|
+
</template>
|
|
77
|
+
<script>
|
|
78
|
+
import FormFields from '../common/form-fields'
|
|
79
|
+
import SystemRoleTree from './system-role-tree'
|
|
80
|
+
import { getFormFieldLabel } from '../common/form-fields-utils.js'
|
|
81
|
+
export default {
|
|
82
|
+
name: 'UserSelection',
|
|
83
|
+
components: {
|
|
84
|
+
SystemRoleTree,
|
|
85
|
+
FormFields
|
|
86
|
+
},
|
|
87
|
+
props: {
|
|
88
|
+
label: {
|
|
89
|
+
type: String,
|
|
90
|
+
default: ''
|
|
91
|
+
},
|
|
92
|
+
labelWidth: {
|
|
93
|
+
type: String,
|
|
94
|
+
default: null
|
|
95
|
+
},
|
|
96
|
+
value: {
|
|
97
|
+
type: String,
|
|
98
|
+
default: ''
|
|
99
|
+
},
|
|
100
|
+
currentTransactor: {
|
|
101
|
+
type: Boolean,
|
|
102
|
+
default: false
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
data() {
|
|
106
|
+
let showUserList = false
|
|
107
|
+
let selectedUsers = ''
|
|
108
|
+
// 流程发起人等前3个选项和指定人员选中的人使用分号(后跟一个空格)来分割,这样区分了前三个选项和最后一个选项
|
|
109
|
+
const users = this.value.split('; ')
|
|
110
|
+
const checkList = users[0].split(' condition.operator.or ')
|
|
111
|
+
if (users.length === 2) {
|
|
112
|
+
showUserList = true
|
|
113
|
+
selectedUsers = users[1].split(' condition.operator.or ')
|
|
114
|
+
checkList.push('assignUser')
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
checkList,
|
|
118
|
+
showUserList,
|
|
119
|
+
selectedUsers,
|
|
120
|
+
showSelectUser: false, // 是否显示用户树
|
|
121
|
+
selectedUsersShowValue: null, // 已选择人员的显示值,例如:用户 等于 '张三/分支1' 或者 用户 等于 '李四/集团公司'
|
|
122
|
+
showSelectDepartment: false, // 是否显示部门树
|
|
123
|
+
showSelectWorkgroup: false, // 是否显示工作组树
|
|
124
|
+
showSelectRole: false, // 是否显示角色树
|
|
125
|
+
showSelectField: false // 是否选择字段
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
watch: {
|
|
129
|
+
checkList(val) {
|
|
130
|
+
this.$emit('input', this.getValue())
|
|
131
|
+
},
|
|
132
|
+
selectedUsers(val) {
|
|
133
|
+
this.$emit('input', this.getValue())
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
created() {
|
|
137
|
+
console.log(this.checkList)
|
|
138
|
+
this.getSelectedUsersShowValue()
|
|
139
|
+
},
|
|
140
|
+
methods: {
|
|
141
|
+
formatLabel(name) {
|
|
142
|
+
return getFormFieldLabel(name)
|
|
143
|
+
},
|
|
144
|
+
getValue() {
|
|
145
|
+
const checkList = this.checkList.filter(item => {
|
|
146
|
+
return item !== '' && item !== 'assignUser'
|
|
147
|
+
})
|
|
148
|
+
let value = checkList.join(' condition.operator.or ')
|
|
149
|
+
if (this.showUserList && this.selectedUsers && this.selectedUsers.length !== 0) {
|
|
150
|
+
value = value + '; ' + this.selectedUsers.join(' condition.operator.or ')
|
|
151
|
+
}
|
|
152
|
+
return value
|
|
153
|
+
},
|
|
154
|
+
toggleUserList() {
|
|
155
|
+
this.showUserList = !this.showUserList
|
|
156
|
+
},
|
|
157
|
+
// 清空已选人员
|
|
158
|
+
resetSelectedUsers() {
|
|
159
|
+
this.selectedUsers = []
|
|
160
|
+
this.selectedUsersShowValue = ''
|
|
161
|
+
},
|
|
162
|
+
// 选择指定人员下拉菜单事件处理
|
|
163
|
+
handleCommand(command) {
|
|
164
|
+
if (command === 'selectUser') {
|
|
165
|
+
this.selectPointUser()
|
|
166
|
+
} else if (command === 'selectDepartment') {
|
|
167
|
+
this.selectPointDepartment()
|
|
168
|
+
} else if (command === 'selectRole') {
|
|
169
|
+
this.selectPointRole()
|
|
170
|
+
} else if (command === 'selectWorkgroup') {
|
|
171
|
+
this.selectPointWorkgroup()
|
|
172
|
+
} else if (command === 'selectField') {
|
|
173
|
+
this.selectPointField()
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
// 显示用户树
|
|
177
|
+
selectPointUser() {
|
|
178
|
+
this.showSelectUser = true
|
|
179
|
+
},
|
|
180
|
+
// 显示部门树
|
|
181
|
+
selectPointDepartment() {
|
|
182
|
+
this.showSelectDepartment = true
|
|
183
|
+
},
|
|
184
|
+
// 显示角色树
|
|
185
|
+
selectPointRole() {
|
|
186
|
+
this.showSelectRole = true
|
|
187
|
+
},
|
|
188
|
+
selectPointField() {
|
|
189
|
+
this.showSelectField = true
|
|
190
|
+
},
|
|
191
|
+
// 显示工作组树
|
|
192
|
+
selectPointWorkgroup() {
|
|
193
|
+
this.showSelectWorkgroup = true
|
|
194
|
+
},
|
|
195
|
+
// 选择用户
|
|
196
|
+
addPointUsers(selectNodeInfo) {
|
|
197
|
+
if (selectNodeInfo) {
|
|
198
|
+
const isContainBranch = selectNodeInfo.containBranch
|
|
199
|
+
if (isContainBranch) {
|
|
200
|
+
// 如果包含分支机构,需要拼接分支编码,格式为:loginName~~branchCode,并封装为用户条件
|
|
201
|
+
this.packageSelectedUserConditionsWithBranch(selectNodeInfo.users)
|
|
202
|
+
} else {
|
|
203
|
+
// 如果不包含分支机构,直接封装为用户条件
|
|
204
|
+
this.packageSelectedUserConditionsWithOutBranch(selectNodeInfo.users)
|
|
205
|
+
}
|
|
206
|
+
// 获得显示时的条件值
|
|
207
|
+
this.getSelectedUsersShowValue()
|
|
208
|
+
}
|
|
209
|
+
this.showSelectUser = false
|
|
210
|
+
},
|
|
211
|
+
// 如果包含分支机构,需要拼接分支编码,格式为:loginName~~branchCode,并封装为用户条件
|
|
212
|
+
packageSelectedUserConditionsWithBranch(selectedUsers) {
|
|
213
|
+
// 用户登录名和分支编码的分隔符
|
|
214
|
+
const loginNameAndBranchSeparator = '~~'
|
|
215
|
+
// 用户姓名和分支名称的分隔符
|
|
216
|
+
const userNameAndBranchSeparator = '/'
|
|
217
|
+
const fixCondition = '${user} operator.text.eq '
|
|
218
|
+
selectedUsers.forEach(user => {
|
|
219
|
+
let loginName = user.loginName
|
|
220
|
+
let userName = user.name
|
|
221
|
+
if (user.subCompanyId && user.subCompanyId !== null) {
|
|
222
|
+
// 用户属于分支机构,拼接分支机构编码
|
|
223
|
+
const branchCode = user.subCompanyCode
|
|
224
|
+
const branchName = user.subCompanyName
|
|
225
|
+
loginName = loginName + loginNameAndBranchSeparator + branchCode
|
|
226
|
+
userName = userName + userNameAndBranchSeparator + branchName
|
|
227
|
+
} else {
|
|
228
|
+
// 用户属于集团公司,拼接公司编码
|
|
229
|
+
loginName = loginName + loginNameAndBranchSeparator + user.tenantCode
|
|
230
|
+
userName = userName + userNameAndBranchSeparator + user.tenantName
|
|
231
|
+
}
|
|
232
|
+
const condition = fixCondition + userName + '[' + loginName + ']'
|
|
233
|
+
if (this.selectedUsers) {
|
|
234
|
+
const selectedCondition = this.selectedUsers.filter(this.filterCondition(condition))
|
|
235
|
+
if (selectedCondition.length === 0) {
|
|
236
|
+
this.selectedUsers.push(condition)
|
|
237
|
+
}
|
|
238
|
+
} else {
|
|
239
|
+
this.selectedUsers = []
|
|
240
|
+
this.selectedUsers.push(condition)
|
|
241
|
+
}
|
|
242
|
+
})
|
|
243
|
+
},
|
|
244
|
+
// 如果不包含分支机构,直接封装为用户条件
|
|
245
|
+
packageSelectedUserConditionsWithOutBranch(selectedUsers) {
|
|
246
|
+
const fixCondition = '${user} operator.text.eq '
|
|
247
|
+
selectedUsers.forEach(user => {
|
|
248
|
+
const condition = fixCondition + user.name + '[' + user.loginName + ']'
|
|
249
|
+
const selectedUserCondition = this.selectedUsers.filter(this.filterCondition(condition))
|
|
250
|
+
if (selectedUserCondition.length === 0) {
|
|
251
|
+
this.selectedUsers.push(condition)
|
|
252
|
+
}
|
|
253
|
+
})
|
|
254
|
+
},
|
|
255
|
+
// 获得显示时的条件值
|
|
256
|
+
getSelectedUsersShowValue() {
|
|
257
|
+
if (this.selectedUsers) {
|
|
258
|
+
const selectedUsersCondition = this.selectedUsers.join(' condition.operator.or ')
|
|
259
|
+
this.selectedUsersShowValue = selectedUsersCondition.replace(/\$\{user\}/g, '用户')
|
|
260
|
+
.replace(/\$\{department\}/g, '部门').replace(/\$\{workGroup\}/g, '工作组')
|
|
261
|
+
.replace(/\$\{role\}/g, '角色')
|
|
262
|
+
.replace(/operator\.text\.eq/g, '等于').replace(/condition\.operator\.or/g, '或者')
|
|
263
|
+
.replace(/\$\{field/g, '字段').replace(/]\}/g, ']')
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
// 过滤已选条件中是否包含condition条件
|
|
267
|
+
filterCondition(condition) {
|
|
268
|
+
return (selectedUserCondition) => {
|
|
269
|
+
return selectedUserCondition === condition
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
// 选择部门
|
|
273
|
+
addPointDepartments(selectNodeInfo) {
|
|
274
|
+
if (selectNodeInfo) {
|
|
275
|
+
const isContainBranch = selectNodeInfo.containBranch
|
|
276
|
+
if (isContainBranch) {
|
|
277
|
+
// 如果包含分支机构,需要拼接显示的分支名称,格式为:部门名称/分支名称,并封装为部门条件
|
|
278
|
+
this.packageSelectedDepartmentOrWorkgroupConditionsWithBranch(selectNodeInfo.departments, '${department}')
|
|
279
|
+
} else {
|
|
280
|
+
// 如果不包含分支机构,直接封装为部门条件
|
|
281
|
+
this.packageSelectedDepartmentOrWorkgroupConditionsWithOutBranch(selectNodeInfo.departments, '${department}')
|
|
282
|
+
}
|
|
283
|
+
// 获得显示时的条件值
|
|
284
|
+
this.getSelectedUsersShowValue()
|
|
285
|
+
}
|
|
286
|
+
this.showSelectDepartment = false
|
|
287
|
+
},
|
|
288
|
+
// 如果包含分支机构,需要拼接显示的分支名称,格式为:部门名称/分支名称 或 工作组名称/分支名称,并封装为部门 或 工作组条件
|
|
289
|
+
packageSelectedDepartmentOrWorkgroupConditionsWithBranch(selectedDepartments, type) {
|
|
290
|
+
// 部门姓名和分支名称的分隔符
|
|
291
|
+
const departmentNameAndBranchSeparator = '/'
|
|
292
|
+
const fixCondition = type + ' operator.text.eq '
|
|
293
|
+
selectedDepartments.forEach(department => {
|
|
294
|
+
const departmentCode = department.code
|
|
295
|
+
let departmentName = department.name
|
|
296
|
+
if (department.subCompanyId && department.subCompanyId !== null) {
|
|
297
|
+
// 用户属于分支机构,拼接分支机构名称
|
|
298
|
+
const branchName = department.subCompanyName
|
|
299
|
+
if (branchName && branchName !== '') {
|
|
300
|
+
departmentName = departmentName + departmentNameAndBranchSeparator + branchName
|
|
301
|
+
}
|
|
302
|
+
} else {
|
|
303
|
+
// 用户属于集团公司,拼接公司名称
|
|
304
|
+
departmentName = departmentName + departmentNameAndBranchSeparator + department.tenantName
|
|
305
|
+
}
|
|
306
|
+
const condition = fixCondition + departmentName + '[' + departmentCode + ']'
|
|
307
|
+
if (this.selectedUsers) {
|
|
308
|
+
const selectedCondition = this.selectedUsers.filter(this.filterCondition(condition))
|
|
309
|
+
if (selectedCondition.length === 0) {
|
|
310
|
+
this.selectedUsers.push(condition)
|
|
311
|
+
}
|
|
312
|
+
} else {
|
|
313
|
+
this.selectedUsers = []
|
|
314
|
+
this.selectedUsers.push(condition)
|
|
315
|
+
}
|
|
316
|
+
})
|
|
317
|
+
},
|
|
318
|
+
// 如果不包含分支机构,直接封装为部门条件 或 工作组条件
|
|
319
|
+
packageSelectedDepartmentOrWorkgroupConditionsWithOutBranch(selectedDepartments, type) {
|
|
320
|
+
const fixCondition = type + ' operator.text.eq '
|
|
321
|
+
selectedDepartments.forEach(department => {
|
|
322
|
+
const condition = fixCondition + department.name + '[' + department.code + ']'
|
|
323
|
+
if (this.selectedUsers) {
|
|
324
|
+
const selectedCondition = this.selectedUsers.filter(this.filterCondition(condition))
|
|
325
|
+
if (selectedCondition.length === 0) {
|
|
326
|
+
this.selectedUsers.push(condition)
|
|
327
|
+
}
|
|
328
|
+
} else {
|
|
329
|
+
this.selectedUsers = []
|
|
330
|
+
this.selectedUsers.push(condition)
|
|
331
|
+
}
|
|
332
|
+
})
|
|
333
|
+
},
|
|
334
|
+
// 选择工作组
|
|
335
|
+
addPointWorkgroups(selectNodeInfo) {
|
|
336
|
+
if (selectNodeInfo) {
|
|
337
|
+
const isContainBranch = selectNodeInfo.containBranch
|
|
338
|
+
if (isContainBranch) {
|
|
339
|
+
// 如果包含分支机构,需要拼接分支名称,格式为:工作组名称/分支名称,并封装为工作组条件
|
|
340
|
+
this.packageSelectedDepartmentOrWorkgroupConditionsWithBranch(selectNodeInfo.workgroups, '${workGroup}')
|
|
341
|
+
} else {
|
|
342
|
+
// 如果不包含分支机构,直接封装为工作组条件
|
|
343
|
+
this.packageSelectedDepartmentOrWorkgroupConditionsWithOutBranch(selectNodeInfo.workgroups, '${workGroup}')
|
|
344
|
+
}
|
|
345
|
+
// 获得显示时的条件值
|
|
346
|
+
this.getSelectedUsersShowValue()
|
|
347
|
+
}
|
|
348
|
+
this.showSelectWorkgroup = false
|
|
349
|
+
},
|
|
350
|
+
// 选择角色
|
|
351
|
+
addPointRoles(selectNodeInfo) {
|
|
352
|
+
if (selectNodeInfo) {
|
|
353
|
+
// 角色不需要考虑分支机构
|
|
354
|
+
this.packageSelectedDepartmentOrWorkgroupConditionsWithOutBranch(selectNodeInfo.roles, '${role}')
|
|
355
|
+
// 获得显示时的条件值
|
|
356
|
+
this.getSelectedUsersShowValue()
|
|
357
|
+
}
|
|
358
|
+
this.showSelectRole = false
|
|
359
|
+
},
|
|
360
|
+
// 如果不包含分支机构,直接封装为部门条件 或 工作组条件
|
|
361
|
+
packageSelectedFieldConditions(fieldName, type) {
|
|
362
|
+
const fixCondition = type + ' operator.text.eq '
|
|
363
|
+
const condition = fixCondition + '${field[' + fieldName + ']}'
|
|
364
|
+
if (this.selectedUsers) {
|
|
365
|
+
const selectedCondition = this.selectedUsers.filter(this.filterCondition(condition))
|
|
366
|
+
if (selectedCondition.length === 0) {
|
|
367
|
+
this.selectedUsers.push(condition)
|
|
368
|
+
}
|
|
369
|
+
} else {
|
|
370
|
+
this.selectedUsers = []
|
|
371
|
+
this.selectedUsers.push(condition)
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
// 选择字段
|
|
375
|
+
setField(name) {
|
|
376
|
+
if (name !== undefined) {
|
|
377
|
+
this.packageSelectedFieldConditions(name, '${user}')
|
|
378
|
+
// 获得显示时的条件值
|
|
379
|
+
this.getSelectedUsersShowValue()
|
|
380
|
+
}
|
|
381
|
+
this.showSelectField = false
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
</script>
|
|
386
|
+
|