Procházet zdrojové kódy

Merge remote-tracking branch 'origin/test' into test

# Conflicts:
#	src/components/tools/UserMenu.vue
hfxc226 před 5 měsíci
rodič
revize
d010c01af4

+ 4 - 4
src/components/SettingDrawer/SettingDrawer.vue

@@ -105,7 +105,7 @@
                   <template slot="title">
                     该设定仅 [顶部栏导航] 时有效
                   </template>
-                  <a-select size="small" style="width: 80px;" :defaultValue="contentWidth" @change="handleContentWidthChange">
+                  <a-select size="small" :disabled="layoutMode !== 'topmenu'" style="width: 80px;" :defaultValue="contentWidth" @change="handleContentWidthChange">
                     <a-select-option value="Fixed">固定</a-select-option>
                     <a-select-option value="Fluid" v-if="layoutMode !== 'sidemenu'">流式</a-select-option>
                   </a-select>
@@ -115,7 +115,7 @@
                 </a-list-item-meta>
               </a-list-item>
               <a-list-item>
-                <a-switch slot="actions" size="small" :defaultChecked="fixedHeader" @change="handleFixedHeader" />
+                <a-switch slot="actions" size="small" :disabled="layoutMode === 'mixmenu'" :defaultChecked="fixedHeader" @change="handleFixedHeader" />
                 <a-list-item-meta>
                   <div slot="title">固定 Header</div>
                 </a-list-item-meta>
@@ -130,7 +130,7 @@
                 </a-list-item-meta>
               </a-list-item>
               <a-list-item>
-                <a-switch slot="actions" size="small" :disabled="(layoutMode === 'topmenu')" :defaultChecked="fixSiderbar" @change="handleFixSiderbar" />
+                <a-switch slot="actions" size="small" :disabled="(layoutMode !== 'sidemenu')" :defaultChecked="fixSiderbar" @change="handleFixSiderbar" />
                 <a-list-item-meta>
                   <div slot="title" :style="{ textDecoration: layoutMode === 'topmenu' ? 'line-through' : 'unset' }">固定侧边菜单</div>
                 </a-list-item-meta>
@@ -151,7 +151,7 @@
                 </a-list-item-meta>
               </a-list-item>
               <a-list-item>
-                <a-switch slot="actions" size="small" :defaultChecked="multiTab" @change="onMultiTab" />
+                <a-switch slot="actions" :disabled="layoutMode === 'mixmenu'" size="small" :defaultChecked="multiTab" @change="onMultiTab" />
                 <a-list-item-meta>
                   <div slot="title">多页签模式</div>
                 </a-list-item-meta>

+ 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]
     }
   },