workflow-editor 0.0.7-up → 0.0.8-up
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/package.json +12 -2
- package/index.html +0 -13
- package/packages/index.js +0 -34
- package/packages/plugins/formValidatorUtil.js +0 -533
- package/packages/plugins/index.js +0 -8
- package/packages/workflow-editor/index.js +0 -14
- package/packages/workflow-editor/src/api.js +0 -7
- package/packages/workflow-editor/src/assets/wf-editor-icons.js +0 -2
- package/packages/workflow-editor/src/constant.js +0 -8
- package/packages/workflow-editor/src/json-object-templates/auto-task.js +0 -70
- package/packages/workflow-editor/src/json-object-templates/copy-task.js +0 -72
- package/packages/workflow-editor/src/json-object-templates/decision.js +0 -11
- package/packages/workflow-editor/src/json-object-templates/end.js +0 -14
- package/packages/workflow-editor/src/json-object-templates/fork.js +0 -10
- package/packages/workflow-editor/src/json-object-templates/human-decision.js +0 -9
- package/packages/workflow-editor/src/json-object-templates/human-task.js +0 -199
- package/packages/workflow-editor/src/json-object-templates/join.js +0 -10
- package/packages/workflow-editor/src/json-object-templates/process.js +0 -98
- package/packages/workflow-editor/src/json-object-templates/start.js +0 -13
- package/packages/workflow-editor/src/json-object-templates/subprocess.js +0 -31
- package/packages/workflow-editor/src/json-object-templates/transition.js +0 -26
- package/packages/workflow-editor/src/main/admin-save-dialog.vue +0 -66
- package/packages/workflow-editor/src/main/canvas.vue +0 -483
- package/packages/workflow-editor/src/main/context-menu.vue +0 -132
- package/packages/workflow-editor/src/main/icon-svg.vue +0 -32
- package/packages/workflow-editor/src/main/selection-region.vue +0 -66
- package/packages/workflow-editor/src/main/tache-history-tooltip.vue +0 -38
- package/packages/workflow-editor/src/main/tache-name-input.vue +0 -19
- package/packages/workflow-editor/src/main/tache-subprocess-history-dialog.vue +0 -35
- package/packages/workflow-editor/src/main/toolbox.vue +0 -60
- package/packages/workflow-editor/src/main/wf-history-canvas.vue +0 -304
- package/packages/workflow-editor/src/process-json.js +0 -623
- package/packages/workflow-editor/src/process-service.js +0 -31
- package/packages/workflow-editor/src/properties-editors/auto-task/basic-properties.vue +0 -81
- package/packages/workflow-editor/src/properties-editors/auto-task/permission-settings.vue +0 -155
- package/packages/workflow-editor/src/properties-editors/auto-task.vue +0 -73
- package/packages/workflow-editor/src/properties-editors/common/additional-condition-utils.js +0 -531
- package/packages/workflow-editor/src/properties-editors/common/additional-condition.vue +0 -276
- package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields-utils.js +0 -34
- package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields.vue +0 -239
- package/packages/workflow-editor/src/properties-editors/common/common-notice-tool.vue +0 -67
- package/packages/workflow-editor/src/properties-editors/common/common-user-condition.vue +0 -241
- package/packages/workflow-editor/src/properties-editors/common/form-fields-utils.js +0 -23
- package/packages/workflow-editor/src/properties-editors/common/form-fields.vue +0 -116
- package/packages/workflow-editor/src/properties-editors/common/i18n-input.vue +0 -75
- package/packages/workflow-editor/src/properties-editors/common/i18n-set-dialog.vue +0 -125
- package/packages/workflow-editor/src/properties-editors/common/notice-reminder.vue +0 -72
- package/packages/workflow-editor/src/properties-editors/common/notice.vue +0 -101
- package/packages/workflow-editor/src/properties-editors/common/reminder.vue +0 -185
- package/packages/workflow-editor/src/properties-editors/common/select-mail-template.vue +0 -83
- package/packages/workflow-editor/src/properties-editors/common/standard-fields.vue +0 -65
- package/packages/workflow-editor/src/properties-editors/common/system-role-tree-inline.vue +0 -347
- package/packages/workflow-editor/src/properties-editors/common/system-role-tree.vue +0 -63
- package/packages/workflow-editor/src/properties-editors/common/task-title.vue +0 -148
- package/packages/workflow-editor/src/properties-editors/common/transactor-settings.vue +0 -233
- package/packages/workflow-editor/src/properties-editors/common/user-selection.vue +0 -386
- package/packages/workflow-editor/src/properties-editors/common/value-selection-dialog.vue +0 -209
- package/packages/workflow-editor/src/properties-editors/common/variables.vue +0 -135
- package/packages/workflow-editor/src/properties-editors/copy-task/basic-properties.vue +0 -90
- package/packages/workflow-editor/src/properties-editors/copy-task/permission-settings.vue +0 -155
- package/packages/workflow-editor/src/properties-editors/copy-task.vue +0 -94
- package/packages/workflow-editor/src/properties-editors/decision.vue +0 -90
- package/packages/workflow-editor/src/properties-editors/fork.vue +0 -72
- package/packages/workflow-editor/src/properties-editors/human-decision.vue +0 -44
- package/packages/workflow-editor/src/properties-editors/human-task/additional-condition-dialog.vue +0 -60
- package/packages/workflow-editor/src/properties-editors/human-task/basic-properties.vue +0 -160
- package/packages/workflow-editor/src/properties-editors/human-task/componentsConfigUtil.js +0 -291
- package/packages/workflow-editor/src/properties-editors/human-task/custom-actions.vue +0 -249
- package/packages/workflow-editor/src/properties-editors/human-task/editable-child-field-setting.vue +0 -392
- package/packages/workflow-editor/src/properties-editors/human-task/editable-child-fields.vue +0 -241
- package/packages/workflow-editor/src/properties-editors/human-task/editable-field-selection.vue +0 -220
- package/packages/workflow-editor/src/properties-editors/human-task/editable-fields.vue +0 -204
- package/packages/workflow-editor/src/properties-editors/human-task/events.vue +0 -59
- package/packages/workflow-editor/src/properties-editors/human-task/permission-settings.vue +0 -207
- package/packages/workflow-editor/src/properties-editors/human-task/selection-conditions.vue +0 -390
- package/packages/workflow-editor/src/properties-editors/human-task.vue +0 -109
- package/packages/workflow-editor/src/properties-editors/join.vue +0 -44
- package/packages/workflow-editor/src/properties-editors/process/basic-properties.vue +0 -273
- package/packages/workflow-editor/src/properties-editors/process/events.vue +0 -76
- package/packages/workflow-editor/src/properties-editors/process/notice-settings.vue +0 -60
- package/packages/workflow-editor/src/properties-editors/process/parameter-settings.vue +0 -95
- package/packages/workflow-editor/src/properties-editors/process/permission-settings.vue +0 -28
- package/packages/workflow-editor/src/properties-editors/process/selectPage.vue +0 -81
- package/packages/workflow-editor/src/properties-editors/process.vue +0 -115
- package/packages/workflow-editor/src/properties-editors/subprocess/basic-properties.vue +0 -199
- package/packages/workflow-editor/src/properties-editors/subprocess/events.vue +0 -26
- package/packages/workflow-editor/src/properties-editors/subprocess/field-mappings.vue +0 -206
- package/packages/workflow-editor/src/properties-editors/subprocess/transactor-settings.vue +0 -64
- package/packages/workflow-editor/src/properties-editors/subprocess.vue +0 -79
- package/packages/workflow-editor/src/properties-editors/transition/basic-properties.vue +0 -53
- package/packages/workflow-editor/src/properties-editors/transition.vue +0 -74
- package/packages/workflow-editor/src/properties-editors/user-condition.js +0 -177
- package/packages/workflow-editor/src/store/getters.js +0 -27
- package/packages/workflow-editor/src/store/workflow-editor.js +0 -125
- package/packages/workflow-editor/src/taches/auto-task.vue +0 -99
- package/packages/workflow-editor/src/taches/common-methods.js +0 -21
- package/packages/workflow-editor/src/taches/copy-task.vue +0 -99
- package/packages/workflow-editor/src/taches/custom-task.vue +0 -88
- package/packages/workflow-editor/src/taches/decision.vue +0 -102
- package/packages/workflow-editor/src/taches/end.vue +0 -76
- package/packages/workflow-editor/src/taches/fork.vue +0 -102
- package/packages/workflow-editor/src/taches/human-decision.vue +0 -102
- package/packages/workflow-editor/src/taches/human-task.vue +0 -113
- package/packages/workflow-editor/src/taches/join.vue +0 -91
- package/packages/workflow-editor/src/taches/joint.vue +0 -177
- package/packages/workflow-editor/src/taches/start.vue +0 -76
- package/packages/workflow-editor/src/taches/subprocess.vue +0 -99
- package/packages/workflow-editor/src/taches/tache-resizer.vue +0 -80
- package/packages/workflow-editor/src/transitions/broken-line.vue +0 -91
- package/packages/workflow-editor/src/transitions/curve-line.vue +0 -91
- package/packages/workflow-editor/src/transitions/straight-line.vue +0 -26
- package/packages/workflow-editor/src/transitions/transition.vue +0 -212
- package/packages/workflow-editor/src/transitions/virtual-transition.vue +0 -43
- package/packages/workflow-editor/src/util.js +0 -489
- package/packages/workflow-editor/src/workflow-editor.vue +0 -606
- package/packages/workflow-editor/src/workflow-history.vue +0 -153
- package/public/vite.svg +0 -1
- package/src/i18n/i18n.js +0 -16
- package/src/i18n/langs/cn.js +0 -509
- package/src/i18n/langs/en.js +0 -551
- package/vite.config.js +0 -36
|
@@ -1,347 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<el-input v-model="filterText" :placeholder="$t('workflowEditorMessage.pleaseEnterTheRoleName')" @keyup.enter="clickSearch">
|
|
4
|
-
<el-button slot="append" icon="el-icon-search" @click="clickSearch" />
|
|
5
|
-
</el-input>
|
|
6
|
-
<el-tree
|
|
7
|
-
ref="roleTree"
|
|
8
|
-
:props="defaultProps"
|
|
9
|
-
:load="loadNode"
|
|
10
|
-
lazy
|
|
11
|
-
:highlight-current="true"
|
|
12
|
-
node-key="nodeId"
|
|
13
|
-
:show-checkbox="multiple"
|
|
14
|
-
check-strictly
|
|
15
|
-
:render-content="renderContent"
|
|
16
|
-
:filter-node-method="filterNode"
|
|
17
|
-
@check="handleCheckNode"
|
|
18
|
-
@node-click="handleNodeClick"
|
|
19
|
-
/>
|
|
20
|
-
</div>
|
|
21
|
-
</template>
|
|
22
|
-
<style>
|
|
23
|
-
.searchResult {
|
|
24
|
-
color:red
|
|
25
|
-
}
|
|
26
|
-
.inline-input-custom {
|
|
27
|
-
width : 90%
|
|
28
|
-
}
|
|
29
|
-
</style>
|
|
30
|
-
<script>
|
|
31
|
-
export default {
|
|
32
|
-
name: 'InlineSystemRoleTree',
|
|
33
|
-
props: {
|
|
34
|
-
multiple: {
|
|
35
|
-
type: Boolean,
|
|
36
|
-
default: false
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
data() {
|
|
40
|
-
return {
|
|
41
|
-
systemRoleTrees: null,
|
|
42
|
-
filterText: '',
|
|
43
|
-
defaultProps: {
|
|
44
|
-
id: 'id',
|
|
45
|
-
label: 'label',
|
|
46
|
-
children: 'children',
|
|
47
|
-
isLeaf: 'leaf'
|
|
48
|
-
},
|
|
49
|
-
containBranch: false, // 当前租户内是否包含分支机构。获得当前选中角色名称时,如果有分支,则需要将分支名称返回给用户,例如:普通用户/分支1
|
|
50
|
-
tenantInfo: null, // 公司信息
|
|
51
|
-
tenantNodeId: -1, // 公司节点的id
|
|
52
|
-
allSearchNodeIds: [], // 用于保存所有查询出的节点id
|
|
53
|
-
allExpandNodeIds: [], // 用于保存allSearchNodeIds中所有已加载子节点的id集合
|
|
54
|
-
isClickNode: false,
|
|
55
|
-
searchValue: null,
|
|
56
|
-
selectNodeInfo: null // 单选时选中的结果
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
computed: {
|
|
61
|
-
},
|
|
62
|
-
watch: {
|
|
63
|
-
filterText(val) {
|
|
64
|
-
if (!val) {
|
|
65
|
-
this.searchValue = val
|
|
66
|
-
// 清空查询内容时,重新加载整个树
|
|
67
|
-
this.loadRole(this.tenantNodeId, this.tenantNodeId + '')
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
created() {
|
|
72
|
-
},
|
|
73
|
-
methods: {
|
|
74
|
-
// 初始化树 或 点击三角展开节点时动态加载子节点
|
|
75
|
-
loadNode(node, resolve) {
|
|
76
|
-
var parentId = 0
|
|
77
|
-
var parentNodeId
|
|
78
|
-
if (node.level === 0) {
|
|
79
|
-
// 表示初始化树
|
|
80
|
-
parentId = 0
|
|
81
|
-
parentNodeId = parentId + ''
|
|
82
|
-
} else {
|
|
83
|
-
parentId = node.data.id
|
|
84
|
-
parentNodeId = node.data.nodeId
|
|
85
|
-
}
|
|
86
|
-
var checkedKeys = []
|
|
87
|
-
if (this.$refs.roleTree) {
|
|
88
|
-
checkedKeys = this.$refs.roleTree.getCheckedKeys()
|
|
89
|
-
}
|
|
90
|
-
// 初始化角色树
|
|
91
|
-
this.initLoadRole(parentId, parentNodeId, node, resolve, checkedKeys)
|
|
92
|
-
},
|
|
93
|
-
// 初始化部门树
|
|
94
|
-
initLoadRole(parentId, parentNodeId, node, resolve, checkedKeys) {
|
|
95
|
-
this.$http.get(this.baseAPI + '/acs/roles/system-role-trees/' + parentId).then(data => {
|
|
96
|
-
resolve(data)
|
|
97
|
-
// 更新当前点击的节点的子节点
|
|
98
|
-
this.$refs.roleTree.updateKeyChildren(parentNodeId, data)
|
|
99
|
-
if (parentId === 0) {
|
|
100
|
-
// 初始化树时,展开公司节点
|
|
101
|
-
const tenantData = data[0].data
|
|
102
|
-
this.tenantInfo = JSON.parse(tenantData)
|
|
103
|
-
this.containBranch = data[0].containBranch
|
|
104
|
-
// 加载整个组织结构树时,展开公司节点
|
|
105
|
-
this.loadRole(this.tenantNodeId, this.tenantNodeId + '')
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
if (this.isClickNode) {
|
|
109
|
-
// 点击当前节点时,加载树节点时
|
|
110
|
-
// 注意不是点击复选框时
|
|
111
|
-
this.isClickNode = false
|
|
112
|
-
this.checkedNodeAndChildren(node.data)
|
|
113
|
-
} else {
|
|
114
|
-
// 表示是点击三角展开节点时
|
|
115
|
-
if (checkedKeys && checkedKeys.indexOf(parentNodeId) > -1) {
|
|
116
|
-
// 点击部门名称前的三角标识展开节点时,保持当前节点的选中状态
|
|
117
|
-
// 表示当前展开的节点是选中状态,则应保持其选中状态,并选中其子节点
|
|
118
|
-
this.checkedNodeAndChildren(node.data)
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
})
|
|
122
|
-
},
|
|
123
|
-
// 加载当前节点的子节点
|
|
124
|
-
loadRole(parentId, nodeId, isSearch, searchValue) {
|
|
125
|
-
this.$http.get(this.baseAPI + '/acs/roles/system-role-trees/' + parentId).then(children => {
|
|
126
|
-
this.$refs.roleTree.updateKeyChildren(nodeId, children)
|
|
127
|
-
if (this.$refs.roleTree.store.nodesMap[nodeId]) {
|
|
128
|
-
this.$refs.roleTree.store.nodesMap[nodeId].expanded = true
|
|
129
|
-
}
|
|
130
|
-
if (isSearch) {
|
|
131
|
-
// 查询时处理
|
|
132
|
-
if (this.allExpandNodeIds.indexOf(nodeId) === -1) {
|
|
133
|
-
// allExpandNodeIds集合中是否包含当前parentId节点id
|
|
134
|
-
this.allExpandNodeIds.push(nodeId)
|
|
135
|
-
}
|
|
136
|
-
if (this.allExpandNodeIds.length === this.allSearchNodeIds.length) {
|
|
137
|
-
// 表示所有节点已展开,执行树的过滤方法
|
|
138
|
-
this.$refs.roleTree.filter(searchValue)
|
|
139
|
-
this.allExpandNodeIds = []
|
|
140
|
-
this.allSearchNodeIds = []
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
})
|
|
144
|
-
},
|
|
145
|
-
clickSearch() {
|
|
146
|
-
this.searchValue = this.filterText
|
|
147
|
-
this.filterAppendNodes(this.filterText)
|
|
148
|
-
},
|
|
149
|
-
// 后台查询部门,并拼接树节点
|
|
150
|
-
filterAppendNodes(value) {
|
|
151
|
-
this.$http.get(this.baseAPI + '/acs/roles/search-system-role-trees?searchValue=' + value).then(systemIds => {
|
|
152
|
-
if (systemIds) {
|
|
153
|
-
if (systemIds.length === 0) {
|
|
154
|
-
this.$message({
|
|
155
|
-
showClose: true,
|
|
156
|
-
type: 'error',
|
|
157
|
-
message: this.$t('workflowEditorMessage.queryResultIsEmpty')
|
|
158
|
-
})
|
|
159
|
-
return
|
|
160
|
-
}
|
|
161
|
-
systemIds.forEach(systemId => {
|
|
162
|
-
const nodeId = 'SYSTEM_' + systemId
|
|
163
|
-
if (this.allSearchNodeIds.indexOf(nodeId) === -1) {
|
|
164
|
-
// 表示没有加载过该节点,需要放到allSearchNodeIds集合中,并加载该节点内容
|
|
165
|
-
this.allSearchNodeIds.push(nodeId)
|
|
166
|
-
this.loadRole(systemId, nodeId, true, value)
|
|
167
|
-
}
|
|
168
|
-
})
|
|
169
|
-
} else {
|
|
170
|
-
this.$message({
|
|
171
|
-
showClose: true,
|
|
172
|
-
type: 'error',
|
|
173
|
-
message: this.$t('workflowEditorMessage.queryResultIsEmpty')
|
|
174
|
-
})
|
|
175
|
-
}
|
|
176
|
-
})
|
|
177
|
-
},
|
|
178
|
-
// 点击复选框时处理
|
|
179
|
-
handleCheckNode(data, checkObj) {
|
|
180
|
-
if (checkObj.checkedKeys.indexOf(data.nodeId) > -1) {
|
|
181
|
-
// 表示正选中data节点
|
|
182
|
-
if (data.children) {
|
|
183
|
-
// 如果已展开,不需要再走后台获得其子节点。只需要选中已有子节点
|
|
184
|
-
// 展开当前选中的节点
|
|
185
|
-
this.$refs.roleTree.store.nodesMap[data.nodeId].expanded = true
|
|
186
|
-
// 选中当前节点及其子节点
|
|
187
|
-
this.checkedNodeAndChildren(data)
|
|
188
|
-
} else {
|
|
189
|
-
// 当前节点未展开。需要走后台获得当前节点的子节点,然后展开当前节点,然后选中这些子节点
|
|
190
|
-
if (!data.leaf) {
|
|
191
|
-
// 不是叶子节点,并且没有加载过该父节点的子节点时,需要走后台展开子节点
|
|
192
|
-
this.$http.get(this.baseAPI + '/acs/roles/system-role-trees/' + data.id).then(result => {
|
|
193
|
-
// 更新当前点击的节点的子节点
|
|
194
|
-
this.$refs.roleTree.updateKeyChildren(data.nodeId, result)
|
|
195
|
-
// 展开当前选中的节点
|
|
196
|
-
this.$refs.roleTree.store.nodesMap[data.nodeId].expanded = true
|
|
197
|
-
// 获得所有应该选中的节点
|
|
198
|
-
this.checkedNodeAndChildren(data)
|
|
199
|
-
})
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
} else {
|
|
203
|
-
// 表示正取消选中data节点,同时要取消其子节点的选中状态
|
|
204
|
-
this.cancelChildCheckedNodes(data)
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
// 选中当前节点及其子节点
|
|
208
|
-
checkedNodeAndChildren(data) {
|
|
209
|
-
// 取消选中状态时,保持节点是展开的状态,不要折叠
|
|
210
|
-
this.$refs.roleTree.store.nodesMap[data.nodeId].expanded = true
|
|
211
|
-
// 获得所有应该选中的节点
|
|
212
|
-
this.$refs.roleTree.setChecked(data.nodeId, true)
|
|
213
|
-
const children = data.children
|
|
214
|
-
if (children) {
|
|
215
|
-
// 递归设置子子节点的选中状态
|
|
216
|
-
children.forEach(nodeData => {
|
|
217
|
-
this.checkedNodeAndChildren(nodeData)
|
|
218
|
-
})
|
|
219
|
-
}
|
|
220
|
-
},
|
|
221
|
-
// 取消当前节点的子节点的选中状态
|
|
222
|
-
cancelChildCheckedNodes(data) {
|
|
223
|
-
if (data.id !== this.tenantNodeId) {
|
|
224
|
-
// 如果当前节点不是公司节点,需要将公司节点的选中状态去掉
|
|
225
|
-
this.$refs.roleTree.setChecked(this.tenantNodeId + '', false)
|
|
226
|
-
}
|
|
227
|
-
const children = data.children
|
|
228
|
-
if (children) {
|
|
229
|
-
children.forEach(nodeData => {
|
|
230
|
-
// 取消节点的选中状态
|
|
231
|
-
this.$refs.roleTree.setChecked(nodeData.nodeId, false)
|
|
232
|
-
// 递归取消子子节点的选中状态
|
|
233
|
-
this.cancelChildCheckedNodes(nodeData)
|
|
234
|
-
})
|
|
235
|
-
}
|
|
236
|
-
},
|
|
237
|
-
selectRole() {
|
|
238
|
-
if (this.multiple) {
|
|
239
|
-
const selectNodeInfo = {
|
|
240
|
-
containBranch: this.containBranch,
|
|
241
|
-
roles: []
|
|
242
|
-
}
|
|
243
|
-
const selectedRoles = []
|
|
244
|
-
const checkedNodes = this.$refs.roleTree.getCheckedNodes()
|
|
245
|
-
checkedNodes.forEach(nodeData => {
|
|
246
|
-
if (nodeData.nodeType === 'ROLE') {
|
|
247
|
-
const role = JSON.parse(nodeData.data)
|
|
248
|
-
role.tenantCode = this.tenantInfo.code
|
|
249
|
-
role.tenantName = this.tenantInfo.tenantName
|
|
250
|
-
selectedRoles.push(role)
|
|
251
|
-
}
|
|
252
|
-
})
|
|
253
|
-
selectNodeInfo.roles = selectedRoles
|
|
254
|
-
if (selectNodeInfo.length > 0) {
|
|
255
|
-
this.$emit('result', selectNodeInfo)
|
|
256
|
-
} else {
|
|
257
|
-
this.$message({
|
|
258
|
-
showClose: true,
|
|
259
|
-
type: 'warning',
|
|
260
|
-
message: this.$t('workflowEditor.pleaseSelectRole')
|
|
261
|
-
})
|
|
262
|
-
}
|
|
263
|
-
} else {
|
|
264
|
-
if (this.selectNodeInfo) {
|
|
265
|
-
this.$emit('result', this.selectNodeInfo)
|
|
266
|
-
} else {
|
|
267
|
-
this.$message({
|
|
268
|
-
showClose: true,
|
|
269
|
-
type: 'warning',
|
|
270
|
-
message: this.$t('workflowEditor.pleaseSelectRole')
|
|
271
|
-
})
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
},
|
|
275
|
-
filterNode(value, data, node) {
|
|
276
|
-
if (!value) {
|
|
277
|
-
return true
|
|
278
|
-
} else {
|
|
279
|
-
var roleName = data.label
|
|
280
|
-
if (data.nodeType !== 'ROLE') {
|
|
281
|
-
// 表示不是角色节点
|
|
282
|
-
return false
|
|
283
|
-
}
|
|
284
|
-
return roleName.indexOf(value) !== -1
|
|
285
|
-
}
|
|
286
|
-
},
|
|
287
|
-
handleNodeClick(data, node, nodeTree) {
|
|
288
|
-
if (this.multiple) {
|
|
289
|
-
// 多选角色树时,处理点击节点事件
|
|
290
|
-
this.clickNodeWhenMultiple(data)
|
|
291
|
-
}
|
|
292
|
-
console.log(data)
|
|
293
|
-
if (data.nodeType === 'ROLE' && !this.multiple) {
|
|
294
|
-
// 点击的是角色节点,并且是单选树时,点击部门节点直接关闭弹框
|
|
295
|
-
const role = JSON.parse(data.data)
|
|
296
|
-
role.tenantName = this.tenantInfo.tenantName
|
|
297
|
-
role.tenantCode = this.tenantInfo.code
|
|
298
|
-
var selectNodeInfo = {
|
|
299
|
-
id: data.id,
|
|
300
|
-
name: data.name,
|
|
301
|
-
containBranch: this.containBranch,
|
|
302
|
-
role: role
|
|
303
|
-
}
|
|
304
|
-
this.selectNodeInfo = selectNodeInfo
|
|
305
|
-
}
|
|
306
|
-
},
|
|
307
|
-
// 多选树时,点击节点处理复选框的选中状态
|
|
308
|
-
clickNodeWhenMultiple(data) {
|
|
309
|
-
var checkedKeys = []
|
|
310
|
-
if (this.$refs.roleTree) {
|
|
311
|
-
checkedKeys = this.$refs.roleTree.getCheckedKeys()
|
|
312
|
-
}
|
|
313
|
-
if (checkedKeys.indexOf(data.nodeId) > -1) {
|
|
314
|
-
// 表示当前节点是选中状态,则需要取消其选中状态
|
|
315
|
-
// 取消当前节点的勾选状态
|
|
316
|
-
this.$refs.roleTree.setChecked(data.nodeId, false)
|
|
317
|
-
// 取消当前节点的子节点的勾选状态
|
|
318
|
-
this.cancelChildCheckedNodes(data)
|
|
319
|
-
// 取消选中状态时,保持节点是展开的状态,不要折叠
|
|
320
|
-
this.$refs.roleTree.store.nodesMap[data.nodeId].expanded = true
|
|
321
|
-
} else {
|
|
322
|
-
// 表示当前节点不是选中的状态,需要勾选该节点
|
|
323
|
-
this.$refs.roleTree.setChecked(data.nodeId, true)
|
|
324
|
-
// 点击树节点时添加并展开节点会走loadNode方法,因为设置了树组件的expand-on-click-node属性为true
|
|
325
|
-
const children = data.childDepartments
|
|
326
|
-
if (children && children.length > 0) {
|
|
327
|
-
// 表示加载过该节点,直接选中即可
|
|
328
|
-
this.checkedNodeAndChildren(data)
|
|
329
|
-
} else {
|
|
330
|
-
// 表示没有加载过该节点,是首次加载,需要走后台
|
|
331
|
-
// 会走loadNode方法,因为设置了树组件的expand-on-click-node属性为true
|
|
332
|
-
this.isClickNode = true
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
},
|
|
336
|
-
// 给节点添加查询结果样式
|
|
337
|
-
renderContent(h, { node, data, store }) {
|
|
338
|
-
if (data.nodeType && data.nodeType === 'ROLE' &&
|
|
339
|
-
this.searchValue && data.label.indexOf(this.searchValue) > -1) {
|
|
340
|
-
// 如果是查询条件
|
|
341
|
-
return h('span', {},[h('span',{class: 'searchResult'},node.label)])
|
|
342
|
-
}
|
|
343
|
-
return h('span', {},[h('span',{},node.label)])
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
</script>
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-dialog
|
|
3
|
-
visible
|
|
4
|
-
:title="$t('workflowEditorMessage.selectRole')"
|
|
5
|
-
width="30%"
|
|
6
|
-
top="10vh"
|
|
7
|
-
append-to-body
|
|
8
|
-
custom-class="properties-editor-noTab"
|
|
9
|
-
:close-on-click-modal="false"
|
|
10
|
-
@close="$emit('close')"
|
|
11
|
-
>
|
|
12
|
-
<inline-system-role-tree ref="systemRoleTree" :multiple="multiple" @result="roleResult" />
|
|
13
|
-
<span v-if="multiple" slot="footer" class="dialog-footer">
|
|
14
|
-
<el-button type="primary" size="small" @click="selectRoles">
|
|
15
|
-
{{ $t('workflowEditorPublicModel.determine') }}
|
|
16
|
-
</el-button>
|
|
17
|
-
<el-button size="small" @click="$emit('close')">
|
|
18
|
-
{{ $t('workflowEditorPublicModel.cancel') }}
|
|
19
|
-
</el-button>
|
|
20
|
-
</span>
|
|
21
|
-
</el-dialog>
|
|
22
|
-
</template>
|
|
23
|
-
<style>
|
|
24
|
-
.searchResult {
|
|
25
|
-
color:red
|
|
26
|
-
}
|
|
27
|
-
.inline-input-custom {
|
|
28
|
-
width : 90%
|
|
29
|
-
}
|
|
30
|
-
</style>
|
|
31
|
-
<script>
|
|
32
|
-
import InlineSystemRoleTree from './system-role-tree-inline'
|
|
33
|
-
export default {
|
|
34
|
-
name: 'SystemRoleTree',
|
|
35
|
-
components: {
|
|
36
|
-
InlineSystemRoleTree
|
|
37
|
-
},
|
|
38
|
-
props: {
|
|
39
|
-
multiple: {
|
|
40
|
-
type: Boolean,
|
|
41
|
-
default: false
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
computed: {
|
|
45
|
-
},
|
|
46
|
-
watch: {
|
|
47
|
-
},
|
|
48
|
-
created() {
|
|
49
|
-
},
|
|
50
|
-
methods: {
|
|
51
|
-
roleResult(selectNodeInfo) {
|
|
52
|
-
if (selectNodeInfo) {
|
|
53
|
-
this.$emit('close', selectNodeInfo)
|
|
54
|
-
} else {
|
|
55
|
-
this.$emit('close')
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
selectRoles() {
|
|
59
|
-
this.$refs.systemRoleTree.selectRole()
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
</script>
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<el-tag
|
|
4
|
-
v-for="(tag,index) in dynamicTags"
|
|
5
|
-
:key="index+tag"
|
|
6
|
-
:type="getType(tag)"
|
|
7
|
-
closable
|
|
8
|
-
:disable-transitions="false"
|
|
9
|
-
@close="handleClose(tag)"
|
|
10
|
-
>
|
|
11
|
-
{{ tag|showText }}
|
|
12
|
-
</el-tag>
|
|
13
|
-
<el-input
|
|
14
|
-
v-if="inputVisible||showFormFields"
|
|
15
|
-
ref="saveTagInput"
|
|
16
|
-
v-model="inputValue"
|
|
17
|
-
class="input-new-tag"
|
|
18
|
-
size="small"
|
|
19
|
-
@keyup.enter.native="handleInputConfirm"
|
|
20
|
-
@blur="handleInputConfirm"
|
|
21
|
-
/>
|
|
22
|
-
<el-button-group v-if="!inputVisible">
|
|
23
|
-
<el-button class="button-new-tag" size="small" icon="el-icon-edit" @click="showInput">
|
|
24
|
-
{{ $t('workflowEditorMessage.enterText') }}
|
|
25
|
-
</el-button>
|
|
26
|
-
<el-button class="button-new-tag" size="small" icon="el-icon-search" @click="showFormFields=true">
|
|
27
|
-
{{ $t('workflowEditorMessage.selectField') }}
|
|
28
|
-
</el-button>
|
|
29
|
-
</el-button-group>
|
|
30
|
-
<form-fields v-if="showFormFields" @close="setField" />
|
|
31
|
-
</div>
|
|
32
|
-
</template>
|
|
33
|
-
<script>
|
|
34
|
-
import FormFields from './form-fields'
|
|
35
|
-
import { getFormFieldLabel } from './form-fields-utils.js'
|
|
36
|
-
export default {
|
|
37
|
-
name: 'TaskTitle',
|
|
38
|
-
components: {
|
|
39
|
-
FormFields
|
|
40
|
-
},
|
|
41
|
-
filters: {
|
|
42
|
-
showText(value) {
|
|
43
|
-
let result = value
|
|
44
|
-
if (value.indexOf('${field[') >= 0) {
|
|
45
|
-
const name = result.substring(result.indexOf('[') + 1, result.lastIndexOf(']'))
|
|
46
|
-
result = getFormFieldLabel(name)
|
|
47
|
-
result = '[' + result + ']'
|
|
48
|
-
} else if (value.indexOf('${writeTitle[') >= 0) {
|
|
49
|
-
const index = value.indexOf('${writeTitle[')
|
|
50
|
-
result = result.substring(index + 13)
|
|
51
|
-
result = result.substring(0, result.indexOf(']'))
|
|
52
|
-
}
|
|
53
|
-
return result
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
props: {
|
|
57
|
-
value: {
|
|
58
|
-
type: String,
|
|
59
|
-
default: null
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
data() {
|
|
63
|
-
const dynamicTags = []
|
|
64
|
-
if (this.value) {
|
|
65
|
-
const regex = /\$\{(.+?)\}/g
|
|
66
|
-
const matched = this.value.match(regex)
|
|
67
|
-
for (const item of matched) {
|
|
68
|
-
dynamicTags.push(item)
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return {
|
|
72
|
-
dynamicTags,
|
|
73
|
-
inputVisible: false,
|
|
74
|
-
showFormFields: false,
|
|
75
|
-
inputValue: ''
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
watch: {
|
|
79
|
-
dynamicTags(val) {
|
|
80
|
-
this.$emit('input', this.dynamicTags.join(''))
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
mounted() {
|
|
84
|
-
|
|
85
|
-
},
|
|
86
|
-
methods: {
|
|
87
|
-
handleClose(tag) {
|
|
88
|
-
this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1)
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
showInput() {
|
|
92
|
-
this.inputVisible = true
|
|
93
|
-
this.$nextTick(_ => {
|
|
94
|
-
this.$refs.saveTagInput.focus()
|
|
95
|
-
})
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
handleInputConfirm() {
|
|
99
|
-
let inputValue = this.inputValue
|
|
100
|
-
if (inputValue) {
|
|
101
|
-
if (this.inputVisible) {
|
|
102
|
-
inputValue = '${writeTitle[' + inputValue + ']}'
|
|
103
|
-
}
|
|
104
|
-
this.dynamicTags.push(inputValue)
|
|
105
|
-
}
|
|
106
|
-
this.inputVisible = false
|
|
107
|
-
this.inputValue = ''
|
|
108
|
-
},
|
|
109
|
-
getType(tag) {
|
|
110
|
-
if (tag.indexOf('${field') >= 0) {
|
|
111
|
-
return 'success'
|
|
112
|
-
} else {
|
|
113
|
-
return null
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
setField(name) {
|
|
117
|
-
if (name !== undefined) {
|
|
118
|
-
// showFormFields的时候,input也显示了出来(实际上是不应该显示的)。如果input不显示出来,会发生非常怪异的事情,这个push操作不会更新视图,界面上不显示新的tag(尽管数组里有)
|
|
119
|
-
this.dynamicTags.push('${field[' + name + ']}')
|
|
120
|
-
}
|
|
121
|
-
this.showFormFields = false
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
</script>
|
|
126
|
-
<style scoped>
|
|
127
|
-
.el-tag + .el-tag {
|
|
128
|
-
margin-left: 10px;
|
|
129
|
-
}
|
|
130
|
-
.button-new-tag {
|
|
131
|
-
margin-left: 10px;
|
|
132
|
-
height: 32px;
|
|
133
|
-
line-height: 30px;
|
|
134
|
-
padding-top: 0;
|
|
135
|
-
padding-bottom: 0;
|
|
136
|
-
}
|
|
137
|
-
.input-new-tag {
|
|
138
|
-
width: 150px;
|
|
139
|
-
margin-left: 10px;
|
|
140
|
-
vertical-align: bottom;
|
|
141
|
-
}
|
|
142
|
-
select{
|
|
143
|
-
width: 150px;
|
|
144
|
-
margin-left: 10px;
|
|
145
|
-
height: 32px;
|
|
146
|
-
line-height: 32px;
|
|
147
|
-
}
|
|
148
|
-
</style>
|