diff --git a/package.json b/package.json index 7cbae876..0986f367 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,6 @@ "lint": "eslint \"{src}/**/*.{vue,ts,tsx}\" --fix --ext" }, "dependencies": { - "@vicons/ionicons5": "~0.11.0", "axios": "^0.23.0", "mockjs": "^1.1.0", "naive-ui": "^2.19.9", @@ -18,6 +17,7 @@ "vue-router": "4.0.12" }, "devDependencies": { + "@vicons/ionicons5": "~0.11.0", "@types/node": "^16.11.1", "@typescript-eslint/eslint-plugin": "^5.6.0", "@typescript-eslint/parser": "^5.6.0", diff --git a/src/assets/images/project/project-top-bg.png b/src/assets/images/project/project-top-bg.png new file mode 100644 index 00000000..96da55e9 Binary files /dev/null and b/src/assets/images/project/project-top-bg.png differ diff --git a/src/components/Application/Application.vue b/src/components/Application/Application.vue index 53f89c65..8ce52cc5 100644 --- a/src/components/Application/Application.vue +++ b/src/components/Application/Application.vue @@ -12,13 +12,6 @@ - - + + diff --git a/src/enums/pageEnum.ts b/src/enums/pageEnum.ts index 824f8ef8..3facd572 100644 --- a/src/enums/pageEnum.ts +++ b/src/enums/pageEnum.ts @@ -13,9 +13,17 @@ export enum PageEnum { BASE_HOME = '/project', BASE_HOME_NAME = 'Project', + // 我的项目 + BASE_HOME_ITEMS = '/project/items', + BASE_HOME_ITEMS_NAME = 'Project-Ttems', + + // 我的模板 + BASE_HOME_TEMPLATE = '/project/my-template', + BASE_HOME_TEMPLATE_NAME = 'Project-My-Template', + // 模板市场 - BASE_HOME_Template_Market = '/project/templateMarket', - BASE_HOME_Template_Market_NAME = 'Project-TemplateMarket', + BASE_HOME_TEMPLATE_MARKET = '/project/template-market', + BASE_HOME_TEMPLATE_MARKET_NAME = 'Project-Template-Market', // 错误 ERROR_PAGE_NAME_403 = 'ErrorPage403', diff --git a/src/layout/components/Header/index.vue b/src/layout/components/Header/index.vue index 23c8e716..5c6896ec 100644 --- a/src/layout/components/Header/index.vue +++ b/src/layout/components/Header/index.vue @@ -32,9 +32,5 @@ import { LangSelect } from '@/components/LangSelect' padding: 0 60px; height: $--header-height; } - &-divider { - margin: 0; - padding-top: 0; - } } diff --git a/src/layout/components/Main/index.vue b/src/layout/components/Main/index.vue index 34d082de..1362764b 100644 --- a/src/layout/components/Main/index.vue +++ b/src/layout/components/Main/index.vue @@ -1,11 +1,7 @@ diff --git a/src/layout/components/TransitionMain/index.ts b/src/layout/components/TransitionMain/index.ts new file mode 100644 index 00000000..b236a3ec --- /dev/null +++ b/src/layout/components/TransitionMain/index.ts @@ -0,0 +1,3 @@ +import TransitionMain from './index.vue'; + +export { TransitionMain }; diff --git a/src/layout/components/TransitionMain/index.vue b/src/layout/components/TransitionMain/index.vue new file mode 100644 index 00000000..3a34c8dd --- /dev/null +++ b/src/layout/components/TransitionMain/index.vue @@ -0,0 +1,18 @@ + diff --git a/src/layout/index.vue b/src/layout/index.vue index 1dc5a750..a6de0ced 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -6,17 +6,8 @@ import { ref, onMounted } from 'vue' import { useLoadingBar } from 'naive-ui' import { MainView } from '@/layout/components/Main/index' -const collapsed = ref(false) - -const watchWidth = () => { - const Width = document.body.clientWidth - if (Width <= 950) { - collapsed.value = true - } else collapsed.value = false -} onMounted(() => { - window.addEventListener('resize', watchWidth) //挂载在 window 方便与在js中使用 window['$loading'] = useLoadingBar() window['$loading'].finish() diff --git a/src/plugins/naive.ts b/src/plugins/naive.ts index 37d4848d..301b2658 100644 --- a/src/plugins/naive.ts +++ b/src/plugins/naive.ts @@ -2,6 +2,11 @@ import type { App } from 'vue'; import { create, NA, + NP, + NH1, + NH2, + NH3, + NH4, NText, NConfigProvider, NMessageProvider, @@ -76,6 +81,11 @@ import { const naive = create({ components: [ NA, + NP, + NH1, + NH2, + NH3, + NH4, NText, NMessageProvider, NDialogProvider, diff --git a/src/router/base.ts b/src/router/base.ts index aad943ab..04afcb95 100644 --- a/src/router/base.ts +++ b/src/router/base.ts @@ -40,7 +40,6 @@ export const HttpErrorPage: RouteRecordRaw[] = [ }, ] -// 404 on a page export const ErrorPageRoute: AppRouteRecordRaw = { path: '/:path(.*)*', name: 'ErrorPage', diff --git a/src/router/modules/project.router.ts b/src/router/modules/project.router.ts index 25982fc2..f9f106dc 100644 --- a/src/router/modules/project.router.ts +++ b/src/router/modules/project.router.ts @@ -1,14 +1,50 @@ import { RouteRecordRaw } from 'vue-router' import { PageEnum } from '@/enums/pageEnum' +// 引入路径 +const importPath = { + 'PageEnum.BASE_HOME_NAME': () => import('@/views/project/index.vue'), + 'PageEnum.BASE_HOME_ITEMS_NAME': () => import('@/views/project/items/index.vue'), + 'PageEnum.BASE_HOME_TEMPLATE_NAME': () => import('@/views/project/mtTemplate/index.vue'), + 'PageEnum.BASE_HOME_TEMPLATE_MARKET_NAME': () => import('@/views/project/templateMarket/index.vue') +} + const projectRoutes: RouteRecordRaw = { path: PageEnum.BASE_HOME, name: PageEnum.BASE_HOME_NAME, - component: () => import('@/views/project/index.vue'), + component: importPath['PageEnum.BASE_HOME_NAME'], + redirect: PageEnum.BASE_HOME_ITEMS, meta: { title: '项目', isRoot: true - } + }, + // todo 可采用循环动态插入 + children: [ + { + path: PageEnum.BASE_HOME_ITEMS, + name: PageEnum.BASE_HOME_ITEMS_NAME, + component: importPath['PageEnum.BASE_HOME_ITEMS_NAME'], + meta: { + title: PageEnum.BASE_HOME_ITEMS_NAME + } + }, + { + path: PageEnum.BASE_HOME_TEMPLATE, + name: PageEnum.BASE_HOME_TEMPLATE_NAME, + component: importPath['PageEnum.BASE_HOME_TEMPLATE_NAME'], + meta: { + title: PageEnum.BASE_HOME_TEMPLATE_NAME + } + }, + { + path: PageEnum.BASE_HOME_TEMPLATE_MARKET, + name: PageEnum.BASE_HOME_TEMPLATE_MARKET_NAME, + component: importPath['PageEnum.BASE_HOME_TEMPLATE_MARKET_NAME'], + meta: { + title: PageEnum.BASE_HOME_TEMPLATE_MARKET_NAME + } + } + ] } export default projectRoutes diff --git a/src/settings/designSetting.ts b/src/settings/designSetting.ts index 703a2ecf..738bdfbe 100644 --- a/src/settings/designSetting.ts +++ b/src/settings/designSetting.ts @@ -47,7 +47,7 @@ export const theme = { } // 侧边栏宽度 -export const asideWidth = '240' +export const asideWidth = '270' // 侧边栏缩小后的宽度 export const asideCollapsedWidth = '60' diff --git a/src/styles/common/_dark.scss b/src/styles/common/_dark.scss index 0ff01060..3926caa2 100644 --- a/src/styles/common/_dark.scss +++ b/src/styles/common/_dark.scss @@ -8,4 +8,6 @@ $dark: ( linear-gradient(120deg, $--color-dark-bg-1 0%, $--color-dark-bg-1 100%), //毛玻璃 filter-color: $--filter-color-login-dark, + // 物料市场背景 + items-top-bg: linear-gradient(180deg, $--color-dark-bg-1, rgba(23, 23, 26, 0)) ); diff --git a/src/styles/common/_light.scss b/src/styles/common/_light.scss index eb02afc4..aa90513b 100644 --- a/src/styles/common/_light.scss +++ b/src/styles/common/_light.scss @@ -8,7 +8,4 @@ $light: ( linear-gradient(120deg, $--color-text-1 0%, $--color-text-1 100%), //毛玻璃 filter-color: $--filter-color-login-light, - // 侧边栏 - aside-bg: #fff, - aside-color: rgb(239, 239, 245) ); diff --git a/src/styles/common/animation.scss b/src/styles/common/animation.scss index 20ec553f..d27d32ed 100644 --- a/src/styles/common/animation.scss +++ b/src/styles/common/animation.scss @@ -34,4 +34,4 @@ } .list-complete-leave-active { position: absolute; -} +} \ No newline at end of file diff --git a/src/views/project/index.vue b/src/views/project/index.vue index eb3f9280..162acddf 100644 --- a/src/views/project/index.vue +++ b/src/views/project/index.vue @@ -12,7 +12,9 @@ :native-scrollbar="false" > - + + + @@ -23,6 +25,7 @@ diff --git a/src/views/project/items/index.vue b/src/views/project/items/index.vue new file mode 100644 index 00000000..0a89c2af --- /dev/null +++ b/src/views/project/items/index.vue @@ -0,0 +1,15 @@ + + + + + diff --git a/src/views/project/layout/components/AsideFooter/index.vue b/src/views/project/layout/components/AsideFooter/index.vue index 4e9a8449..f3a3cc76 100644 --- a/src/views/project/layout/components/AsideFooter/index.vue +++ b/src/views/project/layout/components/AsideFooter/index.vue @@ -1,8 +1,24 @@