bri-components 1.4.50 → 1.4.51

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.50",
3
+ "version": "1.4.51",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -1,5 +1,5 @@
1
1
  import controlMixin from "./controlMixin.js";
2
- import { resourceData, regionData, benjiRegionData, userIndustryData } from "../../../data/index.js";
2
+ import { resourceData, regionData, benjiRegionData, userIndustryData } from "bri-datas";
3
3
 
4
4
  export default {
5
5
  mixins: [
@@ -1,5 +1,5 @@
1
1
  import controlMixin from "./controlMixin.js";
2
- import { resourceData } from "../../../data/index.js";
2
+ import { resourceData } from "bri-datas";
3
3
 
4
4
  export default {
5
5
  mixins: [
@@ -321,7 +321,7 @@ export default {
321
321
  });
322
322
  },
323
323
  quickChangeVal (operationItem, row, rowIndex, column, params) {
324
- if (this.isUseQuickChange({ row, rowIndex, column })) {
324
+ if (["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type)) {
325
325
  this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
326
326
  this.dealSameRowsVal({ row, rowIndex, column });
327
327
 
@@ -329,7 +329,7 @@ export default {
329
329
  }
330
330
  },
331
331
  changeVal (operationItem, row, rowIndex, column, params) {
332
- if (!this.isUseQuickChange({ row, rowIndex, column })) {
332
+ if (!["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type)) {
333
333
  this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
334
334
  this.dealSameRowsVal({ row, rowIndex, column });
335
335
 
@@ -385,19 +385,22 @@ export default {
385
385
 
386
386
  return rowspan;
387
387
  },
388
- // 是都满足使用quickChange
389
- isUseQuickChange ({ row, rowIndex, column }) {
390
- return ["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type) &&
391
- this.mergeRowColKeys.includes(column._key) &&
392
- this.rowspanMap[this.getMixKey(row, column)] > 1;
393
- },
388
+ // // 是都满足使用quickChange
389
+ // isUseQuickChange ({ row, rowIndex, column }) {
390
+ // return ["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type) &&
391
+ // this.mergeRowColKeys.includes(column._key) &&
392
+ // this.rowspanMap[this.getMixKey(row, column)] > 1;
393
+ // },
394
394
  // 合并单元格的行,某列的值全部跟着修改
395
395
  dealSameRowsVal ({ row, rowIndex, column }, list = this.allListData) {
396
- const indexInAll = list.findIndex(dataItem => dataItem._id === row._id);
397
- list.slice(indexInAll + 1, indexInAll + this.rowspanMap[this.getMixKey(row, column)])
398
- .forEach(rowItem => {
399
- rowItem[column._key] = this.$deepCopy(row[column._key]);
400
- });
396
+ if (this.mergeRowColKeys.includes(column._key) && this.rowspanMap[this.getMixKey(row, column)] > 1) {
397
+ const indexInAll = list.findIndex(dataItem => dataItem._id === row._id);
398
+ list.slice(indexInAll + 1, indexInAll + this.rowspanMap[this.getMixKey(row, column)])
399
+ .forEach(rowItem => {
400
+ console.log(rowItem[column._key]);
401
+ rowItem[column._key] = this.$deepCopy(row[column._key]);
402
+ });
403
+ }
401
404
  }
402
405
  }
403
406
  };
@@ -856,12 +856,17 @@ export default {
856
856
  },
857
857
  // 输入框值改变立即
858
858
  quickChangeVal (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 });
861
+ this.change("quickChangeVal", row, rowIndex, column, ...params);
862
+ }
860
863
  },
861
864
  // 输入框值改变
862
865
  changeVal (operationItem, row, rowIndex, column, params) {
863
- this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
864
- this.change("changeVal", row, rowIndex, column, ...params);
866
+ if (!["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type)) {
867
+ this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
868
+ this.change("changeVal", row, rowIndex, column, ...params);
869
+ }
865
870
  },
866
871
  change (eventType, row, rowIndex, column, ...params) {
867
872
  this.$emit("change", this.tableDataObj, eventType, column, row, rowIndex, ...params);
@@ -1,4 +1,4 @@
1
- import { resourceData } from "../../../data/index.js";
1
+ import { resourceData } from "bri-datas";
2
2
 
3
3
  export default {
4
4
  mixins: [],