From 8ceb7ace71f1277cb1a8a9ba77bdea240c6f213c Mon Sep 17 00:00:00 2001 From: xiaozzzi <42293085+xiaozzzi@users.noreply.github.com> Date: Fri, 17 Nov 2023 15:58:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=9A=E5=AE=A2=E6=94=AF=E6=8C=81=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E5=BE=85=E5=8A=9E=E4=BA=8B=E9=A1=B9=E4=B8=8E=E6=97=A5?= =?UTF-8?q?=E5=8E=86=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blossom-web/components.d.ts | 8 +- blossom-web/declaration.d.ts | 1 + blossom-web/index.html | 1 - blossom-web/src/App.vue | 5 +- blossom-web/src/components/BLTag.vue | 18 +- blossom-web/src/router/route-init.ts | 6 +- blossom-web/src/stores/user.ts | 8 + blossom-web/src/views/article/Articles.vue | 99 +++- blossom-web/src/views/article/DocTitle.vue | 79 +-- blossom-web/src/views/index/IndexHeader.vue | 19 +- blossom-web/src/views/index/Login.vue | 32 - blossom-web/src/views/plan/PlanColor.scss | 47 ++ blossom-web/src/views/plan/PlanIndex.vue | 362 ++++++++++++ blossom-web/src/views/todo/TodoIndex.vue | 610 ++++++++++++++++++++ blossom-web/src/views/todo/scripts/types.ts | 84 +++ 15 files changed, 1259 insertions(+), 120 deletions(-) create mode 100644 blossom-web/src/views/plan/PlanColor.scss create mode 100644 blossom-web/src/views/plan/PlanIndex.vue create mode 100644 blossom-web/src/views/todo/TodoIndex.vue create mode 100644 blossom-web/src/views/todo/scripts/types.ts diff --git a/blossom-web/components.d.ts b/blossom-web/components.d.ts index fbbc0ce..07a07ed 100644 --- a/blossom-web/components.d.ts +++ b/blossom-web/components.d.ts @@ -11,13 +11,17 @@ declare module 'vue' { BLRow: typeof import('./src/components/BLRow.vue')['default'] BLTag: typeof import('./src/components/BLTag.vue')['default'] ElButton: typeof import('element-plus/es')['ElButton'] + ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup'] + ElCalendar: typeof import('element-plus/es')['ElCalendar'] + ElDrawer: typeof import('element-plus/es')['ElDrawer'] ElInput: typeof import('element-plus/es')['ElInput'] - ElInputPassword: typeof import('element-plus/es')['ElInputPassword'] ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElPopover: typeof import('element-plus/es')['ElPopover'] + ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] + ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] + ElSlider: typeof import('element-plus/es')['ElSlider'] ElSubMenu: typeof import('element-plus/es')['ElSubMenu'] - ElTooltip: typeof import('element-plus/es')['ElTooltip'] NotFound: typeof import('./src/components/NotFound.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] diff --git a/blossom-web/declaration.d.ts b/blossom-web/declaration.d.ts index e69de29..0c2ae36 100644 --- a/blossom-web/declaration.d.ts +++ b/blossom-web/declaration.d.ts @@ -0,0 +1 @@ +declare module 'element-plus/dist/locale/zh-cn.mjs' diff --git a/blossom-web/index.html b/blossom-web/index.html index bde8bd6..9d86c6e 100644 --- a/blossom-web/index.html +++ b/blossom-web/index.html @@ -9,7 +9,6 @@ diff --git a/blossom-web/src/router/route-init.ts b/blossom-web/src/router/route-init.ts index 6786a3b..e3387c6 100644 --- a/blossom-web/src/router/route-init.ts +++ b/blossom-web/src/router/route-init.ts @@ -11,6 +11,8 @@ const Index = () => import('../views/Index.vue') const Home = () => import('../views/index/Home.vue') const Login = () => import('@/views/index/Login.vue') const Articles = () => import('@/views/article/Articles.vue') +const TodoIndex = () => import('@/views/todo/TodoIndex.vue') +const PlanIndex = () => import('@/views/plan/PlanIndex.vue') router.addRoute({ path: '/404', component: NotFound }) router.addRoute({ path: '/:pathMatch(.*)', redirect: '/404' }) @@ -23,6 +25,8 @@ router.addRoute({ children: [ { path: '/home', name: 'Home', component: Home, meta: { keepAlive: true } }, { path: '/login', name: 'Login', component: Login, meta: { keepAlive: true } }, - { path: '/articles', name: 'Articles', component: Articles, meta: { keepAlive: false } } + { path: '/articles', name: 'Articles', component: Articles, meta: { keepAlive: false } }, + { path: '/todo', name: 'TodoIndex', component: TodoIndex, meta: { keepAlive: false } }, + { path: '/plan', name: 'PlanIndex', component: PlanIndex, meta: { keepAlive: false } } ] }) diff --git a/blossom-web/src/stores/user.ts b/blossom-web/src/stores/user.ts index 7476c54..4d343d3 100644 --- a/blossom-web/src/stores/user.ts +++ b/blossom-web/src/stores/user.ts @@ -47,6 +47,14 @@ export const useUserStore = defineStore('userStore', { auth: Local.get(storeKey) || initAuth(), userinfo: Local.get(userinfoKey) || initUserinfo() }), + getters: { + isLogin: (state): boolean => { + if (!state.auth) { + return false + } + return state.auth.status === AuthStatus.Succ + } + }, actions: { // /** // * 根据用户名密码登录 diff --git a/blossom-web/src/views/article/Articles.vue b/blossom-web/src/views/article/Articles.vue index bb37ada..8a9da46 100644 --- a/blossom-web/src/views/article/Articles.vue +++ b/blossom-web/src/views/article/Articles.vue @@ -28,46 +28,60 @@