|
@@ -228,13 +228,27 @@ export default {
|
|
|
let isHas = this.content_group_row_list.some((group) => group.row_id === row_id);
|
|
|
if (!isHas) {
|
|
|
this.content_group_row_list.splice(i, 0, { row_id, is_pre_same_group: false });
|
|
|
+
|
|
|
+ [i - 1, i + 1].forEach((start) => {
|
|
|
+ let step = start < i ? -1 : 1;
|
|
|
+ for (let j = start; j >= 0 && j < this.content_group_row_list.length; j += step) {
|
|
|
+ if (this.content_group_row_list[j].is_pre_same_group) {
|
|
|
+ this.content_group_row_list[j].is_pre_same_group = false;
|
|
|
+ } else {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- // 过滤掉已经不存在的行
|
|
|
- this.content_group_row_list = this.content_group_row_list.filter((group) => {
|
|
|
- return val.find((row) => row.row_id === group.row_id);
|
|
|
- });
|
|
|
+ // 过滤掉已经不存在的行,并将第一行的 is_pre_same_group 设置为 false
|
|
|
+ this.content_group_row_list = this.content_group_row_list.filter((group) =>
|
|
|
+ val.find((row) => row.row_id === group.row_id),
|
|
|
+ );
|
|
|
+ if (this.content_group_row_list[0]) {
|
|
|
+ this.content_group_row_list[0].is_pre_same_group = false;
|
|
|
+ }
|
|
|
},
|
|
|
immediate: true,
|
|
|
},
|