agilebuilder-ui 1.1.41 → 1.1.42-sit1

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.
Files changed (31) hide show
  1. package/lib/{401-deb6f978.js → 401-5c692db3.js} +1 -1
  2. package/lib/{404-ca0b33ee.js → 404-bcdb3ce5.js} +1 -1
  3. package/lib/{iframe-page-eb39ba95.js → iframe-page-c8073fc1.js} +1 -1
  4. package/lib/{index-a36c91b2.js → index-fa4b5a84.js} +4882 -4825
  5. package/lib/super-ui.css +1 -1
  6. package/lib/super-ui.js +1 -1
  7. package/lib/super-ui.umd.cjs +85 -85
  8. package/lib/{tab-content-iframe-index-094835e7.js → tab-content-iframe-index-2be5c19e.js} +1 -1
  9. package/lib/{tab-content-index-92b24462.js → tab-content-index-69988e2f.js} +1 -1
  10. package/lib/{tache-subprocess-history-0d32337a.js → tache-subprocess-history-9889b788.js} +1 -1
  11. package/package.json +1 -1
  12. package/packages/fs-preview/src/fs-preview.vue +38 -29
  13. package/packages/fs-upload-new/src/fs-button-upload.vue +34 -1
  14. package/packages/fs-upload-new/src/fs-drag-upload.vue +43 -2
  15. package/packages/fs-upload-new/src/fs-preview-new.vue +6 -4
  16. package/packages/super-grid/src/custom-formatter.js +16 -10
  17. package/packages/super-grid/src/dynamic-input.vue +8 -3
  18. package/packages/super-grid/src/normal-column-content.vue +1 -0
  19. package/packages/super-grid/src/normal-column.vue +8 -4
  20. package/packages/super-grid/src/row-operation.vue +13 -9
  21. package/packages/super-grid/src/search-form-advancedQuery.vue +1 -1
  22. package/packages/super-grid/src/search-form-item.vue +23 -23
  23. package/packages/super-grid/src/search-form-open.vue +164 -158
  24. package/packages/super-grid/src/super-grid-service.js +141 -153
  25. package/packages/super-grid/src/super-grid.vue +43 -14
  26. package/packages/super-nine-grid/src/search-form.vue +469 -659
  27. package/packages/super-nine-grid/src/super-nine-grid.vue +1 -1
  28. package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +515 -539
  29. package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +24 -44
  30. package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +626 -665
  31. package/src/utils/permission.js +86 -9
@@ -1,85 +1,84 @@
1
1
  <template>
2
- <div>
3
- <el-container style="height: 395px">
4
- <el-aside width="430px">
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
- :fetch-suggestions="querySearch"
10
- :placeholder="$t('departmentUserTree.pleaseEnterUserInformation')"
11
- :trigger-on-focus="false"
12
- class="inline-input inline-input-custom"
13
- select-when-unmatched
14
- size="default"
15
- @select="handleSelect"
16
- @keyup.enter="clickSearch"
17
- >
18
- <template v-slot:append>
19
- <el-button :icon="ElIconSearch" @click="clickSearch"/>
20
- </template>
21
- </el-autocomplete>
22
- </el-header>
23
- <el-main style="padding: 10px">
24
- <div
25
- v-if="!searchValue"
26
- style="
27
- padding-top: 5px;
28
- overflow: auto;
29
- width: auto;
30
- display: inline-block !important;
31
- "
32
- >
33
- <el-tree
34
- ref="workgroupUserTree"
35
- :filter-node-method="filterNode"
36
- :load="loadNode"
37
- :props="defaultProps"
38
- :show-checkbox="multiple"
39
- lazy
40
- node-key="nodeId"
41
- @check="handleCheckNode"
42
- @node-click="handleNodeClick"
43
- >
44
- <template #default="{ node, data }">
45
- <span>
46
- <el-icon>
47
- <Menu v-if="node.data.id === -1"/>
48
- <Calendar v-else/>
49
- </el-icon>
50
- <span :class="data.nodeType && data.nodeType === 'USER' && searchValue && filterUserVal(data, searchValue)?'searchResult': '' " :title="node.label">
51
- {{ node.label }}
52
- </span>
53
- </span>
54
- </template>
55
- </el-tree>
56
- </div>
57
- <div
58
- v-if="searchValue && searchValue.length > 0"
59
- style="height: 100%; overflow: hidden"
60
- >
61
- <workgroup-user-result
62
- ref="workgroupUserResult"
63
- :grid-data="searchResult"
64
- :height="height"
65
- :is-search-result="true"
66
- :multiple="multiple"
67
- :select-result="selectResult"
68
- @addWorkgroupUser="addWorkgroupUser"
69
- @resultRowDblclick="resultRowDblclick"
70
- @selectResult="getSelectWorkgroupUser"
71
- />
72
- </div>
73
- </el-main>
74
- </el-container>
75
- </el-aside>
76
- <el-container v-if="multiple">
77
- <el-aside width="2px">
78
- <table
79
- border="1px"
80
- cellpadding="0"
81
- cellspacing="0"
82
- style="
2
+ <div>
3
+ <el-container style="height: 395px">
4
+ <el-aside width="430px">
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
+ :fetch-suggestions="querySearch"
10
+ :placeholder="$t('departmentUserTree.pleaseEnterUserInformation')"
11
+ :trigger-on-focus="false"
12
+ class="inline-input inline-input-custom"
13
+ select-when-unmatched
14
+ size="default"
15
+ @select="handleSelect"
16
+ @keyup.enter="clickSearch"
17
+ >
18
+ <template v-slot:append>
19
+ <el-button :icon="ElIconSearch" @click="clickSearch" />
20
+ </template>
21
+ </el-autocomplete>
22
+ </el-header>
23
+ <el-main style="padding: 10px">
24
+ <div
25
+ v-if="!searchValue"
26
+ style="padding-top: 5px; overflow: auto; width: auto; display: inline-block !important"
27
+ >
28
+ <el-tree
29
+ ref="workgroupUserTree"
30
+ :filter-node-method="filterNode"
31
+ :load="loadNode"
32
+ :props="defaultProps"
33
+ :show-checkbox="multiple"
34
+ lazy
35
+ node-key="nodeId"
36
+ @check="handleCheckNode"
37
+ @node-click="handleNodeClick"
38
+ >
39
+ <template #default="{ node, data }">
40
+ <span>
41
+ <el-icon>
42
+ <Menu v-if="node.data.id === -1" />
43
+ <Calendar v-else />
44
+ </el-icon>
45
+ <span
46
+ :class="
47
+ data.nodeType && data.nodeType === 'USER' && searchValue && filterUserVal(data, searchValue)
48
+ ? 'searchResult'
49
+ : ''
50
+ "
51
+ :title="node.label"
52
+ >
53
+ {{ node.label }}
54
+ </span>
55
+ </span>
56
+ </template>
57
+ </el-tree>
58
+ </div>
59
+ <div v-if="searchValue && searchValue.length > 0" style="height: 100%; overflow: hidden">
60
+ <workgroup-user-result
61
+ ref="workgroupUserResult"
62
+ :grid-data="searchResult"
63
+ :height="height"
64
+ :is-search-result="true"
65
+ :multiple="multiple"
66
+ :select-result="selectResult"
67
+ @addWorkgroupUser="addWorkgroupUser"
68
+ @resultRowDblclick="resultRowDblclick"
69
+ @selectResult="getSelectWorkgroupUser"
70
+ />
71
+ </div>
72
+ </el-main>
73
+ </el-container>
74
+ </el-aside>
75
+ <el-container v-if="multiple">
76
+ <el-aside width="2px">
77
+ <table
78
+ border="1px"
79
+ cellpadding="0"
80
+ cellspacing="0"
81
+ style="
83
82
  height: 100%;
