bri-components 1.3.96 → 1.3.98

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.
@@ -80,12 +80,16 @@ export default {
80
80
  const list = this.data;
81
81
  const newRow = this.getNewRowData();
82
82
 
83
- // 处理单元格合并相关(当前列是合并列,则该列之前的合并列,要复制这一行对应列的值;当前列是普通列,按最后合并列的操作处理)
83
+ // 处理单元格合并相关(当前列是合并列,则该列之前的合并列,要复制这一行对应列的值;当前列是普通列,按该列前的最后合并列的操作处理)
84
84
  if (col) {
85
- if (col._mergeRow === true) {
85
+ if (this.mergeRowColKeys.includes(col._key)) {
86
86
  const newList = this.allListData.slice(rowIndex); // 从该行开始截取
87
- const nextRowIndex = newList.findIndex(rowItem => rowItem[col._key] !== row[col._key]); // 寻找该单元格值开始不一样的行(特殊情况是最后一行,nextRowIndex为-1)
88
- row = nextRowIndex < 0 ? newList[newList.length - 1] : newList[nextRowIndex - 1]; // 取该单元格值一样的最后一行
87
+ const nextRowIndex = this.$isEmptyData(row[col._key])
88
+ ? 1
89
+ : newList.findIndex(rowItem => rowItem[col._key] !== row[col._key]); // 寻找该单元格值开始不一样的行(特殊情况是最后一行,nextRowIndex为-1)
90
+ row = nextRowIndex < 0
91
+ ? newList[newList.length - 1]
92
+ : newList[nextRowIndex - 1]; // 取该单元格值一样的最后一行
89
93
 
90
94
  const colIndex = this.mergeRowColumns.findIndex(column => column._key === col._key);
91
95
  this.mergeRowColumns.reduce((obj, column, columnIndex) => {
@@ -98,7 +102,7 @@ export default {
98
102
  }
99
103
  else {
100
104
  const colIndex = this.selfColumns.findIndex(column => column._key === col._key);
101
- const mergeRowColumns = this.selfColumns.filter((column, columnIndex) => columnIndex < colIndex && column._mergeRow === true);
105
+ const mergeRowColumns = this.selfColumns.filter((column, columnIndex) => columnIndex < colIndex && this.mergeRowColKeys.includes(column._key));
102
106
  mergeRowColumns.slice(0, mergeRowColumns.length - 1).reduce((obj, column) => {
103
107
  return Object.assign(obj, {
104
108
  [column._key]: this.$deepCopy(row[column._key])
@@ -111,7 +115,7 @@ export default {
111
115
  : list.length;
112
116
  list.splice(newRowIndex, 0, newRow);
113
117
 
114
- this.change("createRow", null, newRow, newRowIndex);
118
+ this.change("createRow", newRow, newRowIndex, null);
115
119
  },
116
120
  // 点击 -删除行
117
121
  clickDelete (operationItem, row, rowIndex) {
@@ -121,12 +125,12 @@ export default {
121
125
  onOk: () => {
122
126
  this.data.splice(rowIndex, 1);
123
127
 
124
- this.change("deleteRow", null, row, rowIndex);
128
+ this.change("deleteRow", row, rowIndex, null);
125
129
  }
126
130
  });
127
131
  },
128
132
 
129
- change (eventType, col, row, rowIndex, ...params) {
133
+ change (eventType, row, rowIndex, col, ...params) {
130
134
  this.$emit("change", { list: this.allListData, rowDefault: this.rowDefault }, eventType, col, row, rowIndex, ...params);
131
135
  }
132
136
  }
@@ -117,7 +117,7 @@ export default {
117
117
  },
118
118
  created () { },
119
119
  methods: {
120
- change (eventType, col, row, rowIndex, ...params) {
120
+ change (eventType, row, rowIndex, col, ...params) {
121
121
  this.$emit("change", { tree: this.data, rowDefault: this.rowDefault }, eventType, col, row, rowIndex, ...params);
122
122
  },
123
123
 
@@ -198,7 +198,7 @@ export default {
198
198
  }, rowItem);
199
199
  }
200
200
 
201
- this.fixRowItem(rowItem);
201
+ this.fixRowItem(rowItem, levelNum);
202
202
  });
203
203
  loop(treeData);
204
204