imatrix-ui 2.8.97-dw-tmp40 → 2.8.97-dw-tmp41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/breadcrumb/index.js +6 -0
- package/packages/breadcrumb/src/breadcrumb.vue +71 -0
- package/packages/department-tree/index.js +6 -0
- package/packages/department-tree/src/department-tree.vue +108 -0
- package/packages/department-tree-inline/index.js +6 -0
- package/packages/department-tree-inline/src/department-multi-tree-inline.vue +402 -0
- package/packages/department-tree-inline/src/department-single-tree-inline.vue +284 -0
- package/packages/department-tree-inline/src/department-tree-inline.vue +86 -0
- package/packages/department-tree-inline/src/department-tree-service.js +245 -0
- package/packages/department-tree-inline/src/search-result.vue +176 -0
- package/packages/department-user-tree/index.js +6 -0
- package/packages/department-user-tree/src/department-user-multiple-tree.vue +116 -0
- package/packages/department-user-tree/src/department-user-single-tree.vue +76 -0
- package/packages/department-user-tree/src/department-user-tree.vue +101 -0
- package/packages/department-user-tree-inline/index.js +6 -0
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +626 -0
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +269 -0
- package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +79 -0
- package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +230 -0
- package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +122 -0
- package/packages/department-user-tree-inline/src/search-result.vue +197 -0
- package/packages/directives/prevent-reclick.js +19 -0
- package/packages/dynamic-source-select/index.js +6 -0
- package/packages/dynamic-source-select/src/dynamic-source-select-service.js +70 -0
- package/packages/dynamic-source-select/src/dynamic-source-select.vue +440 -0
- package/packages/dynamic-source-select/src/events.js +55 -0
- package/packages/fs-preview/index.js +6 -0
- package/packages/fs-preview/src/fs-preview.vue +226 -0
- package/packages/fs-upload/index.js +6 -0
- package/packages/fs-upload/src/fs-upload-multi.vue +420 -0
- package/packages/fs-upload/src/fs-upload-single.vue +312 -0
- package/packages/fs-upload/src/fs-upload.vue +189 -0
- package/packages/fs-upload/src/see-big-picture.vue +55 -0
- package/packages/fs-upload-list/index.js +6 -0
- package/packages/fs-upload-list/src/fs-upload-list.vue +287 -0
- package/packages/hamburger/index.js +6 -0
- package/packages/hamburger/src/hamburger.vue +38 -0
- package/packages/index.js +121 -0
- package/packages/multipart-upload/index.js +6 -0
- package/packages/multipart-upload/src/index.vue +73 -0
- package/packages/multipart-upload/src/multipart-upload-form.vue +297 -0
- package/packages/multipart-upload/src/multipart-upload-list.vue +378 -0
- package/packages/organization-input/index.js +6 -0
- package/packages/organization-input/src/organization-input.vue +542 -0
- package/packages/plugins/export-data-new.js +453 -0
- package/packages/plugins/export-data.js +361 -0
- package/packages/plugins/index.js +15 -0
- package/packages/plugins/public-method.js +43 -0
- package/packages/remove-department/index.js +6 -0
- package/packages/remove-department/src/remove-department.vue +172 -0
- package/packages/remove-department/src/remove-dept-service.js +20 -0
- package/packages/remove-user/index.js +6 -0
- package/packages/remove-user/src/remove-user-service.js +20 -0
- package/packages/remove-user/src/remove-user.vue +195 -0
- package/packages/remove-workgroup/index.js +6 -0
- package/packages/remove-workgroup/src/remove-workgroup-service.js +20 -0
- package/packages/remove-workgroup/src/remove-workgroup.vue +159 -0
- package/packages/rich-editor/index.js +7 -0
- package/packages/rich-editor/index.vue +278 -0
- package/packages/rich-editor/langs/zh-Hans.js +1 -0
- package/packages/rich-editor/viewer.vue +103 -0
- package/packages/scan-code-input/index.js +6 -0
- package/packages/scan-code-input/src/events.js +33 -0
- package/packages/scan-code-input/src/scan-code-input-colse.vue +131 -0
- package/packages/scan-code-input/src/scan-code-input.vue +116 -0
- package/packages/secret-info/index.js +7 -0
- package/packages/secret-info/index.vue +90 -0
- package/packages/super-grid/index.js +7 -0
- package/packages/super-grid/src/apis.js +763 -0
- package/packages/super-grid/src/columns-config.vue +335 -0
- package/packages/super-grid/src/custom-formatter.js +250 -0
- package/packages/super-grid/src/dynamic-input.vue +1279 -0
- package/packages/super-grid/src/eventBus.js +2 -0
- package/packages/super-grid/src/events.js +55 -0
- package/packages/super-grid/src/formValidatorUtil.js +226 -0
- package/packages/super-grid/src/formatter.js +181 -0
- package/packages/super-grid/src/group-column.vue +100 -0
- package/packages/super-grid/src/header-context-menu.vue +87 -0
- package/packages/super-grid/src/index-column.vue +51 -0
- package/packages/super-grid/src/normal-column copy.vue +769 -0
- package/packages/super-grid/src/normal-column.vue +769 -0
- package/packages/super-grid/src/public-methods.js +31 -0
- package/packages/super-grid/src/row-operation.vue +161 -0
- package/packages/super-grid/src/search-button.vue +66 -0
- package/packages/super-grid/src/search-condition-input.vue +61 -0
- package/packages/super-grid/src/search-condition-list.vue +59 -0
- package/packages/super-grid/src/search-form-advancedQuery.vue +653 -0
- package/packages/super-grid/src/search-form-dialog.vue +79 -0
- package/packages/super-grid/src/search-form-item.vue +386 -0
- package/packages/super-grid/src/search-form-number.vue +38 -0
- package/packages/super-grid/src/search-form-open.vue +162 -0
- package/packages/super-grid/src/search-form-ordinarySearch.vue +188 -0
- package/packages/super-grid/src/search-form.vue +634 -0
- package/packages/super-grid/src/search-methods.js +387 -0
- package/packages/super-grid/src/selection-column.vue +43 -0
- package/packages/super-grid/src/store.js +3 -0
- package/packages/super-grid/src/super-grid-service-static.js +1313 -0
- package/packages/super-grid/src/super-grid-service.js +561 -0
- package/packages/super-grid/src/super-grid-static.vue +3229 -0
- package/packages/super-grid/src/super-grid.vue +2793 -0
- package/packages/super-grid/src/utils.js +763 -0
- package/packages/super-grid/src/view-image-dialog.vue +130 -0
- package/packages/super-nine-grid/index.js +7 -0
- package/packages/super-nine-grid/src/apis.js +103 -0
- package/packages/super-nine-grid/src/custom-formatter.js +66 -0
- package/packages/super-nine-grid/src/formatter.js +132 -0
- package/packages/super-nine-grid/src/search-form-number.vue +38 -0
- package/packages/super-nine-grid/src/search-form.vue +430 -0
- package/packages/super-nine-grid/src/search-methods.js +134 -0
- package/packages/super-nine-grid/src/store.js +3 -0
- package/packages/super-nine-grid/src/super-grid-service.js +91 -0
- package/packages/super-nine-grid/src/super-nine-grid.vue +872 -0
- package/packages/super-nine-grid/src/utils.js +261 -0
- package/packages/svg-icon/index.js +6 -0
- package/packages/svg-icon/src/svg-icon.vue +43 -0
- package/packages/utils/utils.js +152 -0
- package/packages/utils/value-set.js +86 -0
- package/packages/valid-code/index.js +7 -0
- package/packages/valid-code/src/valid-code.vue +95 -0
- package/packages/workflow-button/index.js +6 -0
- package/packages/workflow-button/src/workflow-button.vue +325 -0
- package/packages/workflow-history-list/index.js +6 -0
- package/packages/workflow-history-list/src/api.js +7 -0
- package/packages/workflow-history-list/src/workflow-history-list.vue +185 -0
- package/packages/workgroup-tree/index.js +6 -0
- package/packages/workgroup-tree/src/workgroup-tree.vue +76 -0
- package/packages/workgroup-tree-inline/index.js +6 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +317 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +43 -0
- package/packages/workgroup-user-tree/index.js +6 -0
- package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +100 -0
- package/packages/workgroup-user-tree-inline/index.js +6 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +163 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +436 -0
- package/packages/year-range-picker/index.js +6 -0
- package/packages/year-range-picker/src/year-range-picker.vue +51 -0
package/package.json
CHANGED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-breadcrumb class="app-breadcrumb" separator="/">
|
|
3
|
+
<transition-group name="breadcrumb">
|
|
4
|
+
<el-breadcrumb-item v-for="(item,index) in levelListWithTitle" :key="item.path">
|
|
5
|
+
<span v-if="item.redirect==='noredirect'||index==levelList.length-1" class="no-redirect">
|
|
6
|
+
{{ item.meta.title }}
|
|
7
|
+
</span>
|
|
8
|
+
<router-link v-else :to="item.redirect||item.path">
|
|
9
|
+
{{ item.meta.title }}
|
|
10
|
+
</router-link>
|
|
11
|
+
</el-breadcrumb-item>
|
|
12
|
+
</transition-group>
|
|
13
|
+
</el-breadcrumb>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
import pathToRegexp from 'path-to-regexp'
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
name: 'Breadcrumb',
|
|
21
|
+
data() {
|
|
22
|
+
return {
|
|
23
|
+
levelList: null
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
computed: {
|
|
27
|
+
levelListWithTitle() {
|
|
28
|
+
return this.levelList.filter(item => item.meta.title !== undefined && item.meta.title !== null)
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
watch: {
|
|
32
|
+
$route() {
|
|
33
|
+
this.getBreadcrumb()
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
created() {
|
|
37
|
+
this.getBreadcrumb()
|
|
38
|
+
},
|
|
39
|
+
methods: {
|
|
40
|
+
getBreadcrumb() {
|
|
41
|
+
const { params } = this.$route
|
|
42
|
+
let matched = this.$route.matched.filter(item => {
|
|
43
|
+
if (item.name) {
|
|
44
|
+
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
|
|
45
|
+
var toPath = pathToRegexp.compile(item.path)
|
|
46
|
+
item.path = toPath(params)
|
|
47
|
+
return true
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
const first = matched[0]
|
|
51
|
+
if (first && first.name !== 'Dashboard') {
|
|
52
|
+
matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched)
|
|
53
|
+
}
|
|
54
|
+
this.levelList = matched
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
61
|
+
.app-breadcrumb.el-breadcrumb {
|
|
62
|
+
display: inline-block;
|
|
63
|
+
font-size: 14px;
|
|
64
|
+
line-height: 50px;
|
|
65
|
+
margin-left: 10px;
|
|
66
|
+
.no-redirect {
|
|
67
|
+
color: #97a8be;
|
|
68
|
+
cursor: text;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
</style>
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-dialog
|
|
4
|
+
class="user-tree"
|
|
5
|
+
visible
|
|
6
|
+
:title="myTitle"
|
|
7
|
+
:close-on-click-modal="false"
|
|
8
|
+
append-to-body
|
|
9
|
+
:width="multiple?'50%':'30%'"
|
|
10
|
+
@open="$emit('open')"
|
|
11
|
+
@opend="$emit('opend')"
|
|
12
|
+
@close="$emit('close')"
|
|
13
|
+
@closed="$emit('closed')"
|
|
14
|
+
>
|
|
15
|
+
<inline-department-tree
|
|
16
|
+
ref="inlineDeparmentTree"
|
|
17
|
+
:check-strictly="checkStrictly"
|
|
18
|
+
:multiple="multiple"
|
|
19
|
+
:height="height"
|
|
20
|
+
:department-info="departmentInfo"
|
|
21
|
+
:select-department-info="selectDepartmentInfo"
|
|
22
|
+
:search-field="searchField"
|
|
23
|
+
:separator="separator"
|
|
24
|
+
@result="result"
|
|
25
|
+
/>
|
|
26
|
+
<div slot="footer" class="dialog-footer">
|
|
27
|
+
<el-button size="small" @click="$emit('close')">
|
|
28
|
+
{{ $t('imatrixUIPublicModel.cancel') }}
|
|
29
|
+
</el-button>
|
|
30
|
+
<el-button size="small" type="primary" @click="selectDepartment">
|
|
31
|
+
{{ $t('imatrixUIPublicModel.sure') }}
|
|
32
|
+
</el-button>
|
|
33
|
+
</div>
|
|
34
|
+
</el-dialog>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
<script>
|
|
38
|
+
import InlineDepartmentTree from '../../department-tree-inline/src/department-tree-inline.vue'
|
|
39
|
+
export default {
|
|
40
|
+
name: 'DepartmentTree',
|
|
41
|
+
components: {
|
|
42
|
+
InlineDepartmentTree
|
|
43
|
+
},
|
|
44
|
+
props: {
|
|
45
|
+
// 是否是多选树,默认是true
|
|
46
|
+
multiple: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: true
|
|
49
|
+
},
|
|
50
|
+
checkStrictly: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false
|
|
53
|
+
},
|
|
54
|
+
// 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
|
|
55
|
+
departmentInfo: {
|
|
56
|
+
type: Array,
|
|
57
|
+
default: null
|
|
58
|
+
},
|
|
59
|
+
// 弹框的标题
|
|
60
|
+
title: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: null
|
|
63
|
+
},
|
|
64
|
+
// 弹框的宽度
|
|
65
|
+
width: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: '30%'
|
|
68
|
+
},
|
|
69
|
+
// 弹框的高度
|
|
70
|
+
height: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: '300px'
|
|
73
|
+
},
|
|
74
|
+
// 多选部门树时,已选择部门id或部门名称或编码集合,多个之间以逗号隔开
|
|
75
|
+
selectDepartmentInfo: {
|
|
76
|
+
type: [String, Number],
|
|
77
|
+
default: null
|
|
78
|
+
},
|
|
79
|
+
// 移除部门时,部门属性名称:id、name、code,默认是id
|
|
80
|
+
searchField: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: 'id'
|
|
83
|
+
},
|
|
84
|
+
// 多选树时结果之间的分隔符,默认是逗号分隔
|
|
85
|
+
separator: {
|
|
86
|
+
type: String,
|
|
87
|
+
default: ','
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
data() {
|
|
91
|
+
let myTitle = this.$t('imatrixUIMessage.pleaseSelectDepartment')
|
|
92
|
+
if (this.title) {
|
|
93
|
+
myTitle = this.title
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
myTitle
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
methods: {
|
|
100
|
+
result(selectNodeInfo) {
|
|
101
|
+
this.$emit('close', selectNodeInfo)
|
|
102
|
+
},
|
|
103
|
+
selectDepartment() {
|
|
104
|
+
this.$refs.inlineDeparmentTree.selectDepartment()
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
</script>
|
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-container style="height: 395px">
|
|
4
|
+
<el-aside width="350px">
|
|
5
|
+
<el-container style="height: 390px">
|
|
6
|
+
<el-header style="text-align: right; font-size: 12px;height: 35px">
|
|
7
|
+
<el-autocomplete
|
|
8
|
+
v-model="filterText"
|
|
9
|
+
size="small"
|
|
10
|
+
select-when-unmatched
|
|
11
|
+
class="inline-input inline-input-custom"
|
|
12
|
+
:fetch-suggestions="querySearch"
|
|
13
|
+
:placeholder="$t('departmentTreeInline.pleaseEnterDepartmentName')"
|
|
14
|
+
:trigger-on-focus="false"
|
|
15
|
+
@keyup.enter.native="clickSearch"
|
|
16
|
+
@select="handleSelect"
|
|
17
|
+
>
|
|
18
|
+
<el-button slot="append" icon="el-icon-search" @click="clickSearch" />
|
|
19
|
+
</el-autocomplete>
|
|
20
|
+
</el-header>
|
|
21
|
+
<el-main style="padding: 10px">
|
|
22
|
+
<div v-if="!searchValue" style="padding-top:5px;overflow:auto;width: auto;display: inline-block !important;">
|
|
23
|
+
<el-tree
|
|
24
|
+
ref="deparmentTree"
|
|
25
|
+
:props="defaultProps"
|
|
26
|
+
:load="loadNode"
|
|
27
|
+
lazy
|
|
28
|
+
:show-checkbox="true"
|
|
29
|
+
node-key="id"
|
|
30
|
+
check-strictly
|
|
31
|
+
:render-content="renderContent"
|
|
32
|
+
:filter-node-method="filterNode"
|
|
33
|
+
@check-change="handleCheckChange"
|
|
34
|
+
@node-expand="handleNodeExpand"
|
|
35
|
+
@check="handleCheckNode"
|
|
36
|
+
@node-click="handleNodeClick"
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<div v-if="searchValue && searchValue.length > 0" style="height:100%;overflow: hidden;">
|
|
41
|
+
<user-result :grid-data="searchResult" :select-result="selectResult" :height="height" :multiple="true" :is-search-result="true" @addUser="selectUser" />
|
|
42
|
+
</div>
|
|
43
|
+
</el-main>
|
|
44
|
+
</el-container>
|
|
45
|
+
</el-aside>
|
|
46
|
+
|
|
47
|
+
<el-container>
|
|
48
|
+
<el-aside width="2px">
|
|
49
|
+
<table border="1px" cellpadding="0" cellspacing="0" style="height:100%;border-left-style:solid; border-bottom-style:none;border-right-style:none;border-top-style:none;border-left-color: #cccccc" />
|
|
50
|
+
</el-aside>
|
|
51
|
+
<el-main style="padding: 10px">
|
|
52
|
+
<div style="text-align:left;font-size:16px">
|
|
53
|
+
{{ $t('departmentTreeInline.selectedDept') }}:
|
|
54
|
+
</div>
|
|
55
|
+
<div :style="'padding-top: 5px;height:90%;overflow: hidden;'">
|
|
56
|
+
<user-result v-loading="isloading" :grid-data="selectResult" :height="height" :multiple="true" :is-search-result="false" @removeUser="removeUser" />
|
|
57
|
+
</div>
|
|
58
|
+
</el-main>
|
|
59
|
+
</el-container>
|
|
60
|
+
</el-container>
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
<style>
|
|
64
|
+
.searchResult {
|
|
65
|
+
color:red
|
|
66
|
+
}
|
|
67
|
+
.inline-input-custom {
|
|
68
|
+
width : 90%
|
|
69
|
+
}
|
|
70
|
+
</style>
|
|
71
|
+
|
|
72
|
+
<script>
|
|
73
|
+
import localStorage from '../../../src/utils/local-storage'
|
|
74
|
+
import utils from '../../utils/utils'
|
|
75
|
+
import departmentTreeService from './department-tree-service'
|
|
76
|
+
import UserResult from './search-result.vue'
|
|
77
|
+
export default {
|
|
78
|
+
name: 'InlineDepartmentMultiTree',
|
|
79
|
+
components: {
|
|
80
|
+
UserResult
|
|
81
|
+
},
|
|
82
|
+
props: {
|
|
83
|
+
checkStrictly: {
|
|
84
|
+
type: Boolean,
|
|
85
|
+
default: false
|
|
86
|
+
},
|
|
87
|
+
// 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
|
|
88
|
+
departmentInfo: {
|
|
89
|
+
type: Array,
|
|
90
|
+
default: null
|
|
91
|
+
},
|
|
92
|
+
// 弹框的高度
|
|
93
|
+
height: {
|
|
94
|
+
type: String,
|
|
95
|
+
default: '300px'
|
|
96
|
+
},
|
|
97
|
+
// 多选部门树时,已选择部门id或部门名称或编码集合,多个之间以逗号隔开
|
|
98
|
+
selectDepartmentInfo: {
|
|
99
|
+
type: [String, Number],
|
|
100
|
+
default: null
|
|
101
|
+
},
|
|
102
|
+
// 移除部门时,部门属性名称:id、name、code,默认是id
|
|
103
|
+
searchField: {
|
|
104
|
+
type: String,
|
|
105
|
+
default: 'id'
|
|
106
|
+
},
|
|
107
|
+
// 多选树时结果之间的分隔符,默认是逗号分隔
|
|
108
|
+
separator: {
|
|
109
|
+
type: String,
|
|
110
|
+
default: ','
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
data() {
|
|
114
|
+
return {
|
|
115
|
+
filterText: '',
|
|
116
|
+
defaultProps: {
|
|
117
|
+
id: 'id',
|
|
118
|
+
label: 'showName',
|
|
119
|
+
children: 'childDepartments',
|
|
120
|
+
isLeaf: 'leaf'
|
|
121
|
+
},
|
|
122
|
+
searchParam: {
|
|
123
|
+
searchValue: null,
|
|
124
|
+
treeType: 'DEPARTMENT_TREE',
|
|
125
|
+
departmentInfo: null
|
|
126
|
+
},
|
|
127
|
+
count: 0,
|
|
128
|
+
containBranch: false, // 当前租户内是否包含分支机构。获得当前选中部门名称时,如果有分支,则需要将分支名称返回给用户,例如:部门1(分支1)
|
|
129
|
+
tenantNodeId: -1, // 公司节点的id
|
|
130
|
+
allSearchNodeIds: [], // 用于保存所有查询出的节点id
|
|
131
|
+
allExpandNodeIds: [], // 用于保存allSearchNodeIds中所有已加载子节点的id集合
|
|
132
|
+
isClickNode: false,
|
|
133
|
+
restaurants: [], // 查询的备选值
|
|
134
|
+
searchValue: null, // 查询条件
|
|
135
|
+
searchStoreKey: 'searchDepartment',
|
|
136
|
+
selectNodeInfo: null, // 单选时,选择的部门信息
|
|
137
|
+
tenantInfo: {}, // 公司根节点信息
|
|
138
|
+
searchResult: [],
|
|
139
|
+
selectResult: [],
|
|
140
|
+
isloading: false // 控制右侧选择区的loading状态
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
computed: {
|
|
144
|
+
},
|
|
145
|
+
watch: {
|
|
146
|
+
filterText(val) {
|
|
147
|
+
if (!val) {
|
|
148
|
+
this.searchValue = val
|
|
149
|
+
// 清空查询内容时,重新加载整个树
|
|
150
|
+
if (this.departmentInfo && this.departmentInfo.length > 0) {
|
|
151
|
+
// 加载指定部门时,展开公司节点
|
|
152
|
+
this.loadPointDepartments()
|
|
153
|
+
} else {
|
|
154
|
+
// 加载整个组织结构树时,展开公司节点
|
|
155
|
+
this.loadDepartment(this.tenantNodeId)
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
created() {
|
|
161
|
+
this.initSelectDepts(this.searchField, this.selectDepartmentInfo, this.separator).then(selectUsers => {
|
|
162
|
+
if (selectUsers) {
|
|
163
|
+
this.selectResult = selectUsers
|
|
164
|
+
}
|
|
165
|
+
})
|
|
166
|
+
},
|
|
167
|
+
mounted() {
|
|
168
|
+
var searchDepartment = localStorage.getObject(this.searchStoreKey)
|
|
169
|
+
if (searchDepartment) {
|
|
170
|
+
this.restaurants = searchDepartment
|
|
171
|
+
} else {
|
|
172
|
+
this.restaurants = []
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
methods: {
|
|
176
|
+
...utils,
|
|
177
|
+
...departmentTreeService,
|
|
178
|
+
filterNode(value, data, node) {
|
|
179
|
+
if (!value) {
|
|
180
|
+
return true
|
|
181
|
+
} else {
|
|
182
|
+
return data.name.indexOf(value) !== -1
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
// 选中当前节点及其子节点
|
|
186
|
+
checkedNodeAndChildren(data) {
|
|
187
|
+
// 取消选中状态时,保持节点是展开的状态,不要折叠
|
|
188
|
+
// this.$refs.deparmentTree.store.nodesMap[data.id].expanded = true
|
|
189
|
+
let department = data
|
|
190
|
+
if (data.data) {
|
|
191
|
+
department = JSON.parse(data.data)
|
|
192
|
+
}
|
|
193
|
+
this.selectUser(null, department)
|
|
194
|
+
// 获得所有应该选中的节点
|
|
195
|
+
this.$refs.deparmentTree.setChecked(data.id, true)
|
|
196
|
+
const childDepartments = data.childDepartments
|
|
197
|
+
if (childDepartments && !this.checkStrictly) {
|
|
198
|
+
// 递归设置子子节点的选中状态
|
|
199
|
+
childDepartments.forEach(nodeData => {
|
|
200
|
+
this.checkedNodeAndChildren(nodeData)
|
|
201
|
+
})
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
// 取消当前节点的子节点的选中状态
|
|
205
|
+
cancelChildCheckedNodes(data) {
|
|
206
|
+
const department = JSON.parse(data.data)
|
|
207
|
+
this.selectResult = this.removeRow(this.selectResult, department)
|
|
208
|
+
if (data.id !== this.tenantNodeId) {
|
|
209
|
+
// 如果当前节点不是公司节点,需要将公司节点的选中状态去掉
|
|
210
|
+
this.$refs.deparmentTree.setChecked(this.tenantNodeId, false)
|
|
211
|
+
}
|
|
212
|
+
const childDepartments = data.childDepartments
|
|
213
|
+
if (childDepartments && !this.checkStrictly) {
|
|
214
|
+
childDepartments.forEach(nodeData => {
|
|
215
|
+
// 取消节点的选中状态
|
|
216
|
+
this.$refs.deparmentTree.setChecked(nodeData.id, false)
|
|
217
|
+
// 递归取消子子节点的选中状态
|
|
218
|
+
this.cancelChildCheckedNodes(nodeData)
|
|
219
|
+
})
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
handleCheckChange(data, checked, indeterminate) {
|
|
223
|
+
|
|
224
|
+
},
|
|
225
|
+
handleNodeExpand(data, node, nodeTree) {
|
|
226
|
+
},
|
|
227
|
+
handleNodeClick(data, node, nodeTree) {
|
|
228
|
+
// 多选部门树时,处理点击节点事件
|
|
229
|
+
this.clickNodeWhenMultiple(data)
|
|
230
|
+
},
|
|
231
|
+
// 多选树时,点击节点处理复选框的选中状态
|
|
232
|
+
clickNodeWhenMultiple(data) {
|
|
233
|
+
var checkedKeys = []
|
|
234
|
+
if (this.$refs.deparmentTree) {
|
|
235
|
+
checkedKeys = this.$refs.deparmentTree.getCheckedKeys()
|
|
236
|
+
}
|
|
237
|
+
if (checkedKeys && checkedKeys.indexOf(data.id) > -1) {
|
|
238
|
+
// 表示当前节点是选中状态,则需要取消其选中状态
|
|
239
|
+
// 取消当前节点的勾选状态
|
|
240
|
+
this.$refs.deparmentTree.setChecked(data.id, false)
|
|
241
|
+
// 取消当前节点的子节点的勾选状态
|
|
242
|
+
if (!this.checkStrictly) {
|
|
243
|
+
this.cancelChildCheckedNodes(data)
|
|
244
|
+
}
|
|
245
|
+
// 取消选中状态时,保持节点是展开的状态,不要折叠
|
|
246
|
+
this.$refs.deparmentTree.store.nodesMap[data.id].expanded = true
|
|
247
|
+
} else {
|
|
248
|
+
// 表示当前节点不是选中的状态,需要勾选该节点
|
|
249
|
+
if (data.nodeType && data.nodeType === 'DEPARTMENT' && data.data) {
|
|
250
|
+
// 表示当前选中的节点是部门
|
|
251
|
+
const department = JSON.parse(data.data)
|
|
252
|
+
this.selectUser(null, department)
|
|
253
|
+
}
|
|
254
|
+
this.$refs.deparmentTree.setChecked(data.id, true)
|
|
255
|
+
// 点击树节点时添加并展开节点会走loadNode方法,因为设置了树组件的expand-on-click-node属性为true
|
|
256
|
+
const children = data.childDepartments
|
|
257
|
+
if (children && children.length > 0) {
|
|
258
|
+
// 表示加载过该节点,直接选中即可
|
|
259
|
+
if (!this.checkStrictly) {
|
|
260
|
+
this.checkedNodeAndChildren(data)
|
|
261
|
+
}
|
|
262
|
+
} else {
|
|
263
|
+
// 表示没有加载过该节点,是首次加载,需要走后台
|
|
264
|
+
// 会走loadNode方法,因为设置了树组件的expand-on-click-node属性为true
|
|
265
|
+
this.isClickNode = true
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
isDepartmentNode(data) {
|
|
270
|
+
// 当前节点不是公司节点,也不是分支机构节点,表示是部门节点
|
|
271
|
+
return data.id !== this.tenantNodeId && data.nodeType && data.nodeType === 'DEPARTMENT' && !data.branch
|
|
272
|
+
},
|
|
273
|
+
selectDepartment() {
|
|
274
|
+
// 是否需要显示提示框,默认不显示
|
|
275
|
+
var showTip = false
|
|
276
|
+
var leafSelectNodeInfo = {
|
|
277
|
+
ids: [],
|
|
278
|
+
names: [],
|
|
279
|
+
codes: [],
|
|
280
|
+
zhNames: [],
|
|
281
|
+
enNames: [],
|
|
282
|
+
departments: []
|
|
283
|
+
}
|
|
284
|
+
if (this.selectResult.length === 0) {
|
|
285
|
+
// 没有选择任何节点
|
|
286
|
+
showTip = true
|
|
287
|
+
} else {
|
|
288
|
+
for (var i = 0; i < this.selectResult.length; i++) {
|
|
289
|
+
var userData = this.selectResult[i]
|
|
290
|
+
// 不存在该用户则放到结果集合中,去掉重复使用
|
|
291
|
+
leafSelectNodeInfo.ids.push(userData.id)
|
|
292
|
+
leafSelectNodeInfo.codes.push(userData.code)
|
|
293
|
+
if(userData.enName) {
|
|
294
|
+
leafSelectNodeInfo.enNames.push(userData.enName)
|
|
295
|
+
} else {
|
|
296
|
+
leafSelectNodeInfo.enNames.push('')
|
|
297
|
+
}
|
|
298
|
+
if (userData.department) {
|
|
299
|
+
leafSelectNodeInfo.departments.push(userData.department)
|
|
300
|
+
} else {
|
|
301
|
+
leafSelectNodeInfo.departments.push(userData)
|
|
302
|
+
}
|
|
303
|
+
let name = userData.showName
|
|
304
|
+
leafSelectNodeInfo.names.push(name)
|
|
305
|
+
leafSelectNodeInfo.zhNames.push(userData.name)
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
if (leafSelectNodeInfo.ids.length > 0) {
|
|
309
|
+
leafSelectNodeInfo.containBranch = this.containBranch
|
|
310
|
+
this.$emit('result', leafSelectNodeInfo)
|
|
311
|
+
} else {
|
|
312
|
+
showTip = true
|
|
313
|
+
}
|
|
314
|
+
if (showTip) {
|
|
315
|
+
this.$alert(this.$t('imatrixUIMessage.pleaseSelectDepartment'), this.$t('imatrixUIMessage.tips'), {
|
|
316
|
+
confirmButtonText: this.$t('imatrixUIPublicModel.sure')
|
|
317
|
+
})
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
// 是否选中了公司节点
|
|
321
|
+
isSelectTenantNode(dataId) {
|
|
322
|
+
return dataId === this.tenantNodeId && (!this.departmentInfo || this.departmentInfo.length === 0)
|
|
323
|
+
},
|
|
324
|
+
// 给节点添加自定义图标
|
|
325
|
+
renderContent(h, { node, data, store }) {
|
|
326
|
+
var className
|
|
327
|
+
if (node.data.id === -1 || node.data.branch) {
|
|
328
|
+
// node.id ===-1表示公司节点,node.branch表示是分支机构节点
|
|
329
|
+
className = 'el-icon-menu'
|
|
330
|
+
} else if (node.data.id === -2 || node.data.id === -3) {
|
|
331
|
+
// node.id ===-2表示集团公司无部门用户节点,node.id ===-3表示是分支机构无部门用户节点
|
|
332
|
+
className = 'el-icon-tickets'
|
|
333
|
+
} else {
|
|
334
|
+
// 表示是部门节点
|
|
335
|
+
className = 'el-icon-date'
|
|
336
|
+
}
|
|
337
|
+
return (
|
|
338
|
+
<span>
|
|
339
|
+
<i class={className}></i>
|
|
340
|
+
<span title={node.label}>{node.label}</span>
|
|
341
|
+
</span>
|
|
342
|
+
)
|
|
343
|
+
},
|
|
344
|
+
// 将查询结果中指定用户添加到已选择用户集合中
|
|
345
|
+
selectUser(index, dept) {
|
|
346
|
+
// if (!this.isContainAllUser()) {
|
|
347
|
+
const containUsers = this.selectResult.filter(this.filterDept(dept))
|
|
348
|
+
if (containUsers && containUsers.length === 0) {
|
|
349
|
+
// 如果已选结果中不包含当前用户,则添加
|
|
350
|
+
// 将查询结果中的用户复制到已选择用户集合中
|
|
351
|
+
dept.tenantCode = this.tenantInfo.code
|
|
352
|
+
dept.tenantName = this.tenantInfo.tenantName
|
|
353
|
+
this.selectResult.push(dept)
|
|
354
|
+
}
|
|
355
|
+
// } else {
|
|
356
|
+
// this.alertByAllUser()
|
|
357
|
+
// }
|
|
358
|
+
},
|
|
359
|
+
// 判断用户是否存在的过滤器
|
|
360
|
+
filterDept(queryDept) {
|
|
361
|
+
return (dept) => {
|
|
362
|
+
return (dept.id === queryDept.id)
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
filterDeptNode(queryDept) {
|
|
366
|
+
return (deptNodeId) => {
|
|
367
|
+
return (deptNodeId + '' === queryDept.id + '')
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
// 从已选择用户集合中移除指定用户,并添加到查询结果集合中
|
|
371
|
+
removeUser(index, dept) {
|
|
372
|
+
// 表示是在组织结构树页面,需要将树的人员节点的选中状态去掉
|
|
373
|
+
if (dept.nodeId) {
|
|
374
|
+
const nodeId = dept.nodeId
|
|
375
|
+
if (this.$refs.deparmentTree && nodeId) {
|
|
376
|
+
this.$refs.deparmentTree.setChecked(nodeId, false)
|
|
377
|
+
}
|
|
378
|
+
} else {
|
|
379
|
+
if (this.$refs.deparmentTree) {
|
|
380
|
+
// 通过查询结果添加的用户,在返回到组织结构树时,也选中了该用户,在移除该用户时,需要去掉复选框的选中状态
|
|
381
|
+
const checkedKeys = this.$refs.deparmentTree.getCheckedKeys()
|
|
382
|
+
const currentCheckedUserNodeIds = checkedKeys.filter(this.filterDeptNode(dept))
|
|
383
|
+
if (currentCheckedUserNodeIds.length > 0) {
|
|
384
|
+
// 表示当前用户是选中的状态,需要去掉
|
|
385
|
+
currentCheckedUserNodeIds.forEach(userNodeId => {
|
|
386
|
+
this.$refs.deparmentTree.setChecked(userNodeId, false)
|
|
387
|
+
})
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
this.selectResult = this.removeRow(this.selectResult, dept)
|
|
392
|
+
if (!this.selectResult || this.selectResult.length === 0) {
|
|
393
|
+
// 已选结果面板没有内容,则左侧树节点也不要有选中节点了
|
|
394
|
+
if (this.$refs.deparmentTree) {
|
|
395
|
+
this.$refs.deparmentTree.setCheckedKeys([])
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
</script>
|