imatrix-ui 2.9.18-dw → 2.9.19-boe02
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.umd.min.js +5 -35
- package/package.json +4 -3
- package/src/api/sso-service.js +19 -1
- package/src/assets/nonemessage.png +0 -0
- package/src/i18n/i18n.js +1 -1
- package/src/i18n/langs/cn.js +25 -6
- package/src/i18n/langs/en.js +27 -7
- package/src/permission.js +2 -2
- package/src/plugins.js +3 -3
- package/src/router/index.js +10 -0
- package/src/store/modules/tab-content.js +6 -0
- package/src/store/modules/user.js +32 -2
- package/src/styles/display-layout.scss +1 -1
- package/src/styles/index.scss +74 -4
- package/src/styles/theme/black/font-style.scss +70 -0
- package/src/styles/theme/black/index.scss +6 -30
- package/src/styles/theme/blue/font-style.scss +37 -0
- package/src/styles/theme/blue/index.scss +2 -18
- package/src/styles/theme/blue2/font-style.scss +70 -0
- package/src/styles/theme/blue2/index.scss +3 -13
- package/src/styles/theme/dark-blue/card.scss +4 -6
- package/src/styles/theme/dark-blue/form.scss +7 -4
- package/src/styles/theme/dark-blue/index.scss +30 -5
- package/src/styles/theme/dark-blue/input.scss +4 -1
- package/src/styles/theme/dark-blue/message.scss +8 -0
- package/src/styles/theme/dark-blue/radio.scss +13 -0
- package/src/styles/theme/dark-blue/scrollbar-style.scss +8 -3
- package/src/styles/theme/dark-blue/sidebar.scss +7 -37
- package/src/styles/theme/dark-blue/tab.scss +4 -1
- package/src/styles/theme/dark-blue/table.scss +2 -2
- package/src/styles/theme/dark-blue/tree.scss +35 -10
- package/src/styles/theme/gray/card-style.scss +13 -1
- package/src/styles/theme/gray/font-style.scss +38 -0
- package/src/styles/theme/gray/index.scss +13 -25
- package/src/styles/theme/gray/scrollbar-style.scss +37 -0
- package/src/styles/theme/gray/sidebar.scss +7 -14
- package/src/utils/auth-api.js +47 -1
- package/src/utils/calculator/calculator-util.js +14 -0
- package/src/utils/common-util.js +22 -81
- package/src/utils/jump-page-utils.js +12 -9
- package/src/utils/preview-util.js +32 -0
- package/src/utils/range-selector.js +185 -0
- package/src/utils/request.js +20 -12
- package/src/utils/util.js +13 -11
- package/src/utils/workflow-util.js +3 -0
- package/src/views/dsc-component/Sidebar/Item.vue +7 -5
- package/src/views/dsc-component/Sidebar/SidebarItem.vue +2 -3
- package/src/views/dsc-component/Sidebar/index.vue +14 -22
- package/src/views/dsc-component/tabs/tab-content.vue +8 -9
- package/src/views/layout/EmptyLayout.vue +4 -1
- package/src/views/layout/NewLayout.vue +6 -65
- package/src/views/layout/components/AppMain.vue +2 -1
- package/src/views/layout/components/Breadcrumb/index.vue +1 -1
- package/src/views/layout/components/Menubar/Item.vue +23 -7
- package/src/views/layout/components/Menubar/Link.vue +11 -2
- package/src/views/layout/components/Menubar/SidebarItem.vue +50 -7
- package/src/views/layout/components/Menubar/index.vue +51 -16
- package/src/views/layout/components/Sidebar/index.vue +2 -2
- package/src/views/layout/components/tabs/tab-content.vue +162 -0
- package/src/views/layout/tab-content-iframe-index.vue +31 -0
- package/src/views/layout/tab-content-index.vue +84 -0
- package/src/views/login/index.vue +1 -1
- package/packages/breadcrumb/index.js +0 -6
- package/packages/breadcrumb/src/breadcrumb.vue +0 -71
- package/packages/department-tree/index.js +0 -6
- package/packages/department-tree/src/department-tree.vue +0 -108
- package/packages/department-tree-inline/index.js +0 -6
- package/packages/department-tree-inline/src/department-multi-tree-inline.vue +0 -411
- package/packages/department-tree-inline/src/department-single-tree-inline.vue +0 -293
- package/packages/department-tree-inline/src/department-tree-inline.vue +0 -86
- package/packages/department-tree-inline/src/department-tree-service.js +0 -275
- package/packages/department-tree-inline/src/search-result.vue +0 -176
- package/packages/department-user-tree/index.js +0 -6
- package/packages/department-user-tree/src/department-user-multiple-tree.vue +0 -116
- package/packages/department-user-tree/src/department-user-single-tree.vue +0 -76
- package/packages/department-user-tree/src/department-user-tree.vue +0 -101
- package/packages/department-user-tree-inline/index.js +0 -6
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +0 -639
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +0 -274
- package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +0 -79
- package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +0 -248
- package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -142
- package/packages/department-user-tree-inline/src/search-result.vue +0 -197
- package/packages/directives/prevent-reclick.js +0 -19
- package/packages/dynamic-source-select/index.js +0 -6
- package/packages/dynamic-source-select/src/dynamic-source-select-service.js +0 -70
- package/packages/dynamic-source-select/src/dynamic-source-select.vue +0 -440
- package/packages/dynamic-source-select/src/events.js +0 -55
- package/packages/fs-preview/index.js +0 -6
- package/packages/fs-preview/src/fs-preview.vue +0 -226
- package/packages/fs-upload/index.js +0 -6
- package/packages/fs-upload/src/fs-upload-multi.vue +0 -420
- package/packages/fs-upload/src/fs-upload-single.vue +0 -312
- package/packages/fs-upload/src/fs-upload.vue +0 -189
- package/packages/fs-upload/src/see-big-picture.vue +0 -55
- package/packages/fs-upload-list/index.js +0 -6
- package/packages/fs-upload-list/src/fs-upload-list.vue +0 -287
- package/packages/hamburger/index.js +0 -6
- package/packages/hamburger/src/hamburger.vue +0 -38
- package/packages/index.js +0 -121
- package/packages/multipart-upload/index.js +0 -6
- package/packages/multipart-upload/src/index.vue +0 -73
- package/packages/multipart-upload/src/multipart-upload-form.vue +0 -297
- package/packages/multipart-upload/src/multipart-upload-list.vue +0 -378
- package/packages/organization-input/index.js +0 -6
- package/packages/organization-input/src/organization-input.vue +0 -542
- package/packages/plugins/export-data-new.js +0 -466
- package/packages/plugins/export-data.js +0 -361
- package/packages/plugins/index.js +0 -15
- package/packages/plugins/public-method.js +0 -43
- package/packages/remove-department/index.js +0 -6
- package/packages/remove-department/src/remove-department.vue +0 -172
- package/packages/remove-department/src/remove-dept-service.js +0 -20
- package/packages/remove-user/index.js +0 -6
- package/packages/remove-user/src/remove-user-service.js +0 -20
- package/packages/remove-user/src/remove-user.vue +0 -195
- package/packages/remove-workgroup/index.js +0 -6
- package/packages/remove-workgroup/src/remove-workgroup-service.js +0 -20
- package/packages/remove-workgroup/src/remove-workgroup.vue +0 -159
- package/packages/rich-editor/index.js +0 -7
- package/packages/rich-editor/index.vue +0 -278
- package/packages/rich-editor/langs/zh-Hans.js +0 -1
- package/packages/rich-editor/viewer.vue +0 -103
- package/packages/scan-code-input/index.js +0 -6
- package/packages/scan-code-input/src/events.js +0 -33
- package/packages/scan-code-input/src/scan-code-input-colse.vue +0 -131
- package/packages/scan-code-input/src/scan-code-input.vue +0 -116
- package/packages/secret-info/index.js +0 -7
- package/packages/secret-info/index.vue +0 -90
- package/packages/super-grid/index.js +0 -7
- package/packages/super-grid/src/apis.js +0 -820
- package/packages/super-grid/src/columns-config.vue +0 -335
- package/packages/super-grid/src/custom-formatter.js +0 -278
- package/packages/super-grid/src/dynamic-input.vue +0 -1279
- package/packages/super-grid/src/eventBus.js +0 -2
- package/packages/super-grid/src/events.js +0 -55
- package/packages/super-grid/src/formValidatorUtil.js +0 -226
- package/packages/super-grid/src/formatter.js +0 -181
- package/packages/super-grid/src/group-column.vue +0 -100
- package/packages/super-grid/src/header-context-menu.vue +0 -87
- package/packages/super-grid/src/index-column.vue +0 -51
- package/packages/super-grid/src/normal-column.vue +0 -775
- package/packages/super-grid/src/public-methods.js +0 -31
- package/packages/super-grid/src/row-operation.vue +0 -161
- package/packages/super-grid/src/search-button.vue +0 -66
- package/packages/super-grid/src/search-condition-input.vue +0 -61
- package/packages/super-grid/src/search-condition-list.vue +0 -59
- package/packages/super-grid/src/search-form-advancedQuery.vue +0 -654
- package/packages/super-grid/src/search-form-dialog.vue +0 -79
- package/packages/super-grid/src/search-form-item.vue +0 -405
- package/packages/super-grid/src/search-form-number.vue +0 -38
- package/packages/super-grid/src/search-form-open.vue +0 -170
- package/packages/super-grid/src/search-form-ordinarySearch.vue +0 -196
- package/packages/super-grid/src/search-form.vue +0 -642
- package/packages/super-grid/src/search-methods.js +0 -448
- package/packages/super-grid/src/selection-column.vue +0 -43
- package/packages/super-grid/src/store.js +0 -3
- package/packages/super-grid/src/super-grid-service.js +0 -593
- package/packages/super-grid/src/super-grid.vue +0 -2873
- package/packages/super-grid/src/utils.js +0 -772
- package/packages/super-grid/src/view-image-dialog.vue +0 -130
- package/packages/super-nine-grid/index.js +0 -7
- package/packages/super-nine-grid/src/apis.js +0 -103
- package/packages/super-nine-grid/src/custom-formatter.js +0 -66
- package/packages/super-nine-grid/src/formatter.js +0 -132
- package/packages/super-nine-grid/src/search-form-number.vue +0 -38
- package/packages/super-nine-grid/src/search-form.vue +0 -430
- package/packages/super-nine-grid/src/search-methods.js +0 -134
- package/packages/super-nine-grid/src/store.js +0 -3
- package/packages/super-nine-grid/src/super-grid-service.js +0 -91
- package/packages/super-nine-grid/src/super-nine-grid.vue +0 -872
- package/packages/super-nine-grid/src/utils.js +0 -261
- package/packages/svg-icon/index.js +0 -6
- package/packages/svg-icon/src/svg-icon.vue +0 -43
- package/packages/utils/memory-cache-utils.js +0 -90
- package/packages/utils/utils.js +0 -152
- package/packages/utils/value-set.js +0 -86
- package/packages/valid-code/index.js +0 -7
- package/packages/valid-code/src/valid-code.vue +0 -95
- package/packages/workflow-button/index.js +0 -6
- package/packages/workflow-button/src/workflow-button.vue +0 -325
- package/packages/workflow-history-list/index.js +0 -6
- package/packages/workflow-history-list/src/api.js +0 -7
- package/packages/workflow-history-list/src/workflow-history-list.vue +0 -185
- package/packages/workgroup-tree/index.js +0 -6
- package/packages/workgroup-tree/src/workgroup-tree.vue +0 -76
- package/packages/workgroup-tree-inline/index.js +0 -6
- package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +0 -317
- package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +0 -43
- package/packages/workgroup-user-tree/index.js +0 -6
- package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +0 -100
- package/packages/workgroup-user-tree-inline/index.js +0 -6
- package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +0 -163
- package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +0 -436
- package/packages/year-range-picker/index.js +0 -6
- package/packages/year-range-picker/src/year-range-picker.vue +0 -51
- package/src/index.js +0 -93
- package/src/styles/theme/gray/form-style.scss +0 -41
|
@@ -1,411 +0,0 @@
|
|
|
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
|
-
class="inline-input inline-input-custom"
|
|
11
|
-
:fetch-suggestions="querySearch"
|
|
12
|
-
:placeholder="$t('departmentTreeInline.pleaseEnterDepartmentName')"
|
|
13
|
-
@keyup.enter.native="clickSearch"
|
|
14
|
-
@select="handleSelect"
|
|
15
|
-
>
|
|
16
|
-
<el-button slot="append" icon="el-icon-search" @click="clickSearch" />
|
|
17
|
-
</el-autocomplete>
|
|
18
|
-
</el-header>
|
|
19
|
-
<el-main style="padding: 10px">
|
|
20
|
-
<div v-if="!searchValue" style="padding-top:5px;overflow:auto;width: auto;display: inline-block !important;">
|
|
21
|
-
<el-tree
|
|
22
|
-
ref="deparmentTree"
|
|
23
|
-
:props="defaultProps"
|
|
24
|
-
:load="loadNode"
|
|
25
|
-
lazy
|
|
26
|
-
:show-checkbox="true"
|
|
27
|
-
node-key="id"
|
|
28
|
-
check-strictly
|
|
29
|
-
:render-content="renderContent"
|
|
30
|
-
:filter-node-method="filterNode"
|
|
31
|
-
@check-change="handleCheckChange"
|
|
32
|
-
@node-expand="handleNodeExpand"
|
|
33
|
-
@check="handleCheckNode"
|
|
34
|
-
@node-click="handleNodeClick"
|
|
35
|
-
/>
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
<div v-if="searchValue && searchValue.length > 0" style="height:100%;overflow: hidden;">
|
|
39
|
-
<user-result :grid-data="searchResult" :select-result="selectResult" :height="height" :multiple="true" :is-search-result="true" @addUser="selectUser" />
|
|
40
|
-
</div>
|
|
41
|
-
</el-main>
|
|
42
|
-
</el-container>
|
|
43
|
-
</el-aside>
|
|
44
|
-
|
|
45
|
-
<el-container>
|
|
46
|
-
<el-aside width="2px">
|
|
47
|
-
<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" />
|
|
48
|
-
</el-aside>
|
|
49
|
-
<el-main style="padding: 10px">
|
|
50
|
-
<div style="text-align:left;font-size:16px">
|
|
51
|
-
{{ $t('departmentTreeInline.selectedDept') }}:
|
|
52
|
-
</div>
|
|
53
|
-
<div :style="'padding-top: 5px;height:90%;overflow: hidden;'">
|
|
54
|
-
<user-result v-loading="isloading" :grid-data="selectResult" :height="height" :multiple="true" :is-search-result="false" @removeUser="removeUser" />
|
|
55
|
-
</div>
|
|
56
|
-
</el-main>
|
|
57
|
-
</el-container>
|
|
58
|
-
</el-container>
|
|
59
|
-
</div>
|
|
60
|
-
</template>
|
|
61
|
-
<style>
|
|
62
|
-
.searchResult {
|
|
63
|
-
color:red
|
|
64
|
-
}
|
|
65
|
-
.inline-input-custom {
|
|
66
|
-
width : 90%
|
|
67
|
-
}
|
|
68
|
-
.el-autocomplete-suggestion.el-popper {
|
|
69
|
-
min-width: 300px;
|
|
70
|
-
}
|
|
71
|
-
</style>
|
|
72
|
-
|
|
73
|
-
<script>
|
|
74
|
-
import localStorage from '../../../src/utils/local-storage'
|
|
75
|
-
import utils from '../../utils/utils'
|
|
76
|
-
import departmentTreeService from './department-tree-service'
|
|
77
|
-
import UserResult from './search-result.vue'
|
|
78
|
-
import memoryCacheUtils from '../../utils/memory-cache-utils'
|
|
79
|
-
export default {
|
|
80
|
-
name: 'InlineDepartmentMultiTree',
|
|
81
|
-
components: {
|
|
82
|
-
UserResult
|
|
83
|
-
},
|
|
84
|
-
props: {
|
|
85
|
-
checkStrictly: {
|
|
86
|
-
type: Boolean,
|
|
87
|
-
default: false
|
|
88
|
-
},
|
|
89
|
-
// 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
|
|
90
|
-
departmentInfo: {
|
|
91
|
-
type: Array,
|
|
92
|
-
default: null
|
|
93
|
-
},
|
|
94
|
-
// 弹框的高度
|
|
95
|
-
height: {
|
|
96
|
-
type: String,
|
|
97
|
-
default: '300px'
|
|
98
|
-
},
|
|
99
|
-
// 多选部门树时,已选择部门id或部门名称或编码集合,多个之间以逗号隔开
|
|
100
|
-
selectDepartmentInfo: {
|
|
101
|
-
type: [String, Number],
|
|
102
|
-
default: null
|
|
103
|
-
},
|
|
104
|
-
// 移除部门时,部门属性名称:id、name、code,默认是id
|
|
105
|
-
searchField: {
|
|
106
|
-
type: String,
|
|
107
|
-
default: 'id'
|
|
108
|
-
},
|
|
109
|
-
// 多选树时结果之间的分隔符,默认是逗号分隔
|
|
110
|
-
separator: {
|
|
111
|
-
type: String,
|
|
112
|
-
default: ','
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
data() {
|
|
116
|
-
return {
|
|
117
|
-
filterText: '',
|
|
118
|
-
defaultProps: {
|
|
119
|
-
id: 'id',
|
|
120
|
-
label: 'showName',
|
|
121
|
-
children: 'childDepartments',
|
|
122
|
-
isLeaf: 'leaf'
|
|
123
|
-
},
|
|
124
|
-
searchParam: {
|
|
125
|
-
searchValue: null,
|
|
126
|
-
treeType: 'DEPARTMENT_TREE',
|
|
127
|
-
departmentInfo: null
|
|
128
|
-
},
|
|
129
|
-
count: 0,
|
|
130
|
-
containBranch: false, // 当前租户内是否包含分支机构。获得当前选中部门名称时,如果有分支,则需要将分支名称返回给用户,例如:部门1(分支1)
|
|
131
|
-
tenantNodeId: -1, // 公司节点的id
|
|
132
|
-
allSearchNodeIds: [], // 用于保存所有查询出的节点id
|
|
133
|
-
allExpandNodeIds: [], // 用于保存allSearchNodeIds中所有已加载子节点的id集合
|
|
134
|
-
isClickNode: false,
|
|
135
|
-
restaurants: [], // 查询的备选值
|
|
136
|
-
searchValue: null, // 查询条件
|
|
137
|
-
searchStoreKey: 'searchDepartment',
|
|
138
|
-
selectNodeInfo: null, // 单选时,选择的部门信息
|
|
139
|
-
tenantInfo: {}, // 公司根节点信息
|
|
140
|
-
searchResult: [],
|
|
141
|
-
selectResult: [],
|
|
142
|
-
isloading: false, // 控制右侧选择区的loading状态
|
|
143
|
-
multiple: true,
|
|
144
|
-
memoryCacheKey: 'DEPARTMENT_MEMORY_KEY',
|
|
145
|
-
memoryCacheData: [] // 记忆选择数据, 搜索框获得焦点后,下拉显示最近选中的10个人,倒序排列,最后选中的在最上面显示。
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
computed: {
|
|
149
|
-
},
|
|
150
|
-
watch: {
|
|
151
|
-
filterText(val) {
|
|
152
|
-
if (!val) {
|
|
153
|
-
this.searchValue = val
|
|
154
|
-
// 清空查询内容时,重新加载整个树
|
|
155
|
-
if (this.departmentInfo && this.departmentInfo.length > 0) {
|
|
156
|
-
// 加载指定部门时,展开公司节点
|
|
157
|
-
this.loadPointDepartments()
|
|
158
|
-
} else {
|
|
159
|
-
// 加载整个组织结构树时,展开公司节点
|
|
160
|
-
this.loadDepartment(this.tenantNodeId)
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
created() {
|
|
166
|
-
this.initSelectDepts(this.searchField, this.selectDepartmentInfo, this.separator).then(selectUsers => {
|
|
167
|
-
if (selectUsers) {
|
|
168
|
-
this.selectResult = selectUsers
|
|
169
|
-
}
|
|
170
|
-
})
|
|
171
|
-
},
|
|
172
|
-
mounted() {
|
|
173
|
-
var searchDepartment = localStorage.getObject(this.searchStoreKey)
|
|
174
|
-
if (searchDepartment) {
|
|
175
|
-
this.restaurants = searchDepartment
|
|
176
|
-
} else {
|
|
177
|
-
this.restaurants = []
|
|
178
|
-
}
|
|
179
|
-
this.getMemoryCacheData('department')
|
|
180
|
-
},
|
|
181
|
-
methods: {
|
|
182
|
-
...utils,
|
|
183
|
-
...departmentTreeService,
|
|
184
|
-
...memoryCacheUtils,
|
|
185
|
-
filterNode(value, data, node) {
|
|
186
|
-
if (!value) {
|
|
187
|
-
return true
|
|
188
|
-
} else {
|
|
189
|
-
return data.name.indexOf(value) !== -1
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
// 选中当前节点及其子节点
|
|
193
|
-
checkedNodeAndChildren(data) {
|
|
194
|
-
// 取消选中状态时,保持节点是展开的状态,不要折叠
|
|
195
|
-
// this.$refs.deparmentTree.store.nodesMap[data.id].expanded = true
|
|
196
|
-
let department = data
|
|
197
|
-
if (data.data) {
|
|
198
|
-
department = JSON.parse(data.data)
|
|
199
|
-
}
|
|
200
|
-
this.selectUser(null, department)
|
|
201
|
-
// 获得所有应该选中的节点
|
|
202
|
-
this.$refs.deparmentTree.setChecked(data.id, true)
|
|
203
|
-
const childDepartments = data.childDepartments
|
|
204
|
-
if (childDepartments && !this.checkStrictly) {
|
|
205
|
-
// 递归设置子子节点的选中状态
|
|
206
|
-
childDepartments.forEach(nodeData => {
|
|
207
|
-
this.checkedNodeAndChildren(nodeData)
|
|
208
|
-
})
|
|
209
|
-
}
|
|
210
|
-
},
|
|
211
|
-
// 取消当前节点的子节点的选中状态
|
|
212
|
-
cancelChildCheckedNodes(data) {
|
|
213
|
-
const department = JSON.parse(data.data)
|
|
214
|
-
this.selectResult = this.removeRow(this.selectResult, department)
|
|
215
|
-
if (data.id !== this.tenantNodeId) {
|
|
216
|
-
// 如果当前节点不是公司节点,需要将公司节点的选中状态去掉
|
|
217
|
-
this.$refs.deparmentTree.setChecked(this.tenantNodeId, false)
|
|
218
|
-
}
|
|
219
|
-
const childDepartments = data.childDepartments
|
|
220
|
-
if (childDepartments && !this.checkStrictly) {
|
|
221
|
-
childDepartments.forEach(nodeData => {
|
|
222
|
-
// 取消节点的选中状态
|
|
223
|
-
this.$refs.deparmentTree.setChecked(nodeData.id, false)
|
|
224
|
-
// 递归取消子子节点的选中状态
|
|
225
|
-
this.cancelChildCheckedNodes(nodeData)
|
|
226
|
-
})
|
|
227
|
-
}
|
|
228
|
-
},
|
|
229
|
-
handleCheckChange(data, checked, indeterminate) {
|
|
230
|
-
|
|
231
|
-
},
|
|
232
|
-
handleNodeExpand(data, node, nodeTree) {
|
|
233
|
-
},
|
|
234
|
-
handleNodeClick(data, node, nodeTree) {
|
|
235
|
-
// 多选部门树时,处理点击节点事件
|
|
236
|
-
this.clickNodeWhenMultiple(data)
|
|
237
|
-
},
|
|
238
|
-
// 多选树时,点击节点处理复选框的选中状态
|
|
239
|
-
clickNodeWhenMultiple(data) {
|
|
240
|
-
var checkedKeys = []
|
|
241
|
-
if (this.$refs.deparmentTree) {
|
|
242
|
-
checkedKeys = this.$refs.deparmentTree.getCheckedKeys()
|
|
243
|
-
}
|
|
244
|
-
if (checkedKeys && checkedKeys.indexOf(data.id) > -1) {
|
|
245
|
-
// 表示当前节点是选中状态,则需要取消其选中状态
|
|
246
|
-
// 取消当前节点的勾选状态
|
|
247
|
-
this.$refs.deparmentTree.setChecked(data.id, false)
|
|
248
|
-
// 取消当前节点的子节点的勾选状态
|
|
249
|
-
if (!this.checkStrictly) {
|
|
250
|
-
this.cancelChildCheckedNodes(data)
|
|
251
|
-
}
|
|
252
|
-
// 取消选中状态时,保持节点是展开的状态,不要折叠
|
|
253
|
-
this.$refs.deparmentTree.store.nodesMap[data.id].expanded = true
|
|
254
|
-
} else {
|
|
255
|
-
// 表示当前节点不是选中的状态,需要勾选该节点
|
|
256
|
-
if (data.nodeType && data.nodeType === 'DEPARTMENT' && data.data) {
|
|
257
|
-
// 表示当前选中的节点是部门
|
|
258
|
-
const department = JSON.parse(data.data)
|
|
259
|
-
this.selectUser(null, department)
|
|
260
|
-
}
|
|
261
|
-
this.$refs.deparmentTree.setChecked(data.id, true)
|
|
262
|
-
// 点击树节点时添加并展开节点会走loadNode方法,因为设置了树组件的expand-on-click-node属性为true
|
|
263
|
-
const children = data.childDepartments
|
|
264
|
-
if (children && children.length > 0) {
|
|
265
|
-
// 表示加载过该节点,直接选中即可
|
|
266
|
-
if (!this.checkStrictly) {
|
|
267
|
-
this.checkedNodeAndChildren(data)
|
|
268
|
-
}
|
|
269
|
-
} else {
|
|
270
|
-
// 表示没有加载过该节点,是首次加载,需要走后台
|
|
271
|
-
// 会走loadNode方法,因为设置了树组件的expand-on-click-node属性为true
|
|
272
|
-
this.isClickNode = true
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
},
|
|
276
|
-
isDepartmentNode(data) {
|
|
277
|
-
// 当前节点不是公司节点,也不是分支机构节点,表示是部门节点
|
|
278
|
-
return data.id !== this.tenantNodeId && data.nodeType && data.nodeType === 'DEPARTMENT' && !data.branch
|
|
279
|
-
},
|
|
280
|
-
selectDepartment() {
|
|
281
|
-
// 是否需要显示提示框,默认不显示
|
|
282
|
-
var showTip = false
|
|
283
|
-
var leafSelectNodeInfo = {
|
|
284
|
-
ids: [],
|
|
285
|
-
names: [],
|
|
286
|
-
codes: [],
|
|
287
|
-
zhNames: [],
|
|
288
|
-
enNames: [],
|
|
289
|
-
departments: []
|
|
290
|
-
}
|
|
291
|
-
if (this.selectResult.length === 0) {
|
|
292
|
-
// 没有选择任何节点
|
|
293
|
-
showTip = true
|
|
294
|
-
} else {
|
|
295
|
-
for (var i = 0; i < this.selectResult.length; i++) {
|
|
296
|
-
var userData = this.selectResult[i]
|
|
297
|
-
// 不存在该用户则放到结果集合中,去掉重复使用
|
|
298
|
-
leafSelectNodeInfo.ids.push(userData.id)
|
|
299
|
-
leafSelectNodeInfo.codes.push(userData.code)
|
|
300
|
-
if (userData.enName) {
|
|
301
|
-
leafSelectNodeInfo.enNames.push(userData.enName)
|
|
302
|
-
} else {
|
|
303
|
-
leafSelectNodeInfo.enNames.push('')
|
|
304
|
-
}
|
|
305
|
-
if (userData.department) {
|
|
306
|
-
leafSelectNodeInfo.departments.push(userData.department)
|
|
307
|
-
} else {
|
|
308
|
-
leafSelectNodeInfo.departments.push(userData)
|
|
309
|
-
}
|
|
310
|
-
const name = userData.showName
|
|
311
|
-
leafSelectNodeInfo.names.push(name)
|
|
312
|
-
leafSelectNodeInfo.zhNames.push(userData.name)
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
if (leafSelectNodeInfo.ids.length > 0) {
|
|
316
|
-
leafSelectNodeInfo.containBranch = this.containBranch
|
|
317
|
-
this.$emit('result', leafSelectNodeInfo)
|
|
318
|
-
} else {
|
|
319
|
-
showTip = true
|
|
320
|
-
}
|
|
321
|
-
if (showTip) {
|
|
322
|
-
this.$alert(this.$t('imatrixUIMessage.pleaseSelectDepartment'), this.$t('imatrixUIMessage.tips'), {
|
|
323
|
-
confirmButtonText: this.$t('imatrixUIPublicModel.sure')
|
|
324
|
-
})
|
|
325
|
-
}
|
|
326
|
-
},
|
|
327
|
-
// 是否选中了公司节点
|
|
328
|
-
isSelectTenantNode(dataId) {
|
|
329
|
-
return dataId === this.tenantNodeId && (!this.departmentInfo || this.departmentInfo.length === 0)
|
|
330
|
-
},
|
|
331
|
-
// 给节点添加自定义图标
|
|
332
|
-
renderContent(h, { node, data, store }) {
|
|
333
|
-
var className
|
|
334
|
-
if (node.data.id === -1 || node.data.branch) {
|
|
335
|
-
// node.id ===-1表示公司节点,node.branch表示是分支机构节点
|
|
336
|
-
className = 'el-icon-menu'
|
|
337
|
-
} else if (node.data.id === -2 || node.data.id === -3) {
|
|
338
|
-
// node.id ===-2表示集团公司无部门用户节点,node.id ===-3表示是分支机构无部门用户节点
|
|
339
|
-
className = 'el-icon-tickets'
|
|
340
|
-
} else {
|
|
341
|
-
// 表示是部门节点
|
|
342
|
-
className = 'el-icon-date'
|
|
343
|
-
}
|
|
344
|
-
return (
|
|
345
|
-
<span>
|
|
346
|
-
<i class={className}></i>
|
|
347
|
-
<span title={node.label}>{node.label}</span>
|
|
348
|
-
</span>
|
|
349
|
-
)
|
|
350
|
-
},
|
|
351
|
-
// 将查询结果中指定用户添加到已选择用户集合中
|
|
352
|
-
selectUser(index, dept) {
|
|
353
|
-
// if (!this.isContainAllUser()) {
|
|
354
|
-
const containUsers = this.selectResult.filter(this.filterDept(dept))
|
|
355
|
-
if (containUsers && containUsers.length === 0) {
|
|
356
|
-
// 如果已选结果中不包含当前用户,则添加
|
|
357
|
-
// 将查询结果中的用户复制到已选择用户集合中
|
|
358
|
-
dept.tenantCode = this.tenantInfo.code
|
|
359
|
-
dept.tenantName = this.tenantInfo.tenantName
|
|
360
|
-
this.selectResult.push(dept)
|
|
361
|
-
// 搜索选中记忆
|
|
362
|
-
this.setMemoryCacheData(dept, 'department')
|
|
363
|
-
}
|
|
364
|
-
// } else {
|
|
365
|
-
// this.alertByAllUser()
|
|
366
|
-
// }
|
|
367
|
-
},
|
|
368
|
-
// 判断用户是否存在的过滤器
|
|
369
|
-
filterDept(queryDept) {
|
|
370
|
-
return (dept) => {
|
|
371
|
-
return (dept.id === queryDept.id)
|
|
372
|
-
}
|
|
373
|
-
},
|
|
374
|
-
filterDeptNode(queryDept) {
|
|
375
|
-
return (deptNodeId) => {
|
|
376
|
-
return (deptNodeId + '' === queryDept.id + '')
|
|
377
|
-
}
|
|
378
|
-
},
|
|
379
|
-
// 从已选择用户集合中移除指定用户,并添加到查询结果集合中
|
|
380
|
-
removeUser(index, dept) {
|
|
381
|
-
// 表示是在组织结构树页面,需要将树的人员节点的选中状态去掉
|
|
382
|
-
if (dept.nodeId) {
|
|
383
|
-
const nodeId = dept.nodeId
|
|
384
|
-
if (this.$refs.deparmentTree && nodeId) {
|
|
385
|
-
this.$refs.deparmentTree.setChecked(nodeId, false)
|
|
386
|
-
}
|
|
387
|
-
} else {
|
|
388
|
-
if (this.$refs.deparmentTree) {
|
|
389
|
-
// 通过查询结果添加的用户,在返回到组织结构树时,也选中了该用户,在移除该用户时,需要去掉复选框的选中状态
|
|
390
|
-
const checkedKeys = this.$refs.deparmentTree.getCheckedKeys()
|
|
391
|
-
const currentCheckedUserNodeIds = checkedKeys.filter(this.filterDeptNode(dept))
|
|
392
|
-
if (currentCheckedUserNodeIds.length > 0) {
|
|
393
|
-
// 表示当前用户是选中的状态,需要去掉
|
|
394
|
-
currentCheckedUserNodeIds.forEach(userNodeId => {
|
|
395
|
-
this.$refs.deparmentTree.setChecked(userNodeId, false)
|
|
396
|
-
})
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
this.selectResult = this.removeRow(this.selectResult, dept)
|
|
401
|
-
if (!this.selectResult || this.selectResult.length === 0) {
|
|
402
|
-
// 已选结果面板没有内容,则左侧树节点也不要有选中节点了
|
|
403
|
-
if (this.$refs.deparmentTree) {
|
|
404
|
-
this.$refs.deparmentTree.setCheckedKeys([])
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
</script>
|
|
@@ -1,293 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<el-container style="height: 395px">
|
|
4
|
-
<el-header style="text-align: right; font-size: 12px;height: 35px">
|
|
5
|
-
<el-autocomplete
|
|
6
|
-
v-model="filterText"
|
|
7
|
-
size="small"
|
|
8
|
-
class="inline-input inline-input-custom"
|
|
9
|
-
:fetch-suggestions="querySearch"
|
|
10
|
-
:placeholder="$t('departmentTreeInline.pleaseEnterDepartmentName')"
|
|
11
|
-
@keyup.enter.native="clickSearch"
|
|
12
|
-
@select="handleSelect"
|
|
13
|
-
>
|
|
14
|
-
<el-button slot="append" icon="el-icon-search" @click="clickSearch" />
|
|
15
|
-
</el-autocomplete>
|
|
16
|
-
</el-header>
|
|
17
|
-
<el-main style="padding: 10px">
|
|
18
|
-
<div v-if="!searchValue" style="padding-top:5px;overflow:auto;width: auto;display: inline-block !important;">
|
|
19
|
-
<el-tree
|
|
20
|
-
ref="deparmentTree"
|
|
21
|
-
:props="defaultProps"
|
|
22
|
-
:load="loadNode"
|
|
23
|
-
lazy
|
|
24
|
-
:show-checkbox="false"
|
|
25
|
-
node-key="id"
|
|
26
|
-
check-strictly
|
|
27
|
-
:render-content="renderContent"
|
|
28
|
-
:filter-node-method="filterNode"
|
|
29
|
-
@check-change="handleCheckChange"
|
|
30
|
-
@node-expand="handleNodeExpand"
|
|
31
|
-
@node-click="handleNodeClick"
|
|
32
|
-
/>
|
|
33
|
-
</div>
|
|
34
|
-
<div v-if="searchValue && searchValue.length > 0" style="height:100%;overflow: hidden;">
|
|
35
|
-
<user-result :grid-data="searchResult" :height="height" :multiple="false" :is-search-result="true" @selectResult="getSelectUser" @resultRowDblclick="resultRowDblclick" />
|
|
36
|
-
</div>
|
|
37
|
-
</el-main>
|
|
38
|
-
</el-container>
|
|
39
|
-
</div>
|
|
40
|
-
</template>
|
|
41
|
-
<style>
|
|
42
|
-
.searchResult {
|
|
43
|
-
color:red
|
|
44
|
-
}
|
|
45
|
-
.inline-input-custom {
|
|
46
|
-
width : 90%
|
|
47
|
-
}
|
|
48
|
-
.el-autocomplete-suggestion.el-popper {
|
|
49
|
-
min-width: 300px;
|
|
50
|
-
}
|
|
51
|
-
</style>
|
|
52
|
-
|
|
53
|
-
<script>
|
|
54
|
-
import localStorage from '../../../src/utils/local-storage'
|
|
55
|
-
import utils from '../../utils/utils'
|
|
56
|
-
import departmentTreeService from './department-tree-service'
|
|
57
|
-
import memoryCacheUtils from '../../utils/memory-cache-utils'
|
|
58
|
-
import UserResult from './search-result.vue'
|
|
59
|
-
export default {
|
|
60
|
-
name: 'InlineDepartmentSingleTree',
|
|
61
|
-
components: {
|
|
62
|
-
UserResult
|
|
63
|
-
},
|
|
64
|
-
props: {
|
|
65
|
-
// 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
|
|
66
|
-
departmentInfo: {
|
|
67
|
-
type: Array,
|
|
68
|
-
default: null
|
|
69
|
-
},
|
|
70
|
-
// 弹框的高度
|
|
71
|
-
height: {
|
|
72
|
-
type: String,
|
|
73
|
-
default: '300px'
|
|
74
|
-
},
|
|
75
|
-
// 多选部门树时,已选择部门id或部门名称或编码集合,多个之间以逗号隔开
|
|
76
|
-
selectDepartmentInfo: {
|
|
77
|
-
type: [String, Number],
|
|
78
|
-
default: null
|
|
79
|
-
},
|
|
80
|
-
// 移除部门时,部门属性名称:id、name、code,默认是id
|
|
81
|
-
searchField: {
|
|
82
|
-
type: String,
|
|
83
|
-
default: 'id'
|
|
84
|
-
},
|
|
85
|
-
// 多选树时结果之间的分隔符,默认是逗号分隔
|
|
86
|
-
separator: {
|
|
87
|
-
type: String,
|
|
88
|
-
default: ','
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
data() {
|
|
92
|
-
return {
|
|
93
|
-
filterText: '',
|
|
94
|
-
defaultProps: {
|
|
95
|
-
id: 'id',
|
|
96
|
-
label: 'showName',
|
|
97
|
-
children: 'childDepartments',
|
|
98
|
-
isLeaf: 'leaf'
|
|
99
|
-
},
|
|
100
|
-
searchParam: {
|
|
101
|
-
searchValue: null,
|
|
102
|
-
treeType: 'DEPARTMENT_TREE',
|
|
103
|
-
departmentInfo: null
|
|
104
|
-
},
|
|
105
|
-
count: 0,
|
|
106
|
-
containBranch: false, // 当前租户内是否包含分支机构。获得当前选中部门名称时,如果有分支,则需要将分支名称返回给用户,例如:部门1(分支1)
|
|
107
|
-
tenantNodeId: -1, // 公司节点的id
|
|
108
|
-
allSearchNodeIds: [], // 用于保存所有查询出的节点id
|
|
109
|
-
allExpandNodeIds: [], // 用于保存allSearchNodeIds中所有已加载子节点的id集合
|
|
110
|
-
isClickNode: false,
|
|
111
|
-
restaurants: [], // 查询的备选值
|
|
112
|
-
searchValue: null, // 查询条件
|
|
113
|
-
searchStoreKey: 'searchDepartment',
|
|
114
|
-
selectNodeInfo: null, // 单选时,选择的部门信息
|
|
115
|
-
tenantInfo: {}, // 公司根节点信息
|
|
116
|
-
searchResult: [],
|
|
117
|
-
memoryCacheKey: 'DEPARTMENT_MEMORY_KEY',
|
|
118
|
-
memoryCacheData: [] // 记忆选择数据, 搜索框获得焦点后,下拉显示最近选中的10个人,倒序排列,最后选中的在最上面显示。
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
computed: {
|
|
122
|
-
},
|
|
123
|
-
watch: {
|
|
124
|
-
filterText(val) {
|
|
125
|
-
if (!val) {
|
|
126
|
-
this.searchValue = val
|
|
127
|
-
// 清空查询内容时,重新加载整个树
|
|
128
|
-
if (this.departmentInfo && this.departmentInfo.length > 0) {
|
|
129
|
-
// 加载指定部门时,展开公司节点
|
|
130
|
-
this.loadPointDepartments()
|
|
131
|
-
} else {
|
|
132
|
-
// 加载整个组织结构树时,展开公司节点
|
|
133
|
-
this.loadDepartment(this.tenantNodeId)
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
mounted() {
|
|
139
|
-
var searchDepartment = localStorage.getObject(this.searchStoreKey)
|
|
140
|
-
if (searchDepartment) {
|
|
141
|
-
this.restaurants = searchDepartment
|
|
142
|
-
} else {
|
|
143
|
-
this.restaurants = []
|
|
144
|
-
}
|
|
145
|
-
this.getMemoryCacheData('department')
|
|
146
|
-
},
|
|
147
|
-
methods: {
|
|
148
|
-
...utils,
|
|
149
|
-
...departmentTreeService,
|
|
150
|
-
...memoryCacheUtils,
|
|
151
|
-
filterNode(value, data, node) {
|
|
152
|
-
if (!value) {
|
|
153
|
-
return true
|
|
154
|
-
} else {
|
|
155
|
-
return data.name.indexOf(value) !== -1
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
// 选中当前节点及其子节点
|
|
159
|
-
checkedNodeAndChildren(data) {
|
|
160
|
-
// 取消选中状态时,保持节点是展开的状态,不要折叠
|
|
161
|
-
// this.$refs.deparmentTree.store.nodesMap[data.id].expanded = true
|
|
162
|
-
// 获得所有应该选中的节点
|
|
163
|
-
this.$refs.deparmentTree.setChecked(data.id, true)
|
|
164
|
-
const childDepartments = data.childDepartments
|
|
165
|
-
if (childDepartments) {
|
|
166
|
-
// 递归设置子子节点的选中状态
|
|
167
|
-
childDepartments.forEach(nodeData => {
|
|
168
|
-
this.checkedNodeAndChildren(nodeData)
|
|
169
|
-
})
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
// 取消当前节点的子节点的选中状态
|
|
173
|
-
cancelChildCheckedNodes(data) {
|
|
174
|
-
if (data.id !== this.tenantNodeId) {
|
|
175
|
-
// 如果当前节点不是公司节点,需要将公司节点的选中状态去掉
|
|
176
|
-
this.$refs.deparmentTree.setChecked(this.tenantNodeId, false)
|
|
177
|
-
}
|
|
178
|
-
const childDepartments = data.childDepartments
|
|
179
|
-
if (childDepartments) {
|
|
180
|
-
childDepartments.forEach(nodeData => {
|
|
181
|
-
// 取消节点的选中状态
|
|
182
|
-
this.$refs.deparmentTree.setChecked(nodeData.id, false)
|
|
183
|
-
// 递归取消子子节点的选中状态
|
|
184
|
-
this.cancelChildCheckedNodes(nodeData)
|
|
185
|
-
})
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
handleCheckChange(data, checked, indeterminate) {
|
|
189
|
-
|
|
190
|
-
},
|
|
191
|
-
handleNodeExpand(data, node, nodeTree) {
|
|
192
|
-
},
|
|
193
|
-
handleNodeClick(data, node, nodeTree) {
|
|
194
|
-
this.selectSingleNode(data, false)
|
|
195
|
-
},
|
|
196
|
-
selectSingleNode(data, isClickOkBtn) {
|
|
197
|
-
// 表示是部门树节点
|
|
198
|
-
if (this.isDepartmentNode(data)) {
|
|
199
|
-
// 点击的是部门节点,并且是单选树时,点击部门节点直接关闭弹框
|
|
200
|
-
const department = JSON.parse(data.data)
|
|
201
|
-
this.packageSelectResult(department)
|
|
202
|
-
this.setMemoryCacheData(department, 'department')
|
|
203
|
-
// if (this.selectNodeInfo && isClickOkBtn === true) {
|
|
204
|
-
// // 点击确定按钮时才需要调result回调事件,关闭弹框
|
|
205
|
-
// this.$emit('result', this.selectNodeInfo)
|
|
206
|
-
// }
|
|
207
|
-
}
|
|
208
|
-
},
|
|
209
|
-
packageSelectResult(department) {
|
|
210
|
-
department.tenantName = this.tenantInfo.tenantName
|
|
211
|
-
department.tenantCode = this.tenantInfo.code
|
|
212
|
-
var selectNodeInfo = {
|
|
213
|
-
id: department.id,
|
|
214
|
-
name: department.showName,
|
|
215
|
-
code: department.code,
|
|
216
|
-
containBranch: this.containBranch,
|
|
217
|
-
zhName: department.name,
|
|
218
|
-
enName: department.enName,
|
|
219
|
-
department: department
|
|
220
|
-
}
|
|
221
|
-
this.selectNodeInfo = selectNodeInfo
|
|
222
|
-
},
|
|
223
|
-
isDepartmentNode(data) {
|
|
224
|
-
// 当前节点不是公司节点,也不是分支机构节点,表示是部门节点
|
|
225
|
-
return data.id !== this.tenantNodeId && data.nodeType && data.nodeType === 'DEPARTMENT' && !data.branch
|
|
226
|
-
},
|
|
227
|
-
selectDepartment() {
|
|
228
|
-
// 是否需要显示提示框,默认不显示
|
|
229
|
-
var showTip = false
|
|
230
|
-
// const data = this.$refs.deparmentTree.getCurrentNode()
|
|
231
|
-
if (this.selectNodeInfo) {
|
|
232
|
-
// this.selectSingleNode(data, true)
|
|
233
|
-
this.$emit('result', this.selectNodeInfo)
|
|
234
|
-
} else {
|
|
235
|
-
showTip = true
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
if (showTip) {
|
|
239
|
-
this.$alert(this.$t('imatrixUIMessage.pleaseSelectDepartment'), this.$t('imatrixUIMessage.tips'), {
|
|
240
|
-
confirmButtonText: this.$t('imatrixUIPublicModel.sure')
|
|
241
|
-
})
|
|
242
|
-
}
|
|
243
|
-
},
|
|
244
|
-
// 是否选中了公司节点
|
|
245
|
-
isSelectTenantNode(dataId) {
|
|
246
|
-
return dataId === this.tenantNodeId && (!this.departmentInfo || this.departmentInfo.length === 0)
|
|
247
|
-
},
|
|
248
|
-
// 给节点添加自定义图标
|
|
249
|
-
renderContent(h, { node, data, store }) {
|
|
250
|
-
var className
|
|
251
|
-
if (node.data.id === -1 || node.data.branch) {
|
|
252
|
-
// node.id ===-1表示公司节点,node.branch表示是分支机构节点
|
|
253
|
-
className = 'el-icon-menu'
|
|
254
|
-
} else if (node.data.id === -2 || node.data.id === -3) {
|
|
255
|
-
// node.id ===-2表示集团公司无部门用户节点,node.id ===-3表示是分支机构无部门用户节点
|
|
256
|
-
className = 'el-icon-tickets'
|
|
257
|
-
} else {
|
|
258
|
-
// 表示是部门节点
|
|
259
|
-
className = 'el-icon-date'
|
|
260
|
-
}
|
|
261
|
-
if (data.nodeType && data.nodeType === 'DEPARTMENT' &&
|
|
262
|
-
this.searchValue && data.name.indexOf(this.searchValue) > -1) {
|
|
263
|
-
// 如果是查询条件
|
|
264
|
-
return (
|
|
265
|
-
<span>
|
|
266
|
-
<i class={className}></i>
|
|
267
|
-
<span class='searchResult' title={node.label}>{node.label}</span>
|
|
268
|
-
</span>
|
|
269
|
-
)
|
|
270
|
-
}
|
|
271
|
-
return (
|
|
272
|
-
<span>
|
|
273
|
-
<i class={className}></i>
|
|
274
|
-
<span title={node.label}>{node.label}</span>
|
|
275
|
-
</span>
|
|
276
|
-
)
|
|
277
|
-
},
|
|
278
|
-
getSelectUser(selectUser) {
|
|
279
|
-
// console.log('getSelectUser==', selectUser)
|
|
280
|
-
// this.selectUser = selectUser
|
|
281
|
-
// true参数表示是否是勾选单选框,是勾选单选框时不关闭弹框
|
|
282
|
-
this.packageSelectResult(selectUser)
|
|
283
|
-
// 搜索选中记忆
|
|
284
|
-
this.setMemoryCacheData(selectUser, 'department')
|
|
285
|
-
},
|
|
286
|
-
resultRowDblclick(user) {
|
|
287
|
-
this.packageSelectResult(user)
|
|
288
|
-
this.$emit('result', this.selectNodeInfo)
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
</script>
|