Parcourir la source

去除个人中心菜单,加上首页

ith5 il y a 5 mois
Parent
commit
28908a54f2

+ 24 - 24
src/router/homePageRoutes.js

@@ -1,25 +1,25 @@
 const homePageRoutes = [
   {
-    name: "dashboard",
-    path: "/dashboard",
+    name: 'dashboard',
+    path: '/dashboard',
     meta: {
-      title: "仪表盘",
-      icon: "icon-dashboard",
-      type: "M",
-      affix: true,
+      title: '仪表盘',
+      icon: 'icon-dashboard',
+      type: 'M',
+      affix: true
     },
-    component: () => import("@/views/dashboard/index.vue"),
-  },
-  {
-    name: "userCenter",
-    path: "/usercenter",
-    meta: {
-      title: "个人信息",
-      icon: "icon-user",
-      type: "M",
-    },
-    component: () => import("@/views/dashboard/userCenter/index.vue"),
-  },
+    component: () => import('@/views/dashboard/index.vue')
+  }
+  // {
+  //   name: "userCenter",
+  //   path: "/usercenter",
+  //   meta: {
+  //     title: "个人信息",
+  //     icon: "icon-user",
+  //     type: "M",
+  //   },
+  //   component: () => import("@/views/dashboard/userCenter/index.vue"),
+  // },
   // {
   //   name: 'appStore',
   //   path: 'https://saas.saithink.top/#/appStore',
@@ -29,12 +29,12 @@ const homePageRoutes = [
   //     type: 'L'
   //   }
   // }
-];
+]
 
 export const homePage = {
-  name: "home",
-  path: "/home",
-  meta: { title: "首页", icon: "icon-home", hidden: false, type: "M" },
-};
+  name: 'home',
+  path: '/home',
+  meta: { title: '首页', icon: 'icon-home', hidden: false, type: 'M' }
+}
 
-export default homePageRoutes;
+export default homePageRoutes

+ 30 - 29
src/router/webRouter.js

@@ -2,47 +2,48 @@
 //系统路由
 const routes = [
   {
-    name: "layout",
-    path: "/",
-    component: () => import("@/layout/index.vue"),
-    redirect: "dashboard",
+    name: 'layout',
+    path: '/',
+    component: () => import('@/layout/index.vue'),
+    redirect: 'dashboard',
     // children: homePageRoutes,
     children: [
       {
-        name: "dashboard",
-        path: "/dashboard",
+        name: 'dashboard',
+        path: '/dashboard',
         meta: {
-          title: "仪表盘",
-          icon: "icon-dashboard",
-          type: "M",
-          affix: true,
+          title: '仪表盘',
+          icon: 'icon-dashboard',
+          type: 'M',
+          affix: true
         },
-        component: () => import("@/views/dashboard/index.vue"),
+        component: () => import('@/views/dashboard/index.vue')
       },
       {
-        name: "userCenter",
-        path: "/usercenter",
+        name: 'userCenter',
+        path: '/usercenter',
         meta: {
-          title: "个人信息",
-          icon: "icon-user",
-          type: "M",
+          title: '个人信息',
+          icon: 'icon-user',
+          type: 'M',
+          hidden: true
         },
-        component: () => import("@/views/dashboard/userCenter/index.vue"),
-      },
-    ],
+        component: () => import('@/views/dashboard/userCenter/index.vue')
+      }
+    ]
   },
   {
-    name: "login",
-    path: "/login",
-    component: () => import("@/views/login.vue"),
-    meta: { title: "登录" },
+    name: 'login',
+    path: '/login',
+    component: () => import('@/views/login.vue'),
+    meta: { title: '登录' }
   },
   {
-    path: "/:pathMatch(.*)*",
+    path: '/:pathMatch(.*)*',
     hidden: true,
-    meta: { title: "访问的页面不存在" },
-    component: () => import("@/layout/404.vue"),
-  },
-];
+    meta: { title: '访问的页面不存在' },
+    component: () => import('@/layout/404.vue')
+  }
+]
 
-export default routes;
+export default routes

+ 1 - 1
src/views/dashboard/components/components/st-loginChart.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="ma-content-block p-3 mt-3">
+  <div class="ma-content-block p-3 mt-3" v-if="xAxis.length > 0">
     <a-card
       :bordered="false"
       class="general-card"

+ 17 - 23
src/views/dashboard/components/components/st-welcome.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="flex justify-between">
+  <div class="flex justify-between mb-2">
     <div class="ma-content-block rounded-sm flex justify-between w-full p-3">
       <div class="pl-0 flex inline-block">
         <!-- <a-avatar :size="75" class="hidden lg:inline-block">
@@ -12,15 +12,9 @@
           />
         </a-avatar> -->
         <div class="pl-3 mt-2">
-          <div class="content-block-title">
-            {{ userStore.user.nickname || userStore.user.username }},欢迎回来!
-          </div>
+          <div class="content-block-title">{{ userStore.user.nickname || userStore.user.username }},欢迎回来!</div>
           <div class="leading-5 mt-2">
-            <a-tag
-              class="tag-primary"
-              v-for="item in userStore.user.roleList"
-              :key="item.id"
-            >
+            <a-tag class="tag-primary" v-for="item in userStore.user.roleList" :key="item.id">
               {{ item.name }}
             </a-tag>
           </div>
@@ -35,27 +29,27 @@
 </template>
 
 <script setup>
-import { ref, onMounted } from "vue";
-import { useUserStore } from "@/store";
-import dayjs from "dayjs";
+import { ref, onMounted } from 'vue'
+import { useUserStore } from '@/store'
+import dayjs from 'dayjs'
 
-const userStore = useUserStore();
-const visible = ref(false);
+const userStore = useUserStore()
+const visible = ref(false)
 
-const time = ref(null);
-const day = ref(null);
+const time = ref(null)
+const day = ref(null)
 
 onMounted(() => {
-  showTime();
-  setInterval(() => showTime(), 1000);
-});
+  showTime()
+  setInterval(() => showTime(), 1000)
+})
 
 const showTime = () => {
-  time.value = dayjs().format("HH:mm:ss");
-  day.value = dayjs().format("YYYY年MM月DD日");
-};
+  time.value = dayjs().format('HH:mm:ss')
+  day.value = dayjs().format('YYYY年MM月DD日')
+}
 
-const donate = () => (visible.value = true);
+const donate = () => (visible.value = true)
 </script>
 
 <style scoped>

+ 1 - 1
src/views/dashboard/components/statistics.vue

@@ -1,5 +1,5 @@
 <template>
-  <!-- <st-welcome /> -->
+  <st-welcome />
   <st-count />
   <st-login-chart />
 </template>

+ 1 - 2
src/views/dashboard/index.vue

@@ -1,7 +1,6 @@
 <template>
   <a-layout-content class="flex flex-col">
-    <statistics v-if="userStore.user && userStore.user.dashboard === 'statistics'" />
-    <work-panel v-else-if="userStore.user" />
+    <statistics />
   </a-layout-content>
 </template>