84
83
  border-left-style: solid;
85
84
  border-bottom-style: none;
@@ -87,606 +86,568 @@
87
86
  border-top-style: none;
88
87
  border-left-color: #cccccc;
89
88
  "
90
- />
91
- </el-aside>
92
- <el-main style="padding: 10px">
93
- <div style="text-align: left; font-size: 16px">
94
- {{ $t('departmentUserTree.selectedPeople') }}::
95
- </div>
96
- <div :style="'padding-top: 5px;height:90%;overflow: hidden;'">
97
- <workgroup-user-result
98
- :grid-data="selectResult"
99
- :height="height"
100
- :is-search-result="false"
101
- :multiple="multiple"
102
- @removeWorkgroupUser="removeWorkgroupUser"
103
- @resultRowDblclick="resultRowDblclick"
104
- @selectResult="getSelectWorkgroupUser"
105
- />
106
- </div>
107
- </el-main>
108
- </el-container>
109
- </el-container>
110
- </div>
89
+ />
90
+ </el-aside>
91
+ <el-main style="padding: 10px">
92
+ <div style="text-align: left; font-size: 16px">{{ $t('departmentUserTree.selectedPeople') }}::</div>
93
+ <div :style="'padding-top: 5px;height:90%;overflow: hidden;'">
94
+ <workgroup-user-result
95
+ :grid-data="selectResult"
96
+ :height="height"
97
+ :is-search-result="false"
98
+ :multiple="multiple"
99
+ @removeWorkgroupUser="removeWorkgroupUser"
100
+ @resultRowDblclick="resultRowDblclick"
101
+ @selectResult="getSelectWorkgroupUser"
102
+ />
103
+ </div>
104
+ </el-main>
105
+ </el-container>
106
+ </el-container>
107
+ </div>
111
108
  </template>
112
109
 
113
110
  <script>
114
- import {Search as ElIconSearch} from '@element-plus/icons-vue'
115
- import {$emit} from '../../utils/gogocodeTransfer'
111
+ import { Search as ElIconSearch } from '@element-plus/icons-vue'
112
+ import { $emit } from '../../utils/gogocodeTransfer'
116
113
  import localStorage from '../../../src/utils/local-storage'
117
114
  import utils from '../../utils/utils'
118
115
  import workgroupTreeInlineService from './workgroup-tree-inline-service'
119
116
  import WorkgroupUserResult from './search-result.vue'
120
117
 
