From c9bd327fc090433092b12acd07f64f2587c245e9 Mon Sep 17 00:00:00 2001 From: "Ray.Hao" <1490493387@qq.com> Date: Tue, 1 Sep 2026 07:26:09 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E9=80=9A?= =?UTF-8?q?=E7=94=A8=E7=BB=84=E4=BB=B6=E5=AE=9E=E7=8E=B0=E4=B8=8E=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - src/components/DictSelect: 改用 defineModel 与 computed,修复选项加载时清空已选值与父子值分叉 - src/components/ThemeSwitcher: ThemeSwitch 改名,修正 theneList 拼写 - src/composables/useTableSelection: 显式判空,避免 id 为 0 的行被过滤 - src/utils/download: 收窄入参类型,headers 改为可选 - src/api/system/user: 导出与模板下载接口声明 Blob 响应类型 - src/views/system/dict: 标签类型选项排除空串,el-tag 去掉 as any - src/views/system/user/components/UserImportDialog: 去掉响应类型的 any 标注 - src/layouts、src/views/login: 删除可自动导入组件的冗余 import --- src/api/system/user/index.ts | 4 +- src/components/DictSelect/index.vue | 93 ++++++------ src/components/LangSelect/index.vue | 2 +- .../{ThemeSwitch => ThemeSwitcher}/index.vue | 8 +- src/composables/useTableSelection.ts | 4 +- src/layouts/components/LayoutNavbar.vue | 2 - src/layouts/components/LayoutToolbar.vue | 8 +- src/utils/download.ts | 16 +- src/views/login/index.vue | 143 ++++++++++-------- src/views/system/dict/dict-item.vue | 4 +- src/views/system/menu/index.vue | 4 +- .../user/components/UserImportDialog.vue | 2 +- 12 files changed, 158 insertions(+), 132 deletions(-) rename src/components/{ThemeSwitch => ThemeSwitcher}/index.vue (87%) diff --git a/src/api/system/user/index.ts b/src/api/system/user/index.ts index 705fbc91..8e0471ea 100644 --- a/src/api/system/user/index.ts +++ b/src/api/system/user/index.ts @@ -109,7 +109,7 @@ const UserAPI = { /** 下载用户导入模板 */ downloadTemplate() { - return request({ + return request({ url: `${USER_BASE_URL}/template`, method: "get", responseType: "blob", @@ -122,7 +122,7 @@ const UserAPI = { * @param queryParams 查询参数 */ export(queryParams: UserQueryParams) { - return request({ + return request({ url: `${USER_BASE_URL}/export`, method: "get", params: queryParams, diff --git a/src/components/DictSelect/index.vue b/src/components/DictSelect/index.vue index af54dc48..cce46357 100644 --- a/src/components/DictSelect/index.vue +++ b/src/components/DictSelect/index.vue @@ -1,12 +1,11 @@