AaronBruin 3 månader sedan
förälder
incheckning
80c2976b96

+ 4 - 1
src/api/menu.js

@@ -4,6 +4,9 @@ import request from '@/utils/request'
 export const getRouters = () => {
   return request({
     url: '/getRouters',
-    method: 'get'
+    method: 'get',
+    params: {
+      ibms: true
+    }
   })
 }

+ 30 - 9
src/layout/components/Sidebar/index.vue

@@ -20,7 +20,7 @@
         <div class="menu_bottom_box" ref="scrollWrapper">
           <div class="item_box_sidebar" v-for="(item, index) in filteredArray" :key="item.path + index">
             <div @click="goBack(item.path)">
-              <div class="img_box_item" :class="activeMenu == item.path ? 'activate_img_sidebar' : ''">
+              <div class="img_box_item" :class="getPathUrl(item.path) ? 'activate_img_sidebar' : ''">
                 <svg class="energy_box_icon" aria-hidden="true">
                   <defs>
                     <linearGradient id="myGradient" x1="0%" y1="100%" x2="0%" y2="0%">
@@ -35,7 +35,7 @@
                     </linearGradient>
                   </defs>
                   <use :xlink:href="iconName(item.meta.icon)"
-                    :fill="activeMenu == item.path ? `url('#activate_Gradient')` : `url('#myGradient')`" />
+                    :fill="getPathUrl(item.path) ? `url('#activate_Gradient')` : `url('#myGradient')`" />
                 </svg>
               </div>
               <span class="title_sidebar">{{ item.meta.title }}</span>
@@ -79,7 +79,12 @@ const settingsStore = useSettingsStore()
 const permissionStore = usePermissionStore()
 
 const sidebarRouters = computed(() => permissionStore.sidebarRouters);
-const filteredArray = sidebarRouters.value.filter(obj => obj.hasOwnProperty('meta'));
+const filteredArray = ref([])
+sidebarRouters.value.forEach((item) => {
+  if (item.redirect == "noRedirect") {
+    filteredArray.value = item.children.filter(obj => obj.hasOwnProperty('meta'));
+  }
+})
 
 const showLogo = computed(() => settingsStore.sidebarLogo);
 const sideTheme = computed(() => settingsStore.sideTheme);
@@ -102,20 +107,36 @@ const getMenuTextColor = computed(() => {
   return sideTheme.value === 'theme-dark' ? variables.menuText : variables.menuLightText;
 });
 
