mirror of
				https://gitee.com/chu1204505056/vue-admin-beautiful.git
				synced 2025-11-04 05:12:09 +08:00 
			
		
		
		
	♻️ refactor: code
This commit is contained in:
		
							parent
							
								
									e793320d73
								
							
						
					
					
						commit
						a242f65e22
					
				@ -1,5 +1,5 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description .eslintrc.js
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description stylelint
 | 
			
		||||
 */
 | 
			
		||||
module.exports = {
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description babel.config
 | 
			
		||||
 */
 | 
			
		||||
module.exports = {
 | 
			
		||||
 | 
			
		||||
@ -3,7 +3,7 @@ const { join } = require('path')
 | 
			
		||||
const fs = require('fs')
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 随机生成图片url。
 | 
			
		||||
 * @param width
 | 
			
		||||
 * @param height
 | 
			
		||||
@ -14,7 +14,7 @@ function handleRandomImage(width = 50, height = 50) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 处理所有 controller 模块,npm run serve时在node环境中自动输出controller文件夹下Mock接口,请勿修改。
 | 
			
		||||
 * @returns {[]}
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
@ -12,7 +12,7 @@
 | 
			
		||||
    "serve:mac": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
 | 
			
		||||
    "build:mac": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
 | 
			
		||||
    "lint": "vue-cli-service lint --fix",
 | 
			
		||||
    "lint:eslint": "eslint {src,mock,library}/**/*.{vue,js,ts} --fix",
 | 
			
		||||
    "lint:eslint": "eslint {src,mock,library}/**/*.{vue,js} --fix",
 | 
			
		||||
    "lint:prettier": "prettier {src,mock,library}/**/*.{html,vue,css,sass,scss,js,ts,md} --write",
 | 
			
		||||
    "clear": "rimraf node_modules&&npm install  --registry=--registry=https://registry.npmmirror.com",
 | 
			
		||||
    "update": "ncu -u --reject webpack,eslint-plugin-prettier,@vue/eslint-config-prettier,prettier,layouts,sass-loader,sass,screenfull,eslint,chalk,vue,vue-template-compiler,vue-router,vuex,@vue/cli-plugin-babel,@vue/cli-plugin-eslint,@vue/cli-service,eslint-plugin-vue --registry=https://registry.npmmirror.com&&pnpm i",
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 路由守卫,目前两种模式:all模式与intelligence模式
 | 
			
		||||
 */
 | 
			
		||||
import router from '@/router'
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 公共布局及样式自动引入
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -45,259 +45,259 @@
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
  import { mapActions, mapGetters } from 'vuex'
 | 
			
		||||
  import { tokenName } from '@/config'
 | 
			
		||||
import { mapActions, mapGetters } from 'vuex'
 | 
			
		||||
import { tokenName } from '@/config'
 | 
			
		||||
 | 
			
		||||
  export default {
 | 
			
		||||
    name: 'Layout',
 | 
			
		||||
    data() {
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'Layout',
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      oldLayout: '',
 | 
			
		||||
      controller: new window.AbortController(),
 | 
			
		||||
      timeOutID: null,
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  computed: {
 | 
			
		||||
    ...mapGetters({
 | 
			
		||||
      layout: 'settings/layout',
 | 
			
		||||
      tabsBar: 'settings/tabsBar',
 | 
			
		||||
      collapse: 'settings/collapse',
 | 
			
		||||
      header: 'settings/header',
 | 
			
		||||
      device: 'settings/device',
 | 
			
		||||
    }),
 | 
			
		||||
    classObj() {
 | 
			
		||||
      return {
 | 
			
		||||
        oldLayout: '',
 | 
			
		||||
        controller: new window.AbortController(),
 | 
			
		||||
        timeOutID: null,
 | 
			
		||||
        mobile: this.device === 'mobile',
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    computed: {
 | 
			
		||||
      ...mapGetters({
 | 
			
		||||
        layout: 'settings/layout',
 | 
			
		||||
        tabsBar: 'settings/tabsBar',
 | 
			
		||||
        collapse: 'settings/collapse',
 | 
			
		||||
        header: 'settings/header',
 | 
			
		||||
        device: 'settings/device',
 | 
			
		||||
      }),
 | 
			
		||||
      classObj() {
 | 
			
		||||
        return {
 | 
			
		||||
          mobile: this.device === 'mobile',
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
    beforeMount() {
 | 
			
		||||
      window.addEventListener('resize', this.handleResize)
 | 
			
		||||
    },
 | 
			
		||||
    beforeDestroy() {
 | 
			
		||||
      window.removeEventListener('resize', this.handleResize)
 | 
			
		||||
      this.controller.abort()
 | 
			
		||||
      clearTimeout(this.timeOutID)
 | 
			
		||||
    },
 | 
			
		||||
    mounted() {
 | 
			
		||||
      this.oldLayout = this.layout
 | 
			
		||||
      const userAgent = navigator.userAgent
 | 
			
		||||
      if (userAgent.includes('Juejin')) {
 | 
			
		||||
        this.$baseAlert(
 | 
			
		||||
          'vue-admin-beautiful不支持在掘金内置浏览器演示,请手动复制以下地址到浏览器中查看http://mpfhrd48.sanxing.uz7.cn/vue-admin-beautiful'
 | 
			
		||||
        )
 | 
			
		||||
      }
 | 
			
		||||
      const isMobile = this.handleIsMobile()
 | 
			
		||||
  },
 | 
			
		||||
  beforeMount() {
 | 
			
		||||
    window.addEventListener('resize', this.handleResize)
 | 
			
		||||
  },
 | 
			
		||||
  beforeDestroy() {
 | 
			
		||||
    window.removeEventListener('resize', this.handleResize)
 | 
			
		||||
    this.controller.abort()
 | 
			
		||||
    clearTimeout(this.timeOutID)
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.oldLayout = this.layout
 | 
			
		||||
    const userAgent = navigator.userAgent
 | 
			
		||||
    if (userAgent.includes('Juejin')) {
 | 
			
		||||
      this.$baseAlert(
 | 
			
		||||
        'vue-admin-beautiful不支持在掘金内置浏览器演示,请手动复制以下地址到浏览器中查看http://mpfhrd48.sanxing.uz7.cn/vue-admin-beautiful'
 | 
			
		||||
      )
 | 
			
		||||
    }
 | 
			
		||||
    const isMobile = this.handleIsMobile()
 | 
			
		||||
    if (isMobile) {
 | 
			
		||||
      if (isMobile) {
 | 
			
		||||
        //横向布局时如果是手机端访问那么改成纵向版
 | 
			
		||||
        this.$store.dispatch('settings/changeLayout', 'vertical')
 | 
			
		||||
      } else {
 | 
			
		||||
        this.$store.dispatch('settings/changeLayout', this.oldLayout)
 | 
			
		||||
      }
 | 
			
		||||
      this.$store.dispatch('settings/toggleDevice', 'mobile')
 | 
			
		||||
      this.timeOutID = setTimeout(() => {
 | 
			
		||||
        this.$store.dispatch('settings/foldSideBar')
 | 
			
		||||
      }, 2000)
 | 
			
		||||
    } else {
 | 
			
		||||
      this.$store.dispatch('settings/openSideBar')
 | 
			
		||||
    }
 | 
			
		||||
    this.$nextTick(() => {
 | 
			
		||||
      window.addEventListener(
 | 
			
		||||
        'storage',
 | 
			
		||||
        (e) => {
 | 
			
		||||
          if (e.key === tokenName || e.key === null) window.location.reload()
 | 
			
		||||
          if (e.key === tokenName && e.value === null) window.location.reload()
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          capture: false,
 | 
			
		||||
          signal: this.controller?.signal,
 | 
			
		||||
        }
 | 
			
		||||
      )
 | 
			
		||||
    })
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    ...mapActions({
 | 
			
		||||
      handleFoldSideBar: 'settings/foldSideBar',
 | 
			
		||||
    }),
 | 
			
		||||
    handleIsMobile() {
 | 
			
		||||
      return document.body.getBoundingClientRect().width - 1 < 992
 | 
			
		||||
    },
 | 
			
		||||
    handleResize() {
 | 
			
		||||
      if (!document.hidden) {
 | 
			
		||||
        const isMobile = this.handleIsMobile()
 | 
			
		||||
        if (isMobile) {
 | 
			
		||||
          //横向布局时如果是手机端访问那么改成纵向版
 | 
			
		||||
          this.$store.dispatch('settings/changeLayout', 'vertical')
 | 
			
		||||
        } else {
 | 
			
		||||
          this.$store.dispatch('settings/changeLayout', this.oldLayout)
 | 
			
		||||
        }
 | 
			
		||||
        this.$store.dispatch('settings/toggleDevice', 'mobile')
 | 
			
		||||
        this.timeOutID = setTimeout(() => {
 | 
			
		||||
          this.$store.dispatch('settings/foldSideBar')
 | 
			
		||||
        }, 2000)
 | 
			
		||||
      } else {
 | 
			
		||||
        this.$store.dispatch('settings/openSideBar')
 | 
			
		||||
      }
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        window.addEventListener(
 | 
			
		||||
          'storage',
 | 
			
		||||
          (e) => {
 | 
			
		||||
            if (e.key === tokenName || e.key === null) window.location.reload()
 | 
			
		||||
            if (e.key === tokenName && e.value === null) window.location.reload()
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            capture: false,
 | 
			
		||||
            signal: this.controller?.signal,
 | 
			
		||||
          }
 | 
			
		||||
        )
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    methods: {
 | 
			
		||||
      ...mapActions({
 | 
			
		||||
        handleFoldSideBar: 'settings/foldSideBar',
 | 
			
		||||
      }),
 | 
			
		||||
      handleIsMobile() {
 | 
			
		||||
        return document.body.getBoundingClientRect().width - 1 < 992
 | 
			
		||||
      },
 | 
			
		||||
      handleResize() {
 | 
			
		||||
        if (!document.hidden) {
 | 
			
		||||
          const isMobile = this.handleIsMobile()
 | 
			
		||||
          if (isMobile) {
 | 
			
		||||
            //横向布局时如果是手机端访问那么改成纵向版
 | 
			
		||||
            this.$store.dispatch('settings/changeLayout', 'vertical')
 | 
			
		||||
          } else {
 | 
			
		||||
            this.$store.dispatch('settings/changeLayout', this.oldLayout)
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
          this.$store.dispatch('settings/toggleDevice', isMobile ? 'mobile' : 'desktop')
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
        this.$store.dispatch('settings/toggleDevice', isMobile ? 'mobile' : 'desktop')
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
  }
 | 
			
		||||
  },
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
  @mixin fix-header {
 | 
			
		||||
    position: fixed;
 | 
			
		||||
    top: 0;
 | 
			
		||||
    right: 0;
 | 
			
		||||
    left: 0;
 | 
			
		||||
    z-index: $base-z-index - 2;
 | 
			
		||||
    width: 100%;
 | 
			
		||||
    overflow: hidden;
 | 
			
		||||
@mixin fix-header {
 | 
			
		||||
  position: fixed;
 | 
			
		||||
  top: 0;
 | 
			
		||||
  right: 0;
 | 
			
		||||
  left: 0;
 | 
			
		||||
  z-index: $base-z-index - 2;
 | 
			
		||||
  width: 100%;
 | 
			
		||||
  overflow: hidden;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.vue-admin-beautiful-wrapper {
 | 
			
		||||
  position: relative;
 | 
			
		||||
  width: 100%;
 | 
			
		||||
  height: 100%;
 | 
			
		||||
 | 
			
		||||
  .layout-container-horizontal {
 | 
			
		||||
    position: relative;
 | 
			
		||||
 | 
			
		||||
    &.fixed {
 | 
			
		||||
      padding-top: calc(#{$base-top-bar-height} + #{$base-tabs-bar-height});
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    &.fixed.no-tabs-bar {
 | 
			
		||||
      padding-top: $base-top-bar-height;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    ::v-deep {
 | 
			
		||||
      .vab-main {
 | 
			
		||||
        width: 88%;
 | 
			
		||||
        margin: auto;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      .fixed-header {
 | 
			
		||||
        @include fix-header;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      .tag-view-show {
 | 
			
		||||
        background: $base-color-white;
 | 
			
		||||
        box-shadow: $base-box-shadow;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      .nav-bar-container {
 | 
			
		||||
        .fold-unfold {
 | 
			
		||||
          display: none;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      .main-padding {
 | 
			
		||||
        .app-main-container {
 | 
			
		||||
          margin-top: $base-padding;
 | 
			
		||||
          margin-bottom: $base-padding;
 | 
			
		||||
          background: $base-color-white;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  .vue-admin-beautiful-wrapper {
 | 
			
		||||
  .layout-container-vertical {
 | 
			
		||||
    position: relative;
 | 
			
		||||
    width: 100%;
 | 
			
		||||
    height: 100%;
 | 
			
		||||
 | 
			
		||||
    .layout-container-horizontal {
 | 
			
		||||
    .mask {
 | 
			
		||||
      position: fixed;
 | 
			
		||||
      top: 0;
 | 
			
		||||
      right: 0;
 | 
			
		||||
      bottom: 0;
 | 
			
		||||
      left: 0;
 | 
			
		||||
      z-index: $base-z-index - 1;
 | 
			
		||||
      width: 100%;
 | 
			
		||||
      height: 100vh;
 | 
			
		||||
      overflow: hidden;
 | 
			
		||||
      background: #000;
 | 
			
		||||
      opacity: 0.5;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    &.fixed {
 | 
			
		||||
      padding-top: calc(#{$base-nav-bar-height} + #{$base-tabs-bar-height});
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    &.fixed.no-tabs-bar {
 | 
			
		||||
      padding-top: $base-nav-bar-height;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .vab-main {
 | 
			
		||||
      position: relative;
 | 
			
		||||
 | 
			
		||||
      &.fixed {
 | 
			
		||||
        padding-top: calc(#{$base-top-bar-height} + #{$base-tabs-bar-height});
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      &.fixed.no-tabs-bar {
 | 
			
		||||
        padding-top: $base-top-bar-height;
 | 
			
		||||
      }
 | 
			
		||||
      min-height: 100%;
 | 
			
		||||
      margin-left: $base-left-menu-width;
 | 
			
		||||
      background: #f6f8f9;
 | 
			
		||||
      transition: $base-transition;
 | 
			
		||||
 | 
			
		||||
      ::v-deep {
 | 
			
		||||
        .vab-main {
 | 
			
		||||
          width: 88%;
 | 
			
		||||
          margin: auto;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .fixed-header {
 | 
			
		||||
          @include fix-header;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .tag-view-show {
 | 
			
		||||
          background: $base-color-white;
 | 
			
		||||
          left: $base-left-menu-width;
 | 
			
		||||
          width: $base-right-content-width;
 | 
			
		||||
          box-shadow: $base-box-shadow;
 | 
			
		||||
          transition: $base-transition;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .nav-bar-container {
 | 
			
		||||
          .fold-unfold {
 | 
			
		||||
            display: none;
 | 
			
		||||
          }
 | 
			
		||||
          position: relative;
 | 
			
		||||
          box-sizing: border-box;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .main-padding {
 | 
			
		||||
          .app-main-container {
 | 
			
		||||
            margin-top: $base-padding;
 | 
			
		||||
            margin-bottom: $base-padding;
 | 
			
		||||
            background: $base-color-white;
 | 
			
		||||
          }
 | 
			
		||||
        .tabs-bar-container {
 | 
			
		||||
          box-sizing: border-box;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .app-main-container {
 | 
			
		||||
          width: calc(100% - #{$base-padding} - #{$base-padding});
 | 
			
		||||
          margin: $base-padding auto;
 | 
			
		||||
          background: $base-color-white;
 | 
			
		||||
          border-radius: $base-border-radius;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .layout-container-vertical {
 | 
			
		||||
      position: relative;
 | 
			
		||||
 | 
			
		||||
      .mask {
 | 
			
		||||
        position: fixed;
 | 
			
		||||
        top: 0;
 | 
			
		||||
        right: 0;
 | 
			
		||||
        bottom: 0;
 | 
			
		||||
        left: 0;
 | 
			
		||||
        z-index: $base-z-index - 1;
 | 
			
		||||
        width: 100%;
 | 
			
		||||
        height: 100vh;
 | 
			
		||||
        overflow: hidden;
 | 
			
		||||
        background: #000;
 | 
			
		||||
        opacity: 0.5;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      &.fixed {
 | 
			
		||||
        padding-top: calc(#{$base-nav-bar-height} + #{$base-tabs-bar-height});
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      &.fixed.no-tabs-bar {
 | 
			
		||||
        padding-top: $base-nav-bar-height;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      .vab-main {
 | 
			
		||||
        position: relative;
 | 
			
		||||
        min-height: 100%;
 | 
			
		||||
        margin-left: $base-left-menu-width;
 | 
			
		||||
        background: #f6f8f9;
 | 
			
		||||
        transition: $base-transition;
 | 
			
		||||
      &.is-collapse-main {
 | 
			
		||||
        margin-left: $base-left-menu-width-min;
 | 
			
		||||
 | 
			
		||||
        ::v-deep {
 | 
			
		||||
          .fixed-header {
 | 
			
		||||
            @include fix-header;
 | 
			
		||||
 | 
			
		||||
            left: $base-left-menu-width;
 | 
			
		||||
            width: $base-right-content-width;
 | 
			
		||||
            box-shadow: $base-box-shadow;
 | 
			
		||||
            transition: $base-transition;
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
          .nav-bar-container {
 | 
			
		||||
            position: relative;
 | 
			
		||||
            box-sizing: border-box;
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
          .tabs-bar-container {
 | 
			
		||||
            box-sizing: border-box;
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
          .app-main-container {
 | 
			
		||||
            width: calc(100% - #{$base-padding} - #{$base-padding});
 | 
			
		||||
            margin: $base-padding auto;
 | 
			
		||||
            background: $base-color-white;
 | 
			
		||||
            border-radius: $base-border-radius;
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        &.is-collapse-main {
 | 
			
		||||
          margin-left: $base-left-menu-width-min;
 | 
			
		||||
 | 
			
		||||
          ::v-deep {
 | 
			
		||||
            .fixed-header {
 | 
			
		||||
              left: $base-left-menu-width-min;
 | 
			
		||||
              width: calc(100% - 65px);
 | 
			
		||||
            }
 | 
			
		||||
            left: $base-left-menu-width-min;
 | 
			
		||||
            width: calc(100% - 65px);
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    /* 手机端开始 */
 | 
			
		||||
    &.mobile {
 | 
			
		||||
      ::v-deep {
 | 
			
		||||
        .el-pager,
 | 
			
		||||
        .el-pagination__jump {
 | 
			
		||||
          display: none;
 | 
			
		||||
        }
 | 
			
		||||
  /* 手机端开始 */
 | 
			
		||||
  &.mobile {
 | 
			
		||||
    ::v-deep {
 | 
			
		||||
      .el-pager,
 | 
			
		||||
      .el-pagination__jump {
 | 
			
		||||
        display: none;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
        .layout-container-vertical {
 | 
			
		||||
          .el-scrollbar.side-bar-container.is-collapse {
 | 
			
		||||
            width: 0;
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
          .vab-main {
 | 
			
		||||
            width: 100%;
 | 
			
		||||
            margin-left: 0;
 | 
			
		||||
          }
 | 
			
		||||
      .layout-container-vertical {
 | 
			
		||||
        .el-scrollbar.side-bar-container.is-collapse {
 | 
			
		||||
          width: 0;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .vab-main {
 | 
			
		||||
          .fixed-header {
 | 
			
		||||
            left: 0 !important;
 | 
			
		||||
            width: 100% !important;
 | 
			
		||||
          }
 | 
			
		||||
          width: 100%;
 | 
			
		||||
          margin-left: 0;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      .vab-main {
 | 
			
		||||
        .fixed-header {
 | 
			
		||||
          left: 0 !important;
 | 
			
		||||
          width: 100% !important;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* 手机端结束 */
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /* 手机端结束 */
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 | 
			
		||||
@ -5,7 +5,7 @@ import router from './router'
 | 
			
		||||
import './plugins'
 | 
			
		||||
import '@/layouts/export'
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 生产环境默认都使用mock,如果正式用于生产环境时,记得去掉
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description router全局配置,如有必要可分文件抽离,其中asyncRoutes只有在intelligence模式下才会用到,vip文档中已提供路由的基础图标与小清新图标的配置方案,请仔细阅读
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 导入所有 vuex 模块,自动加入namespaced:true,用于解决vuex命名冲突,请勿修改。
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 异常捕获的状态拦截,请勿修改
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 路由拦截状态管理,目前两种模式:all模式与intelligence模式,其中partialRoutes是菜单暂未使用
 | 
			
		||||
 */
 | 
			
		||||
import { asyncRoutes, constantRoutes } from '@/router'
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 所有全局配置的状态管理,如无必要请勿修改
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 代码生成机状态管理
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description tabsBar多标签页逻辑,前期借鉴了很多开源项目发现都有个共同的特点很繁琐并不符合框架设计的初衷,后来在github用户hipi的启发下完成了重构,请勿修改
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 登录、获取用户信息、退出登录、清除accessToken逻辑,不建议修改
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 全局加载动画
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description vue过渡动画
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 全局样式
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 全局主题变量配置
 | 
			
		||||
 */
 | 
			
		||||
/* stylelint-disable */
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
import { storage, tokenTableName } from '@/config'
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 获取accessToken
 | 
			
		||||
 * @returns {string|ActiveX.IXMLDOMNode|Promise<any>|any|IDBRequest<any>|MediaKeyStatus|FormDataEntryValue|Function|Promise<Credential | null>}
 | 
			
		||||
 */
 | 
			
		||||
@ -20,7 +20,7 @@ export function getAccessToken() {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 存储accessToken
 | 
			
		||||
 * @param accessToken
 | 
			
		||||
 * @returns {void|*}
 | 
			
		||||
@ -40,7 +40,7 @@ export function setAccessToken(accessToken) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 移除accessToken
 | 
			
		||||
 * @returns {void|Promise<void>}
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
@ -10,7 +10,7 @@ function clipboardError() {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 复制数据
 | 
			
		||||
 * @param text
 | 
			
		||||
 * @param event
 | 
			
		||||
 | 
			
		||||
@ -5,7 +5,7 @@ const privateKey =
 | 
			
		||||
  'MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAMFPa+v52FkSUXvcUnrGI/XzW3EpZRI0s9BCWJ3oNQmEYA5luWW5p8h0uadTIoTyYweFPdH4hveyxlwmS7oefvbIdiP+o+QIYW/R4Wjsb4Yl8MhR4PJqUE3RCy6IT9fM8ckG4kN9ECs6Ja8fQFc6/mSl5dJczzJO3k1rWMBhKJD/AgMBAAECgYEAucMakH9dWeryhrYoRHcXo4giPVJsH9ypVt4KzmOQY/7jV7KFQK3x//27UoHfUCak51sxFw9ek7UmTPM4HjikA9LkYeE7S381b4QRvFuf3L6IbMP3ywJnJ8pPr2l5SqQ00W+oKv+w/VmEsyUHr+k4Z+4ik+FheTkVWp566WbqFsECQQDjYaMcaKw3j2Zecl8T6eUe7fdaRMIzp/gcpPMfT/9rDzIQk+7ORvm1NI9AUmFv/FAlfpuAMrdL2n7p9uznWb7RAkEA2aP934kbXg5bdV0R313MrL+7WTK/qdcYxATUbMsMuWWQBoS5irrt80WCZbG48hpocJavLNjbtrjmUX3CuJBmzwJAOJg8uP10n/+ZQzjEYXh+BszEHDuw+pp8LuT/fnOy5zrJA0dO0RjpXijO3vuiNPVgHXT9z1LQPJkNrb5ACPVVgQJBALPeb4uV0bNrJDUb5RB4ghZnIxv18CcaqNIft7vuGCcFBAIPIRTBprR+RuVq+xHDt3sNXdsvom4h49+Hky1b0ksCQBBwUtVaqH6ztCtwUF1j2c/Zcrt5P/uN7IHAd44K0gIJc1+Csr3qPG+G2yoqRM8KVqLI8Z2ZYn9c+AvEE+L9OQY='
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description RSA加密
 | 
			
		||||
 * @param data
 | 
			
		||||
 * @returns {Promise<{param: PromiseLike<ArrayBuffer>}|*>}
 | 
			
		||||
@ -29,7 +29,7 @@ export async function encryptedData(data) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description RSA解密
 | 
			
		||||
 * @param data
 | 
			
		||||
 * @returns {PromiseLike<ArrayBuffer>}
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description all模式渲染后端返回路由
 | 
			
		||||
 * @param constantRoutes
 | 
			
		||||
 * @returns {*}
 | 
			
		||||
@ -24,7 +24,7 @@ export function convertRouter(asyncRoutes) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 判断当前路由是否包含权限
 | 
			
		||||
 * @param permissions
 | 
			
		||||
 * @param route
 | 
			
		||||
@ -39,7 +39,7 @@ function hasPermission(permissions, route) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description intelligence模式根据permissions数组拦截路由
 | 
			
		||||
 * @param routes
 | 
			
		||||
 * @param permissions
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 格式化时间
 | 
			
		||||
 * @param time
 | 
			
		||||
 * @param cFormat
 | 
			
		||||
@ -45,7 +45,7 @@ export function parseTime(time, cFormat) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 格式化时间
 | 
			
		||||
 * @param time
 | 
			
		||||
 * @param option
 | 
			
		||||
@ -80,7 +80,7 @@ export function formatTime(time, option) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 将url请求参数转为json格式
 | 
			
		||||
 * @param url
 | 
			
		||||
 * @returns {{}|any}
 | 
			
		||||
@ -94,7 +94,7 @@ export function paramObj(url) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 父子关系的数组转换成树形结构数据
 | 
			
		||||
 * @param data
 | 
			
		||||
 * @returns {*}
 | 
			
		||||
@ -119,7 +119,7 @@ export function translateDataToTree(data) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 树形结构数据转换成父子关系的数组
 | 
			
		||||
 * @param data
 | 
			
		||||
 * @returns {[]}
 | 
			
		||||
@ -146,7 +146,7 @@ export function translateTreeToData(data) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 10位时间戳转换
 | 
			
		||||
 * @param time
 | 
			
		||||
 * @returns {string}
 | 
			
		||||
@ -168,7 +168,7 @@ export function tenBitTimestamp(time) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 13位时间戳转换
 | 
			
		||||
 * @param time
 | 
			
		||||
 * @returns {string}
 | 
			
		||||
@ -190,7 +190,7 @@ export function thirteenBitTimestamp(time) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 获取随机id
 | 
			
		||||
 * @param length
 | 
			
		||||
 * @returns {string}
 | 
			
		||||
@ -205,7 +205,7 @@ export function uuid(length = 32) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description m到n的随机数
 | 
			
		||||
 * @param m
 | 
			
		||||
 * @param n
 | 
			
		||||
@ -216,7 +216,7 @@ export function random(m, n) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description addEventListener
 | 
			
		||||
 * @type {function(...[*]=)}
 | 
			
		||||
 */
 | 
			
		||||
@ -229,7 +229,7 @@ export const on = (function () {
 | 
			
		||||
})()
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description removeEventListener
 | 
			
		||||
 * @type {function(...[*]=)}
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
import { title } from '@/config'
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 设置标题
 | 
			
		||||
 * @param pageTitle
 | 
			
		||||
 * @returns {string}
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
import store from '@/store'
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 检查权限
 | 
			
		||||
 * @param value
 | 
			
		||||
 * @returns {boolean}
 | 
			
		||||
 | 
			
		||||
@ -19,7 +19,7 @@ import { isArray } from '@/utils/validate'
 | 
			
		||||
let loadingInstance
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 处理code异常
 | 
			
		||||
 * @param {*} code
 | 
			
		||||
 * @param {*} msg
 | 
			
		||||
 | 
			
		||||
@ -9,7 +9,7 @@ export function isExternal(path) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description 校验密码是否小于6位
 | 
			
		||||
 * @param str
 | 
			
		||||
 * @returns {boolean}
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @author https://vue-admin-beautiful.com (不想保留author可删除)
 | 
			
		||||
 * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
 | 
			
		||||
 * @description cli配置
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user