bri-components 1.4.26 → 1.4.27

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bri-components",
3
- "version": "1.4.26",
3
+ "version": "1.4.27",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -82,7 +82,7 @@
82
82
  canSave: {
83
83
  name: "完成",
84
84
  type: "canSave",
85
- btnType: "primary",
85
+ btnType: "primaryLine",
86
86
  size: "default",
87
87
  event: "clickSave"
88
88
  }
@@ -311,6 +311,7 @@
311
311
  return (JSON.parse(sessionStorage.getItem("userData")) || {}).isCompAdmin || this.selfPropsObj._isCompAdmin;
312
312
  },
313
313
 
314
+ // 展示的部门
314
315
  departShowList () {
315
316
  const loop = (arr = [], filterVals = [], cascaderVals = [], reverseFilter = false) => {
316
317
  arr = cascaderVals.length
@@ -374,7 +375,7 @@
374
375
  )
375
376
  ];
376
377
  },
377
- allSelectDepartKeys () {
378
+ allDepartShowKeys () {
378
379
  const loop = (list = []) => {
379
380
  return list.reduce((arr, item) => {
380
381
  return [
@@ -387,13 +388,15 @@
387
388
  return loop(this.departShowList).map(item => item._key);
388
389
  },
389
390
  userShowList () {
390
- let list = this.allSelectDepartKeys.length
391
+ // 有部门过滤就只显示对应的部门,无过滤就涌全部用户(包含无部门用户)
392
+ let list = this.filterVals.length || this.cascaderVals.length
391
393
  ? this.userList.filter(item =>
392
394
  this.reverseFilter
393
- ? !this.allSelectDepartKeys.includes(item.departmentKey)
394
- : this.allSelectDepartKeys.includes(item.departmentKey)
395
+ ? !this.allDepartShowKeys.includes(item.departmentKey)
396
+ : this.allDepartShowKeys.includes(item.departmentKey)
395
397
  )
396
398
  : this.userList;
399
+
397
400
  list = this.curDepart._key === "_highSearch"
398
401
  ? this.highUserList
399
402
  : this.curDepart._key === "_resign"
@@ -46,13 +46,6 @@ export default {
46
46
  return this.transformRows(this.allTreeData, this.treeColumns);
47
47
  },
48
48
 
49
- showContentColumns () {
50
- return this.contentColumns.filter(colItem =>
51
- this.hideStatus === true
52
- ? !this.hideColKeys.includes(colItem._key)
53
- : true
54
- );
55
- },
56
49
  showColumns () {
57
50
  return this.mergeColumns(this.treeColumns);
58
51
  },
@@ -85,7 +85,7 @@ export default {
85
85
  return [
86
86
  ...(this.useSelection === true ? [this.selectionColumn] : []),
87
87
  ...(this.useIndex === true ? [this.indexColumn] : []),
88
- ...this.$transformToColumns(this.contentColumns),
88
+ ...this.$transformToColumns(this.showContentColumns),
89
89
  ...(!this.isSearching && this.rowOperationList.length ? [this.operationColumn] : [])
90
90
  ];
91
91
  },
@@ -51,7 +51,7 @@ export default {
51
51
  ...(this.useSelection === true ? [this.selectionColumn] : []),
52
52
  this.expandColumn,
53
53
  ...(this.useIndex === true ? [this.indexColumn] : []),
54
- ...this.$transformToColumns(this.contentColumns),
54
+ ...this.$transformToColumns(this.showContentColumns),
55
55
  ...(!this.isSearching && this.rowOperationList.length ? [this.operationColumn] : [])
56
56
  ];
57
57
  },
@@ -517,6 +517,13 @@ export default {
517
517
  ...colItem
518
518
  }));
519
519
  },
520
+ showContentColumns () {
521
+ return this.contentColumns.filter(colItem =>
522
+ this.hideStatus === true
523
+ ? !this.hideColKeys.includes(colItem._key)
524
+ : true
525
+ );
526
+ },
520
527
 
521
528
  selectionColumn () {
522
529
  return {
@@ -557,7 +564,7 @@ export default {
557
564
  maxHeight: this.contentHeight,
558
565
  // 通过实例方法 hideColumnsByKeys(keys)将列隐藏,通过实例方法 showColumnsByKeys(keys)将隐藏的列显示
559
566
  columnHiddenOption: {
560
- defaultHiddenColumnKeys: [...this.hideColKeys] // 必须这么写,不解构,切换一次隐藏/显示后,hideColKeys会变成空数组
567
+ // defaultHiddenColumnKeys: [...this.hideColKeys] // 必须这么写,不解构,切换一次隐藏/显示后,hideColKeys会变成空数组
561
568
  },
562
569
  cellStyleOption: {
563
570
  bodyCellClass: this.bodyCellClass
@@ -579,7 +586,7 @@ export default {
579
586
 
580
587
  // 联动隐藏
581
588
  showColKeys () {
582
- return this.showByNumFieldVal >= 0
589
+ return this.showByNumFieldVal != null && this.showByNumFieldVal >= 0
583
590
  ? this.showOrHideColKeys.slice(0, this.showByNumFieldVal)
584
591
  : this.showOrHideColKeys;
585
592
  },
@@ -816,13 +823,13 @@ export default {
816
823
 
817
824
  /* ----------- 隐藏/显示字段 ---------- */
818
825
  toggleHideOrShow () {
819
- if (this.$refs.briTable) {
820
- if (this.hideStatus === true) {
821
- this.$refs.briTable.showColumnsByKeys(this.hideColKeys);
822
- } else {
823
- this.$refs.briTable.hideColumnsByKeys(this.hideColKeys);
824
- }
825
- }
826
+ // if (this.$refs.briTable) {
827
+ // if (this.hideStatus === true) {
828
+ // this.$refs.briTable.showColumnsByKeys(this.hideColKeys);
829
+ // } else {
830
+ // this.$refs.briTable.hideColumnsByKeys(this.hideColKeys);
831
+ // }
832
+ // }
826
833
 
827
834
  this.hideStatus = !this.hideStatus;
828
835
  },