Browse Source

二期启动开发

刘洋 1 year ago
parent
commit
fb52a167a9

+ 23 - 0
src/router/asyncRoutes.js

@@ -6,6 +6,7 @@ import workHours from './modules/workHours';
 import projectQuality from './modules/projectQuality';
 import User from './modules/user';
 import System from './modules/system';
+import Report from './modules/report';
 
 const asyncRoutes = [
   myWorkbenches,
@@ -16,6 +17,7 @@ const asyncRoutes = [
   projectQuality,
   User,
   System,
+  Report,
 ];
 export const moduleMap = asyncRoutes.reduce((obj, item) => {
   obj[item.path.slice(1)] = item.name;
@@ -97,4 +99,25 @@ export const whiteMenuList = [
     type: 'MENU',
   },
 ];
+
+//开发阶段临时创造的菜单白名单,等后端接口菜单完善后弃用
+export const devPushMenuList = [
+  {
+    id: '2000',
+    name: '数据驾驶舱',
+    parentId: '-1',
+    url: 'test',
+    sort: 9,
+    type: 'MENU',
+  },
+  {
+    id: '2001',
+    name: '数据驾驶舱',
+    parentId: '2000',
+    url: 'test1',
+    sort: 1,
+    type: 'MENU',
+  },
+];
+
 export default asyncRoutes;

+ 24 - 0
src/router/modules/report.js

@@ -0,0 +1,24 @@
+export default {
+  name: 'Report',
+  path: '/report',
+  meta: {
+    title: '数据驾驶舱',
+    sort: 9,
+    isModule: true,
+    alias: '',
+    icon: 'work',
+  },
+  children: [
+    {
+      name: 'DispatchAnalysis',
+      path: '/report/dispatch-analysis',
+      component: () => import('@/views/report/dispatch-analysis/index.vue'),
+      meta: {
+        title: '派单分析',
+        sort: 1,
+        alias: '',
+        icon: 'notice',
+      },
+    },
+  ],
+};

+ 9 - 2
src/store/modules/user.js

@@ -2,7 +2,10 @@ import { defineStore } from 'pinia';
 import { cloneDeep, omit } from 'lodash';
 import { getMenus, logout, login } from '@/api/user';
 import router from '@/router/index';
-import asyncRoutes, { whiteMenuList } from '@/router/asyncRoutes';
+import asyncRoutes, {
+  whiteMenuList,
+  devPushMenuList,
+} from '@/router/asyncRoutes';
 import { getTreeList, local, session, clear } from '@/utils/tool';
 import { routesNotMenu } from '@/router/asyncRoutes';
 
@@ -162,7 +165,11 @@ const useUserStore = defineStore('user', {
               router.push({ name: 'Login' });
               return;
             }
-            let allMenus = [...whiteMenuList, ...(response.privileges || [])];
+            let allMenus = [
+              ...whiteMenuList,
+              ...(response.privileges || []),
+              ...devPushMenuList,
+            ];
             this.setMenu(allMenus);
             this.setFinePermissionIds(allMenus);
             resolve(allMenus);

+ 7 - 0
src/views/report/dispatch-analysis/index.vue

@@ -0,0 +1,7 @@
+<template>
+  <div class="dispatch-analysis"> 派单分析</div>
+</template>
+
+<script setup name="DispatchAnalysis"></script>
+
+<style lang="scss" scoped></style>