bri-components 1.4.40 → 1.4.41

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.40",
3
+ "version": "1.4.41",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -203,6 +203,7 @@
203
203
  // 参数event
204
204
  onChange (event) {
205
205
  this.quickChange(); // 立马触发
206
+
206
207
  clearTimeout(this.timer);
207
208
  this.timer = setTimeout(() => {
208
209
  this.change();
@@ -275,18 +275,20 @@ export default {
275
275
  });
276
276
  },
277
277
  quickChangeVal (operationItem, row, rowIndex, column, params) {
278
- this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
279
- this.dealSameRowsVal({ row, rowIndex, column });
278
+ if (this.isUseQuickChange({ row, rowIndex, column })) {
279
+ this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
280
+ this.dealSameRowsVal({ row, rowIndex, column });
280
281
 
281
- this.change("quickChangeVal", row, rowIndex, column, ...params);
282
+ this.change("quickChangeVal", row, rowIndex, column, ...params);
283
+ }
282
284
  },
283
285
  changeVal (operationItem, row, rowIndex, column, params) {
284
- this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
285
- if (!["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._key)) {
286
+ if (!this.isUseQuickChange({ row, rowIndex, column })) {
287
+ this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
286
288
  this.dealSameRowsVal({ row, rowIndex, column });
287
- }
288
289
 
289
- this.change("changeVal", row, rowIndex, column, ...params);
290
+ this.change("changeVal", row, rowIndex, column, ...params);
291
+ }
290
292
  },
291
293
 
292
294
  /* ----------- 方法 ---------- */
@@ -337,15 +339,19 @@ export default {
337
339
 
338
340
  return rowspan;
339
341
  },
342
+ // 是都满足使用quickChange
343
+ isUseQuickChange ({ row, rowIndex, column }) {
344
+ return ["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type) &&
345
+ this.mergeRowColKeys.includes(column._key) &&
346
+ this.rowspanMap[this.getMixKey(row, column)] > 1;
347
+ },
340
348
  // 合并单元格的行,某列的值全部跟着修改
341
349
  dealSameRowsVal ({ row, rowIndex, column }, list = this.allListData) {
342
- if (this.mergeRowColKeys.includes(column._key) && this.rowspanMap[this.getMixKey(row, column)] > 1) {
343
- const indexInAll = list.findIndex(dataItem => dataItem._id === row._id);
344
- list.slice(indexInAll + 1, indexInAll + this.rowspanMap[this.getMixKey(row, column)])
345
- .forEach(rowItem => {
346
- rowItem[column._key] = this.$deepCopy(row[column._key]);
347
- });
348
- }
350
+ const indexInAll = list.findIndex(dataItem => dataItem._id === row._id);
351
+ list.slice(indexInAll + 1, indexInAll + this.rowspanMap[this.getMixKey(row, column)])
352
+ .forEach(rowItem => {
353
+ rowItem[column._key] = this.$deepCopy(row[column._key]);
354
+ });
349
355
  }
350
356
  }
351
357
  };
@@ -813,8 +813,7 @@ export default {
813
813
  },
814
814
  // 输入框值改变立即
815
815
  quickChangeVal (operationItem, row, rowIndex, column, params) {
816
- this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
817
- this.change("quickChangeVal", row, rowIndex, column, ...params);
816
+ // 啥也不做,平级表格合并单元格时用这个方法
818
817
  },
819
818
  // 输入框值改变
820
819
  changeVal (operationItem, row, rowIndex, column, params) {