Explorar o código

常用功能自定义编辑

tianyabing %!s(int64=2) %!d(string=hai) anos
pai
achega
59c31dbb90

+ 0 - 0
src/assets/images/aside/auth.png → src/assets/images/function/auth.png


+ 0 - 0
src/assets/images/aside/carbon.png → src/assets/images/function/carbon.png


+ 0 - 0
src/assets/images/aside/dashboard.png → src/assets/images/function/dashboard.png


+ 0 - 0
src/assets/images/aside/life.png → src/assets/images/function/life.png


+ 0 - 0
src/assets/images/aside/operation.png → src/assets/images/function/operation.png


+ 0 - 0
src/assets/images/aside/report.png → src/assets/images/function/report.png


+ 0 - 0
src/assets/images/aside/scene.png → src/assets/images/function/scene.png


+ 0 - 0
src/assets/images/aside/security.png → src/assets/images/function/security.png


+ 0 - 0
src/assets/images/aside/work.png → src/assets/images/function/work.png


+ 0 - 0
src/assets/images/function/iocRestaurant.png → src/assets/images/functionColor/life/iocRestaurant.png


+ 7 - 4
src/components/dashboard/Dashboard.vue

@@ -13,7 +13,7 @@
             </template>
             <a-row>
               <a-col v-for="(item, index) in commonMenu" :span="6" :key="index">
-                <IocFunction :title="'智慧餐厅'" :icon="require('@/assets/images/function/iocRestaurant.png')"></IocFunction>
+                <IocFunction :item="item"></IocFunction>
               </a-col>
             </a-row>
           </IocCard>
@@ -39,7 +39,7 @@
     </a-row>
 
 
-    <FunctionManage :visible.sync="showFuncManage"></FunctionManage>
+    <FunctionManage v-if="showFuncManage" :visible.sync="showFuncManage" :common-function.sync="commonMenu"></FunctionManage>
 
   </div>
 </template>
@@ -52,13 +52,14 @@ import DashboardMessageCard from "@/components/dashboard/message/dashboardMessag
 import DashboardPortrait from "@/components/dashboard/portrait/dashboardPortrait.vue";
 import DashboardMore from "@/components/dashboard/more/dashboardMore.vue";
 import FunctionManage from "@/components/dashboard/commonFuncManage/functionManage.vue";
