bri-components 1.3.50 → 1.3.52

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.3.50",
3
+ "version": "1.3.52",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -122,7 +122,7 @@
122
122
  },
123
123
 
124
124
  showVal () {
125
- return `${this.curVal ? this.$getTreeLeafTotal(this.curVal.tree) : 0} 行`;
125
+ return `${this.curVal ? this.$getTreeLeafTotal(this.curVal.tree, this.showMode === "treeTable") : 0} 行`;
126
126
  }
127
127
  },
128
128
  created () {},
@@ -281,7 +281,7 @@
281
281
  _key: "logic",
282
282
  _optionKind: "flat",
283
283
  _clearable: false,
284
- _disabled: this.isSimpleSearch,
284
+ // _disabled: this.isSimpleSearch,
285
285
  _data: [
286
286
  { _key: "and", name: "且" },
287
287
  { _key: "or", name: "或" }
@@ -27,12 +27,12 @@ export default {
27
27
  this.data.forEach(item => {
28
28
  !item._id && this.$set(item, "_id", this.$ObjectID().str);
29
29
 
30
- if (!this.initFlag) {
30
+ if (this.initFlag) {
31
31
  item.__old__ = true; // 标记老数据(initFlag不用在data中声明)
32
32
  }
33
33
  });
34
34
 
35
- this.initFlag = true;
35
+ this.initFlag = false;
36
36
  return this.data;
37
37
  },
38
38
  footerData () {
@@ -59,6 +59,7 @@ export default {
59
59
  showRuleMessage: false, // 进行全体校验
60
60
  ruleRecordMap: {}, // 单元格是否发生校验的记录映射
61
61
 
62
+ dftLogic: "and",
62
63
  dftConditions: [],
63
64
 
64
65
  dshRenderName: undefined,
@@ -265,10 +266,13 @@ export default {
265
266
  // 过滤行数据的 最终的筛选条件
266
267
  finalTableAdvSearch () {
267
268
  return {
268
- logic: "and",
269
+ logic: ["and", "or"].includes(this.tableAdvSearch.logic) ? this.tableAdvSearch.logic : "and",
269
270
  conditions: [
270
- ...this.dftConditions,
271
- ...this.hideConditions
271
+ ...this.hideConditions,
272
+ {
273
+ logic: this.dftLogic,
274
+ conditions: this.dftConditions
275
+ }
272
276
  ]
273
277
  };
274
278
  },
@@ -280,9 +284,7 @@ export default {
280
284
  }));
281
285
  },
282
286
  isSearching () {
283
- return this.searchFormList.length && this.finalTableAdvSearch.conditions.some(conditionItem =>
284
- conditionItem.fieldValue.length && conditionItem.fieldValue.some(valItem => !this.$isEmptyData(valItem))
285
- );
287
+ return this.$isAdvSearching(this.finalTableAdvSearch);
286
288
  },
287
289
 
288
290
  parentDataId () {
@@ -486,7 +488,9 @@ export default {
486
488
  },
487
489
  methods: {
488
490
  baseInit () {
489
- this.dftConditions = this.tableAdvSearch.conditions;
491
+ this.dftConditions = this.tableAdvSearch.conditions.filter(conditionItem =>
492
+ this.searchListFields.includes(conditionItem.fieldKey)
493
+ );
490
494
  },
491
495
  // 重置
492
496
  reset () {
@@ -501,6 +505,11 @@ export default {
501
505
  return this.allListData.every((row, rowIndex) => this.getRowRuleResult(row, rowIndex));
502
506
  },
503
507
 
508
+ // 筛选回调
509
+ searchCb (conditions) {
510
+ this.isExpandAction = false;
511
+ this.dftConditions = conditions;
512
+ },
504
513
  // 表单控件失去焦点
505
514
  controlBlur (operationItem, col, row, rowIndex, params) {
506
515
  this.$set(this.ruleRecordMap, `${row._id}dsh${col._key}`, { showRuleMessage: true });
@@ -699,8 +708,8 @@ export default {
699
708
  // 行按钮是否可编辑(删除按钮可编辑 不代表行内容是可编辑的)
700
709
  getRowBtnCanEdit (row) {
701
710
  return this.canEdit && // 是编辑状态
702
- (this.disabledOldDataRow ? !row.__old__ : true) && // 老数据行不置灰/置灰时是新增数据
703
- !row.__readonly__; // 不能为只读数据
711
+ (this.disabledOldDataRow ? row.__old__ !== true : true) && // 老数据行不置灰/置灰时是新增数据
712
+ row.__readonly__ !== true; // 不能为只读数据
704
713
  },
705
714
  // 行内容是否可编辑
706
715
  getRowCanEdit (row) {
@@ -727,11 +736,11 @@ export default {
727
736
  )
728
737
  : true
729
738
  ) &&
730
- (col._oldReadonly ? !row.__old__ : true) && // 老数据行里某些列不可编辑
731
- (row.__isQuote__ ? this.quoteDataCanEdit : true) && // 引用过来的数据是否可编辑
739
+ (col._oldReadonly ? row.__old__ !== true : true) && // 老数据行里某些列不可编辑
740
+ (row.__isQuote__ ? this.quoteDataCanEdit === true : true) && // 引用过来的数据是否可编辑
732
741
  col._enterType !== "calculate" && // 计算的不可编辑
733
742
  col._readonly !== true && // 不能为只读
734
- col.canEdit;
743
+ col.canEdit !== false; // 字段本身编辑权限 考虑为undefined时候
735
744
  },
736
745
  // 单元格最终编辑状态
737
746
  getUnitCanEdit (col, row) {