-const activeMenu = computed(() => {
+function getPathUrl(pathUrl) {
   const { meta, path } = route;
-  if (meta.activeMenu) {
-    return meta.activeMenu;
+  let arrUrl = path.split("/system/")
+  let arril = ''
+  if (arrUrl.length > 1) {
+    arril = arrUrl[1];
+  } else {
+    arril = arrUrl[0];
+  }
+  if (arril == '/index' && pathUrl == '/') {
+    return true
+  } else {
+    if (arril == pathUrl) {
+      return true
+    }
   }
-  return path;
-});
 
+}
 function iconName(iconClass) {
   return `#icon-${iconClass}`
 }
 
 function goBack(event) {
-  router.push({ path: event || "/" });
+  let path = '/system/' + event
+  console.log(event, 222);
+  if (event == "/") {
+    router.push("/index");
+  } else {
+    router.push({ path: path || "/" });
+  }
 }
 // 向右
 function arrowBack() {

+ 18 - 6
src/layout/index.vue

@@ -1,8 +1,10 @@
 <template>
-  <div :class="classObj" class="app-wrapper">
-    <logo :collapse="isCollapse" class="fixed-header" />
-    <app-main />
-    <sidebar v-if="!sidebar.hide" class="fixed-bottom" />
+  <div class="app">
+    <div :class="classObj" class="app-wrapper">
+      <logo :collapse="isCollapse" class="fixed-header" />
+      <app-main />
+      <sidebar v-if="!sidebar.hide" class="fixed-bottom" />
+    </div>
   </div>
 </template>
 
@@ -63,6 +65,11 @@ function setLayout() {
 @import "@/assets/styles/mixin.scss";
 @import "@/assets/styles/variables.module.scss";
 
+.app {
+  background-image: linear-gradient(-20deg, #2b5876 0%, #4e4376 100%);
+
+}
+
 .app-wrapper {
   @include clearfix;
   position: relative;
@@ -71,8 +78,13 @@ function setLayout() {
   display: flex;
   flex-direction: column;
   overflow: hidden;
-  background: linear-gradient(90deg, rgba(65, 204, 148, 0.1) 5%, transparent 0), linear-gradient(rgba(65, 204, 148, 0.1) 5%, transparent 0);
-  background-size: 20px 20px;
+  // background-image: linear-gradient(to bottom, transparent 80px, rgb(9, 24, 57) 1px), linear-gradient(to right, transparent 80px, rgb(9, 24, 57) 1px);
+  // background-size: 81px 81px;
+  // background-repeat: repeat;
+  background: 
+      linear-gradient(135deg, black 12.5%, transparent 12.5%, transparent 37.5%, black 37.5%, black 62.5%, transparent 62.5%, transparent 87.5%, black 87.5%) 0 0,
+      linear-gradient(225deg, black 12.5%, transparent 12.5%, transparent 37.5%, black 37.5%, black 62.5%, transparent 62.5%, transparent 87.5%, black 87.5%) 0 0;
+    background-size: 100px 100px;
 }
 
 .drawer-bg {

+ 1 - 148
src/store/modules/permission.js

@@ -39,154 +39,7 @@ const usePermissionStore = defineStore(
             const sdata = JSON.parse(JSON.stringify(res.data))
             const rdata = JSON.parse(JSON.stringify(res.data))
             const defaultData = JSON.parse(JSON.stringify(res.data))
-            let arrData = [{
-              component: "/index",
-              hidden: false,
-              meta: {
-                icon: "synthesize",
-                title: "综合态势"
-              },
-              name: "/",
-              path: "/index",
-            }, {
-              component: "system/menu/index",
-              hidden: false,
-              meta: {
-                icon: "automatic",
-                title: "楼宇自控"
-              },
-              name: "Menu",
-              path: "/system/menu",
-            }, {
-              component: "system/role/index",
-              hidden: false,
-              meta: {
-                icon: "energy",
-                title: "能源管理"
-              },
-              name: "Role",
-              path: "/system/role",
-            }, {
-              component: "system/user/index",
-              hidden: false,
-              meta: {
-                icon: "illumination",
-                title: "智能照明"
-              },
-              name: "Menu",
-              path: "/system/user",
-            }, {
-              component: "system/dept/index",
-              hidden: false,
-              meta: {
-                icon: "machine",
-                title: "机房环控"
-              },
-              name: "Menu",
-              path: "/system/dept",
-            }, {
-              component: "system/post/index",
-              hidden: false,
-              meta: {
-                icon: "park",
-                title: "停车管理"
-              },
-              name: "Menu",
-              path: "/system/post",
-            }, {
-              component: "system/dict/index",
-              hidden: false,
-              meta: {
-                icon: "monitoring",
-                title: "视频监控"
-              },
-              name: "Menu",
-              path: "/system/dict",
-            }, {
-              component: "system/notice/index",
-              hidden: false,
-              meta: {
-                icon: "guard",
-                title: "门禁管理"
-              },
-              name: "Menu",
-              path: "/system/notice",
-            }, {
-              component: "system/notice/index",
-              hidden: false,
-              meta: {
-                icon: "police",
-                title: "防盗报警"
-              },
-              name: "Menu",
-              path: "/system/notice",
-            }, {
-              component: "system/notice/index",
-              hidden: false,
-              meta: {
-                icon: "broadcast",
-                title: "公告广播"
-              },
-              name: "Menu",
-              path: "/system/notice",
-            }, {
-              component: "system/notice/index",
-              hidden: false,
-              meta: {
-                icon: "information",
-                title: "信息发布"
-              },
-              name: "Menu",
-              path: "/system/notice",
-            }, {
-              component: "system/notice/index",
-              hidden: false,
-              meta: {
-                icon: "patrol",
-                title: "电子巡更"
-              },
-              name: "Menu",
-              path: "/system/notice",
-            }, {
-              component: "system/notice/index",
-              hidden: false,
-              meta: {
-                icon: "Inspection",
-                title: "巡查系统"
-              },
-              name: "Menu",
-              path: "/system/notice",
-            }, {
-              component: "system/notice/index",
-              hidden: false,
-              meta: {
-                icon: "work",
-                title: "工单系统"
-              },
-              name: "Menu",
-              path: "/system/notice",
-            }, {
-              component: "system/notice/index",
-              hidden: false,
-              meta: {
-                icon: "maintenance",
-                title: "维保系统"
-              },
-              name: "Menu",
-              path: "/system/notice",
-            }, {
-              component: "receptiondesk/index",
-              hidden: false,
-              meta: {
-                icon: "service",
-                title: "服务台"
-              },
-              name: "Receptiondesk",
-              path: "/receptiondesk",
-            }]
-            // const sidebarRoutes = filterAsyncRouter(sdata)
-            const sidebarRoutes = filterAsyncRouter(arrData)
-            // const rewriteRoutes = filterAsyncRouter(arrData, false, true)
+            const sidebarRoutes = filterAsyncRouter(sdata)
             const rewriteRoutes = filterAsyncRouter(rdata, false, true)
             const defaultRoutes = filterAsyncRouter(defaultData)
             const asyncRoutes = filterDynamicRoutes(dynamicRoutes)

+ 1 - 1
src/views/receptiondesk/index.vue → src/views/system/receptiondesk/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container home">
-    123
+    会议系统
   </div>
 </template>
 

+ 3 - 2
vite.config.js

@@ -29,9 +29,10 @@ export default defineConfig(({ mode, command }) => {
       host: true,
       open: true,
       proxy: {
-        // https://cn.vitejs.dev/config/#server-proxy
+        // https://cn.vitejs.dev/config/#server-proxy 
         '/dev-api': {
-          target: 'http://182.43.195.17:8099',
+          target: 'http://192.168.11.46:8080',
+          // target: 'http://182.43.195.17:8099',
           changeOrigin: true,
           rewrite: (p) => p.replace(/^\/dev-api/, '')
         }