From 12c78f96d78508fd1022dbb8249d8e68682535a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=9D=E5=85=88=E7=91=9E?= <1490493387@qq.com> Date: Thu, 16 Nov 2023 22:46:28 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20:recycle:=20=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E9=87=8D=E6=9E=84(=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 14e64324f7556c095c38ad289690367cdac0ec56 --- .env.development | 8 +- .env.production | 4 +- .env.staging | 8 - .eslintrc.cjs | 1 - .vscode/extensions.json | 2 +- README.md | 4 +- package.json | 5 +- src/layout/components/Sidebar/Item.vue | 1 - src/layout/components/Sidebar/SidebarItem.vue | 15 +- src/layout/components/Sidebar/TopMenu.vue | 7 - src/layout/components/TagsView/ScrollPane.vue | 2 +- src/layout/components/TagsView/index.vue | 226 +-- src/layout/index.vue | 44 +- src/settings.ts | 60 +- src/store/modules/permission.ts | 4 +- src/store/modules/settings.ts | 63 +- src/store/modules/tagsView.ts | 72 +- src/types/auto-imports.d.ts | 22 +- src/types/components.d.ts | 16 +- src/types/global.d.ts | 55 - src/views/login/index.vue | 11 +- src/views/system/dept/index.vue | 5 +- .../system/dict/components/dict-item.vue | 5 +- src/views/system/dict/index.vue | 10 +- src/views/system/menu/index.vue | 5 +- src/views/system/role/index.vue | 5 +- tsconfig.json | 2 +- types/auto-imports.d.ts | 1589 +++++++++++++++++ types/components.d.ts | 117 ++ {src/types => types}/env.d.ts | 7 +- types/global.d.ts | 102 ++ types/router.d.ts | 22 + {src/types => types}/shims-vue.d.ts | 0 vite.config.ts | 29 +- 34 files changed, 2129 insertions(+), 399 deletions(-) delete mode 100644 .env.staging delete mode 100644 src/types/global.d.ts create mode 100644 types/auto-imports.d.ts create mode 100644 types/components.d.ts rename {src/types => types}/env.d.ts (81%) create mode 100644 types/global.d.ts create mode 100644 types/router.d.ts rename {src/types => types}/shims-vue.d.ts (100%) diff --git a/.env.development b/.env.development index 1d34584..daa0fc6 100644 --- a/.env.development +++ b/.env.development @@ -3,14 +3,12 @@ # 变量必须以 VITE_ 为前缀才能暴露给外部读取 NODE_ENV='development' -VITE_APP_TITLE = 'vue3-element-admin' VITE_APP_PORT = 3000 # API请求前缀 VITE_APP_BASE_API = '/dev-api' # proxy代理配置 -VITE_APP_TARGET_URL = 'http://vapi.youlai.tech' # 线上接口 -# VITE_APP_TARGET_URL = 'http://localhost:8989' # 本地接口,本地启动后端:https://gitee.com/youlaiorg/youlai-boot -# VITE_APP_TARGET_URL = 'http://localhost:3000' # 本地Mock -VITE_APP_TARGET_BASE_API = '' +VITE_APP_API_URL = 'http://vapi.youlai.tech' # 线上接口 +# VITE_APP_API_URL = 'http://localhost:8989' # 本地接口,本地启动后端:https://gitee.com/youlaiorg/youlai-boot +# VITE_APP_API_URL = 'http://localhost:3000' # 本地Mock diff --git a/.env.production b/.env.production index ad781c0..c8c6931 100644 --- a/.env.production +++ b/.env.production @@ -1,11 +1,9 @@ ## 生产环境 -VITE_APP_TITLE = 'vue3-element-admin' VITE_APP_PORT = 3000 # API请求前缀 VITE_APP_BASE_API = '/prod-api' # proxy代理配置 -VITE_APP_TARGET_URL = "http://vapi.youlai.tech" -VITE_APP_TARGET_BASE_API = '' +VITE_APP_API_URL = "http://vapi.youlai.tech" diff --git a/.env.staging b/.env.staging deleted file mode 100644 index 7b5894b..0000000 --- a/.env.staging +++ /dev/null @@ -1,8 +0,0 @@ -## 模拟环境 -NODE_ENV='staging' - -VITE_APP_TITLE = 'vue3-element-admin' -VITE_APP_PORT = 3000 - -VITE_APP_TARGET_URL = 'http://localhost:3000'; -VITE_APP_BASE_API = '/prod-api' diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 5c8537e..8ae169a 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -83,7 +83,6 @@ module.exports = { ], // https://eslint.org/docs/latest/use/configure/language-options#specifying-globals globals: { - DialogOption: "readonly", OptionType: "readonly", }, }; diff --git a/.vscode/extensions.json b/.vscode/extensions.json index a7cea0b..7528cf2 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,3 +1,3 @@ { - "recommendations": ["Vue.volar"] + "recommendations": ["Vue.volar", "lokalise.i18n-ally","esbenp.prettier-vscode"] } diff --git a/README.md b/README.md index f642e93..1ce8018 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ server { - **接口切换 Mock** - v2.5.0 版本支持 Mock , 修改 `.env.development` 的 `VITE_APP_TARGET_URL` 值为 `http://localhost:3000` 即可 。 + v2.5.0 版本支持 Mock , 修改 `.env.development` 的 `VITE_APP_API_URL` 值为 `http://localhost:3000` 即可 。 - **其他问题** @@ -142,7 +142,7 @@ server { > 1. 获取基于 `Java 、SpringBoot` 开发的后端 [youlai-boot](https://gitee.com/youlaiorg/youlai-boot.git) 源码 ; > 2. 根据后端工程说明文档 [README.md](https://gitee.com/youlaiorg/youlai-boot#%E9%A1%B9%E7%9B%AE%E8%BF%90%E8%A1%8C) 完成本地启动; - > 3. 替换 [.env.development](.env.development) 的代理目标地址 `VITE_APP_TARGET_URL` 的值 `vapi.youlai.tech` 为本地的 `localhost:8989` + > 3. 替换 [.env.development](.env.development) 的代理目标地址 `VITE_APP_API_URL` 的值 `vapi.youlai.tech` 为本地的 `localhost:8989` diff --git a/package.json b/package.json index 355fd83..ada9be0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vue3-element-admin", - "private": true, "version": "2.6.7", + "private": true, "scripts": { "preinstall": "npx only-allow pnpm", "dev": "vite serve --mode development", @@ -63,7 +63,8 @@ "vue": "^3.3.8", "vue-i18n": "9.2.2", "vue-router": "^4.2.5", - "xlsx": "^0.18.5" + "xlsx": "^0.18.5", + "dayjs": "^1.11.10" }, "devDependencies": { "@commitlint/cli": "^17.8.1", diff --git a/src/layout/components/Sidebar/Item.vue b/src/layout/components/Sidebar/Item.vue index 9ca788f..6524a0a 100644 --- a/src/layout/components/Sidebar/Item.vue +++ b/src/layout/components/Sidebar/Item.vue @@ -5,7 +5,6 @@ - - - - - {{ translateRouteTitle(tag.meta?.title) }} - - - - - - - - - - - 刷新 - - - - 关闭 - - - - 关闭其它 - - - - 关闭左侧 - - - - 关闭右侧 - - - - 关闭所有 - - - - -