Browse Source

修改导航栏文字及图标

niuheng 3 years ago
parent
commit
ee3da67341

BIN
public/imgs/navigation/build_white.png


BIN
public/imgs/navigation/build_yellow.png


BIN
public/imgs/navigation/businessspace_white.png


BIN
public/imgs/navigation/businessspace_yellow.png


BIN
public/imgs/navigation/cadimg_white.png


BIN
public/imgs/navigation/cadimg_yellow.png


BIN
public/imgs/navigation/equip_white.png


BIN
public/imgs/navigation/equip_yellow.png


BIN
public/imgs/navigation/project_white.png


BIN
public/imgs/navigation/project_yellow.png


BIN
public/imgs/navigation/relationview_white.png


BIN
public/imgs/navigation/relationview_yellow.png


BIN
public/imgs/navigation/systemgraph_white.png


BIN
public/imgs/navigation/systemgraph_yellow.png


BIN
public/imgs/navigation/systemor_white.png


BIN
public/imgs/navigation/systemor_yellow.png


+ 25 - 23
public/systemConf.js

@@ -42,41 +42,43 @@ var __systemConf = {
     "name": "信息录入工具",
     "orders": 1,
     children: [{
+        "id": "projectmanage",
+        "name": "项目信息",
+        "orders": 6,
+        "path": "/project/manage",
+        "icon": "project"
+      }, {
       "id": "build_floor",
-      "name": "建筑楼层管理",
+      "name": "建筑楼层",
       "orders": 2,
       "path": "/ready/buildfloor",
       "type": "menu",
-      "icon": "icon-jianzhu"
+      "icon": "build"
     },{
-      "id": "equipment",
-      "name": "设备台账",
+      "id": "businessspaceledger",
+      "name": "业务空间",
       "orders": 3,
-      "path": "/ledger/facility"
+      "path": "/ledger/spacelist",
+      "icon": "businessspace"
     },{
-      "id": "businessspaceledger",
-      "name": "业务空间台账",
+      "id": "equipment",
+      "name": "设备",
       "orders": 3,
-      "path": "/ledger/spacelist"
+      "path": "/ledger/facility",
+      "icon": "equip"
     },
     {
       "id": "system",
-      "name": "系统台账",
+      "name": "系统",
       "orders": 4,
-      "path": "/ledger/list"
+      "path": "/ledger/list",
+      "icon": "systemor"
     },{
       "id": "overview",
-      "name": "全部关系总览",
+      "name": "关系",
       "orders": 5,
       "path": "/relation/overview",
-      "icon": "icon-jiqixuexi-"
-    }
-    ,{
-      "id": "projectmanage",
-      "name": "项目信息管理",
-      "orders": 6,
-      "path": "/project/manage",
-      "icon": "icon-jiqixuexi-"
+      "icon": "relationview"
     }
   ]
   }, {
@@ -85,10 +87,10 @@ var __systemConf = {
     "orders": 6,
     children: [{
       "id": "CADtuzhiguanli",
-      "name": "CAD核查图纸管理",
+      "name": "CAD图纸核查",
       "orders": 7,
       "path": "/deliveryTools/cadDrawingManage",
-      "icon": "icon-topology"
+      "icon": "cadimg"
     }]
   }, {
     "id": "draw",
@@ -96,10 +98,10 @@ var __systemConf = {
     "orders": 8,
     children: [{
       "id": "xitongtubianji",
-      "name": "系统图编辑工具",
+      "name": "系统图",
       "orders": 9,
       "path": "/systemGraph",
-      "icon": "icon-topology"
+      "icon": "systemgraph"
     }]
   }]
 };

+ 24 - 12
src/components/frame/leftMenu.vue

@@ -4,14 +4,14 @@
       :index="menu.orders.toString()"
       v-if="menu.children && menu.children.length > 0"
     >
-      <template slot="title">
+      <!-- <template slot="title">
         <i
           class="menuIcon"
-          :class="'iconfont ' + menu.icon"
+          :class="'leftMenuIconfont ' + menu.icon"
           v-if="!!menu.icon"
         ></i>
         <span v-text="menu.name"></span>
-      </template>
+      </template> -->
       <leftMenu
         :menu="subMenu"
         v-for="subMenu in menu.children"
@@ -22,12 +22,20 @@
       :index="menu.path"
       v-if="!menu.children || menu.children.length == 0"
     >
-      <i
+      <!-- <i
         class="menuIcon"
