Преглед изворни кода

chore: update eslint rules & fix rule

Sendya пре 6 година
родитељ
комит
95f317934a
100 измењених фајлова са 1935 додато и 1949 уклоњено
  1. 5 4
      package.json
  2. 29 30
      src/App.vue
  3. 10 10
      src/api/index.js
  4. 6 6
      src/api/login.js
  5. 8 8
      src/api/manage.js
  6. 33 33
      src/components/AvatarList/Item.vue
  7. 65 66
      src/components/AvatarList/List.vue
  8. 1 1
      src/components/AvatarList/index.js
  9. 79 79
      src/components/CountDown/CountDown.vue
  10. 1 1
      src/components/CountDown/index.js
  11. 47 47
      src/components/Ellipsis/Ellipsis.vue
  12. 1 1
      src/components/Ellipsis/index.js
  13. 12 12
      src/components/FooterToolbar/FooterToolBar.vue
  14. 1 1
      src/components/FooterToolbar/index.js
  15. 29 29
      src/components/NumberInfo/NumberInfo.vue
  16. 1 1
      src/components/NumberInfo/index.js
  17. 1 1
      src/components/Tree/Tree.jsx
  18. 18 18
      src/components/Trend/Trend.vue
  19. 1 1
      src/components/Trend/index.js
  20. 1 1
      src/components/_util/StringUtil.js
  21. 1 1
      src/components/_util/util.js
  22. 38 38
      src/components/chart/Bar.vue
  23. 16 16
      src/components/chart/ChartCard.vue
  24. 18 18
      src/components/chart/Liquid.vue
  25. 35 35
      src/components/chart/MiniArea.vue
  26. 35 35
      src/components/chart/MiniBar.vue
  27. 20 20
      src/components/chart/MiniProgress.vue
  28. 43 43
      src/components/chart/Radar.vue
  29. 13 13
      src/components/chart/RankList.vue
  30. 44 44
      src/components/chart/TransferBar.vue
  31. 38 38
      src/components/chart/Trend.vue
  32. 1 1
      src/components/index.js
  33. 12 12
      src/components/layouts/BasicLayout.vue
  34. 4 4
      src/components/layouts/BlankLayout.vue
  35. 42 42
      src/components/layouts/PageView.vue
  36. 17 17
      src/components/layouts/RouteView.vue
  37. 17 17
      src/components/layouts/UserLayout.vue
  38. 1 1
      src/components/layouts/index.js
  39. 40 40
      src/components/menu/SideMenu.vue
  40. 14 14
      src/components/menu/index.js
  41. 6 6
      src/components/page/GlobalFooter.vue
  42. 55 55
      src/components/page/GlobalHeader.vue
  43. 67 72
      src/components/page/GlobalLayout.vue
  44. 51 52
      src/components/page/PageHeader.vue
  45. 41 41
      src/components/page/PageLayout.vue
  46. 25 25
      src/components/page/SHeaderNotice.vue
  47. 94 94
      src/components/setting/SettingDrawer.vue
  48. 12 12
      src/components/setting/SettingItem.vue
  49. 21 19
      src/components/table/index.js
  50. 10 11
      src/components/tools/Breadcrumb.vue
  51. 59 59
      src/components/tools/DetailList.vue
  52. 20 20
      src/components/tools/HeadInfo.vue
  53. 18 18
      src/components/tools/HeaderNotice.vue
  54. 14 14
      src/components/tools/Logo.vue
  55. 5 5
      src/components/tools/TwoStepCaptcha.vue
  56. 29 29
      src/components/tools/UserMenu.vue
  57. 12 12
      src/components/tools/setting.js
  58. 2 2
      src/config/defaultSettings.js
  59. 12 12
      src/config/router.config.js
  60. 1 1
      src/core/bootstrap.js
  61. 1 1
      src/core/use.js
  62. 4 6
      src/permission.js
  63. 1 1
      src/router/index.js
  64. 1 1
      src/store/getters.js
  65. 13 13
      src/store/modules/app.js
  66. 3 3
      src/store/modules/permission.js
  67. 7 7
      src/store/modules/user.js
  68. 2 2
      src/store/mutation-types.js
  69. 4 4
      src/utils/auth.js
  70. 30 30
      src/utils/axios.js
  71. 3 4
      src/utils/device.js
  72. 4 4
      src/utils/filter.js
  73. 5 6
      src/utils/helper/permission.js
  74. 2 2
      src/utils/mixin.js
  75. 2 2
      src/utils/permissions.js
  76. 4 4
      src/utils/request.js
  77. 0 1
      src/utils/storage.js
  78. 6 6
      src/utils/util.js
  79. 4 4
      src/views/404.vue
  80. 34 34
      src/views/Home.vue
  81. 10 10
      src/views/account/center/Index.vue
  82. 17 17
      src/views/account/center/page/App.vue
  83. 9 9
      src/views/account/center/page/Article.vue
  84. 4 4
      src/views/account/center/page/Project.vue
  85. 1 1
      src/views/account/center/page/index.js
  86. 45 47
      src/views/account/settings/AvatarModal.vue
  87. 29 29
      src/views/account/settings/BaseSetting.vue
  88. 9 9
      src/views/account/settings/Binding.vue
  89. 61 61
      src/views/account/settings/Custom.vue
  90. 47 47
      src/views/account/settings/Index.vue
  91. 9 9
      src/views/account/settings/Notification.vue
  92. 12 12
      src/views/account/settings/Security.vue
  93. 40 40
      src/views/dashboard/Analysis.vue
  94. 4 4
      src/views/dashboard/Monitor.vue
  95. 118 119
      src/views/dashboard/Workplace.vue
  96. 6 6
      src/views/exception/403.vue
  97. 6 6
      src/views/exception/404.vue
  98. 6 6
      src/views/exception/500.vue
  99. 19 19
      src/views/exception/ExceptionPage.vue
  100. 1 1
      src/views/exception/type.js

+ 5 - 4
package.json

@@ -31,15 +31,15 @@
     "@vue/cli-plugin-babel": "^3.3.0",
     "@vue/cli-plugin-eslint": "^3.3.0",
     "@vue/cli-plugin-unit-jest": "^3.3.0",
-    "@vue/cli-service": "^3.2.1",
+    "@vue/cli-service": "^3.3.0",
     "@vue/eslint-config-standard": "^4.0.0",
     "@vue/test-utils": "^1.0.0-beta.20",
     "babel-core": "7.0.0-bridge.0",
     "babel-eslint": "^10.0.1",
     "babel-jest": "^23.6.0",
-    "eslint": "^5.12.1",
+    "eslint": "^5.8.0",
     "eslint-plugin-html": "^5.0.0",
-    "eslint-plugin-vue": "^5.1.0",
+    "eslint-plugin-vue": "^5.0.0",
     "less": "^3.8.1",
     "less-loader": "^4.1.0",
     "vue-template-compiler": "^2.5.22"
