Unverified Commit 2b6261c5 by Sendya

update eslint ,cleanup

parent cd1d8254
...@@ -12,36 +12,37 @@ ...@@ -12,36 +12,37 @@
"@antv/data-set": "^0.10.1", "@antv/data-set": "^0.10.1",
"ant-design-vue": "~1.3.2", "ant-design-vue": "~1.3.2",
"axios": "^0.18.0", "axios": "^0.18.0",
"dayjs": "^1.7.5",
"enquire.js": "^2.1.6", "enquire.js": "^2.1.6",
"js-cookie": "^2.2.0", "js-cookie": "^2.2.0",
"lodash.get": "^4.4.2", "lodash.get": "^4.4.2",
"lodash.pick": "^4.4.0", "lodash.pick": "^4.4.0",
"md5": "^2.2.1", "md5": "^2.2.1",
"moment": "^2.24.0",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"viser-vue": "^2.3.3", "viser-vue": "^2.3.3",
"vue": "^2.5.17", "vue": "^2.5.22",
"vue-clipboard2": "^0.2.1", "vue-clipboard2": "^0.2.1",
"vue-cropper": "^0.4.4", "vue-cropper": "^0.4.4",
"vue-ls": "^3.2.0", "vue-ls": "^3.2.0",
"vue-router": "^3.0.1", "vue-router": "^3.0.1",
"vuex": "^3.0.1" "vuex": "^3.1.0"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^3.2.0", "@vue/cli-plugin-babel": "^3.3.0",
"@vue/cli-plugin-eslint": "^3.2.0", "@vue/cli-plugin-eslint": "^3.3.0",
"@vue/cli-plugin-unit-jest": "^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/eslint-config-standard": "^4.0.0",
"@vue/test-utils": "^1.0.0-beta.20", "@vue/test-utils": "^1.0.0-beta.20",
"babel-core": "7.0.0-bridge.0", "babel-core": "7.0.0-bridge.0",
"babel-eslint": "^10.0.1", "babel-eslint": "^10.0.1",
"babel-jest": "^23.6.0", "babel-jest": "^23.6.0",
"eslint": "^5.8.0", "eslint": "^5.12.1",
"eslint-plugin-vue": "^5.0.0-0", "eslint-plugin-html": "^5.0.0",
"eslint-plugin-vue": "^5.1.0",
"less": "^3.8.1", "less": "^3.8.1",
"less-loader": "^4.1.0", "less-loader": "^4.1.0",
"vue-template-compiler": "^2.5.17" "vue-template-compiler": "^2.5.22"
}, },
"eslintConfig": { "eslintConfig": {
"root": true, "root": true,
......
...@@ -6,18 +6,15 @@ ...@@ -6,18 +6,15 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>logo.png"> <link rel="icon" href="<%= BASE_URL %>logo.png">
<title>Ant Design Pro</title> <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> </head>
<body> <body>
<noscript> <noscript>
<strong>We're sorry but vue-antd-pro doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> <strong>We're sorry but vue-antd-pro doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript> </noscript>
<div id="preloadingWrapper" class="preloading-animate"> <div id="app">
<div class="preloading-wrapper"> <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>
<img src="/loading/option2/loading.svg" />
</div>
</div> </div>
<div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
</html> </html>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</template> </template>
<script> <script>
import moment from 'dayjs' import moment from 'moment'
const data = [] const data = []
const beginDay = new Date().getTime() const beginDay = new Date().getTime()
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</template> </template>
<script> <script>
import moment from 'dayjs' import moment from 'moment'
const data = [] const data = []
const beginDay = new Date().getTime() const beginDay = new Date().getTime()
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<div style="height: 20px"> <div style="height: 20px">
<a-tooltip class="setting-drawer-theme-color-colorBlock" v-for="(item, index) in colorList" :key="index"> <a-tooltip class="setting-drawer-theme-color-colorBlock" v-for="(item, index) in colorList" :key="index">
<template slot='title'> <template slot="title">
{{ item.key }} {{ item.key }}
</template> </template>
<a-tag :color="item.color" @click="changeColor(item.color)"> <a-tag :color="item.color" @click="changeColor(item.color)">
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
<a-list :split="false"> <a-list :split="false">
<a-list-item> <a-list-item>
<a-tooltip slot="actions"> <a-tooltip slot="actions">
<template slot='title'> <template slot="title">
该设定仅 [顶部栏导航] 时有效 该设定仅 [顶部栏导航] 时有效
</template> </template>
<a-select size="small" style="width: 80px;" :defaultValue="contentWidth" @change="handleContentWidthChange"> <a-select size="small" style="width: 80px;" :defaultValue="contentWidth" @change="handleContentWidthChange">
......
...@@ -12,7 +12,6 @@ import { ...@@ -12,7 +12,6 @@ import {
DEFAULT_FIXED_SIDEMENU, DEFAULT_FIXED_SIDEMENU,
DEFAULT_CONTENT_WIDTH_TYPE DEFAULT_CONTENT_WIDTH_TYPE
} from '@/store/mutation-types' } from '@/store/mutation-types'
import { removeLoadingAnimate } from '@/utils/util'
import config from '@/config/defaultSettings' import config from '@/config/defaultSettings'
export default function Initializer () { export default function Initializer () {
...@@ -27,5 +26,4 @@ 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('TOGGLE_COLOR', Vue.ls.get(DEFAULT_COLOR, config.primaryColor))
store.commit('SET_TOKEN', Vue.ls.get(ACCESS_TOKEN)) store.commit('SET_TOKEN', Vue.ls.get(ACCESS_TOKEN))
// last step // last step
removeLoadingAnimate('preloadingWrapper', 1500)
} }
\ No newline at end of file
...@@ -71,7 +71,7 @@ router.afterEach(() => { ...@@ -71,7 +71,7 @@ router.afterEach(() => {
* Action 权限指令 * Action 权限指令
* 指令用法: * 指令用法:
* - 在需要控制 action 级别权限的组件上使用 v-action:[method] , 如下: * - 在需要控制 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-button v-action:delete>删除用户</a-button>
* <a v-action:edit @click="edit(record)">修改</a> * <a v-action:edit @click="edit(record)">修改</a>
* *
......
import Vue from 'vue' import Vue from 'vue'
import * as dayjs from 'dayjs' import moment from 'moment'
Vue.filter('NumberFormat', function (value) { Vue.filter('NumberFormat', function (value) {
if (!value) { if (!value) {
...@@ -9,10 +9,10 @@ Vue.filter('NumberFormat', function (value) { ...@@ -9,10 +9,10 @@ Vue.filter('NumberFormat', function (value) {
return intPartFormat 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 dayjs(dataStr).format(pattern) 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 dayjs(dataStr).format(pattern) return moment(dataStr).format(pattern)
}) })
\ No newline at end of file
...@@ -70,43 +70,43 @@ ...@@ -70,43 +70,43 @@
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label='唯一识别码' label="唯一识别码"
hasFeedback 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>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label='权限名称' label="权限名称"
hasFeedback 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>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label='状态' label="状态"
hasFeedback hasFeedback
validateStatus='warning' validateStatus="warning"
> >
<a-select v-model="mdl.status"> <a-select v-model="mdl.status">
<a-select-option value='1'>正常</a-select-option> <a-select-option value="1">正常</a-select-option>
<a-select-option value='2'>禁用</a-select-option> <a-select-option value="2">禁用</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label='描述' label="描述"
hasFeedback 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-form-item>
<a-divider /> <a-divider />
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label='赋予权限' label="赋予权限"
hasFeedback hasFeedback
> >
<a-select <a-select
......
...@@ -95,11 +95,11 @@ ...@@ -95,11 +95,11 @@
</div> </div>
</template> </template>
<template slot="action" slot-scope="text, record, index"> <template slot="action" slot-scope="text, record, index">
<div class='editable-row-operations'> <div class="editable-row-operations">
<span v-if="record.editable"> <span v-if="record.editable">
<a @click="() => save(record)">保存</a> <a @click="() => save(record)">保存</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
<a-popconfirm title='真的放弃编辑吗?' @confirm="() => cancel(record)"> <a-popconfirm title="真的放弃编辑吗?" @confirm="() => cancel(record)">
<a>取消</a> <a>取消</a>
</a-popconfirm> </a-popconfirm>
</span> </span>
......
...@@ -118,19 +118,19 @@ ...@@ -118,19 +118,19 @@
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label='规则编号' label="规则编号"
hasFeedback 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>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label='服务调用次数' label="服务调用次数"
hasFeedback hasFeedback
validateStatus='success' validateStatus="success"
> >
<a-input-number :min="1" id="callNo" v-model="mdl.callNo" style="width: 100%" /> <a-input-number :min="1" id="callNo" v-model="mdl.callNo" style="width: 100%" />
</a-form-item> </a-form-item>
...@@ -138,33 +138,33 @@ ...@@ -138,33 +138,33 @@
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label='状态' label="状态"
hasFeedback hasFeedback
validateStatus='warning' validateStatus="warning"
> >
<a-select defaultValue='1' v-model="mdl.status"> <a-select defaultValue="1" v-model="mdl.status">
<a-select-option value='1'>Option 1</a-select-option> <a-select-option value="1">Option 1</a-select-option>
<a-select-option value='2'>Option 2</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-option value="3">Option 3</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label='描述' label="描述"
hasFeedback 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>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label='更新时间' label="更新时间"
hasFeedback hasFeedback
validateStatus='error' validateStatus="error"
> >
<a-date-picker <a-date-picker
style="width: 100%" style="width: 100%"
......
...@@ -84,43 +84,43 @@ ...@@ -84,43 +84,43 @@
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label='唯一识别码' label="唯一识别码"
hasFeedback 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>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label='角色名称' label="角色名称"
hasFeedback 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>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label='状态' label="状态"
hasFeedback hasFeedback
validateStatus='warning' validateStatus="warning"
> >
<a-select v-model="mdl.status"> <a-select v-model="mdl.status">
<a-select-option value='1'>正常</a-select-option> <a-select-option value="1">正常</a-select-option>
<a-select-option value='2'>禁用</a-select-option> <a-select-option value="2">禁用</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label='描述' label="描述"
hasFeedback 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-form-item>
<a-divider /> <a-divider />
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label='拥有权限' label="拥有权限"
hasFeedback hasFeedback
> >
<a-row :gutter="16" v-for="(permission, index) in mdl.permissions" :key="index"> <a-row :gutter="16" v-for="(permission, index) in mdl.permissions" :key="index">
......
...@@ -13,24 +13,24 @@ ...@@ -13,24 +13,24 @@
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label='唯一识别码' label="唯一识别码"
hasFeedback 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>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label='角色名称' label="角色名称"
hasFeedback > 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>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label='状态' label="状态"
hasFeedback > hasFeedback >
<a-select v-decorator="[ 'status', {rules: []} ]"> <a-select v-decorator="[ 'status', {rules: []} ]">
<a-select-option :value="1">正常</a-select-option> <a-select-option :value="1">正常</a-select-option>
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label='描述' label="描述"
hasFeedback hasFeedback
> >
<a-textarea :rows="5" placeholder="..." v-decorator="[ 'describe', { rules: [] } ]" /> <a-textarea :rows="5" placeholder="..." v-decorator="[ 'describe', { rules: [] } ]" />
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label='拥有权限' label="拥有权限"
hasFeedback hasFeedback
> >
<a-row :gutter="16" v-for="(permission, index) in permissions" :key="index"> <a-row :gutter="16" v-for="(permission, index) in permissions" :key="index">
......
...@@ -249,10 +249,13 @@ export default { ...@@ -249,10 +249,13 @@ export default {
loginSuccess(res) { loginSuccess(res) {
console.log(res) console.log(res)
this.$router.push({ name: 'dashboard' }) this.$router.push({ name: 'dashboard' })
this.$notification.success({ // 延迟 1 秒显示欢迎信息
message: '欢迎', setTimeout(() => {
description: `${timeFix()},欢迎回来` this.$notification.success({
}) message: '欢迎',
description: `${timeFix()},欢迎回来`
})
}, 1000)
}, },
requestFailed(err) { requestFailed(err) {
this.$notification['error']({ this.$notification['error']({
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
fieldDecoratorId="captcha" fieldDecoratorId="captcha"
:fieldDecoratorOptions="{rules: [{ required: true, message: '请输入验证码' }], validateTrigger: 'blur'}"> :fieldDecoratorOptions="{rules: [{ required: true, message: '请输入验证码' }], validateTrigger: 'blur'}">
<a-input size="large" type="text" placeholder="验证码"> <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-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment