浏览代码

update eslint ,cleanup

Sendya 6 年之前
父节点
当前提交
192fe98b0b

+ 10 - 9
package.json

@@ -12,36 +12,37 @@
     "@antv/data-set": "^0.10.1",
     "ant-design-vue": "~1.3.2",
     "axios": "^0.18.0",
-    "dayjs": "^1.7.5",
     "enquire.js": "^2.1.6",
     "js-cookie": "^2.2.0",
     "lodash.get": "^4.4.2",
     "lodash.pick": "^4.4.0",
     "md5": "^2.2.1",
+    "moment": "^2.24.0",
     "nprogress": "^0.2.0",
     "viser-vue": "^2.3.3",
-    "vue": "^2.5.17",
+    "vue": "^2.5.22",
     "vue-clipboard2": "^0.2.1",
     "vue-cropper": "^0.4.4",
     "vue-ls": "^3.2.0",
     "vue-router": "^3.0.1",
-    "vuex": "^3.0.1"
+    "vuex": "^3.1.0"
   },
   "devDependencies": {
-    "@vue/cli-plugin-babel": "^3.2.0",
-    "@vue/cli-plugin-eslint": "^3.2.0",
+    "@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.0",
+    "@vue/cli-service": "^3.2.1",
     "@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.8.0",
-    "eslint-plugin-vue": "^5.0.0-0",
+    "eslint": "^5.12.1",
+    "eslint-plugin-html": "^5.0.0",
+    "eslint-plugin-vue": "^5.1.0",
     "less": "^3.8.1",
     "less-loader": "^4.1.0",
-    "vue-template-compiler": "^2.5.17"
+    "vue-template-compiler": "^2.5.22"
   },
   "eslintConfig": {
     "root": true,

+ 3 - 6
public/index.html

@@ -6,18 +6,15 @@
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
     <link rel="icon" href="<%= BASE_URL %>logo.png">
     <title>Ant Design Pro</title>
-    <style>.preloading-animate{background:#ffffff;width:100%;height:100%;position:fixed;left:0;top:0;z-index:299;}.preloading-animate .preloading-wrapper{position:absolute;width:5rem;height:5rem;left:50%;top:50%;transform:translate(-50%,-50%);}.preloading-animate .preloading-wrapper .preloading-balls{font-size:5rem;}</style>
+    <style>#preloadingAnimation{position:fixed;left:0;top:0;height:100%;width:100%;background:#ffffff;user-select:none;z-index: 9999;overflow: hidden}.lds-roller{display:inline-block;position:relative;left:50%;top:50%;transform:translate(-50%,-50%);width:64px;height:64px;}.lds-roller div{animation:lds-roller 1.2s cubic-bezier(0.5,0,0.5,1) infinite;transform-origin:32px 32px;}.lds-roller div:after{content:" ";display:block;position:absolute;width:6px;height:6px;border-radius:50%;background:#13c2c2;margin:-3px 0 0 -3px;}.lds-roller div:nth-child(1){animation-delay:-0.036s;}.lds-roller div:nth-child(1):after{top:50px;left:50px;}.lds-roller div:nth-child(2){animation-delay:-0.072s;}.lds-roller div:nth-child(2):after{top:54px;left:45px;}.lds-roller div:nth-child(3){animation-delay:-0.108s;}.lds-roller div:nth-child(3):after{top:57px;left:39px;}.lds-roller div:nth-child(4){animation-delay:-0.144s;}.lds-roller div:nth-child(4):after{top:58px;left:32px;}.lds-roller div:nth-child(5){animation-delay:-0.18s;}.lds-roller div:nth-child(5):after{top:57px;left:25px;}.lds-roller div:nth-child(6){animation-delay:-0.216s;}.lds-roller div:nth-child(6):after{top:54px;left:19px;}.lds-roller div:nth-child(7){animation-delay:-0.252s;}.lds-roller div:nth-child(7):after{top:50px;left:14px;}.lds-roller div:nth-child(8){animation-delay:-0.288s;}.lds-roller div:nth-child(8):after{top:45px;left:10px;}#preloadingAnimation .load-tips{color: #13c2c2;font-size:2rem;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);margin-top:80px;text-align:center;width:400px;height:64px;}  @keyframes lds-roller{0%{transform:rotate(0deg);} 100%{transform:rotate(360deg);}}</style>
   </head>
   <body>
     <noscript>
       <strong>We're sorry but vue-antd-pro doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
     </noscript>
-    <div id="preloadingWrapper" class="preloading-animate">
-      <div class="preloading-wrapper">
-        <img src="/loading/option2/loading.svg" />
-      </div>
+    <div id="app">
+      <div id="preloadingAnimation"><div class=lds-roller><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div><div class=load-tips>Loading</div></div>
     </div>
-    <div id="app"></div>
     <!-- built files will be auto injected -->
   </body>
 </html>

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

@@ -10,7 +10,7 @@
 </template>
 
 <script>
-  import moment from 'dayjs'
+  import moment from 'moment'
   const data = []
   const beginDay = new Date().getTime()
 

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

@@ -10,7 +10,7 @@
 </template>
 
 <script>
-  import moment from 'dayjs'
+  import moment from 'moment'
   const data = []
   const beginDay = new Date().getTime()
 

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

@@ -46,7 +46,7 @@
 
           <div style="height: 20px">
             <a-tooltip class="setting-drawer-theme-color-colorBlock" v-for="(item, index) in colorList" :key="index">
-              <template slot='title'>
+              <template slot="title">
                 {{ item.key }}
               </template>
               <a-tag :color="item.color" @click="changeColor(item.color)">
@@ -90,7 +90,7 @@
             <a-list :split="false">
               <a-list-item>
                 <a-tooltip slot="actions">
-                  <template slot='title'>
+                  <template slot="title">
                     该设定仅 [顶部栏导航] 时有效
                   </template>
                   <a-select size="small" style="width: 80px;" :defaultValue="contentWidth" @change="handleContentWidthChange">

+ 0 - 2
src/core/bootstrap.js

@@ -12,7 +12,6 @@ import {
   DEFAULT_FIXED_SIDEMENU,
   DEFAULT_CONTENT_WIDTH_TYPE
 } from '@/store/mutation-types'
-import { removeLoadingAnimate } from '@/utils/util'
 import config from '@/config/defaultSettings'
 
 export default function Initializer () {
@@ -27,5 +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
-  removeLoadingAnimate('preloadingWrapper', 1500)
 }

+ 1 - 1
src/permission.js

@@ -71,7 +71,7 @@ router.afterEach(() => {
  * Action 权限指令
  * 指令用法:
  *  - 在需要控制 action 级别权限的组件上使用 v-action:[method] , 如下:
- *    <a-button v-action:add >添加用户</a-button>
+ *    <i-button v-action:add >添加用户</a-button>
  *    <a-button v-action:delete>删除用户</a-button>
  *    <a v-action:edit @click="edit(record)">修改</a>
  *

+ 5 - 5
src/utils/filter.js

@@ -1,5 +1,5 @@
 import Vue from 'vue'
-import * as dayjs from 'dayjs'
+import moment from 'moment'
 
 Vue.filter('NumberFormat', function (value) {
   if (!value) {
@@ -9,10 +9,10 @@ Vue.filter('NumberFormat', function (value) {
   return intPartFormat
 })
 
-Vue.filter('dayjs', function(dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') {
-  return dayjs(dataStr).format(pattern)
+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') {
-  return dayjs(dataStr).format(pattern)
+Vue.filter ('moment', function(dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') {
+  return moment(dataStr).format(pattern)
 })

+ 13 - 13
src/views/list/PermissionList.vue

@@ -70,43 +70,43 @@
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
-          label='唯一识别码'
+          label="唯一识别码"
           hasFeedback
-          validateStatus='success'
+          validateStatus="success"
         >
-          <a-input placeholder='唯一识别码' v-model="mdl.id" id='no' disabled="disabled" />
+          <a-input placeholder="唯一识别码" v-model="mdl.id" id="no" disabled="disabled" />
         </a-form-item>
 
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
-          label='权限名称'
+          label="权限名称"
           hasFeedback
-          validateStatus='success'
+          validateStatus="success"
         >
-          <a-input placeholder='起一个名字' v-model="mdl.name" id='permission_name' />
+          <a-input placeholder="起一个名字" v-model="mdl.name" id="permission_name" />
         </a-form-item>
 
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
-          label='状态'
+          label="状态"
           hasFeedback
-          validateStatus='warning'
+          validateStatus="warning"
         >
           <a-select v-model="mdl.status">
-            <a-select-option value='1'>正常</a-select-option>
-            <a-select-option value='2'>禁用</a-select-option>
+            <a-select-option value="1">正常</a-select-option>
+            <a-select-option value="2">禁用</a-select-option>
           </a-select>
         </a-form-item>
 
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
-          label='描述'
+          label="描述"
           hasFeedback
         >
-          <a-textarea :rows="5" v-model="mdl.describe" placeholder="..." id='describe'/>
+          <a-textarea :rows="5" v-model="mdl.describe" placeholder="..." id="describe"/>
         </a-form-item>
 
         <a-divider />
@@ -114,7 +114,7 @@
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
-          label='赋予权限'
+          label="赋予权限"
           hasFeedback
         >
           <a-select

+ 2 - 2
src/views/list/TableInnerEditList.vue

@@ -95,11 +95,11 @@
         </div>
       </template>
       <template slot="action" slot-scope="text, record, index">
-        <div class='editable-row-operations'>
+        <div class="editable-row-operations">
           <span v-if="record.editable">
             <a @click="() => save(record)">保存</a>
             <a-divider type="vertical" />
-            <a-popconfirm title='真的放弃编辑吗?' @confirm="() => cancel(record)">
+            <a-popconfirm title="真的放弃编辑吗?" @confirm="() => cancel(record)">
               <a>取消</a>
             </a-popconfirm>
           </span>

+ 16 - 16
src/views/list/TableList.vue

@@ -118,19 +118,19 @@
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
-          label='规则编号'
+          label="规则编号"
           hasFeedback
-          validateStatus='success'
+          validateStatus="success"
         >
-          <a-input placeholder='规则编号' v-model="mdl.no" id='no' />
+          <a-input placeholder="规则编号" v-model="mdl.no" id="no" />
         </a-form-item>
 
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
-          label='服务调用次数'
+          label="服务调用次数"
           hasFeedback
-          validateStatus='success'
+          validateStatus="success"
         >
           <a-input-number :min="1" id="callNo" v-model="mdl.callNo" style="width: 100%" />
         </a-form-item>
@@ -138,33 +138,33 @@
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
-          label='状态'
+          label="状态"
           hasFeedback
-          validateStatus='warning'
+          validateStatus="warning"
         >
-          <a-select defaultValue='1' v-model="mdl.status">
-            <a-select-option value='1'>Option 1</a-select-option>
-            <a-select-option value='2'>Option 2</a-select-option>
-            <a-select-option value='3'>Option 3</a-select-option>
+          <a-select defaultValue="1" v-model="mdl.status">
+            <a-select-option value="1">Option 1</a-select-option>
+            <a-select-option value="2">Option 2</a-select-option>
+            <a-select-option value="3">Option 3</a-select-option>
           </a-select>
         </a-form-item>
 
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
-          label='描述'
+          label="描述"
           hasFeedback
-          help='请填写一段描述'
+          help="请填写一段描述"
         >
-          <a-textarea :rows="5" v-model="mdl.description" placeholder="..." id='description'/>
+          <a-textarea :rows="5" v-model="mdl.description" placeholder="..." id="description"/>
         </a-form-item>
 
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
-          label='更新时间'
+          label="更新时间"
           hasFeedback
-          validateStatus='error'
+          validateStatus="error"
         >
           <a-date-picker
             style="width: 100%"

+ 13 - 13
src/views/list/UserList.vue

@@ -84,43 +84,43 @@
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
-          label='唯一识别码'
+          label="唯一识别码"
           hasFeedback
-          validateStatus='success'
+          validateStatus="success"
         >
-          <a-input placeholder='唯一识别码' v-model="mdl.id" id='no' disabled="disabled" />
+          <a-input placeholder="唯一识别码" v-model="mdl.id" id="no" disabled="disabled" />
         </a-form-item>
 
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
-          label='角色名称'
+          label="角色名称"
           hasFeedback
-          validateStatus='success'
+          validateStatus="success"
         >
-          <a-input placeholder='起一个名字' v-model="mdl.name" id='role_name' />
+          <a-input placeholder="起一个名字" v-model="mdl.name" id="role_name" />
         </a-form-item>
 
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
-          label='状态'
+          label="状态"
           hasFeedback
-          validateStatus='warning'
+          validateStatus="warning"
         >
           <a-select v-model="mdl.status">
-            <a-select-option value='1'>正常</a-select-option>
-            <a-select-option value='2'>禁用</a-select-option>
+            <a-select-option value="1">正常</a-select-option>
+            <a-select-option value="2">禁用</a-select-option>
           </a-select>
         </a-form-item>
 
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
-          label='描述'
+          label="描述"
           hasFeedback
         >
-          <a-textarea :rows="5" v-model="mdl.describe" placeholder="..." id='describe'/>
+          <a-textarea :rows="5" v-model="mdl.describe" placeholder="..." id="describe"/>
         </a-form-item>
 
         <a-divider />
@@ -128,7 +128,7 @@
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
-          label='拥有权限'
+          label="拥有权限"
           hasFeedback
         >
           <a-row :gutter="16" v-for="(permission, index) in mdl.permissions" :key="index">

+ 7 - 7
src/views/list/modules/RoleModal.vue

@@ -13,24 +13,24 @@
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
-          label='唯一识别码'
+          label="唯一识别码"
           hasFeedback
         >
-          <a-input placeholder='唯一识别码' disabled="disabled" v-decorator="[ 'id', {rules: []} ]" />
+          <a-input placeholder="唯一识别码" disabled="disabled" v-decorator="[ 'id', {rules: []} ]" />
         </a-form-item>
 
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
-          label='角色名称'
+          label="角色名称"
           hasFeedback >
-          <a-input placeholder='起一个名字' v-decorator="[ 'name', {rules: [{ required: true, message: '不起一个名字吗?' }] }]" />
+          <a-input placeholder="起一个名字" v-decorator="[ 'name', {rules: [{ required: true, message: '不起一个名字吗?' }] }]" />
         </a-form-item>
 
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
-          label='状态'
+          label="状态"
           hasFeedback >
           <a-select v-decorator="[ 'status', {rules: []} ]">
             <a-select-option :value="1">正常</a-select-option>
@@ -41,7 +41,7 @@
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
-          label='描述'
+          label="描述"
           hasFeedback
         >
           <a-textarea :rows="5" placeholder="..." v-decorator="[ 'describe', { rules: [] } ]" />
@@ -52,7 +52,7 @@
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
-          label='拥有权限'
+          label="拥有权限"
           hasFeedback
         >
           <a-row :gutter="16" v-for="(permission, index) in permissions" :key="index">

+ 7 - 4
src/views/user/Login.vue

@@ -249,10 +249,13 @@ export default {
     loginSuccess(res) {
       console.log(res)
       this.$router.push({ name: 'dashboard' })
-      this.$notification.success({
-        message: '欢迎',
-        description: `${timeFix()},欢迎回来`
-      })
+      // 延迟 1 秒显示欢迎信息
+      setTimeout(() => {
+        this.$notification.success({
+          message: '欢迎',
+          description: `${timeFix()},欢迎回来`
+        })
+      }, 1000)
     },
     requestFailed(err) {
       this.$notification['error']({

+ 1 - 1
src/views/user/Register.vue

@@ -57,7 +57,7 @@
             fieldDecoratorId="captcha"
             :fieldDecoratorOptions="{rules: [{ required: true, message: '请输入验证码' }], validateTrigger: 'blur'}">
             <a-input size="large" type="text" placeholder="验证码">
-              <a-icon slot="prefix" type='mail' :style="{ color: 'rgba(0,0,0,.25)' }"/>
+              <a-icon slot="prefix" type="mail" :style="{ color: 'rgba(0,0,0,.25)' }"/>
             </a-input>
           </a-form-item>
         </a-col>

文件差异内容过多而无法显示
+ 377 - 246
yarn.lock


部分文件因为文件数量过多而无法显示