imatrix-ui 2.8.97-dw-tmp39 → 2.8.97-dw-tmp41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/super-ui.umd.min.js +3 -3
- package/package.json +1 -1
- package/packages/breadcrumb/index.js +6 -0
- package/packages/breadcrumb/src/breadcrumb.vue +71 -0
- package/packages/department-tree/index.js +6 -0
- package/packages/department-tree/src/department-tree.vue +108 -0
- package/packages/department-tree-inline/index.js +6 -0
- package/packages/department-tree-inline/src/department-multi-tree-inline.vue +402 -0
- package/packages/department-tree-inline/src/department-single-tree-inline.vue +284 -0
- package/packages/department-tree-inline/src/department-tree-inline.vue +86 -0
- package/packages/department-tree-inline/src/department-tree-service.js +245 -0
- package/packages/department-tree-inline/src/search-result.vue +176 -0
- package/packages/department-user-tree/index.js +6 -0
- package/packages/department-user-tree/src/department-user-multiple-tree.vue +116 -0
- package/packages/department-user-tree/src/department-user-single-tree.vue +76 -0
- package/packages/department-user-tree/src/department-user-tree.vue +101 -0
- package/packages/department-user-tree-inline/index.js +6 -0
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +626 -0
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +269 -0
- package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +79 -0
- package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +230 -0
- package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +122 -0
- package/packages/department-user-tree-inline/src/search-result.vue +197 -0
- package/packages/directives/prevent-reclick.js +19 -0
- package/packages/dynamic-source-select/index.js +6 -0
- package/packages/dynamic-source-select/src/dynamic-source-select-service.js +70 -0
- package/packages/dynamic-source-select/src/dynamic-source-select.vue +440 -0
- package/packages/dynamic-source-select/src/events.js +55 -0
- package/packages/fs-preview/index.js +6 -0
- package/packages/fs-preview/src/fs-preview.vue +226 -0
- package/packages/fs-upload/index.js +6 -0
- package/packages/fs-upload/src/fs-upload-multi.vue +420 -0
- package/packages/fs-upload/src/fs-upload-single.vue +312 -0
- package/packages/fs-upload/src/fs-upload.vue +189 -0
- package/packages/fs-upload/src/see-big-picture.vue +55 -0
- package/packages/fs-upload-list/index.js +6 -0
- package/packages/fs-upload-list/src/fs-upload-list.vue +287 -0
- package/packages/hamburger/index.js +6 -0
- package/packages/hamburger/src/hamburger.vue +38 -0
- package/packages/index.js +121 -0
- package/packages/multipart-upload/index.js +6 -0
- package/packages/multipart-upload/src/index.vue +73 -0
- package/packages/multipart-upload/src/multipart-upload-form.vue +297 -0
- package/packages/multipart-upload/src/multipart-upload-list.vue +378 -0
- package/packages/organization-input/index.js +6 -0
- package/packages/organization-input/src/organization-input.vue +542 -0
- package/packages/plugins/export-data-new.js +453 -0
- package/packages/plugins/export-data.js +361 -0
- package/packages/plugins/index.js +15 -0
- package/packages/plugins/public-method.js +43 -0
- package/packages/remove-department/index.js +6 -0
- package/packages/remove-department/src/remove-department.vue +172 -0
- package/packages/remove-department/src/remove-dept-service.js +20 -0
- package/packages/remove-user/index.js +6 -0
- package/packages/remove-user/src/remove-user-service.js +20 -0
- package/packages/remove-user/src/remove-user.vue +195 -0
- package/packages/remove-workgroup/index.js +6 -0
- package/packages/remove-workgroup/src/remove-workgroup-service.js +20 -0
- package/packages/remove-workgroup/src/remove-workgroup.vue +159 -0
- package/packages/rich-editor/index.js +7 -0
- package/packages/rich-editor/index.vue +278 -0
- package/packages/rich-editor/langs/zh-Hans.js +1 -0
- package/packages/rich-editor/viewer.vue +103 -0
- package/packages/scan-code-input/index.js +6 -0
- package/packages/scan-code-input/src/events.js +33 -0
- package/packages/scan-code-input/src/scan-code-input-colse.vue +131 -0
- package/packages/scan-code-input/src/scan-code-input.vue +116 -0
- package/packages/secret-info/index.js +7 -0
- package/packages/secret-info/index.vue +90 -0
- package/packages/super-grid/index.js +7 -0
- package/packages/super-grid/src/apis.js +763 -0
- package/packages/super-grid/src/columns-config.vue +335 -0
- package/packages/super-grid/src/custom-formatter.js +250 -0
- package/packages/super-grid/src/dynamic-input.vue +1279 -0
- package/packages/super-grid/src/eventBus.js +2 -0
- package/packages/super-grid/src/events.js +55 -0
- package/packages/super-grid/src/formValidatorUtil.js +226 -0
- package/packages/super-grid/src/formatter.js +181 -0
- package/packages/super-grid/src/group-column.vue +100 -0
- package/packages/super-grid/src/header-context-menu.vue +87 -0
- package/packages/super-grid/src/index-column.vue +51 -0
- package/packages/super-grid/src/normal-column copy.vue +769 -0
- package/packages/super-grid/src/normal-column.vue +769 -0
- package/packages/super-grid/src/public-methods.js +31 -0
- package/packages/super-grid/src/row-operation.vue +161 -0
- package/packages/super-grid/src/search-button.vue +66 -0
- package/packages/super-grid/src/search-condition-input.vue +61 -0
- package/packages/super-grid/src/search-condition-list.vue +59 -0
- package/packages/super-grid/src/search-form-advancedQuery.vue +653 -0
- package/packages/super-grid/src/search-form-dialog.vue +79 -0
- package/packages/super-grid/src/search-form-item.vue +386 -0
- package/packages/super-grid/src/search-form-number.vue +38 -0
- package/packages/super-grid/src/search-form-open.vue +162 -0
- package/packages/super-grid/src/search-form-ordinarySearch.vue +188 -0
- package/packages/super-grid/src/search-form.vue +634 -0
- package/packages/super-grid/src/search-methods.js +387 -0
- package/packages/super-grid/src/selection-column.vue +43 -0
- package/packages/super-grid/src/store.js +3 -0
- package/packages/super-grid/src/super-grid-service-static.js +1313 -0
- package/packages/super-grid/src/super-grid-service.js +561 -0
- package/packages/super-grid/src/super-grid-static.vue +3229 -0
- package/packages/super-grid/src/super-grid.vue +2793 -0
- package/packages/super-grid/src/utils.js +763 -0
- package/packages/super-grid/src/view-image-dialog.vue +130 -0
- package/packages/super-nine-grid/index.js +7 -0
- package/packages/super-nine-grid/src/apis.js +103 -0
- package/packages/super-nine-grid/src/custom-formatter.js +66 -0
- package/packages/super-nine-grid/src/formatter.js +132 -0
- package/packages/super-nine-grid/src/search-form-number.vue +38 -0
- package/packages/super-nine-grid/src/search-form.vue +430 -0
- package/packages/super-nine-grid/src/search-methods.js +134 -0
- package/packages/super-nine-grid/src/store.js +3 -0
- package/packages/super-nine-grid/src/super-grid-service.js +91 -0
- package/packages/super-nine-grid/src/super-nine-grid.vue +872 -0
- package/packages/super-nine-grid/src/utils.js +261 -0
- package/packages/svg-icon/index.js +6 -0
- package/packages/svg-icon/src/svg-icon.vue +43 -0
- package/packages/utils/utils.js +152 -0
- package/packages/utils/value-set.js +86 -0
- package/packages/valid-code/index.js +7 -0
- package/packages/valid-code/src/valid-code.vue +95 -0
- package/packages/workflow-button/index.js +6 -0
- package/packages/workflow-button/src/workflow-button.vue +325 -0
- package/packages/workflow-history-list/index.js +6 -0
- package/packages/workflow-history-list/src/api.js +7 -0
- package/packages/workflow-history-list/src/workflow-history-list.vue +185 -0
- package/packages/workgroup-tree/index.js +6 -0
- package/packages/workgroup-tree/src/workgroup-tree.vue +76 -0
- package/packages/workgroup-tree-inline/index.js +6 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +317 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +43 -0
- package/packages/workgroup-user-tree/index.js +6 -0
- package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +100 -0
- package/packages/workgroup-user-tree-inline/index.js +6 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +163 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +436 -0
- package/packages/year-range-picker/index.js +6 -0
- package/packages/year-range-picker/src/year-range-picker.vue +51 -0
- package/lib/super-ui.common.1.js +0 -368
- package/lib/super-ui.umd.1.js +0 -368
- package/lib/super-ui.umd.min.1.js +0 -2
|
@@ -0,0 +1,436 @@
|
|
|
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('departmentUserTree.pleaseEnterUserInformation')"
|
|
12
|
+
:trigger-on-focus="false"
|
|
13
|
+
@select="handleSelect"
|
|
14
|
+
@keyup.enter.native="clickSearch"
|
|
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 style="padding-top:5px;overflow:auto;width: auto;display: inline-block !important;">
|
|
21
|
+
<el-tree
|
|
22
|
+
ref="workgroupUserTree"
|
|
23
|
+
:props="defaultProps"
|
|
24
|
+
:load="loadNode"
|
|
25
|
+
lazy
|
|
26
|
+
:show-checkbox="multiple"
|
|
27
|
+
node-key="nodeId"
|
|
28
|
+
:render-content="renderContent"
|
|
29
|
+
:filter-node-method="filterNode"
|
|
30
|
+
@check="handleCheckNode"
|
|
31
|
+
@node-click="handleNodeClick"
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
</el-main>
|
|
35
|
+
</el-container>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
<style>
|
|
39
|
+
.searchResult {
|
|
40
|
+
color:red
|
|
41
|
+
}
|
|
42
|
+
.inline-input-custom {
|
|
43
|
+
width : 90%
|
|
44
|
+
}
|
|
45
|
+
</style>
|
|
46
|
+
|
|
47
|
+
<script>
|
|
48
|
+
import localStorage from '../../../src/utils/local-storage'
|
|
49
|
+
import utils from '../../utils/utils'
|
|
50
|
+
import workgroupTreeInlineService from './workgroup-tree-inline-service'
|
|
51
|
+
export default {
|
|
52
|
+
name: 'InlineWorkgroupUserTree',
|
|
53
|
+
props: {
|
|
54
|
+
// 是否是多选树,默认是true
|
|
55
|
+
multiple: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: true
|
|
58
|
+
},
|
|
59
|
+
// 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
|
|
60
|
+
branchInfo: {
|
|
61
|
+
type: Array,
|
|
62
|
+
default: null
|
|
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
|
+
return {
|
|
83
|
+
filterText: '',
|
|
84
|
+
defaultProps: {
|
|
85
|
+
id: 'id',
|
|
86
|
+
label: 'name',
|
|
87
|
+
children: 'children',
|
|
88
|
+
isLeaf: 'leaf'
|
|
89
|
+
},
|
|
90
|
+
searchParam: {
|
|
91
|
+
userField: null,
|
|
92
|
+
searchValue: null,
|
|
93
|
+
treeType: 'MAN_GROUP_TREE',
|
|
94
|
+
departmentInfo: null
|
|
95
|
+
},
|
|
96
|
+
containBranch: false, // 当前租户内是否包含分支机构。获得当前选中部门名称时,如果有分支,则需要将分支名称返回给用户,例如:部门1(分支1)
|
|
97
|
+
tenantNodeId: -1, // 公司节点的id
|
|
98
|
+
allSearchNodeIds: [], // 用于保存所有查询出的节点id
|
|
99
|
+
allExpandNodeIds: [], // 用于保存allSearchNodeIds中所有已加载子节点的id集合
|
|
100
|
+
isClickNode: false,
|
|
101
|
+
restaurants: [], // 查询的备选值
|
|
102
|
+
searchValue: null, // 查询条件
|
|
103
|
+
searchStoreKey: 'searchWorkgroupUser',
|
|
104
|
+
selectNodeInfo: null, // 单选时,选择的用户信息
|
|
105
|
+
tenantInfo: {} // 公司根节点信息
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
computed: {
|
|
109
|
+
},
|
|
110
|
+
watch: {
|
|
111
|
+
filterText(val) {
|
|
112
|
+
if (!val) {
|
|
113
|
+
this.searchValue = val
|
|
114
|
+
// 清空查询内容时,重新加载整个树
|
|
115
|
+
this.loadWorkgroup(this.tenantNodeId, this.tenantNodeId + '')
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
created() {
|
|
120
|
+
},
|
|
121
|
+
mounted() {
|
|
122
|
+
var searchWorkgroup = localStorage.getObject(this.searchStoreKey)
|
|
123
|
+
if (searchWorkgroup) {
|
|
124
|
+
this.restaurants = searchWorkgroup
|
|
125
|
+
} else {
|
|
126
|
+
this.restaurants = []
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
methods: {
|
|
130
|
+
...utils,
|
|
131
|
+
...workgroupTreeInlineService,
|
|
132
|
+
handleSelect(item) {
|
|
133
|
+
this.handleSelectUtil(item, localStorage)
|
|
134
|
+
},
|
|
135
|
+
search(value) {
|
|
136
|
+
this.searchValue = value
|
|
137
|
+
let mySearchValue = value
|
|
138
|
+
if (mySearchValue) {
|
|
139
|
+
mySearchValue = mySearchValue.trim()
|
|
140
|
+
}
|
|
141
|
+
this.searchParam.searchValue = mySearchValue
|
|
142
|
+
this.searchParam.departmentInfo = this.branchInfo
|
|
143
|
+
// this.searchParam.userField = this.searchField
|
|
144
|
+
// 后台查询部门,并拼接树节点
|
|
145
|
+
this.filterAppendNodes(value)
|
|
146
|
+
},
|
|
147
|
+
// 点击查询按钮调用的方法
|
|
148
|
+
clickSearch() {
|
|
149
|
+
this.storeSeachValue(localStorage, this.searchStoreKey, this.filterText)
|
|
150
|
+
this.search(this.filterText)
|
|
151
|
+
},
|
|
152
|
+
filterNode(value, data, node) {
|
|
153
|
+
if (!value) {
|
|
154
|
+
return true
|
|
155
|
+
} else {
|
|
156
|
+
if (data.nodeType && data.nodeType === 'USER') {
|
|
157
|
+
// data.data是用户的所有数据
|
|
158
|
+
const user = JSON.parse(data.data)
|
|
159
|
+
return this.filterUserVal(user, value)
|
|
160
|
+
} else {
|
|
161
|
+
// 表示不是用户节点
|
|
162
|
+
return false
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
filterUserVal(user, searchVal) {
|
|
167
|
+
const searchFields = ['name', 'loginName', 'email', 'telephone', 'jobNumber', 'honorificName']
|
|
168
|
+
let isHasVal = false
|
|
169
|
+
for (let i = 0; i < searchFields.length; i++) {
|
|
170
|
+
const searchField = searchFields[i]
|
|
171
|
+
const userValue = user[searchField]
|
|
172
|
+
if (userValue.indexOf(searchVal) !== -1 || (searchField === 'name' && user['enName'] && user['enName'].indexOf(searchVal) !== -1)) {
|
|
173
|
+
isHasVal = true
|
|
174
|
+
} else {
|
|
175
|
+
isHasVal = false
|
|
176
|
+
break
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return isHasVal
|
|
180
|
+
},
|
|
181
|
+
// 点击复选框时处理
|
|
182
|
+
handleCheckNode(data, checkObj) {
|
|
183
|
+
if (checkObj.checkedKeys.indexOf(data.nodeId) > -1) {
|
|
184
|
+
// 表示正选中data节点
|
|
185
|
+
this.checkedNode(data, false)
|
|
186
|
+
} else {
|
|
187
|
+
// 表示正取消选中data节点,同时要取消其子节点的选中状态
|
|
188
|
+
this.cancelCheckedNode(data)
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
// 选中当前节点及其子节点
|
|
192
|
+
checkedNodeAndChildren(data) {
|
|
193
|
+
// 取消选中状态时,保持节点是展开的状态,不要折叠
|
|
194
|
+
this.$refs.workgroupUserTree.store.nodesMap[data.nodeId].expanded = true
|
|
195
|
+
// 获得所有应该选中的节点
|
|
196
|
+
this.$refs.workgroupUserTree.setChecked(data.nodeId, true)
|
|
197
|
+
const children = data.children
|
|
198
|
+
if (children) {
|
|
199
|
+
// 递归设置子子节点的选中状态
|
|
200
|
+
children.forEach(nodeData => {
|
|
201
|
+
this.checkedNodeAndChildren(nodeData)
|
|
202
|
+
})
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
// 取消节点选中状态时
|
|
206
|
+
cancelCheckedNode(data) {
|
|
207
|
+
if (data.id === this.tenantNodeId) {
|
|
208
|
+
// 表示取消公司节点的选中状态,即取消所有节点的勾选状态
|
|
209
|
+
this.$refs.workgroupUserTree.setCheckedKeys([])
|
|
210
|
+
} else if (data.nodeType && data.nodeType === 'WORKGROUP') {
|
|
211
|
+
this.cancelCheckedUserNodesWithWorkgroup(data)
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
// 选中了根节点公司节点时,选中所有工作组
|
|
215
|
+
checkedAllWorkgroups(root) {
|
|
216
|
+
const children = root.children
|
|
217
|
+
if (children) {
|
|
218
|
+
children.forEach(workgroupNode => {
|
|
219
|
+
this.$refs.workgroupUserTree.setChecked(workgroupNode.nodeId, true)
|
|
220
|
+
})
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
// 取消指定工作组下的用户节点的选中状态
|
|
224
|
+
cancelCheckedUserNodesWithWorkgroup(workgroupData) {
|
|
225
|
+
const children = workgroupData.children
|
|
226
|
+
if (children) {
|
|
227
|
+
children.forEach(userNode => {
|
|
228
|
+
this.$refs.workgroupUserTree.setChecked(userNode.nodeId, false)
|
|
229
|
+
})
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
handleNodeClick(data, node, nodeTree) {
|
|
233
|
+
if (this.multiple) {
|
|
234
|
+
// 多选部门树时,处理点击节点事件
|
|
235
|
+
this.clickNodeWhenMultiple(data)
|
|
236
|
+
}
|
|
237
|
+
this.selectSingleNode(data, false)
|
|
238
|
+
},
|
|
239
|
+
selectSingleNode(data, isClickOkBtn) {
|
|
240
|
+
if (this.isUserNode(data) && !this.multiple) {
|
|
241
|
+
// 点击的是工作组节点,并且是单选树时,点击部门节点直接关闭弹框
|
|
242
|
+
const user = JSON.parse(data.data)
|
|
243
|
+
user.tenantCode = this.tenantInfo.code
|
|
244
|
+
user.tenantName = this.tenantInfo.tenantName
|
|
245
|
+
let name = user.name
|
|
246
|
+
if (user.enName && user.enName.trim() !== '') {
|
|
247
|
+
name = name + '(' + user.enName + ')'
|
|
248
|
+
}
|
|
249
|
+
const selectNodeInfo = {
|
|
250
|
+
id: user.id,
|
|
251
|
+
name: name,
|
|
252
|
+
loginName: user.loginName,
|
|
253
|
+
email: user.email,
|
|
254
|
+
telephone: user.telephone,
|
|
255
|
+
containBranch: this.containBranch,
|
|
256
|
+
user: user,
|
|
257
|
+
enName: user.enName,
|
|
258
|
+
subCompanyName: user.subCompanyName
|
|
259
|
+
}
|
|
260
|
+
this.selectNodeInfo = selectNodeInfo
|
|
261
|
+
if (isClickOkBtn === true) {
|
|
262
|
+
// 点击确定按钮时才需要调result回调事件,关闭弹框
|
|
263
|
+
this.$emit('result', selectNodeInfo)
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
// 多选树时,点击节点处理复选框的选中状态
|
|
268
|
+
clickNodeWhenMultiple(data) {
|
|
269
|
+
var checkedKeys = []
|
|
270
|
+
if (this.$refs.workgroupUserTree) {
|
|
271
|
+
checkedKeys = this.$refs.workgroupUserTree.getCheckedKeys()
|
|
272
|
+
}
|
|
273
|
+
// 取消选中状态时,保持节点是展开的状态,不要折叠
|
|
274
|
+
this.$refs.workgroupUserTree.store.nodesMap[data.nodeId].expanded = true
|
|
275
|
+
if (checkedKeys.indexOf(data.nodeId) > -1) {
|
|
276
|
+
// 表示当前节点是选中状态,则需要取消其选中状态
|
|
277
|
+
// 取消当前节点的勾选状态
|
|
278
|
+
this.$refs.workgroupUserTree.setChecked(data.nodeId, false)
|
|
279
|
+
this.cancelCheckedNode(data)
|
|
280
|
+
} else {
|
|
281
|
+
// 表示当前节点不是选中的状态,需要勾选该节点
|
|
282
|
+
this.$refs.workgroupUserTree.setChecked(data.nodeId, true)
|
|
283
|
+
this.checkedNode(data, true)
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
isUserNode(data) {
|
|
287
|
+
// 当前节点不是公司节点,也不是分支机构节点,表示是部门节点
|
|
288
|
+
return data.id !== this.tenantNodeId && data.nodeType && data.nodeType === 'USER'
|
|
289
|
+
},
|
|
290
|
+
selectWorkgroupUser() {
|
|
291
|
+
// 是否需要显示提示框,默认不显示
|
|
292
|
+
var showTip = false
|
|
293
|
+
if (this.multiple) {
|
|
294
|
+
// 选中的用户结果
|
|
295
|
+
var selectNodeInfo = {
|
|
296
|
+
userIds: [],
|
|
297
|
+
userNames: [],
|
|
298
|
+
loginNames: [],
|
|
299
|
+
emails: [],
|
|
300
|
+
telephones: [],
|
|
301
|
+
users: []
|
|
302
|
+
}
|
|
303
|
+
var parentIds = []
|
|
304
|
+
|
|
305
|
+
var nodes = this.$refs.workgroupUserTree.getCheckedNodes()
|
|
306
|
+
if (nodes) {
|
|
307
|
+
if (nodes.length === 0) {
|
|
308
|
+
// 没有选择任何节点
|
|
309
|
+
showTip = true
|
|
310
|
+
} else {
|
|
311
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
312
|
+
var node = nodes[i]
|
|
313
|
+
if (this.isSelectTenantNode(node.id)) {
|
|
314
|
+
// 表示选择了所有工作组人员
|
|
315
|
+
selectNodeInfo.userIds = []
|
|
316
|
+
selectNodeInfo.userNames = []
|
|
317
|
+
selectNodeInfo.userIds.push(node.id)
|
|
318
|
+
selectNodeInfo.userNames.push('所有工作组人员')
|
|
319
|
+
break
|
|
320
|
+
} else if (node.id !== this.tenantNodeId) {
|
|
321
|
+
// 不是公司根节点
|
|
322
|
+
if (node.leaf) {
|
|
323
|
+
// 如果是叶子节点
|
|
324
|
+
if (this.isUserNode(node)) {
|
|
325
|
+
const user = JSON.parse(node.data)
|
|
326
|
+
this.addSelectedUserInfo(selectNodeInfo, user)
|
|
327
|
+
}
|
|
328
|
+
} else {
|
|
329
|
+
// 表示是工作组节点,且该节点下存在用户
|
|
330
|
+
const userDatas = node.children
|
|
331
|
+
if (userDatas && userDatas.length > 0) {
|
|
332
|
+
// 表示已展开过该工作组
|
|
333
|
+
userDatas.forEach(userData => {
|
|
334
|
+
const user = JSON.parse(userData.data)
|
|
335
|
+
this.addSelectedUserInfo(selectNodeInfo, user)
|
|
336
|
+
})
|
|
337
|
+
} else {
|
|
338
|
+
// 表示没有展开过该节点,需要去后台获得该工作组下的人员信息
|
|
339
|
+
parentIds.push(node.id)
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
if (parentIds.length > 0) {
|
|
345
|
+
// 表示选中的工作组节点未展开过,则需要去后台查询获得这些工作组下的人员集合
|
|
346
|
+
this.getAllSelectedWorkgroupUsers(parentIds, selectNodeInfo)
|
|
347
|
+
showTip = false
|
|
348
|
+
} else {
|
|
349
|
+
if (selectNodeInfo.userIds.length > 0) {
|
|
350
|
+
this.$emit('result', selectNodeInfo)
|
|
351
|
+
} else {
|
|
352
|
+
showTip = true
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
} else {
|
|
357
|
+
showTip = true
|
|
358
|
+
}
|
|
359
|
+
} else {
|
|
360
|
+
const data = this.$refs.workgroupUserTree.getCurrentNode()
|
|
361
|
+
if (data && data !== null) {
|
|
362
|
+
this.selectSingleNode(data, true)
|
|
363
|
+
} else {
|
|
364
|
+
showTip = true
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
if (showTip) {
|
|
369
|
+
this.$alert(this.$t('imatrixUIMessage.pleaseSelectPersonnel'), this.$t('imatrixUIMessage.tips'), {
|
|
370
|
+
confirmButtonText: this.$t('imatrixUIPublicModel.sure')
|
|
371
|
+
})
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
// 是否选中了公司节点
|
|
375
|
+
isSelectTenantNode(dataId) {
|
|
376
|
+
return dataId === this.tenantNodeId && (!this.branchInfo || this.branchInfo.length === 0)
|
|
377
|
+
},
|
|
378
|
+
// 将选中的部门节点添加到结果集合中
|
|
379
|
+
addSelectedUserInfo(result, user) {
|
|
380
|
+
const filterResult = result.userIds.filter(this.filterUserNode(user))
|
|
381
|
+
if (filterResult.length === 0) {
|
|
382
|
+
let name = user.name
|
|
383
|
+
if (user.enName && user.enName !== '') {
|
|
384
|
+
name = name + '(' + user.enName + ')'
|
|
385
|
+
}
|
|
386
|
+
// if (this.containBranch && user.subCompanyName) {
|
|
387
|
+
// // 如果包含分支机构,则拼接分支机构名称
|
|
388
|
+
// name = name + '(' + user.subCompanyName + ')'
|
|
389
|
+
// }
|
|
390
|
+
user.tenantCode = this.tenantInfo.code
|
|
391
|
+
user.tenantName = this.tenantInfo.tenantName
|
|
392
|
+
result.containBranch = this.containBranch
|
|
393
|
+
result.users.push(user)
|
|
394
|
+
result.userIds.push(user.id)
|
|
395
|
+
result.loginNames.push(user.loginName)
|
|
396
|
+
result.userNames.push(name)
|
|
397
|
+
result.emails.push(user.email)
|
|
398
|
+
result.telephones.push(user.telephone)
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
filterUserNode(queryUser) {
|
|
402
|
+
return (userId) => {
|
|
403
|
+
return (userId === queryUser.id)
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
// 给节点添加自定义图标
|
|
407
|
+
renderContent(h, { node, data, store }) {
|
|
408
|
+
var className
|
|
409
|
+
if (node.data.id === -1) {
|
|
410
|
+
// node.id ===-1表示公司节点,node.branch表示是分支机构节点
|
|
411
|
+
className = 'el-icon-menu'
|
|
412
|
+
} else {
|
|
413
|
+
// 表示是工作组节点
|
|
414
|
+
className = 'el-icon-date'
|
|
415
|
+
}
|
|
416
|
+
if (data.nodeType && data.nodeType === 'USER' &&
|
|
417
|
+
this.searchValue && this.filterUserVal(data, this.searchValue)) {
|
|
418
|
+
// 如果是查询条件
|
|
419
|
+
return (
|
|
420
|
+
<span>
|
|
421
|
+
<i class={className}></i>
|
|
422
|
+
<span class='searchResult' title={node.label}>{node.label}</span>
|
|
423
|
+
</span>
|
|
424
|
+
)
|
|
425
|
+
}
|
|
426
|
+
return (
|
|
427
|
+
<span>
|
|
428
|
+
<i class={className}></i>
|
|
429
|
+
<span title={node.label}>{node.label}</span>
|
|
430
|
+
</span>
|
|
431
|
+
)
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
</script>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-date-picker
|
|
4
|
+
v-model="value[0]"
|
|
5
|
+
style="width:47%"
|
|
6
|
+
value-format="yyyy"
|
|
7
|
+
type="year"
|
|
8
|
+
:placeholder="$t('imatrixUIMessage.selectYear')"
|
|
9
|
+
@change="changeStart"
|
|
10
|
+
/>
|
|
11
|
+
-
|
|
12
|
+
<el-date-picker
|
|
13
|
+
v-model="value[1]"
|
|
14
|
+
style="width:47%"
|
|
15
|
+
value-format="yyyy"
|
|
16
|
+
type="year"
|
|
17
|
+
:placeholder="$t('imatrixUIMessage.selectYear')"
|
|
18
|
+
@change="changeEnd"
|
|
19
|
+
/>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
<script>
|
|
23
|
+
export default {
|
|
24
|
+
name: 'YearRangePicker',
|
|
25
|
+
props: {
|
|
26
|
+
value: {
|
|
27
|
+
type: Array,
|
|
28
|
+
default: () => {
|
|
29
|
+
return []
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
data() {
|
|
34
|
+
return {
|
|
35
|
+
yearStart: '',
|
|
36
|
+
yearEnd: ''
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
methods: {
|
|
40
|
+
changeStart(value) {
|
|
41
|
+
this.value[0] = value
|
|
42
|
+
this.$emit('change', this.value)
|
|
43
|
+
},
|
|
44
|
+
changeEnd(value) {
|
|
45
|
+
this.value[1] = value
|
|
46
|
+
this.$emit('change', this.value)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
</script>
|