From a402d33b899bb2c58f5a66bfd0b47fa46cf7618b Mon Sep 17 00:00:00 2001 From: xiaoming <1923740402@qq.com> Date: Wed, 17 Apr 2024 15:41:37 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=A1=86=E6=9E=B6=E6=A0=B8=E5=BF=83?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=9B=BD=E9=99=85=E5=8C=96=E5=85=A8=E9=87=8F?= =?UTF-8?q?=E8=A6=86=E7=9B=96=EF=BC=88=E4=BB=85=E9=9C=80=E5=A4=84=E7=90=86?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E4=BB=A3=E7=A0=81=E5=9B=BD=E9=99=85=E5=8C=96?= =?UTF-8?q?=E5=8D=B3=E5=8F=AF=EF=BC=89=20(#1082)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.zh_CN.md | 4 +- locales/en.yaml | 52 ++++++- locales/zh-CN.yaml | 54 +++++++- src/api/user.ts | 2 +- src/components/ReSegmented/src/index.tsx | 7 +- src/config/index.ts | 2 +- src/layout/components/appMain.vue | 4 +- src/layout/components/navbar.vue | 2 +- src/layout/components/notice/index.vue | 4 +- src/layout/components/notice/noticeList.vue | 5 +- src/layout/components/panel/index.vue | 12 +- .../search/components/SearchFooter.vue | 10 +- .../search/components/SearchHistory.vue | 10 +- .../search/components/SearchModal.vue | 8 +- src/layout/components/setting/index.vue | 127 ++++++++++-------- .../components/sidebar/centerCollapse.vue | 6 +- src/layout/components/sidebar/horizontal.vue | 2 +- .../components/sidebar/leftCollapse.vue | 6 +- src/layout/components/sidebar/mixNav.vue | 2 +- src/layout/components/sidebar/topCollapse.vue | 9 +- src/layout/hooks/useNav.ts | 3 +- src/layout/index.vue | 4 +- src/router/utils.ts | 2 +- src/style/dark.scss | 2 +- src/utils/auth.ts | 2 +- src/utils/responsive.ts | 4 +- src/views/guide/index.vue | 4 +- src/views/login/index.vue | 4 +- 28 files changed, 254 insertions(+), 99 deletions(-) diff --git a/CHANGELOG.zh_CN.md b/CHANGELOG.zh_CN.md index 6ab74107f..41a7a4389 100644 --- a/CHANGELOG.zh_CN.md +++ b/CHANGELOG.zh_CN.md @@ -41,7 +41,7 @@ - 修复`windwos`下点击注册页面会出现滚动条问题 - 修复`windows`下页面切换,内容区会出现滚动条问题 - 修复`pure-table`带状态表格在深色整体风格下状态样式消失的问题 -- 修复项目配置中开启灰色模式和深色整体风格,刷新页面整体风格异常 +- 修复系统配置中开启灰色模式和深色整体风格,刷新页面整体风格异常 ### 🍏 Perf @@ -84,7 +84,7 @@ - 所有`search`搜索图标统一替换为`@iconify-icons/ri/search-line`它比较常用将其放入全局离线图标中 - 移除`iframe`在暗模式下的滤镜效果 - 带来更美观精致的首页 -- 更干净整洁的项目配置右侧弹出面板 +- 更干净整洁的系统配置右侧弹出面板 - 重构关于页面,整体更紧致,关键信息更突出 ### 🎫 Feat diff --git a/locales/en.yaml b/locales/en.yaml index 894f77661..4605818fe 100644 --- a/locales/en.yaml +++ b/locales/en.yaml @@ -2,7 +2,7 @@ buttons: pureAccountSettings: Account pureLoginOut: LoginOut pureLogin: Login - pureSystemSet: Open ProjectConfig + pureOpenSystemSet: Open System Configs pureReload: Reload pureCloseCurrentTab: Close CurrentTab pureCloseLeftTabs: Close LeftTabs @@ -11,6 +11,54 @@ buttons: pureCloseAllTabs: Close AllTabs pureContentFullScreen: Content FullScreen pureContentExitFullScreen: Content ExitFullScreen + pureClickCollapse: Collapse + pureClickExpand: Expand + pureConfirm: Confirm + pureSwitch: Switch + pureClose: Close + pureBackTop: BackTop + pureOpenText: Open + pureCloseText: Close +search: + pureTotal: Total + pureHistory: History + pureCollect: Collect + pureDragSort: (Drag Sort) + pureEmpty: Empty + purePlaceholder: Search Menu +panel: + pureSystemSet: System Configs + pureCloseSystemSet: Close System Configs + pureClearCacheAndToLogin: Clear cache and return to login page + pureClearCache: Clear Cache + pureOverallStyle: Overall Style + pureOverallStyleLight: Light + pureOverallStyleLightTip: Set sail freshly and light up the comfortable work interface + pureOverallStyleDark: Dark + pureOverallStyleDarkTip: Moonlight Overture, indulge in the tranquility and elegance of the night + pureOverallStyleSystem: Auto + pureOverallStyleSystemTip: Synchronize time, the interface naturally responds to morning and dusk + pureThemeColor: Theme Color + pureLayoutModel: Layout Model + pureVerticalTip: The menu on the left is familiar and friendly + pureHorizontalTip: Top menu, concise overview + pureMixTip: Mixed menu, flexible + pureStretch: Stretch Page + pureStretchFixed: Fixed + pureStretchFixedTip: Compact pages make it easy to find the information you need + pureStretchCustom: Custom + pureStretchCustomTip: Minimum 1280, maximum 1600 + pureTagsStyle: Tags Style + pureTagsStyleSmart: Smart + pureTagsStyleSmartTip: Smart tags add fun and brilliance + pureTagsStyleCard: Card + pureTagsStyleCardTip: Card tags for efficient browsing + pureInterfaceDisplay: Interface Display + pureGreyModel: Grey Model + pureWeakModel: Weak Model + pureHiddenTags: Hidden Tags + pureHiddenFooter: Hidden Footer + pureMultiTagsCache: MultiTags Cache menus: pureHome: Home pureLogin: Login @@ -136,6 +184,7 @@ menus: pureChildMenuOverflow: Child Menu Overflow Show Tooltip Text status: pureLoad: Loading... + pureNoMessage: No Message login: pureUsername: Username purePassword: Password @@ -160,6 +209,7 @@ login: pureTip: After scanning the code, click "Confirm" to complete the login pureDefinite: Definite pureLoginSuccess: Login Success + pureLoginFail: Login Fail pureRegisterSuccess: Regist Success pureTickPrivacy: Please tick Privacy Policy pureReadAccept: I have read it carefully and accept diff --git a/locales/zh-CN.yaml b/locales/zh-CN.yaml index 69a6a8641..1d2f2ce15 100644 --- a/locales/zh-CN.yaml +++ b/locales/zh-CN.yaml @@ -2,7 +2,7 @@ buttons: pureAccountSettings: 账户设置 pureLoginOut: 退出系统 pureLogin: 登录 - pureSystemSet: 打开项目配置 + pureOpenSystemSet: 打开系统配置 pureReload: 重新加载 pureCloseCurrentTab: 关闭当前标签页 pureCloseLeftTabs: 关闭左侧标签页 @@ -11,6 +11,54 @@ buttons: pureCloseAllTabs: 关闭全部标签页 pureContentFullScreen: 内容区全屏 pureContentExitFullScreen: 内容区退出全屏 + pureClickCollapse: 点击折叠 + pureClickExpand: 点击展开 + pureConfirm: 确认 + pureSwitch: 切换 + pureClose: 关闭 + pureBackTop: 回到顶部 + pureOpenText: 开 + pureCloseText: 关 +search: + pureTotal: 共 + pureHistory: 搜索历史 + pureCollect: 收藏 + pureDragSort: (可拖拽排序) + pureEmpty: 暂无搜索结果 + purePlaceholder: 搜索菜单(支持拼音搜索) +panel: + pureSystemSet: 系统配置 + pureCloseSystemSet: 关闭配置 + pureClearCacheAndToLogin: 清空缓存并返回登录页 + pureClearCache: 清空缓存 + pureOverallStyle: 整体风格 + pureOverallStyleLight: 浅色 + pureOverallStyleLightTip: 清新启航,点亮舒适的工作界面 + pureOverallStyleDark: 深色 + pureOverallStyleDarkTip: 月光序曲,沉醉于夜的静谧雅致 + pureOverallStyleSystem: 自动 + pureOverallStyleSystemTip: 同步时光,界面随晨昏自然呼应 + pureThemeColor: 主题色 + pureLayoutModel: 导航模式 + pureVerticalTip: 左侧菜单,亲切熟悉 + pureHorizontalTip: 顶部菜单,简洁概览 + pureMixTip: 混合菜单,灵活多变 + pureStretch: 页宽 + pureStretchFixed: 固定 + pureStretchFixedTip: 紧凑页面,轻松找到所需信息 + pureStretchCustom: 自定义 + pureStretchCustomTip: 最小1280、最大1600 + pureTagsStyle: 页签风格 + pureTagsStyleSmart: 灵动 + pureTagsStyleSmartTip: 灵动标签,添趣生辉 + pureTagsStyleCard: 卡片 + pureTagsStyleCardTip: 卡片标签,高效浏览 + pureInterfaceDisplay: 界面显示 + pureGreyModel: 灰色模式 + pureWeakModel: 色弱模式 + pureHiddenTags: 隐藏标签页 + pureHiddenFooter: 隐藏页脚 + pureMultiTagsCache: 页签持久化 menus: pureHome: 首页 pureLogin: 登录 @@ -136,6 +184,7 @@ menus: pureChildMenuOverflow: 菜单超出显示 Tooltip 文字提示 status: pureLoad: 加载中... + pureNoMessage: 暂无消息 login: pureUsername: 账号 purePassword: 密码 @@ -160,6 +209,7 @@ login: pureTip: 扫码后点击"确认",即可完成登录 pureDefinite: 确定 pureLoginSuccess: 登录成功 + pureLoginFail: 登录失败 pureRegisterSuccess: 注册成功 pureTickPrivacy: 请勾选隐私政策 pureReadAccept: 我已仔细阅读并接受 @@ -176,4 +226,4 @@ login: purePassWordRuleReg: 密码格式应为8-18位数字、字母、符号的任意两种组合 purePassWordSureReg: 请输入确认密码 purePassWordDifferentReg: 两次密码不一致! - purePassWordUpdateReg: 修改密码成功 \ No newline at end of file + purePassWordUpdateReg: 修改密码成功 diff --git a/src/api/user.ts b/src/api/user.ts index 79c30ce0c..58696b665 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -5,7 +5,7 @@ export type UserResult = { data: { /** 用户名 */ username: string; - /** 当前登陆用户的角色 */ + /** 当前登录用户的角色 */ roles: Array; /** `token` */ accessToken: string; diff --git a/src/components/ReSegmented/src/index.tsx b/src/components/ReSegmented/src/index.tsx index 5d20005e0..f28d30d16 100644 --- a/src/components/ReSegmented/src/index.tsx +++ b/src/components/ReSegmented/src/index.tsx @@ -42,6 +42,11 @@ const props = { disabled: { type: Boolean, default: false + }, + /** 当内容发生变化时,设置 `resize` 可使其自适应容器位置 */ + resize: { + type: Boolean, + default: false } }; @@ -108,7 +113,7 @@ export default defineComponent({ }); } - props.block && handleResizeInit(); + (props.block || props.resize) && handleResizeInit(); watch( () => curIndex.value, diff --git a/src/config/index.ts b/src/config/index.ts index 3573dc2d3..c81d1c4d7 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -35,7 +35,7 @@ export const getPlatformConfig = async (app: App): Promise => { }) .then(({ data: config }) => { let $config = app.config.globalProperties.$config; - // 自动注入项目配置 + // 自动注入系统配置 if (app && $config && typeof config === "object") { $config = Object.assign($config, config); app.config.globalProperties.$config = $config; diff --git a/src/layout/components/appMain.vue b/src/layout/components/appMain.vue index 8543acc24..9f8d767c1 100644 --- a/src/layout/components/appMain.vue +++ b/src/layout/components/appMain.vue @@ -1,4 +1,5 @@ diff --git a/src/layout/components/panel/index.vue b/src/layout/components/panel/index.vue index 6a1bb446a..ff08bd376 100644 --- a/src/layout/components/panel/index.vue +++ b/src/layout/components/panel/index.vue @@ -1,4 +1,5 @@ @@ -16,22 +18,22 @@ const { device } = useNav(); diff --git a/src/layout/components/search/components/SearchHistory.vue b/src/layout/components/search/components/SearchHistory.vue index 132ad4b60..87d5488c9 100644 --- a/src/layout/components/search/components/SearchHistory.vue +++ b/src/layout/components/search/components/SearchHistory.vue @@ -1,5 +1,6 @@