gcs-ui-lib 1.2.24 → 1.2.25

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": "gcs-ui-lib",
3
- "version": "1.2.24",
3
+ "version": "1.2.25",
4
4
  "private": false,
5
5
  "main": "./lib/gcs-ui-lib.common.js",
6
6
  "scripts": {
@@ -214,16 +214,25 @@ export default {
214
214
  label: item.label || item.prop,
215
215
  }));
216
216
  },
217
- // 显示列勾选状态(返回数组,默认全选)
217
+ // 显示列勾选状态
218
218
  checkColumns() {
219
- return this.mergedColumns.length ? this.mergedColumns : this.columns;
219
+ const savedColumns = this.$refs.fillList?.displayColumns;
220
+ const baseColumns = this.mergedColumns.length ? this.mergedColumns : this.columns;
221
+
222
+ if (!savedColumns?.length) {
223
+ return baseColumns;
224
+ }
225
+
226
+ const savedProps = new Set(savedColumns.map(c => c.prop));
227
+ const newColumns = baseColumns.filter(c => !savedProps.has(c.prop));
228
+ return [...savedColumns, ...newColumns];
220
229
  },
221
230
  },
222
231
  methods: {
223
232
  // 显示列设置回调 - 将显示列设置同步回表格
224
233
  setChange(list) {
225
234
  this.$refs.fillList.setColumns(list);
226
- this.showColumnVisible = false; // 手动关闭弹窗
235
+ this.showColumnVisible = false;
227
236
  },
228
237
  // 接收合并后的列配置
229
238
  handleColumnsChange(columns) {
@@ -26,8 +26,8 @@
26
26
  align="center"
27
27
  />
28
28
  <el-table-column
29
- v-for="item in displayColumns"
30
- :key="item.prop"
29
+ v-for="(item, index) in displayColumns"
30
+ :key="`${item.prop}-${index}`"
31
31
  v-bind="item"
32
32
  header-align="center"
33
33
  min-width="250"
@@ -343,8 +343,11 @@ export default {
343
343
  this.displayColumns = columns.map((col) => ({
344
344
  ...col,
345
345
  label: col.label || col.label2 || col.prop,
346
- label2: col.label2 || col.label || col.prop,
347
346
  }));
347
+ this.$forceUpdate();
348
+ this.$nextTick(() => {
349
+ this.$refs['t-box']?.doLayout();
350
+ });
348
351
  },
349
352
  },
350
353
  activated() {},