lz 3 éve
szülő
commit
cb6e4a4e6b

+ 3 - 0
.prettierignore

@@ -0,0 +1,3 @@
+node_modules/
+build
+dist

+ 0 - 74
src/components/Breadcrumb/index.vue

@@ -1,74 +0,0 @@
-<template>
-  <el-breadcrumb class="app-breadcrumb" separator="/">
-    <transition-group name="breadcrumb">
-      <el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
-        <span v-if="item.redirect === 'noRedirect' || index == levelList.length - 1" class="no-redirect">{{ item.meta.title }}</span>
-        <a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a>
-      </el-breadcrumb-item>
-    </transition-group>
-  </el-breadcrumb>
-</template>
-
-<script>
-export default {
-  data() {
-    return {
-      levelList: null
-    }
-  },
-  watch: {
-    $route(route) {
-      // if you go to the redirect page, do not update the breadcrumbs
-      if (route.path.startsWith('/redirect/')) {
-        return
-      }
-      this.getBreadcrumb()
-    }
-  },
-  created() {
-    this.getBreadcrumb()
-  },
-  methods: {
-    getBreadcrumb() {
-      // only show routes with meta.title
-      let matched = this.$route.matched.filter(item => item.meta && item.meta.title)
-      const first = matched[0]
-
-      if (!this.isDashboard(first)) {
-        matched = [{ path: '/index', meta: { title: '首页' }}].concat(matched)
-      }
-
-      this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
-    },
-    isDashboard(route) {
-      const name = route && route.name
-      if (!name) {
-        return false
-      }
-      return name.trim() === 'Index'
-    },
-    handleLink(item) {
-      const { redirect, path } = item
-      if (redirect) {
-        this.$router.push(redirect)
-        return
-      }
-      this.$router.push(path)
-    }
-  }
-}
-</script>
-
-<style lang="scss" scoped>
-.app-breadcrumb.el-breadcrumb {
-  display: inline-block;
-  font-size: 14px;
-  line-height: 50px;
-  margin-left: 8px;
-
-  .no-redirect {
-    color: #97a8be;
-    cursor: text;
-  }
-}
-</style>

+ 3 - 0
src/components/Screenfull/index.vue

