imatrix-ui 2.8.21-dw → 2.8.21
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 -2
- 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.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.js +561 -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/src/i18n/i18n.js +1 -1
- package/src/i18n/langs/cn.js +4 -2
- package/src/i18n/langs/en.js +4 -2
- package/src/index.js +93 -0
- package/src/permission.js +7 -3
- package/src/plugins.js +3 -3
- package/src/router/index.js +24 -0
- package/src/store/getters.js +2 -1
- package/src/store/modules/app.js +10 -1
- package/src/styles/display-layout.scss +34 -0
- package/src/styles/index.scss +32 -4
- package/src/styles/theme/dark-blue/button.scss +9 -0
- package/src/styles/theme/dark-blue/card.scss +64 -0
- package/src/styles/theme/dark-blue/checkbox.scss +10 -0
- package/src/styles/theme/dark-blue/dark-blue-var.scss +8 -0
- package/src/styles/theme/dark-blue/dialog.scss +21 -0
- package/src/styles/theme/dark-blue/element-variables.scss +7 -0
- package/src/styles/theme/dark-blue/font.scss +71 -0
- package/src/styles/theme/dark-blue/form.scss +51 -0
- package/src/styles/theme/dark-blue/index.scss +247 -0
- package/src/styles/theme/dark-blue/input.scss +15 -0
- package/src/styles/theme/dark-blue/pagination.scss +14 -0
- package/src/styles/theme/dark-blue/scrollbar-style.scss +32 -0
- package/src/styles/theme/dark-blue/sidebar.scss +296 -0
- package/src/styles/theme/dark-blue/tab.scss +83 -0
- package/src/styles/theme/dark-blue/table.scss +60 -0
- package/src/styles/theme/dark-blue/tree.scss +31 -0
- package/src/styles/theme/dark-blue/var.scss +1028 -0
- package/src/styles/theme/gray/form-style.scss +2 -2
- package/src/styles/theme/gray/input-style.scss +8 -0
- package/src/utils/auth-api.js +115 -0
- package/src/utils/auth.js +34 -42
- package/src/utils/calculator/calculator-factory.js +2 -2
- package/src/utils/common-util.js +34 -0
- package/src/utils/jump-page-utils.js +29 -5
- package/src/utils/menu.js +19 -0
- package/src/utils/permission.js +4 -0
- package/src/utils/request.js +18 -2
- package/src/utils/util.js +7 -3
- package/src/views/dsc-component/Sidebar/Item.vue +4 -4
- package/src/views/dsc-component/Sidebar/Link.vue +11 -2
- package/src/views/dsc-component/Sidebar/SidebarItem.vue +36 -20
- package/src/views/dsc-component/Sidebar/index.vue +24 -12
- package/src/views/dsc-component/tabs/tab-content.vue +16 -1
- package/src/views/login/index.vue +1 -1
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-container style="height: 395px">
|
|
4
|
+
<el-header style="text-align: right; font-size: 12px">
|
|
5
|
+
<el-autocomplete
|
|
6
|
+
v-model="filterText"
|
|
7
|
+
select-when-unmatched
|
|
8
|
+
class="inline-input inline-input-custom"
|
|
9
|
+
:fetch-suggestions="querySearch"
|
|
10
|
+
:placeholder="$t('imatrixUIMessage.pleaseEnterTeamName')"
|
|
11
|
+
:trigger-on-focus="false"
|
|
12
|
+
@select="handleSelect"
|
|
13
|
+
@keyup.enter.native="clickSearch"
|
|
14
|
+
>
|
|
15
|
+
<el-button slot="append" icon="el-icon-search" @click="clickSearch" />
|
|
16
|
+
</el-autocomplete>
|
|
17
|
+
</el-header>
|
|
18
|
+
<el-main>
|
|
19
|
+
<el-tree
|
|
20
|
+
ref="workgroupTree"
|
|
21
|
+
:props="defaultProps"
|
|
22
|
+
:load="loadNode"
|
|
23
|
+
lazy
|
|
24
|
+
:show-checkbox="multiple"
|
|
25
|
+
node-key="id"
|
|
26
|
+
:render-content="renderContent"
|
|
27
|
+
:filter-node-method="filterNode"
|
|
28
|
+
@check="handleCheckNode"
|
|
29
|
+
@node-click="handleNodeClick"
|
|
30
|
+
/>
|
|
31
|
+
</el-main>
|
|
32
|
+
</el-container>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
<style>
|
|
36
|
+
.searchResult {
|
|
37
|
+
color:red
|
|
38
|
+
}
|
|
39
|
+
.inline-input-custom {
|
|
40
|
+
width : 90%
|
|
41
|
+
}
|
|
42
|
+
</style>
|
|
43
|
+
|
|
44
|
+
<script>
|
|
45
|
+
import localStorage from '../../../src/utils/local-storage'
|
|
46
|
+
import utils from '../../utils/utils'
|
|
47
|
+
import workgroupTreeService from './workgroup-tree-service'
|
|
48
|
+
export default {
|
|
49
|
+
name: 'InlineWorkgroupTree',
|
|
50
|
+
props: {
|
|
51
|
+
// 是否是多选树,默认是true
|
|
52
|
+
multiple: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: true
|
|
55
|
+
},
|
|
56
|
+
// 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
|
|
57
|
+
branchInfo: {
|
|
58
|
+
type: Array,
|
|
59
|
+
default: null
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
},
|
|
63
|
+
data() {
|
|
64
|
+
return {
|
|
65
|
+
filterText: '',
|
|
66
|
+
defaultProps: {
|
|
67
|
+
id: 'id',
|
|
68
|
+
label: 'name',
|
|
69
|
+
children: 'children',
|
|
70
|
+
isLeaf: 'leaf'
|
|
71
|
+
},
|
|
72
|
+
containBranch: false, // 当前租户内是否包含分支机构。获得当前选中部门名称时,如果有分支,则需要将分支名称返回给用户,例如:部门1(分支1)
|
|
73
|
+
tenantNodeId: -1, // 公司节点的id
|
|
74
|
+
restaurants: [], // 查询的备选值
|
|
75
|
+
searchValue: null, // 查询条件
|
|
76
|
+
searchStoreKey: 'searchWorkgroup',
|
|
77
|
+
selectNodeInfo: null, // 单选时,选择的工作组信息
|
|
78
|
+
tenantInfo: {} // 公司根节点信息
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
computed: {
|
|
82
|
+
},
|
|
83
|
+
watch: {
|
|
84
|
+
filterText(val) {
|
|
85
|
+
if (!val) {
|
|
86
|
+
this.searchValue = val
|
|
87
|
+
// 清空查询内容时,重新加载整个树
|
|
88
|
+
this.loadWorkgroup(this.tenantNodeId)
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
mounted() {
|
|
93
|
+
var searchWorkgroup = localStorage.getObject(this.searchStoreKey)
|
|
94
|
+
if (searchWorkgroup) {
|
|
95
|
+
this.restaurants = searchWorkgroup
|
|
96
|
+
} else {
|
|
97
|
+
this.restaurants = []
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
methods: {
|
|
101
|
+
...utils,
|
|
102
|
+
...workgroupTreeService,
|
|
103
|
+
handleSelect(item) {
|
|
104
|
+
this.handleSelectUtil(item, localStorage)
|
|
105
|
+
},
|
|
106
|
+
search(value) {
|
|
107
|
+
this.searchValue = value
|
|
108
|
+
this.$refs.workgroupTree.filter(value)
|
|
109
|
+
},
|
|
110
|
+
// 点击查询按钮调用的方法
|
|
111
|
+
clickSearch() {
|
|
112
|
+
this.storeSeachValue(localStorage, this.searchStoreKey, this.filterText)
|
|
113
|
+
this.search(this.filterText)
|
|
114
|
+
},
|
|
115
|
+
filterNode(value, data, node) {
|
|
116
|
+
if (!value) {
|
|
117
|
+
return true
|
|
118
|
+
} else {
|
|
119
|
+
var workgroupName = data.name
|
|
120
|
+
if (data.id === this.tenantNodeId) {
|
|
121
|
+
// 表示是根节点公司节点
|
|
122
|
+
return false
|
|
123
|
+
} else if (this.containBranch) {
|
|
124
|
+
// 如果包含分支,工作组节点显示的格式为:工作组名称(分支名称)
|
|
125
|
+
workgroupName = workgroupName.substring(0, workgroupName.lastIndexOf('('))
|
|
126
|
+
}
|
|
127
|
+
return workgroupName.indexOf(value) !== -1
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
// 点击复选框时处理
|
|
131
|
+
handleCheckNode(data, checkObj) {
|
|
132
|
+
if (checkObj.checkedKeys.indexOf(data.id) > -1) {
|
|
133
|
+
// 表示正选中data节点
|
|
134
|
+
if (data.id === this.tenantNodeId) {
|
|
135
|
+
// 表示选中了公司节点
|
|
136
|
+
this.checkedAllWorkgroups(data)
|
|
137
|
+
}
|
|
138
|
+
} else {
|
|
139
|
+
// 表示正取消选中data节点,同时要取消其子节点的选中状态
|
|
140
|
+
if (data.id === this.tenantNodeId) {
|
|
141
|
+
// 表示取消公司节点的选中状态,即取消所有节点的勾选状态
|
|
142
|
+
this.$refs.workgroupTree.setCheckedKeys([])
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
// 选中了根节点公司节点时,选中所有工作组
|
|
147
|
+
checkedAllWorkgroups(root) {
|
|
148
|
+
const children = root.children
|
|
149
|
+
if (children) {
|
|
150
|
+
children.forEach(workgroupNode => {
|
|
151
|
+
this.$refs.workgroupTree.setChecked(workgroupNode.id, true)
|
|
152
|
+
})
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
handleNodeClick(data, node, nodeTree) {
|
|
156
|
+
if (this.multiple) {
|
|
157
|
+
// 多选部门树时,处理点击节点事件
|
|
158
|
+
this.clickNodeWhenMultiple(data)
|
|
159
|
+
}
|
|
160
|
+
this.selectSingleNode(data, false)
|
|
161
|
+
},
|
|
162
|
+
selectSingleNode(data, isClickOkBtn) {
|
|
163
|
+
if (this.isWorkgroupNode(data) && !this.multiple) {
|
|
164
|
+
// 点击的是工作组节点,并且是单选树时,点击部门节点直接关闭弹框
|
|
165
|
+
const workgroup = JSON.parse(data.data)
|
|
166
|
+
workgroup.tenantCode = this.tenantInfo.code
|
|
167
|
+
workgroup.tenantName = this.tenantInfo.tenantName
|
|
168
|
+
var selectNodeInfo = {
|
|
169
|
+
id: data.id,
|
|
170
|
+
name: data.name,
|
|
171
|
+
code: workgroup.code,
|
|
172
|
+
containBranch: this.containBranch,
|
|
173
|
+
workgroup: workgroup
|
|
174
|
+
}
|
|
175
|
+
this.selectNodeInfo = selectNodeInfo
|
|
176
|
+
if (isClickOkBtn === true) {
|
|
177
|
+
// 点击确定按钮时才需要调result回调事件,关闭弹框
|
|
178
|
+
this.$emit('result', selectNodeInfo)
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
// 多选树时,点击节点处理复选框的选中状态
|
|
183
|
+
clickNodeWhenMultiple(data) {
|
|
184
|
+
var checkedKeys = []
|
|
185
|
+
if (this.$refs.workgroupTree) {
|
|
186
|
+
checkedKeys = this.$refs.workgroupTree.getCheckedKeys()
|
|
187
|
+
}
|
|
188
|
+
// 取消选中状态时,保持节点是展开的状态,不要折叠
|
|
189
|
+
this.$refs.workgroupTree.store.nodesMap[data.id].expanded = true
|
|
190
|
+
if (checkedKeys.indexOf(data.id) > -1) {
|
|
191
|
+
// 表示当前节点是选中状态,则需要取消其选中状态
|
|
192
|
+
// 取消当前节点的勾选状态
|
|
193
|
+
this.$refs.workgroupTree.setChecked(data.id, false)
|
|
194
|
+
if (data.id === this.tenantNodeId) {
|
|
195
|
+
// 表示取消公司节点的选中状态,即取消所有节点的勾选状态
|
|
196
|
+
this.$refs.workgroupTree.setCheckedKeys([])
|
|
197
|
+
}
|
|
198
|
+
} else {
|
|
199
|
+
// 表示当前节点不是选中的状态,需要勾选该节点
|
|
200
|
+
this.$refs.workgroupTree.setChecked(data.id, true)
|
|
201
|
+
if (data.id === this.tenantNodeId) {
|
|
202
|
+
// 表示当前正选中根节点公司节点,则需要勾选所有节点的选中状态
|
|
203
|
+
this.checkedAllWorkgroups(data)
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
isWorkgroupNode(data) {
|
|
208
|
+
// 当前节点不是公司节点,也不是分支机构节点,表示是部门节点
|
|
209
|
+
return data.id !== this.tenantNodeId && data.nodeType && data.nodeType === 'WORKGROUP'
|
|
210
|
+
},
|
|
211
|
+
selectWorkgroup() {
|
|
212
|
+
// 是否需要显示提示框,默认不显示
|
|
213
|
+
var showTip = false
|
|
214
|
+
if (this.multiple) {
|
|
215
|
+
var selectNodeInfo = {
|
|
216
|
+
ids: [],
|
|
217
|
+
names: [],
|
|
218
|
+
codes: [],
|
|
219
|
+
workgroups: []
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
var nodes = this.$refs.workgroupTree.getCheckedNodes()
|
|
223
|
+
if (nodes) {
|
|
224
|
+
if (nodes.length === 0) {
|
|
225
|
+
// 没有选择任何节点
|
|
226
|
+
showTip = true
|
|
227
|
+
} else {
|
|
228
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
229
|
+
var node = nodes[i]
|
|
230
|
+
if (node.id !== this.tenantNodeId) {
|
|
231
|
+
// 不是公司根节点,表示是工作组节点,直接存到结果集合中
|
|
232
|
+
// node.data是部门对象的json字符串信息,通过JSON.parse(node.data)将json字符串转为对象
|
|
233
|
+
const workgroupData = JSON.parse(node.data)
|
|
234
|
+
this.addSelectedWorkgroupInfo(selectNodeInfo, node, workgroupData)
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
if (selectNodeInfo.ids.length > 0) {
|
|
238
|
+
this.$emit('result', selectNodeInfo)
|
|
239
|
+
} else {
|
|
240
|
+
showTip = true
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
} else {
|
|
244
|
+
showTip = true
|
|
245
|
+
}
|
|
246
|
+
} else {
|
|
247
|
+
const data = this.$refs.workgroupTree.getCurrentNode()
|
|
248
|
+
if (data && data !== null) {
|
|
249
|
+
this.selectSingleNode(data, true)
|
|
250
|
+
} else {
|
|
251
|
+
showTip = true
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
if (showTip) {
|
|
256
|
+
this.$alert(this.$t('imatrixUIMessage.pleaseSelectATeam'), this.$t('imatrixUIMessage.tips'), {
|
|
257
|
+
confirmButtonText: this.$t('imatrixUIPublicModel.sure')
|
|
258
|
+
})
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
// 将选中的部门节点添加到结果集合中
|
|
262
|
+
addSelectedWorkgroupInfo(result, node, workgroup) {
|
|
263
|
+
workgroup.tenantCode = this.tenantInfo.code
|
|
264
|
+
workgroup.tenantName = this.tenantInfo.tenantName
|
|
265
|
+
result.containBranch = this.containBranch
|
|
266
|
+
result.ids.push(node.id)
|
|
267
|
+
result.workgroups.push(workgroup)
|
|
268
|
+
result.codes.push(workgroup.code)
|
|
269
|
+
result.names.push(node.name)
|
|
270
|
+
},
|
|
271
|
+
// 初始化树 或 点击三角展开节点时动态加载子节点
|
|
272
|
+
loadNode(node, resolve) {
|
|
273
|
+
var parentId = 0
|
|
274
|
+
if (node.level === 0) {
|
|
275
|
+
// 表示初始化树
|
|
276
|
+
parentId = 0
|
|
277
|
+
} else {
|
|
278
|
+
parentId = node.data.id
|
|
279
|
+
}
|
|
280
|
+
var checkedKeys = []
|
|
281
|
+
if (this.$refs.workgroupTree) {
|
|
282
|
+
checkedKeys = this.$refs.workgroupTree.getCheckedKeys()
|
|
283
|
+
}
|
|
284
|
+
// 初始化部门树
|
|
285
|
+
this.initLoad(parentId, node, resolve, checkedKeys)
|
|
286
|
+
},
|
|
287
|
+
// 给节点添加自定义图标
|
|
288
|
+
renderContent(h, { node, data, store }) {
|
|
289
|
+
var className
|
|
290
|
+
if (node.data.id === -1) {
|
|
291
|
+
// node.id ===-1表示公司节点,node.branch表示是分支机构节点
|
|
292
|
+
className = 'el-icon-menu'
|
|
293
|
+
} else {
|
|
294
|
+
// 表示是工作组节点
|
|
295
|
+
className = 'el-icon-date'
|
|
296
|
+
}
|
|
297
|
+
if (data.nodeType && data.nodeType === 'WORKGROUP' &&
|
|
298
|
+
this.searchValue && data.name.indexOf(this.searchValue) > -1) {
|
|
299
|
+
// 如果是查询条件
|
|
300
|
+
return (
|
|
301
|
+
<span>
|
|
302
|
+
<i class={className}></i>
|
|
303
|
+
<span class='searchResult' title={node.label}>{node.label}</span>
|
|
304
|
+
</span>
|
|
305
|
+
)
|
|
306
|
+
}
|
|
307
|
+
return (
|
|
308
|
+
<span>
|
|
309
|
+
<i class={className}></i>
|
|
310
|
+
<span title={node.label}>{node.label}</span>
|
|
311
|
+
</span>
|
|
312
|
+
)
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
</script>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
const workgroupTreeService = {
|
|
3
|
+
// 初始化部门树
|
|
4
|
+
initLoad(parentId, node, resolve, checkedKeys) {
|
|
5
|
+
const param = {
|
|
6
|
+
parentId: parentId,
|
|
7
|
+
departmentInfo: this.branchInfo
|
|
8
|
+
}
|
|
9
|
+
this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/workgroups', param).then(data => {
|
|
10
|
+
resolve(data)
|
|
11
|
+
// 更新当前点击的节点的子节点
|
|
12
|
+
this.$refs.workgroupTree.updateKeyChildren(parentId, data)
|
|
13
|
+
if (parentId === 0) {
|
|
14
|
+
// 初始化树时,展开公司节点
|
|
15
|
+
const tenantData = data[0].data
|
|
16
|
+
this.tenantInfo = JSON.parse(tenantData)
|
|
17
|
+
this.containBranch = data[0].containBranch
|
|
18
|
+
// 加载整个组织结构树时,展开公司节点
|
|
19
|
+
this.loadWorkgroup(this.tenantNodeId)
|
|
20
|
+
}
|
|
21
|
+
// 表示是点击三角展开节点时
|
|
22
|
+
if (checkedKeys && checkedKeys.indexOf(parentId) > -1 && parentId === this.tenantNodeId) {
|
|
23
|
+
// 点击公司名称前的三角标识展开节点时,保持当前节点的选中状态
|
|
24
|
+
// 表示当前展开的节点是选中状态,则应保持其选中状态,并选中其子节点
|
|
25
|
+
this.checkedAllWorkgroups(node.data)
|
|
26
|
+
}
|
|
27
|
+
})
|
|
28
|
+
},
|
|
29
|
+
// 加载当前节点的子节点
|
|
30
|
+
loadWorkgroup(parentId) {
|
|
31
|
+
const param = {
|
|
32
|
+
parentId: parentId,
|
|
33
|
+
departmentInfo: this.branchInfo
|
|
34
|
+
}
|
|
35
|
+
this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/workgroups', param).then(children => {
|
|
36
|
+
this.$refs.workgroupTree.updateKeyChildren(parentId, children)
|
|
37
|
+
if (this.$refs.workgroupTree.store.nodesMap[parentId]) {
|
|
38
|
+
this.$refs.workgroupTree.store.nodesMap[parentId].expanded = true
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export default workgroupTreeService
|
|
@@ -0,0 +1,100 @@
|
|
|
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="width"
|
|
10
|
+
@open="$emit('open')"
|
|
11
|
+
@opend="$emit('opend')"
|
|
12
|
+
@close="$emit('close')"
|
|
13
|
+
@closed="$emit('closed')"
|
|
14
|
+
>
|
|
15
|
+
<inline-workgroup-user-tree
|
|
16
|
+
ref="workgroupUserTree"
|
|
17
|
+
:multiple="multiple"
|
|
18
|
+
:branch-info="branchInfo"
|
|
19
|
+
:select-user-info="selectUserInfo"
|
|
20
|
+
:search-field="searchField"
|
|
21
|
+
:separator="separator"
|
|
22
|
+
@result="result"
|
|
23
|
+
/>
|
|
24
|
+
<div slot="footer" class="dialog-footer">
|
|
25
|
+
<el-button size="small" @click="$emit('close')">
|
|
26
|
+
{{ $t('imatrixUIPublicModel.cancel') }}
|
|
27
|
+
</el-button>
|
|
28
|
+
<el-button size="small" type="primary" @click="selectWorkgroupUser">
|
|
29
|
+
{{ $t('imatrixUIPublicModel.sure') }}
|
|
30
|
+
</el-button>
|
|
31
|
+
</div>
|
|
32
|
+
</el-dialog>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script>
|
|
37
|
+
import InlineWorkgroupUserTree from '../../workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue'
|
|
38
|
+
export default {
|
|
39
|
+
name: 'WorkgroupUserTree',
|
|
40
|
+
components: {
|
|
41
|
+
InlineWorkgroupUserTree
|
|
42
|
+
},
|
|
43
|
+
props: {
|
|
44
|
+
// 是否是多选树,默认是true
|
|
45
|
+
multiple: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: true
|
|
48
|
+
},
|
|
49
|
+
// 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
|
|
50
|
+
branchInfo: {
|
|
51
|
+
type: Array,
|
|
52
|
+
default: null
|
|
53
|
+
},
|
|
54
|
+
// 弹框的标题
|
|
55
|
+
title: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: null
|
|
58
|
+
},
|
|
59
|
+
// 弹框的宽度
|
|
60
|
+
width: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: '30%'
|
|
63
|
+
},
|
|
64
|
+
// 多选用户树时,已选择用户id或登录名集合,多个之间以逗号隔开
|
|
65
|
+
selectUserInfo: {
|
|
66
|
+
type: [String, Number],
|
|
67
|
+
default: null
|
|
68
|
+
},
|
|
69
|
+
// 移除用户时,用户属性名称:id、loginName、email、telephone,默认是loginName
|
|
70
|
+
searchField: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: 'loginName'
|
|
73
|
+
},
|
|
74
|
+
// 多选树时结果之间的分隔符,默认是逗号分隔
|
|
75
|
+
separator: {
|
|
76
|
+
type: String,
|
|
77
|
+
default: ','
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
},
|
|
81
|
+
data() {
|
|
82
|
+
let myTitle = this.$t('imatrixUIMessage.pleaseSelectATeam')
|
|
83
|
+
if (this.title) {
|
|
84
|
+
myTitle = this.title
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
myTitle
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
methods: {
|
|
91
|
+
result(selectNodeInfo) {
|
|
92
|
+
this.$emit('close', selectNodeInfo)
|
|
93
|
+
},
|
|
94
|
+
// 嵌入树,多选时,点击确定时调用的方法
|
|
95
|
+
selectWorkgroupUser() {
|
|
96
|
+
this.$refs.workgroupUserTree.selectWorkgroupUser()
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
</script>
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
import { getI18n } from '../../../src/utils/util'
|
|
3
|
+
const workgroupTreeInlineService = {
|
|
4
|
+
// 后台查询部门,并拼接树节点
|
|
5
|
+
filterAppendNodes(value) {
|
|
6
|
+
this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/searches', this.searchParam).then(result => {
|
|
7
|
+
if (result) {
|
|
8
|
+
if (result.length === 0) {
|
|
9
|
+
this.$message({
|
|
10
|
+
showClose: true,
|
|
11
|
+
type: 'error',
|
|
12
|
+
message: getI18n().t('imatrixUIMessage.queryResultIsEmpty')
|
|
13
|
+
})
|
|
14
|
+
return
|
|
15
|
+
}
|
|
16
|
+
// result的格式为[WORKGROUP~1,WORKGROUP~4,WORKGROUP~10]
|
|
17
|
+
result.forEach(nodeId => {
|
|
18
|
+
var dataId = nodeId
|
|
19
|
+
// 节点类型和数据id的分隔符
|
|
20
|
+
var nodeTypeAndDataIdSeparator = '~'
|
|
21
|
+
// nodeId格式为WORKGROUP~4
|
|
22
|
+
if (nodeId.indexOf(nodeTypeAndDataIdSeparator) > -1) {
|
|
23
|
+
dataId = nodeId.substring(nodeId.indexOf('~') + 1)
|
|
24
|
+
}
|
|
25
|
+
if (this.allSearchNodeIds.indexOf(nodeId) === -1) {
|
|
26
|
+
// 表示没有加载过该节点,需要放到allSearchNodeIds集合中,并加载该节点内容
|
|
27
|
+
this.allSearchNodeIds.push(nodeId)
|
|
28
|
+
this.loadWorkgroup(dataId, nodeId, true, value)
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
} else {
|
|
32
|
+
this.$message({
|
|
33
|
+
showClose: true,
|
|
34
|
+
type: 'error',
|
|
35
|
+
message: getI18n().t('imatrixUIMessage.queryResultIsEmpty')
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
},
|
|
40
|
+
// 选中节点时
|
|
41
|
+
checkedNode(data, isClickNode) {
|
|
42
|
+
const children = data.children
|
|
43
|
+
if (children && children.length > 0) {
|
|
44
|
+
// 展开当前选中的节点
|
|
45
|
+
this.$refs.workgroupUserTree.store.nodesMap[data.nodeId].expanded = true
|
|
46
|
+
// 选中当前节点及其子节点
|
|
47
|
+
this.checkedNodeAndChildren(data)
|
|
48
|
+
} else {
|
|
49
|
+
if (!data.leaf) {
|
|
50
|
+
// 不是叶子节点,并且没有加载过该父节点的子节点时,需要走后台展开子节点
|
|
51
|
+
if (!isClickNode) {
|
|
52
|
+
var param = {
|
|
53
|
+
parentId: data.id,
|
|
54
|
+
departmentInfo: this.branchInfo
|
|
55
|
+
}
|
|
56
|
+
this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/workgroup-users', param).then(result => {
|
|
57
|
+
// 更新当前点击的节点的子节点
|
|
58
|
+
this.$refs.workgroupUserTree.updateKeyChildren(data.nodeId, result)
|
|
59
|
+
// 展开当前选中的节点
|
|
60
|
+
this.$refs.workgroupUserTree.store.nodesMap[data.nodeId].expanded = true
|
|
61
|
+
// 获得所有应该选中的节点
|
|
62
|
+
this.checkedNodeAndChildren(data)
|
|
63
|
+
})
|
|
64
|
+
} else {
|
|
65
|
+
this.isClickNode = true
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
// 获得所有指定工作组下的用户信息
|
|
71
|
+
getAllSelectedWorkgroupUsers(parentIds, selectNodeInfo) {
|
|
72
|
+
this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/user-in-workgroups', parentIds).then(users => {
|
|
73
|
+
users.forEach(user => {
|
|
74
|
+
this.addSelectedUserInfo(selectNodeInfo, user)
|
|
75
|
+
})
|
|
76
|
+
if (selectNodeInfo.userIds.length > 0) {
|
|
77
|
+
this.$emit('result', selectNodeInfo)
|
|
78
|
+
} else {
|
|
79
|
+
this.$alert(getI18n().t('imatrixUIMessage.pleaseSelectPersonnel'), getI18n().t('imatrixUIMessage.tips'), {
|
|
80
|
+
confirmButtonText: getI18n().t('imatrixUIPublicModel.sure')
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
})
|
|
84
|
+
},
|
|
85
|
+
// 初始化树 或 点击三角展开节点时动态加载子节点
|
|
86
|
+
loadNode(node, resolve) {
|
|
87
|
+
var parentId = 0
|
|
88
|
+
var parentNodeId = '0'
|
|
89
|
+
if (node.level === 0) {
|
|
90
|
+
// 表示初始化树
|
|
91
|
+
parentId = 0
|
|
92
|
+
parentNodeId = '0'
|
|
93
|
+
} else {
|
|
94
|
+
parentId = node.data.id
|
|
95
|
+
parentNodeId = node.data.nodeId
|
|
96
|
+
}
|
|
97
|
+
var checkedKeys = []
|
|
98
|
+
if (this.$refs.workgroupUserTree) {
|
|
99
|
+
checkedKeys = this.$refs.workgroupUserTree.getCheckedKeys()
|
|
100
|
+
}
|
|
101
|
+
// 初始化部门树
|
|
102
|
+
this.initLoad(parentId, parentNodeId, node, resolve, checkedKeys)
|
|
103
|
+
},
|
|
104
|
+
// 初始化部门树
|
|
105
|
+
initLoad(parentId, parentNodeId, node, resolve, checkedKeys) {
|
|
106
|
+
const param = {
|
|
107
|
+
parentId: parentId,
|
|
108
|
+
departmentInfo: this.branchInfo
|
|
109
|
+
}
|
|
110
|
+
this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/workgroup-users', param).then(data => {
|
|
111
|
+
resolve(data)
|
|
112
|
+
// 更新当前点击的节点的子节点
|
|
113
|
+
this.$refs.workgroupUserTree.updateKeyChildren(parentNodeId, data)
|
|
114
|
+
if (parentId === 0) {
|
|
115
|
+
// 初始化树时,展开公司节点
|
|
116
|
+
const tenantData = data[0].data
|
|
117
|
+
this.tenantInfo = JSON.parse(tenantData)
|
|
118
|
+
this.containBranch = data[0].containBranch
|
|
119
|
+
// 加载整个组织结构树时,展开公司节点
|
|
120
|
+
this.loadWorkgroup(this.tenantNodeId, this.tenantNodeId + '')
|
|
121
|
+
}
|
|
122
|
+
if (this.isClickNode) {
|
|
123
|
+
// 表示点击工作组节点选中时展开
|
|
124
|
+
this.isClickNode = false
|
|
125
|
+
this.checkedNode(node.data)
|
|
126
|
+
} else {
|
|
127
|
+
// 表示是点击三角展开节点时
|
|
128
|
+
if (checkedKeys && checkedKeys.indexOf(parentNodeId) > -1) {
|
|
129
|
+
// 点击公司名称前的三角标识展开节点时,保持当前节点的选中状态
|
|
130
|
+
// 表示当前展开的节点是选中状态,则应保持其选中状态,并选中其子节点
|
|
131
|
+
this.checkedNode(node.data)
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
})
|
|
135
|
+
},
|
|
136
|
+
// 加载当前节点的子节点
|
|
137
|
+
loadWorkgroup(parentId, parentNodeId, isSearch, searchValue) {
|
|
138
|
+
const param = {
|
|
139
|
+
parentId: parentId,
|
|
140
|
+
departmentInfo: this.branchInfo
|
|
141
|
+
}
|
|
142
|
+
this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/workgroup-users', param).then(children => {
|
|
143
|
+
this.$refs.workgroupUserTree.updateKeyChildren(parentNodeId, children)
|
|
144
|
+
if (this.$refs.workgroupUserTree.store.nodesMap[parentNodeId]) {
|
|
145
|
+
this.$refs.workgroupUserTree.store.nodesMap[parentNodeId].expanded = true
|
|
146
|
+
}
|
|
147
|
+
if (isSearch) {
|
|
148
|
+
// 查询时处理
|
|
149
|
+
if (this.allExpandNodeIds.indexOf(parentNodeId) === -1) {
|
|
150
|
+
// allExpandNodeIds集合中是否包含当前parentId节点id
|
|
151
|
+
this.allExpandNodeIds.push(parentNodeId)
|
|
152
|
+
}
|
|
153
|
+
if (this.allExpandNodeIds.length === this.allSearchNodeIds.length) {
|
|
154
|
+
// 表示所有节点已展开,执行树的过滤方法
|
|
155
|
+
this.$refs.workgroupUserTree.filter(searchValue)
|
|
156
|
+
this.allExpandNodeIds = []
|
|
157
|
+
this.allSearchNodeIds = []
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
})
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
export default workgroupTreeInlineService
|