agilebuilder-ui 1.0.621 → 1.0.962
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 +115880 -110424
- package/lib/super-ui.umd.cjs +103 -95
- package/package.json +6 -3
- package/packages/department-tree/src/department-tree.vue +27 -10
- package/packages/department-tree-inline/src/department-tree-service.js +20 -41
- package/packages/department-tree-mobile/src/department-tree-app.vue +6 -6
- package/packages/department-tree-mobile/src/department-tree-inline-app.vue +15 -15
- package/packages/department-user-tree/src/department-user-tree.vue +17 -2
- 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 +162 -0
- package/packages/department-user-tree-inline/src/group-user/group-list.vue +99 -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 +74 -0
- package/packages/department-user-tree-inline/src/search-result.vue +34 -36
- package/packages/department-user-tree-mobile/src/department-user-tree-app.vue +6 -6
- package/packages/department-user-tree-mobile/src/department-user-tree-inline-app.vue +17 -19
- package/packages/department-user-tree-mobile/src/department-user-tree-service.ts +0 -11
- package/packages/dynamic-source-select/src/dynamic-source-select.vue +795 -799
- package/packages/dynamic-source-select/src/events.js +11 -16
- package/packages/fs-upload-list/src/fs-upload-list.vue +183 -122
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-app.vue +246 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue +480 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-component.vue +127 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-input.vue +246 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload.vue +255 -0
- package/packages/fs-upload-new/src/fs-button-upload.vue +10 -13
- package/packages/fs-upload-new/src/fs-drag-upload.vue +4 -8
- package/packages/fs-upload-new/src/fs-preview-new.vue +103 -36
- package/packages/fs-upload-new/src/fs-upload-new.vue +160 -13
- package/packages/index.js +11 -2
- package/packages/organization-input/src/organization-input.vue +493 -539
- package/packages/plugins/export-data-new.js +34 -1
- package/packages/rich-editor/index.vue +29 -0
- package/packages/row-form/index.js +7 -0
- package/packages/row-form/index.vue +211 -0
- package/packages/scan-code-input/src/scan-code-input.vue +136 -104
- package/packages/scan-code-input-browser/index.js +6 -0
- package/packages/{scan-code-input/src/scan-code-input-colse.vue → scan-code-input-browser/src/scan-code-input.vue} +1 -28
- package/packages/secret-info/index.vue +2 -2
- package/packages/super-grid/src/apis.js +158 -10
- package/packages/super-grid/src/components/grid-icon.vue +7 -14
- package/packages/super-grid/src/components/hyperlinks.vue +24 -8
- package/packages/super-grid/src/custom-formatter.js +312 -380
- package/packages/super-grid/src/dynamic-input.vue +346 -43
- package/packages/super-grid/src/formValidatorUtil.js +79 -15
- package/packages/super-grid/src/group-column.vue +5 -0
- package/packages/super-grid/src/normal-column-content.vue +1056 -0
- package/packages/super-grid/src/normal-column.vue +57 -740
- package/packages/super-grid/src/row-detail.vue +50 -0
- package/packages/super-grid/src/row-operation.vue +19 -10
- package/packages/super-grid/src/scan-util.ts +243 -0
- package/packages/super-grid/src/search-button.vue +18 -14
- package/packages/super-grid/src/search-form-advancedQuery.vue +9 -2
- package/packages/super-grid/src/search-form-item.vue +10 -3
- package/packages/super-grid/src/search-form-mobile.vue +250 -0
- package/packages/super-grid/src/search-form.vue +159 -82
- package/packages/super-grid/src/super-grid-service.js +51 -6
- package/packages/super-grid/src/super-grid.vue +657 -761
- package/packages/super-grid/src/utils.js +126 -170
- package/packages/super-nine-grid/src/super-nine-grid.vue +1032 -1141
- package/packages/workflow-button/src/workflow-button.vue +6 -1
- package/packages/workgroup-tree/src/workgroup-tree.vue +31 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +28 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +26 -0
- package/packages/workgroup-tree-mobile/index.js +6 -0
- package/packages/workgroup-tree-mobile/src/dept-result.vue +51 -0
- package/packages/workgroup-tree-mobile/src/workgroup-tree-app.vue +120 -0
- package/packages/workgroup-tree-mobile/src/workgroup-tree-inline-app.vue +375 -0
- package/packages/workgroup-tree-mobile/src/workgroup-tree-service.ts +62 -0
- package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +15 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +27 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +11 -0
- package/packages/workgroup-user-tree-mobile/index.js +6 -0
- package/packages/workgroup-user-tree-mobile/src/dept-path.vue +36 -0
- package/packages/workgroup-user-tree-mobile/src/dept-result.vue +58 -0
- package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-app.vue +119 -0
- package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-inline-app.vue +394 -0
- package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-service.ts +41 -0
- package/src/api/sso-service.js +44 -15
- package/src/directives/permission/permission.js +4 -3
- package/src/i18n/langs/cn.js +19 -3
- package/src/i18n/langs/en.js +18 -2
- package/src/permission.js +114 -122
- package/src/store/modules/user.js +32 -33
- package/src/styles/index.scss +1 -0
- package/src/styles/table.scss +12 -0
- package/src/styles/theme/dark-blue/button.scss +2 -2
- package/src/styles/theme/dark-blue/index.scss +1 -1
- package/src/styles/theme/dark-blue/sidebar.scss +10 -0
- package/src/styles/theme/dark-blue/table.scss +8 -52
- package/src/styles/theme/green/button.scss +2 -2
- package/src/styles/theme/green/green.scss +1 -1
- package/src/styles/theme/green/index.scss +1 -1
- package/src/styles/theme/green/sidebar.scss +20 -0
- package/src/styles/theme/green/table.scss +7 -51
- package/src/styles/theme/ocean-blue/button.scss +2 -2
- package/src/styles/theme/ocean-blue/index.scss +1 -1
- package/src/styles/theme/ocean-blue/ocean-blue.scss +1 -1
- package/src/styles/theme/ocean-blue/sidebar.scss +10 -0
- package/src/styles/theme/ocean-blue/table.scss +7 -52
- package/src/utils/auth.js +23 -3
- package/src/utils/calculator/calculator-factory.js +4 -4
- package/src/utils/calculator/calculator-util.js +14 -0
- package/src/utils/common-util.js +270 -124
- package/src/utils/i18n-util.js +145 -0
- package/src/utils/jump-page-utils.js +245 -314
- package/src/utils/permission.js +7 -1
- package/src/utils/permissionAuth.js +155 -37
- package/src/utils/request.js +10 -11
- package/src/utils/util.js +154 -205
- package/src/views/layout/EmptyLayout.vue +1 -1
- package/src/views/layout/components/Menubar/Item.vue +27 -4
- package/src/views/layout/components/Menubar/SidebarItem.vue +7 -3
- package/src/views/layout/components/Menubar/index.vue +14 -2
- 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,74 @@
|
|
|
1
|
+
const groupUserTreeService = {
|
|
2
|
+
// 选中非叶子类型的部门节点时,首次加载该节点的子节点,需要动态加载该部门下的用户节点及子部门节点,并展开该部门,且选中用户节点
|
|
3
|
+
dynamicCheckedUserNodes(data) {
|
|
4
|
+
const parentId = data.id
|
|
5
|
+
this.$http.get(window.$vueApp.config.globalProperties.baseAPI + '/component/organization-group-trees/' + parentId).then(result => {
|
|
6
|
+
// 更新当前点击的节点的子节点
|
|
7
|
+
this.$refs.groupUserTree.updateKeyChildren(data.nodeId, result)
|
|
8
|
+
this.$refs.groupUserTree.store.nodesMap[data.nodeId].expanded = true
|
|
9
|
+
this.staticCheckedUserNodes(data)
|
|
10
|
+
})
|
|
11
|
+
},
|
|
12
|
+
// 初始化部门人员树
|
|
13
|
+
initLoadDepartment(parentId, node, resolve, checkedKeys, parentNodeId) {
|
|
14
|
+
var children = []
|
|
15
|
+
if (node.data && node.data.children) {
|
|
16
|
+
children = node.data.children
|
|
17
|
+
}
|
|
18
|
+
if (children && children.length > 0) {
|
|
19
|
+
// 表示加载过该父节点的子节点,只需重新更新一下
|
|
20
|
+
resolve(children)
|
|
21
|
+
// 表示当前展开的节点是选中状态,则应保持其选中状态,并选中其子节点
|
|
22
|
+
if (checkedKeys && checkedKeys.indexOf(parentNodeId) > -1) {
|
|
23
|
+
// 点击部门名称前的三角标识展开节点时,保持当前节点的选中状态
|
|
24
|
+
// 表示当前展开的节点是选中状态,则应保持其选中状态,并选中其子节点
|
|
25
|
+
this.checkedChildrenUserNodes(node.data, node.data.children)
|
|
26
|
+
}
|
|
27
|
+
} else {
|
|
28
|
+
// 表示没有加载过该父节点的子节点集合时
|
|
29
|
+
this.$http.get(window.$vueApp.config.globalProperties.baseAPI + '/component/organization-group-trees/' + parentId).then(data => {
|
|
30
|
+
resolve(data)
|
|
31
|
+
// 更新当前点击的节点的子节点,必须加该方法,否则会导致子节点无法选中
|
|
32
|
+
this.$refs.groupUserTree.updateKeyChildren(parentNodeId, data)
|
|
33
|
+
if (parentId === 0) {
|
|
34
|
+
// 初始化树时,展开公司节点
|
|
35
|
+
// 加载整个组织结构树时,展开公司节点
|
|
36
|
+
this.loadDepartment(this.tenantNodeId, this.tenantNodeId + '')
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
loadDepartment(parentId, parentNodeId, isSearch, searchValue) {
|
|
42
|
+
this.$http.get(window.$vueApp.config.globalProperties.baseAPI + '/component/organization-group-trees/' + parentId).then(children => {
|
|
43
|
+
this.$refs.groupUserTree.updateKeyChildren(parentNodeId, children)
|
|
44
|
+
if (this.$refs.groupUserTree.store.nodesMap[parentNodeId]) {
|
|
45
|
+
this.$refs.groupUserTree.store.nodesMap[parentNodeId].expanded = true
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
},
|
|
49
|
+
getGroupUsers(groupIds) {
|
|
50
|
+
return this.$http.post(window.$vueApp.config.globalProperties.baseAPI + '/component/user-group-links/users', groupIds)
|
|
51
|
+
},
|
|
52
|
+
getUserGroupList() {
|
|
53
|
+
return this.$http.get(window.$vueApp.config.globalProperties.baseAPI + '/component/user-groups')
|
|
54
|
+
},
|
|
55
|
+
saveUserGroup(userGroup) {
|
|
56
|
+
return this.$http.post(window.$vueApp.config.globalProperties.baseAPI + '/component/user-groups', userGroup)
|
|
57
|
+
},
|
|
58
|
+
deleteUserGroup(groupId) {
|
|
59
|
+
return this.$http.delete(window.$vueApp.config.globalProperties.baseAPI + '/component/user-groups/' + groupId)
|
|
60
|
+
},
|
|
61
|
+
saveUserGroupLinks(groupId, loginNames) {
|
|
62
|
+
return this.$http.post(window.$vueApp.config.globalProperties.baseAPI + '/component/user-group-links/' + groupId, loginNames)
|
|
63
|
+
},
|
|
64
|
+
getUserGroupLinks(groupId) {
|
|
65
|
+
return this.$http.get(window.$vueApp.config.globalProperties.baseAPI + '/component/user-group-links/' + groupId)
|
|
66
|
+
},
|
|
67
|
+
deleteGroupUserLink(groupId, loginName) {
|
|
68
|
+
return this.$http.delete(window.$vueApp.config.globalProperties.baseAPI + '/component/user-groups/' + groupId + '/users/' + loginName)
|
|
69
|
+
},
|
|
70
|
+
getGroupById(groupId) {
|
|
71
|
+
return this.$http.get(window.$vueApp.config.globalProperties.baseAPI + '/component/user-groups/' + groupId)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
export default groupUserTreeService
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
</div>
|
|
75
75
|
</template>
|
|
76
76
|
</el-table-column>
|
|
77
|
-
<el-table-column
|
|
77
|
+
<!-- <el-table-column
|
|
78
78
|
v-if="multiple"
|
|
79
79
|
:label="$t('superGrid.index')"
|
|
80
80
|
align="center"
|
|
@@ -83,25 +83,31 @@
|
|
|
83
83
|
<template v-slot="scope">
|
|
84
84
|
{{ scope.$index + 1 }}
|
|
85
85
|
</template>
|
|
86
|
-
</el-table-column>
|
|
86
|
+
</el-table-column> -->
|
|
87
87
|
<el-table-column
|
|
88
88
|
:label="$t('departmentUserTreeInline.name')"
|
|
89
|
-
:width="130"
|
|
90
89
|
prop="name"
|
|
91
90
|
>
|
|
92
91
|
<template v-slot="scope">
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
92
|
+
<div v-if="scope.row.enName && scope.row.enName.trim() !== ''">
|
|
93
|
+
<div :title="scope.row.name +'('+scope.row.enName+')' +'['+scope.row.loginName+']'">
|
|
94
|
+
<span>{{ scope.row.name+'('+scope.row.enName+')' }}[{{ scope.row.loginName }}]</span>
|
|
95
|
+
</div>
|
|
96
|
+
<div style="color:#ccc" :title="getDeptName(scope.row)">
|
|
97
|
+
{{ getDeptName(scope.row) }}
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
<div v-else>
|
|
101
|
+
<div :title="scope.row.name +'['+scope.row.loginName+']'">
|
|
102
|
+
<span>{{ scope.row.name }}[{{ scope.row.loginName }}]</span>
|
|
103
|
+
</div>
|
|
104
|
+
<div style="color:#ccc" :title="getDeptName(scope.row)">
|
|
105
|
+
{{ getDeptName(scope.row) }}
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
102
108
|
</template>
|
|
103
109
|
</el-table-column>
|
|
104
|
-
<el-table-column
|
|
110
|
+
<!-- <el-table-column
|
|
105
111
|
:label="$t('departmentUserTreeInline.loginName')"
|
|
106
112
|
:width="110"
|
|
107
113
|
prop="loginName"
|
|
@@ -132,38 +138,17 @@
|
|
|
132
138
|
}}</span
|
|
133
139
|
>
|
|
134
140
|
</template>
|
|
135
|
-
</el-table-column>
|
|
141
|
+
</el-table-column> -->
|
|
136
142
|
<!--由于保密要求,邮箱不能显示,需要脱敏处理,暂时注释掉,不显示-->
|
|
137
143
|
<!-- <el-table-column
|
|
138
144
|
:label="$t('departmentUserTreeInline.email')"
|
|
139
145
|
:width="130"
|
|
140
146
|
prop="email"
|
|
141
147
|
>
|
|
142
|
-
<template
|
|
148
|
+
<template #default="scope">
|
|
143
149
|
<span class="ellipsis cell--span" :title="scope.row.email">{{ scope.row.email }}</span>
|
|
144
150
|
</template>
|
|
145
151
|
</el-table-column> -->
|
|
146
|
-
<el-table-column
|
|
147
|
-
:label="$t('departmentUserTreeInline.superiorDeptNameFullPath')"
|
|
148
|
-
:width="130"
|
|
149
|
-
prop="superiorDeptNameFullPath"
|
|
150
|
-
>
|
|
151
|
-
<template v-slot="scope">
|
|
152
|
-
<span :title="scope.row.superiorDeptNameFullPath" class="ellipsis cell--span">{{ scope.row.superiorDeptNameFullPath }}</span>
|
|
153
|
-
</template>
|
|
154
|
-
</el-table-column>
|
|
155
|
-
<el-table-column
|
|
156
|
-
v-if="containBranch"
|
|
157
|
-
:label="$t('departmentUserTreeInline.branch')"
|
|
158
|
-
:width="130"
|
|
159
|
-
prop="subCompanyName"
|
|
160
|
-
>
|
|
161
|
-
<template v-slot="scope">
|
|
162
|
-
<span :title="scope.row.subCompanyName" class="ellipsis cell--span">{{
|
|
163
|
-
scope.row.subCompanyName
|
|
164
|
-
}}</span>
|
|
165
|
-
</template>
|
|
166
|
-
</el-table-column>
|
|
167
152
|
</el-table>
|
|
168
153
|
</div>
|
|
169
154
|
</template>
|
|
@@ -269,6 +254,19 @@ export default {
|
|
|
269
254
|
return dept.id === queryDept.id
|
|
270
255
|
}
|
|
271
256
|
},
|
|
257
|
+
getDeptName(row) {
|
|
258
|
+
let deptName = row.superiorDeptNameFullPath
|
|
259
|
+
if (deptName) {
|
|
260
|
+
return deptName
|
|
261
|
+
}
|
|
262
|
+
if (this.language && this.language !== 'cn') {
|
|
263
|
+
deptName = row.mainDepartmentEnName
|
|
264
|
+
}
|
|
265
|
+
if (deptName) {
|
|
266
|
+
return deptName
|
|
267
|
+
}
|
|
268
|
+
return row.mainDepartmentName
|
|
269
|
+
}
|
|
272
270
|
},
|
|
273
271
|
emits: ['removeUser', 'addUser', 'selectResult', 'resultRowDblclick'],
|
|
274
272
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-drawer v-model="isShowForm" direction="btt" size="100%" class="organization-tree">
|
|
2
|
+
<el-drawer v-model="isShowForm" direction="btt" size="100%" class="organization-tree" @close="closeTree()">
|
|
3
3
|
<template #header>
|
|
4
4
|
<div style="text-align: center;">
|
|
5
5
|
{{$t('imatrixUIMessage.pleaseSelect')}}
|
|
@@ -47,10 +47,10 @@ const props = defineProps<{
|
|
|
47
47
|
}
|
|
48
48
|
}>()
|
|
49
49
|
const emits = defineEmits(['close'])
|
|
50
|
-
let isShowForm = ref(
|
|
51
|
-
function showTree() {
|
|
52
|
-
|
|
53
|
-
}
|
|
50
|
+
let isShowForm = ref(true)
|
|
51
|
+
// function showTree() {
|
|
52
|
+
// isShowForm.value = true
|
|
53
|
+
// }
|
|
54
54
|
function closeTree(selectNodeInfo) {
|
|
55
55
|
emits('close', selectNodeInfo)
|
|
56
56
|
isShowForm.value = false
|
|
@@ -58,7 +58,7 @@ const props = defineProps<{
|
|
|
58
58
|
function selectDepartment() {
|
|
59
59
|
// this.$refs.inlineDeparmentTree.selectDepartment()
|
|
60
60
|
}
|
|
61
|
-
defineExpose({showTree})
|
|
61
|
+
// defineExpose({showTree})
|
|
62
62
|
</script>
|
|
63
63
|
<style>
|
|
64
64
|
.organization-tree, .organization-tree .el-checkbox__label,.organization-tree .el-breadcrumb__inner,.organization-tree .el-tree {
|