+import {requireImg} from "@/utils/requireImg";
 
 
 export default {
   data() {
     return {
       showFuncManage: false,
-      commonMenu: [{},{},{},{},{},{},{},{}]
+      commonMenu: []
     }
   },
   components: {
@@ -70,9 +71,11 @@ export default {
     DashboardMore,
     FunctionManage,
   },
-  created() {
+  mounted() {
+    this.commonMenu = this.$store.menuStore().commonFunction;
   },
   methods: {
+    requireImg,
     openFuncManage() {
       this.showFuncManage = true;
     }

+ 14 - 7
src/components/dashboard/commonFuncManage/function.vue

@@ -1,15 +1,15 @@
 <template>
   <div class="function-btn" :style="functionBtnStyle">
     <div class="function-icon">
-      <a-avatar class="function-avatar" shape="square" size="large" :src="icon"></a-avatar>
+      <a-avatar class="function-avatar" shape="square" size="large" :src="requireImg(item.iconColor)"></a-avatar>
     </div>
-    <div class="function-title">{{ title }}</div>
-    <div class="function-btn-opr" v-if="type==-1" @click="minusFunction?minusFunction(title, isSSO):()=>{}">
+    <div class="function-title">{{ item.name }}</div>
+    <div class="function-btn-opr" v-if="type==-1" @click="minusFunction(item)">
       <span class="anticon" >
         <svg width="20" height="20" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z" fill="#cd2a2a" stroke="#cd2a2a" stroke-width="4" stroke-linejoin="round"/><path d="M16 24L32 24" stroke="#FFF" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>
       </span>
     </div>
-    <div class="function-btn-opr" v-if="type==1" @click="plusFunction?plusFunction(title, isSSO):()=>{}">
+    <div class="function-btn-opr" v-if="type===1" @click="plusFunction(item)">
        <span class="anticon" >
          <svg width="20" height="20" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z" fill="#2ea8e6" stroke="#2ea8e6" stroke-width="4" stroke-linejoin="round"/><path d="M24 16V32" stroke="#FFF" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M16 24L32 24" stroke="#FFF" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>
        </span>
@@ -19,7 +19,10 @@
 </template>
 
 <script>
+import {requireImg} from "@/utils/requireImg";
+
 export default {
+  methods: {requireImg},
   data() {
     return {
       functionBtnStyle: {
@@ -28,10 +31,10 @@ export default {
     }
   },
   props: {
+    item: Object,
     type: Number,
     title: String,
     icon: String,
-    isSSO: Boolean,
     plusFunction: Function,
     minusFunction: Function,
   },
@@ -66,12 +69,16 @@ export default {
     }
   }
   .function-title {
+    width: 55%;
+    line-height: 20px;
+    vertical-align: middle;
     display: inline-block;
-    margin-top: 20px;
+    //margin-top: 20px;
     margin-left: 5%;
     font-size: 16px;
-    line-height: 24px;
     letter-spacing: 1px;
+    white-space:pre-wrap;
+    word-break: break-word;
   }
   .function-btn-opr {
     position: absolute;

+ 55 - 147
src/components/dashboard/commonFuncManage/functionManage.vue

@@ -1,123 +1,22 @@
 <script>
+import menuList from "@/data/json/menuList.json"
+import ssoList from "@/data/json/ssoList.json"
 import Function from "@/components/dashboard/commonFuncManage/function.vue";
 
 export default {
   data() {
     return {
-      commonFunctions: [
-        {
-          name: '智慧餐厅',
-          icon: '@/assets/images/function/iocRestaurant.png',
-          url: '',
-          type: 'route'
-        },
-        {
-          name: '智慧餐厅2',
-          icon: '@/assets/images/function/iocRestaurant.png',
-          url: '',
-          type: 'route'
-        },{
-          name: '智慧餐厅3',
-          icon: '@/assets/images/function/iocRestaurant.png',
-          url: '',
-          type: 'route'
-        },{
-          name: '智慧餐厅4',
-          icon: '@/assets/images/function/iocRestaurant.png',
-          url: '',
-          type: 'route'
-        },{
-          name: '智慧餐厅5',
-          icon: '@/assets/images/function/iocRestaurant.png',
-          url: '',
-          type: 'route'
-        },{
-          name: '智慧餐厅6',
-          icon: '@/assets/images/function/iocRestaurant.png',
-          url: '',
-          type: 'route'
-        },{
-          name: '智慧餐厅7',
-          icon: '@/assets/images/function/iocRestaurant.png',
-          url: '',
-          type: 'route'
-        },{
-          name: '智慧餐厅8',
-          icon: '@/assets/images/function/iocRestaurant.png',
-          url: '',
-          type: 'route'
-        },
-      ],
-      functions: [
-        {
-          name: '智慧停车',
-          icon: '@/assets/images/function/iocRestaurant.png',
-          url: '',
-          type: 'route'
-        },
-        {
-          name: '智慧停车2',
-          icon: '@/assets/images/function/iocRestaurant.png',
-          url: '',
-          type: 'route'
-        },
-        {
-          name: '智慧停车3',
-          icon: '@/assets/images/function/iocRestaurant.png',
-          url: '',
-          type: 'route'
-        },
-        {
-          name: '智慧停车4',
-          icon: '@/assets/images/function/iocRestaurant.png',
-          url: '',
-          type: 'route'
-        },
-        {
-          name: '智慧停车5',
-          icon: '@/assets/images/function/iocRestaurant.png',
-          url: '',
-          type: 'route'
-        },
-      ],
-      ssoList: [
-        {
-          name: '系统1',
-          icon: '@/assets/images/function/iocRestaurant.png',
-          url: '',
-          isSSO: true,
-          type: 'url'
-        },{
-          name: '系统2',
-          icon: '@/assets/images/function/iocRestaurant.png',
-          url: '',
-          isSSO: true,
-          type: 'url'
-        },{
-          name: '系统3',
-          icon: '@/assets/images/function/iocRestaurant.png',
-          url: '',
-          isSSO: true,
-          type: 'url'
-        },{
-          name: '系统4',
-          icon: '@/assets/images/function/iocRestaurant.png',
-          url: '',
-          isSSO: true,
-          type: 'url'
-        },{
-          name: '系统5',
-          icon: '@/assets/images/function/iocRestaurant.png',
-          url: '',
-          isSSO: true,
-          type: 'url'
-        },
-      ],
+      menuList,
+      ssoList,
+      customFunction: [],
+      functions: [],
+      ssoSystems: [],
       show: false,
     }
   },
   props: {
     visible: Boolean,
+    commonFunction: Array,
   },
   components: {
     Function
@@ -128,65 +27,74 @@ export default {
     },
     "visible": function (val) {
       this.show = val
-    }
+    },
   },
-  emits: ['update:visible'],
+  emits: ['update:visible', 'update:commonFunction'],
   setup(props, context) {
     const methods = {
       toggleVisible(flag) {
         context.emit('update:visible', flag)
       },
+      updateFunctions(arr) {
+        context.emit('update:commonFunction', arr)
+      }
     }
     return methods
   },
   mounted() {
     this.show = this.visible;
+    this.customFunction = JSON.parse(JSON.stringify(this.commonFunction));
+    this.getFunctions();
+    this.ssoSystems = this.ssoList
   },
   methods: {
+    getFunctions() {
+      let names = this.commonFunction.map(i=>{return i.name});
+      this.functions = [];
+      for (let i = 0; i < this.menuList.length; i++) {
+        let menu = this.menuList[i];
+        let childMenus = menu.children?menu.children:[];
+        childMenus = childMenus.filter(i=>names.indexOf(i.name)<0);
+        childMenus.forEach(item => {
+          this.functions.push(item)
+        })
+      }
+    },
     handleOk() {
+      this.$store.menuStore().commonFunction = JSON.parse(JSON.stringify(this.customFunction));
+      this.updateFunctions(this.$store.menuStore().commonFunction)
       this.show = false;
     },
     handleCancel() {
       this.show = false
     },
-    plusFunction(item, isSSO) {
-      if (!item || item == '') {
-        return;
-      }
-      if (this.commonFunctions.length>=8) {
+    plusFunction(item) {
+      if (this.customFunction.length>=8) {
         this.$message.warning('功能位已满,请先移除功能后重试')
         return;
       }
-      let obj;
-      let index = this.functions.findIndex(i=>i.name==item)
-      if (!index || index>=0) {
-        index = this.ssoList.findIndex(i=>i.name==item)
-        if (index && index>=0) {
-          obj = this.ssoList[index];
-          this.ssoList.splice(index, 1)
+      if (item.isSso) {
+        let index = this.ssoSystems.findIndex(i=>i.name==item.name)
+        if (index) {
+          this.ssoSystems.splice(index, 1)
         }
       } else {
-        obj = this.functions[index];
-        this.functions.splice(index, 1)
-      }
-      if (obj) {
-        this.commonFunctions.push(obj)
+        let index = this.functions.findIndex(i=>i.name==item.name)
+        if (index) {
+          this.functions.splice(index, 1)
+        }
       }
+      this.customFunction.push(item)
     },
-    minusFunction(item, isSSO) {
-      if (!item || item == '') {
-        return;
-      }
-      let obj;
-      let index = this.commonFunctions.findIndex(i=>i.name==item)
-      if (index && index>=0) {
-        obj = this.commonFunctions[index]
-        this.commonFunctions.splice(index, 1)
-      }
-      if (isSSO) {
-        this.ssoList.push(obj)
-      } else {
-        this.functions.push(obj)
+    minusFunction(item) {
+      let index = this.customFunction.findIndex(i => i.name==item.name);
+      if (index) {
+        this.customFunction.splice(index, 1);
+        if (item.isSso) {
+          this.ssoSystems.push(item);
+        } else {
+          this.functions.push(item);
+        }
       }
     },
   }
@@ -215,8 +123,8 @@ export default {
       <div class="funcManage-body">
         <a-row :gutter="16">
           <transition-group name="common-function">
-            <a-col :span="6" v-for="(item,index) in commonFunctions" :key="item.name" style="margin-bottom: 12px">
-              <Function :minus-function="minusFunction" :title="item.name" :type="-1" :icon="require('@/assets/images/function/iocRestaurant.png')"></Function>
+            <a-col :span="6" v-for="(item,index) in customFunction" :key="item.name" style="margin-bottom: 12px">
+              <Function :minus-function="minusFunction" :item="item" :type="-1"></Function>
             </a-col>
           </transition-group>
         </a-row>
@@ -230,7 +138,7 @@ export default {
           <a-row :gutter="16">
             <transition-group name="common-function">
               <a-col :span="6" v-for="(item,index) in functions" :key="item.name" style="margin-bottom: 12px">
-                <Function :plus-function="plusFunction" :title="item.name" :type="1"></Function>
+                <Function :plus-function="plusFunction" :item="item" :type="1"></Function>
               </a-col>
             </transition-group>
           </a-row>
@@ -242,8 +150,8 @@ export default {
         <div class="funcManage-body">
           <a-row :gutter="16">
             <transition-group name="common-function">
-              <a-col :span="6" v-for="(item, index) in ssoList" :key="item.name" style="margin-bottom: 12px">
-                <Function :plus-function="plusFunction" :title="item.name" :type="1"></Function>
+              <a-col :span="6" v-for="(item, index) in ssoSystems" :key="item.name" style="margin-bottom: 12px">
+                <Function :plus-function="plusFunction" :item="item" :type="1"></Function>
               </a-col>
             </transition-group>
           </a-row>

+ 18 - 23
src/components/home/ContainerAside.vue

@@ -6,14 +6,12 @@ export default {
     return {
       selectedKeys: [],
       highLight: {backgroundColor: '#e9f6fd'},
-      routers: [],
       menuList: [],
       height: '100%',
     }
   },
   mounted() {
     let app = this;
-    this.routers = this.$router.options.routes;
     this.$nextTick(() => {
       app.getCurrMenuList()
     })
@@ -22,28 +20,25 @@ export default {
   methods: {
     requireImg,
     getCurrMenuList() {
-      let arr = this.$route.matched;
-      let route = this.routers[0].children;
-      if (arr.length>1) {
-        let obj = route.find((e) => (e.path == arr[1].path));
-        route = obj.children;
+      let matchRoutes = this.$route.matched;
+      let menu = this.$store.menuStore().currMenu
+      this.menuList = [];
+      if (menu.children && menu.children.length>0) {
+        this.menuList = JSON.parse(JSON.stringify(menu.children))
       }
-      this.menuList = JSON.parse(JSON.stringify(route))
-      this.selectedKeys = [];
-      if (arr.length>2) {
-        for (let i = 0; i < arr.length; i++) {
-          this.selectedKeys.push(arr[i].path)
-        }
-      } else if (arr.length===2) {
-        if (this.menuList.length>0 && !this.menuList[0].children) {
-          this.handleClick(this.menuList[0]);
-          this.selectedKeys.push(this.menuList[0].path)
-        }
+      if (matchRoutes.length===2) {
+        this.toRoute(this.menuList[0].router)
+      } else if (matchRoutes.length>2) {
+        let route = this.$route.matched[2];
+        this.toRoute(route.path)
       }
     },
     handleClick(item) {
-      let path = item.path?item.path:item.key
+      this.toRoute(item.key)
+    },
+    toRoute(path) {
       this.$router.push({path: path})
+      this.selectedKeys = [path]
       this.$forceUpdate()
     }
   }
@@ -60,12 +55,12 @@ export default {
         @click="handleClick"
     >
       <template v-for="item in menuList">
-        <a-menu-item  class="menuItem" :key="item.path" :route="item.key" v-if="item.meta.hideChild || !item.children">
+        <a-menu-item  class="menuItem" :key="item.router" :route="item.router" v-if="!item.children">
         <span class="anticon" style="vertical-align: text-top">
           <a-avatar class="function-avatar" shape="square" :size="20" :src="requireImg(item.icon)"></a-avatar>
         </span>
           <span >
-            {{ item.meta.breadcrumb }}
+            {{ item.name }}
           </span>
         </a-menu-item>
 
@@ -74,13 +69,13 @@ export default {
             <span class="anticon" style="vertical-align: text-top">
           <a-avatar class="function-avatar" shape="square" :size="20" :src="requireImg(item.icon)"></a-avatar>
         </span>
-            <span>{{ item.meta.breadcrumb }}</span>
+            <span>{{ item.name }}</span>
           </template>
           <a-menu-item v-for="subItem in item.children" :key="subItem.path" :route="subItem.path">
             <span class="anticon" style="vertical-align: text-top">
           <a-avatar class="function-avatar" shape="square" :size="20" :src="requireImg(item.icon)"></a-avatar>
         </span>
-            <span>{{ subItem.meta.breadcrumb }}</span>
+            <span>{{ subItem.name }}</span>
           </a-menu-item>
         </a-sub-menu>
       </template>

+ 10 - 1
src/components/home/HomeAside.vue

@@ -18,6 +18,10 @@ export default {
     collapse(val) {
       this.suitHeight(val)
     },
+    $route() {
+      this.getCurrRoute()
+      this.$forceUpdate();
+    }
   },
   mounted() {
     this.suitHeight(this.collapse)
@@ -57,10 +61,15 @@ export default {
         if (this.$route.matched.length>1) {
           this.selectedKey = [this.$route.matched[1].path+'']
         }
+        let index = this.menuList.findIndex(i=>i.router==this.selectedKey)
+        this.handleClickMenuItem(this.menuList[index])
         this.$forceUpdate()
       })
 
     },
+    handleClickMenuItem(item) {
+      this.$store.menuStore().currMenu = item;
+    },
     handleSelected(item) {
       this.$router.push({path: item.key})
     },
@@ -88,7 +97,7 @@ export default {
           </div>
         </template>
       </a-menu-item-group>
-      <a-menu-item v-for="item in menuList" :key="item.router" >
+      <a-menu-item v-for="item in menuList" :key="item.router" @click="handleClickMenuItem(item)" >
         <span class="anticon" :style="{verticalAlign: iconVerticalAlign}">
           <a-avatar class="function-avatar" shape="square" :size="20" :src="requireImg(item.icon)"></a-avatar>
         </span>

+ 9 - 1
src/components/home/HomeLeft.vue

@@ -32,7 +32,7 @@
     </a-menu>
 
     <div class="ioc-nav" v-if="navVisible"  >
-      <NavigationPage />
+      <NavigationPage :to-route="toRoute" />
     </div>
 
   </div>
@@ -46,10 +46,18 @@ export default {
       navVisible: false
     }
   },
+  props: {
+    close: Function,
+  },
   components: {
     NavigationPage
   },
   methods: {
+    toRoute(item, parent) {
+      this.$store.menuStore().currMenu = parent;
+      this.$router.push({path: item.router});
+      this.close();
+    },
     showNav() {
       this.navVisible = true;
     },

+ 3 - 3
src/components/home/NavigationPage.vue

@@ -4,7 +4,7 @@
       <div class="menu" v-if="menu.name!=='智能看板'" :key="menu.name">
         <div class="menu-title">{{menu.name}}</div>
         <ul class="menu-content" >
-          <li class="menu-content-item" v-for="item in menu.children" :key="item.name" >{{ item.name }}</li>
+          <li class="menu-content-item" v-for="item in menu.children" :key="item.name" @click="toRoute(item, menu)" >{{ item.name }}</li>
         </ul>
       </div>
     </template>
@@ -28,14 +28,13 @@ export default {
     }
   },
   props: {
-
+    toRoute: Function
   },
   created() {
   },
   mounted() {
   },
   methods: {
-
   }
 
 }
@@ -66,6 +65,7 @@ export default {
         line-height: 30px;
         letter-spacing: 1px;
         color: #101010;
+        cursor: pointer;
       }
     }
   }

+ 33 - 38
src/data/json/menuList.json

@@ -2,110 +2,105 @@
   {
     "name": "智能看板",
     "router": "/dashboard",
-    "icon": "aside/dashboard.png",
-    "children": [
-      {
-        "name": "人员画像",
-        "router": "",
-        "icon": ""
-      },
-      {
-        "name": "能源画像",
-        "router": "",
-        "icon": ""
-      },
-      {
-        "name": "资产画像",
-        "router": "",
-        "icon": ""
-      }
-    ]
+    "icon": "function/dashboard.png"
   },
   {
     "name": "智享生活",
     "router": "/life",
-    "icon": "aside/life.png",
+    "icon": "function/life.png",
     "children": [
       {
         "name": "智慧餐厅",
         "router": "/life/restaurant",
-        "icon": ""
+        "icon": "",
+        "iconColor": "functionColor/life/iocRestaurant.png"
       },
       {
         "name": "智慧停车",
         "router": "/life/parking",
-        "icon": ""
+        "icon": "",
+        "iconColor": "functionColor/life/iocRestaurant.png"
       },
       {
         "name": "无人商超",
         "router": "/life/supermarket",
-        "icon": ""
+        "icon": "",
+        "iconColor": "functionColor/life/iocRestaurant.png"
       },
       {
         "name": "健康小屋",
         "router": "/life/healthyHome",
-        "icon": ""
+        "icon": "",
+        "iconColor": "functionColor/life/iocRestaurant.png"
       }
     ]
   },
   {
     "name": "智慧办公",
     "router": "/work",
-    "icon": "aside/work.png",
+    "icon": "function/work.png",
     "children": [
       {
         "name": "楼层概览",
         "router": "/work/overview",
-        "icon": ""
+        "icon": "",
+        "iconColor": "functionColor/life/iocRestaurant.png"
       },
       {
         "name": "会议管理",
         "router": "/work/meeting",
-        "icon": ""
+        "icon": "",
+        "iconColor": "functionColor/life/iocRestaurant.png"
       },
       {
         "name": "文印管理",
         "router": "/work/print",
-        "icon": ""
+        "icon": "",
+        "iconColor": "functionColor/life/iocRestaurant.png"
       },
       {
         "name": "公车管理",
         "router": "/work/bus",
-        "icon": ""
+        "icon": "",
+        "iconColor": "functionColor/life/iocRestaurant.png"
       }
     ]
   },
   {
     "name": "数智双碳",
     "router": "/doubleCarbon",
-    "icon": "aside/carbon.png",
+    "icon": "function/carbon.png",
     "children": [
       {
         "name": "双碳概览",
         "router": "/doubleCarbon/overview",
-        "icon": ""
+        "icon": "",
+        "iconColor": "functionColor/life/iocRestaurant.png"
       },
       {
         "name": "车辆排放",
         "router": "/doubleCarbon/car",
-        "icon": ""
+        "icon": "",
+        "iconColor": "functionColor/life/iocRestaurant.png"
       },
       {
         "name": "文印排放",
         "router": "/doubleCarbon/print",
-        "icon": ""
+        "icon": "",
+        "iconColor": "functionColor/life/iocRestaurant.png"
       },
       {
         "name": "光伏发电",
         "router": "/doubleCarbon/pv",
-        "icon": ""
+        "icon": "",
+        "iconColor": "functionColor/life/iocRestaurant.png"
       }
     ]
   },
   {
     "name": "智慧运营",
     "router": "/business",
-    "icon": "aside/operation.png",
+    "icon": "function/operation.png",
     "children": [
       {
         "name": "资产管理",
@@ -127,7 +122,7 @@
   {
     "name": "智慧安防",
     "router": "/security",
-    "icon": "aside/security.png",
+    "icon": "function/security.png",
     "children": [
       {
         "name": "安防人员",
@@ -171,7 +166,7 @@
   {
     "name": "智慧场景",
     "router": "/scene",
-    "icon": "aside/scene.png",
+    "icon": "function/scene.png",
     "children": [
       {
         "name": "智•会议",
@@ -244,7 +239,7 @@
   {
     "name": "数据报表",
     "router": "/report",
-    "icon": "aside/report.png",
+    "icon": "function/report.png",
     "children": [
       {
         "name": "报表",
@@ -261,7 +256,7 @@
   {
     "name": "权限下达",
     "router": "/auth",
-    "icon": "aside/auth.png",
+    "icon": "function/auth.png",
     "children": [
       {
         "name": "角色权限",

+ 26 - 13
src/data/json/ssoList.json

@@ -2,66 +2,79 @@
   {
     "name": "能源系统",
     "icon": "",
-    "url": ""
+    "url": "",
+    "isSso": true
   },
   {
     "name": "文印管理系统",
     "icon": "",
-    "url": ""
+    "url": "",
+    "isSso": true
   },
   {
     "name": "资产管理系统",
     "icon": "",
-    "url": ""
+    "url": "",
+    "isSso": true
   },
   {
     "name": "空间管理系统",
     "icon": "",
-    "url": ""
+    "url": "",
+    "isSso": true
   },
   {
     "name": "视频云平台",
     "icon": "",
-    "url": ""
+    "url": "",
+    "isSso": true
   },
   {
     "name": "停车管理系统",
     "icon": "",
-    "url": ""
+    "url": "",
+    "isSso": true
   },
   {
     "name": "会议系统",
     "icon": "",
-    "url": ""
+    "url": "",
+    "isSso": true
   },
   {
     "name": "门禁口出入系统",
     "icon": "",
-    "url": ""
+    "url": "",
+    "isSso": true
   },
   {
     "name": "餐厅系统",
     "icon": "",
-    "url": ""
+    "url": "",
+    "isSso": true
   },
   {
     "name": "碳数据管理平台",
     "icon": "",
-    "url": ""
+    "url": "",
+    "isSso": true
   },
   {
     "name": "智慧健康系统",
     "icon": "",
-    "url": ""
+    "url": "",
+    "isSso": true
   },
   {
     "name": "车辆管理系统",
     "icon": "",
-    "url": ""
+    "url": "",
+    "isSso": true
   },
   {
     "name": "无人商超系统",
     "icon": "",
-    "url": ""
+    "url": "",
+    "isSso": true
   }
 ]

+ 3 - 0
src/main.js

@@ -17,6 +17,9 @@ import constant from '@/utils/constant.js'
 // 时间插件
 import moment from '@/utils/moment_set.js'
 
+import Stores from "@/stores";
+Vue.prototype.$store = Stores;
+
 Vue.prototype.$util = util
 Vue.prototype.$constant = constant
 Vue.prototype.$echarts = echarts

+ 75 - 12
src/stores/index.js

@@ -1,15 +1,78 @@
-import { defineStore } from 'pinia'
+import {defineStore} from 'pinia'
 
-export const useUserStore = defineStore('user', {
-  state: () => ({
-    userInfo: {},
-    token: '',
-  }),
-  getters: {
-    userToken: state => state.token,
-    userInfo: state => state.userInfo,
-  },
-  actions: {
+const menuStore = defineStore('ioc-menu', {
+    state: () => (
+        {
+            currMenu: {},
+            commonFunction: [
+                {
+                    "name": "智慧餐厅",
+                    "router": "/life/restaurant",
+                    "icon": "",
+                    "iconColor": "functionColor/life/iocRestaurant.png"
+                },
+                {
+                    "name": "智慧停车",
+                    "router": "/life/parking",
+                    "icon": "",
+                    "iconColor": "functionColor/life/iocRestaurant.png"
+                },
+                {
+                    "name": "无人商超",
+                    "router": "/life/supermarket",
+                    "icon": "",
+                    "iconColor": "functionColor/life/iocRestaurant.png"
+                },
+                {
+                    "name": "健康小屋",
+                    "router": "/life/healthyHome",
+                    "icon": "",
+                    "iconColor": "functionColor/life/iocRestaurant.png"
+                },
+                {
+                    "name": "双碳概览",
+                    "router": "/doubleCarbon/overview",
+                    "icon": "",
+                    "iconColor": "functionColor/life/iocRestaurant.png"
+                },
+                {
+                    "name": "车辆排放",
+                    "router": "/doubleCarbon/car",
+                    "icon": "",
+                    "iconColor": "functionColor/life/iocRestaurant.png"
+                },
+                {
+                    "name": "文印排放",
+                    "router": "/doubleCarbon/print",
+                    "icon": "",
+                    "iconColor": "functionColor/life/iocRestaurant.png"
+                },
+                {
+                    "name": "光伏发电",
+                    "router": "/doubleCarbon/pv",
+                    "icon": "",
+                    "iconColor": "functionColor/life/iocRestaurant.png"
+                }
+            ],
+        }
+    ),
+    getters: {},
+    actions: {},
+})
 
-  },
+const userStore = defineStore('ioc-user', {
+    state: () => ({
+        userInfo: {},
+        token: '',
+    }),
+    getters: {
+        userToken: state => state.token,
+        userInfo: state => state.userInfo,
+    },
+    actions: {},
 })
+
+export default {
+    menuStore,
+    userStore,
+}

+ 1 - 1
src/views/HomeView.vue

@@ -14,7 +14,7 @@
             @close="closeLeft"
             width="auto"
             :wrap-style="{ position: 'absolute' }">
-          <HomeLeft />
+          <HomeLeft :close="()=>{leftVisible=false}" />
         </a-drawer>
         <a-layout-sider
           v-model="collapse"