bri-components 1.4.83 → 1.4.84

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.83",
3
+ "version": "1.4.84",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
package/src/.DS_Store ADDED
Binary file
Binary file
@@ -17,7 +17,7 @@
17
17
  <!-- 底部编辑按钮 -->
18
18
  <dsh-buttons
19
19
  class="DshSingleData-btns"
20
- :list="operationList"
20
+ :list="selfOperationList"
21
21
  @click="$dshEmit($event, formData)"
22
22
  ></dsh-buttons>
23
23
  </template>
@@ -73,6 +73,18 @@
73
73
  computed: {
74
74
  formData () {
75
75
  return this.data[0];
76
+ },
77
+ selfOperationList () {
78
+ return this.operationList.map(operationItem => {
79
+ return {
80
+ ...operationItem,
81
+ ...(
82
+ operationItem.operationFunc
83
+ ? operationItem.operationFunc(operationItem, this.formData, undefined, this.operationList)
84
+ : {}
85
+ )
86
+ };
87
+ });
76
88
  }
77
89
  },
78
90
  created () {},
@@ -335,7 +335,7 @@ export default {
335
335
  },
336
336
  quickChangeVal (operationItem, row, rowIndex, column, params) {
337
337
  if (["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type)) {
338
- this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
338
+ this.dealRuleRecord(row, column);
339
339
  this.dealSameRowsVal({ row, rowIndex, column });
340
340
 
341
341
  this.change("quickChangeVal", row, rowIndex, column, ...params);
@@ -343,7 +343,7 @@ export default {
343
343
  },
344
344
  changeVal (operationItem, row, rowIndex, column, params) {
345
345
  if (!["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type)) {
346
- this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
346
+ this.dealRuleRecord(row, column);
347
347
  this.dealSameRowsVal({ row, rowIndex, column });
348
348
 
349
349
  this.change("changeVal", row, rowIndex, column, ...params);
@@ -845,19 +845,19 @@ export default {
845
845
 
846
846
  // 输入框失去焦点
847
847
  controlBlur (operationItem, row, rowIndex, column, params) {
848
- this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
848
+ this.dealRuleRecord(row, column);
849
849
  },
850
850
  // 输入框值改变立即
851
851
  quickChangeVal (operationItem, row, rowIndex, column, params) {
852
852
  if (["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type)) {
853
- this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
853
+ this.dealRuleRecord(row, column);
854
854
  this.change("quickChangeVal", row, rowIndex, column, ...params);
855
855
  }
856
856
  },
857
857
  // 输入框值改变
858
858
  changeVal (operationItem, row, rowIndex, column, params) {
859
859
  if (!["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type)) {
860
- this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
860
+ this.dealRuleRecord(row, column);
861
861
  this.change("changeVal", row, rowIndex, column, ...params);
862
862
  }
863
863
  },
@@ -1476,7 +1476,7 @@ export default {
1476
1476
  column = this.$transformDynamicProperty(column, row, this.parentObj);
1477
1477
 
1478
1478
  // 未触发校验时 不显示错误
1479
- if ((this.ruleRecordMap[this.getMixKey(row, column)] || {}).showRuleMessage || this.showRuleMessage) {
1479
+ if (this.ruleRecordMap[this.getMixKey(row, column)] || this.showRuleMessage) {
1480
1480
  // 校验必填不通过 => 校验对比
1481
1481
  const resultObj = {};
1482
1482
  this.$getFieldRuleResult(column, row, resultObj) &&
@@ -1717,6 +1717,11 @@ export default {
1717
1717
  // 行id + 分隔符 + 列key 组成键
1718
1718
  getMixKey (row, column, splitStr = "--") {
1719
1719
  return `${row._id}${splitStr}${column._key}`;
1720
+ },
1721
+ // 更新校验显示的标记
1722
+ dealRuleRecord (row, column) {
1723
+ // this.$set(this.ruleRecordMap, this.getMixKey(row, column), true);
1724
+ this.ruleRecordMap[this.getMixKey(row, column)] = true;
1720
1725
  }
1721
1726
  }
1722
1727
  };
Binary file
Binary file