bri-components 1.4.82 → 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.82",
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 () {},
@@ -53,7 +53,7 @@
53
53
  :isLoading="isLoading"
54
54
  :columns="showColumns"
55
55
  :data="isLoading ? [] : showListData"
56
- :propsObj="tablePropsObj"
56
+ :propsObj="tableInModalPropsObj"
57
57
  @changeSelect="changeSelect"
58
58
  @selectAll="changeSelect"
59
59
  ></bri-table>
@@ -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);
@@ -136,6 +136,7 @@ export default {
136
136
  btnType: "errorText",
137
137
  icon: "md-trash",
138
138
  size: "small",
139
+ color: "#E83636",
139
140
  disabled: false,
140
141
  event: "clickDelete"
141
142
  }
@@ -450,22 +451,17 @@ export default {
450
451
  .map(rowItem => rowItem._id)
451
452
  .filter(id => !!id);
452
453
  },
453
- // 渲染过的行
454
- renderedListData () {
455
- return this.allListData.filter(rowItem => {
456
- this.dealSearchShow(rowItem);
457
-
458
- return rowItem.__isRendered__;
459
- });
460
- },
461
454
  // 全部数据 或 筛选时符合条件的数据
462
455
  showListData () {
463
- return this.renderedListData
464
- .filter(rowItem => !!rowItem[this.controlShowKey])
456
+ return this.allListData
457
+ .filter(rowItem => {
458
+ this.dealSearchShow(rowItem);
459
+ return rowItem.__isRendered__ && !!rowItem[this.controlShowKey];
460
+ })
465
461
  .map((rowItem, rowIndex) => {
466
462
  rowItem.__index__ = rowIndex + 1;
467
463
  return rowItem;
468
- });
464
+ });
469
465
  },
470
466
  // 全部数据 或 筛选时符合条件的数据 -总数
471
467
  selfTotal () {
@@ -487,11 +483,11 @@ export default {
487
483
  ? initDftVal
488
484
  : dftVal
489
485
  : dftInRowVal
490
- // [column._key]: this.$isEmptyData(dftInRowVal)
491
- // ? this.$isEmptyData(dftVal)
492
- // ? initDftVal
493
- // : dftVal
494
- // : dftInRowVal
486
+ // [column._key]: this.$isEmptyData(dftInRowVal)
487
+ // ? this.$isEmptyData(dftVal)
488
+ // ? initDftVal
489
+ // : dftVal
490
+ // : dftInRowVal
495
491
  });
496
492
  }, {});
497
493
  },
@@ -849,19 +845,19 @@ export default {
849
845
 
850
846
  // 输入框失去焦点
851
847
  controlBlur (operationItem, row, rowIndex, column, params) {
852
- this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
848
+ this.dealRuleRecord(row, column);
853
849
  },
854
850
  // 输入框值改变立即
855
851
  quickChangeVal (operationItem, row, rowIndex, column, params) {
856
852
  if (["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type)) {
857
- this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
853
+ this.dealRuleRecord(row, column);
858
854
  this.change("quickChangeVal", row, rowIndex, column, ...params);
859
855
  }
860
856
  },
861
857
  // 输入框值改变
862
858
  changeVal (operationItem, row, rowIndex, column, params) {
863
859
  if (!["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type)) {
864
- this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
860
+ this.dealRuleRecord(row, column);
865
861
  this.change("changeVal", row, rowIndex, column, ...params);
866
862
  }
867
863
  },
@@ -1179,7 +1175,7 @@ export default {
1179
1175
  e.stopPropagation();
1180
1176
  }
1181
1177
  }
1182
- });
1178
+ });
1183
1179
  },
1184
1180
  topSearchRender (h) {
1185
1181
  return this.searchFormList.length
@@ -1465,7 +1461,7 @@ export default {
1465
1461
  getRowDelBtnCanEdit (row, rowIndex) {
1466
1462
  return row.__readonly__ !== true && // 不能为只读数据
1467
1463
  (this.disabledDeleteDftRow ? row.__isDefault__ !== true : true) && // 默认数据可删除
1468
- (this.disabledDeleteOldRow ? row.__old__ !== true : true); // 老数据可删除
1464
+ (this.disabledDeleteOldRow ? row.__old__ !== true : true); // 老数据可删除
1469
1465
  },
1470
1466
  // 行内容是否可编辑
1471
1467
  getRowCanEdit (row, rowIndex) {
@@ -1480,7 +1476,7 @@ export default {
1480
1476
  column = this.$transformDynamicProperty(column, row, this.parentObj);
1481
1477
 
1482
1478
  // 未触发校验时 不显示错误
1483
- if ((this.ruleRecordMap[this.getMixKey(row, column)] || {}).showRuleMessage || this.showRuleMessage) {
1479
+ if (this.ruleRecordMap[this.getMixKey(row, column)] || this.showRuleMessage) {
1484
1480
  // 校验必填不通过 => 校验对比
1485
1481
  const resultObj = {};
1486
1482
  this.$getFieldRuleResult(column, row, resultObj) &&
@@ -1721,6 +1717,11 @@ export default {
1721
1717
  // 行id + 分隔符 + 列key 组成键
1722
1718
  getMixKey (row, column, splitStr = "--") {
1723
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;
1724
1725
  }
1725
1726
  }
1726
1727
  };
Binary file
Binary file