imatrix-ui 2.9.9-dw → 2.9.11-boe1
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 +2 -2
- package/src/api/sso-service.js +19 -1
- package/src/i18n/i18n.js +1 -1
- package/src/i18n/langs/cn.js +14 -4
- package/src/i18n/langs/en.js +16 -5
- package/src/permission.js +1 -1
- 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 +19 -0
- 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/index.scss +27 -5
- package/src/styles/theme/dark-blue/message.scss +8 -0
- package/src/styles/theme/dark-blue/sidebar.scss +7 -37
- package/src/styles/theme/dark-blue/table.scss +1 -1
- 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 +32 -0
- package/src/styles/theme/gray/sidebar.scss +7 -14
- package/src/utils/auth-api.js +45 -1
- package/src/utils/common-util.js +21 -81
- package/src/utils/range-selector.js +185 -0
- package/src/utils/request.js +6 -3
- package/src/utils/util.js +12 -10
- 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 +12 -20
- package/src/views/dsc-component/tabs/tab-content.vue +1 -5
- package/src/views/layout/NewLayout.vue +6 -65
- 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/tabs/tab-content.vue +160 -0
- package/src/views/layout/tab-content-iframe-index.vue +31 -0
- package/src/views/layout/tab-content-index.vue +85 -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 -402
- package/packages/department-tree-inline/src/department-single-tree-inline.vue +0 -284
- package/packages/department-tree-inline/src/department-tree-inline.vue +0 -86
- package/packages/department-tree-inline/src/department-tree-service.js +0 -245
- 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 -626
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +0 -269
- 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 -230
- package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -122
- 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 -453
- 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 -763
- package/packages/super-grid/src/columns-config.vue +0 -335
- package/packages/super-grid/src/custom-formatter.js +0 -250
- 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 -769
- 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 -653
- package/packages/super-grid/src/search-form-dialog.vue +0 -79
- package/packages/super-grid/src/search-form-item.vue +0 -386
- package/packages/super-grid/src/search-form-number.vue +0 -38
- package/packages/super-grid/src/search-form-open.vue +0 -162
- package/packages/super-grid/src/search-form-ordinarySearch.vue +0 -188
- package/packages/super-grid/src/search-form.vue +0 -634
- package/packages/super-grid/src/search-methods.js +0 -387
- 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 -561
- package/packages/super-grid/src/super-grid.vue +0 -2829
- package/packages/super-grid/src/utils.js +0 -763
- 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/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,284 +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
|
-
select-when-unmatched
|
|
9
|
-
class="inline-input inline-input-custom"
|
|
10
|
-
:fetch-suggestions="querySearch"
|
|
11
|
-
:placeholder="$t('departmentTreeInline.pleaseEnterDepartmentName')"
|
|
12
|
-
:trigger-on-focus="false"
|
|
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="false"
|
|
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
|
-
@node-click="handleNodeClick"
|
|
34
|
-
/>
|
|
35
|
-
</div>
|
|
36
|
-
<div v-if="searchValue && searchValue.length > 0" style="height:100%;overflow: hidden;">
|
|
37
|
-
<user-result :grid-data="searchResult" :height="height" :multiple="false" :is-search-result="true" @selectResult="getSelectUser" @resultRowDblclick="resultRowDblclick" />
|
|
38
|
-
</div>
|
|
39
|
-
</el-main>
|
|
40
|
-
</el-container>
|
|
41
|
-
</div>
|
|
42
|
-
</template>
|
|
43
|
-
<style>
|
|
44
|
-
.searchResult {
|
|
45
|
-
color:red
|
|
46
|
-
}
|
|
47
|
-
.inline-input-custom {
|
|
48
|
-
width : 90%
|
|
49
|
-
}
|
|
50
|
-
</style>
|
|
51
|
-
|
|
52
|
-
<script>
|
|
53
|
-
import localStorage from '../../../src/utils/local-storage'
|
|
54
|
-
import utils from '../../utils/utils'
|
|
55
|
-
import departmentTreeService from './department-tree-service'
|
|
56
|
-
import UserResult from './search-result.vue'
|
|
57
|
-
export default {
|
|
58
|
-
name: 'InlineDepartmentSingleTree',
|
|
59
|
-
components: {
|
|
60
|
-
UserResult
|
|
61
|
-
},
|
|
62
|
-
props: {
|
|
63
|
-
// 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
|
|
64
|
-
departmentInfo: {
|
|
65
|
-
type: Array,
|
|
66
|
-
default: null
|
|
67
|
-
},
|
|
68
|
-
// 弹框的高度
|
|
69
|
-
height: {
|
|
70
|
-
type: String,
|
|
71
|
-
default: '300px'
|
|
72
|
-
},
|
|
73
|
-
// 多选部门树时,已选择部门id或部门名称或编码集合,多个之间以逗号隔开
|
|
74
|
-
selectDepartmentInfo: {
|
|
75
|
-
type: [String, Number],
|
|
76
|
-
default: null
|
|
77
|
-
},
|
|
78
|
-
// 移除部门时,部门属性名称:id、name、code,默认是id
|
|
79
|
-
searchField: {
|
|
80
|
-
type: String,
|
|
81
|
-
default: 'id'
|
|
82
|
-
},
|
|
83
|
-
// 多选树时结果之间的分隔符,默认是逗号分隔
|
|
84
|
-
separator: {
|
|
85
|
-
type: String,
|
|
86
|
-
default: ','
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
data() {
|
|
90
|
-
return {
|
|
91
|
-
filterText: '',
|
|
92
|
-
defaultProps: {
|
|
93
|
-
id: 'id',
|
|
94
|
-
label: 'showName',
|
|
95
|
-
children: 'childDepartments',
|
|
96
|
-
isLeaf: 'leaf'
|
|
97
|
-
},
|
|
98
|
-
searchParam: {
|
|
99
|
-
searchValue: null,
|
|
100
|
-
treeType: 'DEPARTMENT_TREE',
|
|
101
|
-
departmentInfo: null
|
|
102
|
-
},
|
|
103
|
-
count: 0,
|
|
104
|
-
containBranch: false, // 当前租户内是否包含分支机构。获得当前选中部门名称时,如果有分支,则需要将分支名称返回给用户,例如:部门1(分支1)
|
|
105
|
-
tenantNodeId: -1, // 公司节点的id
|
|
106
|
-
allSearchNodeIds: [], // 用于保存所有查询出的节点id
|
|
107
|
-
allExpandNodeIds: [], // 用于保存allSearchNodeIds中所有已加载子节点的id集合
|
|
108
|
-
isClickNode: false,
|
|
109
|
-
restaurants: [], // 查询的备选值
|
|
110
|
-
searchValue: null, // 查询条件
|
|
111
|
-
searchStoreKey: 'searchDepartment',
|
|
112
|
-
selectNodeInfo: null, // 单选时,选择的部门信息
|
|
113
|
-
tenantInfo: {}, // 公司根节点信息
|
|
114
|
-
searchResult: []
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
computed: {
|
|
118
|
-
},
|
|
119
|
-
watch: {
|
|
120
|
-
filterText(val) {
|
|
121
|
-
if (!val) {
|
|
122
|
-
this.searchValue = val
|
|
123
|
-
// 清空查询内容时,重新加载整个树
|
|
124
|
-
if (this.departmentInfo && this.departmentInfo.length > 0) {
|
|
125
|
-
// 加载指定部门时,展开公司节点
|
|
126
|
-
this.loadPointDepartments()
|
|
127
|
-
} else {
|
|
128
|
-
// 加载整个组织结构树时,展开公司节点
|
|
129
|
-
this.loadDepartment(this.tenantNodeId)
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
mounted() {
|
|
135
|
-
var searchDepartment = localStorage.getObject(this.searchStoreKey)
|
|
136
|
-
if (searchDepartment) {
|
|
137
|
-
this.restaurants = searchDepartment
|
|
138
|
-
} else {
|
|
139
|
-
this.restaurants = []
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
methods: {
|
|
143
|
-
...utils,
|
|
144
|
-
...departmentTreeService,
|
|
145
|
-
filterNode(value, data, node) {
|
|
146
|
-
if (!value) {
|
|
147
|
-
return true
|
|
148
|
-
} else {
|
|
149
|
-
return data.name.indexOf(value) !== -1
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
// 选中当前节点及其子节点
|
|
153
|
-
checkedNodeAndChildren(data) {
|
|
154
|
-
// 取消选中状态时,保持节点是展开的状态,不要折叠
|
|
155
|
-
// this.$refs.deparmentTree.store.nodesMap[data.id].expanded = true
|
|
156
|
-
// 获得所有应该选中的节点
|
|
157
|
-
this.$refs.deparmentTree.setChecked(data.id, true)
|
|
158
|
-
const childDepartments = data.childDepartments
|
|
159
|
-
if (childDepartments) {
|
|
160
|
-
// 递归设置子子节点的选中状态
|
|
161
|
-
childDepartments.forEach(nodeData => {
|
|
162
|
-
this.checkedNodeAndChildren(nodeData)
|
|
163
|
-
})
|
|
164
|
-
}
|
|
165
|
-
},
|
|
166
|
-
// 取消当前节点的子节点的选中状态
|
|
167
|
-
cancelChildCheckedNodes(data) {
|
|
168
|
-
if (data.id !== this.tenantNodeId) {
|
|
169
|
-
// 如果当前节点不是公司节点,需要将公司节点的选中状态去掉
|
|
170
|
-
this.$refs.deparmentTree.setChecked(this.tenantNodeId, false)
|
|
171
|
-
}
|
|
172
|
-
const childDepartments = data.childDepartments
|
|
173
|
-
if (childDepartments) {
|
|
174
|
-
childDepartments.forEach(nodeData => {
|
|
175
|
-
// 取消节点的选中状态
|
|
176
|
-
this.$refs.deparmentTree.setChecked(nodeData.id, false)
|
|
177
|
-
// 递归取消子子节点的选中状态
|
|
178
|
-
this.cancelChildCheckedNodes(nodeData)
|
|
179
|
-
})
|
|
180
|
-
}
|
|
181
|
-
},
|
|
182
|
-
handleCheckChange(data, checked, indeterminate) {
|
|
183
|
-
|
|
184
|
-
},
|
|
185
|
-
handleNodeExpand(data, node, nodeTree) {
|
|
186
|
-
},
|
|
187
|
-
handleNodeClick(data, node, nodeTree) {
|
|
188
|
-
this.selectSingleNode(data, false)
|
|
189
|
-
},
|
|
190
|
-
selectSingleNode(data, isClickOkBtn) {
|
|
191
|
-
// 表示是部门树节点
|
|
192
|
-
if (this.isDepartmentNode(data)) {
|
|
193
|
-
// 点击的是部门节点,并且是单选树时,点击部门节点直接关闭弹框
|
|
194
|
-
const department = JSON.parse(data.data)
|
|
195
|
-
this.packageSelectResult(department)
|
|
196
|
-
// if (this.selectNodeInfo && isClickOkBtn === true) {
|
|
197
|
-
// // 点击确定按钮时才需要调result回调事件,关闭弹框
|
|
198
|
-
// this.$emit('result', this.selectNodeInfo)
|
|
199
|
-
// }
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
packageSelectResult(department) {
|
|
203
|
-
department.tenantName = this.tenantInfo.tenantName
|
|
204
|
-
department.tenantCode = this.tenantInfo.code
|
|
205
|
-
var selectNodeInfo = {
|
|
206
|
-
id: department.id,
|
|
207
|
-
name: department.showName,
|
|
208
|
-
code: department.code,
|
|
209
|
-
containBranch: this.containBranch,
|
|
210
|
-
zhName: department.name,
|
|
211
|
-
enName: department.enName,
|
|
212
|
-
department: department
|
|
213
|
-
}
|
|
214
|
-
this.selectNodeInfo = selectNodeInfo
|
|
215
|
-
},
|
|
216
|
-
isDepartmentNode(data) {
|
|
217
|
-
// 当前节点不是公司节点,也不是分支机构节点,表示是部门节点
|
|
218
|
-
return data.id !== this.tenantNodeId && data.nodeType && data.nodeType === 'DEPARTMENT' && !data.branch
|
|
219
|
-
},
|
|
220
|
-
selectDepartment() {
|
|
221
|
-
// 是否需要显示提示框,默认不显示
|
|
222
|
-
var showTip = false
|
|
223
|
-
// const data = this.$refs.deparmentTree.getCurrentNode()
|
|
224
|
-
if (this.selectNodeInfo) {
|
|
225
|
-
// this.selectSingleNode(data, true)
|
|
226
|
-
this.$emit('result', this.selectNodeInfo)
|
|
227
|
-
} else {
|
|
228
|
-
showTip = true
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
if (showTip) {
|
|
232
|
-
this.$alert(this.$t('imatrixUIMessage.pleaseSelectDepartment'), this.$t('imatrixUIMessage.tips'), {
|
|
233
|
-
confirmButtonText: this.$t('imatrixUIPublicModel.sure')
|
|
234
|
-
})
|
|
235
|
-
}
|
|
236
|
-
},
|
|
237
|
-
// 是否选中了公司节点
|
|
238
|
-
isSelectTenantNode(dataId) {
|
|
239
|
-
return dataId === this.tenantNodeId && (!this.departmentInfo || this.departmentInfo.length === 0)
|
|
240
|
-
},
|
|
241
|
-
// 给节点添加自定义图标
|
|
242
|
-
renderContent(h, { node, data, store }) {
|
|
243
|
-
var className
|
|
244
|
-
if (node.data.id === -1 || node.data.branch) {
|
|
245
|
-
// node.id ===-1表示公司节点,node.branch表示是分支机构节点
|
|
246
|
-
className = 'el-icon-menu'
|
|
247
|
-
} else if (node.data.id === -2 || node.data.id === -3) {
|
|
248
|
-
// node.id ===-2表示集团公司无部门用户节点,node.id ===-3表示是分支机构无部门用户节点
|
|
249
|
-
className = 'el-icon-tickets'
|
|
250
|
-
} else {
|
|
251
|
-
// 表示是部门节点
|
|
252
|
-
className = 'el-icon-date'
|
|
253
|
-
}
|
|
254
|
-
if (data.nodeType && data.nodeType === 'DEPARTMENT' &&
|
|
255
|
-
this.searchValue && data.name.indexOf(this.searchValue) > -1) {
|
|
256
|
-
// 如果是查询条件
|
|
257
|
-
return (
|
|
258
|
-
<span>
|
|
259
|
-
<i class={className}></i>
|
|
260
|
-
<span class='searchResult' title={node.label}>{node.label}</span>
|
|
261
|
-
</span>
|
|
262
|
-
)
|
|
263
|
-
}
|
|
264
|
-
return (
|
|
265
|
-
<span>
|
|
266
|
-
<i class={className}></i>
|
|
267
|
-
<span title={node.label}>{node.label}</span>
|
|
268
|
-
</span>
|
|
269
|
-
)
|
|
270
|
-
},
|
|
271
|
-
getSelectUser(selectUser) {
|
|
272
|
-
// console.log('getSelectUser==', selectUser)
|
|
273
|
-
// this.selectUser = selectUser
|
|
274
|
-
// true参数表示是否是勾选单选框,是勾选单选框时不关闭弹框
|
|
275
|
-
this.packageSelectResult(selectUser)
|
|
276
|
-
},
|
|
277
|
-
resultRowDblclick(user) {
|
|
278
|
-
this.packageSelectResult(user)
|
|
279
|
-
this.$emit('result', this.selectNodeInfo)
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
</script>
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<inline-department-multi-tree
|
|
4
|
-
v-if="multiple"
|
|
5
|
-
ref="inlineDeparmentTree"
|
|
6
|
-
:height="height"
|
|
7
|
-
:check-strictly="checkStrictly"
|
|
8
|
-
:department-info="departmentInfo"
|
|
9
|
-
:select-department-info="selectDepartmentInfo"
|
|
10
|
-
:search-field="searchField"
|
|
11
|
-
:separator="separator"
|
|
12
|
-
@result="result"
|
|
13
|
-
/>
|
|
14
|
-
<inline-department-single-tree
|
|
15
|
-
v-if="!multiple"
|
|
16
|
-
ref="inlineDeparmentTree"
|
|
17
|
-
:department-info="departmentInfo"
|
|
18
|
-
@result="result"
|
|
19
|
-
/>
|
|
20
|
-
</div>
|
|
21
|
-
</template>
|
|
22
|
-
|
|
23
|
-
<script>
|
|
24
|
-
import InlineDepartmentMultiTree from './department-multi-tree-inline.vue'
|
|
25
|
-
import InlineDepartmentSingleTree from './department-single-tree-inline.vue'
|
|
26
|
-
export default {
|
|
27
|
-
name: 'InlineDepartmentTree',
|
|
28
|
-
components: {
|
|
29
|
-
InlineDepartmentMultiTree,
|
|
30
|
-
InlineDepartmentSingleTree
|
|
31
|
-
},
|
|
32
|
-
props: {
|
|
33
|
-
// 是否是多选树,默认是true
|
|
34
|
-
multiple: {
|
|
35
|
-
type: Boolean,
|
|
36
|
-
default: true
|
|
37
|
-
},
|
|
38
|
-
checkStrictly: {
|
|
39
|
-
type: Boolean,
|
|
40
|
-
default: false
|
|
41
|
-
},
|
|
42
|
-
// 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
|
|
43
|
-
departmentInfo: {
|
|
44
|
-
type: Array,
|
|
45
|
-
default: null
|
|
46
|
-
},
|
|
47
|
-
// 弹框的高度
|
|
48
|
-
height: {
|
|
49
|
-
type: String,
|
|
50
|
-
default: '300px'
|
|
51
|
-
},
|
|
52
|
-
// 多选部门树时,已选择部门id或部门名称或编码集合,多个之间以逗号隔开
|
|
53
|
-
selectDepartmentInfo: {
|
|
54
|
-
type: [String, Number],
|
|
55
|
-
default: null
|
|
56
|
-
},
|
|
57
|
-
// 移除部门时,部门属性名称:id、name、code,默认是id
|
|
58
|
-
searchField: {
|
|
59
|
-
type: String,
|
|
60
|
-
default: 'id'
|
|
61
|
-
},
|
|
62
|
-
// 多选树时结果之间的分隔符,默认是逗号分隔
|
|
63
|
-
separator: {
|
|
64
|
-
type: String,
|
|
65
|
-
default: ','
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
data() {
|
|
69
|
-
return {
|
|
70
|
-
selectNodeInfo: null // 单选时,选择的用户信息
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
mounted() {
|
|
74
|
-
},
|
|
75
|
-
methods: {
|
|
76
|
-
result(selectNodeInfo) {
|
|
77
|
-
this.selectNodeInfo = selectNodeInfo
|
|
78
|
-
this.$emit('result', selectNodeInfo)
|
|
79
|
-
},
|
|
80
|
-
selectDepartment() {
|
|
81
|
-
this.$refs.inlineDeparmentTree.selectDepartment()
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
</script>
|
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
import Vue from 'vue'
|
|
2
|
-
import { getI18n } from '../../../src/utils/util'
|
|
3
|
-
const departmentTreeService = {
|
|
4
|
-
// 后台查询部门,并拼接树节点
|
|
5
|
-
filterAppendNodes(value) {
|
|
6
|
-
this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/search-pc-depts', this.searchParam).then(result => {
|
|
7
|
-
if (result) {
|
|
8
|
-
if (result.length === 0) {
|
|
9
|
-
this.searchResult = []
|
|
10
|
-
this.$message({
|
|
11
|
-
showClose: true,
|
|
12
|
-
type: 'error',
|
|
13
|
-
message: getI18n().t('imatrixUIMessage.queryResultIsEmpty')
|
|
14
|
-
})
|
|
15
|
-
return
|
|
16
|
-
}
|
|
17
|
-
this.searchResult = result
|
|
18
|
-
// result的格式为[DEPARTMENT~1,DEPARTMENT~1/DEPARTMENT~4,DEPARTMENT~10]
|
|
19
|
-
// result.forEach(nodeIds => {
|
|
20
|
-
// // nodeId的分隔符
|
|
21
|
-
// var nodeIdSeparator = '/'
|
|
22
|
-
// const nodeIdArr = nodeIds.split(nodeIdSeparator)
|
|
23
|
-
// if (nodeIdArr.length > 0) {
|
|
24
|
-
// this.loadDepartmentWhenSearch(0, nodeIdArr)
|
|
25
|
-
// }
|
|
26
|
-
// })
|
|
27
|
-
} else {
|
|
28
|
-
this.$message({
|
|
29
|
-
showClose: true,
|
|
30
|
-
type: 'error',
|
|
31
|
-
message: getI18n().t('imatrixUIMessage.queryResultIsEmpty')
|
|
32
|
-
})
|
|
33
|
-
}
|
|
34
|
-
})
|
|
35
|
-
},
|
|
36
|
-
search(value) {
|
|
37
|
-
this.searchValue = value
|
|
38
|
-
let mySearchValue = value
|
|
39
|
-
if (mySearchValue) {
|
|
40
|
-
mySearchValue = mySearchValue.trim()
|
|
41
|
-
}
|
|
42
|
-
this.searchParam.searchValue = mySearchValue
|
|
43
|
-
this.searchParam.departmentInfo = this.departmentInfo
|
|
44
|
-
// 后台查询部门,并拼接树节点
|
|
45
|
-
this.filterAppendNodes(value)
|
|
46
|
-
},
|
|
47
|
-
handleSelect(item) {
|
|
48
|
-
this.handleSelectUtil(item, localStorage)
|
|
49
|
-
},
|
|
50
|
-
querySearch(queryString, cb) {
|
|
51
|
-
this.search(this.filterText)
|
|
52
|
-
cb([])
|
|
53
|
-
},
|
|
54
|
-
// 点击查询按钮调用的方法
|
|
55
|
-
clickSearch() {
|
|
56
|
-
this.storeSeachValue()
|
|
57
|
-
this.search(this.filterText)
|
|
58
|
-
},
|
|
59
|
-
loadDepartmentWhenSearch(n, nodeIdArr) {
|
|
60
|
-
return new Promise((resolve, reject) => {
|
|
61
|
-
if (nodeIdArr.length === n) {
|
|
62
|
-
resolve()
|
|
63
|
-
} else {
|
|
64
|
-
const nodeId = nodeIdArr[n]
|
|
65
|
-
let dataId = nodeId
|
|
66
|
-
// 节点类型和数据id的分隔符
|
|
67
|
-
const nodeTypeAndDataIdSeparator = '~'
|
|
68
|
-
// nodeId格式为DEPARTMENT~4
|
|
69
|
-
if (nodeId.indexOf(nodeTypeAndDataIdSeparator) > -1) {
|
|
70
|
-
dataId = nodeId.substring(nodeId.indexOf('~') + 1)
|
|
71
|
-
}
|
|
72
|
-
this.loadDepartment(dataId).then(() => {
|
|
73
|
-
this.loadDepartmentWhenSearch(++n, nodeIdArr)
|
|
74
|
-
}).catch((error) => {
|
|
75
|
-
reject(error)
|
|
76
|
-
})
|
|
77
|
-
}
|
|
78
|
-
})
|
|
79
|
-
},
|
|
80
|
-
// 点击复选框时处理
|
|
81
|
-
handleCheckNode(data, checkObj) {
|
|
82
|
-
if (checkObj.checkedKeys.indexOf(data.id) > -1) {
|
|
83
|
-
// 表示正选中data节点
|
|
84
|
-
this.isloading = true
|
|
85
|
-
if (data.nodeType && data.nodeType === 'DEPARTMENT' && data.data) {
|
|
86
|
-
// 表示当前选中的节点是部门
|
|
87
|
-
const department = JSON.parse(data.data)
|
|
88
|
-
this.selectUser(null, department)
|
|
89
|
-
}
|
|
90
|
-
if (data.childDepartments) {
|
|
91
|
-
// 如果已展开,不需要再走后台获得其子节点。只需要选中已有子节点
|
|
92
|
-
// 展开当前选中的节点
|
|
93
|
-
this.$refs.deparmentTree.store.nodesMap[data.id].expanded = true
|
|
94
|
-
// 选中当前节点及其子节点
|
|
95
|
-
this.checkedNodeAndChildren(data)
|
|
96
|
-
this.isloading = false
|
|
97
|
-
} else {
|
|
98
|
-
// 当前节点未展开。需要走后台获得当前节点的子节点,然后展开当前节点,然后选中这些子节点
|
|
99
|
-
if (!data.leaf) {
|
|
100
|
-
// 不是叶子节点,并且没有加载过该父节点的子节点时,需要走后台展开子节点
|
|
101
|
-
this.$http.get(Vue.prototype.baseAPI + '/component/organization-trees/departments/' + data.id).then(result => {
|
|
102
|
-
// 更新当前点击的节点的子节点
|
|
103
|
-
this.$refs.deparmentTree.updateKeyChildren(data.id, result)
|
|
104
|
-
// 展开当前选中的节点
|
|
105
|
-
this.$refs.deparmentTree.store.nodesMap[data.id].expanded = true
|
|
106
|
-
// 获得所有应该选中的节点
|
|
107
|
-
this.checkedNodeAndChildren(data)
|
|
108
|
-
})
|
|
109
|
-
this.$http.get(Vue.prototype.baseAPI + '/component/organization-trees/child-departments/' + data.id).then(childDepts => {
|
|
110
|
-
if (childDepts && !this.checkStrictly) {
|
|
111
|
-
childDepts.forEach(item => {
|
|
112
|
-
this.selectUser(null, item)
|
|
113
|
-
})
|
|
114
|
-
this.isloading = false
|
|
115
|
-
}
|
|
116
|
-
})
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
} else {
|
|
120
|
-
// 表示正取消选中data节点,同时要取消其子节点的选中状态
|
|
121
|
-
this.cancelChildCheckedNodes(data)
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
// 初始化树 或 点击三角展开节点时动态加载子节点
|
|
125
|
-
loadNode(node, resolve) {
|
|
126
|
-
var parentId = 0
|
|
127
|
-
if (node.level === 0) {
|
|
128
|
-
// 表示初始化树
|
|
129
|
-
parentId = 0
|
|
130
|
-
} else {
|
|
131
|
-
parentId = node.data.id
|
|
132
|
-
}
|
|
133
|
-
var checkedKeys = []
|
|
134
|
-
if (this.$refs.deparmentTree) {
|
|
135
|
-
checkedKeys = this.$refs.deparmentTree.getCheckedKeys()
|
|
136
|
-
}
|
|
137
|
-
// 初始化部门树
|
|
138
|
-
this.initLoadDepartment(parentId, node, resolve, checkedKeys)
|
|
139
|
-
},
|
|
140
|
-
// 初始化部门树
|
|
141
|
-
initLoadDepartment(parentId, node, resolve, checkedKeys) {
|
|
142
|
-
this.$http.get(Vue.prototype.baseAPI + '/component/organization-trees/departments/' + parentId).then(data => {
|
|
143
|
-
resolve(data)
|
|
144
|
-
// 更新当前点击的节点的子节点
|
|
145
|
-
this.$refs.deparmentTree.updateKeyChildren(parentId, data)
|
|
146
|
-
if (parentId === 0) {
|
|
147
|
-
// 初始化树时,展开公司节点
|
|
148
|
-
const tenantData = data[0].data
|
|
149
|
-
data[0].disable = true
|
|
150
|
-
this.tenantInfo = JSON.parse(tenantData)
|
|
151
|
-
this.containBranch = data[0].containBranch
|
|
152
|
-
if (this.departmentInfo && this.departmentInfo.length > 0) {
|
|
153
|
-
// 加载指定部门时,展开公司节点
|
|
154
|
-
this.loadPointDepartments()
|
|
155
|
-
} else {
|
|
156
|
-
// 加载整个组织结构树时,展开公司节点
|
|
157
|
-
this.loadDepartment(this.tenantNodeId)
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
if (this.isClickNode) {
|
|
162
|
-
// 点击当前节点时,加载树节点时
|
|
163
|
-
// 注意不是点击复选框时
|
|
164
|
-
this.isClickNode = false
|
|
165
|
-
this.checkedNodeAndChildren(node.data)
|
|
166
|
-
} else {
|
|
167
|
-
// 表示是点击三角展开节点时
|
|
168
|
-
if (checkedKeys && checkedKeys.indexOf(parentId) > -1) {
|
|
169
|
-
// 点击部门名称前的三角标识展开节点时,保持当前节点的选中状态
|
|
170
|
-
// 表示当前展开的节点是选中状态,则应保持其选中状态,并选中其子节点
|
|
171
|
-
this.checkedNodeAndChildren(node.data)
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
})
|
|
175
|
-
},
|
|
176
|
-
// 加载当前节点的子节点
|
|
177
|
-
loadDepartment(parentId, isSearch, searchValue) {
|
|
178
|
-
return new Promise((resolve, reject) => {
|
|
179
|
-
this.$http.get(Vue.prototype.baseAPI + '/component/organization-trees/departments/' + parentId).then(children => {
|
|
180
|
-
this.$refs.deparmentTree.updateKeyChildren(parentId, children)
|
|
181
|
-
if (this.$refs.deparmentTree.store.nodesMap[parentId]) {
|
|
182
|
-
this.$refs.deparmentTree.store.nodesMap[parentId].expanded = true
|
|
183
|
-
}
|
|
184
|
-
resolve()
|
|
185
|
-
}).catch((error) => {
|
|
186
|
-
console.log('error', error)
|
|
187
|
-
})
|
|
188
|
-
})
|
|
189
|
-
},
|
|
190
|
-
// 加载指定部门节点
|
|
191
|
-
loadPointDepartments() {
|
|
192
|
-
this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/point-departments', this.departmentInfo).then(children => {
|
|
193
|
-
this.$refs.deparmentTree.updateKeyChildren(this.tenantNodeId, children)
|
|
194
|
-
if (this.$refs.deparmentTree.store.nodesMap[this.tenantNodeId]) {
|
|
195
|
-
this.$refs.deparmentTree.store.nodesMap[this.tenantNodeId].expanded = true
|
|
196
|
-
}
|
|
197
|
-
})
|
|
198
|
-
},
|
|
199
|
-
getSelectDepts(searchField, selectDeptInfo, separator) {
|
|
200
|
-
return new Promise((resolve, reject) => {
|
|
201
|
-
if (!searchField) {
|
|
202
|
-
resolve([])
|
|
203
|
-
} else if (!selectDeptInfo) {
|
|
204
|
-
resolve([])
|
|
205
|
-
} else {
|
|
206
|
-
this.$http.get(Vue.prototype.baseAPI + '/component/organization-trees/select-departments?searchField=' + searchField + '&selectDeptInfo=' + selectDeptInfo + '&separator=' + separator).then(departments => {
|
|
207
|
-
resolve(departments)
|
|
208
|
-
}).catch(error => {
|
|
209
|
-
reject(error)
|
|
210
|
-
})
|
|
211
|
-
}
|
|
212
|
-
})
|
|
213
|
-
},
|
|
214
|
-
// 选中了组织结构树的根节点
|
|
215
|
-
packageAllDept() {
|
|
216
|
-
// 表示集合中不存在该用户,则封装该用户
|
|
217
|
-
var allDept = {
|
|
218
|
-
id: this.tenantNodeId,
|
|
219
|
-
name: '所有部门'
|
|
220
|
-
}
|
|
221
|
-
return allDept
|
|
222
|
-
},
|
|
223
|
-
initSelectDepts() {
|
|
224
|
-
return new Promise((resolve, reject) => {
|
|
225
|
-
const selectDepts = []
|
|
226
|
-
if (this.selectDepartmentInfo) {
|
|
227
|
-
if (this.selectDepartmentInfo === this.tenantNodeId || this.selectDepartmentInfo === '所有部门') {
|
|
228
|
-
// 表示已选择所有用户
|
|
229
|
-
selectDepts.push(this.packageAllDept())
|
|
230
|
-
resolve(selectDepts)
|
|
231
|
-
} else {
|
|
232
|
-
// 表示不是选择的所有用户
|
|
233
|
-
this.getSelectDepts(this.searchField, this.selectDepartmentInfo, this.separator).then(departments => {
|
|
234
|
-
resolve(departments)
|
|
235
|
-
}).catch(error => {
|
|
236
|
-
reject(error)
|
|
237
|
-
})
|
|
238
|
-
}
|
|
239
|
-
} else {
|
|
240
|
-
resolve(selectDepts)
|
|
241
|
-
}
|
|
242
|
-
})
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
export default departmentTreeService
|