agilebuilder-ui 1.1.47 → 1.1.48-rc1
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/{401-24b6b525.js → 401-a94cd05b.js} +1 -1
- package/lib/{404-55dbc936.js → 404-eb21244b.js} +1 -1
- package/lib/{iframe-page-effbb33c.js → iframe-page-7add4333.js} +1 -1
- package/lib/{index-f3ef09a5.js → index-7a601895.js} +18636 -18542
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.js +1 -1
- package/lib/super-ui.umd.cjs +104 -104
- package/lib/{tab-content-iframe-index-4c557db3.js → tab-content-iframe-index-483b398c.js} +1 -1
- package/lib/{tab-content-index-a7350229.js → tab-content-index-0862686f.js} +1 -1
- package/lib/{tache-subprocess-history-f19dd95f.js → tache-subprocess-history-c80e8ed2.js} +1 -1
- package/package.json +1 -1
- package/packages/department-tree-inline/src/department-multi-tree-inline.vue +42 -34
- package/packages/department-tree-inline/src/department-single-tree-inline.vue +53 -42
- package/packages/department-tree-inline/src/department-tree-service.js +17 -11
- package/packages/department-tree-inline/src/search-result.vue +187 -219
- package/packages/department-tree-mobile/src/department-tree-inline-app.vue +17 -4
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +52 -43
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +52 -42
- package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +23 -13
- package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +9 -5
- package/packages/department-user-tree-inline/src/group-user-tree-service.js +17 -11
- package/packages/department-user-tree-inline/src/search-result.vue +207 -220
- package/packages/department-user-tree-mobile/src/department-user-tree-inline-app.vue +14 -3
- package/packages/dynamic-source-select/src/dynamic-source-select-service.js +7 -2
- package/packages/empty-state/index.vue +28 -0
- package/packages/fs-preview/src/fs-preview.vue +12 -3
- package/packages/fs-upload/src/fs-upload-multi.vue +6 -4
- package/packages/fs-upload/src/fs-upload-single.vue +7 -6
- package/packages/fs-upload/src/fs-upload.vue +3 -1
- package/packages/fs-upload/src/see-big-picture.vue +3 -0
- package/packages/fs-upload-list/src/fs-upload-list.vue +8 -2
- package/packages/fs-upload-new/src/fs-button-upload.vue +11 -4
- package/packages/fs-upload-new/src/fs-drag-upload.vue +11 -4
- package/packages/fs-upload-new/src/fs-preview-new.vue +8 -5
- package/packages/fs-upload-new/src/fs-upload-new.vue +17 -0
- package/packages/plugins/export-data-new.js +2 -0
- package/packages/super-grid/src/components/grid-icon.vue +6 -3
- package/packages/super-grid/src/custom-formatter.js +15 -2
- package/packages/super-grid/src/dynamic-input.vue +34 -6
- package/packages/super-grid/src/formatter.js +5 -1
- package/packages/super-grid/src/normal-column-content.vue +30 -38
- package/packages/super-grid/src/super-grid.vue +4 -4
- package/packages/utils/utils.js +27 -9
- package/packages/workgroup-tree-inline/src/search-result.vue +2 -1
- package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +50 -41
- package/packages/workgroup-tree-mobile/src/workgroup-tree-inline-app.vue +16 -5
- package/packages/workgroup-user-tree-inline/src/search-result.vue +2 -1
- package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +30 -24
- package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +49 -37
- package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-inline-app.vue +281 -222
- package/src/i18n/langs/cn.js +6 -4
- package/src/i18n/langs/en.js +6 -4
- package/src/styles/index.scss +26 -0
- package/src/utils/auth.js +10 -7
- package/src/utils/chat-ai-util.ts +3 -3
- package/src/utils/common-util.js +22 -0
- package/src/utils/global-prop.js +17 -0
- package/src/utils/jump-page-utils.js +8 -4
- package/src/views/dsc-component/Sidebar/SidebarItem.vue +6 -0
- package/src/views/dsc-component/tabs/tab-content.vue +6 -0
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
@change-required="changeRequired"
|
|
35
35
|
@open-page="openPageEvent"
|
|
36
36
|
/>
|
|
37
|
-
<div v-else class="column-text-main">
|
|
37
|
+
<div v-else :class=" (options?.configureObj?.props?.base?.columnEditable ?? false) ? 'column-text-main' : ''">
|
|
38
38
|
<div
|
|
39
39
|
v-if="
|
|
40
40
|
lineEdit.editable &&
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
columnFormatter.options.format &&
|
|
148
148
|
columnFormatter.options.format !== ''
|
|
149
149
|
"
|
|
150
|
-
:class="
|
|
150
|
+
:class="textOverflow === 'newline' ? 'wrap-text' : 'ellipsis cell--span'"
|
|
151
151
|
>
|
|
152
152
|
<!--:key="column.prop+'_'+rowIndex+'_'+currentPage" 为了解决子表分页时,新增自动跳转到下一页,第一条记录的自定义控件被复用,导致业务逻辑没执行 -->
|
|
153
153
|
<component
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
:component-id="componentId"
|
|
173
173
|
:additional-settings="additionalSettings"
|
|
174
174
|
:page-context="options?.pageContext"
|
|
175
|
-
:custom-params="
|
|
175
|
+
:custom-params="getCustomParams()"
|
|
176
176
|
@prohibitToEdit="prohibitToEdit"
|
|
177
177
|
@refresh-list="refreshList"
|
|
178
178
|
/></span>
|
|
@@ -221,12 +221,7 @@
|
|
|
221
221
|
@click="clickHyperLink(column, row, listCode, rowIndex)"
|
|
222
222
|
> -->
|
|
223
223
|
<el-link
|
|
224
|
-
v-else-if="
|
|
225
|
-
columnFormatter !== undefined &&
|
|
226
|
-
columnFormatter.type !== undefined &&
|
|
227
|
-
columnFormatter.type === 'hyperlinks' &&
|
|
228
|
-
getMyHyperLinkSetting(row, rowIndex).visible === true
|
|
229
|
-
"
|
|
224
|
+
v-else-if="columnFormatter?.type === 'hyperlinks' && linkObject.visible === true"
|
|
230
225
|
:type="getLinkType(row)"
|
|
231
226
|
@click="clickHyperLink(column, row, listCode, rowIndex)"
|
|
232
227
|
>
|
|
@@ -234,20 +229,14 @@
|
|
|
234
229
|
v-if="isShowOverflowTooltip"
|
|
235
230
|
:id="column.prop + 'DomData' + rowIndex"
|
|
236
231
|
:style="textOverflow === 'newline' ? {} : { width: cellWidth + 'px' }"
|
|
237
|
-
:title="
|
|
232
|
+
:title="linkObject.title"
|
|
238
233
|
:class="textOverflow === 'newline' ? 'wrap-text' : 'ellipsis cell--span'"
|
|
239
|
-
>{{
|
|
240
|
-
<SuperIcon
|
|
241
|
-
v-if="getMyHyperLinkSetting(row, rowIndex).icon"
|
|
242
|
-
:iconValue="getMyHyperLinkSetting(row, rowIndex).icon"
|
|
243
|
-
></SuperIcon>
|
|
234
|
+
>{{ linkObject.label }}
|
|
235
|
+
<SuperIcon v-if="linkObject.icon" :iconValue="linkObject.icon"></SuperIcon>
|
|
244
236
|
</span>
|
|
245
237
|
<span v-else :id="column.prop + 'DomData' + rowIndex" :class="isShowForm ? '' : 'cell--span'"
|
|
246
|
-
>{{
|
|
247
|
-
<SuperIcon
|
|
248
|
-
v-if="getMyHyperLinkSetting(row, rowIndex).icon"
|
|
249
|
-
:iconValue="getMyHyperLinkSetting(row, rowIndex).icon"
|
|
250
|
-
></SuperIcon>
|
|
238
|
+
>{{ linkObject.label }}
|
|
239
|
+
<SuperIcon v-if="linkObject.icon" :iconValue="linkObject.icon"></SuperIcon>
|
|
251
240
|
</span>
|
|
252
241
|
</el-link>
|
|
253
242
|
<span
|
|
@@ -307,12 +296,7 @@
|
|
|
307
296
|
</span>
|
|
308
297
|
<!-- 超链接 -->
|
|
309
298
|
<el-link
|
|
310
|
-
v-else-if="
|
|
311
|
-
columnFormatter !== undefined &&
|
|
312
|
-
columnFormatter.type !== undefined &&
|
|
313
|
-
columnFormatter.type === 'hyperlinks' &&
|
|
314
|
-
getMyHyperLinkSetting(row, rowIndex).visible === true
|
|
315
|
-
"
|
|
299
|
+
v-else-if="columnFormatter?.type === 'hyperlinks' && linkObject.visible"
|
|
316
300
|
type="primary"
|
|
317
301
|
@click="clickHyperLink(column, row, listCode, rowIndex)"
|
|
318
302
|
>
|
|
@@ -320,20 +304,14 @@
|
|
|
320
304
|
v-if="isShowOverflowTooltip"
|
|
321
305
|
:id="column.prop + 'DomData' + rowIndex"
|
|
322
306
|
:style="textOverflow === 'newline' ? {} : { width: cellWidth + 'px' }"
|
|
323
|
-
:title="$escapeHtml(
|
|
307
|
+
:title="$escapeHtml(linkObject.title)"
|
|
324
308
|
:class="textOverflow === 'newline' ? 'wrap-text' : 'ellipsis cell--span'"
|
|
325
|
-
>{{ $escapeHtml(
|
|
326
|
-
<SuperIcon
|
|
327
|
-
v-if="getMyHyperLinkSetting(row, rowIndex).icon"
|
|
328
|
-
:iconValue="getMyHyperLinkSetting(row, rowIndex).icon"
|
|
329
|
-
></SuperIcon>
|
|
309
|
+
>{{ $escapeHtml(linkObject.label) }}
|
|
310
|
+
<SuperIcon v-if="linkObject.icon" :iconValue="linkObject.icon"></SuperIcon>
|
|
330
311
|
</span>
|
|
331
312
|
<span v-else :id="column.prop + 'DomData' + rowIndex" :class="isShowForm ? '' : 'cell--span'"
|
|
332
|
-
>{{ $escapeHtml(
|
|
333
|
-
<SuperIcon
|
|
334
|
-
v-if="getMyHyperLinkSetting(row, rowIndex).icon"
|
|
335
|
-
:iconValue="getMyHyperLinkSetting(row, rowIndex).icon"
|
|
336
|
-
></SuperIcon>
|
|
313
|
+
>{{ $escapeHtml(linkObject.label) }}
|
|
314
|
+
<SuperIcon v-if="linkObject.icon" :iconValue="linkObject.icon"></SuperIcon>
|
|
337
315
|
</span>
|
|
338
316
|
</el-link>
|
|
339
317
|
<!-- 富文本 -->
|
|
@@ -554,7 +532,8 @@ export default {
|
|
|
554
532
|
requiredClass: '',
|
|
555
533
|
lineEdit,
|
|
556
534
|
options,
|
|
557
|
-
textOverflow
|
|
535
|
+
textOverflow,
|
|
536
|
+
linkObject: {}
|
|
558
537
|
}
|
|
559
538
|
},
|
|
560
539
|
computed: {
|
|
@@ -707,6 +686,9 @@ export default {
|
|
|
707
686
|
}
|
|
708
687
|
this.setScanRuleSets()
|
|
709
688
|
this.requiredClass = this.isRequired(this.row.$editing) ? 'm-requried column-text-main' : ''
|
|
689
|
+
if (this.columnFormatter?.type === 'hyperlinks') {
|
|
690
|
+
this.linkObject = this.getMyHyperLinkSetting(this.row, this.rowIndex)
|
|
691
|
+
}
|
|
710
692
|
},
|
|
711
693
|
mounted() {
|
|
712
694
|
if (this.controlConfig) {
|
|
@@ -1280,6 +1262,16 @@ export default {
|
|
|
1280
1262
|
}
|
|
1281
1263
|
}
|
|
1282
1264
|
return true
|
|
1265
|
+
},
|
|
1266
|
+
getCustomParams() {
|
|
1267
|
+
if (this.column.formatter.type === 'customControl') {
|
|
1268
|
+
if (this.column.formatter?.options?.controlConfig) {
|
|
1269
|
+
const controlConfig = JSON.parse(this.column.formatter.options.controlConfig)
|
|
1270
|
+
if (controlConfig && controlConfig.customParams) {
|
|
1271
|
+
return formatCustomParams(controlConfig.customParams, this.options?.pageContext, this.row)
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1283
1275
|
}
|
|
1284
1276
|
},
|
|
1285
1277
|
emits: ['refresData', 'refresPortData', 'refresPortsData', 'refresMainTableFields', 'prohibitToEdit']
|
|
@@ -460,7 +460,7 @@ export default {
|
|
|
460
460
|
// 限制高度最低值
|
|
461
461
|
hasMaxHeight() {
|
|
462
462
|
if (this.maxHeight) {
|
|
463
|
-
return this.maxHeight <= 100 ? 100 : this.maxHeight + (this.heightOffset!==0?this.heightOffset:30)
|
|
463
|
+
return this.maxHeight <= 100 ? 100 : this.maxHeight + (this.heightOffset !== 0 ? this.heightOffset : 30)
|
|
464
464
|
}
|
|
465
465
|
return undefined
|
|
466
466
|
},
|
|
@@ -468,7 +468,7 @@ export default {
|
|
|
468
468
|
// 是指固定高度最低值
|
|
469
469
|
hasTableHeight() {
|
|
470
470
|
if (this.tableHeight) {
|
|
471
|
-
return this.tableHeight <= 100 ? 100 : this.tableHeight + (this.heightOffset!==0?this.heightOffset:30)
|
|
471
|
+
return this.tableHeight <= 100 ? 100 : this.tableHeight + (this.heightOffset !== 0 ? this.heightOffset : 30)
|
|
472
472
|
}
|
|
473
473
|
return undefined
|
|
474
474
|
},
|
|
@@ -925,7 +925,7 @@ export default {
|
|
|
925
925
|
}
|
|
926
926
|
)
|
|
927
927
|
if (!this.isFormSubTable) {
|
|
928
|
-
setPageInfoToChatStore(this.pageContext
|
|
928
|
+
setPageInfoToChatStore(this.pageContext, {
|
|
929
929
|
listRefs: [
|
|
930
930
|
{
|
|
931
931
|
ref: this
|
|
@@ -1666,7 +1666,7 @@ export default {
|
|
|
1666
1666
|
// const subTableData = JSON.parse(JSON.stringify(this.subTableData))
|
|
1667
1667
|
this.pagination.total = subTableData.length
|
|
1668
1668
|
// 当前是第几页
|
|
1669
|
-
let newCurrentPage = currentPage!== undefined && currentPage !== null ?currentPage: this.currentPage
|
|
1669
|
+
let newCurrentPage = currentPage !== undefined && currentPage !== null ? currentPage : this.currentPage
|
|
1670
1670
|
if (newCurrentPage === undefined || newCurrentPage === null) {
|
|
1671
1671
|
newCurrentPage = 1
|
|
1672
1672
|
}
|
package/packages/utils/utils.js
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
import { getI18n } from '../../src/utils/util'
|
|
2
2
|
import * as Vue from 'vue'
|
|
3
|
+
import { cacheCanShowOrgTree, getCanShowOrgTree } from '../../src/utils/global-prop.js'
|
|
3
4
|
const utils = {
|
|
4
5
|
getSearchUserFields() {
|
|
5
6
|
const i18n = getI18n()
|
|
6
7
|
return [
|
|
7
8
|
{
|
|
8
9
|
value: 'name',
|
|
9
|
-
label: i18n.t('departmentUserTree.searchFieldUserName')
|
|
10
|
+
label: i18n.t('departmentUserTree.searchFieldUserName')
|
|
10
11
|
},
|
|
11
12
|
{
|
|
12
13
|
value: 'loginName',
|
|
13
|
-
label: i18n.t('departmentUserTree.searchFieldLoginName')
|
|
14
|
+
label: i18n.t('departmentUserTree.searchFieldLoginName')
|
|
14
15
|
},
|
|
15
16
|
{ value: 'email', label: i18n.t('departmentUserTree.searchFieldEmail') },
|
|
16
17
|
{
|
|
17
18
|
value: 'telephone',
|
|
18
|
-
label: i18n.t('departmentUserTree.searchFieldTelephone')
|
|
19
|
+
label: i18n.t('departmentUserTree.searchFieldTelephone')
|
|
19
20
|
},
|
|
20
21
|
{
|
|
21
22
|
value: 'jobNumber',
|
|
22
|
-
label: i18n.t('departmentUserTree.searchFieldJobNumber')
|
|
23
|
+
label: i18n.t('departmentUserTree.searchFieldJobNumber')
|
|
23
24
|
},
|
|
24
25
|
{
|
|
25
26
|
value: 'honorificName',
|
|
26
|
-
label: i18n.t('departmentUserTree.searchFieldHonorificName')
|
|
27
|
-
}
|
|
27
|
+
label: i18n.t('departmentUserTree.searchFieldHonorificName')
|
|
28
|
+
}
|
|
28
29
|
]
|
|
29
30
|
},
|
|
30
31
|
removeRow(arr, row) {
|
|
@@ -70,9 +71,7 @@ const utils = {
|
|
|
70
71
|
},
|
|
71
72
|
createFilter(queryString) {
|
|
72
73
|
return (restaurant) => {
|
|
73
|
-
return (
|
|
74
|
-
restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
|
|
75
|
-
)
|
|
74
|
+
return restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
|
|
76
75
|
}
|
|
77
76
|
},
|
|
78
77
|
handleSelectUtil(item, localStorage) {
|
|
@@ -176,5 +175,24 @@ const utils = {
|
|
|
176
175
|
}
|
|
177
176
|
})
|
|
178
177
|
},
|
|
178
|
+
canShowOrgTree() {
|
|
179
|
+
return new Promise((resolve, reject) => {
|
|
180
|
+
const cacheShowOrgTree = getCanShowOrgTree()
|
|
181
|
+
if (cacheShowOrgTree === 'false' || cacheShowOrgTree === 'true') {
|
|
182
|
+
let showOrgTree = cacheShowOrgTree === 'true'
|
|
183
|
+
resolve(showOrgTree)
|
|
184
|
+
} else {
|
|
185
|
+
window.$http
|
|
186
|
+
.get(window.$vueApp.config.globalProperties.baseAPI + '/component/organization-trees/show-org-tree')
|
|
187
|
+
.then((canshow) => {
|
|
188
|
+
cacheCanShowOrgTree(canshow)
|
|
189
|
+
resolve(canshow)
|
|
190
|
+
})
|
|
191
|
+
.catch((error) => {
|
|
192
|
+
resolve(false)
|
|
193
|
+
})
|
|
194
|
+
}
|
|
195
|
+
})
|
|
196
|
+
}
|
|
179
197
|
}
|
|
180
198
|
export default utils
|
|
@@ -162,7 +162,8 @@ export default {
|
|
|
162
162
|
},
|
|
163
163
|
// 添加工作组
|
|
164
164
|
addWorkgroup(index, row) {
|
|
165
|
-
|
|
165
|
+
// JSON.parse(JSON.stringify(row)) 转换对象是为了解决添加数据时浏览器崩溃
|
|
166
|
+
$emit(this, 'addWorkgroup', index, JSON.parse(JSON.stringify(row)))
|
|
166
167
|
},
|
|
167
168
|
// 选中工作组
|
|
168
169
|
selectWorkgroup(selectVal) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<el-container style="height: 395px">
|
|
4
4
|
<el-aside width="430px">
|
|
5
5
|
<el-container style="height: 390px">
|
|
6
|
-
<el-header style="text-align: right; font-size: 12px">
|
|
6
|
+
<el-header style="text-align: right; font-size: 12px; height: 35px">
|
|
7
7
|
<el-autocomplete
|
|
8
8
|
v-model="filterText"
|
|
9
9
|
:fetch-suggestions="querySearch"
|
|
@@ -20,44 +20,48 @@
|
|
|
20
20
|
</el-autocomplete>
|
|
21
21
|
</el-header>
|
|
22
22
|
<el-main>
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<el-tree
|
|
28
|
-
ref="workgroupTree"
|
|
29
|
-
:filter-node-method="filterNode"
|
|
30
|
-
:load="loadNode"
|
|
31
|
-
:props="defaultProps"
|
|
32
|
-
:show-checkbox="multiple"
|
|
33
|
-
lazy
|
|
34
|
-
node-key="id"
|
|
35
|
-
@check="handleCheckNode"
|
|
36
|
-
@node-click="handleNodeClick"
|
|
23
|
+
<template v-if="!searchValue">
|
|
24
|
+
<div
|
|
25
|
+
v-if="canShowOrgTree"
|
|
26
|
+
style="padding-top: 5px; overflow: auto; width: auto; display: inline-block !important"
|
|
37
27
|
>
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
28
|
+
<el-tree
|
|
29
|
+
ref="workgroupTree"
|
|
30
|
+
:filter-node-method="filterNode"
|
|
31
|
+
:load="loadNode"
|
|
32
|
+
:props="defaultProps"
|
|
33
|
+
:show-checkbox="multiple"
|
|
34
|
+
lazy
|
|
35
|
+
node-key="id"
|
|
36
|
+
@check="handleCheckNode"
|
|
37
|
+
@node-click="handleNodeClick"
|
|
38
|
+
>
|
|
39
|
+
<template #default="{ node, data }">
|
|
40
|
+
<span>
|
|
41
|
+
<el-icon>
|
|
42
|
+
<Menu v-if="node.data.id === -1" />
|
|
43
|
+
<Calendar v-else />
|
|
44
|
+
</el-icon>
|
|
45
|
+
<span
|
|
46
|
+
:class="
|
|
47
|
+
data.nodeType &&
|
|
48
|
+
data.nodeType === 'WORKGROUP' &&
|
|
49
|
+
searchValue &&
|
|
50
|
+
data.name.indexOf(searchValue) > -1
|
|
51
|
+
? 'searchResult'
|
|
52
|
+
: ''
|
|
53
|
+
"
|
|
54
|
+
:title="node.label"
|
|
55
|
+
>
|
|
56
|
+
{{ node.label }}
|
|
57
|
+
</span>
|
|
56
58
|
</span>
|
|
57
|
-
</
|
|
58
|
-
</
|
|
59
|
-
</
|
|
60
|
-
|
|
59
|
+
</template>
|
|
60
|
+
</el-tree>
|
|
61
|
+
</div>
|
|
62
|
+
<!-- 暂无信息 -->
|
|
63
|
+
<EmptyState v-else style="width: 100%; height: 100%" />
|
|
64
|
+
</template>
|
|
61
65
|
<div v-if="searchValue && searchValue.length > 0" style="height: 100%; overflow: hidden">
|
|
62
66
|
<workgroup-result
|
|
63
67
|
ref="workgroupResult"
|
|
@@ -116,7 +120,7 @@ import localStorage from '../../../src/utils/local-storage'
|
|
|
116
120
|
import utils from '../../utils/utils'
|
|
117
121
|
import workgroupTreeService from './workgroup-tree-service'
|
|
118
122
|
import WorkgroupResult from './search-result.vue'
|
|
119
|
-
|
|
123
|
+
import EmptyState from '../../empty-state/index.vue'
|
|
120
124
|
export default {
|
|
121
125
|
data() {
|
|
122
126
|
return {
|
|
@@ -145,12 +149,14 @@ export default {
|
|
|
145
149
|
selectWorkgroupData: null,
|
|
146
150
|
// 公司根节点信息
|
|
147
151
|
tenantInfo: {},
|
|
148
|
-
ElIconSearch
|
|
152
|
+
ElIconSearch,
|
|
153
|
+
canShowOrgTree: false
|
|
149
154
|
}
|
|
150
155
|
},
|
|
151
156
|
name: 'InlineWorkgroupTree',
|
|
152
157
|
components: {
|
|
153
|
-
WorkgroupResult
|
|
158
|
+
WorkgroupResult,
|
|
159
|
+
EmptyState
|
|
154
160
|
},
|
|
155
161
|
props: {
|
|
156
162
|
// 是否是多选树,默认是true
|
|
@@ -195,6 +201,9 @@ export default {
|
|
|
195
201
|
}
|
|
196
202
|
},
|
|
197
203
|
created() {
|
|
204
|
+
utils.canShowOrgTree().then((showOrgTree) => {
|
|
205
|
+
this.canShowOrgTree = showOrgTree
|
|
206
|
+
})
|
|
198
207
|
if (this.multiple) {
|
|
199
208
|
this.initSelectGroups(this.searchField, this.selectGroupInfo, this.separator).then((selectGroups) => {
|
|
200
209
|
if (selectGroups) {
|
|
@@ -537,7 +546,7 @@ export default {
|
|
|
537
546
|
}
|
|
538
547
|
</script>
|
|
539
548
|
|
|
540
|
-
<style>
|
|
549
|
+
<style scoped>
|
|
541
550
|
.searchResult {
|
|
542
551
|
color: red;
|
|
543
552
|
}
|
|
@@ -43,7 +43,9 @@
|
|
|
43
43
|
</el-row>
|
|
44
44
|
</el-card>
|
|
45
45
|
<el-card class="card-content org-tree" style="overflow: auto">
|
|
46
|
+
<el-empty v-if="!departments.length" :image="noMessageImage"> </el-empty>
|
|
46
47
|
<el-tree
|
|
48
|
+
v-else
|
|
47
49
|
ref="orgTreeRef"
|
|
48
50
|
:data="departments"
|
|
49
51
|
:show-checkbox="multiple"
|
|
@@ -63,14 +65,14 @@
|
|
|
63
65
|
</template>
|
|
64
66
|
</el-tree>
|
|
65
67
|
</el-card>
|
|
66
|
-
<el-card class="card-footer"
|
|
68
|
+
<el-card class="card-footer">
|
|
67
69
|
<div style="display: flex">
|
|
68
70
|
<div class="select-result" @click="showResult">
|
|
69
71
|
<!-- 已选择:6人,其中有一个部门(含子部门) -->
|
|
70
72
|
<span v-if="multiple" @click="showResult">
|
|
71
73
|
<span v-if="selectDepts.length > 0">
|
|
72
74
|
{{ $t('departmentTreeInline.selectResultInfoHasSelect')
|
|
73
|
-
}}{{ $t('
|
|
75
|
+
}}{{ $t('workgroupTree.selectResultInfo', { num: selectDepts.length }) }}
|
|
74
76
|
<span style="padding-left: 10px"
|
|
75
77
|
><el-icon><ArrowUpBold /></el-icon
|
|
76
78
|
></span>
|
|
@@ -97,6 +99,8 @@ import { resizeScrollTargetHeightUtil, getDeptNamePath } from '../../utils/organ
|
|
|
97
99
|
import deptResult from './dept-result.vue'
|
|
98
100
|
import { ElMessage } from 'element-plus'
|
|
99
101
|
import { useI18n } from 'vue-i18n'
|
|
102
|
+
import utils from '../../utils/utils'
|
|
103
|
+
import noMessageImage from '../../../src/assets/nonemessage.png'
|
|
100
104
|
const props = defineProps<{
|
|
101
105
|
// 是否是多选树,默认是true
|
|
102
106
|
multiple: {
|
|
@@ -149,6 +153,7 @@ let searchParam = ref({
|
|
|
149
153
|
departmentInfo: null
|
|
150
154
|
})
|
|
151
155
|
const { t } = useI18n()
|
|
156
|
+
|
|
152
157
|
onMounted(() => {
|
|
153
158
|
initSelectGroups(props.searchField, props.selectWorkgroupInfo, props.separator).then((departments) => {
|
|
154
159
|
selectDepts.value = departments
|
|
@@ -167,9 +172,15 @@ function getTenantInfo() {
|
|
|
167
172
|
}
|
|
168
173
|
|
|
169
174
|
function getTenantChildrenDept() {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
175
|
+
utils.canShowOrgTree().then((showOrgTree) => {
|
|
176
|
+
if (showOrgTree) {
|
|
177
|
+
getTenantChildren(props.branchInfo, tenantNodeId).then((children) => {
|
|
178
|
+
departments.value = children
|
|
179
|
+
checkedDeptDefault(selectDepts.value, defaultCheckedKeys.value)
|
|
180
|
+
})
|
|
181
|
+
} else {
|
|
182
|
+
departments.value = []
|
|
183
|
+
}
|
|
173
184
|
})
|
|
174
185
|
}
|
|
175
186
|
|
|
@@ -209,7 +209,8 @@ export default {
|
|
|
209
209
|
},
|
|
210
210
|
// 添加工作组
|
|
211
211
|
addWorkgroupUser(index, row) {
|
|
212
|
-
|
|
212
|
+
// JSON.parse(JSON.stringify(row)) 转换对象是为了解决添加数据时浏览器崩溃
|
|
213
|
+
$emit(this, 'addWorkgroupUser', index, JSON.parse(JSON.stringify(row)))
|
|
213
214
|
},
|
|
214
215
|
// 选中工作组
|
|
215
216
|
selectWorkgroupUser(selectVal) {
|
|
@@ -132,27 +132,29 @@ const workgroupTreeInlineService = {
|
|
|
132
132
|
.then((data) => {
|
|
133
133
|
resolve(data)
|
|
134
134
|
// 更新当前点击的节点的子节点
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
135
|
+
if (this.$refs.workgroupUserTree) {
|
|
136
|
+
this.$refs.workgroupUserTree.updateKeyChildren(parentNodeId, data)
|
|
137
|
+
if (parentId === 0) {
|
|
138
|
+
// 初始化树时,展开公司节点
|
|
139
|
+
const tenantData = data[0].data
|
|
140
|
+
this.tenantInfo = JSON.parse(tenantData)
|
|
141
|
+
this.containBranch = data[0].containBranch
|
|
142
|
+
// 加载整个组织结构树时,展开公司节点
|
|
143
|
+
this.loadWorkgroup(this.tenantNodeId, this.tenantNodeId + '')
|
|
144
|
+
}
|
|
145
|
+
if (this.isClickNode) {
|
|
146
|
+
// 表示点击工作组节点选中时展开
|
|
147
|
+
this.isClickNode = false
|
|
148
|
+
this.checkedNode(node.data)
|
|
149
|
+
} else {
|
|
150
|
+
// 表示是点击三角展开节点时
|
|
151
|
+
if (checkedKeys && checkedKeys.indexOf(parentNodeId) > -1) {
|
|
152
|
+
// 点击公司名称前的三角标识展开节点时,保持当前节点的选中状态
|
|
153
|
+
// 表示当前展开的节点是选中状态,则应保持其选中状态,并选中其子节点
|
|
154
|
+
this.checkedNode(node.data)
|
|
155
|
+
}
|
|
156
|
+
}
|
|
154
157
|
}
|
|
155
|
-
}
|
|
156
158
|
})
|
|
157
159
|
},
|
|
158
160
|
// 加载当前节点的子节点
|
|
@@ -164,9 +166,11 @@ const workgroupTreeInlineService = {
|
|
|
164
166
|
this.$http
|
|
165
167
|
.post(window.$vueApp.config.globalProperties.baseAPI + '/component/organization-trees/workgroup-users', param)
|
|
166
168
|
.then((children) => {
|
|
167
|
-
this.$refs.workgroupUserTree
|
|
168
|
-
|
|
169
|
-
this.$refs.workgroupUserTree.store.nodesMap[parentNodeId]
|
|
169
|
+
if(this.$refs.workgroupUserTree) {
|
|
170
|
+
this.$refs.workgroupUserTree.updateKeyChildren(parentNodeId, children)
|
|
171
|
+
if (this.$refs.workgroupUserTree.store.nodesMap[parentNodeId]) {
|
|
172
|
+
this.$refs.workgroupUserTree.store.nodesMap[parentNodeId].expanded = true
|
|
173
|
+
}
|
|
170
174
|
}
|
|
171
175
|
if (isSearch) {
|
|
172
176
|
// 查询时处理
|
|
@@ -176,7 +180,9 @@ const workgroupTreeInlineService = {
|
|
|
176
180
|
}
|
|
177
181
|
if (this.allExpandNodeIds.length === this.allSearchNodeIds.length) {
|
|
178
182
|
// 表示所有节点已展开,执行树的过滤方法
|
|
179
|
-
this.$refs.workgroupUserTree
|
|
183
|
+
if(this.$refs.workgroupUserTree) {
|
|
184
|
+
this.$refs.workgroupUserTree.filter(searchValue)
|
|
185
|
+
}
|
|
180
186
|
this.allExpandNodeIds = []
|
|
181
187
|
this.allSearchNodeIds = []
|
|
182
188
|
}
|