agilebuilder-ui 1.0.80 → 1.0.82-tmp1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.js +21688 -20318
- package/lib/super-ui.umd.cjs +74 -74
- package/package.json +1 -1
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +61 -26
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +64 -22
- package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -6
- package/packages/department-user-tree-inline/src/group-user/group-input.vue +153 -0
- package/packages/department-user-tree-inline/src/group-user/group-list.vue +96 -0
- package/packages/department-user-tree-inline/src/group-user/group-user.vue +42 -0
- package/packages/department-user-tree-inline/src/group-user-multiple-tree.vue +304 -0
- package/packages/department-user-tree-inline/src/group-user-single-tree.vue +155 -0
- package/packages/department-user-tree-inline/src/group-user-tree-service.js +75 -0
- package/packages/dynamic-source-select/src/dynamic-source-select.vue +2 -2
- package/packages/rich-editor/index.vue +29 -0
- package/packages/secret-info/index.vue +2 -2
- package/packages/super-grid/src/dynamic-input.vue +15 -8
- package/packages/super-grid/src/formValidatorUtil.js +5 -0
- package/packages/super-grid/src/group-column.vue +5 -0
- package/packages/super-grid/src/normal-column.vue +23 -7
- package/packages/super-grid/src/row-operation.vue +19 -10
- package/packages/super-grid/src/super-grid-service.js +7 -4
- package/packages/super-grid/src/super-grid.vue +30 -3
- package/packages/super-grid/src/utils.js +36 -118
- package/packages/workflow-button/src/workflow-button.vue +6 -1
- package/src/i18n/langs/cn.js +7 -1
- package/src/i18n/langs/en.js +7 -1
- package/src/utils/calculator/calculator-util.js +14 -0
- package/src/utils/permission.js +7 -1
- package/src/utils/permissionAuth.js +47 -1
- package/src/views/layout/components/Menubar/SidebarItem.vue +1 -1
- package/src/views/layout/tab-content-index.vue +1 -1
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-tree
|
|
4
|
+
ref="groupUserTree"
|
|
5
|
+
:props="defaultProps"
|
|
6
|
+
:load="loadNode"
|
|
7
|
+
:check-on-click-node="true"
|
|
8
|
+
lazy
|
|
9
|
+
show-checkbox
|
|
10
|
+
node-key="nodeId"
|
|
11
|
+
@check="handleCheckNode"
|
|
12
|
+
@check-change="handleCheckChange"
|
|
13
|
+
>
|
|
14
|
+
<template #default="{ node, data }">
|
|
15
|
+
<span>
|
|
16
|
+
<el-icon>
|
|
17
|
+
<Menu v-if="node.data.id === -1"/>
|
|
18
|
+
<Calendar v-else-if="node.data.nodeType === 'USER_GROUP'"/>
|
|
19
|
+
<User v-else-if="node.data.nodeType === 'USER'"/>
|
|
20
|
+
</el-icon>
|
|
21
|
+
<span :title="node.label">
|
|
22
|
+
{{ node.label }}
|
|
23
|
+
</span>
|
|
24
|
+
</span>
|
|
25
|
+
</template>
|
|
26
|
+
</el-tree>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
<script>
|
|
30
|
+
import {Calendar, Menu, User} from '@element-plus/icons-vue'
|
|
31
|
+
import groupUserTreeService from './group-user-tree-service'
|
|
32
|
+
import utils from '../../utils/utils'
|
|
33
|
+
export default {
|
|
34
|
+
name: 'GroupUserMultipleTree',
|
|
35
|
+
components:{
|
|
36
|
+
Menu,
|
|
37
|
+
Calendar,
|
|
38
|
+
User
|
|
39
|
+
},
|
|
40
|
+
props: {
|
|
41
|
+
},
|
|
42
|
+
data() {
|
|
43
|
+
return {
|
|
44
|
+
defaultProps: {
|
|
45
|
+
id: 'id',
|
|
46
|
+
label: 'showName',
|
|
47
|
+
children: 'children',
|
|
48
|
+
isLeaf: 'leaf'
|
|
49
|
+
},
|
|
50
|
+
count: 0,
|
|
51
|
+
tenantNodeId: -10, // 公司节点的id
|
|
52
|
+
selectUser: null, // 选择的用户原信息
|
|
53
|
+
selectResult: [], // 已选用户结果
|
|
54
|
+
selectNodeInfo: null, // 封装后的用户信息,即用户结果
|
|
55
|
+
notMultipleClickNum: null, // 节点没有双击事件,手动实现双击事件,参数用来记录次数
|
|
56
|
+
notMultipleClickNode: null // 节点没有双击事件,手动实现双击事件,参数用来记录节点
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
computed: {
|
|
60
|
+
},
|
|
61
|
+
watch: {
|
|
62
|
+
},
|
|
63
|
+
created() {
|
|
64
|
+
},
|
|
65
|
+
mounted() {
|
|
66
|
+
},
|
|
67
|
+
methods: {
|
|
68
|
+
...utils,
|
|
69
|
+
...groupUserTreeService,
|
|
70
|
+
// 封装已选人员结果
|
|
71
|
+
packageSelectUser(user) {
|
|
72
|
+
const containUsers = this.selectResult.filter(this.filterUser(user))
|
|
73
|
+
if (containUsers && containUsers.length === 0) {
|
|
74
|
+
// 表示集合中不存在该用户,则封装该用户
|
|
75
|
+
var selectUser = {
|
|
76
|
+
id: user.id,
|
|
77
|
+
name: user.name,
|
|
78
|
+
zhName: user.name,
|
|
79
|
+
loginName: user.loginName,
|
|
80
|
+
email: user.email,
|
|
81
|
+
telephone: user.telephone,
|
|
82
|
+
mainDepartmentName: user.mainDepartmentName,
|
|
83
|
+
subCompanyName: user.subCompanyName,
|
|
84
|
+
user: user,
|
|
85
|
+
enName: user.enName,
|
|
86
|
+
superiorDeptNameFullPath: user.superiorDeptNameFullPath
|
|
87
|
+
}
|
|
88
|
+
return selectUser
|
|
89
|
+
}
|
|
90
|
+
return null
|
|
91
|
+
},
|
|
92
|
+
// 判断用户是否存在的过滤器
|
|
93
|
+
filterUser(queryUser) {
|
|
94
|
+
return (user) => {
|
|
95
|
+
return (user.id === queryUser.id)
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
handleCheckChange(data, checked, childrenChecked) {
|
|
99
|
+
if (this.isUserNode(data)) {
|
|
100
|
+
// 是否是人员节点
|
|
101
|
+
if (checked) {
|
|
102
|
+
// 当前节点是否被选中
|
|
103
|
+
const user = JSON.parse(data.data)
|
|
104
|
+
const selectUser = this.packageSelectUser(user)
|
|
105
|
+
if (selectUser) {
|
|
106
|
+
this.$emit('result', selectUser)
|
|
107
|
+
// this.selectResult.push(selectUser)
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
// 点击复选框时处理
|
|
113
|
+
handleCheckNode(data, checkObj) {
|
|
114
|
+
if (checkObj.checkedKeys.indexOf(data.nodeId) > -1) {
|
|
115
|
+
// 如果没有选择所有用户,则可以继续选择用户
|
|
116
|
+
this.checkedNodeToSelectResult(data)
|
|
117
|
+
} else {
|
|
118
|
+
this.cancelChildCheckedNodes(data)
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
// 选中树节点处理
|
|
122
|
+
checkedNodeToSelectResult(data) {
|
|
123
|
+
this.checkedNode(data)
|
|
124
|
+
},
|
|
125
|
+
// 取消当前节点及其子节点的选中状态
|
|
126
|
+
cancelCheckedNodeAndChildren(data) {
|
|
127
|
+
if (data.id !== this.tenantNodeId) {
|
|
128
|
+
// 如果当前节点不是公司节点,需要将公司节点的选中状态去掉
|
|
129
|
+
this.$refs.groupUserTree.setChecked(this.tenantNodeId + '', false)
|
|
130
|
+
}
|
|
131
|
+
const children = data.children
|
|
132
|
+
if (children) {
|
|
133
|
+
children.forEach(nodeData => {
|
|
134
|
+
// 取消节点的选中状态
|
|
135
|
+
this.$refs.groupUserTree.setChecked(nodeData.nodeId, false)
|
|
136
|
+
// 递归取消子子节点的选中状态
|
|
137
|
+
this.cancelCheckedNodeAndChildren(nodeData)
|
|
138
|
+
})
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
// 勾选节点时的操作
|
|
142
|
+
checkedNode(data) {
|
|
143
|
+
// 勾选当前节点
|
|
144
|
+
const isExpand = this.$refs.groupUserTree.store.nodesMap[data.nodeId].expanded
|
|
145
|
+
if (isExpand) {
|
|
146
|
+
// 如果已展开,不需要再走后台获得其子节点。只需要选中已有子节点
|
|
147
|
+
// 选中当前节点及其子节点
|
|
148
|
+
this.checkedChildrenUserNodes(data, data.children)
|
|
149
|
+
} else {
|
|
150
|
+
// 当前节点未展开。则再判断是否需要走后台加载叶子节点
|
|
151
|
+
if (!data.leaf) {
|
|
152
|
+
// 不是叶子节点
|
|
153
|
+
if (data.children) {
|
|
154
|
+
// 如果已经加载过该父节点的子节点,则只需展开,并选中人员节点
|
|
155
|
+
this.staticCheckedUserNodes(data)
|
|
156
|
+
} else {
|
|
157
|
+
// 没有加载过该父节点的子节点时,需要走后台获得该父节点的子节点,并展开子节点
|
|
158
|
+
this.dynamicCheckedUserNodes(data)
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
// 取消当前节点的子节点的勾选状态
|
|
164
|
+
cancelChildCheckedNodes(data) {
|
|
165
|
+
const children = data.children
|
|
166
|
+
if (children) {
|
|
167
|
+
children.forEach(nodeData => {
|
|
168
|
+
// 取消节点的选中状态
|
|
169
|
+
this.$refs.groupUserTree.setChecked(nodeData.nodeId, false)
|
|
170
|
+
// 递归取消子节点的孩子节点的选中状态
|
|
171
|
+
this.cancelChildCheckedNodes(nodeData)
|
|
172
|
+
})
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
// 勾选指定节点及其下的所有用户节点
|
|
176
|
+
checkedChildrenUserNodes(data, children) {
|
|
177
|
+
// 勾选指定节点
|
|
178
|
+
// 勾选指定节点下的用户节点
|
|
179
|
+
if (children) {
|
|
180
|
+
const groupIds = []
|
|
181
|
+
children.forEach(childData => {
|
|
182
|
+
if (childData.nodeType === 'USER') {
|
|
183
|
+
// 勾选用户节点
|
|
184
|
+
this.$refs.groupUserTree.setChecked(childData.nodeId, true)
|
|
185
|
+
const user = JSON.parse(childData.data)
|
|
186
|
+
const selectUser = this.packageSelectUser(user)
|
|
187
|
+
if (selectUser) {
|
|
188
|
+
selectUser.nodeId = childData.nodeId
|
|
189
|
+
this.$emit('result', selectUser)
|
|
190
|
+
// this.selectResult.push(selectUser)
|
|
191
|
+
}
|
|
192
|
+
} else if (childData.nodeType === 'USER_GROUP') {
|
|
193
|
+
this.$refs.groupUserTree.setChecked(childData.nodeId, true)
|
|
194
|
+
groupIds.push(childData.id)
|
|
195
|
+
} else {
|
|
196
|
+
this.$refs.groupUserTree.setChecked(childData.nodeId, false)
|
|
197
|
+
}
|
|
198
|
+
if (this.$refs.groupUserTree.store.nodesMap[childData.nodeId].expanded) {
|
|
199
|
+
// 如果当前子节点已展开,则选中子节点的孩子节点中的用户节点
|
|
200
|
+
this.checkedChildrenUserNodes(childData)
|
|
201
|
+
}
|
|
202
|
+
})
|
|
203
|
+
// 封装所有子部门及孙子部门的用户
|
|
204
|
+
this.packageChildrenDepartmentUsers(groupIds)
|
|
205
|
+
}
|
|
206
|
+
// 选中当前点击的节点,即使当前点击的是非用户节点也要选中
|
|
207
|
+
this.$refs.groupUserTree.setChecked(data.nodeId, true)
|
|
208
|
+
},
|
|
209
|
+
// 封装所有子部门及孙子部门的用户
|
|
210
|
+
packageChildrenDepartmentUsers(groupIds) {
|
|
211
|
+
if (groupIds && groupIds.length > 0) {
|
|
212
|
+
this.getGroupUsers(groupIds).then(users => {
|
|
213
|
+
users.forEach(user => {
|
|
214
|
+
const selectUser = this.packageSelectUser(user)
|
|
215
|
+
if (selectUser) {
|
|
216
|
+
// this.selectResult.push(selectUser)
|
|
217
|
+
this.$emit('result', selectUser)
|
|
218
|
+
}
|
|
219
|
+
})
|
|
220
|
+
})
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
// 选中非叶子类型的部门节点时,已加载过该节点下的子节点,只需展开该部门,且选中用户节点
|
|
224
|
+
staticCheckedUserNodes(data) {
|
|
225
|
+
// 展开当前选中的节点
|
|
226
|
+
this.$refs.groupUserTree.store.nodesMap[data.nodeId].expanded = true
|
|
227
|
+
// 选中用户节点
|
|
228
|
+
this.checkedChildrenUserNodes(data, data.children)
|
|
229
|
+
},
|
|
230
|
+
// 多选树时,点击节点处理复选框的选中状态
|
|
231
|
+
handleNodeClick(data, node, nodeTree) {
|
|
232
|
+
var checkedKeys = []
|
|
233
|
+
if (this.$refs.groupUserTree) {
|
|
234
|
+
checkedKeys = this.$refs.groupUserTree.getCheckedKeys()
|
|
235
|
+
}
|
|
236
|
+
if (checkedKeys.indexOf(data.nodeId) > -1) {
|
|
237
|
+
// 表示当前节点是选中状态,则需要取消其选中状态
|
|
238
|
+
// 取消当前节点的勾选状态
|
|
239
|
+
this.$refs.groupUserTree.setChecked(data.nodeId, false)
|
|
240
|
+
// 取消当前节点的子节点的勾选状态
|
|
241
|
+
this.cancelChildCheckedNodes(data)
|
|
242
|
+
// 取消选中状态时,保持节点是展开的状态,不要折叠
|
|
243
|
+
this.$refs.groupUserTree.store.nodesMap[data.nodeId].expanded = true
|
|
244
|
+
} else {
|
|
245
|
+
// 表示当前节点不是选中的状态,需要勾选该节点
|
|
246
|
+
// 点击树节点时添加并展开节点会走loadNode方法,因为设置了树组件的expand-on-click-node属性为true
|
|
247
|
+
const children = data.children
|
|
248
|
+
if (children && children.length > 0) {
|
|
249
|
+
// 表示加载过该节点,直接选中即可
|
|
250
|
+
this.staticCheckedUserNodes(data)
|
|
251
|
+
} else if (data.nodeType && data.nodeType === 'USER') {
|
|
252
|
+
// 表示是用户节点需要选中该节点
|
|
253
|
+
this.$refs.groupUserTree.setChecked(data.nodeId, true)
|
|
254
|
+
} else {
|
|
255
|
+
// 表示没有加载过该节点,是首次加载,需要走后台
|
|
256
|
+
// 会走loadNode方法,因为设置了树组件的expand-on-click-node属性为true
|
|
257
|
+
this.isClickNode = true
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
isUserNode(data) {
|
|
262
|
+
// 当前节点不是公司节点,节点类型是用户类型时,表示点击的是用户节点
|
|
263
|
+
return data.id !== this.tenantNodeId && data.nodeType && data.nodeType === 'USER'
|
|
264
|
+
},
|
|
265
|
+
// 初始化树 或 点击三角展开节点时动态加载子节点
|
|
266
|
+
loadNode(node, resolve) {
|
|
267
|
+
var parentId = 0
|
|
268
|
+
var parentNodeId = '0'
|
|
269
|
+
if (node.level === 0) {
|
|
270
|
+
// 表示初始化树
|
|
271
|
+
parentId = 0
|
|
272
|
+
parentNodeId = parentId + ''
|
|
273
|
+
} else {
|
|
274
|
+
parentId = node.data.id
|
|
275
|
+
parentNodeId = node.data.nodeId
|
|
276
|
+
}
|
|
277
|
+
var checkedKeys = []
|
|
278
|
+
if (this.$refs.groupUserTree) {
|
|
279
|
+
checkedKeys = this.$refs.groupUserTree.getCheckedKeys()
|
|
280
|
+
}
|
|
281
|
+
// 初始化部门人员树
|
|
282
|
+
this.initLoadDepartment(parentId, node, resolve, checkedKeys, parentNodeId)
|
|
283
|
+
},
|
|
284
|
+
// renderContent(h, { node, data, store }) {
|
|
285
|
+
// var className
|
|
286
|
+
// if (node.data.id === -1) {
|
|
287
|
+
// // node.id ===-1表示公司节点,node.branch表示是分支机构节点
|
|
288
|
+
// className = 'el-icon-menu'
|
|
289
|
+
// } else if (node.data.nodeType === 'USER_GROUP') {
|
|
290
|
+
// // node.id ===-2表示集团公司无部门用户节点,node.id ===-3表示是分支机构无部门用户节点
|
|
291
|
+
// className = 'el-icon-date'
|
|
292
|
+
// } else if (node.data.nodeType === 'USER') {
|
|
293
|
+
// className = 'el-icon-user'
|
|
294
|
+
// }
|
|
295
|
+
// return (
|
|
296
|
+
// <span>
|
|
297
|
+
// <i class={className}></i>
|
|
298
|
+
// <span title={node.label}>{node.label}</span>
|
|
299
|
+
// </span>
|
|
300
|
+
// )
|
|
301
|
+
// }
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
</script>
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-tree
|
|
4
|
+
ref="groupUserTree"
|
|
5
|
+
:props="defaultProps"
|
|
6
|
+
:load="loadNode"
|
|
7
|
+
lazy
|
|
8
|
+
node-key="nodeId"
|
|
9
|
+
@node-click="handleNodeClick"
|
|
10
|
+
>
|
|
11
|
+
<template #default="{ node, data }">
|
|
12
|
+
<span>
|
|
13
|
+
<el-icon>
|
|
14
|
+
<Menu v-if="node.data.id === -1"/>
|
|
15
|
+
<Calendar v-else-if="node.data.nodeType === 'USER_GROUP'"/>
|
|
16
|
+
<User v-else-if="node.data.nodeType === 'USER'"/>
|
|
17
|
+
</el-icon>
|
|
18
|
+
<span :title="node.label">
|
|
19
|
+
{{ node.label }}
|
|
20
|
+
</span>
|
|
21
|
+
</span>
|
|
22
|
+
</template>
|
|
23
|
+
</el-tree>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
<script>
|
|
27
|
+
import {Calendar, Menu, User} from '@element-plus/icons-vue'
|
|
28
|
+
import groupUserTreeService from './group-user-tree-service'
|
|
29
|
+
import utils from '../../utils/utils'
|
|
30
|
+
export default {
|
|
31
|
+
name: 'GroupUserSingleTree',
|
|
32
|
+
components:{
|
|
33
|
+
Menu,
|
|
34
|
+
Calendar,
|
|
35
|
+
User
|
|
36
|
+
},
|
|
37
|
+
props: {
|
|
38
|
+
},
|
|
39
|
+
data() {
|
|
40
|
+
return {
|
|
41
|
+
defaultProps: {
|
|
42
|
+
id: 'id',
|
|
43
|
+
label: 'showName',
|
|
44
|
+
children: 'children',
|
|
45
|
+
isLeaf: 'leaf'
|
|
46
|
+
},
|
|
47
|
+
count: 0,
|
|
48
|
+
tenantNodeId: -10, // 公司节点的id
|
|
49
|
+
selectUser: null, // 选择的用户原信息
|
|
50
|
+
selectNodeInfo: null, // 封装后的用户信息,即用户结果
|
|
51
|
+
notMultipleClickNum: null, // 节点没有双击事件,手动实现双击事件,参数用来记录次数
|
|
52
|
+
notMultipleClickNode: null // 节点没有双击事件,手动实现双击事件,参数用来记录节点
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
computed: {
|
|
56
|
+
},
|
|
57
|
+
watch: {
|
|
58
|
+
},
|
|
59
|
+
created() {
|
|
60
|
+
},
|
|
61
|
+
mounted() {
|
|
62
|
+
},
|
|
63
|
+
methods: {
|
|
64
|
+
...utils,
|
|
65
|
+
...groupUserTreeService,
|
|
66
|
+
handleNodeClick(data, node, nodeTree) {
|
|
67
|
+
console.log('handleNodeClick---data=', data)
|
|
68
|
+
if (this.isUserNode(data)) {
|
|
69
|
+
const user = JSON.parse(data.data)
|
|
70
|
+
// 点击的是用户节点,并且是单选树时,点击部门节点直接关闭弹框
|
|
71
|
+
this.packageSelectResult(user)
|
|
72
|
+
if (this.notMultipleClickNode && this.notMultipleClickNode.id === node.id) {
|
|
73
|
+
this.notMultipleClickNum++
|
|
74
|
+
// 表示第二次点击
|
|
75
|
+
// 判断次数
|
|
76
|
+
if (this.notMultipleClickNum === 2) {
|
|
77
|
+
console.log('handleNodeClick--dblClick-----this.selectNodeInfo=', this.selectNodeInfo)
|
|
78
|
+
this.notMultipleClickNum = 0
|
|
79
|
+
this.notMultipleClickNode = null
|
|
80
|
+
// 关闭弹窗
|
|
81
|
+
this.$emit('dblClick', this.selectNodeInfo)
|
|
82
|
+
}
|
|
83
|
+
} else {
|
|
84
|
+
this.notMultipleClickNode = node
|
|
85
|
+
this.notMultipleClickNum = 1
|
|
86
|
+
console.log('handleNodeClick--singleClick----this.selectNodeInfo=', this.selectNodeInfo)
|
|
87
|
+
// 关闭弹窗
|
|
88
|
+
this.$emit('singleClick', this.selectNodeInfo)
|
|
89
|
+
}
|
|
90
|
+
const that = this
|
|
91
|
+
setTimeout(function() {
|
|
92
|
+
that.notMultipleClickNum = 0
|
|
93
|
+
that.notMultipleClickNode = null
|
|
94
|
+
}, 300)
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
packageSelectResult(user) {
|
|
98
|
+
let name = user.name
|
|
99
|
+
if (user.enName && user.enName.trim() !== '') {
|
|
100
|
+
name = name + '(' + user.enName + ')'
|
|
101
|
+
}
|
|
102
|
+
const selectNodeInfo = {
|
|
103
|
+
id: user.id,
|
|
104
|
+
name: name,
|
|
105
|
+
zhName: user.name,
|
|
106
|
+
loginName: user.loginName,
|
|
107
|
+
email: user.email,
|
|
108
|
+
telephone: user.telephone,
|
|
109
|
+
user: user,
|
|
110
|
+
enName: user.enName,
|
|
111
|
+
subCompanyName: user.subCompanyName
|
|
112
|
+
}
|
|
113
|
+
// 表示是勾选单选按钮或 选中树节点
|
|
114
|
+
this.selectNodeInfo = selectNodeInfo
|
|
115
|
+
},
|
|
116
|
+
isUserNode(data) {
|
|
117
|
+
// 当前节点不是公司节点,节点类型是用户类型时,表示点击的是用户节点
|
|
118
|
+
return data.id !== this.tenantNodeId && data.nodeType && data.nodeType === 'USER'
|
|
119
|
+
},
|
|
120
|
+
// 初始化树 或 点击三角展开节点时动态加载子节点
|
|
121
|
+
loadNode(node, resolve) {
|
|
122
|
+
var parentId = 0
|
|
123
|
+
var parentNodeId = '0'
|
|
124
|
+
if (node.level === 0) {
|
|
125
|
+
// 表示初始化树
|
|
126
|
+
parentId = 0
|
|
127
|
+
parentNodeId = parentId + ''
|
|
128
|
+
} else {
|
|
129
|
+
parentId = node.data.id
|
|
130
|
+
parentNodeId = node.data.nodeId
|
|
131
|
+
}
|
|
132
|
+
// 初始化部门人员树
|
|
133
|
+
this.initLoadDepartment(parentId, node, resolve, [], parentNodeId)
|
|
134
|
+
},
|
|
135
|
+
// renderContent(h, { node, data, store }) {
|
|
136
|
+
// var className
|
|
137
|
+
// if (node.data.id === -1) {
|
|
138
|
+
// // node.id ===-1表示公司节点,node.branch表示是分支机构节点
|
|
139
|
+
// className = 'el-icon-menu'
|
|
140
|
+
// } else if (node.data.nodeType === 'USER_GROUP') {
|
|
141
|
+
// // node.id ===-2表示集团公司无部门用户节点,node.id ===-3表示是分支机构无部门用户节点
|
|
142
|
+
// className = 'el-icon-date'
|
|
143
|
+
// } else if (node.data.nodeType === 'USER') {
|
|
144
|
+
// className = 'el-icon-user'
|
|
145
|
+
// }
|
|
146
|
+
// return (
|
|
147
|
+
// <span>
|
|
148
|
+
// <i class={className}></i>
|
|
149
|
+
// <span title={node.label}>{node.label}</span>
|
|
150
|
+
// </span>
|
|
151
|
+
// )
|
|
152
|
+
// }
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
</script>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
const groupUserTreeService = {
|
|
3
|
+
// 选中非叶子类型的部门节点时,首次加载该节点的子节点,需要动态加载该部门下的用户节点及子部门节点,并展开该部门,且选中用户节点
|
|
4
|
+
dynamicCheckedUserNodes(data) {
|
|
5
|
+
const parentId = data.id
|
|
6
|
+
this.$http.get(Vue.prototype.baseAPI + '/component/organization-group-trees/' + parentId).then(result => {
|
|
7
|
+
// 更新当前点击的节点的子节点
|
|
8
|
+
this.$refs.groupUserTree.updateKeyChildren(data.nodeId, result)
|
|
9
|
+
this.$refs.groupUserTree.store.nodesMap[data.nodeId].expanded = true
|
|
10
|
+
this.staticCheckedUserNodes(data)
|
|
11
|
+
})
|
|
12
|
+
},
|
|
13
|
+
// 初始化部门人员树
|
|
14
|
+
initLoadDepartment(parentId, node, resolve, checkedKeys, parentNodeId) {
|
|
15
|
+
var children = []
|
|
16
|
+
if (node.data && node.data.children) {
|
|
17
|
+
children = node.data.children
|
|
18
|
+
}
|
|
19
|
+
if (children && children.length > 0) {
|
|
20
|
+
// 表示加载过该父节点的子节点,只需重新更新一下
|
|
21
|
+
resolve(children)
|
|
22
|
+
// 表示当前展开的节点是选中状态,则应保持其选中状态,并选中其子节点
|
|
23
|
+
if (checkedKeys && checkedKeys.indexOf(parentNodeId) > -1) {
|
|
24
|
+
// 点击部门名称前的三角标识展开节点时,保持当前节点的选中状态
|
|
25
|
+
// 表示当前展开的节点是选中状态,则应保持其选中状态,并选中其子节点
|
|
26
|
+
this.checkedChildrenUserNodes(node.data, node.data.children)
|
|
27
|
+
}
|
|
28
|
+
} else {
|
|
29
|
+
// 表示没有加载过该父节点的子节点集合时
|
|
30
|
+
this.$http.get(Vue.prototype.baseAPI + '/component/organization-group-trees/' + parentId).then(data => {
|
|
31
|
+
resolve(data)
|
|
32
|
+
// 更新当前点击的节点的子节点,必须加该方法,否则会导致子节点无法选中
|
|
33
|
+
this.$refs.groupUserTree.updateKeyChildren(parentNodeId, data)
|
|
34
|
+
if (parentId === 0) {
|
|
35
|
+
// 初始化树时,展开公司节点
|
|
36
|
+
// 加载整个组织结构树时,展开公司节点
|
|
37
|
+
this.loadDepartment(this.tenantNodeId, this.tenantNodeId + '')
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
loadDepartment(parentId, parentNodeId, isSearch, searchValue) {
|
|
43
|
+
this.$http.get(Vue.prototype.baseAPI + '/component/organization-group-trees/' + parentId).then(children => {
|
|
44
|
+
this.$refs.groupUserTree.updateKeyChildren(parentNodeId, children)
|
|
45
|
+
if (this.$refs.groupUserTree.store.nodesMap[parentNodeId]) {
|
|
46
|
+
this.$refs.groupUserTree.store.nodesMap[parentNodeId].expanded = true
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
},
|
|
50
|
+
getGroupUsers(groupIds) {
|
|
51
|
+
return this.$http.post(Vue.prototype.baseAPI + '/component/user-group-links/users', groupIds)
|
|
52
|
+
},
|
|
53
|
+
getUserGroupList() {
|
|
54
|
+
return this.$http.get(Vue.prototype.baseAPI + '/component/user-groups')
|
|
55
|
+
},
|
|
56
|
+
saveUserGroup(userGroup) {
|
|
57
|
+
return this.$http.post(Vue.prototype.baseAPI + '/component/user-groups', userGroup)
|
|
58
|
+
},
|
|
59
|
+
deleteUserGroup(groupId) {
|
|
60
|
+
return this.$http.delete(Vue.prototype.baseAPI + '/component/user-groups/' + groupId)
|
|
61
|
+
},
|
|
62
|
+
saveUserGroupLinks(groupId, loginNames) {
|
|
63
|
+
return this.$http.post(Vue.prototype.baseAPI + '/component/user-group-links/' + groupId, loginNames)
|
|
64
|
+
},
|
|
65
|
+
getUserGroupLinks(groupId) {
|
|
66
|
+
return this.$http.get(Vue.prototype.baseAPI + '/component/user-group-links/' + groupId)
|
|
67
|
+
},
|
|
68
|
+
deleteGroupUserLink(groupId, loginName) {
|
|
69
|
+
return this.$http.delete(Vue.prototype.baseAPI + '/component/user-groups/' + groupId + '/users/' + loginName)
|
|
70
|
+
},
|
|
71
|
+
getGroupById(groupId) {
|
|
72
|
+
return this.$http.get(Vue.prototype.baseAPI + '/component/user-groups/' + groupId)
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
export default groupUserTreeService
|
|
@@ -196,7 +196,7 @@ export default {
|
|
|
196
196
|
}
|
|
197
197
|
let lastValues = []
|
|
198
198
|
if (this.baseProps.multiple !== undefined && this.baseProps.multiple === true) {
|
|
199
|
-
if (this.value !== undefined && this.value !== null &&
|
|
199
|
+
if (this.value !== undefined && this.value !== null && Array.isArray(this.value)) {
|
|
200
200
|
lastValues = JSON.parse(JSON.stringify(this.value))
|
|
201
201
|
}
|
|
202
202
|
}
|
|
@@ -296,7 +296,7 @@ export default {
|
|
|
296
296
|
// })
|
|
297
297
|
// }
|
|
298
298
|
// 默认选中处理
|
|
299
|
-
if (dynamicDataSourceDto.defaultSelect) {
|
|
299
|
+
if (dynamicDataSourceDto.defaultSelect && (this.value === undefined || this.value === null || this.value === '')) {
|
|
300
300
|
// 多选处理
|
|
301
301
|
/**
|
|
302
302
|
if (this.baseProps.multiple) {
|
|
@@ -40,6 +40,19 @@
|
|
|
40
40
|
>
|
|
41
41
|
<div :id="fullscreenViewerId"/>
|
|
42
42
|
</el-dialog>
|
|
43
|
+
<!--<el-image-->
|
|
44
|
+
<!-- ref="preview"-->
|
|
45
|
+
<!-- :src="imgList[0]"-->
|
|
46
|
+
<!-- :preview-src-list="imgList"-->
|
|
47
|
+
<!-- style="display: none"-->
|
|
48
|
+
<!--/>-->
|
|
49
|
+
<el-image-viewer
|
|
50
|
+
v-if="isLightBoxVisible"
|
|
51
|
+
hide-on-click-modal
|
|
52
|
+
:initial-index="0"
|
|
53
|
+
:url-list="imgList"
|
|
54
|
+
:on-close="() =>{isLightBoxVisible = false}"
|
|
55
|
+
/>
|
|
43
56
|
</div>
|
|
44
57
|
</template>
|
|
45
58
|
|
|
@@ -92,11 +105,13 @@ import 'tinymce/plugins/visualchars' //
|
|
|
92
105
|
import 'tinymce/plugins/wordcount' // 数字统计
|
|
93
106
|
import 'tinymce/skins/ui/oxide/skin.css' // 编辑器皮肤样式
|
|
94
107
|
import './tinymce/zh_CN.js'
|
|
108
|
+
import {ElImageViewer} from 'element-plus'
|
|
95
109
|
|
|
96
110
|
export default {
|
|
97
111
|
name: 'RichEditor',
|
|
98
112
|
components: {
|
|
99
113
|
Editor,
|
|
114
|
+
ElImageViewer
|
|
100
115
|
},
|
|
101
116
|
props: {
|
|
102
117
|
entity: {
|
|
@@ -188,6 +203,18 @@ export default {
|
|
|
188
203
|
}
|
|
189
204
|
return url
|
|
190
205
|
},
|
|
206
|
+
setup: (editor) => {
|
|
207
|
+
editor.on('click', (e) => {
|
|
208
|
+
const targetNode = e.target.nodeName
|
|
209
|
+
if (targetNode === 'IMG') {
|
|
210
|
+
// 这里可以实现自定义的图片预览逻辑
|
|
211
|
+
const imgSrc = e.target.src
|
|
212
|
+
this.imgList = []
|
|
213
|
+
this.imgList.push(imgSrc)
|
|
214
|
+
this.isLightBoxVisible = true
|
|
215
|
+
}
|
|
216
|
+
})
|
|
217
|
+
},
|
|
191
218
|
images_upload_handler: (blobInfo, success, failure, progress) => {
|
|
192
219
|
let file
|
|
193
220
|
if (blobInfo.blob() instanceof File) {
|
|
@@ -223,6 +250,8 @@ export default {
|
|
|
223
250
|
dialogVisible: false,
|
|
224
251
|
fullscreenViewerId: 'editor_viewer_' + new Date().getTime(),
|
|
225
252
|
ImageComponent: null,
|
|
253
|
+
imgList: [],
|
|
254
|
+
isLightBoxVisible: false
|
|
226
255
|
}
|
|
227
256
|
},
|
|
228
257
|
watch: {
|
|
@@ -31,7 +31,7 @@ export default {
|
|
|
31
31
|
default: null,
|
|
32
32
|
},
|
|
33
33
|
value: {
|
|
34
|
-
type: String,
|
|
34
|
+
type: [String, Number],
|
|
35
35
|
default: null,
|
|
36
36
|
},
|
|
37
37
|
tableName: {
|
|
@@ -79,7 +79,7 @@ export default {
|
|
|
79
79
|
pageCode: this.pageCode,
|
|
80
80
|
fieldName: this.prop,
|
|
81
81
|
fieldCnName: this.fieldLabel,
|
|
82
|
-
ciphertext: this.value
|
|
82
|
+
ciphertext: this.value ? this.value + '' : null
|
|
83
83
|
}
|
|
84
84
|
if (this.entity) {
|
|
85
85
|
params.dataId = this.entity.ID ? this.entity.ID : this.entity.id
|
|
@@ -1590,15 +1590,19 @@ export default {
|
|
|
1590
1590
|
isSaveAll = true
|
|
1591
1591
|
}
|
|
1592
1592
|
}
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
this.innerValue.
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
this.
|
|
1593
|
+
if (this.type === 'multiselect') {
|
|
1594
|
+
// console.log('multiselectChange2---this.innerValue=', this.innerValue)
|
|
1595
|
+
if (this.innerValue && typeof this.innerValue !== 'number' && this.innerValue.indexOf('saveAll') !== -1) {
|
|
1596
|
+
this.innerValue.splice(this.innerValue.indexOf('saveAll'), 1)
|
|
1597
|
+
}
|
|
1598
|
+
// console.log('multiselectChange3---this.innerValue=', this.innerValue)
|
|
1599
|
+
const val = this.innerValue && this.innerValue.length > 0 ? this.innerValue.join(',') : null
|
|
1600
|
+
if (isSaveAll) {
|
|
1601
|
+
this.cellEvent('input', val)
|
|
1602
|
+
}
|
|
1603
|
+
this.cellEvent('change', val)
|
|
1604
|
+
this.setCellValue(this.column.prop, val, 'change')
|
|
1600
1605
|
}
|
|
1601
|
-
this.cellEvent('change', arr)
|
|
1602
1606
|
},
|
|
1603
1607
|
getDefaultValue(val) {
|
|
1604
1608
|
// 表示当前字段的是空的,但是有默认值时,给当前字段设置值
|
|
@@ -1712,6 +1716,9 @@ export default {
|
|
|
1712
1716
|
isInvalidValue(value) {
|
|
1713
1717
|
return value === undefined || value === null || value === ''
|
|
1714
1718
|
},
|
|
1719
|
+
refreshList() {
|
|
1720
|
+
this.$emit('refresh-list')
|
|
1721
|
+
},
|
|
1715
1722
|
getSwitchConfig(switchProp) {
|
|
1716
1723
|
if (this.valueSetOptions && this.valueSetOptions[switchProp]) {
|
|
1717
1724
|
return this.valueSetOptions[switchProp]
|
|
@@ -161,6 +161,11 @@ function validatorEntity(
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
const gridParams = store.get(listCode)
|
|
164
|
+
Object.keys(entity).forEach(function(key) {
|
|
165
|
+
if(entity[key] && typeof entity[key] === 'string') {
|
|
166
|
+
entity[key] = entity[key].trim()
|
|
167
|
+
}
|
|
168
|
+
})
|
|
164
169
|
validator.validate(
|
|
165
170
|
entity,
|
|
166
171
|
{
|