From c85f0a199507c0464c0d53036956aaba0789e971 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期五, 01 九月 2023 11:38:23 +0800 Subject: [PATCH] update 优化 控制台debuger位置错误问题 update 优化 TopNav 菜单样式 fix 修复 布局配置失效问题 --- /dev/null | 5 -- src/layout/components/Navbar.vue | 4 +- src/store/modules/settings.ts | 14 +++--- src/views/system/user/profile/index.vue | 7 +-- package.json | 2 src/components/TopNav/index.vue | 14 ++++++ src/layout/components/TagsView/index.vue | 2 src/layout/components/TopBar/search.vue | 0 vite/plugins/index.ts | 4 +- vite/plugins/setup-extend.ts | 5 ++ LICENSE | 20 ++++++++++ src/settings.ts | 2 12 files changed, 54 insertions(+), 25 deletions(-) diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..32b3071 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2019 RuoYi-Vue-Plus + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/package.json b/package.json index 039083c..2d76393 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "vite": "4.3.1", "vite-plugin-compression": "0.5.1", "vite-plugin-svg-icons": "2.0.1", - "vite-plugin-vue-setup-extend": "^0.4.0", + "unplugin-vue-setup-extend-plus": "0.4.9", "vitest": "^0.29.7", "vue-eslint-parser": "9.1.0", "vue-tsc": "0.35.0" diff --git a/src/components/TopNav/index.vue b/src/components/TopNav/index.vue index 2092415..227fccc 100644 --- a/src/components/TopNav/index.vue +++ b/src/components/TopNav/index.vue @@ -2,7 +2,9 @@ <el-menu :default-active="activeMenu" mode="horizontal" @select="handleSelect" :ellipsis="false"> <template v-for="(item, index) in topMenus"> <el-menu-item :style="{'--theme': theme}" :index="item.path" :key="index" v-if="index < visibleNumber" - ><svg-icon :icon-class="item.meta ? item.meta.icon : '' " /> {{ item.meta?.title }}</el-menu-item + ><svg-icon + v-if="item.meta && item.meta.icon && item.meta.icon !== '#'" + :icon-class="item.meta ? item.meta.icon : '' " /> {{ item.meta?.title }}</el-menu-item > </template> @@ -180,4 +182,14 @@ padding: 0 5px !important; margin: 0 10px !important; } + +/* 鑳屾櫙鑹查殣钘� */ +.topmenu-container.el-menu--horizontal>.el-menu-item:not(.is-disabled):focus, .topmenu-container.el-menu--horizontal>.el-menu-item:not(.is-disabled):hover, .topmenu-container.el-menu--horizontal>.el-submenu .el-submenu__title:hover { + background-color: #ffffff !important; +} + +/* 鍥炬爣鍙抽棿璺� */ +.topmenu-container .svg-icon { + margin-right: 4px; +} </style> diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index d001ea8..3c0e45d 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -58,7 +58,7 @@ <router-link to="/user/profile" v-if="!dynamic"> <el-dropdown-item>{{ $t('navbar.personalCenter') }}</el-dropdown-item> </router-link> - <el-dropdown-item command="setLayout"> + <el-dropdown-item command="setLayout" v-if="settingsStore.showSettings"> <span>{{ $t('navbar.layoutSetting') }}</span> </el-dropdown-item> <el-dropdown-item divided command="logout"> @@ -73,7 +73,7 @@ </template> <script setup lang="ts"> -import SearchMenu from './topBar/search.vue'; +import SearchMenu from './TopBar/search.vue'; import useAppStore from '@/store/modules/app'; import useUserStore from '@/store/modules/user'; import useSettingsStore from '@/store/modules/settings'; diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue index 8998ca1..1df486e 100644 --- a/src/layout/components/TagsView/index.vue +++ b/src/layout/components/TagsView/index.vue @@ -278,7 +278,7 @@ height: 8px; border-radius: 50%; position: relative; - margin-right: 2px; + margin-right: 5px; } } } diff --git a/src/layout/components/topBar/search.vue b/src/layout/components/TopBar/search.vue similarity index 100% rename from src/layout/components/topBar/search.vue rename to src/layout/components/TopBar/search.vue diff --git a/src/settings.ts b/src/settings.ts index dd171e7..9cebde7 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -13,7 +13,7 @@ /** * 鏄惁绯荤粺甯冨眬閰嶇疆 */ - showSettings: false, + showSettings: true, /** * 鏄惁鏄剧ず椤堕儴瀵艰埅 diff --git a/src/store/modules/settings.ts b/src/store/modules/settings.ts index b9a5730..fcf595c 100644 --- a/src/store/modules/settings.ts +++ b/src/store/modules/settings.ts @@ -11,13 +11,13 @@ title: ref<string>(''), theme: ref<string>(storageSetting.theme || defaultSettings.theme), sideTheme: ref<string>(storageSetting.sideTheme || defaultSettings.sideTheme), - showSettings: ref<boolean>(storageSetting.showSettings), - topNav: ref<boolean>(storageSetting.topNav || defaultSettings.topNav), - tagsView: ref<boolean>(storageSetting.tagsView || defaultSettings.tagsView), - fixedHeader: ref<boolean>(storageSetting.fixedHeader || defaultSettings.fixedHeader), - sidebarLogo: ref<boolean>(storageSetting.sidebarLogo || defaultSettings.sidebarLogo), - dynamicTitle: ref<boolean>(storageSetting.dynamicTitle || defaultSettings.dynamicTitle), - animationEnable: ref<boolean>(storageSetting.animationEnable || defaultSettings.animationEnable), + showSettings: ref<boolean>(storageSetting.showSettings || defaultSettings.showSettings), + topNav: ref<boolean>(storageSetting.topNav === undefined ? defaultSettings.topNav : storageSetting.topNav), + tagsView: ref<boolean>(storageSetting.tagsView === undefined ? defaultSettings.tagsView : storageSetting.tagsView), + fixedHeader: ref<boolean>(storageSetting.fixedHeader === undefined ? defaultSettings.fixedHeader : storageSetting.fixedHeader), + sidebarLogo: ref<boolean>(storageSetting.sidebarLogo === undefined ? defaultSettings.sidebarLogo : storageSetting.sidebarLogo), + dynamicTitle: ref<boolean>(storageSetting.dynamicTitle === undefined ? defaultSettings.dynamicTitle : storageSetting.dynamicTitle), + animationEnable: ref<boolean>(storageSetting.animationEnable === undefined ? defaultSettings.animationEnable : storageSetting.animationEnable), dark: ref<boolean>(storageSetting.dark || defaultSettings.dark) }; diff --git a/src/views/system/user/profile/index.vue b/src/views/system/user/profile/index.vue index 31dc6ea..8866e0b 100644 --- a/src/views/system/user/profile/index.vue +++ b/src/views/system/user/profile/index.vue @@ -10,7 +10,7 @@ </template> <div> <div class="text-center"> - <userAvatar :user="state.user" /> + <userAvatar/> </div> <ul class="list-group list-group-striped"> <li class="list-group-item"> @@ -66,10 +66,7 @@ </template> <script setup name="Profile" lang="ts"> -import userAvatar from "./userAvatar.vue"; -import userInfo from "./userInfo.vue"; -import resetPwd from "./resetPwd.vue"; -import thirdParty from "./thirdParty.vue"; +import UserAvatar from "./userAvatar.vue"; import { getAuthList } from "@/api/system/social/auth"; import { getUserProfile } from "@/api/system/user"; diff --git a/vite/plugins/index.ts b/vite/plugins/index.ts index 72ca771..a31412d 100644 --- a/vite/plugins/index.ts +++ b/vite/plugins/index.ts @@ -5,7 +5,7 @@ import createIcons from './icons'; import createSvgIconsPlugin from './svg-icon'; import createCompression from './compression'; -import createVueSetupExtend from './vue-setup-extend'; +import createSetupExtend from './setup-extend'; import path from 'path'; export default (viteEnv: any, isBuild = false): [] => { @@ -17,6 +17,6 @@ vitePlusgins.push(createCompression(viteEnv)); vitePlusgins.push(createIcons()); vitePlusgins.push(createSvgIconsPlugin(path, isBuild)); - vitePlusgins.push(createVueSetupExtend()); + vitePlusgins.push(createSetupExtend()); return vitePlusgins; }; diff --git a/vite/plugins/setup-extend.ts b/vite/plugins/setup-extend.ts new file mode 100644 index 0000000..a1dbb5a --- /dev/null +++ b/vite/plugins/setup-extend.ts @@ -0,0 +1,5 @@ +import setupExtend from 'unplugin-vue-setup-extend-plus/vite' + +export default () => { + return setupExtend({}) +}; diff --git a/vite/plugins/vue-setup-extend.ts b/vite/plugins/vue-setup-extend.ts deleted file mode 100644 index 01b6e9d..0000000 --- a/vite/plugins/vue-setup-extend.ts +++ /dev/null @@ -1,5 +0,0 @@ -import VueSetupExtend from 'vite-plugin-vue-setup-extend'; - -export default () => { - return VueSetupExtend(); -}; -- Gitblit v1.9.3