@@ -51,7 +51,7 @@
     },
     "extends": [
       "plugin:vue/strongly-recommended",
-      "eslint:recommended"
+      "@vue/standard"
     ],
     "parserOptions": {
       "parser": "babel-eslint"
@@ -80,6 +80,7 @@
       "vue/html-closing-bracket-newline": 0,
       "vue/no-parsing-error": 0,
       "no-console": 0,
+      "no-tabs": 0,
       "quotes": [
         2,
         "single",

+ 29 - 30
src/App.vue

@@ -7,41 +7,40 @@
 </template>
 
 <script>
-  import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
-  import { deviceEnquire, DEVICE_TYPE } from '@/utils/device'
+import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
+import { deviceEnquire, DEVICE_TYPE } from '@/utils/device'
 
-  export default {
-    data () {
-      return {
-        locale: zhCN
-      }
-    },
-    mounted () {
-      const { $store } = this
-      deviceEnquire(deviceType => {
-
-        switch (deviceType) {
-          case DEVICE_TYPE.DESKTOP:
-            $store.commit('TOGGLE_DEVICE', 'desktop')
-            $store.dispatch('setSidebar', true)
-            break
-          case DEVICE_TYPE.TABLET:
-            $store.commit('TOGGLE_DEVICE', 'tablet')
-            $store.dispatch('setSidebar', false)
-            break
-          case DEVICE_TYPE.MOBILE:
-          default:
-            $store.commit('TOGGLE_DEVICE', 'mobile')
-            $store.dispatch('setSidebar', true)
-            break
-        }
-        console.log('deviceType', deviceType)
-      })
+export default {
+  data () {
+    return {
+      locale: zhCN
     }
+  },
+  mounted () {
+    const { $store } = this
+    deviceEnquire(deviceType => {
+      switch (deviceType) {
+        case DEVICE_TYPE.DESKTOP:
+          $store.commit('TOGGLE_DEVICE', 'desktop')
+          $store.dispatch('setSidebar', true)
+          break
+        case DEVICE_TYPE.TABLET:
+          $store.commit('TOGGLE_DEVICE', 'tablet')
+          $store.dispatch('setSidebar', false)
+          break
+        case DEVICE_TYPE.MOBILE:
+        default:
+          $store.commit('TOGGLE_DEVICE', 'mobile')
+          $store.dispatch('setSidebar', true)
+          break
+      }
+      console.log('deviceType', deviceType)
+    })
   }
+}
 </script>
 <style>
   #app {
     height: 100%;
   }
-</style>
+</style>

+ 10 - 10
src/api/index.js

@@ -1,12 +1,12 @@
 const api = {
-    Login: '/auth/login',
-    Logout: '/auth/logout',
-    ForgePassword: '/auth/forge-password',
-    Register: '/auth/register',
-    twoStepCode: '/auth/2step-code',
-    SendSms: '/account/sms',
-    SendSmsErr: '/account/sms_err',
-    // get my info
-    UserInfo: '/user/info'
+  Login: '/auth/login',
+  Logout: '/auth/logout',
+  ForgePassword: '/auth/forge-password',
+  Register: '/auth/register',
+  twoStepCode: '/auth/2step-code',
+  SendSms: '/account/sms',
+  SendSmsErr: '/account/sms_err',
+  // get my info
+  UserInfo: '/user/info'
 }
-export default api
+export default api

+ 6 - 6
src/api/login.js

@@ -12,7 +12,7 @@ import { axios } from '@/utils/request'
  * @param parameter
  * @returns {*}
  */
-export function login(parameter) {
+export function login (parameter) {
   return axios({
     url: '/auth/login',
     method: 'post',
@@ -20,7 +20,7 @@ export function login(parameter) {
   })
 }
 
-export function getSmsCaptcha(parameter) {
+export function getSmsCaptcha (parameter) {
   return axios({
     url: api.SendSms,
     method: 'post',
@@ -28,7 +28,7 @@ export function getSmsCaptcha(parameter) {
   })
 }
 
-export function getInfo() {
+export function getInfo () {
   return axios({
     url: '/user/info',
     method: 'get',
@@ -38,7 +38,7 @@ export function getInfo() {
   })
 }
 
-export function logout() {
+export function logout () {
   return axios({
     url: '/auth/logout',
     method: 'post',
@@ -52,10 +52,10 @@ export function logout() {
  * get user 2step code open?
  * @param parameter {*}
  */
-export function get2step(parameter) {
+export function get2step (parameter) {
   return axios({
     url: api.twoStepCode,
     method: 'post',
     data: parameter
   })
-}
+}

+ 8 - 8
src/api/manage.js

@@ -11,7 +11,7 @@ const api = {
 
 export default api
 
-export function getUserList(parameter) {
+export function getUserList (parameter) {
   return axios({
     url: api.user,
     method: 'get',
@@ -19,7 +19,7 @@ export function getUserList(parameter) {
   })
 }
 
-export function getRoleList(parameter) {
+export function getRoleList (parameter) {
   return axios({
     url: api.role,
     method: 'get',
@@ -27,7 +27,7 @@ export function getRoleList(parameter) {
   })
 }
 
-export function getServiceList(parameter) {
+export function getServiceList (parameter) {
   return axios({
     url: api.service,
     method: 'get',
@@ -35,7 +35,7 @@ export function getServiceList(parameter) {
   })
 }
 
-export function getPermissions(parameter) {
+export function getPermissions (parameter) {
   return axios({
     url: api.permissionNoPager,
     method: 'get',
@@ -43,7 +43,7 @@ export function getPermissions(parameter) {
   })
 }
 
-export function getOrgTree(parameter) {
+export function getOrgTree (parameter) {
   return axios({
     url: api.orgTree,
     method: 'get',
@@ -53,10 +53,10 @@ export function getOrgTree(parameter) {
 
 // id == 0 add     post
 // id != 0 update  put
-export function saveService(parameter) {
+export function saveService (parameter) {
   return axios({
     url: api.service,
-    method: parameter.id == 0 ? 'post' : 'put',
+    method: parameter.id === 0 ? 'post' : 'put',
     data: parameter
   })
-}
+}

+ 33 - 33
src/components/AvatarList/Item.vue

@@ -7,40 +7,40 @@
 </template>
 
 <script>
-  import Avatar from 'ant-design-vue/es/avatar'
-  import Tooltip from 'ant-design-vue/es/tooltip'
+import Avatar from 'ant-design-vue/es/avatar'
+import Tooltip from 'ant-design-vue/es/tooltip'
 
-  export default {
-    name: 'AvatarItem',
-    components: {
-      Avatar,
-      Tooltip
+export default {
+  name: 'AvatarItem',
+  components: {
+    Avatar,
+    Tooltip
+  },
+  props: {
+    tips: {
+      type: String,
+      default: '',
+      required: false
     },
-    props: {
-      tips: {
-        type: String,
-        default: '',
-        required: false
-      },
-      src: {
-        type: String,
-        default: ''
-      }
-    },
-    data () {
-      return {
-        size: this.$parent.size
-      }
-    },
-    computed: {
-      avatarSize () {
-        return this.size !== 'mini' && this.size || 20
-      }
-    },
-    watch: {
-      '$parent.size' (val) {
-        this.size = val
-      }
+    src: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      size: this.$parent.size
+    }
+  },
+  computed: {
+    avatarSize () {
+      return this.size !== 'mini' && this.size || 20
+    }
+  },
+  watch: {
+    '$parent.size' (val) {
+      this.size = val
     }
   }
-</script>
+}
+</script>

+ 65 - 66
src/components/AvatarList/List.vue

@@ -5,7 +5,6 @@
       <slot></slot>
       <template v-for="item in filterEmpty($slots.default).slice(0, 3)"></template>
 
-
       <template v-if="maxLength > 0 && filterEmpty($slots.default).length > maxLength">
         <avatar-item :size="size">
           <avatar :size="size !== 'mini' && size || 20" :style="excessItemsStyle">{{ `+${maxLength}` }}</avatar>
@@ -17,84 +16,84 @@
 -->
 
 <script>
-  import Avatar from 'ant-design-vue/es/avatar'
-  import AvatarItem from './Item'
-  import { filterEmpty } from '@/components/_util/util'
+import Avatar from 'ant-design-vue/es/avatar'
+import AvatarItem from './Item'
+import { filterEmpty } from '@/components/_util/util'
 
-  export default {
-    AvatarItem,
-    name: 'AvatarList',
-    components: {
-      Avatar,
-      AvatarItem
+export default {
+  AvatarItem,
+  name: 'AvatarList',
+  components: {
+    Avatar,
+    AvatarItem
+  },
+  props: {
+    prefixCls: {
+      type: String,
+      default: 'ant-pro-avatar-list'
     },
-    props: {
-      prefixCls: {
-        type: String,
-        default: 'ant-pro-avatar-list'
-      },
-      /**
+    /**
        * 头像大小 类型: large、small 、mini, default
        * 默认值: default
        */
-      size: {
-        type: [String, Number],
-        default: 'default'
-      },
-      /**
+    size: {
+      type: [String, Number],
+      default: 'default'
+    },
+    /**
        * 要显示的最大项目
        */
-      maxLength: {
-        type: Number,
-        default: 0
-      },
-      /**
+    maxLength: {
+      type: Number,
+      default: 0
+    },
+    /**
        * 多余的项目风格
        */
-      excessItemsStyle: {
-        type: Object,
-        default: () => {
-          return {
-            color: '#f56a00',
-            backgroundColor: '#fde3cf'
-          }
-        }
-      }
-    },
-    data () {
-      return {}
-    },
-    methods: {
-      getItems(items) {
-        const classString = {
-          [`${this.prefixCls}-item`]: true,
-          [`${this.size}`]: true
+    excessItemsStyle: {
+      type: Object,
+      default: () => {
+        return {
+          color: '#f56a00',
+          backgroundColor: '#fde3cf'
         }
-
-        if (this.maxLength > 0) {
-          items = items.slice(0, this.maxLength)
-          items.push((<Avatar size={ this.size } style={ this.excessItemsStyle }>{`+${this.maxLength}`}</Avatar>))
-        }
-        const itemList = items.map((item) => (
-          <li class={ classString }>{ item }</li>
-        ))
-        return itemList
       }
-    },
-    render () {
-      const { prefixCls, size } = this.$props
+    }
+  },
+  data () {
+    return {}
+  },
+  methods: {
+    getItems (items) {
       const classString = {
-        [`${prefixCls}`]: true,
-        [`${size}`]: true,
+        [`${this.prefixCls}-item`]: true,
+        [`${this.size}`]: true
       }
-      const items = filterEmpty(this.$slots.default)
-      const itemsDom = items && items.length ? <ul class={`${prefixCls}-items`}>{ this.getItems(items) }</ul> : null
 
-      return (
-        <div class={ classString }>
-          { itemsDom }
-        </div>
-      )
+      if (this.maxLength > 0) {
+        items = items.slice(0, this.maxLength)
+        items.push((<Avatar size={ this.size } style={ this.excessItemsStyle }>{`+${this.maxLength}`}</Avatar>))
+      }
+      const itemList = items.map((item) => (
+        <li class={ classString }>{ item }</li>
+      ))
+      return itemList
+    }
+  },
+  render () {
+    const { prefixCls, size } = this.$props
+    const classString = {
+      [`${prefixCls}`]: true,
+      [`${size}`]: true
     }
+    const items = filterEmpty(this.$slots.default)
+    const itemsDom = items && items.length ? <ul class={`${prefixCls}-items`}>{ this.getItems(items) }</ul> : null
+
+    return (
+      <div class={ classString }>
+        { itemsDom }
+      </div>
+    )
   }
-</script>
+}
+</script>

+ 1 - 1
src/components/AvatarList/index.js

@@ -1,4 +1,4 @@
 import AvatarList from './List'
 import './index.less'
 
-export default AvatarList
+export default AvatarList

+ 79 - 79
src/components/CountDown/CountDown.vue

@@ -6,97 +6,97 @@
 
 <script>
 
-  function fixedZero(val) {
-    return val * 1 < 10 ? `0${val}` : val
-  }
+function fixedZero (val) {
+  return val * 1 < 10 ? `0${val}` : val
+}
 
-  export default {
-    name: 'CountDown',
-    props: {
-      format: {
-        type: Function,
-        default: undefined
-      },
-      target: {
-        type: [Date, Number],
-        required: true,
-      },
-      onEnd: {
-        type: Function,
-        default: () => ({})
-      }
+export default {
+  name: 'CountDown',
+  props: {
+    format: {
+      type: Function,
+      default: undefined
     },
-    data() {
-      return {
-        dateTime: '0',
-        originTargetTime: 0,
-        lastTime: 0,
-        timer: 0,
-        interval: 1000
-      }
+    target: {
+      type: [Date, Number],
+      required: true
     },
-    filters: {
-      format(time) {
-        const hours = 60 * 60 * 1000
-        const minutes = 60 * 1000
+    onEnd: {
+      type: Function,
+      default: () => ({})
+    }
+  },
+  data () {
+    return {
+      dateTime: '0',
+      originTargetTime: 0,
+      lastTime: 0,
+      timer: 0,
+      interval: 1000
+    }
+  },
+  filters: {
+    format (time) {
+      const hours = 60 * 60 * 1000
+      const minutes = 60 * 1000
 
-        const h = Math.floor(time / hours)
-        const m = Math.floor((time - h * hours) / minutes)
-        const s = Math.floor((time - h * hours - m * minutes) / 1000)
-        return `${fixedZero(h)}:${fixedZero(m)}:${fixedZero(s)}`
-      }
-    },
-    created() {
-      this.initTime()
-      this.tick()
-    },
-    methods: {
-      initTime() {
-        let lastTime = 0
-        let targetTime = 0
-        this.originTargetTime = this.target
-        try {
-          if (Object.prototype.toString.call(this.target) === '[object Date]') {
-            targetTime = this.target
-          } else {
-            targetTime = new Date(this.target).getTime()
-          }
-        } catch (e) {
-          throw new Error('invalid target prop')
+      const h = Math.floor(time / hours)
+      const m = Math.floor((time - h * hours) / minutes)
+      const s = Math.floor((time - h * hours - m * minutes) / 1000)
+      return `${fixedZero(h)}:${fixedZero(m)}:${fixedZero(s)}`
+    }
+  },
+  created () {
+    this.initTime()
+    this.tick()
+  },
+  methods: {
+    initTime () {
+      let lastTime = 0
+      let targetTime = 0
+      this.originTargetTime = this.target
+      try {
+        if (Object.prototype.toString.call(this.target) === '[object Date]') {
+          targetTime = this.target
+        } else {
+          targetTime = new Date(this.target).getTime()
         }
+      } catch (e) {
+        throw new Error('invalid target prop')
+      }
 
-        lastTime = targetTime - new Date().getTime()
+      lastTime = targetTime - new Date().getTime()
 
-        this.lastTime = lastTime < 0 ? 0 : lastTime
-      },
-      tick() {
-        const {onEnd} = this
+      this.lastTime = lastTime < 0 ? 0 : lastTime
+    },
+    tick () {
+      const { onEnd } = this
 
-        this.timer = setTimeout(() => {
-          if (this.lastTime < this.interval) {
-            clearTimeout(this.timer)
-            this.lastTime = 0
-            if (typeof onEnd === 'function') {
-              onEnd()
-            }
-          } else {
-            this.lastTime -= this.interval
-            this.tick()
+      this.timer = setTimeout(() => {
+        if (this.lastTime < this.interval) {
+          clearTimeout(this.timer)
+          this.lastTime = 0
+          if (typeof onEnd === 'function') {
+            onEnd()
           }
-        }, this.interval)
-      }
-    },
-    beforeUpdate () {
-      if (this.originTargetTime !== this.target) {
-        this.initTime()
-      }
-    },
-    beforeDestroy() {
-      clearTimeout(this.timer)
+        } else {
+          this.lastTime -= this.interval
+          this.tick()
+        }
+      }, this.interval)
+    }
+  },
+  beforeUpdate () {
+    if (this.originTargetTime !== this.target) {
+      this.initTime()
     }
+  },
+  beforeDestroy () {
+    clearTimeout(this.timer)
   }
+}
 </script>
 
 <style scoped>
 
-</style>
+</style>

+ 1 - 1
src/components/CountDown/index.js

@@ -1,3 +1,3 @@
 import CountDown from './CountDown'
 
-export default CountDown
+export default CountDown

+ 47 - 47
src/components/Ellipsis/Ellipsis.vue

@@ -1,7 +1,7 @@
 <script>
-  import Tooltip from 'ant-design-vue/es/tooltip'
-  import { cutStrByFullLength, getStrFullLength } from '@/components/_util/StringUtil'
-  /*
+import Tooltip from 'ant-design-vue/es/tooltip'
+import { cutStrByFullLength, getStrFullLength } from '@/components/_util/StringUtil'
+/*
     const isSupportLineClamp = document.body.style.webkitLineClamp !== undefined;
 
     const TooltipOverlayStyle = {
@@ -10,55 +10,55 @@
     };
   */
 
-  export default {
-    name: 'Ellipsis',
-    components: {
-      Tooltip
+export default {
+  name: 'Ellipsis',
+  components: {
+    Tooltip
+  },
+  props: {
+    prefixCls: {
+      type: String,
+      default: 'ant-pro-ellipsis'
     },
-    props: {
-      prefixCls: {
-        type: String,
-        default: 'ant-pro-ellipsis'
-      },
-      tooltip: {
-        type: Boolean
-      },
-      length: {
-        type: Number,
-        required: true
-      },
-      lines: {
-        type: Number,
-        default: 1
-      },
-      fullWidthRecognition: {
-        type: Boolean,
-        default: false
-      }
+    tooltip: {
+      type: Boolean
     },
-    methods: {
-      getStrDom (str, fullLength) {
-        return (
-          <span>{ cutStrByFullLength(str, this.length) + (fullLength > this.length ? '...' : '') }</span>
-        )
-      },
-      getTooltip (fullStr, fullLength) {
-        return (
-          <Tooltip>
-            <template slot="title">{ fullStr }</template>
-            { this.getStrDom(fullStr, fullLength) }
-          </Tooltip>
-        )
-      }
+    length: {
+      type: Number,
+      required: true
     },
-    render () {
-      const { tooltip, length } = this.$props
-      const str = this.$slots.default.map(vNode => vNode.text).join('')
-      const fullLength = getStrFullLength(str)
-      const strDom = tooltip && fullLength > length ? this.getTooltip(str, fullLength) : this.getStrDom(str, fullLength)
+    lines: {
+      type: Number,
+      default: 1
+    },
+    fullWidthRecognition: {
+      type: Boolean,
+      default: false
+    }
+  },
+  methods: {
+    getStrDom (str, fullLength) {
+      return (
+        <span>{ cutStrByFullLength(str, this.length) + (fullLength > this.length ? '...' : '') }</span>
+      )
+    },
+    getTooltip (fullStr, fullLength) {
       return (
-        strDom
+        <Tooltip>
+          <template slot="title">{ fullStr }</template>
+          { this.getStrDom(fullStr, fullLength) }
+        </Tooltip>
       )
     }
+  },
+  render () {
+    const { tooltip, length } = this.$props
+    const str = this.$slots.default.map(vNode => vNode.text).join('')
+    const fullLength = getStrFullLength(str)
+    const strDom = tooltip && fullLength > length ? this.getTooltip(str, fullLength) : this.getStrDom(str, fullLength)
+    return (
+      strDom
+    )
   }
+}
 </script>

+ 1 - 1
src/components/Ellipsis/index.js

@@ -1,3 +1,3 @@
 import Ellipsis from './Ellipsis'
 
-export default Ellipsis
+export default Ellipsis

+ 12 - 12
src/components/FooterToolbar/FooterToolBar.vue

@@ -10,21 +10,21 @@
 </template>
 
 <script>
-  export default {
-    name: 'FooterToolBar',
-    props: {
-      prefixCls: {
-        type: String,
-        default: 'ant-pro-footer-toolbar'
-      },
-      extra: {
-        type: [String, Object],
-        default: ''
-      }
+export default {
+  name: 'FooterToolBar',
+  props: {
+    prefixCls: {
+      type: String,
+      default: 'ant-pro-footer-toolbar'
+    },
+    extra: {
+      type: [String, Object],
+      default: ''
     }
   }
+}
 </script>
 
 <style lang="less" scoped>
 
-</style>
+</style>

+ 1 - 1
src/components/FooterToolbar/index.js

@@ -1,4 +1,4 @@
 import FooterToolBar from './FooterToolBar'
 import './index.less'
 
-export default FooterToolBar
+export default FooterToolBar

+ 29 - 29
src/components/NumberInfo/NumberInfo.vue

@@ -14,41 +14,41 @@
 </template>
 
 <script>
-  import Icon from 'ant-design-vue/es/icon'
+import Icon from 'ant-design-vue/es/icon'
 
-  export default {
-    name: 'NumberInfo',
-    props: {
-      prefixCls: {
-        type: String,
-        default: 'ant-pro-number-info'
-      },
-      total: {
-        type: Number,
-        required: true
-      },
-      subTotal: {
-        type: Number,
-        required: true
-      },
-      subTitle: {
-        type: [String, Function],
-        default: ''
-      },
-      status: {
-        type: String,
-        default: 'up'
-      }
+export default {
+  name: 'NumberInfo',
+  props: {
+    prefixCls: {
+      type: String,
+      default: 'ant-pro-number-info'
     },
-    components: {
-      Icon
+    total: {
+      type: Number,
+      required: true
     },
-    data () {
-      return {}
+    subTotal: {
+      type: Number,
+      required: true
+    },
+    subTitle: {
+      type: [String, Function],
+      default: ''
+    },
+    status: {
+      type: String,
+      default: 'up'
     }
+  },
+  components: {
+    Icon
+  },
+  data () {
+    return {}
   }
+}
 </script>
 
 <style lang="less" scoped>
   @import "index";
-</style>
+</style>

+ 1 - 1
src/components/NumberInfo/index.js

@@ -1,3 +1,3 @@
 import NumberInfo from './NumberInfo'
 
-export default NumberInfo
+export default NumberInfo

+ 1 - 1
src/components/Tree/Tree.jsx

@@ -115,7 +115,7 @@ export default {
     return (
       <div class="tree-wrapper">
         { search ? this.renderSearch() : null }
-        <Menu mode="inline" class="custom-tree" {...{ on: { click: item =>  this.$emit('click', item), 'update:openKeys': val => { this.localOpenKeys = val } }}} openKeys={this.localOpenKeys}>
+        <Menu mode="inline" class="custom-tree" {...{ on: { click: item => this.$emit('click', item), 'update:openKeys': val => { this.localOpenKeys = val } } }} openKeys={this.localOpenKeys}>
           { list }
         </Menu>
       </div>

+ 18 - 18
src/components/Trend/Trend.vue

@@ -11,31 +11,31 @@
 </template>
 
 <script>
-  export default {
-    name: 'Trend',
-    props: {
-      prefixCls: {
-        type: String,
-        default: 'ant-pro-trend'
-      },
-      /**
+export default {
+  name: 'Trend',
+  props: {
+    prefixCls: {
+      type: String,
+      default: 'ant-pro-trend'
+    },
+    /**
        * 上升下降标识:up|down
        */
-      flag: {
-        type: String,
-        required: true
-      },
-      /**
+    flag: {
+      type: String,
+      required: true
+    },
+    /**
        * 颜色反转
        */
-      reverseColor: {
-        type: Boolean,
-        default: false
-      }
+    reverseColor: {
+      type: Boolean,
+      default: false
     }
   }
+}
 </script>
 
 <style lang="less" scoped>
   @import "index";
-</style>
+</style>

+ 1 - 1
src/components/Trend/index.js

@@ -1,3 +1,3 @@
 import Trend from './Trend.vue'
 
-export default Trend
+export default Trend

+ 1 - 1
src/components/_util/StringUtil.js

@@ -22,4 +22,4 @@ export const cutStrByFullLength = (str = '', maxLength) => {
     }
     return pre
   }, '')
-}
+}

+ 1 - 1
src/components/_util/util.js

@@ -9,4 +9,4 @@
  */
 export function filterEmpty (children = []) {
   return children.filter(c => c.tag || (c.text && c.text.trim() !== ''))
-}
+}

+ 38 - 38
src/components/chart/Bar.vue

@@ -14,44 +14,44 @@
 </template>
 
 <script>
-  const data = []
-  for (let i = 0; i < 12; i += 1) {
-    data.push({
-      x: `${i + 1}月`,
-      y: Math.floor(Math.random() * 1000) + 200
-    })
-  }
-  const tooltip = [
-    'x*y',
-    (x, y) => ({
-      name: x,
-      value: y
-    })
-  ]
-  const scale = [{
-    dataKey: 'x',
-    min: 2
-  }, {
-    dataKey: 'y',
-    title: '时间',
-    min: 1,
-    max: 22
-  }]
+const data = []
+for (let i = 0; i < 12; i += 1) {
+  data.push({
+    x: `${i + 1}月`,
+    y: Math.floor(Math.random() * 1000) + 200
+  })
+}
+const tooltip = [
+  'x*y',
+  (x, y) => ({
+    name: x,
+    value: y
+  })
+]
+const scale = [{
+  dataKey: 'x',
+  min: 2
+}, {
+  dataKey: 'y',
+  title: '时间',
+  min: 1,
+  max: 22
+}]
 
-  export default {
-    name: 'Bar',
-    props: {
-      title: {
-        type: String,
-        default: ''
-      }
-    },
-    data () {
-      return {
-        data,
-        scale,
-        tooltip
-      }
+export default {
+  name: 'Bar',
+  props: {
+    title: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      data,
+      scale,
+      tooltip
     }
   }
-</script>
+}
+</script>

+ 16 - 16
src/components/chart/ChartCard.vue

@@ -23,23 +23,23 @@
 </template>
 
 <script>
-  export default {
-    name: 'ChartCard',
-    props: {
-      title: {
-        type: String,
-        default: ''
-      },
-      total: {
-        type: String,
-        default: ''
-      },
-      loading: {
-        type: Boolean,
-        default: false
-      }
+export default {
+  name: 'ChartCard',
+  props: {
+    title: {
+      type: String,
+      default: ''
+    },
+    total: {
+      type: String,
+      default: ''
+    },
+    loading: {
+      type: Boolean,
+      default: false
     }
   }
+}
 </script>
 
 <style lang="less" scoped>
@@ -108,4 +108,4 @@
     line-height: 38px;
     height: 38px;
   }
-</style>
+</style>

+ 18 - 18
src/components/chart/Liquid.vue

@@ -1,11 +1,11 @@
 <template>
   <div>
-    <v-chart 
-      :forceFit="true" 
-      :height="height" 
-      :width="width" 
-      :data="data" 
-      :scale="scale" 
+    <v-chart
+      :forceFit="true"
+      :height="height"
+      :width="width"
+      :data="data"
+      :scale="scale"
       :padding="0">
       <v-tooltip />
       <v-interval
@@ -47,21 +47,21 @@
 </template>
 
 <script>
-  export default {
-    name: 'Liquid',
-    props: {
-      height: {
-        type: Number,
-        default: 0
-      },
-      width: {
-        type: Number,
-        default: 0
-      }
+export default {
+  name: 'Liquid',
+  props: {
+    height: {
+      type: Number,
+      default: 0
+    },
+    width: {
+      type: Number,
+      default: 0
     }
   }
+}
 </script>
 
 <style scoped>
 
-</style>
+</style>

+ 35 - 35
src/components/chart/MiniArea.vue

@@ -10,47 +10,47 @@
 </template>
 
 <script>
-  import moment from 'moment'
-  const data = []
-  const beginDay = new Date().getTime()
+import moment from 'moment'
+const data = []
+const beginDay = new Date().getTime()
 
-  for (let i = 0; i < 10; i++) {
-    data.push({
-      x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'),
-      y: Math.round(Math.random() * 10)
-    })
-  }
+for (let i = 0; i < 10; i++) {
+  data.push({
+    x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'),
+    y: Math.round(Math.random() * 10)
+  })
+}
 
-  const tooltip = [
-    'x*y',
-    (x, y) => ({
-      name: x,
-      value: y
-    })
-  ]
-  const scale = [{
-    dataKey: 'x',
-    min: 2
-  }, {
-    dataKey: 'y',
-    title: '时间',
-    min: 1,
-    max: 22
-  }]
+const tooltip = [
+  'x*y',
+  (x, y) => ({
+    name: x,
+    value: y
+  })
+]
+const scale = [{
+  dataKey: 'x',
+  min: 2
+}, {
+  dataKey: 'y',
+  title: '时间',
+  min: 1,
+  max: 22
+}]
 
-  export default {
-    name: 'MiniArea',
-    data () {
-      return {
-        data,
-        tooltip,
-        scale,
-        height: 100
-      }
+export default {
+  name: 'MiniArea',
+  data () {
+    return {
+      data,
+      tooltip,
+      scale,
+      height: 100
     }
   }
+}
 </script>
 
 <style lang="less" scoped>
   @import "chart";
-</style>
+</style>

+ 35 - 35
src/components/chart/MiniBar.vue

@@ -10,48 +10,48 @@
 </template>
 
 <script>
-  import moment from 'moment'
-  const data = []
-  const beginDay = new Date().getTime()
+import moment from 'moment'
+const data = []
+const beginDay = new Date().getTime()
 
-  for (let i = 0; i < 10; i++) {
-    data.push({
-      x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'),
-      y: Math.round(Math.random() * 10)
-    })
-  }
+for (let i = 0; i < 10; i++) {
+  data.push({
+    x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'),
+    y: Math.round(Math.random() * 10)
+  })
+}
 
-  const tooltip = [
-    'x*y',
-    (x, y) => ({
-      name: x,
-      value: y
-    })
-  ]
+const tooltip = [
+  'x*y',
+  (x, y) => ({
+    name: x,
+    value: y
+  })
+]
 
-  const scale = [{
-    dataKey: 'x',
-    min: 2
-  }, {
-    dataKey: 'y',
-    title: '时间',
-    min: 1,
-    max: 30
-  }]
+const scale = [{
+  dataKey: 'x',
+  min: 2
+}, {
+  dataKey: 'y',
+  title: '时间',
+  min: 1,
+  max: 30
+}]
 
-  export default {
-    name: 'MiniBar',
-    data () {
-      return {
-        data,
-        tooltip,
-        scale,
-        height: 100
-      }
+export default {
+  name: 'MiniBar',
+  data () {
+    return {
+      data,
+      tooltip,
+      scale,
+      height: 100
     }
   }
+}
 </script>
 
 <style lang="less" scoped>
   @import "chart";
-</style>
+</style>

+ 20 - 20
src/components/chart/MiniProgress.vue

@@ -11,27 +11,27 @@
 </template>
 
 <script>
-  export default {
-    name: 'MiniProgress',
-    props: {
-      target: {
-        type: Number,
-        default: 0
-      },
-      height: {
-        type: String,
-        default: '10px'
-      },
-      color: {
-        type: String,
-        default: '#13C2C2'
-      },
-      percentage: {
-        type: Number,
-        default: 0
-      }
+export default {
+  name: 'MiniProgress',
+  props: {
+    target: {
+      type: Number,
+      default: 0
+    },
+    height: {
+      type: String,
+      default: '10px'
+    },
+    color: {
+      type: String,
+      default: '#13C2C2'
+    },
+    percentage: {
+      type: Number,
+      default: 0
     }
   }
+}
 </script>
 
 <style lang="less" scoped>
@@ -72,4 +72,4 @@
       }
     }
   }
-</style>
+</style>

+ 43 - 43
src/components/chart/Radar.vue

@@ -11,58 +11,58 @@
 </template>
 
 <script>
-  const axis1Opts = {
-    dataKey: 'item',
-    line: null,
-    tickLine: null,
-    grid: {
-      lineStyle: {
-        lineDash: null
-      },
-      hideFirstLine: false
+const axis1Opts = {
+  dataKey: 'item',
+  line: null,
+  tickLine: null,
+  grid: {
+    lineStyle: {
+      lineDash: null
+    },
+    hideFirstLine: false
+  }
+}
+const axis2Opts = {
+  dataKey: 'score',
+  line: null,
+  tickLine: null,
+  grid: {
+    type: 'polygon',
+    lineStyle: {
+      lineDash: null
     }
   }
-  const axis2Opts = {
+}
+
+const scale = [
+  {
     dataKey: 'score',
-    line: null,
-    tickLine: null,
-    grid: {
-      type: 'polygon',
-      lineStyle: {
-        lineDash: null
-      }
-    }
+    min: 0,
+    max: 80
+  }, {
+    dataKey: 'user',
+    alias: '类型'
   }
+]
 
-  const scale = [
-    {
-      dataKey: 'score',
-      min: 0,
-      max: 80
-    }, {
-      dataKey: 'user',
-      alias: '类型'
+export default {
+  name: 'Radar',
+  props: {
+    data: {
+      type: Array,
+      default: null
     }
-  ]
-
-  export default {
-    name: 'Radar',
-    props: {
-      data: {
-        type: Array,
-        default: null,
-      }
-    },
-    data () {
-      return {
-        axis1Opts,
-        axis2Opts,
-        scale
-      }
+  },
+  data () {
+    return {
+      axis1Opts,
+      axis2Opts,
+      scale
     }
   }
+}
 </script>
 
 <style scoped>
 
-</style>
+</style>

+ 13 - 13
src/components/chart/RankList.vue

@@ -12,20 +12,20 @@
 </template>
 
 <script>
-  export default {
-    name: 'RankList',
-    // ['title', 'list']
-    props: {
-      title: {
-        type: String,
-        default: ''
-      },
-      list: {
-        type: Array,
-        default: null
-      }
+export default {
+  name: 'RankList',
+  // ['title', 'list']
+  props: {
+    title: {
+      type: String,
+      default: ''
+    },
+    list: {
+      type: Array,
+      default: null
     }
   }
+}
 </script>
 
 <style lang="less" scoped>
@@ -74,4 +74,4 @@
     padding: 0 32px 32px 32px;
   }
 
-</style>
+</style>

+ 44 - 44
src/components/chart/TransferBar.vue

@@ -15,50 +15,50 @@
 </template>
 
 <script>
-  const tooltip = [
-    'x*y',
-    (x, y) => ({
-      name: x,
-      value: y
-    })
-  ]
-  const scale = [{
-    dataKey: 'x',
-    title: '日期(天)',
-    alias: '日期(天)',
-    min: 2
-  }, {
-    dataKey: 'y',
-    title: '流量(Gb)',
-    alias: '流量(Gb)',
-    min: 1
-  }]
+const tooltip = [
+  'x*y',
+  (x, y) => ({
+    name: x,
+    value: y
+  })
+]
+const scale = [{
+  dataKey: 'x',
+  title: '日期(天)',
+  alias: '日期(天)',
+  min: 2
+}, {
+  dataKey: 'y',
+  title: '流量(Gb)',
+  alias: '流量(Gb)',
+  min: 1
+}]
 
-  export default {
-    name: 'Bar',
-    props: {
-      title: {
-        type: String,
-        default: ''
-      }
-    },
-    data () {
-      return {
-        data: [],
-        scale,
-        tooltip
-      }
-    },
-    created () {
-      this.getMonthBar()
-    },
-    methods: {
-      getMonthBar() {
-        this.$http.get('/analysis/month-bar')
-          .then(res => {
-            this.data = res.result
-          })
-      }
+export default {
+  name: 'Bar',
+  props: {
+    title: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      data: [],
+      scale,
+      tooltip
+    }
+  },
+  created () {
+    this.getMonthBar()
+  },
+  methods: {
+    getMonthBar () {
+      this.$http.get('/analysis/month-bar')
+        .then(res => {
+          this.data = res.result
+        })
     }
   }
-</script>
+}
+</script>

+ 38 - 38
src/components/chart/Trend.vue

@@ -7,47 +7,47 @@
 </template>
 
 <script>
-  export default {
-    name: 'Trend',
-    props: {
-      term: {
-        type: String,
-        default: '',
-        required: true
-      },
-      percentage: {
-        type: Number,
-        default: null
-      },
-      type: {
-        type: Boolean,
-        default: null
-      },
-      target: {
-        type: Number,
-        default: 0
-      },
-      value: {
-        type: Number,
-        default: 0
-      },
-      fixed: {
-        type: Number,
-        default: 2
-      }
+export default {
+  name: 'Trend',
+  props: {
+    term: {
+      type: String,
+      default: '',
+      required: true
     },
-    data () {
-      return {
-        trend: this.type && 'up' || 'down',
-        rate: this.percentage
-      }
+    percentage: {
+      type: Number,
+      default: null
+    },
+    type: {
+      type: Boolean,
+      default: null
     },
-    created () {
-      const type = this.type === null ? this.value >= this.target : this.type
-      this.trend = type ? 'up' : 'down'
-      this.rate = (this.percentage === null ? Math.abs(this.value - this.target) * 100 / this.target : this.percentage).toFixed(this.fixed)
+    target: {
+      type: Number,
+      default: 0
+    },
+    value: {
+      type: Number,
+      default: 0
+    },
+    fixed: {
+      type: Number,
+      default: 2
+    }
+  },
+  data () {
+    return {
+      trend: this.type && 'up' || 'down',
+      rate: this.percentage
     }
+  },
+  created () {
+    const type = this.type === null ? this.value >= this.target : this.type
+    this.trend = type ? 'up' : 'down'
+    this.rate = (this.percentage === null ? Math.abs(this.value - this.target) * 100 / this.target : this.percentage).toFixed(this.fixed)
   }
+}
 </script>
 
 <style lang="less" scoped>
@@ -79,4 +79,4 @@
       }
     }
   }
-</style>
+</style>

+ 1 - 1
src/components/index.js

@@ -34,4 +34,4 @@ export {
   FooterToolbar,
   NumberInfo,
   Tree
-}
+}

+ 12 - 12
src/components/layouts/BasicLayout.vue

@@ -7,19 +7,19 @@
 </template>
 
 <script>
-  import RouteView from '@/components/layouts/RouteView'
-  import GlobalLayout from '@/components/page/GlobalLayout'
+import RouteView from '@/components/layouts/RouteView'
+import GlobalLayout from '@/components/page/GlobalLayout'
 
-  export default {
-    name: 'BasicLayout',
-    components: {
-      RouteView,
-      GlobalLayout
-    },
-    data () {
-      return {}
-    }
+export default {
+  name: 'BasicLayout',
+  components: {
+    RouteView,
+    GlobalLayout
+  },
+  data () {
+    return {}
   }
+}
 </script>
 
 <style lang="less">
@@ -46,4 +46,4 @@
     -webkit-transform: scale(1.1);
     transform: scale(1.1);
   }
-</style>
+</style>

+ 4 - 4
src/components/layouts/BlankLayout.vue

@@ -6,11 +6,11 @@
 
 <script>
 
-  export default {
-    name: 'BlankLayout',
-  }
+export default {
+  name: 'BlankLayout'
+}
 </script>
 
 <style scoped>
 
-</style>
+</style>

+ 42 - 42
src/components/layouts/PageView.vue

@@ -9,55 +9,55 @@
 </template>
 
 <script>
-  import PageLayout from '../page/PageLayout'
-  import RouteView from './RouteView'
+import PageLayout from '../page/PageLayout'
+import RouteView from './RouteView'
 
-  export default {
-    name: 'PageContent',
-    components: {
-      RouteView,
-      PageLayout
-    },
-    data () {
-      return {
-        title: '',
-        description: '',
-        linkList: [],
-        extraImage: '',
-        search: false,
-        tabs: {}
-      }
-    },
-    mounted () {
-      this.getPageHeaderInfo()
-    },
-    updated () {
-      this.getPageHeaderInfo()
-    },
-    computed: {
+export default {
+  name: 'PageContent',
+  components: {
+    RouteView,
+    PageLayout
+  },
+  data () {
+    return {
+      title: '',
+      description: '',
+      linkList: [],
+      extraImage: '',
+      search: false,
+      tabs: {}
+    }
+  },
+  mounted () {
+    this.getPageHeaderInfo()
+  },
+  updated () {
+    this.getPageHeaderInfo()
+  },
+  computed: {
 
-      getTitle () {
-        return this.$route.meta.title
-      }
+    getTitle () {
+      return this.$route.meta.title
+    }
 
-    },
-    methods: {
-      getPageHeaderInfo () {
-        // eslint-disable-next-line
+  },
+  methods: {
+    getPageHeaderInfo () {
+      // eslint-disable-next-line
         this.title = this.$route.meta.title
-        // 因为套用了一层 route-view 所以要取 ref 对象下的子节点的第一个对象
-        const content = this.$refs.content && this.$refs.content.$children[0]
+      // 因为套用了一层 route-view 所以要取 ref 对象下的子节点的第一个对象
+      const content = this.$refs.content && this.$refs.content.$children[0]
 
-        if (content) {
-          this.description = content.description
-          this.linkList = content.linkList
-          this.extraImage = content.extraImage
-          this.search = content.search == true ? true : false
-          this.tabs = content.tabs
-        }
+      if (content) {
+        this.description = content.description
+        this.linkList = content.linkList
+        this.extraImage = content.extraImage
+        this.search = content.search === true
+        this.tabs = content.tabs
       }
     }
   }
+}
 </script>
 
 <style lang="less" scoped>
@@ -82,4 +82,4 @@
       }
     }
   }
-</style>
+</style>

+ 17 - 17
src/components/layouts/RouteView.vue

@@ -1,21 +1,21 @@
 <script>
-  export default {
-    name: 'RouteView',
-    data () {
-      return {}
-    },
-    render () {
-      const { $route: { meta } } = this
+export default {
+  name: 'RouteView',
+  data () {
+    return {}
+  },
+  render () {
+    const { $route: { meta } } = this
 
-      const inKeep = (
-        <keep-alive>
-          <router-view />
-        </keep-alive>
-      )
-      const notKeep = (
+    const inKeep = (
+      <keep-alive>
         <router-view />
-      )
-      return meta.keepAlive ? inKeep : notKeep
-    }
+      </keep-alive>
+    )
+    const notKeep = (
+      <router-view />
+    )
+    return meta.keepAlive ? inKeep : notKeep
   }
-</script>
+}
+</script>

+ 17 - 17
src/components/layouts/UserLayout.vue

@@ -30,23 +30,23 @@
 </template>
 
 <script>
-  import RouteView from '@/components/layouts/RouteView'
-  import { mixinDevice } from '@/utils/mixin.js'
-
-  export default {
-    name: 'UserLayout',
-    components: { RouteView },
-    mixins: [mixinDevice],
-    data () {
-      return {}
-    },
-    mounted () {
-      document.body.classList.add('userLayout')
-    },
-    beforeDestroy () {
-      document.body.classList.remove('userLayout')
-    },
+import RouteView from '@/components/layouts/RouteView'
+import { mixinDevice } from '@/utils/mixin.js'
+
+export default {
+  name: 'UserLayout',
+  components: { RouteView },
+  mixins: [mixinDevice],
+  data () {
+    return {}
+  },
+  mounted () {
+    document.body.classList.add('userLayout')
+  },
+  beforeDestroy () {
+    document.body.classList.remove('userLayout')
   }
+}
 </script>
 
 <style lang="less" scoped>
@@ -147,4 +147,4 @@
       }
     }
   }
-</style>
+</style>

+ 1 - 1
src/components/layouts/index.js

@@ -4,4 +4,4 @@ import BasicLayout from '@/components/layouts/BasicLayout'
 import RouteView from '@/components/layouts/RouteView'
 import PageView from '@/components/layouts/PageView'
 
-export { UserLayout, BasicLayout, BlankLayout, RouteView, PageView }
+export { UserLayout, BasicLayout, BlankLayout, RouteView, PageView }

+ 40 - 40
src/components/menu/SideMenu.vue

@@ -1,9 +1,9 @@
 <template>
   <a-layout-sider
     :class="['sider', isDesktop() ? null : 'shadow', theme, fixSiderbar ? 'ant-fixed-sidemenu' : null ]"
-    width="256px" 
+    width="256px"
     :collapsible="collapsible"
-    v-model="collapsed" 
+    v-model="collapsed"
     :trigger="null">
     <logo />
     <s-menu
@@ -18,45 +18,45 @@
 </template>
 
 <script>
-  import ALayoutSider from 'ant-design-vue/es/layout/Sider'
-  import Logo from '../tools/Logo'
-  import SMenu from './index'
-  import { mixin, mixinDevice } from '@/utils/mixin.js'
+import ALayoutSider from 'ant-design-vue/es/layout/Sider'
+import Logo from '../tools/Logo'
+import SMenu from './index'
+import { mixin, mixinDevice } from '@/utils/mixin.js'
 
-  export default {
-    name: 'SideMenu',
-    components: { ALayoutSider, Logo, SMenu },
-    mixins: [mixin, mixinDevice],
-    props: {
-      mode: {
-        type: String,
-        required: false,
-        default: 'inline'
-      },
-      theme: {
-        type: String,
-        required: false,
-        default: 'dark'
-      },
-      collapsible: {
-        type: Boolean,
-        required: false,
-        default: false
-      },
-      collapsed: {
-        type: Boolean,
-        required: false,
-        default: false
-      },
-      menus: {
-        type: Array,
-        required: true
-      }
+export default {
+  name: 'SideMenu',
+  components: { ALayoutSider, Logo, SMenu },
+  mixins: [mixin, mixinDevice],
+  props: {
+    mode: {
+      type: String,
+      required: false,
+      default: 'inline'
     },
-    methods: {
-      onSelect (obj) {
-        this.$emit('menuSelect', obj)
-      }
+    theme: {
+      type: String,
+      required: false,
+      default: 'dark'
+    },
+    collapsible: {
+      type: Boolean,
+      required: false,
+      default: false
+    },
+    collapsed: {
+      type: Boolean,
+      required: false,
+      default: false
+    },
+    menus: {
+      type: Array,
+      required: true
+    }
+  },
+  methods: {
+    onSelect (obj) {
+      this.$emit('menuSelect', obj)
     }
   }
-</script>
+}
+</script>

+ 14 - 14
src/components/menu/index.js

@@ -26,7 +26,7 @@ export default {
       default: false
     }
   },
-  data() {
+  data () {
     return {
       openKeys: [],
       selectedKeys: [],
@@ -40,11 +40,11 @@ export default {
       return keys
     }
   },
-  created() {
+  created () {
     this.updateMenu()
   },
   watch: {
-    collapsed(val) {
+    collapsed (val) {
       if (val) {
         this.cachedOpenKeys = this.openKeys.concat()
         this.openKeys = []
@@ -52,15 +52,15 @@ export default {
         this.openKeys = this.cachedOpenKeys
       }
     },
-    $route: function() {
+    $route: function () {
       this.updateMenu()
     }
   },
   methods: {
-    renderIcon: function(h, icon) {
+    renderIcon: function (h, icon) {
       return icon === 'none' || icon === undefined ? null : h(Icon, { props: { type: icon !== undefined ? icon : '' } })
     },
-    renderMenuItem: function(h, menu, pIndex, index) {
+    renderMenuItem: function (h, menu, pIndex, index) {
       return h(Item, { key: menu.path ? menu.path : 'item_' + pIndex + '_' + index }, [
         h('router-link', { attrs: { to: { name: menu.name } } }, [
           this.renderIcon(h, menu.meta.icon),
@@ -68,36 +68,36 @@ export default {
         ])
       ])
     },
-    renderSubMenu: function(h, menu, pIndex, index) {
+    renderSubMenu: function (h, menu, pIndex, index) {
       const this2_ = this
       const subItem = [h('span', { slot: 'title' }, [this.renderIcon(h, menu.meta.icon), h('span', [menu.meta.title])])]
       const itemArr = []
       const pIndex_ = pIndex + '_' + index
       if (!menu.alwaysShow) {
-        menu.children.forEach(function(item, i) {
+        menu.children.forEach(function (item, i) {
           itemArr.push(this2_.renderItem(h, item, pIndex_, i))
         })
       }
       return h(SubMenu, { key: menu.path ? menu.path : 'submenu_' + pIndex + '_' + index }, subItem.concat(itemArr))
     },
-    renderItem: function(h, menu, pIndex, index) {
+    renderItem: function (h, menu, pIndex, index) {
       if (!menu.hidden) {
         return menu.children && !menu.alwaysShow
           ? this.renderSubMenu(h, menu, pIndex, index)
           : this.renderMenuItem(h, menu, pIndex, index)
       }
     },
-    renderMenu: function(h, menuTree) {
+    renderMenu: function (h, menuTree) {
       const this2_ = this
       const menuArr = []
-      menuTree.forEach(function(menu, i) {
+      menuTree.forEach(function (menu, i) {
         if (!menu.hidden) {
           menuArr.push(this2_.renderItem(h, menu, '0', i))
         }
       })
       return menuArr
     },
-    onOpenChange(openKeys) {
+    onOpenChange (openKeys) {
       const latestOpenKey = openKeys.find(key => !this.openKeys.includes(key))
       if (!this.rootSubmenuKeys.includes(latestOpenKey)) {
         this.openKeys = openKeys
@@ -105,7 +105,7 @@ export default {
         this.openKeys = latestOpenKey ? [latestOpenKey] : []
       }
     },
-    updateMenu() {
+    updateMenu () {
       const routes = this.$route.matched.concat()
 
       if (routes.length >= 4 && this.$route.meta.hidden) {
@@ -125,7 +125,7 @@ export default {
       this.collapsed ? (this.cachedOpenKeys = openKeys) : (this.openKeys = openKeys)
     }
   },
-  render(h) {
+  render (h) {
     return h(
       Menu,
       {

+ 6 - 6
src/components/page/GlobalFooter.vue

@@ -17,13 +17,13 @@
 </template>
 
 <script>
-  export default {
-    name: 'LayoutFooter',
-    data () {
-      return {
-      }
+export default {
+  name: 'LayoutFooter',
+  data () {
+    return {
     }
   }
+}
 </script>
 
 <style lang="less" scoped>
@@ -52,4 +52,4 @@
       font-size: 14px;
     }
   }
-</style>
+</style>

+ 55 - 55
src/components/page/GlobalHeader.vue

@@ -39,74 +39,74 @@
 </template>
 
 <script>
-  import UserMenu from '../tools/UserMenu'
-  import SMenu from '../menu/'
-  import Logo from '../tools/Logo'
+import UserMenu from '../tools/UserMenu'
+import SMenu from '../menu/'
+import Logo from '../tools/Logo'
 
-  import { mixin } from '@/utils/mixin.js'
+import { mixin } from '@/utils/mixin.js'
 
-  export default {
-    name: 'GlobalHeader',
-    components: {
-      UserMenu,
-      SMenu,
-      Logo
+export default {
+  name: 'GlobalHeader',
+  components: {
+    UserMenu,
+    SMenu,
+    Logo
+  },
+  mixins: [mixin],
+  props: {
+    mode: {
+      type: String,
+      // sidemenu, topmenu
+      default: 'sidemenu'
     },
-    mixins: [mixin],
-    props: {
-      mode: {
-        type: String,
-        // sidemenu, topmenu
-        default: 'sidemenu'
-      },
-      menus: {
-        type: Array,
-        required: true
-      },
-      theme: {
-        type: String,
-        required: false,
-        default: 'dark'
-      },
-      collapsed: {
-        type: Boolean,
-        required: false,
-        default: false
-      },
-      device: {
-        type: String,
-        required: false,
-        default: 'desktop'
-      }
+    menus: {
+      type: Array,
+      required: true
     },
-    data() {
-      return {
-        headerBarFixed: false,
-      }
+    theme: {
+      type: String,
+      required: false,
+      default: 'dark'
     },
-    mounted () {
-      window.addEventListener('scroll', this.handleScroll)
+    collapsed: {
+      type: Boolean,
+      required: false,
+      default: false
     },
-    methods: {
-      handleScroll () {
-        if (this.autoHideHeader) {
-          const scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
-          if (scrollTop > 100) {
-            this.headerBarFixed = true
-          } else {
-            this.headerBarFixed = false
-          }
+    device: {
+      type: String,
+      required: false,
+      default: 'desktop'
+    }
+  },
+  data () {
+    return {
+      headerBarFixed: false
+    }
+  },
+  mounted () {
+    window.addEventListener('scroll', this.handleScroll)
+  },
+  methods: {
+    handleScroll () {
+      if (this.autoHideHeader) {
+        const scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
+        if (scrollTop > 100) {
+          this.headerBarFixed = true
         } else {
           this.headerBarFixed = false
         }
-      },
-      toggle() {
-        this.$emit('toggle')
+      } else {
+        this.headerBarFixed = false
       }
+    },
+    toggle () {
+      this.$emit('toggle')
     }
   }
+}
 </script>
 
 <style lang="less" scoped>
 
-</style>
+</style>

+ 67 - 72
src/components/page/GlobalLayout.vue

@@ -73,78 +73,78 @@
 </template>
 
 <script>
-  import SideMenu from '@/components/menu/SideMenu'
-  import GlobalHeader from '@/components/page/GlobalHeader'
-  import GlobalFooter from '@/components/page/GlobalFooter'
-  import SettingDrawer from '@/components/setting/SettingDrawer'
-  import { triggerWindowResizeEvent } from '@/utils/util'
-  import { mapState, mapActions } from 'vuex'
-  import { mixin, mixinDevice } from '@/utils/mixin.js'
-
-  export default {
-    name: 'GlobalLayout',
-    components: {
-      SideMenu,
-      GlobalHeader,
-      GlobalFooter,
-      SettingDrawer
-    },
-    mixins: [mixin, mixinDevice],
-    data () {
-      return {
-        collapsed: false,
-        menus: []
+import SideMenu from '@/components/menu/SideMenu'
+import GlobalHeader from '@/components/page/GlobalHeader'
+import GlobalFooter from '@/components/page/GlobalFooter'
+import SettingDrawer from '@/components/setting/SettingDrawer'
+import { triggerWindowResizeEvent } from '@/utils/util'
+import { mapState, mapActions } from 'vuex'
+import { mixin, mixinDevice } from '@/utils/mixin.js'
+
+export default {
+  name: 'GlobalLayout',
+  components: {
+    SideMenu,
+    GlobalHeader,
+    GlobalFooter,
+    SettingDrawer
+  },
+  mixins: [mixin, mixinDevice],
+  data () {
+    return {
+      collapsed: false,
+      menus: []
+    }
+  },
+  computed: {
+    ...mapState({
+      // 主路由
+      mainMenu: state => state.permission.addRouters
+    }),
+    contentPaddingLeft () {
+      if (!this.fixSidebar || this.isMobile()) {
+        return '0'
       }
-    },
-    computed: {
-      ...mapState({
-        // 主路由
-        mainMenu: state => state.permission.addRouters,
-      }),
-      contentPaddingLeft () {
-        if(!this.fixSidebar || this.isMobile()){
-          return '0'
-        }
-        if(this.sidebarOpened){
-          return '256px'
-        }
-        return '80px'
+      if (this.sidebarOpened) {
+        return '256px'
       }
+      return '80px'
+    }
+  },
+  watch: {
+    sidebarOpened (val) {
+      console.log('sidebarOpened', val)
+      this.collapsed = !val
+    }
+  },
+  created () {
+    this.menus = this.mainMenu.find((item) => item.path === '/').children
+    this.collapsed = !this.sidebarOpened
+  },
+  methods: {
+    ...mapActions(['setSidebar']),
+    toggle () {
+      this.collapsed = !this.collapsed
+      this.setSidebar(!this.collapsed)
+      triggerWindowResizeEvent()
     },
-    watch: {
-      sidebarOpened(val) {
-        console.log('sidebarOpened', val)
-        this.collapsed = !val
-      },
-    },
-    created() {
-      this.menus = this.mainMenu.find((item) => item.path === '/').children
-      this.collapsed = !this.sidebarOpened
-    },
-    methods: {
-      ...mapActions(['setSidebar']),
-      toggle() {
-        this.collapsed = !this.collapsed
-        this.setSidebar(!this.collapsed)
-        triggerWindowResizeEvent()
-      },
-      paddingCalc () {
-        let left = ''
-        if (this.sidebarOpened) {
-          left = this.isDesktop() ? '256px' : '80px'
-        } else {
-          left = this.isMobile() && '0' || (this.fixSidebar && '80px' || '0')
-        }
-        console.log('left', left)
-        return left
-      },
-      menuSelect() {
-        if (!this.isDesktop()) {
-          this.collapsed = false
-        }
+    paddingCalc () {
+      let left = ''
+      if (this.sidebarOpened) {
+        left = this.isDesktop() ? '256px' : '80px'
+      } else {
+        left = this.isMobile() && '0' || (this.fixSidebar && '80px' || '0')
       }
+      console.log('left', left)
+      return left
     },
+    menuSelect () {
+      if (!this.isDesktop()) {
+        this.collapsed = false
+      }
+    }
   }
+}
 </script>
 
 <style lang="less">
@@ -267,8 +267,6 @@
       }
     }
 
-
-
     .header {
       height: 64px;
       padding: 0 12px 0 0;
@@ -301,7 +299,6 @@
             vertical-align: middle;
           }
 
-
           .icon {
             font-size: 16px;
             padding: 4px;
@@ -376,7 +373,6 @@
 
     }
 
-
     .top-nav-header-index {
       box-shadow: 0 1px 4px rgba(0,21,41,.08);
       position: relative;
@@ -446,7 +442,6 @@
       }
     }
 
-
     // 内容区
     .layout-content {
       margin: 24px 24px 0px;
@@ -623,4 +618,4 @@
       }
     }
   }
-</style>
+</style>

+ 51 - 52
src/components/page/PageHeader.vue

@@ -41,63 +41,62 @@
 </template>
 
 <script>
-  import Breadcrumb from '@/components/tools/Breadcrumb'
-
-  export default {
-    name: 'PageHeader',
-    components: {
-      's-breadcrumb': Breadcrumb
+import Breadcrumb from '@/components/tools/Breadcrumb'
+
+export default {
+  name: 'PageHeader',
+  components: {
+    's-breadcrumb': Breadcrumb
+  },
+  props: {
+    title: {
+      type: String,
+      default: '',
+      required: false
     },
-    props: {
-      title: {
-        type: String,
-        default: '',
-        required: false
-      },
-      breadcrumb: {
-        type: Array,
-        default: null,
-        required: false
-      },
-      logo: {
-        type: String,
-        default: '',
-        required: false
-      },
-      avatar: {
-        type: String,
-        default: '',
-        required: false
-      }
+    breadcrumb: {
+      type: Array,
+      default: null,
+      required: false
     },
-    data() {
-      return {
-        name: '',
-        breadList: [],
-      }
+    logo: {
+      type: String,
+      default: '',
+      required: false
     },
-    created() {
+    avatar: {
+      type: String,
+      default: '',
+      required: false
+    }
+  },
+  data () {
+    return {
+      name: '',
+      breadList: []
+    }
+  },
+  created () {
+    this.getBreadcrumb()
+  },
+  methods: {
+    getBreadcrumb () {
+      this.breadList = []
+      // this.breadList.push({name: 'index', path: '/dashboard/', meta: {title: '首页'}})
+
+      this.name = this.$route.name
+      this.$route.matched.forEach((item) => {
+        // item.name !== 'index' && this.breadList.push(item)
+        this.breadList.push(item)
+      })
+    }
+  },
+  watch: {
+    $route () {
       this.getBreadcrumb()
-    },
-    methods: {
-      getBreadcrumb() {
-
-        this.breadList = []
-        // this.breadList.push({name: 'index', path: '/dashboard/', meta: {title: '首页'}})
-
-        this.name = this.$route.name
-        this.$route.matched.forEach((item) => {
-          // item.name !== 'index' && this.breadList.push(item)
-          this.breadList.push(item)
-        })
-      }
-    },
-    watch: {
-      $route() {
-        this.getBreadcrumb()
-      }
     }
   }
+}
 </script>
 
 <style lang="less" scoped>
@@ -235,4 +234,4 @@
       }
     }
   }
-</style>
+</style>

+ 41 - 41
src/components/page/PageLayout.vue

@@ -37,51 +37,51 @@
 </template>
 
 <script>
-  import PageHeader from './PageHeader'
+import PageHeader from './PageHeader'
 
-  export default {
-    name: 'LayoutContent',
-    components: {
-      PageHeader
+export default {
+  name: 'LayoutContent',
+  components: {
+    PageHeader
+  },
+  // ['desc', 'logo', 'title', 'avatar', 'linkList', 'extraImage']
+  props: {
+    desc: {
+      type: String,
+      default: null
     },
-    // ['desc', 'logo', 'title', 'avatar', 'linkList', 'extraImage']
-    props: {
-      desc: {
-        type: String,
-        default: null
-      },
-      logo: {
-        type: String,
-        default: null
-      },
-      title: {
-        type: String,
-        default: null
-      },
-      avatar: {
-        type: String,
-        default: null
-      },
-      linkList: {
-        type: Array,
-        default: null
-      },
-      extraImage: {
-        type: String,
-        default: null
-      },
-      search: {
-        type: Boolean,
-        default: false
-      },
-      tabs: {
-        type: Object,
-        default: () => ({})
-      }
+    logo: {
+      type: String,
+      default: null
+    },
+    title: {
+      type: String,
+      default: null
+    },
+    avatar: {
+      type: String,
+      default: null
+    },
+    linkList: {
+      type: Array,
+      default: null
+    },
+    extraImage: {
+      type: String,
+      default: null
+    },
+    search: {
+      type: Boolean,
+      default: false
     },
-    methods: {
+    tabs: {
+      type: Object,
+      default: () => ({})
     }
+  },
+  methods: {
   }
+}
 </script>
 
 <style lang="less" scoped>
@@ -121,4 +121,4 @@
   .page-menu-tabs {
     margin-top: 48px;
   }
-</style>
+</style>

+ 25 - 25
src/components/page/SHeaderNotice.vue

@@ -18,33 +18,33 @@
 </template>
 
 <script>
-  export default {
-    name: 'HeaderNotice',
-    props: {
-      tabs: {
-        type: Array,
-        default: null,
-        required: true
-      }
-    },
-    data () {
-      return {
-        loadding: false
-      }
-    },
-    methods: {
-      fetchNotice () {
-        if (this.loadding) {
-          this.loadding = false
-          return
-        }
-        this.loadding = true
-        setTimeout(() => {
-          this.loadding = false
-        }, 2000)
+export default {
+  name: 'HeaderNotice',
+  props: {
+    tabs: {
+      type: Array,
+      default: null,
+      required: true
+    }
+  },
+  data () {
+    return {
+      loadding: false
+    }
+  },
+  methods: {
+    fetchNotice () {
+      if (this.loadding) {
+        this.loadding = false
+        return
       }
+      this.loadding = true
+      setTimeout(() => {
+        this.loadding = false
+      }, 2000)
     }
   }
+}
 </script>
 
 <style lang="less" scoped>
@@ -55,4 +55,4 @@
       vertical-align: initial;
     }
   }
-</style>
+</style>

+ 94 - 94
src/components/setting/SettingDrawer.vue

@@ -162,62 +162,62 @@
 </template>
 
 <script>
-  import DetailList from '@/components/tools/DetailList'
-  import SettingItem from '@/components/setting/SettingItem'
-  import config from '@/config/defaultSettings'
-  import { updateTheme, updateColorWeak, colorList } from '@/components/tools/setting'
-  import { mixin, mixinDevice } from '@/utils/mixin'
+import DetailList from '@/components/tools/DetailList'
+import SettingItem from '@/components/setting/SettingItem'
+import config from '@/config/defaultSettings'
+import { updateTheme, updateColorWeak, colorList } from '@/components/tools/setting'
+import { mixin, mixinDevice } from '@/utils/mixin'
 
-  export default {
-    components: {
-      DetailList,
-      SettingItem
+export default {
+  components: {
+    DetailList,
+    SettingItem
+  },
+  mixins: [mixin, mixinDevice],
+  data () {
+    return {
+      visible: true,
+      colorList,
+      baseConfig: Object.assign({}, config)
+    }
+  },
+  watch: {
+
+  },
+  mounted () {
+    const vm = this
+    setTimeout(() => {
+      vm.visible = false
+    }, 16)
+    // 当主题色不是默认色时,才进行主题编译
+    if (this.primaryColor !== config.primaryColor) {
+      updateTheme(this.primaryColor)
+    }
+    if (this.colorWeak !== config.colorWeak) {
+      updateColorWeak(this.colorWeak)
+    }
+  },
+  methods: {
+    showDrawer () {
+      this.visible = true
     },
-    mixins: [mixin, mixinDevice],
-    data() {
-      return {
-        visible: true,
-        colorList,
-        baseConfig: Object.assign({}, config)
-      }
+    onClose () {
+      this.visible = false
     },
-    watch: {
-
+    toggle () {
+      this.visible = !this.visible
     },
-    mounted () {
-      const vm = this
-      setTimeout(() => {
-        vm.visible = false
-      }, 16)
-      // 当主题色不是默认色时,才进行主题编译
-      if (this.primaryColor !== config.primaryColor) {
-        updateTheme(this.primaryColor)
-      }
-      if (this.colorWeak !== config.colorWeak) {
-        updateColorWeak(this.colorWeak)
-      }
+    onColorWeak (checked) {
+      this.baseConfig.colorWeak = checked
+      this.$store.dispatch('ToggleWeak', checked)
+      updateColorWeak(checked)
+    },
+    handleMenuTheme (theme) {
+      this.baseConfig.navTheme = theme
+      this.$store.dispatch('ToggleTheme', theme)
     },
-    methods: {
-      showDrawer() {
-        this.visible = true
-      },
-      onClose() {
-        this.visible = false
-      },
-      toggle() {
-        this.visible = !this.visible
-      },
-      onColorWeak (checked) {
-        this.baseConfig.colorWeak = checked
-        this.$store.dispatch('ToggleWeak', checked)
-        updateColorWeak(checked)
-      },
-      handleMenuTheme (theme) {
-        this.baseConfig.navTheme = theme
-        this.$store.dispatch('ToggleTheme', theme)
-      },
-      doCopy () {
-        const text = `export default {
+    doCopy () {
+      const text = `export default {
   primaryColor: '${this.baseConfig.primaryColor}', // primary color of ant design
   navTheme: '${this.baseConfig.navTheme}', // theme for nav menu
   layout: '${this.baseConfig.layout}', // nav menu position: sidemenu or topmenu
@@ -233,51 +233,51 @@
     storage: 'local',
   }
 }`
-        this.$copyText(text).then(message => {
-          console.log('copy', message)
-          this.$message.success('复制完毕')
-        }).catch(err => {
-          console.log('copy.err', err)
-          this.$message.error('复制失败')
-        })
-      },
-      handleLayout (mode) {
-        this.baseConfig.layout = mode
-        this.$store.dispatch('ToggleLayoutMode', mode)
-        // 因为顶部菜单不能固定左侧菜单栏,所以强制关闭
-        //
-        this.handleFixSiderbar(false)
-      },
-      handleContentWidthChange (type) {
-        this.baseConfig.contentWidth = type
-        this.$store.dispatch('ToggleContentWidth', type)
-      },
-      changeColor (color) {
-        this.baseConfig.primaryColor = color
-        if (this.primaryColor !== color) {
-          this.$store.dispatch('ToggleColor', color)
-          updateTheme(color)
-        }
-      },
-      handleFixedHeader (fixed) {
-        this.baseConfig.fixedHeader = fixed
-        this.$store.dispatch('ToggleFixedHeader', fixed)
-      },
-      handleFixedHeaderHidden (autoHidden) {
-        this.baseConfig.autoHideHeader = autoHidden
-        this.$store.dispatch('ToggleFixedHeaderHidden', autoHidden)
-      },
-      handleFixSiderbar (fixed) {
-        if (this.layoutMode === 'topmenu') {
-          this.baseConfig.fixSiderbar = false
-          this.$store.dispatch('ToggleFixSiderbar', false)
-          return
-        }
-        this.baseConfig.fixSiderbar = fixed
-        this.$store.dispatch('ToggleFixSiderbar', fixed)
+      this.$copyText(text).then(message => {
+        console.log('copy', message)
+        this.$message.success('复制完毕')
+      }).catch(err => {
+        console.log('copy.err', err)
+        this.$message.error('复制失败')
+      })
+    },
+    handleLayout (mode) {
+      this.baseConfig.layout = mode
+      this.$store.dispatch('ToggleLayoutMode', mode)
+      // 因为顶部菜单不能固定左侧菜单栏,所以强制关闭
+      //
+      this.handleFixSiderbar(false)
+    },
+    handleContentWidthChange (type) {
+      this.baseConfig.contentWidth = type
+      this.$store.dispatch('ToggleContentWidth', type)
+    },
+    changeColor (color) {
+      this.baseConfig.primaryColor = color
+      if (this.primaryColor !== color) {
+        this.$store.dispatch('ToggleColor', color)
+        updateTheme(color)
       }
     },
+    handleFixedHeader (fixed) {
+      this.baseConfig.fixedHeader = fixed
+      this.$store.dispatch('ToggleFixedHeader', fixed)
+    },
+    handleFixedHeaderHidden (autoHidden) {
+      this.baseConfig.autoHideHeader = autoHidden
+      this.$store.dispatch('ToggleFixedHeaderHidden', autoHidden)
+    },
+    handleFixSiderbar (fixed) {
+      if (this.layoutMode === 'topmenu') {
+        this.baseConfig.fixSiderbar = false
+        this.$store.dispatch('ToggleFixSiderbar', false)
+        return
+      }
+      this.baseConfig.fixSiderbar = fixed
+      this.$store.dispatch('ToggleFixSiderbar', fixed)
+    }
   }
+}
 </script>
 
 <style lang="less" scoped>
@@ -352,4 +352,4 @@
       font-size: 20px;
     }
   }
-</style>
+</style>

+ 12 - 12
src/components/setting/SettingItem.vue

@@ -7,19 +7,19 @@
 </template>
 
 <script>
-  export default {
-    name: 'SettingItem',
-    props: {
-      title: {
-        type: String,
-        default: ''
-      },
-      divider: {
-        type: Boolean,
-        default: false
-      }
+export default {
+  name: 'SettingItem',
+  props: {
+    title: {
+      type: String,
+      default: ''
+    },
+    divider: {
+      type: Boolean,
+      default: false
     }
   }
+}
 </script>
 
 <style lang="less" scoped>
@@ -35,4 +35,4 @@
     }
 
   }
-</style>
+</style>

+ 21 - 19
src/components/table/index.js

@@ -103,8 +103,8 @@ export default {
      * 如果参数为 true, 则强制刷新到第一页
      * @param Boolean bool
      */
-    refresh(bool = false) {
-      this.loadData(bool ? { current: 1 }: {})
+    refresh (bool = false) {
+      this.loadData(bool ? { current: 1 } : {})
     },
     /**
      * 加载数据方法
@@ -113,29 +113,28 @@ export default {
      * @param {Object} sorter 排序条件
      */
     loadData (pagination, filters, sorter) {
-
       this.localLoading = true
       var result = this.data(Object.assign({
         pageNo: (pagination && pagination.current) ||
           this.localPagination.current,
         pageSize: (pagination && pagination.pageSize) ||
           this.localPagination.pageSize
-        },
-        (sorter && sorter.field && {
-          sortField: sorter.field
-        }) || {},
-        (sorter && sorter.order && {
-          sortOrder: sorter.order
-        }) || {}, {
-          ...filters
-        }
+      },
+      (sorter && sorter.field && {
+        sortField: sorter.field
+      }) || {},
+      (sorter && sorter.order && {
+        sortOrder: sorter.order
+      }) || {}, {
+        ...filters
+      }
       ))
 
       // 对接自己的通用数据接口需要修改下方代码中的 r.pageNo, r.totalCount, r.data
       if (result instanceof Promise) {
         result.then(r => {
           this.localPagination = Object.assign({}, this.localPagination, {
-            current: r.pageNo,  // 返回结果中的当前分页数
+            current: r.pageNo, // 返回结果中的当前分页数
             total: r.totalCount, // 返回结果中的总记录数
             showSizeChanger: this.showSizeChanger,
             pageSize: (pagination && pagination.pageSize) ||
@@ -143,7 +142,7 @@ export default {
           })
 
           // 为防止删除数据后导致页面当前页面数据长度为 0 ,自动翻页到上一页
-          if (r.data.length == 0 && this.localPagination.current != 1) {
+          if (r.data.length === 0 && this.localPagination.current !== 1) {
             this.localPagination.current--
             this.loadData()
             return
@@ -247,11 +246,12 @@ export default {
     Object.keys(T.props).forEach(k => {
       const localKey = `local${k.substring(0, 1).toUpperCase()}${k.substring(1)}`
       if (localKeys.includes(localKey)) {
-        return props[k] = this[localKey]
+        props[k] = this[localKey]
+        return props[k]
       }
       if (showAlert && k === 'rowSelection') {
         // 重新绑定 rowSelection 事件
-        return props[k] = {
+        props[k] = {
           selectedRows: this.selectedRows,
           selectedRowKeys: this.selectedRowKeys,
           onChange: (selectedRowKeys, selectedRows) => {
@@ -259,12 +259,14 @@ export default {
             typeof this[k].onChange !== 'undefined' && this[k].onChange(selectedRowKeys, selectedRows)
           }
         }
+        return props[k]
       }
-      return props[k] = this[k]
+      props[k] = this[k]
+      return props[k]
     })
 
     const table = (
-      <a-table {...{ props, scopedSlots: {...this.$scopedSlots}}} onChange={this.loadData}>
+      <a-table {...{ props, scopedSlots: { ...this.$scopedSlots } }} onChange={this.loadData}>
         {this.$slots.default}
       </a-table>
     )
@@ -276,4 +278,4 @@ export default {
       </div>
     )
   }
-}
+}

+ 10 - 11
src/components/tools/Breadcrumb.vue

@@ -11,18 +11,17 @@
 
 <script>
 export default {
-    data() {
-      return {
-        name: '',
-        breadList: [],
-      }
-    },
+  data () {
+    return {
+      name: '',
+      breadList: []
+    }
+  },
   created () {
     this.getBreadcrumb()
   },
   methods: {
-    getBreadcrumb() {
-
+    getBreadcrumb () {
       console.log('this.$route.matched', this.$route.matched)
 
       this.breadList = []
@@ -31,12 +30,12 @@ export default {
       this.name = this.$route.name
       this.$route.matched.forEach((item) => {
         // item.meta.name === 'dashboard' ? item.path = '/dashboard' : this.$route.path === item.path
-          this.breadList.push(item)
+        this.breadList.push(item)
       })
     }
   },
   watch: {
-    $route() {
+    $route () {
       this.getBreadcrumb()
     }
   }
@@ -45,4 +44,4 @@ export default {
 
 <style scoped>
 
-</style>
+</style>

+ 59 - 59
src/components/tools/DetailList.vue

@@ -8,73 +8,73 @@
 </template>
 
 <script>
-  import { Col } from 'ant-design-vue/es/grid/'
+import { Col } from 'ant-design-vue/es/grid/'
 
-  const Item = {
-    name: 'DetailListItem',
-    props: {
-      term: {
-        type: String,
-        default: '',
-        required: false
-      },
-    },
-    inject: {
-      col: {
-        type: Number
-      }
-    },
-    render () {
-      return (
-        <Col {...{props: responsive[this.col]}}>
-          <div class="term">{this.$props.term}</div>
-          <div class="content">{this.$slots.default}</div>
-        </Col>
-      )
+const Item = {
+  name: 'DetailListItem',
+  props: {
+    term: {
+      type: String,
+      default: '',
+      required: false
     }
+  },
+  inject: {
+    col: {
+      type: Number
+    }
+  },
+  render () {
+    return (
+      <Col {...{ props: responsive[this.col] }}>
+        <div class="term">{this.$props.term}</div>
+        <div class="content">{this.$slots.default}</div>
+      </Col>
+    )
   }
+}
 
-  const responsive = {
-    1: { xs: 24 },
-    2: { xs: 24, sm: 12 },
-    3: { xs: 24, sm: 12, md: 8 },
-    4: { xs: 24, sm: 12, md: 6 }
-  }
+const responsive = {
+  1: { xs: 24 },
+  2: { xs: 24, sm: 12 },
+  3: { xs: 24, sm: 12, md: 8 },
+  4: { xs: 24, sm: 12, md: 6 }
+}
 
-  export default {
-    name: 'DetailList',
-    Item: Item,
-    components: {
-      Col
+export default {
+  name: 'DetailList',
+  Item: Item,
+  components: {
+    Col
+  },
+  props: {
+    title: {
+      type: String,
+      default: '',
+      required: false
     },
-    props: {
-      title: {
-        type: String,
-        default: '',
-        required: false
-      },
-      col: {
-        type: Number,
-        required: false,
-        default: 3
-      },
-      size: {
-        type: String,
-        required: false,
-        default: 'large'
-      },
-      layout: {
-        type: String,
-        required: false,
-        default: 'horizontal'
-      }
+    col: {
+      type: Number,
+      required: false,
+      default: 3
     },
-    provide () {
-      return {
-        col: this.col > 4 ? 4 : this.col
-      }
+    size: {
+      type: String,
+      required: false,
+      default: 'large'
+    },
+    layout: {
+      type: String,
+      required: false,
+      default: 'horizontal'
+    }
+  },
+  provide () {
+    return {
+      col: this.col > 4 ? 4 : this.col
     }
   }
+}
 </script>
 
 <style lang="less">
@@ -144,4 +144,4 @@
       }
     }
   }
-</style>
+</style>

+ 20 - 20
src/components/tools/HeadInfo.vue

@@ -7,27 +7,27 @@
 </template>
 
 <script>
-  export default {
-    name: 'HeadInfo',
-    props: {
-      title: {
-        type: String,
-        default: ''
-      },
-      content: {
-        type: String,
-        default: ''
-      },
-      bordered: {
-        type: Boolean,
-        default: false
-      },
-      center: {
-        type: Boolean,
-        default: true
-      }
+export default {
+  name: 'HeadInfo',
+  props: {
+    title: {
+      type: String,
+      default: ''
+    },
+    content: {
+      type: String,
+      default: ''
+    },
+    bordered: {
+      type: Boolean,
+      default: false
+    },
+    center: {
+      type: Boolean,
+      default: true
     }
   }
+}
 </script>
 
 <style lang="less" scoped>
@@ -64,4 +64,4 @@
       right: 0;
     }
   }
-</style>
+</style>

+ 18 - 18
src/components/tools/HeaderNotice.vue

@@ -46,26 +46,26 @@
 </template>
 
 <script>
-  export default {
-    name: 'HeaderNotice',
-    data () {
-      return {
-        loadding: false
-      }
-    },
-    methods: {
-      fetchNotice () {
-        if (this.loadding) {
-          this.loadding = false
-          return
-        }
-        this.loadding = true
-        setTimeout(() => {
-          this.loadding = false
-        }, 2000)
+export default {
+  name: 'HeaderNotice',
+  data () {
+    return {
+      loadding: false
+    }
+  },
+  methods: {
+    fetchNotice () {
+      if (this.loadding) {
+        this.loadding = false
+        return
       }
+      this.loadding = true
+      setTimeout(() => {
+        this.loadding = false
+      }, 2000)
     }
   }
+}
 </script>
 
 <style lang="css">
@@ -82,4 +82,4 @@
       vertical-align: initial;
     }
   }
-</style>
+</style>

+ 14 - 14
src/components/tools/Logo.vue

@@ -8,19 +8,19 @@
 </template>
 
 <script>
-  export default {
-    name: 'Logo',
-    props: {
-      title: {
-        type: String,
-        default: 'Ant Design Pro',
-        required: false
-      },
-      showTitle: {
-        type: Boolean,
-        default: true,
-        required: false
-      }
+export default {
+  name: 'Logo',
+  props: {
+    title: {
+      type: String,
+      default: 'Ant Design Pro',
+      required: false
+    },
+    showTitle: {
+      type: Boolean,
+      default: true,
+      required: false
     }
   }
-</script>
+}
+</script>

+ 5 - 5
src/components/tools/TwoStepCaptcha.vue

@@ -46,7 +46,7 @@ export default {
       default: false
     }
   },
-  data() {
+  data () {
     return {
       stepLoading: false,
 
@@ -54,13 +54,13 @@ export default {
     }
   },
   methods: {
-    handleStepOk() {
+    handleStepOk () {
       const vm = this
       this.stepLoading = true
       this.form.validateFields((err, values) => {
         if (!err) {
           console.log('values', values)
-          setTimeout( () => {
+          setTimeout(() => {
             vm.stepLoading = false
             vm.$emit('success', { values })
           }, 2000)
@@ -74,7 +74,7 @@ export default {
       this.visible = false
       this.$emit('cancel')
     },
-    onForgeStepCode() {
+    onForgeStepCode () {
 
     }
   }
@@ -86,4 +86,4 @@ export default {
     width: 80%;
     max-width: 400px;
   }
-</style>
+</style>

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

@@ -39,37 +39,37 @@
 </template>
 
 <script>
-  import HeaderNotice from './HeaderNotice'
-  import { mapActions, mapGetters } from 'vuex'
+import HeaderNotice from './HeaderNotice'
+import { mapActions, mapGetters } from 'vuex'
 
-  export default {
-    name: 'UserMenu',
-    components: {
-      HeaderNotice
-    },
-    methods: {
-      ...mapActions(['Logout']),
-      ...mapGetters(['nickname', 'avatar']),
-      handleLogout() {
-        const that = this
+export default {
+  name: 'UserMenu',
+  components: {
+    HeaderNotice
+  },
+  methods: {
+    ...mapActions(['Logout']),
+    ...mapGetters(['nickname', 'avatar']),
+    handleLogout () {
+      const that = this
 
-        this.$confirm({
-          title: '提示',
-          content: '真的要注销登录吗 ?',
-          onOk() {
-            return that.Logout({}).then(() => {
-              window.location.reload()
-            }).catch(err => {
-              that.$message.error({
-                title: '错误',
-                description: err.message
-              })
+      this.$confirm({
+        title: '提示',
+        content: '真的要注销登录吗 ?',
+        onOk () {
+          return that.Logout({}).then(() => {
+            window.location.reload()
+          }).catch(err => {
+            that.$message.error({
+              title: '错误',
+              description: err.message
             })
-          },
-          onCancel() {
-          },
-        })
-      },
+          })
+        },
+        onCancel () {
+        }
+      })
     }
   }
-</script>
+}
+</script>

+ 12 - 12
src/components/tools/setting.js

@@ -5,29 +5,29 @@ let lessNodesAppended
 
 const colorList = [
   {
-    key: '薄暮', color: '#F5222D',
+    key: '薄暮', color: '#F5222D'
   },
   {
-    key: '火山', color: '#FA541C',
+    key: '火山', color: '#FA541C'
   },
   {
-    key: '日暮', color: '#FAAD14',
+    key: '日暮', color: '#FAAD14'
   },
   {
-    key: '明青', color: '#13C2C2',
+    key: '明青', color: '#13C2C2'
   },
   {
-    key: '极光绿', color: '#52C41A',
+    key: '极光绿', color: '#52C41A'
   },
   {
-    key: '拂晓蓝(默认)', color: '#1890FF',
+    key: '拂晓蓝(默认)', color: '#1890FF'
   },
   {
-    key: '极客蓝', color: '#2F54EB',
+    key: '极客蓝', color: '#2F54EB'
   },
   {
-    key: '酱紫', color: '#722ED1',
-  },
+    key: '酱紫', color: '#722ED1'
+  }
 ]
 
 const updateTheme = primaryColor => {
@@ -40,14 +40,14 @@ const updateTheme = primaryColor => {
     return
   }
   const hideMessage = message.loading('正在编译主题!', 0)
-  function buildIt() {
+  function buildIt () {
     if (!window.less) {
       return
     }
     setTimeout(() => {
       window.less
         .modifyVars({
-          '@primary-color': primaryColor,
+          '@primary-color': primaryColor
         })
         .then(() => {
           hideMessage()
@@ -92,4 +92,4 @@ const updateColorWeak = colorWeak => {
   colorWeak ? document.body.classList.add('colorWeak') : document.body.classList.remove('colorWeak')
 }
 
-export { updateTheme, colorList, updateColorWeak }
+export { updateTheme, colorList, updateColorWeak }

+ 2 - 2
src/config/defaultSettings.js

@@ -26,6 +26,6 @@ export default {
   storageOptions: {
     namespace: 'pro__', // key prefix
     name: 'ls', // name variable Vue.[ls] or this.[$ls],
-    storage: 'local', // storage name session, local, memory
+    storage: 'local' // storage name session, local, memory
   }
-}
+}

+ 12 - 12
src/config/router.config.js

@@ -110,7 +110,7 @@ export const asyncRouterMap = [
             path: '/list/system-role',
             name: 'SystemRole',
             component: () => import('@/views/role/RoleList'),
-            meta: { title: '角色列表2', keepAlive: true, permission: [ 'table' ]}
+            meta: { title: '角色列表2', keepAlive: true, permission: [ 'table' ] }
           },
           {
             path: '/list/permission-list',
@@ -154,9 +154,9 @@ export const asyncRouterMap = [
                 name: 'SearchApplications',
                 component: () => import('../views/list/TableList'),
                 meta: { title: '搜索列表(应用)', permission: [ 'table' ] }
-              },
+              }
             ]
-          },
+          }
         ]
       },
 
@@ -252,7 +252,7 @@ export const asyncRouterMap = [
             path: '/account/settings',
             name: 'settings',
             component: () => import('@/views/account/settings/Index'),
-            meta: { title: '个人设置', hideHeader: true, keepAlive: true, permission: [ 'user' ]  },
+            meta: { title: '个人设置', hideHeader: true, keepAlive: true, permission: [ 'user' ] },
             redirect: '/account/settings/base',
             alwaysShow: true,
             children: [
@@ -260,34 +260,34 @@ export const asyncRouterMap = [
                 path: '/account/settings/base',
                 name: 'BaseSettings',
                 component: () => import('@/views/account/settings/BaseSetting'),
-                meta: { title: '基本设置', hidden: true, keepAlive: true, permission: [ 'user' ]  }
+                meta: { title: '基本设置', hidden: true, keepAlive: true, permission: [ 'user' ] }
               },
               {
                 path: '/account/settings/security',
                 name: 'SecuritySettings',
                 component: () => import('@/views/account/settings/Security'),
-                meta: { title: '安全设置', hidden: true, keepAlive: true, permission: [ 'user' ]  }
+                meta: { title: '安全设置', hidden: true, keepAlive: true, permission: [ 'user' ] }
               },
               {
                 path: '/account/settings/custom',
                 name: 'CustomSettings',
                 component: () => import('@/views/account/settings/Custom'),
-                meta: { title: '个性化设置', hidden: true, keepAlive: true, permission: [ 'user' ]  }
+                meta: { title: '个性化设置', hidden: true, keepAlive: true, permission: [ 'user' ] }
               },
               {
                 path: '/account/settings/binding',
                 name: 'BindingSettings',
                 component: () => import('@/views/account/settings/Binding'),
-                meta: { title: '账户绑定', hidden: true, keepAlive: true, permission: [ 'user' ]  }
+                meta: { title: '账户绑定', hidden: true, keepAlive: true, permission: [ 'user' ] }
               },
               {
                 path: '/account/settings/notification',
                 name: 'NotificationSettings',
                 component: () => import('@/views/account/settings/Notification'),
-                meta: { title: '新消息通知', hidden: true, keepAlive: true, permission: [ 'user' ]  }
-              },
+                meta: { title: '新消息通知', hidden: true, keepAlive: true, permission: [ 'user' ] }
+              }
             ]
-          },
+          }
         ]
       }
     ]
@@ -342,6 +342,6 @@ export const constantRouterMap = [
   {
     path: '/404',
     component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
-  },
+  }
 
 ]

+ 1 - 1
src/core/bootstrap.js

@@ -26,4 +26,4 @@ export default function Initializer () {
   store.commit('TOGGLE_COLOR', Vue.ls.get(DEFAULT_COLOR, config.primaryColor))
   store.commit('SET_TOKEN', Vue.ls.get(ACCESS_TOKEN))
   // last step
-}
+}

+ 1 - 1
src/core/use.js

@@ -19,4 +19,4 @@ Vue.use(Viser)
 
 Vue.use(VueStorage, config.storageOptions)
 Vue.use(VueClipboard)
-Vue.use(PermissionHelper)
+Vue.use(PermissionHelper)

+ 4 - 6
src/permission.js

@@ -87,21 +87,19 @@ const action = Vue.directive('action', {
     const permissionId = vnode.context.$route.meta.permission
     let actions = []
     roles.permissions.forEach(p => {
-      if (p.permissionId != permissionId) {
+      if (p.permissionId !== permissionId) {
         return
       }
       actions = p.actionList
     })
     if (actions.indexOf(actionName) < 0) {
       setTimeout(() => {
-        if(el.parentNode == null){
+        if (el.parentNode == null) {
           el.style.display = 'none'
-        }
-        else{
-            el.parentNode.removeChild(el)
+        } else {
+          el.parentNode.removeChild(el)
         }
       }, 10)
-
     }
   }
 })

+ 1 - 1
src/router/index.js

@@ -9,4 +9,4 @@ export default new Router({
   base: process.env.BASE_URL,
   scrollBehavior: () => ({ y: 0 }),
   routes: constantRouterMap
-})
+})

+ 1 - 1
src/store/getters.js

@@ -11,4 +11,4 @@ const getters = {
   addRouters: state => state.permission.addRouters
 }
 
-export default getters
+export default getters

+ 13 - 13
src/store/modules/app.js

@@ -73,43 +73,43 @@ const app = {
     }
   },
   actions: {
-    setSidebar({ commit }, type) {
+    setSidebar ({ commit }, type) {
       commit('SET_SIDEBAR_TYPE', type)
     },
-    CloseSidebar({ commit }) {
+    CloseSidebar ({ commit }) {
       commit('CLOSE_SIDEBAR')
     },
-    ToggleDevice({ commit }, device) {
+    ToggleDevice ({ commit }, device) {
       commit('TOGGLE_DEVICE', device)
     },
-    ToggleTheme({ commit }, theme) {
+    ToggleTheme ({ commit }, theme) {
       commit('TOGGLE_THEME', theme)
     },
-    ToggleLayoutMode({ commit }, mode) {
+    ToggleLayoutMode ({ commit }, mode) {
       commit('TOGGLE_LAYOUT_MODE', mode)
     },
-    ToggleFixedHeader({ commit }, fixedHeader) {
+    ToggleFixedHeader ({ commit }, fixedHeader) {
       if (!fixedHeader) {
         commit('TOGGLE_FIXED_HEADER_HIDDEN', false)
       }
       commit('TOGGLE_FIXED_HEADER', fixedHeader)
     },
-    ToggleFixSiderbar({ commit }, fixSiderbar) {
-      commit( 'TOGGLE_FIXED_SIDERBAR', fixSiderbar)
+    ToggleFixSiderbar ({ commit }, fixSiderbar) {
+      commit('TOGGLE_FIXED_SIDERBAR', fixSiderbar)
     },
-    ToggleFixedHeaderHidden({ commit }, show) {
+    ToggleFixedHeaderHidden ({ commit }, show) {
       commit('TOGGLE_FIXED_HEADER_HIDDEN', show)
     },
-    ToggleContentWidth({ commit }, type) {
+    ToggleContentWidth ({ commit }, type) {
       commit('TOGGLE_CONTENT_WIDTH', type)
     },
-    ToggleColor({ commit }, color) {
+    ToggleColor ({ commit }, color) {
       commit('TOGGLE_COLOR', color)
     },
-    ToggleWeak({ commit }, weakFlag) {
+    ToggleWeak ({ commit }, weakFlag) {
       commit('TOGGLE_WEAK', weakFlag)
     }
   }
 }
 
-export default app
+export default app

+ 3 - 3
src/store/modules/permission.js

@@ -7,7 +7,7 @@ import { asyncRouterMap, constantRouterMap } from '@/config/router.config'
  * @param route
  * @returns {boolean}
  */
-function hasPermission(permission, route) {
+function hasPermission (permission, route) {
   if (route.meta && route.meta.permission) {
     let flag = false
     for (let i = 0, len = permission.length; i < len; i++) {
@@ -37,7 +37,7 @@ function hasRole(roles, route) {
   }
 }
 
-function filterAsyncRouter(routerMap, roles) {
+function filterAsyncRouter (routerMap, roles) {
   const accessedRouters = routerMap.filter(route => {
     if (hasPermission(roles.permissionList, route)) {
       if (route.children && route.children.length) {
@@ -62,7 +62,7 @@ const permission = {
     }
   },
   actions: {
-    GenerateRoutes({ commit }, data) {
+    GenerateRoutes ({ commit }, data) {
       return new Promise(resolve => {
         const { roles } = data
         const accessedRouters = filterAsyncRouter(asyncRouterMap, roles)

+ 7 - 7
src/store/modules/user.js

@@ -29,12 +29,12 @@ const user = {
     },
     SET_INFO: (state, info) => {
       state.info = info
-    },
+    }
   },
 
   actions: {
     // 登录
-    Login({ commit }, userInfo) {
+    Login ({ commit }, userInfo) {
       return new Promise((resolve, reject) => {
         login(userInfo).then(response => {
           const result = response.result
@@ -48,7 +48,7 @@ const user = {
     },
 
     // 获取用户信息
-    GetInfo({ commit }) {
+    GetInfo ({ commit }) {
       return new Promise((resolve, reject) => {
         getInfo().then(response => {
           const result = response.result
@@ -66,7 +66,7 @@ const user = {
             commit('SET_ROLES', result.role)
             commit('SET_INFO', result)
           } else {
-            reject('getInfo: roles must be a non-null array !')
+            reject(new Error('getInfo: roles must be a non-null array !'))
           }
 
           commit('SET_NAME', { name: result.name, welcome: welcome() })
@@ -80,7 +80,7 @@ const user = {
     },
 
     // 登出
-    Logout({ commit, state }) {
+    Logout ({ commit, state }) {
       return new Promise((resolve) => {
         commit('SET_TOKEN', '')
         commit('SET_ROLES', [])
@@ -92,9 +92,9 @@ const user = {
           resolve()
         })
       })
-    },
+    }
 
   }
 }
 
-export default user
+export default user

+ 2 - 2
src/store/mutation-types.js

@@ -5,11 +5,11 @@ export const DEFAULT_LAYOUT_MODE = 'DEFAULT_LAYOUT_MODE'
 export const DEFAULT_COLOR = 'DEFAULT_COLOR'
 export const DEFAULT_COLOR_WEAK = 'DEFAULT_COLOR_WEAK'
 export const DEFAULT_FIXED_HEADER = 'DEFAULT_FIXED_HEADER'
-export const DEFAULT_FIXED_SIDEMENU= 'DEFAULT_FIXED_SIDEMENU'
+export const DEFAULT_FIXED_SIDEMENU = 'DEFAULT_FIXED_SIDEMENU'
 export const DEFAULT_FIXED_HEADER_HIDDEN = 'DEFAULT_FIXED_HEADER_HIDDEN'
 export const DEFAULT_CONTENT_WIDTH_TYPE = 'DEFAULT_CONTENT_WIDTH_TYPE'
 
 export const CONTENT_WIDTH_TYPE = {
   Fluid: 'Fluid',
   Fixed: 'Fixed'
-}
+}

+ 4 - 4
src/utils/auth.js

@@ -5,15 +5,15 @@ import { setStore, getStore, clearStore } from '@/utils/storage'
 
 export const TokenKey = 'Access-Token'
 
-export function getToken() {
+export function getToken () {
   return getStore(TokenKey)
 }
 
-export function setToken(token) {
+export function setToken (token) {
   // key, token, timeout = 86400s
   return setStore(TokenKey, token, 86400)
 }
 
-export function removeToken() {
+export function removeToken () {
   return clearStore(TokenKey)
-}
+}

+ 30 - 30
src/utils/axios.js

@@ -1,37 +1,37 @@
 const VueAxios = {
-    vm: {},
-    // eslint-disable-next-line no-unused-vars
-    install(Vue, router = {}, instance) {
-        if (this.installed) {
-            return
-        }
-        this.installed = true
+  vm: {},
+  // eslint-disable-next-line no-unused-vars
+  install (Vue, router = {}, instance) {
+    if (this.installed) {
+      return
+    }
+    this.installed = true
 
-        if (!instance) {
-            // eslint-disable-next-line no-console
-            console.error('You have to install axios')
-            return
-        }
+    if (!instance) {
+      // eslint-disable-next-line no-console
+      console.error('You have to install axios')
+      return
+    }
 
-        Vue.axios = instance
+    Vue.axios = instance
 
-        Object.defineProperties(Vue.prototype, {
-            axios: {
-                get: function get() {
-                    return instance
-                }
-            },
-            $http: {
-                get: function get() {
-                    return instance
-                }
-            }
-        })
-    }
+    Object.defineProperties(Vue.prototype, {
+      axios: {
+        get: function get () {
+          return instance
+        }
+      },
+      $http: {
+        get: function get () {
+          return instance
+        }
+      }
+    })
+  }
 }
 
 export {
-    VueAxios,
-    // eslint-disable-next-line no-undef
-    instance as axios
-}
+  VueAxios,
+  // eslint-disable-next-line no-undef
+  instance as axios
+}

+ 3 - 4
src/utils/device.js

@@ -3,11 +3,10 @@ import enquireJs from 'enquire.js'
 export const DEVICE_TYPE = {
   DESKTOP: 'desktop',
   TABLET: 'tablet',
-  MOBILE: 'mobile',
+  MOBILE: 'mobile'
 }
 
 export const deviceEnquire = function (callback) {
-
   const matchDesktop = {
     match: () => {
       callback && callback(DEVICE_TYPE.DESKTOP)
@@ -30,5 +29,5 @@ export const deviceEnquire = function (callback) {
   enquireJs
     .register('screen and (max-width: 576px)', matchMobile)
     .register('screen and (min-width: 576px) and (max-width: 1199px)', matchLablet)
-    .register('screen and (min-width: 1200px)', matchDesktop)    
-}
+    .register('screen and (min-width: 1200px)', matchDesktop)
+}

+ 4 - 4
src/utils/filter.js

@@ -7,14 +7,14 @@ Vue.filter('NumberFormat', function (value) {
   if (!value) {
     return '0'
   }
-  const intPartFormat = value.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') //将整数部分逢三一断
+  const intPartFormat = value.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') // 将整数部分逢三一断
   return intPartFormat
 })
 
-Vue.filter ('dayjs', function(dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') {
+Vue.filter('dayjs', function (dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') {
   return moment(dataStr).format(pattern)
 })
 
-Vue.filter ('moment', function(dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') {
+Vue.filter('moment', function (dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') {
   return moment(dataStr).format(pattern)
-})
+})

+ 5 - 6
src/utils/helper/permission.js

@@ -7,18 +7,17 @@ const PERMISSION_ENUM = {
   'enable': { key: 'enable', label: '启用' },
   'disable': { key: 'disable', label: '禁用' },
   'import': { key: 'import', label: '导入' },
-  'export': { key: 'export', label: '导出' },
+  'export': { key: 'export', label: '导出' }
 }
 
-function plugin(Vue) {
-
+function plugin (Vue) {
   if (plugin.installed) {
     return
   }
 
   !Vue.prototype.$auth && Object.defineProperties(Vue.prototype, {
     $auth: {
-      get() {
+      get () {
         const _this = this
         return (permissions) => {
           const [permission, action] = permissions.split('.')
@@ -36,7 +35,7 @@ function plugin(Vue) {
 
   !Vue.prototype.$enum && Object.defineProperties(Vue.prototype, {
     $enum: {
-      get() {
+      get () {
         // const _this = this;
         return (val) => {
           let result = PERMISSION_ENUM
@@ -50,4 +49,4 @@ function plugin(Vue) {
   })
 }
 
-export default plugin
+export default plugin

+ 2 - 2
src/utils/mixin.js

@@ -33,7 +33,7 @@ const mixin = {
 const mixinDevice = {
   computed: {
     ...mapState({
-      device: state => state.app.device,
+      device: state => state.app.device
     })
   },
   methods: {
@@ -49,4 +49,4 @@ const mixinDevice = {
   }
 }
 
-export { mixin, mixinDevice }
+export { mixin, mixinDevice }

+ 2 - 2
src/utils/permissions.js

@@ -1,8 +1,8 @@
-export function actionToObject(json) {
+export function actionToObject (json) {
   try {
     return JSON.parse(json)
   } catch (e) {
     console.log('err', e.message)
   }
   return []
-}
+}

+ 4 - 4
src/utils/request.js

@@ -16,7 +16,7 @@ const err = (error) => {
     const data = error.response.data
     const token = Vue.ls.get(ACCESS_TOKEN)
     if (error.response.status === 403) {
-      notification.error({ message: 'Forbidden', description: data.message})
+      notification.error({ message: 'Forbidden', description: data.message })
     }
     if (error.response.status === 401) {
       notification.error({ message: 'Unauthorized', description: 'Authorization verification failed' })
@@ -43,8 +43,8 @@ service.interceptors.request.use(config => {
 
 // response interceptor
 service.interceptors.response.use((response) => {
-    return response.data
-  }, err)
+  return response.data
+}, err)
 
 const installer = {
   vm: {},
@@ -56,4 +56,4 @@ const installer = {
 export {
   installer as VueAxios,
   service as axios
-}
+}

+ 0 - 1
src/utils/storage.js

@@ -75,4 +75,3 @@ export const clearAll = () => {
 
   window.localStorage.clear()
 }
-

+ 6 - 6
src/utils/util.js

@@ -1,19 +1,19 @@
-export function timeFix() {
+export function timeFix () {
   const time = new Date()
   const hour = time.getHours()
   return hour < 9 ? '早上好' : (hour <= 11 ? '上午好' : (hour <= 13 ? '中午好' : (hour < 20 ? '下午好' : '晚上好')))
 }
 
-export function welcome() {
+export function welcome () {
   const arr = ['休息一会儿吧', '准备吃什么呢?', '要不要打一把 DOTA', '我猜你可能累了']
-  const index = Math.floor((Math.random()*arr.length))
+  const index = Math.floor((Math.random() * arr.length))
   return arr[index]
 }
 
 /**
  * 触发 window.resize
  */
-export function triggerWindowResizeEvent() {
+export function triggerWindowResizeEvent () {
   const event = document.createEvent('HTMLEvents')
   event.initEvent('resize', true, true)
   event.eventType = 'message'
@@ -25,11 +25,11 @@ export function triggerWindowResizeEvent() {
  * @param id parent element id or class
  * @param timeout
  */
-export function removeLoadingAnimate(id = '', timeout = 1500) {
+export function removeLoadingAnimate (id = '', timeout = 1500) {
   if (id === '') {
     return
   }
   setTimeout(() => {
     document.body.removeChild(document.getElementById(id))
   }, timeout)
-}
+}

+ 4 - 4
src/views/404.vue

@@ -5,11 +5,11 @@
 </template>
 
 <script>
-  export default {
-    name: '404'
-  }
+export default {
+  name: '404'
+}
 </script>
 
 <style scoped>
 
-</style>
+</style>

+ 34 - 34
src/views/Home.vue

@@ -110,43 +110,43 @@
 </template>
 
 <script>
-  // @ is an alias to /src
-
-  import Trend from '@/components/Trend'
-  import AvatarList from '@/components/AvatarList'
-  import CountDown from '@/components/CountDown/CountDown'
-  import Ellipsis from '@/components/Ellipsis'
-  import NumberInfo from '@/components/NumberInfo'
-
-  const AvatarListItem = AvatarList.AvatarItem
-
-  export default {
-    name: 'Home',
-    components: {
-      NumberInfo,
-      Ellipsis,
-      CountDown,
-      Trend,
-      AvatarList,
-      AvatarListItem
-    },
-    data () {
-      return {
-        targetTime: new Date().getTime() + 3900000
-      }
+// @ is an alias to /src
+
+import Trend from '@/components/Trend'
+import AvatarList from '@/components/AvatarList'
+import CountDown from '@/components/CountDown/CountDown'
+import Ellipsis from '@/components/Ellipsis'
+import NumberInfo from '@/components/NumberInfo'
+
+const AvatarListItem = AvatarList.AvatarItem
+
+export default {
+  name: 'Home',
+  components: {
+    NumberInfo,
+    Ellipsis,
+    CountDown,
+    Trend,
+    AvatarList,
+    AvatarListItem
+  },
+  data () {
+    return {
+      targetTime: new Date().getTime() + 3900000
+    }
+  },
+  methods: {
+    onEndHandle () {
+      this.$message.success('CountDown callback!!!')
     },
-    methods: {
-      onEndHandle () {
-        this.$message.success('CountDown callback!!!')
-      },
-      onEndHandle2 () {
-        this.$notification.open({
-          message: 'Notification Title',
-          description: 'This is the content of the notification. This is the content of the notification. This is the content of the notification.',
-        })
-      }
+    onEndHandle2 () {
+      this.$notification.open({
+        message: 'Notification Title',
+        description: 'This is the content of the notification. This is the content of the notification. This is the content of the notification.'
+      })
     }
   }
+}
 </script>
 
 <style scoped>

+ 10 - 10
src/views/account/center/Index.vue

@@ -110,7 +110,7 @@ export default {
     ArticlePage,
     ProjectPage
   },
-  data() {
+  data () {
     return {
       tags: ['很有想法的', '专注设计', '辣~', '大长腿', '川妹子', '海纳百川'],
 
@@ -137,40 +137,40 @@ export default {
       noTitleKey: 'app'
     }
   },
-  mounted() {
+  mounted () {
     this.getTeams()
   },
   methods: {
     ...mapGetters(['nickname', 'avatar']),
 
-    getTeams() {
+    getTeams () {
       this.$http.get('/workplace/teams').then(res => {
         this.teams = res.result
         this.teamSpinning = false
       })
     },
 
-    handleTabChange(key, type) {
+    handleTabChange (key, type) {
       this[type] = key
     },
 
-    handleTagClose(removeTag) {
-      const tags = this.tags.filter(tag => tag != removeTag)
+    handleTagClose (removeTag) {
+      const tags = this.tags.filter(tag => tag !== removeTag)
       this.tags = tags
     },
 
-    showTagInput() {
+    showTagInput () {
       this.tagInputVisible = true
       this.$nextTick(() => {
         this.$refs.tagInput.focus()
       })
     },
 
-    handleInputChange(e) {
+    handleInputChange (e) {
       this.tagInputValue = e.target.value
     },
 
-    handleTagInputConfirm() {
+    handleTagInputConfirm () {
       const inputValue = this.tagInputValue
       let tags = this.tags
       if (inputValue && !tags.includes(inputValue)) {
@@ -286,4 +286,4 @@ export default {
     margin-bottom: 12px;
   }
 }
-</style>
+</style>

+ 17 - 17
src/views/account/center/page/App.vue

@@ -58,25 +58,25 @@
 </template>
 
 <script>
-  const dataSource = []
-  for (let i = 0; i < 11; i++) {
-    dataSource.push({
-      title: 'Alipay',
-      avatar: 'https://gw.alipayobjects.com/zos/rmsportal/WdGqmHpayyMjiEhcKoVE.png',
-      activeUser: 17,
-      newUser: 1700
-    })
-  }
+const dataSource = []
+for (let i = 0; i < 11; i++) {
+  dataSource.push({
+    title: 'Alipay',
+    avatar: 'https://gw.alipayobjects.com/zos/rmsportal/WdGqmHpayyMjiEhcKoVE.png',
+    activeUser: 17,
+    newUser: 1700
+  })
+}
 
-  export default {
-    name: 'Article',
-    components: {},
-    data() {
-      return {
-        dataSource,
-      }
+export default {
+  name: 'Article',
+  components: {},
+  data () {
+    return {
+      dataSource
     }
   }
+}
 </script>
 
 <style lang="less" scoped>
@@ -110,4 +110,4 @@
     }
   }
 
-</style>
+</style>

+ 9 - 9
src/views/account/center/page/Article.vue

@@ -7,18 +7,18 @@
 </template>
 
 <script>
-  import AList from 'ant-design-vue/es/list'
-  import AListItem from 'ant-design-vue/es/list/Item'
+import AList from 'ant-design-vue/es/list'
+import AListItem from 'ant-design-vue/es/list/Item'
 
-  export default {
-    name: 'Article',
-    components: {
-      AList,
-      AListItem
-    }
+export default {
+  name: 'Article',
+  components: {
+    AList,
+    AListItem
   }
+}
 </script>
 
 <style scoped>
 
-</style>
+</style>

+ 4 - 4
src/views/account/center/page/Project.vue

@@ -7,11 +7,11 @@
 </template>
 
 <script>
-  export default {
-    name: 'Project'
-  }
+export default {
+  name: 'Project'
+}
 </script>
 
 <style scoped>
 
-</style>
+</style>

+ 1 - 1
src/views/account/center/page/index.js

@@ -2,4 +2,4 @@ import AppPage from './App'
 import ArticlePage from './Article'
 import ProjectPage from './Project'
 
-export { AppPage, ArticlePage, ProjectPage }
+export { AppPage, ArticlePage, ProjectPage }

+ 45 - 47
src/views/account/settings/AvatarModal.vue

@@ -34,59 +34,57 @@
   </a-modal>
 </template>
 <script>
-  import { VueCropper } from 'vue-cropper'
+import { VueCropper } from 'vue-cropper'
 
-  export default {
-    components: {
-      VueCropper
-    },
-    data() {
-      return {
-        visible: false,
-        id: null,
-        confirmLoading: false,
-
-        options: {
-          img: '/avatar2.jpg',
-          autoCrop: true,
-          autoCropWidth: 200,
-          autoCropHeight: 200,
-          fixedBox: true
-        },
-        previews: {},
-      }
-    },
-    methods: {
-      edit(id) {
-        this.visible = true
-        this.id = id
-        /* 获取原始头像 */
+export default {
+  components: {
+    VueCropper
+  },
+  data () {
+    return {
+      visible: false,
+      id: null,
+      confirmLoading: false,
 
+      options: {
+        img: '/avatar2.jpg',
+        autoCrop: true,
+        autoCropWidth: 200,
+        autoCropHeight: 200,
+        fixedBox: true
       },
-      close() {
-        this.id = null
-        this.visible = false
-      },
-      cancelHandel() {
-        this.close()
-      },
-      okHandel() {
-        const vm = this
-
-        vm.confirmLoading = true
-        setTimeout(() => {
-          vm.confirmLoading = false
-          vm.close()
-          vm.$message.success('上传头像成功')
-        }, 2000)
+      previews: {}
+    }
+  },
+  methods: {
+    edit (id) {
+      this.visible = true
+      this.id = id
+      /* 获取原始头像 */
+    },
+    close () {
+      this.id = null
+      this.visible = false
+    },
+    cancelHandel () {
+      this.close()
+    },
+    okHandel () {
+      const vm = this
 
-      },
+      vm.confirmLoading = true
+      setTimeout(() => {
+        vm.confirmLoading = false
+        vm.close()
+        vm.$message.success('上传头像成功')
+      }, 2000)
+    },
 
-      realTime(data) {
-        this.previews = data
-      }
+    realTime (data) {
+      this.previews = data
     }
   }
+}
 </script>
 
 <style lang="less" scoped>
@@ -106,4 +104,4 @@
       height: 100%;
     }
   }
-</style>
+</style>

+ 29 - 29
src/views/account/settings/BaseSetting.vue

@@ -70,37 +70,37 @@
 </template>
 
 <script>
-  import AvatarModal from './AvatarModal'
-
-  export default {
-    components: {
-      AvatarModal
-    },
-    data () {
-      return {
-        // cropper
-        preview: {},
-        option: {
-          img: '/avatar2.jpg',
-          info: true,
-          size: 1,
-          outputType: 'jpeg',
-          canScale: false,
-          autoCrop: true,
-          // 只有自动截图开启 宽度高度才生效
-          autoCropWidth: 180,
-          autoCropHeight: 180,
-          fixedBox: true,
-          // 开启宽度和高度比例
-          fixed: true,
-          fixedNumber: [1, 1]
-        }
+import AvatarModal from './AvatarModal'
+
+export default {
+  components: {
+    AvatarModal
+  },
+  data () {
+    return {
+      // cropper
+      preview: {},
+      option: {
+        img: '/avatar2.jpg',
+        info: true,
+        size: 1,
+        outputType: 'jpeg',
+        canScale: false,
+        autoCrop: true,
+        // 只有自动截图开启 宽度高度才生效
+        autoCropWidth: 180,
+        autoCropHeight: 180,
+        fixedBox: true,
+        // 开启宽度和高度比例
+        fixed: true,
+        fixedNumber: [1, 1]
       }
-    },
-    methods: {
-
     }
+  },
+  methods: {
+
   }
+}
 </script>
 
 <style lang="less" scoped>
@@ -158,4 +158,4 @@
       overflow: hidden;
     }
   }
-</style>
+</style>

+ 9 - 9
src/views/account/settings/Binding.vue

@@ -8,18 +8,18 @@
 </template>
 
 <script>
-  export default {
-    data () {
-      return {
-        data: []
-      }
-    },
-    methods: {
-
+export default {
+  data () {
+    return {
+      data: []
     }
+  },
+  methods: {
+
   }
+}
 </script>
 
 <style scoped>
 
-</style>
+</style>

+ 61 - 61
src/views/account/settings/Custom.vue

@@ -1,75 +1,75 @@
 <script>
-  import { colorList } from '@/components/tools/setting'
-  import ASwitch from 'ant-design-vue/es/switch'
-  import AList from 'ant-design-vue/es/list'
-  import AListItem from 'ant-design-vue/es/list/Item'
-  import { mixin } from '@/utils/mixin.js'
+import { colorList } from '@/components/tools/setting'
+import ASwitch from 'ant-design-vue/es/switch'
+import AList from 'ant-design-vue/es/list'
+import AListItem from 'ant-design-vue/es/list/Item'
+import { mixin } from '@/utils/mixin.js'
 
-  const Meta = AListItem.Meta
+const Meta = AListItem.Meta
 
-  export default {
-    components: {
-      AListItem,
-      AList,
-      ASwitch,
-      Meta
-    },
-    mixins: [mixin],
-    data () {
-      return {
+export default {
+  components: {
+    AListItem,
+    AList,
+    ASwitch,
+    Meta
+  },
+  mixins: [mixin],
+  data () {
+    return {
+    }
+  },
+  filters: {
+    themeFilter (theme) {
+      const themeMap = {
+        'dark': '暗色',
+        'light': '白色'
       }
+      return themeMap[theme]
+    }
+  },
+  methods: {
+    colorFilter (color) {
+      const c = colorList.filter(o => o.color === color)[0]
+      return c && c.key
     },
-    filters: {
-      themeFilter(theme) {
-        const themeMap = {
-          'dark': '暗色',
-          'light': '白色'
-        }
-        return themeMap[theme]
-      },
-    },
-    methods: {
-      colorFilter(color) {
-        const c = colorList.filter(o => o.color === color)[0]
-        return c && c.key
-      },
 
-      onChange (checked) {
-        if (checked) {
-          this.$store.dispatch('ToggleTheme',  'dark')
-        } else {
-          this.$store.dispatch('ToggleTheme',  'light')
-        }
+    onChange (checked) {
+      if (checked) {
+        this.$store.dispatch('ToggleTheme', 'dark')
+      } else {
+        this.$store.dispatch('ToggleTheme', 'light')
       }
-    },
-    render () {
-      return (
-        <AList itemLayout="horizontal">
-          <AListItem>
-            <Meta>
-              <a slot="title">风格配色</a>
-              <span slot="description">
+    }
+  },
+  render () {
+    return (
+      <AList itemLayout="horizontal">
+        <AListItem>
+          <Meta>
+            <a slot="title">风格配色</a>
+            <span slot="description">
                 整体风格配色设置
-              </span>
-            </Meta>
-            <div slot="actions">
-              <ASwitch checkedChildren="暗色" unCheckedChildren="白色" defaultChecked={this.navTheme === 'dark' && true || false} onChange={this.onChange} />
-            </div>
-          </AListItem>
-          <AListItem>
-            <Meta>
-              <a slot="title">主题色</a>
-              <span slot="description">
+            </span>
+          </Meta>
+          <div slot="actions">
+            <ASwitch checkedChildren="暗色" unCheckedChildren="白色" defaultChecked={this.navTheme === 'dark' && true || false} onChange={this.onChange} />
+          </div>
+        </AListItem>
+        <AListItem>
+          <Meta>
+            <a slot="title">主题色</a>
+            <span slot="description">
                 页面风格配色: <a domPropsInnerHTML={ this.colorFilter(this.primaryColor) }/>
-              </span>
-            </Meta>
-          </AListItem>
-        </AList>
-      )
-    }
+            </span>
+          </Meta>
+        </AListItem>
+      </AList>
+    )
   }
+}
 </script>
 
 <style scoped>
 
-</style>
+</style>

+ 47 - 47
src/views/account/settings/Index.vue

@@ -49,58 +49,58 @@
 </template>
 
 <script>
-  import PageLayout from '@/components/page/PageLayout'
-  import RouteView from '@/components/layouts/RouteView'
-  import { mixinDevice } from '@/utils/mixin.js'
+import PageLayout from '@/components/page/PageLayout'
+import RouteView from '@/components/layouts/RouteView'
+import { mixinDevice } from '@/utils/mixin.js'
 
-  export default {
-    components: {
-      RouteView,
-      PageLayout
-    },
-    mixins: [mixinDevice],
-    data () {
-      return {
-        // horizontal  inline
-        mode: 'inline',
-
-        openKeys: [],
-        defaultSelectedKeys: [],
+export default {
+  components: {
+    RouteView,
+    PageLayout
+  },
+  mixins: [mixinDevice],
+  data () {
+    return {
+      // horizontal  inline
+      mode: 'inline',
 
-        // cropper
-        preview: {},
-        option: {
-          img: '/avatar2.jpg',
-          info: true,
-          size: 1,
-          outputType: 'jpeg',
-          canScale: false,
-          autoCrop: true,
-          // 只有自动截图开启 宽度高度才生效
-          autoCropWidth: 180,
-          autoCropHeight: 180,
-          fixedBox: true,
-          // 开启宽度和高度比例
-          fixed: true,
-          fixedNumber: [1, 1]
-        },
+      openKeys: [],
+      defaultSelectedKeys: [],
 
-        pageTitle: ''
-      }
-    },
-    created () {
-      this.updateMenu()
-    },
-    methods: {
-      onOpenChange (openKeys) {
-        this.openKeys = openKeys
+      // cropper
+      preview: {},
+      option: {
+        img: '/avatar2.jpg',
+        info: true,
+        size: 1,
+        outputType: 'jpeg',
+        canScale: false,
+        autoCrop: true,
+        // 只有自动截图开启 宽度高度才生效
+        autoCropWidth: 180,
+        autoCropHeight: 180,
+        fixedBox: true,
+        // 开启宽度和高度比例
+        fixed: true,
+        fixedNumber: [1, 1]
       },
-      updateMenu () {
-        const routes = this.$route.matched.concat()
-        this.defaultSelectedKeys = [ routes.pop().path ]
-      }
+
+      pageTitle: ''
+    }
+  },
+  created () {
+    this.updateMenu()
+  },
+  methods: {
+    onOpenChange (openKeys) {
+      this.openKeys = openKeys
     },
+    updateMenu () {
+      const routes = this.$route.matched.concat()
+      this.defaultSelectedKeys = [ routes.pop().path ]
+    }
   }
+}
 </script>
 
 <style lang="less" scoped>
@@ -148,4 +148,4 @@
     }
   }
 
-</style>
+</style>

+ 9 - 9
src/views/account/settings/Notification.vue

@@ -8,18 +8,18 @@
 </template>
 
 <script>
-  export default {
-    data () {
-      return {
-        data: []
-      }
-    },
-    methods: {
-
+export default {
+  data () {
+    return {
+      data: []
     }
+  },
+  methods: {
+
   }
+}
 </script>
 
 <style scoped>
 
-</style>
+</style>

+ 12 - 12
src/views/account/settings/Security.vue

@@ -21,21 +21,21 @@
 </template>
 
 <script>
-  export default {
-    data () {
-      return {
-        data: [
-          { title: '账户密码' , description: '当前密码强度', value: '强', actions: { title: '修改', callback: () => { this.$message.info('This is a normal message') } } },
-          { title: '密保手机' , description: '已绑定手机', value: '138****8293', actions: { title: '修改', callback: () => { this.$message.success('This is a message of success') } }  },
-          { title: '密保问题' , description: '未设置密保问题,密保问题可有效保护账户安全', value: '', actions: { title: '设置', callback: () => { this.$message.error('This is a message of error') } }  },
-          { title: '备用邮箱' , description: '已绑定邮箱', value: 'ant***sign.com', actions: { title: '修改', callback: () => { this.$message.warning('This is message of warning') } }  },
-          { title: 'MFA 设备' , description: '未绑定 MFA 设备,绑定后,可以进行二次确认', value: '', actions: { title: '绑定', callback: () => { this.$message.info('This is a normal message') } }  },
-        ]
-      }
+export default {
+  data () {
+    return {
+      data: [
+        { title: '账户密码', description: '当前密码强度', value: '强', actions: { title: '修改', callback: () => { this.$message.info('This is a normal message') } } },
+        { title: '密保手机', description: '已绑定手机', value: '138****8293', actions: { title: '修改', callback: () => { this.$message.success('This is a message of success') } } },
+        { title: '密保问题', description: '未设置密保问题,密保问题可有效保护账户安全', value: '', actions: { title: '设置', callback: () => { this.$message.error('This is a message of error') } } },
+        { title: '备用邮箱', description: '已绑定邮箱', value: 'ant***sign.com', actions: { title: '修改', callback: () => { this.$message.warning('This is message of warning') } } },
+        { title: 'MFA 设备', description: '未绑定 MFA 设备,绑定后,可以进行二次确认', value: '', actions: { title: '绑定', callback: () => { this.$message.info('This is a normal message') } } }
+      ]
     }
   }
+}
 </script>
 
 <style scoped>
 
-</style>
+</style>

+ 40 - 40
src/views/dashboard/Analysis.vue

@@ -145,49 +145,49 @@
 </template>
 
 <script>
-  import ChartCard from '@/components/chart/ChartCard'
-  import ACol from 'ant-design-vue/es/grid/Col'
-  import ATooltip from 'ant-design-vue/es/tooltip/Tooltip'
-  import MiniArea from '@/components/chart/MiniArea'
-  import MiniBar from '@/components/chart/MiniBar'
-  import MiniProgress from '@/components/chart/MiniProgress'
-  import RankList from '@/components/chart/RankList'
-  import Bar from '@/components/chart/Bar'
-  import Trend from '@/components/Trend'
+import ChartCard from '@/components/chart/ChartCard'
+import ACol from 'ant-design-vue/es/grid/Col'
+import ATooltip from 'ant-design-vue/es/tooltip/Tooltip'
+import MiniArea from '@/components/chart/MiniArea'
+import MiniBar from '@/components/chart/MiniBar'
+import MiniProgress from '@/components/chart/MiniProgress'
+import RankList from '@/components/chart/RankList'
+import Bar from '@/components/chart/Bar'
+import Trend from '@/components/Trend'
 
-  const rankList = []
-  for (let i = 0; i < 7; i++) {
-    rankList.push({
-      name: '白鹭岛 ' + (i+1) + ' 号店',
-      total: 1234.56 - i * 100
-    })
-  }
+const rankList = []
+for (let i = 0; i < 7; i++) {
+  rankList.push({
+    name: '白鹭岛 ' + (i + 1) + ' 号店',
+    total: 1234.56 - i * 100
+  })
+}
 
-  export default {
-    name: 'Analysis',
-    components: {
-      ATooltip,
-      ACol,
-      ChartCard,
-      MiniArea,
-      MiniBar,
-      MiniProgress,
-      RankList,
-      Bar,
-      Trend
-    },
-    data() {
-      return {
-        loading: true,
-        rankList
-      }
-    },
-    created() {
-      setTimeout(() => {
-        this.loading = !this.loading
-      }, 1000)
+export default {
+  name: 'Analysis',
+  components: {
+    ATooltip,
+    ACol,
+    ChartCard,
+    MiniArea,
+    MiniBar,
+    MiniProgress,
+    RankList,
+    Bar,
+    Trend
+  },
+  data () {
+    return {
+      loading: true,
+      rankList
     }
+  },
+  created () {
+    setTimeout(() => {
+      this.loading = !this.loading
+    }, 1000)
   }
+}
 </script>
 
 <style lang="less" scoped>
@@ -204,4 +204,4 @@
       }
     }
   }
-</style>
+</style>

+ 4 - 4
src/views/dashboard/Monitor.vue

@@ -5,11 +5,11 @@
 </template>
 
 <script>
-  export default {
-    name: 'Monitor'
-  }
+export default {
+  name: 'Monitor'
+}
 </script>
 
 <style scoped>
 
-</style>
+</style>

+ 118 - 119
src/views/dashboard/Workplace.vue

@@ -110,139 +110,138 @@
 </template>
 
 <script>
-  import { timeFix } from '@/utils/util'
-  import {mapGetters} from 'vuex'
+import { timeFix } from '@/utils/util'
+import { mapGetters } from 'vuex'
 
-  import PageLayout from '@/components/page/PageLayout'
-  import HeadInfo from '@/components/tools/HeadInfo'
-  import Radar from '@/components/chart/Radar'
+import PageLayout from '@/components/page/PageLayout'
+import HeadInfo from '@/components/tools/HeadInfo'
+import Radar from '@/components/chart/Radar'
 
-  import { getRoleList, getServiceList } from '@/api/manage'
+import { getRoleList, getServiceList } from '@/api/manage'
 
-  const DataSet = require('@antv/data-set')
+const DataSet = require('@antv/data-set')
 
-  export default {
-    name: 'Workplace',
-    components: {
-      PageLayout,
-      HeadInfo,
-      Radar
-    },
-    data() {
-      return {
-        timeFix: timeFix(),
-        avatar: '',
-        user: {},
+export default {
+  name: 'Workplace',
+  components: {
+    PageLayout,
+    HeadInfo,
+    Radar
+  },
+  data () {
+    return {
+      timeFix: timeFix(),
+      avatar: '',
+      user: {},
 
-        projects: [],
-        loading: true,
-        radarLoading: true,
-        activities: [],
-        teams: [],
+      projects: [],
+      loading: true,
+      radarLoading: true,
+      activities: [],
+      teams: [],
 
-        // data
-        axis1Opts: {
-          dataKey: 'item',
-          line: null,
-          tickLine: null,
-          grid: {
-            lineStyle: {
-              lineDash: null
-            },
-            hideFirstLine: false
-          }
-        },
-        axis2Opts: {
-          dataKey: 'score',
-          line: null,
-          tickLine: null,
-          grid: {
-            type: 'polygon',
-            lineStyle: {
-              lineDash: null
-            }
+      // data
+      axis1Opts: {
+        dataKey: 'item',
+        line: null,
+        tickLine: null,
+        grid: {
+          lineStyle: {
+            lineDash: null
+          },
+          hideFirstLine: false
+        }
+      },
+      axis2Opts: {
+        dataKey: 'score',
+        line: null,
+        tickLine: null,
+        grid: {
+          type: 'polygon',
+          lineStyle: {
+            lineDash: null
           }
-        },
-        scale: [{
-          dataKey: 'score',
-          min: 0,
-          max: 80
-        }],
-        axisData: [
-          { item: '引用', a: 70, b: 30, c: 40 },
-          { item: '口碑', a: 60, b: 70, c: 40 },
-          { item: '产量', a: 50, b: 60, c: 40 },
-          { item: '贡献', a: 40, b: 50, c: 40 },
-          { item: '热度', a: 60, b: 70, c: 40 },
-          { item: '引用', a: 70, b: 50, c: 40 }
-        ],
-        radarData: []
-      }
-    },
-    computed: {
-      userInfo() {
-        return this.$store.getters.userInfo
-      }
-    },
-    created() {
-      this.user = this.userInfo
-      this.avatar = this.userInfo.avatar
+        }
+      },
+      scale: [{
+        dataKey: 'score',
+        min: 0,
+        max: 80
+      }],
+      axisData: [
+        { item: '引用', a: 70, b: 30, c: 40 },
+        { item: '口碑', a: 60, b: 70, c: 40 },
+        { item: '产量', a: 50, b: 60, c: 40 },
+        { item: '贡献', a: 40, b: 50, c: 40 },
+        { item: '热度', a: 60, b: 70, c: 40 },
+        { item: '引用', a: 70, b: 50, c: 40 }
+      ],
+      radarData: []
+    }
+  },
+  computed: {
+    userInfo () {
+      return this.$store.getters.userInfo
+    }
+  },
+  created () {
+    this.user = this.userInfo
+    this.avatar = this.userInfo.avatar
 
-      getRoleList().then(res => {
-        console.log('workplace -> call getRoleList()', res)
-      })
+    getRoleList().then(res => {
+      console.log('workplace -> call getRoleList()', res)
+    })
 
-      getServiceList().then(res => {
-        console.log('workplace -> call getServiceList()', res)
-      })
+    getServiceList().then(res => {
+      console.log('workplace -> call getServiceList()', res)
+    })
+  },
+  mounted () {
+    this.getProjects()
+    this.getActivity()
+    this.getTeams()
+    this.initRadar()
+  },
+  methods: {
+    ...mapGetters(['nickname', 'welcome']),
+    getProjects () {
+      this.$http.get('/list/search/projects')
+        .then(res => {
+          this.projects = res.result && res.result.data
+          this.loading = false
+        })
     },
-    mounted() {
-      this.getProjects()
-      this.getActivity()
-      this.getTeams()
-      this.initRadar()
+    getActivity () {
+      this.$http.get('/workplace/activity')
+        .then(res => {
+          this.activities = res.result
+        })
     },
-    methods: {
-      ...mapGetters(['nickname', 'welcome']),
-      getProjects() {
-        this.$http.get('/list/search/projects')
-          .then(res => {
-            this.projects = res.result && res.result.data
-            this.loading = false
-          })
-      },
-      getActivity() {
-        this.$http.get('/workplace/activity')
-          .then(res => {
-            this.activities = res.result
-          })
-      },
-      getTeams() {
-        this.$http.get('/workplace/teams')
-          .then(res => {
-            this.teams = res.result
-          })
-      },
-      initRadar() {
-        this.radarLoading = true
-
-        this.$http.get('/workplace/radar')
-          .then(res => {
-
-            const dv = new DataSet.View().source(res.result)
-            dv.transform({
-              type: 'fold',
-              fields: ['个人', '团队', '部门'],
-              key: 'user',
-              value: 'score'
-            })
+    getTeams () {
+      this.$http.get('/workplace/teams')
+        .then(res => {
+          this.teams = res.result
+        })
+    },
+    initRadar () {
+      this.radarLoading = true
 
-            this.radarData = dv.rows
-            this.radarLoading = false
+      this.$http.get('/workplace/radar')
+        .then(res => {
+          const dv = new DataSet.View().source(res.result)
+          dv.transform({
+            type: 'fold',
+            fields: ['个人', '团队', '部门'],
+            key: 'user',
+            value: 'score'
           })
-      }
+
+          this.radarData = dv.rows
+          this.radarLoading = false
+        })
     }
   }
+}
 </script>
 
 <style lang="less" scoped>
@@ -357,4 +356,4 @@
     }
   }
 
-</style>
+</style>

+ 6 - 6
src/views/exception/403.vue

@@ -3,15 +3,15 @@
 </template>
 
 <script>
-  import ExceptionPage from './ExceptionPage'
+import ExceptionPage from './ExceptionPage'
 
-  export default {
-    components: {
-      ExceptionPage
-    }
+export default {
+  components: {
+    ExceptionPage
   }
+}
 </script>
 
 <style scoped>
 
-</style>
+</style>

+ 6 - 6
src/views/exception/404.vue

@@ -3,15 +3,15 @@
 </template>
 
 <script>
-  import ExceptionPage from './ExceptionPage'
+import ExceptionPage from './ExceptionPage'
 
-  export default {
-    components: {
-      ExceptionPage
-    }
+export default {
+  components: {
+    ExceptionPage
   }
+}
 </script>
 
 <style scoped>
 
-</style>
+</style>

+ 6 - 6
src/views/exception/500.vue

@@ -3,15 +3,15 @@
 </template>
 
 <script>
-  import ExceptionPage from './ExceptionPage'
+import ExceptionPage from './ExceptionPage'
 
-  export default {
-    components: {
-      ExceptionPage
-    }
+export default {
+  components: {
+    ExceptionPage
   }
+}
 </script>
 
 <style scoped>
 
-</style>
+</style>

+ 19 - 19
src/views/exception/ExceptionPage.vue

@@ -14,27 +14,27 @@
 </template>
 
 <script>
-  import types from './type'
+import types from './type'
 
-  export default {
-    name: 'Exception',
-    props: {
-      type: {
-        type: String,
-        default: '404'
-      }
-    },
-    data() {
-      return {
-        config: types
-      }
-    },
-    methods: {
-      handleToHome () {
-        this.$router.push({ name: 'dashboard' })
-      }
+export default {
+  name: 'Exception',
+  props: {
+    type: {
+      type: String,
+      default: '404'
+    }
+  },
+  data () {
+    return {
+      config: types
+    }
+  },
+  methods: {
+    handleToHome () {
+      this.$router.push({ name: 'dashboard' })
     }
   }
+}
 </script>
 
 <style lang="less" scoped>
@@ -85,4 +85,4 @@
       }
     }
   }
-</style>
+</style>

+ 1 - 1
src/views/exception/type.js

@@ -16,4 +16,4 @@ const types = {
   }
 }
 
-export default types
+export default types

Неке датотеке нису приказане због велике количине промена