From 3fc162339f6c605bdc54abe928c4a76ce0ddda3e Mon Sep 17 00:00:00 2001 From: chenlin Date: Tue, 27 Jan 2026 12:10:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ColumnConfigDialog.vue | 26 ++++++++++++++++--- .../LowDesign/src/LowTable/index.vue | 2 +- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/components/LowDesign/src/LowTable/components/ColumnConfigDialog.vue b/src/components/LowDesign/src/LowTable/components/ColumnConfigDialog.vue index 3deaafe..540d36a 100644 --- a/src/components/LowDesign/src/LowTable/components/ColumnConfigDialog.vue +++ b/src/components/LowDesign/src/LowTable/components/ColumnConfigDialog.vue @@ -76,6 +76,7 @@ interface ColumnConfig { interface Props { modelValue: boolean columns: Record + fieldList?: any[] // fieldList 数据,用于获取 exportEntity.isExport } const props = defineProps() @@ -97,16 +98,35 @@ const initColumnConfig = () => { columnConfigList.value = Object.keys(props.columns) .map(key => { const column = props.columns[key] + const prop = column.prop || key + + // 如果 IndexedDB 没有记录(isExport === undefined),则从 fieldList 中获取 exportEntity.isExport + let isExport = column.isExport + if (isExport === undefined) { + // 查找 fieldList 中对应的字段 + if (props.fieldList && Array.isArray(props.fieldList)) { + const field = props.fieldList.find((f: any) => f.fieldCode === prop) + if (field && field.exportEntity && field.exportEntity.isExport === 'Y') { + isExport = 'Y' + } else { + // 如果 fieldList 中没有找到或不是 'Y',默认导出 + isExport = 'Y' + } + } else { + // 如果没有 fieldList,默认导出 + isExport = 'Y' + } + } + return { - prop: column.prop || key, + prop, label: column.label || key, hide: column.hide || false, fixed: column.fixed || false, sortable: column.sortable || false, showColumn: column.showColumn !== false, sortNum: column.sortNum, - // 默认全部勾选导出,如果已有配置则使用配置值 - isExport: column.isExport !== undefined ? column.isExport : 'Y' + isExport } }) .sort((a, b) => { diff --git a/src/components/LowDesign/src/LowTable/index.vue b/src/components/LowDesign/src/LowTable/index.vue index 673537a..6c7bf1c 100644 --- a/src/components/LowDesign/src/LowTable/index.vue +++ b/src/components/LowDesign/src/LowTable/index.vue @@ -41,7 +41,7 @@ + :columns="tableOption.column" :field-list="fieldListRef" @confirm="handleColumnConfigConfirm" />