whj 1 год назад
Родитель
Сommit
74d9b96cd9

+ 12 - 11
src/components/global.less

@@ -9,7 +9,9 @@ body {
     overflow: auto;
   }
 }
-
+.pointer{
+  cursor: pointer;
+}
 .layout.ant-layout {
   height: auto;
   overflow-x: hidden;
@@ -246,39 +248,38 @@ body {
     transition: background 0.3s, width 0.2s;
 
     .header-index-wide {
-      max-width: 1200px;
+      max-width: 100vw;
       margin: auto;
       padding-left: 0;
       display: flex;
       height: 64px;
 
       .ant-menu.ant-menu-horizontal {
-        max-width: 835px;
-        flex: 0 1 835px;
+        flex: 1;
+        max-width: calc(100vw - 500px);
         border: none;
         height: 64px;
         line-height: 64px;
       }
 
       .header-index-left {
-        flex: 0 1 1000px;
+        flex: 1;
         display: flex;
 
         .logo.top-nav-header {
-          flex: 0 0 165px;
-          width: 165px;
+          width: 200px;
           height: 64px;
           position: relative;
           line-height: 64px;
           transition: all 0.3s;
           overflow: hidden;
-
+          padding-right: 30px;
+text-align: right;
           img,
           svg {
             display: inline-block;
             vertical-align: middle;
             height: 32px;
-            width: 32px;
           }
 
           h1 {
@@ -293,10 +294,10 @@ body {
       }
 
       .header-index-right {
-        flex: 0 0 238px;
+        width: 150px;
         align-self: flex-end;
         height: 64px;
-        overflow: hidden;
+        margin-right: 20px;
 
         .content-box {
           float: right;

+ 2 - 2
src/components/tools/UserMenu.vue

@@ -26,13 +26,13 @@
           </a-menu-item>
         </a-menu>
       </a-dropdown>-->
-      <a style="margin-left: 8px;" @click="handleScreen(0)">电量管理</a>
+      <!-- <a style="margin-left: 8px;" @click="handleScreen(0)">电量管理</a>
       <a style="margin-left: 8px;" @click="handleScreen(1)">设备大屏</a>
       <a style="margin-left: 8px;" @click="handleScreen(2)">详情大屏</a>
       <a style="margin-left: 8px;" @click="handleScreen(3)">维保大屏</a>
       <a style="margin-left: 8px;" @click="handleScreen(4)">仓库大屏</a>
       <a style="margin-left: 8px;" @click="handleScreen(5)">PC聊天</a>
-      <a style="margin-left: 8px;" @click="handleScreen(6)">移动聊天</a>
+      <a style="margin-left: 8px;" @click="handleScreen(6)">移动聊天</a> -->
       <a-dropdown>
         <span class="action ant-dropdown-link user-dropdown-menu">
           <a-avatar class="avatar" size="small" :src="avatar"/>

+ 9 - 11
src/layouts/BasicLayout.vue

@@ -128,7 +128,9 @@ export default {
           'target': null,
           'permission': null
         }
-      }
+      },
+      menus: [],
+      mixMenu: {}
     }
   },
   watch: {
@@ -141,16 +143,6 @@ export default {
       // 动态主路由
       mainMenu: state => state.permission.addRouters
     }),
-    menus () {
-      return this.mainMenu.find(item => item.path === '/').children
-    },
-    mixMenu () {
-      const mixMenu = {}
-      this.menus.forEach(item => {
-        mixMenu[item.name] = item
-      })
-      return mixMenu
-    },
     contentPaddingLeft () {
       if (!this.fixSidebar || this.isMobile()) {
         return '0'
@@ -163,6 +155,12 @@ export default {
   },
   created () {
     this.collapsed = !this.sidebarOpened
+    this.menus = this.mainMenu.find(item => item.path === '/').children
+    const mixMenu = {}
+    this.menus.forEach(item => {
+      mixMenu[item.name] = item
+    })
+    this.mixMenu = mixMenu
   },
   mounted () {
     const userAgent = navigator.userAgent

+ 0 - 3
src/layouts/SideMenuRouteView.vue

@@ -68,9 +68,6 @@ export default {
       activeMenu: state => state.permission.activeMenu
     }),
     menu () {
-      console.log(this.menus)
-      console.log(this.activeMenu)
-      console.log(this.menus[this.activeMenu])
       return this.menus[this.activeMenu]
     }
   },