diff --git a/.cz-config.js b/.cz-config.js index d51aaae8..42a3e376 100644 --- a/.cz-config.js +++ b/.cz-config.js @@ -2,7 +2,7 @@ module.exports = { // type 类型(定义之后,可通过上下键选择) types: [ { value: 'feat', name: 'feat: 新增功能' }, - { value: 'fix', name: 'fix: 修复 bug' }, + { value: 'fix', name: 'fix: 修复bug' }, { value: 'docs', name: 'docs: 文档变更' }, { value: 'style', name: 'style: 代码格式(不影响功能,例如空格、分号等格式修正)' }, { value: 'refactor', name: 'refactor: 代码重构(不包括 bug 修复、功能新增)' }, @@ -20,7 +20,7 @@ module.exports = { ['components', '组件相关'], ['hooks', 'hook 相关'], ['utils', 'utils 相关'], - ['element-ui', '对 element-ui 的调整'], + ['types', 'ts类型相关'], ['styles', '样式相关'], ['deps', '项目依赖'], ['auth', '对 auth 修改'], diff --git a/README.md b/README.md index 53577a38..ca5caee9 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,7 @@ soybean-admin │ │ ├── dark-mode.ts //windicss暗黑模式插件 │ │ └── smooth-scroll.ts //滚动平滑插件 │ ├── router //vue路由 +│ │ ├── menus.ts //菜单 │ │ ├── permission.ts //路由守卫相关函数 │ │ └── routes.ts //声明的路由 │ ├── service //网络请求 diff --git a/build/plugins/html.ts b/build/plugins/html.ts index 05f9581b..b992212c 100644 --- a/build/plugins/html.ts +++ b/build/plugins/html.ts @@ -6,7 +6,7 @@ export default [ injectHtml({ injectData: { title: viteEnv.VITE_APP_TITLE, - appName: viteEnv.VITE_APP_TITLE_Label + appName: viteEnv.VITE_APP_TITLE_LABEL } }) ]; diff --git a/index.html b/index.html index 5a9c3245..1efb0097 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,25 @@ -
+
+ +
+ +
+
+ + + + +
+
+

<%= appName %>

+ +
+ +
diff --git a/public/resource/loading.css b/public/resource/loading.css new file mode 100644 index 00000000..b990f450 --- /dev/null +++ b/public/resource/loading.css @@ -0,0 +1,90 @@ +.app-loading { + position: fixed; + left: 0; + top: 0; + z-index: -1; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + width: 100%; + height: 100%; +} +.app-loading_logo { + width: 128px; + height: 128px; +} +.app-loading__dot-wrapper { + width: 56px; + height: 56px; + margin: 36px 0; +} +.app-loading__dot { + position: relative; + height: 100%; + transform: rotate(45deg); + animation-name: loadingRotate; + animation-duration: 1.2s; + animation-iteration-count: infinite; + animation-timing-function: linear; +} +@keyframes loadingRotate { + to { + -webkit-transform: rotate(405deg); + transform: rotate(405deg); + } +} +@-webkit-keyframes loadingRotate { + to { + -webkit-transform: rotate(405deg); + transform: rotate(405deg); + } +} +.app-loading__dot > i { + position: absolute; + display: block; + width: 18px; + height: 18px; + background: #1890ff; + border-radius: 50%; + -webkit-transform: scale(0.75); + transform: scale(0.75); + transform-origin: 50% 50%; + opacity: 0.3; + animation: spinOpacity 1s infinite linear alternate; +} +@keyframes spinOpacity { + to { + opacity: 1; + } +} +@-webkit-keyframes spinOpacity { + to { + opacity: 1; + } +} +.delay-400 { + animation-delay: 0.4s !important; +} +.delay-800 { + animation-delay: 0.8s !important; +} +.delay-1200 { + animation-delay: 1.2s !important; +} +.left { + left: 0; +} +.right { + right: 0; +} +.top { + top: 0; +} +.bottom { + bottom: 0; +} +.app-loading_title { + font-size: 28px; + color: #646464; +} diff --git a/public/resource/logo.png b/public/resource/logo.png new file mode 100644 index 00000000..6641c827 Binary files /dev/null and b/public/resource/logo.png differ diff --git a/src/interface/common.ts b/src/interface/common.ts index a0c63f86..7989e64c 100644 --- a/src/interface/common.ts +++ b/src/interface/common.ts @@ -9,8 +9,8 @@ interface RouteMeta { title?: string; /** 页面100%视高 */ fullPage?: boolean; - /** 作为菜单 */ - asMenu?: boolean; + /** 不作为菜单 */ + isNotMenu?: boolean; /** 菜单和面包屑对应的图标 */ icon?: Component; } diff --git a/src/layouts/BasicLayout/components/GlobalHeader/components/GlobalBreadcrumb.vue b/src/layouts/BasicLayout/components/GlobalHeader/components/GlobalBreadcrumb.vue new file mode 100644 index 00000000..203c81d6 --- /dev/null +++ b/src/layouts/BasicLayout/components/GlobalHeader/components/GlobalBreadcrumb.vue @@ -0,0 +1,66 @@ + + + + diff --git a/src/layouts/BasicLayout/components/GlobalHeader/components/index.ts b/src/layouts/BasicLayout/components/GlobalHeader/components/index.ts index 5937cc97..d86b6749 100644 --- a/src/layouts/BasicLayout/components/GlobalHeader/components/index.ts +++ b/src/layouts/BasicLayout/components/GlobalHeader/components/index.ts @@ -1,3 +1,4 @@ +import GlobalBreadcrumb from './GlobalBreadcrumb.vue'; import UserAvatar from './UserAvatar.vue'; import MenuCollapse from './MenuCollapse.vue'; import FullScreen from './FullScreen.vue'; @@ -5,4 +6,4 @@ import SettingDrawerButton from './SettingDrawerButton.vue'; import GihubSite from './GihubSite.vue'; import HeaderItem from './HeaderItem.vue'; -export { UserAvatar, MenuCollapse, FullScreen, SettingDrawerButton, GihubSite, HeaderItem }; +export { GlobalBreadcrumb, UserAvatar, MenuCollapse, FullScreen, SettingDrawerButton, GihubSite, HeaderItem }; diff --git a/src/layouts/BasicLayout/components/GlobalHeader/index.vue b/src/layouts/BasicLayout/components/GlobalHeader/index.vue index 964ff445..5a020afa 100644 --- a/src/layouts/BasicLayout/components/GlobalHeader/index.vue +++ b/src/layouts/BasicLayout/components/GlobalHeader/index.vue @@ -5,7 +5,10 @@ - +
+ + +
@@ -20,7 +23,7 @@ import { computed } from 'vue'; import { NLayoutHeader } from 'naive-ui'; import { useThemeStore } from '@/store'; -import { UserAvatar, MenuCollapse, FullScreen, GihubSite, SettingDrawerButton } from './components'; +import { GlobalBreadcrumb, UserAvatar, MenuCollapse, FullScreen, GihubSite, SettingDrawerButton } from './components'; import { GlobalLogo } from '../common'; defineProps({ diff --git a/src/router/menus.ts b/src/router/menus.ts index 0ff90f65..5057093f 100644 --- a/src/router/menus.ts +++ b/src/router/menus.ts @@ -31,7 +31,7 @@ export function transformRouteToMenu(routes: CustomRoute[]) { /** 判断路由是否作为菜单 */ function asMenu(route: CustomRoute) { - return Boolean(route.meta?.asMenu); + return !route.meta?.isNotMenu; } /** 给菜单添加可选属性 */ diff --git a/src/router/routes.ts b/src/router/routes.ts index 7732fbae..b0480320 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -91,7 +91,7 @@ export const customRoutes: CustomRoute[] = [ path: EnumRoutePath.root, redirect: { name: RouteNameMap.get('dashboard-analysis') }, meta: { - asMenu: false + isNotMenu: true } }, { @@ -101,7 +101,6 @@ export const customRoutes: CustomRoute[] = [ redirect: { name: RouteNameMap.get('dashboard-analysis') }, meta: { title: EnumRouteTitle.dashboard, - asMenu: true, icon: Dashboard }, children: [ @@ -110,8 +109,7 @@ export const customRoutes: CustomRoute[] = [ path: EnumRoutePath['dashboard-analysis'], component: () => import('@/views/dashboard/analysis/index.vue'), meta: { - title: EnumRouteTitle['dashboard-analysis'], - asMenu: true + title: EnumRouteTitle['dashboard-analysis'] } }, { @@ -119,8 +117,7 @@ export const customRoutes: CustomRoute[] = [ path: EnumRoutePath['dashboard-workbench'], component: () => import('@/views/dashboard/workbench/index.vue'), meta: { - title: EnumRouteTitle['dashboard-workbench'], - asMenu: true + title: EnumRouteTitle['dashboard-workbench'] } } ] @@ -131,7 +128,6 @@ export const customRoutes: CustomRoute[] = [ component: BasicLayout, meta: { title: EnumRouteTitle.exception, - asMenu: true, icon: ExceptionOutlined }, children: [ @@ -141,8 +137,7 @@ export const customRoutes: CustomRoute[] = [ component: () => import('@/views/system/exception/403.vue'), meta: { title: EnumRouteTitle['exception-403'], - fullPage: true, - asMenu: true + fullPage: true } }, { @@ -151,8 +146,7 @@ export const customRoutes: CustomRoute[] = [ component: () => import('@/views/system/exception/404.vue'), meta: { title: EnumRouteTitle['exception-404'], - fullPage: true, - asMenu: true + fullPage: true } }, { @@ -161,8 +155,7 @@ export const customRoutes: CustomRoute[] = [ component: () => import('@/views/system/exception/500.vue'), meta: { title: EnumRouteTitle['exception-500'], - fullPage: true, - asMenu: true + fullPage: true } } ]