121
118
  export default {
122
- data() {
123
- return {
124
- filterText: '',
125
- defaultProps: {
126
- id: 'id',
127
- label: 'name',
128
- children: 'children',
129
- isLeaf: 'leaf',
130
- },
131
- searchParam: {
132
- userField: null,
133
- searchValue: null,
134
- treeType: 'MAN_GROUP_TREE',
135
- departmentInfo: null,
136
- },
137
- // 当前租户内是否包含分支机构。获得当前选中部门名称时,如果有分支,则需要将分支名称返回给用户,例如:部门1(分支1)
138
- containBranch: false,
139
- // 公司节点的id
140
- tenantNodeId: -1,
141
- // 用于保存所有查询出的节点id
142
- allSearchNodeIds: [],
143
- // 用于保存allSearchNodeIds中所有已加载子节点的id集合
144
- allExpandNodeIds: [],
145
- isClickNode: false,
146
- // 查询的备选值
147
- restaurants: [],
148
- // 查询条件
149
- searchValue: null,
150
- // 工作组的查询结果
151
- searchResult: [],
152
- // 工作组的选中结果
153
- selectResult: [],
154
- searchStoreKey: 'searchWorkgroupUser',
155
- // 单选时,选择的用户信息
156
- selectNodeInfo: null,
157
- // 公司根节点信息
158
- tenantInfo: {},
159
- ElIconSearch,
160
- }
161
- },
162
- name: 'InlineWorkgroupUserTree',
163
- components: {
164
- WorkgroupUserResult,
165
- },
166
- props: {
167
- // 是否是多选树,默认是true
168
- multiple: {
169
- type: Boolean,
170
- default: true,
171
- },
172
- // 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
173
- branchInfo: {
174
- type: Array,
175
- default: null,
176
- },
177
- // 多选用户树时,已选择用户id或登录名集合,多个之间以逗号隔开
178
- selectUserInfo: {
179
- type: [String, Number],
180
- default: null,
181
- },
182
- // 移除用户时,用户属性名称:id、loginName、email、telephone,默认是loginName
183
- searchField: {
184
- type: String,
185
- default: 'loginName',
186
- },
187
- // 多选树时结果之间的分隔符,默认是逗号分隔
188
- separator: {
189
- type: String,
190
- default: ',',
191
- },
192
- },
193
- computed: {},
194
- watch: {
195
- filterText(val) {
196
- if (!val) {
197
- this.searchValue = val
198
- // 清空查询内容时,重新加载整个树
199
- this.loadWorkgroup(this.tenantNodeId, this.tenantNodeId + '')
200
- }
201
- },
202
- },
203
- created() {
204
- if(this.multiple){
205
- this.initSelectUsers(
206
- this.searchField,
207
- this.selectUserInfo,
208
- this.separator
209
- ).then((users) => {
210
- if (users) {
211
- this.selectResult = users
212
- }
213
- })
214
- }
215
- },
216
- mounted() {
217
- var searchWorkgroup = localStorage.getObject(this.searchStoreKey)
218
- if (searchWorkgroup) {
219
- this.restaurants = searchWorkgroup
220
- } else {
221
- this.restaurants = []
222
- }
223
- },
224
- methods: {
225
- ...utils,
226
- ...workgroupTreeInlineService,
227
- // 将查询结果中指定工作组添加到已选择工作组集合中
228
- addWorkgroupUser(index, workgroup) {
229
- const containWorkgroups = this.selectResult.filter(
230
- this.filterWorkgroup(workgroup)
231
- )
232
- if (containWorkgroups && containWorkgroups.length === 0) {
233
- this.selectResult.push(workgroup)
234
- }
235
- },
236
- filterWorkgroup(queryWorkgroup) {
237
- return (workgroup) => {
238
- return workgroup.id === queryWorkgroup.id
239
- }
240
- },
241
- removeWorkgroupUser(index, workgroup) {
242
- if (this.$refs.workgroupUserTree) {
243
- // 通过查询结果添加的工作组,在返回到组织结构树时,也选中了该工作组,在移除该工作组时,需要去掉复选框的选中状态
244
- const checkedKeys = this.$refs.workgroupUserTree.getCheckedKeys()
245
- const currentCheckedWorkgroupNodeIds = checkedKeys.filter(
246
- this.filterUserNode(workgroup)
247
- )
248
- if (currentCheckedWorkgroupNodeIds.length > 0) {
249
- // 表示当前工作组是选中的状态,需要去掉
250
- currentCheckedWorkgroupNodeIds.forEach((workgroupNodeId) => {
251
- this.$refs.workgroupUserTree.setChecked(workgroupNodeId, false)
252
- })
253
- }
254
- }
255
- this.selectResult = this.removeRow(this.selectResult, workgroup)
256
- if (!this.selectResult || this.selectResult.length === 0) {
257
- // 已选结果面板没有内容,则左侧树节点也不要有选中节点了
258
- if (this.$refs.workgroupUserTree) {
259
- this.$refs.workgroupUserTree.setCheckedKeys([])
260
- }
261
- }
262
- },
263
- getSelectWorkgroupUser(workgroup) {
264
- this.packageSelectResult(workgroup)
265
- },
266
- resultRowDblclick(workgroup) {
267
- this.packageSelectResult(workgroup)
268
- $emit(this, 'result', this.selectNodeInfo)
269
- },
270
- packageSelectResult(user) {
271
- user.tenantCode = this.tenantInfo.code
272
- user.tenantName = this.tenantInfo.tenantName
273
- let name = user.name
274
- if (user.enName && user.enName.trim() !== '') {
275
- name = name + '(' + user.enName + ')'
276
- }
277
- const selectNodeInfo = {
278
- id: user.id,
279
- name: name,
280
- loginName: user.loginName,
281
- email: user.email,
282
- telephone: user.telephone,
283
- containBranch: this.containBranch,
284
- user: user,
285
- enName: user.enName,
286
- subCompanyName: user.subCompanyName,
287
- }
288
- // 表示是勾选单选按钮或 选中树节点
289
- this.selectNodeInfo = selectNodeInfo
290
- },
291
- handleSelect(item) {
292
- this.handleSelectUtil(item, localStorage)
293
- },
294
- search(value) {
295
- this.searchValue = value
296
- // let mySearchValue = value
297
- // if (mySearchValue) {
298
- // mySearchValue = mySearchValue.trim()
299
- // }
300
- // this.searchParam.searchValue = mySearchValue
301
- // this.searchParam.departmentInfo = this.branchInfo
302
- // // this.searchParam.userField = this.searchField
303
- // // 后台查询部门,并拼接树节点
304
- // this.filterAppendNodes(value)
305
- this.$refs.workgroupUserTree.filter(value)
306
- },
307
- // 点击查询按钮调用的方法
308
- clickSearch() {
309
- this.storeSeachValue(localStorage, this.searchStoreKey, this.filterText)
310
- this.search(this.filterText)
311
- },
312
- filterNode(value, data, node) {
313
- if (!value) {
314
- return true
315
- } else {
316
- if (data.nodeType && data.nodeType === 'USER') {
317
- // data.data是用户的所有数据
318
- const user = JSON.parse(data.data)
319
- return this.filterUserVal(user, value)
320
- } else {
321
- // 表示不是用户节点
322
- return false
323
- }
324
- }
325
- },
326
- filterUserVal(user, searchVal) {
327
- const searchFields = [
328
- 'name',
329
- 'loginName',
330
- 'email',
331
- 'telephone',
332
- 'jobNumber',
333
- 'honorificName',
334
- ]
335
- let isHasVal = false
336
- for (let i = 0; i < searchFields.length; i++) {
337
- const searchField = searchFields[i]
338
- const userValue = user[searchField]
339
- if (
340
- userValue.indexOf(searchVal) !== -1 ||
341
- (searchField === 'name' &&
342
- user['enName'] &&
343
- user['enName'].indexOf(searchVal) !== -1)
344
- ) {
345
- isHasVal = true
346
- } else {
347
- isHasVal = false
348
- break
349
- }
350
- }
351
- return isHasVal
352
- },
353
- // 点击复选框时处理
354
- handleCheckNode(data, checkObj) {
355
- if (checkObj.checkedKeys.indexOf(data.nodeId) > -1) {
356
- // 表示正选中data节点
357
- this.checkedNode(data, false)
358
- } else {
359
- // 表示正取消选中data节点,同时要取消其子节点的选中状态
360
- this.cancelCheckedNode(data)
361
- }
362
- },
363
- // 选中当前节点及其子节点
364
- checkedNodeAndChildren(data) {
365
- // 取消选中状态时,保持节点是展开的状态,不要折叠
366
- this.$refs.workgroupUserTree.store.nodesMap[data.nodeId].expanded = true
367
- // 获得所有应该选中的节点
368
- this.$refs.workgroupUserTree.setChecked(data.nodeId, true)
369
- const children = data.children
370
- if (children) {
371
- // 递归设置子子节点的选中状态
372
- children.forEach((nodeData) => {
373
- this.checkedNodeAndChildren(nodeData)
374
- this.selectResult.push(JSON.parse(nodeData.data))
375
- })
376
- }
377
- },
378
- // 取消节点选中状态时
379
- cancelCheckedNode(data) {
380
- if (data.id === this.tenantNodeId) {
381
- // 表示取消公司节点的选中状态,即取消所有节点的勾选状态
382
- this.$refs.workgroupUserTree.setCheckedKeys([])
383
- } else if (data.nodeType && data.nodeType === 'WORKGROUP') {
384
- this.cancelCheckedUserNodesWithWorkgroup(data)
385
- } else {
386
- this.selectResult = this.removeRow(
387
- this.selectResult,
388
- JSON.parse(data.data)
389
- )
390
- }
391
- },
392
- // 选中了根节点公司节点时,选中所有工作组
393
- checkedAllWorkgroups(root) {
394
- const children = root.children
395
- if (children) {
396
- children.forEach((workgroupNode) => {
397
- this.$refs.workgroupUserTree.setChecked(workgroupNode.nodeId, true)
398
- })
399
- }
400
- },
401
- // 取消指定工作组下的用户节点的选中状态
402
- cancelCheckedUserNodesWithWorkgroup(workgroupData) {
403
- const children = workgroupData.children
404
- if (children) {
405
- children.forEach((userNode) => {
406
- this.$refs.workgroupUserTree.setChecked(userNode.nodeId, false)
407
- this.selectResult = this.removeRow(
408
- this.selectResult,
409
- JSON.parse(userNode.data)
410
- )
411
- })
412
- }
413
- },
414
- handleNodeClick(data, node, nodeTree) {
415
- if (this.multiple) {
416
- // 多选部门树时,处理点击节点事件
417
- this.clickNodeWhenMultiple(data)
418
- }
419
- this.selectSingleNode(data, false)
420
- },
421
- selectSingleNode(data, isClickOkBtn) {
422
- if (this.isUserNode(data) && !this.multiple) {
423
- // 点击的是工作组节点,并且是单选树时,点击部门节点直接关闭弹框
424
- const user = JSON.parse(data.data)
425
- user.tenantCode = this.tenantInfo.code
426
- user.tenantName = this.tenantInfo.tenantName
427
- let name = user.name
428
- if (user.enName && user.enName.trim() !== '') {
429
- name = name + '(' + user.enName + ')'
430
- }
431
- const selectNodeInfo = {
432
- id: user.id,
433
- name: name,
434
- loginName: user.loginName,
435
- email: user.email,
436
- telephone: user.telephone,
437
- containBranch: this.containBranch,
438
- user: user,
439
- enName: user.enName,
440
- subCompanyName: user.subCompanyName,
441
- }
442
- this.selectNodeInfo = selectNodeInfo
443
- if (isClickOkBtn === true) {
444
- // 点击确定按钮时才需要调result回调事件,关闭弹框
445
- $emit(this, 'result', selectNodeInfo)
446
- console.log('3=====setSelectNodeInfo=====', selectNodeInfo)
447
- }
448
- }
449
- },
450
- // 多选树时,点击节点处理复选框的选中状态
451
- clickNodeWhenMultiple(data) {
452
- var checkedKeys = []
453
- if (this.$refs.workgroupUserTree) {
454
- checkedKeys = this.$refs.workgroupUserTree.getCheckedKeys()
455
- }
456
- // 取消选中状态时,保持节点是展开的状态,不要折叠
457
- this.$refs.workgroupUserTree.store.nodesMap[data.nodeId].expanded = true
458
- if (checkedKeys.indexOf(data.nodeId) > -1) {
459
- // 表示当前节点是选中状态,则需要取消其选中状态
460
- // 取消当前节点的勾选状态
461
- this.$refs.workgroupUserTree.setChecked(data.nodeId, false)
462
- this.cancelCheckedNode(data)
463
- } else {
464
- // 表示当前节点不是选中的状态,需要勾选该节点
465
- this.$refs.workgroupUserTree.setChecked(data.nodeId, true)
466
- this.checkedNode(data, true)
467
- }
468
- },
469
- isUserNode(data) {
470
- // 当前节点不是公司节点,也不是分支机构节点,表示是部门节点
471
- return (
472
- data.id !== this.tenantNodeId &&
473
- data.nodeType &&
474
- data.nodeType === 'USER'
475
- )
476
- },
477
- singleSetValue() {
478
- let showTip = false
479
- if (this.searchValue) {
480
- console.log('this.selectNodeInfo', this.selectNodeInfo)
481
- if (this.selectNodeInfo) {
482
- $emit(this, 'result', this.selectNodeInfo)
483
- } else {
484
- showTip = true
485
- }
486
- } else {
487
- const data = this.$refs.workgroupUserTree.getCurrentNode()
488
- if (data && data !== null && this.isUserNode(data)) {
489
- this.selectSingleNode(data, true)
490
- } else {
491
- showTip = true
492
- }
493
- }
494
- this.showTip(showTip)
495
- },
496
- multipleSetValue() {
497
- let showTip = false
498
- // 选中的用户结果
499
- var selectNodeInfo = {
500
- userIds: [],
501
- userNames: [],
502
- loginNames: [],
503
- emails: [],
504
- telephones: [],
505
- users: [],
506
- }
507
- if (this.searchValue) {
508
- if (this.selectResult.length > 0) {
509
- this.selectResult.forEach((workgroupData) => {
510
- this.addSelectedUserInfo(selectNodeInfo, workgroupData)
511
- })
512
- $emit(this, 'result', selectNodeInfo)
513
- } else {
514
- showTip = true
515
- }
516
- } else {
517
- var parentIds = []
518
- var nodes = this.$refs.workgroupUserTree.getCheckedNodes()
519
- if (nodes) {
520
- if (nodes.length === 0) {
521
- // 没有选择任何节点
522
- showTip = true
523
- } else {
524
- for (var i = 0; i < nodes.length; i++) {
525
- var node = nodes[i]
526
- if (this.isSelectTenantNode(node.id)) {
527
- // 表示选择了所有工作组人员
528
- selectNodeInfo.userIds = []
529
- selectNodeInfo.userNames = []
530
- selectNodeInfo.userIds.push(node.id)
531
- selectNodeInfo.userNames.push('所有工作组人员')
532
- break
533
- } else if (node.id !== this.tenantNodeId) {
534
- // 不是公司根节点
535
- if (node.leaf) {
536
- // 如果是叶子节点
537
- if (this.isUserNode(node)) {
538
- const user = JSON.parse(node.data)
539
- this.addSelectedUserInfo(selectNodeInfo, user)
540
- }
541
- } else {
542
- // 表示是工作组节点,且该节点下存在用户
543
- const userDatas = node.children
544
- if (userDatas && userDatas.length > 0) {
545
- // 表示已展开过该工作组
546
- userDatas.forEach((userData) => {
547
- const user = JSON.parse(userData.data)
548
- this.addSelectedUserInfo(selectNodeInfo, user)
549
- })
550
- } else {
551
- // 表示没有展开过该节点,需要去后台获得该工作组下的人员信息
552
- parentIds.push(node.id)
553
- }
554
- }
555
- }
556
- }
557
- if (parentIds.length > 0) {
558
- // 表示选中的工作组节点未展开过,则需要去后台查询获得这些工作组下的人员集合
559
- this.getAllSelectedWorkgroupUsers(parentIds, selectNodeInfo)
560
- showTip = false
561
- } else {
562
- if (selectNodeInfo.userIds.length > 0) {
563
- $emit(this, 'result', selectNodeInfo)
564
- console.log('1=====setSelectNodeInfo=====', selectNodeInfo)
565
- } else {
566
- showTip = true
567
- }
568
- }
569
- }
570
- } else {
571
- showTip = true
572
- }
573
- }
574
- this.showTip(showTip)
575
- },
576
- showTip(showTip) {
577
- // 是否需要显示提示框,默认不显示
578
- if (showTip) {
579
- this.$alert(
580
- this.$t('imatrixUIMessage.pleaseSelectPersonnel'),
581
- this.$t('imatrixUIMessage.tips'),
582
- {
583
- confirmButtonText: this.$t('imatrixUIPublicModel.sure'),
584
- }
585
- )
586
- }
587
- },
588
- selectWorkgroupUser() {
589
- if (this.multiple) {
590
- this.multipleSetValue()
591
- } else {
592
- this.singleSetValue()
593
- }
594
- },
595
- // 是否选中了公司节点
596
- isSelectTenantNode(dataId) {
597
- return (
598
- dataId === this.tenantNodeId &&
599
- (!this.branchInfo || this.branchInfo.length === 0)
600
- )
601
- },
602
- // 将选中的部门节点添加到结果集合中
603
- addSelectedUserInfo(result, user) {
604
- const filterResult = result.userIds.filter(this.filterUserId(user))
605
- if (filterResult.length === 0) {
606
- let name = user.name
607
- if (user.enName && user.enName !== '') {
608
- name = name + '(' + user.enName + ')'
609
- }
610
- // if (this.containBranch && user.subCompanyName) {
611
- // // 如果包含分支机构,则拼接分支机构名称
612
- // name = name + '' + user.subCompanyName + ')'
613
- // }
614
- user.tenantCode = this.tenantInfo.code
615
- user.tenantName = this.tenantInfo.tenantName
616
- result.containBranch = this.containBranch
617
- result.users.push(user)
618
- result.userIds.push(user.id)
619
- result.loginNames.push(user.loginName)
620
- result.userNames.push(name)
621
- result.emails.push(user.email)
622
- result.telephones.push(user.telephone)
623
- }
624
- },
625
- filterUserId(queryWorkgroup) {
626
- return (workgroupNodeId) => {
627
- return workgroupNodeId === queryWorkgroup.id
628
- }
629
- },
630
- filterUserNode(queryUser) {
631
- return (userNodeId) => {
632
- // 用户节点的id的分隔符,USER~departmentId~userId
633
- const nodeIdSeparator = '~'
634
- const userId = userNodeId.substring(
635
- userNodeId.lastIndexOf(nodeIdSeparator) + 1
636
- )
637
- return userId === queryUser.id + ''
638
- }
639
- },
640
- // 给节点添加自定义图标
641
- // renderContent(h, {node, data, store}) {
642
- // var className
643
- // if (node.data.id === -1) {
644
- // // node.id ===-1表示公司节点,node.branch表示是分支机构节点
645
- // className = 'Menu'
646
- // } else {
647
- // // 表示是工作组节点
648
- // className = 'Date'
649
- // }
650
- // if (
651
- // data.nodeType &&
652
- // data.nodeType === 'USER' &&
653
- // this.searchValue &&
654
- // this.filterUserVal(data, this.searchValue)
655
- // ) {
656
- // // 如果是查询条件
657
- // return h(
658
- // 'span',
659
- // h('el-icon', h(className)),
660
- // h('span', {class: searchResult, title: node.label}, node.label)
661
- // )
662
- // // return `<span>
663
- // // <i class={className}></i>
664
- // // <span class="searchResult" title={node.label}>
665
- // // {node.label}
666
- // // </span>
667
- // // </span>`
668
- // }
669
- // return h(
670
- // 'span',
671
- // h('el-icon', h(className)),
672
- // h('span', {title: node.label}, node.label)
673
- // )
674
- // // return `<span>
675
- // // <i class={className}></i>
676
- // // <span title={node.label}>{node.label}</span>
677
- // // </span>`
678
- // },
679
- },
680
- emits: ['result'],
119
+ data() {
120
+ return {
121
+ filterText: '',
122
+ defaultProps: {
123
+ id: 'id',
124
+ label: 'name',
125
+ children: 'children',
126
+ isLeaf: 'leaf'
127
+ },
128
+ searchParam: {
129
+ userField: null,
130
+ searchValue: null,
131
+ treeType: 'MAN_GROUP_TREE',
132
+ departmentInfo: null
133
+ },
134
+ // 当前租户内是否包含分支机构。获得当前选中部门名称时,如果有分支,则需要将分支名称返回给用户,例如:部门1(分支1)
135
+ containBranch: false,
136
+ // 公司节点的id
137
+ tenantNodeId: -1,
138
+ // 用于保存所有查询出的节点id
139
+ allSearchNodeIds: [],
140
+ // 用于保存allSearchNodeIds中所有已加载子节点的id集合
141
+ allExpandNodeIds: [],
142
+ isClickNode: false,
143
+ // 查询的备选值
144
+ restaurants: [],
145
+ // 查询条件
146
+ searchValue: null,
147
+ // 工作组的查询结果
148
+ searchResult: [],
149
+ // 工作组的选中结果
150
+ selectResult: [],
151
+ searchStoreKey: 'searchWorkgroupUser',
152
+ // 单选时,选择的用户信息
153
+ selectNodeInfo: null,
154
+ // 公司根节点信息
155
+ tenantInfo: {},
156
+ ElIconSearch
157
+ }
158
+ },
159
+ name: 'InlineWorkgroupUserTree',
160
+ components: {
161
+ WorkgroupUserResult
162
+ },
163
+ props: {
164
+ // 是否是多选树,默认是true
165
+ multiple: {
166
+ type: Boolean,
167
+ default: true
168
+ },
169
+ // 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
170
+ branchInfo: {
171
+ type: Array,
172
+ default: null
173
+ },
174
+ // 多选用户树时,已选择用户id或登录名集合,多个之间以逗号隔开
175
+ selectUserInfo: {
176
+ type: [String, Number],
177
+ default: null
178
+ },
179
+ // 移除用户时,用户属性名称:id、loginName、email、telephone,默认是loginName
180
+ searchField: {
181
+ type: String,
182
+ default: 'loginName'
183
+ },
184
+ // 多选树时结果之间的分隔符,默认是逗号分隔
185
+ separator: {
186
+ type: String,
187
+ default: ','
188
+ }
189
+ },
190
+ computed: {},
191
+ watch: {
192
+ filterText(val) {
193
+ if (!val) {
194
+ this.searchValue = val
195
+ // 清空查询内容时,重新加载整个树
196
+ this.loadWorkgroup(this.tenantNodeId, this.tenantNodeId + '')
197
+ }
198
+ }
199
+ },
200
+ created() {
201
+ if (this.multiple) {
202
+ this.initSelectUsers(this.searchField, this.selectUserInfo, this.separator).then((users) => {
203
+ if (users) {
204
+ this.selectResult = users
205
+ }
206
+ })
207
+ }
208
+ },
209
+ mounted() {
210
+ var searchWorkgroup = localStorage.getObject(this.searchStoreKey)
211
+ if (searchWorkgroup) {
212
+ this.restaurants = searchWorkgroup
213
+ } else {
214
+ this.restaurants = []
215
+ }
216
+ },
217
+ methods: {
218
+ ...utils,
219
+ ...workgroupTreeInlineService,
220
+ // 将查询结果中指定工作组添加到已选择工作组集合中
221
+ addWorkgroupUser(index, workgroup) {
222
+ const containWorkgroups = this.selectResult.filter(this.filterWorkgroup(workgroup))
223
+ if (containWorkgroups && containWorkgroups.length === 0) {
224
+ this.selectResult.push(workgroup)
225
+ }
226
+ },
227
+ filterWorkgroup(queryWorkgroup) {
228
+ return (workgroup) => {
229
+ return workgroup.id === queryWorkgroup.id
230
+ }
231
+ },
232
+ removeWorkgroupUser(index, workgroup) {
233
+ if (this.$refs.workgroupUserTree) {
234
+ // 通过查询结果添加的工作组,在返回到组织结构树时,也选中了该工作组,在移除该工作组时,需要去掉复选框的选中状态
235
+ const checkedKeys = this.$refs.workgroupUserTree.getCheckedKeys()
236
+ const currentCheckedWorkgroupNodeIds = checkedKeys.filter(this.filterUserNode(workgroup))
237
+ if (currentCheckedWorkgroupNodeIds.length > 0) {
238
+ // 表示当前工作组是选中的状态,需要去掉
239
+ currentCheckedWorkgroupNodeIds.forEach((workgroupNodeId) => {
240
+ this.$refs.workgroupUserTree.setChecked(workgroupNodeId, false)
241
+ })
242
+ }
243
+ }
244
+ this.selectResult = this.removeRow(this.selectResult, workgroup)
245
+ if (!this.selectResult || this.selectResult.length === 0) {
246
+ // 已选结果面板没有内容,则左侧树节点也不要有选中节点了
247
+ if (this.$refs.workgroupUserTree) {
248
+ this.$refs.workgroupUserTree.setCheckedKeys([])
249
+ }
250
+ }
251
+ },
252
+ getSelectWorkgroupUser(workgroup) {
253
+ this.packageSelectResult(workgroup)
254
+ },
255
+ resultRowDblclick(workgroup) {
256
+ this.packageSelectResult(workgroup)
257
+ $emit(this, 'result', this.selectNodeInfo)
258
+ },
259
+ packageSelectResult(user) {
260
+ user.tenantCode = this.tenantInfo.code
261
+ user.tenantName = this.tenantInfo.tenantName
262
+ let name = user.name
263
+ if (user.enName && user.enName.trim() !== '') {
264
+ name = name + '(' + user.enName + ')'
265
+ }
266
+ const selectNodeInfo = {
267
+ id: user.id,
268
+ name: name,
269
+ loginName: user.loginName,
270
+ email: user.email,
271
+ telephone: user.telephone,
272
+ containBranch: this.containBranch,
273
+ user: user,
274
+ enName: user.enName,
275
+ subCompanyName: user.subCompanyName
276
+ }
277
+ // 表示是勾选单选按钮或 选中树节点
278
+ this.selectNodeInfo = selectNodeInfo
279
+ },
280
+ handleSelect(item) {
281
+ this.handleSelectUtil(item, localStorage)
282
+ },
283
+ search(value) {
284
+ this.searchValue = value
285
+ // let mySearchValue = value
286
+ // if (mySearchValue) {
287
+ // mySearchValue = mySearchValue.trim()
288
+ // }
289
+ // this.searchParam.searchValue = mySearchValue
290
+ // this.searchParam.departmentInfo = this.branchInfo
291
+ // // this.searchParam.userField = this.searchField
292
+ // // 后台查询部门,并拼接树节点
293
+ // this.filterAppendNodes(value)
294
+ this.$refs.workgroupUserTree.filter(value)
295
+ },
296
+ // 点击查询按钮调用的方法
297
+ clickSearch() {
298
+ this.storeSeachValue(localStorage, this.searchStoreKey, this.filterText)
299
+ this.search(this.filterText)
300
+ },
301
+ filterNode(value, data, node) {
302
+ if (!value) {
303
+ return true
304
+ } else {
305
+ if (data.nodeType && data.nodeType === 'USER') {
306
+ // data.data是用户的所有数据
307
+ const user = JSON.parse(data.data)
308
+ return this.filterUserVal(user, value)
309
+ } else {
310
+ // 表示不是用户节点
311
+ return false
312
+ }
313
+ }
314
+ },
315
+ filterUserVal(user, searchVal) {
316
+ const searchFields = ['name', 'loginName', 'email', 'telephone', 'jobNumber', 'honorificName']
317
+ let isHasVal = false
318
+ for (let i = 0; i < searchFields.length; i++) {
319
+ const searchField = searchFields[i]
320
+ const userValue = user[searchField]
321
+ if (
322
+ userValue.indexOf(searchVal) !== -1 ||
323
+ (searchField === 'name' && user['enName'] && user['enName'].indexOf(searchVal) !== -1)
324
+ ) {
325
+ isHasVal = true
326
+ } else {
327
+ isHasVal = false
328
+ break
329
+ }
330
+ }
331
+ return isHasVal
332
+ },
333
+ // 点击复选框时处理
334
+ handleCheckNode(data, checkObj) {
335
+ if (checkObj.checkedKeys.indexOf(data.nodeId) > -1) {
336
+ // 表示正选中data节点
337
+ this.checkedNode(data, false)
338
+ } else {
339
+ // 表示正取消选中data节点,同时要取消其子节点的选中状态
340
+ this.cancelCheckedNode(data)
341
+ }
342
+ },
343
+ // 选中当前节点及其子节点
344
+ checkedNodeAndChildren(data) {
345
+ // 取消选中状态时,保持节点是展开的状态,不要折叠
346
+ this.$refs.workgroupUserTree.store.nodesMap[data.nodeId].expanded = true
347
+ // 获得所有应该选中的节点
348
+ this.$refs.workgroupUserTree.setChecked(data.nodeId, true)
349
+ const children = data.children
350
+ if (children) {
351
+ // 递归设置子子节点的选中状态
352
+ children.forEach((nodeData) => {
353
+ this.checkedNodeAndChildren(nodeData)
354
+ this.selectResult.push(JSON.parse(nodeData.data))
355
+ })
356
+ }
357
+ },
358
+ // 取消节点选中状态时
359
+ cancelCheckedNode(data) {
360
+ if (data.id === this.tenantNodeId) {
361
+ // 表示取消公司节点的选中状态,即取消所有节点的勾选状态
362
+ this.$refs.workgroupUserTree.setCheckedKeys([])
363
+ } else if (data.nodeType && data.nodeType === 'WORKGROUP') {
364
+ this.cancelCheckedUserNodesWithWorkgroup(data)
365
+ } else {
366
+ this.selectResult = this.removeRow(this.selectResult, JSON.parse(data.data))
367
+ }
368
+ },
369
+ // 选中了根节点公司节点时,选中所有工作组
370
+ checkedAllWorkgroups(root) {
371
+ const children = root.children
372
+ if (children) {
373
+ children.forEach((workgroupNode) => {
374
+ this.$refs.workgroupUserTree.setChecked(workgroupNode.nodeId, true)
375
+ })
376
+ }
377
+ },
378
+ // 取消指定工作组下的用户节点的选中状态
379
+ cancelCheckedUserNodesWithWorkgroup(workgroupData) {
380
+ const children = workgroupData.children
381
+ if (children) {
382
+ children.forEach((userNode) => {
383
+ this.$refs.workgroupUserTree.setChecked(userNode.nodeId, false)
384
+ this.selectResult = this.removeRow(this.selectResult, JSON.parse(userNode.data))
385
+ })
386
+ }
387
+ },
388
+ handleNodeClick(data, node, nodeTree) {
389
+ if (this.multiple) {
390
+ // 多选部门树时,处理点击节点事件
391
+ this.clickNodeWhenMultiple(data)
392
+ }
393
+ this.selectSingleNode(data, false)
394
+ },
395
+ selectSingleNode(data, isClickOkBtn) {
396
+ if (this.isUserNode(data) && !this.multiple) {
397
+ // 点击的是工作组节点,并且是单选树时,点击部门节点直接关闭弹框
398
+ const user = JSON.parse(data.data)
399
+ user.tenantCode = this.tenantInfo.code
400
+ user.tenantName = this.tenantInfo.tenantName
401
+ let name = user.name
402
+ if (user.enName && user.enName.trim() !== '') {
403
+ name = name + '(' + user.enName + ')'
404
+ }
405
+ const selectNodeInfo = {
406
+ id: user.id,
407
+ name: name,
408
+ loginName: user.loginName,
409
+ email: user.email,
410
+ telephone: user.telephone,
411
+ containBranch: this.containBranch,
412
+ user: user,
413
+ enName: user.enName,
414
+ subCompanyName: user.subCompanyName
415
+ }
416
+ this.selectNodeInfo = selectNodeInfo
417
+ if (isClickOkBtn === true) {
418
+ // 点击确定按钮时才需要调result回调事件,关闭弹框
419
+ $emit(this, 'result', selectNodeInfo)
420
+ console.log('3=====setSelectNodeInfo=====', selectNodeInfo)
421
+ }
422
+ }
423
+ },
424
+ // 多选树时,点击节点处理复选框的选中状态
425
+ clickNodeWhenMultiple(data) {
426
+ var checkedKeys = []
427
+ if (this.$refs.workgroupUserTree) {
428
+ checkedKeys = this.$refs.workgroupUserTree.getCheckedKeys()
429
+ }
430
+ // 取消选中状态时,保持节点是展开的状态,不要折叠
431
+ this.$refs.workgroupUserTree.store.nodesMap[data.nodeId].expanded = true
432
+ if (checkedKeys.indexOf(data.nodeId) > -1) {
433
+ // 表示当前节点是选中状态,则需要取消其选中状态
434
+ // 取消当前节点的勾选状态
435
+ this.$refs.workgroupUserTree.setChecked(data.nodeId, false)
436
+ this.cancelCheckedNode(data)
437
+ } else {
438
+ // 表示当前节点不是选中的状态,需要勾选该节点
439
+ this.$refs.workgroupUserTree.setChecked(data.nodeId, true)
440
+ this.checkedNode(data, true)
441
+ }
442
+ },
443
+ isUserNode(data) {
444
+ // 当前节点不是公司节点,也不是分支机构节点,表示是部门节点
445
+ return data.id !== this.tenantNodeId && data.nodeType && data.nodeType === 'USER'
446
+ },
447
+ singleSetValue() {
448
+ let showTip = false
449
+ if (this.searchValue) {
450
+ console.log('this.selectNodeInfo', this.selectNodeInfo)
451
+ if (this.selectNodeInfo) {
452
+ $emit(this, 'result', this.selectNodeInfo)
453
+ } else {
454
+ showTip = true
455
+ }
456
+ } else {
457
+ const data = this.$refs.workgroupUserTree.getCurrentNode()
458
+ if (data && data !== null && this.isUserNode(data)) {
459
+ this.selectSingleNode(data, true)
460
+ } else {
461
+ showTip = true
462
+ }
463
+ }
464
+ this.showTip(showTip)
465
+ },
466
+ multipleSetValue() {
467
+ let showTip = false
468
+ // 选中的用户结果
469
+ var selectNodeInfo = {
470
+ userIds: [],
471
+ userNames: [],
472
+ loginNames: [],
473
+ emails: [],
474
+ telephones: [],
475
+ users: []
476
+ }
477
+ if (this.searchValue) {
478
+ if (this.selectResult.length > 0) {
479
+ this.selectResult.forEach((workgroupData) => {
480
+ this.addSelectedUserInfo(selectNodeInfo, workgroupData)
481
+ })
482
+ $emit(this, 'result', selectNodeInfo)
483
+ } else {
484
+ showTip = true
485
+ }
486
+ } else {
487
+ var parentIds = []
488
+ var nodes = this.$refs.workgroupUserTree.getCheckedNodes()
489
+ if (nodes) {
490
+ if (nodes.length === 0) {
491
+ // 没有选择任何节点
492
+ showTip = true
493
+ } else {
494
+ for (var i = 0; i < nodes.length; i++) {
495
+ var node = nodes[i]
496
+ if (this.isSelectTenantNode(node.id)) {
497
+ // 表示选择了所有工作组人员
498
+ selectNodeInfo.userIds = []
499
+ selectNodeInfo.userNames = []
500
+ selectNodeInfo.userIds.push(node.id)
501
+ selectNodeInfo.userNames.push('所有工作组人员')
502
+ break
503
+ } else if (node.id !== this.tenantNodeId) {
504
+ // 不是公司根节点
505
+ if (node.leaf) {
506
+ // 如果是叶子节点
507
+ if (this.isUserNode(node)) {
508
+ const user = JSON.parse(node.data)
509
+ this.addSelectedUserInfo(selectNodeInfo, user)
510
+ }
511
+ } else {
512
+ // 表示是工作组节点,且该节点下存在用户
513
+ const userDatas = node.children
514
+ if (userDatas && userDatas.length > 0) {
515
+ // 表示已展开过该工作组
516
+ userDatas.forEach((userData) => {
517
+ const user = JSON.parse(userData.data)
518
+ this.addSelectedUserInfo(selectNodeInfo, user)
519
+ })
520
+ } else {
521
+ // 表示没有展开过该节点,需要去后台获得该工作组下的人员信息
522
+ parentIds.push(node.id)
523
+ }
524
+ }
525
+ }
526
+ }
527
+ if (parentIds.length > 0) {
528
+ // 表示选中的工作组节点未展开过,则需要去后台查询获得这些工作组下的人员集合
529
+ this.getAllSelectedWorkgroupUsers(parentIds, selectNodeInfo)
530
+ showTip = false
531
+ } else {
532
+ if (selectNodeInfo.userIds.length > 0) {
533
+ $emit(this, 'result', selectNodeInfo)
534
+ console.log('1=====setSelectNodeInfo=====', selectNodeInfo)
535
+ } else {
536
+ showTip = true
537
+ }
538
+ }
539
+ }
540
+ } else {
541
+ showTip = true
542
+ }
543
+ }
544
+ this.showTip(showTip)
545
+ },
546
+ showTip(showTip) {
547
+ // 是否需要显示提示框,默认不显示
548
+ if (showTip) {
549
+ this.$alert(this.$t('imatrixUIMessage.pleaseSelectPersonnel'), this.$t('imatrixUIMessage.tips'), {
550
+ confirmButtonText: this.$t('imatrixUIPublicModel.sure')
551
+ })
552
+ }
553
+ },
554
+ selectWorkgroupUser() {
555
+ if (this.multiple) {
556
+ this.multipleSetValue()
557
+ } else {
558
+ this.singleSetValue()
559
+ }
560
+ },
561
+ // 是否选中了公司节点
562
+ isSelectTenantNode(dataId) {
563
+ return dataId === this.tenantNodeId && (!this.branchInfo || this.branchInfo.length === 0)
564
+ },
565
+ // 将选中的部门节点添加到结果集合中
566
+ addSelectedUserInfo(result, user) {
567
+ const filterResult = result.userIds.filter(this.filterUserId(user))
568
+ if (filterResult.length === 0) {
569
+ let name = user.name
570
+ if (user.enName && user.enName !== '') {
571
+ name = name + '(' + user.enName + ')'
572
+ }
573
+ // if (this.containBranch && user.subCompanyName) {
574
+ // // 如果包含分支机构,则拼接分支机构名称
575
+ // name = name + '(' + user.subCompanyName + ')'
576
+ // }
577
+ user.tenantCode = this.tenantInfo.code
578
+ user.tenantName = this.tenantInfo.tenantName
579
+ result.containBranch = this.containBranch
580
+ result.users.push(user)
581
+ result.userIds.push(user.id)
582
+ result.loginNames.push(user.loginName)
583
+ result.userNames.push(name)
584
+ result.emails.push(user.email)
585
+ result.telephones.push(user.telephone)
586
+ }
587
+ },
588
+ filterUserId(queryWorkgroup) {
589
+ return (workgroupNodeId) => {
590
+ return workgroupNodeId === queryWorkgroup.id
591
+ }
592
+ },
593
+ filterUserNode(queryUser) {
594
+ return (userNodeId) => {
595
+ // 用户节点的id的分隔符,USER~departmentId~userId
596
+ const nodeIdSeparator = '~'
597
+ const userId = userNodeId.substring(userNodeId.lastIndexOf(nodeIdSeparator) + 1)
598
+ return userId === queryUser.id + ''
599
+ }
600
+ }
601
+ // 给节点添加自定义图标
602
+ // renderContent(h, {node, data, store}) {
603
+ // var className
604
+ // if (node.data.id === -1) {
605
+ // // node.id ===-1表示公司节点,node.branch表示是分支机构节点
606
+ // className = 'Menu'
607
+ // } else {
608
+ // // 表示是工作组节点
609
+ // className = 'Date'
610
+ // }
611
+ // if (
612
+ // data.nodeType &&
613
+ // data.nodeType === 'USER' &&
614
+ // this.searchValue &&
615
+ // this.filterUserVal(data, this.searchValue)
616
+ // ) {
617
+ // // 如果是查询条件
618
+ // return h(
619
+ // 'span',
620
+ // h('el-icon', h(className)),
621
+ // h('span', {class: searchResult, title: node.label}, node.label)
622
+ // )
623
+ // // return `<span>
624
+ // // <i class={className}></i>
625
+ // // <span class="searchResult" title={node.label}>
626
+ // // {node.label}
627
+ // // </span>
628
+ // // </span>`
629
+ // }
630
+ // return h(
631
+ // 'span',
632
+ // h('el-icon', h(className)),
633
+ // h('span', {title: node.label}, node.label)
634
+ // )
635
+ // // return `<span>
636
+ // // <i class={className}></i>
637
+ // // <span title={node.label}>{node.label}</span>
638
+ // // </span>`
639
+ // },
640
+ },
641
+ emits: ['result']
681
642
  }
682
643
  </script>
683
644
 
684
645
  <style>
685
646
  .searchResult {
686
- color: red;
647
+ color: red;
687
648
  }
688
649
 
689
650
  .inline-input-custom {
690
- width: 90%;
651
+ width: 90%;
691
652
  }
692
653
  </style>