bri-components 1.4.23 → 1.4.24
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/package.json
CHANGED
|
@@ -260,7 +260,7 @@
|
|
|
260
260
|
|
|
261
261
|
const departList = [
|
|
262
262
|
...(this.highSearch ? this.highList : []),
|
|
263
|
-
...loop(this.
|
|
263
|
+
...loop(this.departList, this.filterVals, this.cascaderVals, this.reverseFilter)
|
|
264
264
|
];
|
|
265
265
|
|
|
266
266
|
return this.transformDepartList(departList, this.tmpValKeys);
|
|
@@ -313,7 +313,7 @@
|
|
|
313
313
|
callback: data => {
|
|
314
314
|
this.loadinged = true;
|
|
315
315
|
|
|
316
|
-
this.
|
|
316
|
+
this.departList = data.list;
|
|
317
317
|
}
|
|
318
318
|
});
|
|
319
319
|
}
|
|
@@ -271,13 +271,21 @@
|
|
|
271
271
|
_search: true,
|
|
272
272
|
_clearable: false
|
|
273
273
|
},
|
|
274
|
-
|
|
274
|
+
|
|
275
|
+
curDepart: {
|
|
276
|
+
_key: "",
|
|
277
|
+
name: "全部",
|
|
278
|
+
is_leaf: true,
|
|
279
|
+
level: 1
|
|
280
|
+
},
|
|
281
|
+
highUserList: [
|
|
275
282
|
{
|
|
276
283
|
_key: "dyn_myself",
|
|
277
284
|
realname: "当前用户"
|
|
278
285
|
}
|
|
279
286
|
],
|
|
280
|
-
|
|
287
|
+
userList: [],
|
|
288
|
+
highList: [
|
|
281
289
|
{
|
|
282
290
|
_key: "_highSearch",
|
|
283
291
|
name: "高级选项",
|
|
@@ -285,13 +293,6 @@
|
|
|
285
293
|
is_leaf: true
|
|
286
294
|
}
|
|
287
295
|
],
|
|
288
|
-
curDepart: {
|
|
289
|
-
_key: "",
|
|
290
|
-
name: "全部",
|
|
291
|
-
is_leaf: true,
|
|
292
|
-
level: 1
|
|
293
|
-
},
|
|
294
|
-
departList: [],
|
|
295
296
|
|
|
296
297
|
imageResizeConfig: {
|
|
297
298
|
m: "fixed",
|
|
@@ -310,37 +311,55 @@
|
|
|
310
311
|
return (JSON.parse(sessionStorage.getItem("userData")) || {}).isCompAdmin || this.selfPropsObj._isCompAdmin;
|
|
311
312
|
},
|
|
312
313
|
|
|
313
|
-
|
|
314
|
-
const loop = (
|
|
315
|
-
|
|
314
|
+
departShowList () {
|
|
315
|
+
const loop = (arr = [], filterVals = [], cascaderVals = [], reverseFilter = false) => {
|
|
316
|
+
arr = cascaderVals.length
|
|
317
|
+
? arr.filter(item => {
|
|
318
|
+
return reverseFilter
|
|
319
|
+
? !cascaderVals.some(cascaderItem =>
|
|
320
|
+
item.code && cascaderItem.code
|
|
321
|
+
? item.code.length < cascaderItem.code.length
|
|
322
|
+
? false
|
|
323
|
+
: item.code.startsWith(cascaderItem.code)
|
|
324
|
+
: false
|
|
325
|
+
)
|
|
326
|
+
: cascaderVals.some(cascaderItem =>
|
|
327
|
+
item.code && cascaderItem.code
|
|
328
|
+
? item.code.length < cascaderItem.code.length
|
|
329
|
+
? cascaderItem.code.startsWith(item.code)
|
|
330
|
+
: item.code.startsWith(cascaderItem.code)
|
|
331
|
+
: false
|
|
332
|
+
);
|
|
333
|
+
})
|
|
334
|
+
: filterVals.length
|
|
335
|
+
? arr.filter(item =>
|
|
336
|
+
reverseFilter
|
|
337
|
+
? !filterVals.includes(item._key)
|
|
338
|
+
: filterVals.includes(item._key)
|
|
339
|
+
)
|
|
340
|
+
: arr;
|
|
341
|
+
|
|
342
|
+
return arr.reduce((newArr, item) => {
|
|
343
|
+
if (item.children && item.children.length) {
|
|
344
|
+
item.children = loop(item.children, [], cascaderVals, reverseFilter);
|
|
345
|
+
}
|
|
346
|
+
|
|
316
347
|
return [
|
|
317
|
-
...
|
|
318
|
-
|
|
348
|
+
...newArr,
|
|
349
|
+
item
|
|
319
350
|
];
|
|
320
|
-
},
|
|
351
|
+
}, []);
|
|
321
352
|
};
|
|
322
353
|
|
|
323
|
-
const departList = this.departList.filter(item => this.filterVals.includes(item._key));
|
|
324
|
-
return loop(departList).map(item => item._key);
|
|
325
|
-
},
|
|
326
|
-
departShowList () {
|
|
327
354
|
return [
|
|
328
|
-
...(this.highSearch ? this.
|
|
355
|
+
...(this.highSearch ? this.highList : []),
|
|
329
356
|
{
|
|
330
357
|
name: "全部",
|
|
331
358
|
_key: "",
|
|
332
359
|
level: 1,
|
|
333
360
|
is_leaf: true
|
|
334
361
|
},
|
|
335
|
-
...(
|
|
336
|
-
this.allFilterDepartKeys.length
|
|
337
|
-
? this.departList.filter(item =>
|
|
338
|
-
this.reverseFilter
|
|
339
|
-
? !this.allFilterDepartKeys.includes(item._key)
|
|
340
|
-
: this.allFilterDepartKeys.includes(item._key)
|
|
341
|
-
)
|
|
342
|
-
: this.departList
|
|
343
|
-
),
|
|
362
|
+
...loop(this.departList, this.filterVals, this.cascaderVals, this.reverseFilter),
|
|
344
363
|
...(
|
|
345
364
|
this.isCompAdmin
|
|
346
365
|
? [
|
|
@@ -355,18 +374,30 @@
|
|
|
355
374
|
)
|
|
356
375
|
];
|
|
357
376
|
},
|
|
377
|
+
allSelectDepartKeys () {
|
|
378
|
+
const loop = (list = []) => {
|
|
379
|
+
return list.reduce((arr, item) => {
|
|
380
|
+
return [
|
|
381
|
+
...arr,
|
|
382
|
+
...loop(item.children)
|
|
383
|
+
];
|
|
384
|
+
}, list);
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
return loop(this.departShowList).map(item => item._key);
|
|
388
|
+
},
|
|
358
389
|
userShowList () {
|
|
359
|
-
let list = this.
|
|
360
|
-
? this.
|
|
390
|
+
let list = this.allSelectDepartKeys.length
|
|
391
|
+
? this.userList.filter(item =>
|
|
361
392
|
this.reverseFilter
|
|
362
|
-
? !this.
|
|
363
|
-
: this.
|
|
393
|
+
? !this.allSelectDepartKeys.includes(item.departmentKey)
|
|
394
|
+
: this.allSelectDepartKeys.includes(item.departmentKey)
|
|
364
395
|
)
|
|
365
|
-
: this.
|
|
396
|
+
: this.userList;
|
|
366
397
|
list = this.curDepart._key === "_highSearch"
|
|
367
|
-
? this.
|
|
398
|
+
? this.highUserList
|
|
368
399
|
: this.curDepart._key === "_resign"
|
|
369
|
-
? this.
|
|
400
|
+
? this.userList
|
|
370
401
|
: !this.curDepart._key
|
|
371
402
|
? list
|
|
372
403
|
: list.filter(item => item.departmentKey === this.curDepart._key);
|
|
@@ -447,7 +478,7 @@
|
|
|
447
478
|
callback: data => {
|
|
448
479
|
this.loadinged = true;
|
|
449
480
|
|
|
450
|
-
this.
|
|
481
|
+
this.userList = data.list;
|
|
451
482
|
this.total = data.total;
|
|
452
483
|
}
|
|
453
484
|
});
|