From 358e1297655039744bf675fbd9a62eb9f3c69e97 Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Mon, 4 Aug 2025 18:15:18 +0800 Subject: [PATCH 1/6] feat(hooks): add scrollX computation for total table width in useNaiveTable --- src/hooks/common/table.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/hooks/common/table.ts b/src/hooks/common/table.ts index 0b36e00c..0c943f58 100644 --- a/src/hooks/common/table.ts +++ b/src/hooks/common/table.ts @@ -38,6 +38,13 @@ export function useNaiveTable(options: UseNaiveTableOptio getColumns }); + // calculate the total width of the table this is used for horizontal scrolling + const scrollX = computed(() => { + return result.columns.value.reduce((acc, column) => { + return acc + Number(column.width ?? column.minWidth ?? 120); + }, 0); + }); + scope.run(() => { watch( () => appStore.locale, @@ -51,7 +58,10 @@ export function useNaiveTable(options: UseNaiveTableOptio scope.stop(); }); - return result; + return { + ...result, + scrollX + }; } type PaginationParams = Pick; From be8f915a0cedbeefa37348bdb983b19395f3b38c Mon Sep 17 00:00:00 2001 From: Azir-11 <2075125282@qq.com> Date: Tue, 12 Aug 2025 22:45:55 +0800 Subject: [PATCH 2/6] chore(other): update the ESLint validation configuration to support more file types. --- .vscode/settings.json | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 2c70ecf9..ee081a60 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,7 +4,18 @@ "source.organizeImports": "never" }, "editor.formatOnSave": false, - "eslint.validate": ["html", "css", "scss", "json", "jsonc"], + "eslint.validate": [ + "html", + "css", + "scss", + "json", + "jsonc", + "javascript", + "javascriptreact", + "typescript", + "typescriptreact", + "vue" + ], "i18n-ally.displayLanguage": "zh-cn", "i18n-ally.enabledParsers": ["ts"], "i18n-ally.enabledFrameworks": ["vue"], From a55b4dc073f4f22327bc4f05895127fb9b3b4a2e Mon Sep 17 00:00:00 2001 From: Azir-11 <2075125282@qq.com> Date: Tue, 12 Aug 2025 23:13:21 +0800 Subject: [PATCH 3/6] feat(components): add the IconTooltip component. --- src/components/common/icon-tooltip.vue | 42 ++++++++++++++++++++++++++ src/typings/components.d.ts | 2 ++ 2 files changed, 44 insertions(+) create mode 100644 src/components/common/icon-tooltip.vue diff --git a/src/components/common/icon-tooltip.vue b/src/components/common/icon-tooltip.vue new file mode 100644 index 00000000..d98db322 --- /dev/null +++ b/src/components/common/icon-tooltip.vue @@ -0,0 +1,42 @@ + + + diff --git a/src/typings/components.d.ts b/src/typings/components.d.ts index 33b5526f..6662146a 100644 --- a/src/typings/components.d.ts +++ b/src/typings/components.d.ts @@ -25,6 +25,7 @@ declare module 'vue' { IconMdiArrowUpThin: typeof import('~icons/mdi/arrow-up-thin')['default'] IconMdiKeyboardEsc: typeof import('~icons/mdi/keyboard-esc')['default'] IconMdiKeyboardReturn: typeof import('~icons/mdi/keyboard-return')['default'] + IconTooltip: typeof import('./../components/common/icon-tooltip.vue')['default'] IconUilSearch: typeof import('~icons/uil/search')['default'] LangSwitch: typeof import('./../components/common/lang-switch.vue')['default'] LookForward: typeof import('./../components/custom/look-forward.vue')['default'] @@ -56,6 +57,7 @@ declare module 'vue' { NMessageProvider: typeof import('naive-ui')['NMessageProvider'] NModal: typeof import('naive-ui')['NModal'] NNotificationProvider: typeof import('naive-ui')['NNotificationProvider'] + NPopover: typeof import('naive-ui')['NPopover'] NScrollbar: typeof import('naive-ui')['NScrollbar'] NSelect: typeof import('naive-ui')['NSelect'] NSpace: typeof import('naive-ui')['NSpace'] From 4005763c000fe7774e11dae3756f51fdc0a7a7a5 Mon Sep 17 00:00:00 2001 From: Azir-11 <2075125282@qq.com> Date: Tue, 12 Aug 2025 23:36:41 +0800 Subject: [PATCH 4/6] feat(components): replace NTooltip with IconTooltip and optimize the layout of related components. --- .../components/layout-mode-card.vue | 4 +- .../theme-drawer/components/setting-item.vue | 2 +- .../appearance/modules/theme-color.vue | 41 ++++++++++--------- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/layouts/modules/theme-drawer/components/layout-mode-card.vue b/src/layouts/modules/theme-drawer/components/layout-mode-card.vue index 351bb942..e0563508 100644 --- a/src/layouts/modules/theme-drawer/components/layout-mode-card.vue +++ b/src/layouts/modules/theme-drawer/components/layout-mode-card.vue @@ -80,7 +80,7 @@ function handleChangeMode(mode: UnionKey.ThemeLayoutMode) { class="flex-col-center cursor-pointer" @click="handleChangeMode(key)" > - + {{ $t(`theme.layout.layoutMode.${key}_detail`) }} - +

{{ $t(themeLayoutModeRecord[key]) }}

diff --git a/src/layouts/modules/theme-drawer/components/setting-item.vue b/src/layouts/modules/theme-drawer/components/setting-item.vue index ccd29bd2..07316a6d 100644 --- a/src/layouts/modules/theme-drawer/components/setting-item.vue +++ b/src/layouts/modules/theme-drawer/components/setting-item.vue @@ -13,7 +13,7 @@ defineProps();