gcs-ui-lib 1.2.24 → 1.2.26
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/lib/gcs-ui-lib.common.js +159 -157
- package/lib/gcs-ui-lib.umd.js +159 -157
- package/lib/gcs-ui-lib.umd.min.js +6 -6
- package/package.json +1 -1
- package/packages/StreamRefill/src/demo/index.vue +12 -3
- package/packages/StreamRefill/src/main.vue +10 -9
package/package.json
CHANGED
|
@@ -214,16 +214,25 @@ export default {
|
|
|
214
214
|
label: item.label || item.prop,
|
|
215
215
|
}));
|
|
216
216
|
},
|
|
217
|
-
//
|
|
217
|
+
// 显示列勾选状态
|
|
218
218
|
checkColumns() {
|
|
219
|
-
|
|
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"
|
|
@@ -212,11 +212,12 @@ export default {
|
|
|
212
212
|
return {
|
|
213
213
|
...rest,
|
|
214
214
|
label: item.label || item.prop,
|
|
215
|
+
slotName,
|
|
215
216
|
};
|
|
216
217
|
});
|
|
217
218
|
},
|
|
218
219
|
},
|
|
219
|
-
|
|
220
|
+
watch: {
|
|
220
221
|
tableData: {
|
|
221
222
|
handler() {
|
|
222
223
|
this.formData.tableData = this.tableData;
|
|
@@ -226,9 +227,7 @@ export default {
|
|
|
226
227
|
},
|
|
227
228
|
mergedColumns: {
|
|
228
229
|
handler(newVal) {
|
|
229
|
-
|
|
230
|
-
this.displayColumns = newVal;
|
|
231
|
-
}
|
|
230
|
+
this.displayColumns = newVal;
|
|
232
231
|
this.$emit("columns-change", newVal);
|
|
233
232
|
},
|
|
234
233
|
immediate: true,
|
|
@@ -251,7 +250,7 @@ export default {
|
|
|
251
250
|
//获取固定分组数据必填字段
|
|
252
251
|
this.setFieldHeader(Field);
|
|
253
252
|
//获取拓展字段分组数据必填字段
|
|
254
|
-
this.setExTHeader(exField);
|
|
253
|
+
await this.setExTHeader(exField);
|
|
255
254
|
},
|
|
256
255
|
setFieldHeader(Field) {
|
|
257
256
|
for (let i of Field) {
|
|
@@ -339,12 +338,14 @@ export default {
|
|
|
339
338
|
});
|
|
340
339
|
},
|
|
341
340
|
setColumns(columns) {
|
|
342
|
-
// 确保每列都有 label 属性用于显示
|
|
343
341
|
this.displayColumns = columns.map((col) => ({
|
|
344
342
|
...col,
|
|
345
343
|
label: col.label || col.label2 || col.prop,
|
|
346
|
-
label2: col.label2 || col.label || col.prop,
|
|
347
344
|
}));
|
|
345
|
+
this.$forceUpdate();
|
|
346
|
+
this.$nextTick(() => {
|
|
347
|
+
this.$refs['t-box']?.doLayout();
|
|
348
|
+
});
|
|
348
349
|
},
|
|
349
350
|
},
|
|
350
351
|
activated() {},
|