@@ -30,6 +30,9 @@
 				screenfull.toggle()
 			},
 			change() {
+				if (!screenfull.isFullscreen) {
+					this.$store.commit('app/NO_ENLARGE')
+				}
 				this.isFullscreen = screenfull.isFullscreen
 			},
 			init() {

+ 0 - 195
src/components/TopNav/index.vue

@@ -1,195 +0,0 @@
-<template>
-  <el-menu
-    :default-active="activeMenu"
-    mode="horizontal"
-    @select="handleSelect"
-  >
-    <template v-for="(item, index) in topMenus">
-      <el-menu-item :style="{'--theme': theme}" :index="item.path" :key="index" v-if="index < visibleNumber"
-        ><svg-icon :icon-class="item.meta.icon" />
-        {{ item.meta.title }}</el-menu-item
-      >
-    </template>
-
-    <!-- 顶部菜单超出数量折叠 -->
-    <el-submenu :style="{'--theme': theme}" index="more" v-if="topMenus.length > visibleNumber">
-      <template slot="title">更多菜单</template>
-      <template v-for="(item, index) in topMenus">
-        <el-menu-item
-          :index="item.path"
-          :key="index"
-          v-if="index >= visibleNumber"
-          ><svg-icon :icon-class="item.meta.icon" />
-          {{ item.meta.title }}</el-menu-item
-        >
-      </template>
-    </el-submenu>
-  </el-menu>
-</template>
-
-<script>
-import { constantRoutes } from "@/router";
-
-export default {
-  data() {
-    return {
-      // 顶部栏初始数
-      visibleNumber: 5,
-      // 是否为首次加载
-      isFrist: false,
-      // 当前激活菜单的 index
-      currentIndex: undefined
-    };
-  },
-  computed: {
-    theme() {
-      return this.$store.state.settings.theme;
-    },
-    // 顶部显示菜单
-    topMenus() {
-      let topMenus = [];
-      this.routers.map((menu) => {
-        if (menu.hidden !== true) {
-          // 兼容顶部栏一级菜单内部跳转
-          if (menu.path === "/") {
-              topMenus.push(menu.children[0]);
-          } else {
-              topMenus.push(menu);
-          }
-        }
-      });
-      return topMenus;
-    },
-    // 所有的路由信息
-    routers() {
-      return this.$store.state.permission.topbarRouters;
-    },
-    // 设置子路由
-    childrenMenus() {
-      var childrenMenus = [];
-      this.routers.map((router) => {
-        for (var item in router.children) {
-          if (router.children[item].parentPath === undefined) {
-            if(router.path === "/") {
-              router.children[item].path = "/redirect/" + router.children[item].path;
-            } else {
-              if(!this.ishttp(router.children[item].path)) {
-                router.children[item].path = router.path + "/" + router.children[item].path;
-              }
-            }
-            router.children[item].parentPath = router.path;
-          }
-          childrenMenus.push(router.children[item]);
-        }
-      });
-      return constantRoutes.concat(childrenMenus);
-    },
-    // 默认激活的菜单
-    activeMenu() {
-      const path = this.$route.path;
-      let activePath = this.defaultRouter();
-      if (path.lastIndexOf("/") > 0) {
-        const tmpPath = path.substring(1, path.length);
-        activePath = "/" + tmpPath.substring(0, tmpPath.indexOf("/"));
-      } else if ("/index" == path || "" == path) {
-        if (!this.isFrist) {
-          this.isFrist = true;
-        } else {
-          activePath = "index";
-        }
-      }
-      var routes = this.activeRoutes(activePath);
-      if (routes.length === 0) {
-        activePath = this.currentIndex || this.defaultRouter()
-        this.activeRoutes(activePath);
-      }
-      return activePath;
-    },
-  },
-  beforeMount() {
-    window.addEventListener('resize', this.setVisibleNumber)
-  },
-  beforeDestroy() {
-    window.removeEventListener('resize', this.setVisibleNumber)
-  },
-  mounted() {
-    this.setVisibleNumber();
-  },
-  methods: {
-    // 根据宽度计算设置显示栏数
-    setVisibleNumber() {
-      const width = document.body.getBoundingClientRect().width / 3;
-      this.visibleNumber = parseInt(width / 85);
-    },
-    // 默认激活的路由
-    defaultRouter() {
-      let router;
-      Object.keys(this.routers).some((key) => {
-        if (!this.routers[key].hidden) {
-          router = this.routers[key].path;
-          return true;
-        }
-      });
-      return router;
-    },
-    // 菜单选择事件
-    handleSelect(key, keyPath) {
-      this.currentIndex = key;
-      if (this.ishttp(key)) {
-        // http(s):// 路径新窗口打开
-        window.open(key, "_blank");
-      } else if (key.indexOf("/redirect") !== -1) {
-        // /redirect 路径内部打开
-        this.$router.push({ path: key.replace("/redirect", "") });
-      } else {
-        // 显示左侧联动菜单
-        this.activeRoutes(key);
-      }
-    },
-    // 当前激活的路由
-    activeRoutes(key) {
-      var routes = [];
-      if (this.childrenMenus && this.childrenMenus.length > 0) {
-        this.childrenMenus.map((item) => {
-          if (key == item.parentPath || (key == "index" && "" == item.path)) {
-            routes.push(item);
-          }
-        });
-      }
-      if(routes.length > 0) {
-        this.$store.commit("SET_SIDEBAR_ROUTERS", routes);
-      }
-      return routes;
-    },
-	ishttp(url) {
-      return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1
-    }
-  },
-};
-</script>
-
-<style lang="scss">
-.topmenu-container.el-menu--horizontal > .el-menu-item {
-  float: left;
-  height: 50px !important;
-  line-height: 50px !important;
-  color: #999093 !important;
-  padding: 0 5px !important;
-  margin: 0 10px !important;
-}
-
-.topmenu-container.el-menu--horizontal > .el-menu-item.is-active, .el-menu--horizontal > .el-submenu.is-active .el-submenu__title {
-  border-bottom: 2px solid #{'var(--theme)'} !important;
-  color: #303133;
-}
-
-/* submenu item */
-.topmenu-container.el-menu--horizontal > .el-submenu .el-submenu__title {
-  float: left;
-  height: 50px !important;
-  line-height: 50px !important;
-  color: #999093 !important;
-  padding: 0 5px !important;
-  margin: 0 10px !important;
-}
-</style>

+ 2 - 8
src/layout/components/Navbar.vue

@@ -1,10 +1,8 @@
 <template>
 	<div class="navbar">
+		<!-- 导航伸缩按钮 -->
 		<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
 
-		<breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav" />
-		<top-nav id="topmenu-container" class="topmenu-container" v-if="topNav" />
-
 		<div class="right-menu">
 			<template v-if="device !== 'mobile'">
 				<search id="header-search" class="right-menu-item" />
@@ -33,16 +31,12 @@
 
 <script>
 	import { mapGetters } from 'vuex'
-	import Breadcrumb from '@/components/Breadcrumb'
-	import TopNav from '@/components/TopNav'
 	import Hamburger from '@/components/Hamburger'
 	import Screenfull from '@/components/Screenfull'
 	import Search from '@/components/HeaderSearch'
 
 	export default {
 		components: {
-			Breadcrumb,
-			TopNav,
 			Hamburger,
 			Screenfull,
 			Search
@@ -160,7 +154,7 @@
 						cursor: pointer;
 						width: 40px;
 						height: 40px;
-						border-radius: 10px;
+						border-radius: 100%;
 					}
 
 					.el-icon-caret-bottom {

+ 235 - 240
src/layout/components/Settings/index.vue

@@ -1,171 +1,166 @@
 <template>
-  <div class="drawer-container">
-    <div>
-      <div class="setting-drawer-content">
-        <div class="setting-drawer-title">
-          <h3 class="drawer-title">主题风格设置</h3>
-        </div>
-        <div class="setting-drawer-block-checbox">
-          <div class="setting-drawer-block-checbox-item" @click="handleTheme('theme-dark')">
-            <img src="@/assets/images/dark.svg" alt="dark">
-            <div v-if="sideTheme === 'theme-dark'" class="setting-drawer-block-checbox-selectIcon" style="display: block;">
-              <i aria-label="图标: check" class="anticon anticon-check">
-                <svg viewBox="64 64 896 896" data-icon="check" width="1em" height="1em" :fill="theme" aria-hidden="true"
-                     focusable="false" class="">
-                  <path
-                    d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"/>
-                </svg>
-              </i>
-            </div>
-          </div>
-          <div class="setting-drawer-block-checbox-item" @click="handleTheme('theme-light')">
-            <img src="@/assets/images/light.svg" alt="light">
-            <div v-if="sideTheme === 'theme-light'" class="setting-drawer-block-checbox-selectIcon" style="display: block;">
-              <i aria-label="图标: check" class="anticon anticon-check">
-                <svg viewBox="64 64 896 896" data-icon="check" width="1em" height="1em" :fill="theme" aria-hidden="true"
-                     focusable="false" class="">
-                  <path
-                    d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"/>
-                </svg>
-              </i>
-            </div>
-          </div>
-        </div>
-
-        <div class="drawer-item">
-          <span>主题颜色</span>
-          <theme-picker style="float: right;height: 26px;margin: -3px 8px 0 0;" @change="themeChange" />
-        </div>
-      </div>
-
-      <el-divider/>
-
-      <h3 class="drawer-title">系统布局配置</h3>
-      
-      <div class="drawer-item">
-        <span>开启 TopNav</span>
-        <el-switch v-model="topNav" class="drawer-switch" />
-      </div>
-
-      <div class="drawer-item">
-        <span>开启 Tags-Views</span>
-        <el-switch v-model="tagsView" class="drawer-switch" />
-      </div>
-
-      <div class="drawer-item">
-        <span>固定 Header</span>
-        <el-switch v-model="fixedHeader" class="drawer-switch" />
-      </div>
-
-      <div class="drawer-item">
-        <span>显示 Logo</span>
-        <el-switch v-model="sidebarLogo" class="drawer-switch" />
-      </div>
-
-      <div class="drawer-item">
-        <span>动态标题</span>
-        <el-switch v-model="dynamicTitle" class="drawer-switch" />
-      </div>
-
-      <el-divider/>
-
-      <el-button size="small" type="primary" plain icon="el-icon-document-add" @click="saveSetting">保存配置</el-button>
-      <el-button size="small" plain icon="el-icon-refresh" @click="resetSetting">重置配置</el-button>
-    </div>
-  </div>
+	<div class="drawer-container">
+		<div>
+			<div class="setting-drawer-content">
+				<div class="setting-drawer-title">
+					<h3 class="drawer-title">主题风格设置</h3>
+				</div>
+				<div class="setting-drawer-block-checbox">
+					<div class="setting-drawer-block-checbox-item" @click="handleTheme('theme-dark')">
+						<img src="@/assets/images/dark.svg" alt="dark" />
+						<div v-if="sideTheme === 'theme-dark'" class="setting-drawer-block-checbox-selectIcon" style="display: block">
+							<i aria-label="图标: check" class="anticon anticon-check">
+								<svg viewBox="64 64 896 896" data-icon="check" width="1em" height="1em" :fill="theme" aria-hidden="true" focusable="false" class="">
+									<path
+										d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"
+									/>
+								</svg>
+							</i>
+						</div>
+					</div>
+					<div class="setting-drawer-block-checbox-item" @click="handleTheme('theme-light')">
+						<img src="@/assets/images/light.svg" alt="light" />
+						<div v-if="sideTheme === 'theme-light'" class="setting-drawer-block-checbox-selectIcon" style="display: block">
+							<i aria-label="图标: check" class="anticon anticon-check">
+								<svg viewBox="64 64 896 896" data-icon="check" width="1em" height="1em" :fill="theme" aria-hidden="true" focusable="false" class="">
+									<path
+										d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"
+									/>
+								</svg>
+							</i>
+						</div>
+					</div>
+				</div>
+
+				<div class="drawer-item">
+					<span>主题颜色</span>
+					<theme-picker style="float: right; height: 26px; margin: -3px 8px 0 0" @change="themeChange" />
+				</div>
+			</div>
+
+			<el-divider />
+
+			<h3 class="drawer-title">系统布局配置</h3>
+
+			<div class="drawer-item">
+				<span>开启 Tags-Views</span>
+				<el-switch v-model="tagsView" class="drawer-switch" />
+			</div>
+
+			<div class="drawer-item">
+				<span>固定 Header</span>
+				<el-switch v-model="fixedHeader" class="drawer-switch" />
+			</div>
+
+			<div class="drawer-item">
+				<span>显示 Logo</span>
+				<el-switch v-model="sidebarLogo" class="drawer-switch" />
+			</div>
+
+			<div class="drawer-item">
+				<span>动态标题</span>
+				<el-switch v-model="dynamicTitle" class="drawer-switch" />
+			</div>
+
+			<el-divider />
+
+			<el-button size="small" type="primary" plain icon="el-icon-document-add" @click="saveSetting">保存配置</el-button>
+			<el-button size="small" plain icon="el-icon-refresh" @click="resetSetting">重置配置</el-button>
+		</div>
+	</div>
 </template>
 
 <script>
-import ThemePicker from '@/components/ThemePicker'
-
-export default {
-  components: { ThemePicker },
-  data() {
-    return {
-      theme: this.$store.state.settings.theme,
-      sideTheme: this.$store.state.settings.sideTheme
-    };
-  },
-  computed: {
-    fixedHeader: {
-      get() {
-        return this.$store.state.settings.fixedHeader
-      },
-      set(val) {
-        this.$store.dispatch('settings/changeSetting', {
-          key: 'fixedHeader',
-          value: val
-        })
-      }
-    },
-    topNav: {
-      get() {
-        return this.$store.state.settings.topNav
-      },
-      set(val) {
-        this.$store.dispatch('settings/changeSetting', {
-          key: 'topNav',
-          value: val
-        })
-        if (!val) {
-          this.$store.commit("SET_SIDEBAR_ROUTERS", this.$store.state.permission.defaultRoutes);
-        }
-      }
-    },
-    tagsView: {
-      get() {
-        return this.$store.state.settings.tagsView
-      },
-      set(val) {
-        this.$store.dispatch('settings/changeSetting', {
-          key: 'tagsView',
-          value: val
-        })
-      }
-    },
-    sidebarLogo: {
-      get() {
-        return this.$store.state.settings.sidebarLogo
-      },
-      set(val) {
-        this.$store.dispatch('settings/changeSetting', {
-          key: 'sidebarLogo',
-          value: val
-        })
-      }
-    },
-    dynamicTitle: {
-      get() {
-        return this.$store.state.settings.dynamicTitle
-      },
-      set(val) {
-        this.$store.dispatch('settings/changeSetting', {
-          key: 'dynamicTitle',
-          value: val
-        })
-      }
-    },
-  },
-  methods: {
-    themeChange(val) {
-      this.$store.dispatch('settings/changeSetting', {
-        key: 'theme',
-        value: val
-      })
-      this.theme = val;
-    },
-    handleTheme(val) {
-      this.$store.dispatch('settings/changeSetting', {
-        key: 'sideTheme',
-        value: val
-      })
-      this.sideTheme = val;
-    },
-    saveSetting() {
-      this.$modal.loading("正在保存到本地,请稍候...");
-      this.$cache.local.set(
-        "layout-setting",
-        `{
+	import ThemePicker from '@/components/ThemePicker'
+
+	export default {
+		components: { ThemePicker },
+		data() {
+			return {
+				theme: this.$store.state.settings.theme,
+				sideTheme: this.$store.state.settings.sideTheme
+			}
+		},
+		computed: {
+			fixedHeader: {
+				get() {
+					return this.$store.state.settings.fixedHeader
+				},
+				set(val) {
+					this.$store.dispatch('settings/changeSetting', {
+						key: 'fixedHeader',
+						value: val
+					})
+				}
+			},
+			topNav: {
+				get() {
+					return this.$store.state.settings.topNav
+				},
+				set(val) {
+					this.$store.dispatch('settings/changeSetting', {
+						key: 'topNav',
+						value: val
+					})
+					if (!val) {
+						this.$store.commit('SET_SIDEBAR_ROUTERS', this.$store.state.permission.defaultRoutes)
+					}
+				}
+			},
+			tagsView: {
+				get() {
+					return this.$store.state.settings.tagsView
+				},
+				set(val) {
+					this.$store.dispatch('settings/changeSetting', {
+						key: 'tagsView',
+						value: val
+					})
+				}
+			},
+			sidebarLogo: {
+				get() {
+					return this.$store.state.settings.sidebarLogo
+				},
+				set(val) {
+					this.$store.dispatch('settings/changeSetting', {
+						key: 'sidebarLogo',
+						value: val
+					})
+				}
+			},
+			dynamicTitle: {
+				get() {
+					return this.$store.state.settings.dynamicTitle
+				},
+				set(val) {
+					this.$store.dispatch('settings/changeSetting', {
+						key: 'dynamicTitle',
+						value: val
+					})
+				}
+			}
+		},
+		methods: {
+			themeChange(val) {
+				this.$store.dispatch('settings/changeSetting', {
+					key: 'theme',
+					value: val
+				})
+				this.theme = val
+			},
+			handleTheme(val) {
+				this.$store.dispatch('settings/changeSetting', {
+					key: 'sideTheme',
+					value: val
+				})
+				this.sideTheme = val
+			},
+			saveSetting() {
+				this.$modal.loading('正在保存到本地,请稍候...')
+				this.$cache.local.set(
+					'layout-setting',
+					`{
             "topNav":${this.topNav},
             "tagsView":${this.tagsView},
             "fixedHeader":${this.fixedHeader},
@@ -174,83 +169,83 @@ export default {
             "sideTheme":"${this.sideTheme}",
             "theme":"${this.theme}"
           }`
-      );
-      setTimeout(this.$modal.closeLoading(), 1000)
-    },
-    resetSetting() {
-      this.$modal.loading("正在清除设置缓存并刷新,请稍候...");
-      this.$cache.local.remove("layout-setting")
-      setTimeout("window.location.reload()", 1000)
-    }
-  }
-}
+				)
+				setTimeout(this.$modal.closeLoading(), 1000)
+			},
+			resetSetting() {
+				this.$modal.loading('正在清除设置缓存并刷新,请稍候...')
+				this.$cache.local.remove('layout-setting')
+				setTimeout('window.location.reload()', 1000)
+			}
+		}
+	}
 </script>
 
 <style lang="scss" scoped>
-  .setting-drawer-content {
-    .setting-drawer-title {
-      margin-bottom: 12px;
-      color: rgba(0, 0, 0, .85);
-      font-size: 14px;
-      line-height: 22px;
-      font-weight: bold;
-    }
-
-    .setting-drawer-block-checbox {
-      display: flex;
-      justify-content: flex-start;
-      align-items: center;
-      margin-top: 10px;
-      margin-bottom: 20px;
-
-      .setting-drawer-block-checbox-item {
-        position: relative;
-        margin-right: 16px;
-        border-radius: 2px;
-        cursor: pointer;
-
-        img {
-          width: 48px;
-          height: 48px;
-        }
-
-        .setting-drawer-block-checbox-selectIcon {
-          position: absolute;
-          top: 0;
-          right: 0;
-          width: 100%;
-          height: 100%;
-          padding-top: 15px;
-          padding-left: 24px;
-          color: #1890ff;
-          font-weight: 700;
-          font-size: 14px;
-        }
-      }
-    }
-  }
-
-  .drawer-container {
-    padding: 24px;
-    font-size: 14px;
-    line-height: 1.5;
-    word-wrap: break-word;
-
-    .drawer-title {
-      margin-bottom: 12px;
-      color: rgba(0, 0, 0, .85);
-      font-size: 14px;
-      line-height: 22px;
-    }
-
-    .drawer-item {
-      color: rgba(0, 0, 0, .65);
-      font-size: 14px;
-      padding: 12px 0;
-    }
-
-    .drawer-switch {
-      float: right
-    }
-  }
+	.setting-drawer-content {
+		.setting-drawer-title {
+			margin-bottom: 12px;
+			color: rgba(0, 0, 0, 0.85);
+			font-size: 14px;
+			line-height: 22px;
+			font-weight: bold;
+		}
+
+		.setting-drawer-block-checbox {
+			display: flex;
+			justify-content: flex-start;
+			align-items: center;
+			margin-top: 10px;
+			margin-bottom: 20px;
+
+			.setting-drawer-block-checbox-item {
+				position: relative;
+				margin-right: 16px;
+				border-radius: 2px;
+				cursor: pointer;
+
+				img {
+					width: 48px;
+					height: 48px;
+				}
+
+				.setting-drawer-block-checbox-selectIcon {
+					position: absolute;
+					top: 0;
+					right: 0;
+					width: 100%;
+					height: 100%;
+					padding-top: 15px;
+					padding-left: 24px;
+					color: #1890ff;
+					font-weight: 700;
+					font-size: 14px;
+				}
+			}
+		}
+	}
+
+	.drawer-container {
+		padding: 24px;
+		font-size: 14px;
+		line-height: 1.5;
+		word-wrap: break-word;
+
+		.drawer-title {
+			margin-bottom: 12px;
+			color: rgba(0, 0, 0, 0.85);
+			font-size: 14px;
+			line-height: 22px;
+		}
+
+		.drawer-item {
+			color: rgba(0, 0, 0, 0.65);
+			font-size: 14px;
+			padding: 12px 0;
+		}
+
+		.drawer-switch {
+			float: right;
+		}
+	}
 </style>

+ 10 - 3
src/layout/index.vue

@@ -1,13 +1,20 @@
 <template>
 	<div :class="classObj" class="app-wrapper" :style="{ '--current-color': theme }">
-		<div v-if="device === 'mobile' && sidebar.opened" class="drawer-bg" @click="handleClickOutside" />
-		<sidebar class="sidebar-container" v-if="!enlarge" />
+		<!-- 手机端遮罩层 -->
+		<!-- <div v-if="device === 'mobile' && sidebar.opened" class="drawer-bg" @click="handleClickOutside" /> -->
+		<!-- 左侧导航菜单 -->
+		<sidebar class="sidebar-container" v-show="!enlarge" />
+		<!-- 右侧内容区域 -->
 		<div :class="{ hasTagsView: needTagsView, left0: enlarge }" class="main-container">
-			<div :class="{ 'fixed-header': fixedHeader }">
+			<div :class="{ 'fixed-header': fixedHeader }" v-show="!enlarge">
+				<!-- 顶部菜单 -->
 				<navbar />
+				<!-- tab小标签 -->
 				<tags-view v-if="needTagsView" />
 			</div>
+			<!-- 主内容 -->
 			<app-main />
+			<!-- 右侧进入主题设置 -->
 			<right-panel>
 				<settings />
 			</right-panel>

+ 3 - 0
src/store/modules/app.js

@@ -14,6 +14,9 @@ const mutations = {
 	SET_ENLARGE: (state) => {
 		state.enlarge = !state.enlarge
 	},
+	NO_ENLARGE: (state) => {
+		state.enlarge = false
+	},
 	TOGGLE_SIDEBAR: (state) => {
 		state.sidebar.opened = !state.sidebar.opened
 		state.sidebar.withoutAnimation = false

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

@@ -41,6 +41,7 @@ const permission = {
 				// 向后端请求路由数据
 				getRouters().then((res) => {
 					const sdata = JSON.parse(JSON.stringify(res.data))
+					console.log(sdata)
 					const rdata = JSON.parse(JSON.stringify(res.data))
 					const sidebarRoutes = filterAsyncRouter(sdata)
 					const rewriteRoutes = filterAsyncRouter(rdata, false, true)

+ 13 - 3
src/store/modules/user.js

@@ -1,5 +1,6 @@
 import { login, logout, getInfo } from '@/api/login'
 import { getToken, setToken, removeToken } from '@/utils/auth'
+import { Notification } from 'element-ui'
 
 const user = {
 	state: {
@@ -38,9 +39,18 @@ const user = {
 			return new Promise((resolve, reject) => {
 				login(username, password, code, uuid)
 					.then((res) => {
-						setToken(res.token)
-						commit('SET_TOKEN', res.token)
-						resolve()
+						if (res.code == 200) {
+							setToken(res.token)
+							commit('SET_TOKEN', res.token)
+							resolve()
+						} else {
+							Notification({
+								message: res.msg,
+								type: 'error',
+								duration: 2000,
+								customClass: 'elemsg-notify'
+							})
+						}
 					})
 					.catch((error) => {
 						reject(error)

+ 0 - 1
src/views/system/levelPosition/index.vue

@@ -185,7 +185,6 @@
 					this.deptTree = this.handleTree(res.data, 'deptId')
 				}
 			})
-			console.log(checkPermi(['system:levelPosition:listLevel']))
 		},
 		methods: {
 			//获取级别数据