-        :class="'iconfont ' + menu.icon"
+        :class="'leftMenuIconfont ' + menu.icon"
         v-if="!!menu.icon"
-      ></i>
-      <span slot="title" v-text="menu.name"></span>
+      ></i> -->
+      <img :src="menu.state == 'normal' ? menu.normalImg : menu.activeImg" />
+      <span
+        slot="title"
+        v-text="menu.name"
+        style="margin-left: 6px"
+        :style="{
+          color: menu.state == 'normal' ? 'white' : 'rgb(255, 208, 75)',
+        }"
+      ></span>
     </el-menu-item>
   </div>
 </template>
@@ -36,11 +44,15 @@ export default {
   name: "leftMenu",
   props: ["menu"],
   data() {
-    return {};
+    return {
+      routerPath: "",
+    };
   },
   computed: {},
-  methods: {},
-  created() {},
+  methods: {
+  },
+  created() {
+  },
 
   mounted() {},
   components: {},
@@ -51,8 +63,8 @@ export default {
 .menuIcon {
   margin-right: 6px;
   color: #fff;
-  width: 16px;
-  height:16px;
+  width: 20px;
+  height: 20px;
 }
 </style>
 

+ 2 - 6
src/components/systemGraph/graph.vue

@@ -155,11 +155,8 @@ export default {
           //关闭右侧详情框
           this.$emit("closeright");
         });
+
         pixiContainer.appendChild(pixiApp.view);
-        // pixiApp.stage.interactive = true;
-        // pixiApp.view.on("click", (event) => {
-        //   alert(1);
-        // });
         _this.pixiApp = pixiApp;
       } else pixiApp = _this.pixiApp;
 
@@ -254,7 +251,7 @@ export default {
       });
 
       //画线
-      _this.lineArr.forEach((_cLine) => {
+      _this.lineArr.forEach((_cLine, _index) => {
         var lineColor = "0x" + _cLine.style.lineColor.substring(1);
         var lineInstance = new PIXI.Graphics();
         lineInstance.lineStyle(_cLine.style.lineWidth, lineColor, 1, 0, false);
@@ -285,7 +282,6 @@ export default {
           _this.isClickGraphNode = true;
           _this.clickEventCall(event, 2);
         });
-
         pixiApp.stage.addChild(lineInstance);
       });
     },

+ 23 - 3
src/utils/authUtils.ts

@@ -30,11 +30,13 @@ export class authUtils {
     if (vueStore.state.user.id) {
       //更新面包屑数据
       vueStore.commit("updateBreadcrumbs", { to: to.path });
+      var prefitxMenuImg = "/" + (window as any).__systemConf.baseRouteUrl + '/imgs/navigation/';
+      var leftMenus = constructorMenu(vueStore.state.menus);
+      vueStore.commit("updateMenus", leftMenus);
       return next();
     }
-
     let userInfoResult = await userController.getUserInfoById();
-    
+
     if (userInfoResult.result != logicConfig.resultObj.success) {
       console.error("获取用户信息失败,原因:" + userInfoResult.message);
       return next({ path: logicConfig.routerNameConfig.loginRouteName });
@@ -50,7 +52,10 @@ export class authUtils {
       id: _userInfo.id,
       name: _userInfo.name,
     });
-    vueStore.commit("updateMenus", _userInfo.menus || (window as any).__systemConf.menus);
+
+    var prefitxMenuImg = "/" + (window as any).__systemConf.baseRouteUrl + '/imgs/navigation/';
+    var leftMenus = constructorMenu(_userInfo.menus || (window as any).__systemConf.menus);
+    vueStore.commit("updateMenus", leftMenus);
 
     //更新面包屑数据
     vueStore.commit("updateBreadcrumbs", { to: to.path });
@@ -70,5 +75,20 @@ export class authUtils {
     vueStore.commit("updateSelectProject", projects[0]);
 
     next();
+
+
+    function constructorMenu(menus) {
+      menus.forEach(_c => {
+        if (_c.children && _c.children.length > 0) {
+          _c.children = constructorMenu(_c.children);
+        } else {
+          _c.normalImg = prefitxMenuImg + _c.icon + '_white.png';
+          _c.activeImg = prefitxMenuImg + _c.icon + '_yellow.png';
+          _c.state = to.path == _c.path ? 'active' : 'normal';
+        }
+      });
+      return menus;
+    };
+
   }
 }