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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agilebuilder-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.962",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "./lib/super-ui.js",
|
|
@@ -12,20 +12,23 @@
|
|
|
12
12
|
"@tinymce/tinymce-vue": "4.0.4",
|
|
13
13
|
"@zxing/library": "^0.20.0",
|
|
14
14
|
"async-validator": "^4.2.5",
|
|
15
|
+
"compressorjs": "1.2.1",
|
|
15
16
|
"font-awesome": "^4.7.0",
|
|
16
17
|
"js-base64": "^3.7.7",
|
|
17
18
|
"js-cookie": "^3.0.5",
|
|
18
19
|
"mitt": "^3.0.1",
|
|
19
20
|
"path-to-regexp": "6.2.1",
|
|
20
21
|
"sortablejs": "^1.15.0",
|
|
21
|
-
"tinymce": "5.8.2"
|
|
22
|
+
"tinymce": "5.8.2",
|
|
23
|
+
"uuid": "^9.0.1"
|
|
22
24
|
},
|
|
23
25
|
"devDependencies": {
|
|
24
26
|
"@element-plus/icons-vue": "^2.1.0",
|
|
25
27
|
"@vitejs/plugin-vue": "^4.2.3",
|
|
28
|
+
"axios": "^1.5.1",
|
|
26
29
|
"element-plus": "^2.4.1",
|
|
27
30
|
"nprogress": "^0.2.0",
|
|
28
|
-
"sass": "
|
|
31
|
+
"sass": "1.69.4",
|
|
29
32
|
"vite": "^4.4.5",
|
|
30
33
|
"vite-plugin-require-transform": "^1.0.21",
|
|
31
34
|
"vite-plugin-svg-icons": "^2.0.1",
|
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
+
<DepartmentMobileTree
|
|
4
|
+
v-if="isMobile"
|
|
5
|
+
ref="inlineDeparmentTree"
|
|
6
|
+
:department-info="departmentInfo"
|
|
7
|
+
:multiple="multiple"
|
|
8
|
+
:search-field="searchField"
|
|
9
|
+
:select-department-info="selectDepartmentInfo"
|
|
10
|
+
:separator="separator"
|
|
11
|
+
@close="result"
|
|
12
|
+
/>
|
|
3
13
|
<el-dialog
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
v-else
|
|
15
|
+
:close-on-click-modal="false"
|
|
16
|
+
:title="myTitle"
|
|
17
|
+
:width="multiple ? '920px' : '509px'"
|
|
18
|
+
append-to-body
|
|
19
|
+
class="user-tree"
|
|
20
|
+
model-value
|
|
21
|
+
@close="$emit('close')"
|
|
22
|
+
@closed="$emit('closed')"
|
|
23
|
+
@open="$emit('open')"
|
|
24
|
+
@opend="$emit('opend')"
|
|
14
25
|
>
|
|
15
26
|
<inline-department-tree
|
|
16
27
|
ref="inlineDeparmentTree"
|
|
@@ -40,11 +51,14 @@
|
|
|
40
51
|
<script>
|
|
41
52
|
import {$emit} from '../../utils/gogocodeTransfer'
|
|
42
53
|
import InlineDepartmentTree from '../../department-tree-inline/src/department-tree-inline.vue'
|
|
54
|
+
import DepartmentMobileTree from '../../department-tree-mobile/src/department-tree-app.vue'
|
|
55
|
+
import {isMobileBrowser} from '../../../src/utils/common-util'
|
|
43
56
|
|
|
44
57
|
export default {
|
|
45
58
|
name: 'DepartmentTree',
|
|
46
59
|
components: {
|
|
47
60
|
InlineDepartmentTree,
|
|
61
|
+
DepartmentMobileTree
|
|
48
62
|
},
|
|
49
63
|
props: {
|
|
50
64
|
// 是否是多选树,默认是true
|
|
@@ -93,12 +107,15 @@ export default {
|
|
|
93
107
|
},
|
|
94
108
|
},
|
|
95
109
|
data() {
|
|
110
|
+
const isMobile = isMobileBrowser()
|
|
111
|
+
console.log('部门树---isMobile=', isMobile)
|
|
96
112
|
let myTitle = this.$t('imatrixUIMessage.pleaseSelectDepartment')
|
|
97
113
|
if (this.title) {
|
|
98
114
|
myTitle = this.title
|
|
99
115
|
}
|
|
100
116
|
return {
|
|
101
117
|
myTitle,
|
|
118
|
+
isMobile
|
|
102
119
|
}
|
|
103
120
|
},
|
|
104
121
|
methods: {
|
|
@@ -6,8 +6,7 @@ const departmentTreeService = {
|
|
|
6
6
|
filterAppendNodes(value) {
|
|
7
7
|
this.$http
|
|
8
8
|
.post(
|
|
9
|
-
window.$vueApp.config.globalProperties.baseAPI +
|
|
10
|
-
'/component/organization-trees/search-pc-depts',
|
|
9
|
+
window.$vueApp.config.globalProperties.baseAPI + '/component/organization-trees/search-pc-depts',
|
|
11
10
|
this.searchParam
|
|
12
11
|
)
|
|
13
12
|
.then((result) => {
|
|
@@ -17,7 +16,7 @@ const departmentTreeService = {
|
|
|
17
16
|
this.$message({
|
|
18
17
|
showClose: true,
|
|
19
18
|
type: 'error',
|
|
20
|
-
message: getI18n().t('imatrixUIMessage.queryResultIsEmpty')
|
|
19
|
+
message: getI18n().t('imatrixUIMessage.queryResultIsEmpty')
|
|
21
20
|
})
|
|
22
21
|
return
|
|
23
22
|
}
|
|
@@ -35,7 +34,7 @@ const departmentTreeService = {
|
|
|
35
34
|
this.$message({
|
|
36
35
|
showClose: true,
|
|
37
36
|
type: 'error',
|
|
38
|
-
message: getI18n().t('imatrixUIMessage.queryResultIsEmpty')
|
|
37
|
+
message: getI18n().t('imatrixUIMessage.queryResultIsEmpty')
|
|
39
38
|
})
|
|
40
39
|
}
|
|
41
40
|
})
|
|
@@ -55,11 +54,7 @@ const departmentTreeService = {
|
|
|
55
54
|
// this.handleSelectUtil(item, localStorage)
|
|
56
55
|
// 查询最新部门信息替换,缓存为历史数据 数据库可能发生变化
|
|
57
56
|
this.$http
|
|
58
|
-
.get(
|
|
59
|
-
window.$vueApp.config.globalProperties.baseAPI +
|
|
60
|
-
'/api/departments?departmentCode=' +
|
|
61
|
-
item.code
|
|
62
|
-
)
|
|
57
|
+
.get(window.$vueApp.config.globalProperties.baseAPI + '/api/departments?departmentCode=' + item.code)
|
|
63
58
|
.then((departmentDTO) => {
|
|
64
59
|
if (departmentDTO !== null) {
|
|
65
60
|
for (const dtoKey in departmentDTO) {
|
|
@@ -72,9 +67,7 @@ const departmentTreeService = {
|
|
|
72
67
|
this.searchValue = ''
|
|
73
68
|
this.setMemoryCacheData(item, 'department')
|
|
74
69
|
if (this.multiple) {
|
|
75
|
-
const index = this.selectResult.findIndex(
|
|
76
|
-
(selectEntity) => selectEntity.code === item.code
|
|
77
|
-
)
|
|
70
|
+
const index = this.selectResult.findIndex((selectEntity) => selectEntity.code === item.code)
|
|
78
71
|
if (index < 0) {
|
|
79
72
|
this.selectResult.push(item)
|
|
80
73
|
}
|
|
@@ -144,9 +137,7 @@ const departmentTreeService = {
|
|
|
144
137
|
// 不是叶子节点,并且没有加载过该父节点的子节点时,需要走后台展开子节点
|
|
145
138
|
this.$http
|
|
146
139
|
.get(
|
|
147
|
-
window.$vueApp.config.globalProperties.baseAPI +
|
|
148
|
-
'/component/organization-trees/departments/' +
|
|
149
|
-
data.id
|
|
140
|
+
window.$vueApp.config.globalProperties.baseAPI + '/component/organization-trees/departments/' + data.id
|
|
150
141
|
)
|
|
151
142
|
.then((result) => {
|
|
152
143
|
// 更新当前点击的节点的子节点
|
|
@@ -193,21 +184,22 @@ const departmentTreeService = {
|
|
|
193
184
|
if (this.$refs.deparmentTree) {
|
|
194
185
|
checkedKeys = this.$refs.deparmentTree.getCheckedKeys()
|
|
195
186
|
}
|
|
187
|
+
if (parentId === -1 && node.data.childDepartments && node.data.childDepartments.length > 0) {
|
|
188
|
+
// 表示初始化树时,展开公司节点
|
|
189
|
+
resolve(node.data.childDepartments)
|
|
190
|
+
return
|
|
191
|
+
}
|
|
196
192
|
// 初始化部门树
|
|
197
193
|
this.initLoadDepartment(parentId, node, resolve, checkedKeys)
|
|
198
194
|
},
|
|
199
195
|
// 初始化部门树
|
|
200
196
|
initLoadDepartment(parentId, node, resolve, checkedKeys) {
|
|
201
197
|
this.$http
|
|
202
|
-
.get(
|
|
203
|
-
window.$vueApp.config.globalProperties.baseAPI +
|
|
204
|
-
'/component/organization-trees/departments/' +
|
|
205
|
-
parentId
|
|
206
|
-
)
|
|
198
|
+
.get(window.$vueApp.config.globalProperties.baseAPI + '/component/organization-trees/departments/' + parentId)
|
|
207
199
|
.then((data) => {
|
|
208
200
|
resolve(data)
|
|
209
201
|
// 更新当前点击的节点的子节点
|
|
210
|
-
this.$refs.deparmentTree.updateKeyChildren(parentId, data)
|
|
202
|
+
// this.$refs.deparmentTree.updateKeyChildren(parentId, data)
|
|
211
203
|
if (parentId === 0) {
|
|
212
204
|
// 初始化树时,展开公司节点
|
|
213
205
|
const tenantData = data[0].data
|
|
@@ -242,11 +234,7 @@ const departmentTreeService = {
|
|
|
242
234
|
loadDepartment(parentId, isSearch, searchValue) {
|
|
243
235
|
return new Promise((resolve, reject) => {
|
|
244
236
|
this.$http
|
|
245
|
-
.get(
|
|
246
|
-
window.$vueApp.config.globalProperties.baseAPI +
|
|
247
|
-
'/component/organization-trees/departments/' +
|
|
248
|
-
parentId
|
|
249
|
-
)
|
|
237
|
+
.get(window.$vueApp.config.globalProperties.baseAPI + '/component/organization-trees/departments/' + parentId)
|
|
250
238
|
.then((children) => {
|
|
251
239
|
this.$refs.deparmentTree.updateKeyChildren(parentId, children)
|
|
252
240
|
if (this.$refs.deparmentTree.store.nodesMap[parentId]) {
|
|
@@ -263,15 +251,13 @@ const departmentTreeService = {
|
|
|
263
251
|
loadPointDepartments() {
|
|
264
252
|
this.$http
|
|
265
253
|
.post(
|
|
266
|
-
window.$vueApp.config.globalProperties.baseAPI +
|
|
267
|
-
'/component/organization-trees/point-departments',
|
|
254
|
+
window.$vueApp.config.globalProperties.baseAPI + '/component/organization-trees/point-departments',
|
|
268
255
|
this.departmentInfo
|
|
269
256
|
)
|
|
270
257
|
.then((children) => {
|
|
271
258
|
this.$refs.deparmentTree.updateKeyChildren(this.tenantNodeId, children)
|
|
272
259
|
if (this.$refs.deparmentTree.store.nodesMap[this.tenantNodeId]) {
|
|
273
|
-
this.$refs.deparmentTree.store.nodesMap[this.tenantNodeId].expanded =
|
|
274
|
-
true
|
|
260
|
+
this.$refs.deparmentTree.store.nodesMap[this.tenantNodeId].expanded = true
|
|
275
261
|
}
|
|
276
262
|
})
|
|
277
263
|
},
|
|
@@ -306,7 +292,7 @@ const departmentTreeService = {
|
|
|
306
292
|
// 表示集合中不存在该用户,则封装该用户
|
|
307
293
|
var allDept = {
|
|
308
294
|
id: this.tenantNodeId,
|
|
309
|
-
name: '所有部门'
|
|
295
|
+
name: '所有部门'
|
|
310
296
|
}
|
|
311
297
|
return allDept
|
|
312
298
|
},
|
|
@@ -314,20 +300,13 @@ const departmentTreeService = {
|
|
|
314
300
|
return new Promise((resolve, reject) => {
|
|
315
301
|
const selectDepts = []
|
|
316
302
|
if (this.selectDepartmentInfo) {
|
|
317
|
-
if (
|
|
318
|
-
this.selectDepartmentInfo === this.tenantNodeId ||
|
|
319
|
-
this.selectDepartmentInfo === '所有部门'
|
|
320
|
-
) {
|
|
303
|
+
if (this.selectDepartmentInfo === this.tenantNodeId || this.selectDepartmentInfo === '所有部门') {
|
|
321
304
|
// 表示已选择所有用户
|
|
322
305
|
selectDepts.push(this.packageAllDept())
|
|
323
306
|
resolve(selectDepts)
|
|
324
307
|
} else {
|
|
325
308
|
// 表示不是选择的所有用户
|
|
326
|
-
this.getSelectDepts(
|
|
327
|
-
this.searchField,
|
|
328
|
-
this.selectDepartmentInfo,
|
|
329
|
-
this.separator
|
|
330
|
-
)
|
|
309
|
+
this.getSelectDepts(this.searchField, this.selectDepartmentInfo, this.separator)
|
|
331
310
|
.then((departments) => {
|
|
332
311
|
resolve(departments)
|
|
333
312
|
})
|
|
@@ -339,6 +318,6 @@ const departmentTreeService = {
|
|
|
339
318
|
resolve(selectDepts)
|
|
340
319
|
}
|
|
341
320
|
})
|
|
342
|
-
}
|
|
321
|
+
}
|
|
343
322
|
}
|
|
344
323
|
export default departmentTreeService
|
|
@@ -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" :close-on-click-modal="false" :close-on-press-escape="false" 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')}}
|
|
@@ -48,10 +48,10 @@ const props = defineProps<{
|
|
|
48
48
|
}
|
|
49
49
|
}>()
|
|
50
50
|
const emits = defineEmits(['close'])
|
|
51
|
-
let isShowForm = ref(
|
|
52
|
-
function showTree() {
|
|
53
|
-
|
|
54
|
-
}
|
|
51
|
+
let isShowForm = ref(true)
|
|
52
|
+
// function showTree() {
|
|
53
|
+
// isShowForm.value = true
|
|
54
|
+
// }
|
|
55
55
|
function closeTree(selectNodeInfo) {
|
|
56
56
|
emits('close', selectNodeInfo)
|
|
57
57
|
isShowForm.value = false
|
|
@@ -59,7 +59,7 @@ const props = defineProps<{
|
|
|
59
59
|
function selectDepartment() {
|
|
60
60
|
// this.$refs.inlineDeparmentTree.selectDepartment()
|
|
61
61
|
}
|
|
62
|
-
defineExpose({showTree})
|
|
62
|
+
// defineExpose({showTree})
|
|
63
63
|
</script>
|
|
64
64
|
<style>
|
|
65
65
|
.organization-tree, .organization-tree .el-checkbox__label,.organization-tree .el-breadcrumb__inner,.organization-tree .el-tree {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
</el-col>
|
|
19
19
|
</el-row>
|
|
20
20
|
</el-card>
|
|
21
|
-
<el-card v-if="tenantName" class="card-content"
|
|
21
|
+
<el-card v-if="tenantName" class="card-content" >
|
|
22
22
|
<el-row class="item-row item-row-all">
|
|
23
23
|
<el-col class="item-label dept-path"><deptPath :tenantName="tenantName" :clickDepts="clickDepts" @clickBreadcrumb="clickBreadcrumb"/></el-col>
|
|
24
24
|
</el-row>
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
</template>
|
|
45
45
|
</el-tree>
|
|
46
46
|
</el-card>
|
|
47
|
-
<el-card class="card-footer"
|
|
47
|
+
<el-card class="card-footer">
|
|
48
48
|
<div style="display: flex;">
|
|
49
49
|
<div class="select-result" @click="showResult">
|
|
50
50
|
<!-- 已选择:6人,其中有一个部门(含子部门) -->
|
|
@@ -166,17 +166,19 @@ function resizeScrollTargetHeight () {
|
|
|
166
166
|
}
|
|
167
167
|
// 点击复选框时处理
|
|
168
168
|
function handleCheckNode(data, check, isChildrenCheck) {
|
|
169
|
-
if(
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
169
|
+
if(props.multiple) {
|
|
170
|
+
if(check) {
|
|
171
|
+
// 表示选择节点时
|
|
172
|
+
addToSelectDept(data)
|
|
173
|
+
} else {
|
|
174
|
+
// 表示取消选择
|
|
175
|
+
removeSelectDept(data)
|
|
176
|
+
}
|
|
175
177
|
}
|
|
176
178
|
}
|
|
177
179
|
|
|
178
180
|
function handleClickNode(data, node, treenode, events) {
|
|
179
|
-
if(data.nodeType && data.nodeType === 'DEPARTMENT') {
|
|
181
|
+
if(!props.multiple && data.nodeType && data.nodeType === 'DEPARTMENT') {
|
|
180
182
|
selectDepts.value = [data]
|
|
181
183
|
}
|
|
182
184
|
}
|
|
@@ -184,7 +186,7 @@ function handleClickNode(data, node, treenode, events) {
|
|
|
184
186
|
|
|
185
187
|
function addToSelectDept(dept) {
|
|
186
188
|
if(dept.nodeType && dept.nodeType === 'DEPARTMENT') {
|
|
187
|
-
const filterValue = selectDepts.value.filter(item=> item.nodeId === dept.nodeId)
|
|
189
|
+
const filterValue = selectDepts.value.filter(item=> (item.nodeId === dept.nodeId))
|
|
188
190
|
if(!filterValue || filterValue.length === 0) {
|
|
189
191
|
// 表示集合中没有该记录,需要记录到结果集合中
|
|
190
192
|
selectDepts.value.push(JSON.parse(JSON.stringify(dept)))
|
|
@@ -193,7 +195,7 @@ function addToSelectDept(dept) {
|
|
|
193
195
|
}
|
|
194
196
|
|
|
195
197
|
function removeSelectDept(dept) {
|
|
196
|
-
const index = selectDepts.value.findIndex(selectItem=> selectItem.nodeId === dept.nodeId)
|
|
198
|
+
const index = selectDepts.value.findIndex(selectItem=> (selectItem.nodeId === dept.nodeId))
|
|
197
199
|
// 删除指定元素
|
|
198
200
|
selectDepts.value.splice(index, 1)
|
|
199
201
|
checkAll.value =false
|
|
@@ -251,7 +253,7 @@ function showResult() {
|
|
|
251
253
|
}
|
|
252
254
|
|
|
253
255
|
function removeResultDept(dept) {
|
|
254
|
-
const removeDeptInDepts =
|
|
256
|
+
const removeDeptInDepts = selectDepts.value.filter(item=>item.nodeId === dept.nodeId)
|
|
255
257
|
if(removeDeptInDepts && removeDeptInDepts.length > 0) {
|
|
256
258
|
// departments结果存在当前移除的节点时,check-change事件会走removeSelectDept的逻辑
|
|
257
259
|
const selectNodeIds = []
|
|
@@ -261,10 +263,8 @@ function removeResultDept(dept) {
|
|
|
261
263
|
}
|
|
262
264
|
})
|
|
263
265
|
orgTreeRef.value.setCheckedKeys(selectNodeIds, true)
|
|
264
|
-
} else {
|
|
265
|
-
// departments结果不存在当前移除的节点时
|
|
266
|
-
removeSelectDept(dept)
|
|
267
266
|
}
|
|
267
|
+
removeSelectDept(dept)
|
|
268
268
|
}
|
|
269
269
|
|
|
270
270
|
function saveDept() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<department-user-multi-tree
|
|
4
|
-
v-if="multiple"
|
|
4
|
+
v-if="!isMobile && multiple"
|
|
5
5
|
:department-info="departmentInfo"
|
|
6
6
|
:height="height"
|
|
7
7
|
:is-need-virtual-user="isNeedVirtualUser"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
@opendDialog="opendDialog"
|
|
17
17
|
/>
|
|
18
18
|
<department-user-single-tree
|
|
19
|
-
v-if="!multiple"
|
|
19
|
+
v-if="!isMobile && !multiple"
|
|
20
20
|
:department-info="departmentInfo"
|
|
21
21
|
:is-need-virtual-user="isNeedVirtualUser"
|
|
22
22
|
:title="title"
|
|
@@ -26,6 +26,15 @@
|
|
|
26
26
|
@openDialog="openDialog"
|
|
27
27
|
@opendDialog="opendDialog"
|
|
28
28
|
/>
|
|
29
|
+
<DepartmentUserMobileTree
|
|
30
|
+
v-if="isMobile"
|
|
31
|
+
:multiple="multiple"
|
|
32
|
+
:department-info="departmentInfo"
|
|
33
|
+
:search-field="searchField"
|
|
34
|
+
:select-user-info="selectUserInfo"
|
|
35
|
+
:separator="separator"
|
|
36
|
+
@close="closeDialog"
|
|
37
|
+
/>
|
|
29
38
|
</div>
|
|
30
39
|
</template>
|
|
31
40
|
|
|
@@ -33,12 +42,15 @@
|
|
|
33
42
|
import {$emit} from '../../utils/gogocodeTransfer'
|
|
34
43
|
import DepartmentUserSingleTree from './department-user-single-tree.vue'
|
|
35
44
|
import DepartmentUserMultiTree from './department-user-multiple-tree.vue'
|
|
45
|
+
import DepartmentUserMobileTree from '../../department-user-tree-mobile/src/department-user-tree-app.vue'
|
|
46
|
+
import {isMobileBrowser} from '../../../src/utils/common-util'
|
|
36
47
|
|
|
37
48
|
export default {
|
|
38
49
|
name: 'DepartmentUserTree',
|
|
39
50
|
components: {
|
|
40
51
|
DepartmentUserSingleTree,
|
|
41
52
|
DepartmentUserMultiTree,
|
|
53
|
+
DepartmentUserMobileTree
|
|
42
54
|
},
|
|
43
55
|
props: {
|
|
44
56
|
// 是否是多选树,默认是true
|
|
@@ -88,12 +100,15 @@ export default {
|
|
|
88
100
|
}
|
|
89
101
|
},
|
|
90
102
|
data() {
|
|
103
|
+
const isMobile = isMobileBrowser()
|
|
104
|
+
console.log('部门人员树---isMobile=', isMobile)
|
|
91
105
|
let myTitle = this.$t('imatrixUIMessage.pleaseSelectPersonnel')
|
|
92
106
|
if (this.title) {
|
|
93
107
|
myTitle = this.title
|
|
94
108
|
}
|
|
95
109
|
return {
|
|
96
110
|
myTitle,
|
|
111
|
+
isMobile
|
|
97
112
|
}
|
|
98
113
|
},
|
|
99
114
|
methods: {
|
|
@@ -28,31 +28,45 @@
|
|
|
28
28
|
display: inline-block !important;
|
|
29
29
|
"
|
|
30
30
|
>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
31
|
+
<el-tabs v-model="activeTab" class="boe">
|
|
32
|
+
<el-tab-pane :label="$t('departmentUserTreeInline.orgTree')" name="orgTree">
|
|
33
|
+
<el-tree
|
|
34
|
+
ref="deparmentUserTree"
|
|
35
|
+
:props="defaultProps"
|
|
36
|
+
:load="loadNode"
|
|
37
|
+
:check-on-click-node="true"
|
|
38
|
+
lazy
|
|
39
|
+
show-checkbox
|
|
40
|
+
node-key="nodeId"
|
|
41
|
+
@check="handleCheckNode"
|
|
42
|
+
@check-change="handleCheckChange"
|
|
43
|
+
>
|
|
44
|
+
<template #default="{ node, data }">
|
|
45
|
+
<span>
|
|
46
|
+
<el-icon>
|
|
47
|
+
<Menu v-if="node.data.id === -1 || node.data.branch"/>
|
|
48
|
+
<Tickets v-else-if="node.data.id === -2 || node.data.id === -3"/>
|
|
49
|
+
<User v-else-if="node.data.nodeType === 'USER'"/>
|
|
50
|
+
<Calendar v-else/>
|
|
51
|
+
</el-icon>
|
|
52
|
+
<span :title="node.label">
|
|
53
|
+
{{ node.label }}
|
|
54
|
+
</span>
|
|
55
|
+
</span>
|
|
56
|
+
</template>
|
|
57
|
+
</el-tree>
|
|
58
|
+
</el-tab-pane>
|
|
59
|
+
<el-tab-pane name="groupTree">
|
|
60
|
+
<template v-slot:label>
|
|
61
|
+
<span>{{$t('departmentUserTreeInline.group')}}</span>
|
|
62
|
+
<span><GroupUser :active-tab="activeTab" @update-group-tree="updateGroupTree" /></span>
|
|
63
|
+
</template>
|
|
64
|
+
<GroupUserMultipleTree
|
|
65
|
+
v-if="isShowGroupTree"
|
|
66
|
+
@result="getGroupUserResult"
|
|
67
|
+
/>
|
|
68
|
+
</el-tab-pane>
|
|
69
|
+
</el-tabs>
|
|
56
70
|
<!-- @node-click="handleNodeClick" 移除节点点击,不然会造成节点不可选择时,点击也会选择节点 -->
|
|
57
71
|
</div>
|
|
58
72
|
|
|
@@ -117,6 +131,8 @@ import UserResult from './search-result.vue'
|
|
|
117
131
|
import utils from '../../utils/utils'
|
|
118
132
|
import departmentUserTreeMultiService from './department-user-tree-multi-service'
|
|
119
133
|
import memoryCacheUtils from '../../utils/memory-cache-utils'
|
|
134
|
+
import GroupUserMultipleTree from './group-user-multiple-tree'
|
|
135
|
+
import GroupUser from './group-user/group-user.vue'
|
|
120
136
|
|
|
121
137
|
export default {
|
|
122
138
|
data() {
|
|
@@ -156,6 +172,8 @@ export default {
|
|
|
156
172
|
searchStoreKey: 'searchDepartmentUser',
|
|
157
173
|
// 公司根节点信息
|
|
158
174
|
tenantInfo: {},
|
|
175
|
+
activeTab: 'orgTree', // 当前页签
|
|
176
|
+
isShowGroupTree: true,
|
|
159
177
|
memoryCacheKey: 'DEPARTMENT_USER_MEMORY_KEY',
|
|
160
178
|
// 记忆选择数据, 搜索框获得焦点后,下拉显示最近选中的10个人,倒序排列,最后选中的在最上面显示。
|
|
161
179
|
memoryCacheData: [],
|
|
@@ -168,7 +186,9 @@ export default {
|
|
|
168
186
|
Menu,
|
|
169
187
|
Tickets,
|
|
170
188
|
User,
|
|
171
|
-
Calendar
|
|
189
|
+
Calendar,
|
|
190
|
+
GroupUserMultipleTree,
|
|
191
|
+
GroupUser
|
|
172
192
|
},
|
|
173
193
|
props: {
|
|
174
194
|
// 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
|
|
@@ -729,6 +749,21 @@ export default {
|
|
|
729
749
|
// // </span>`
|
|
730
750
|
// // )
|
|
731
751
|
// },
|
|
752
|
+
getGroupUserResult(selectUser) {
|
|
753
|
+
if (selectUser) {
|
|
754
|
+
const result = this.selectResult.filter(user => user.id === selectUser.id)
|
|
755
|
+
if (!result || result.length === 0) {
|
|
756
|
+
this.selectResult.push(selectUser)
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
},
|
|
760
|
+
updateGroupTree() {
|
|
761
|
+
this.isShowGroupTree = false
|
|
762
|
+
const that = this
|
|
763
|
+
setTimeout(() => {
|
|
764
|
+
that.isShowGroupTree = true
|
|
765
|
+
}, 10)
|
|
766
|
+
}
|
|
732
767
|
},
|
|
733
768
|
emits: ['result'],
|
|
734
769
|
}
|