Skip to content

Commit

Permalink
some add
Browse files Browse the repository at this point in the history
  • Loading branch information
BoBoooooo committed Feb 21, 2019
1 parent 21b8bae commit 3d81706
Show file tree
Hide file tree
Showing 13 changed files with 348 additions and 483 deletions.
68 changes: 33 additions & 35 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,36 @@
module.exports = {
root: true,
env: {
node: true,
},
extends: [
'plugin:vue/essential',
'@vue/airbnb',
],
plugins: [
'html',
'vue'
],

rules: {
"semi": "off", //去掉分号检查
'linebreak-style':'off',
'no-param-reassign': 0, //允许改变形参
'no-plusplus':0, // ++ --允许使用
'no-underscore-dangle':0 ,//允许类似 const _this=this 下划线命名
'import/no-unresolved':'off', //允许alias import
'import/no-duplicates':'off', //允许alias import
'no-restricted-syntax': 0, // 允许for-of,
'vue/require-prop-types':0, //props允许不指定type
'consistent-return':'off', //
'max-len':'off',
'import/extensions':'off',
'vue/require-valid-default-prop':'off',
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
},
parserOptions: {
parser: 'babel-eslint',
},

root: true,
env: {
node: true,
},
extends: [
'plugin:vue/essential',
'@vue/airbnb',
],
plugins: [
'vue'
],

}
rules: {
"semi": "off", //去掉分号检查
'linebreak-style': 'off',
'no-param-reassign': 0, //允许改变形参
'no-plusplus': 0, // ++ --允许使用
'no-underscore-dangle': 0, //允许类似 const _this=this 下划线命名
'import/no-unresolved': 'off', //允许alias import
'import/no-duplicates': 'off', //允许alias import
'no-restricted-syntax': 0, // 允许for-of,
'vue/require-prop-types': 0, //props允许不指定type
'consistent-return': 'off', //
'max-len': 'off',
'import/extensions': 'off',
'vue/require-valid-default-prop': 'off',
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
},
parserOptions: {
parser: 'babel-eslint',
},


}
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"nprogress": "^0.2.0",
"screenfull": "3.3.3",
"svg-sprite-loader": "^4.1.3",
"vue": "2.6.6",
"vue": "^2.5.21",
"vue-awesome": "^3.2.0",
"vue-chartjs": "^3.4.0",
"vue-router": "^3.0.1",
Expand All @@ -42,11 +42,9 @@
"babel-eslint": "^10.0.1",
"chai": "^4.1.2",
"vuetify-loader": "1.2.1",
"eslint": "5.14.1",
"eslint-plugin-vue": "5.2.2",
"eslint-friendly-formatter": "^4.0.1",
"eslint-loader": "2.1.2",
"eslint-plugin-html": "5.0.3",
"eslint": "^5.12.0",
"eslint-plugin-vue": "^5.1.0",

"lint-staged": "^7.2.2",
"node-sass": "^4.9.2",
"sass-loader": "^7.0.3",
Expand All @@ -56,6 +54,6 @@
"vue-cli-plugin-element": "^1.0.0",
"vue-cli-plugin-vuetify": "0.4.6",

"vue-template-compiler": "2.6.6"
"vue-template-compiler": "^2.5.21"
}
}
5 changes: 2 additions & 3 deletions src/components/Breadcrumb/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
separator="/">
<transition-group name="breadcrumb">
<el-breadcrumb-item
v-for="(item,index) in levelList"
v-if="item.meta.title"
v-for="(item,index) in levelList.filter(item=>item.meta.title)"
:key="item.path">
<span
v-if="!item.meta.parent||index==levelList.length-1"
v-if="!item.meta.parent||index===levelList.length-1"
class="no-redirect">{{ item.meta.title }}</span>
<router-link
v-else
Expand Down
69 changes: 31 additions & 38 deletions src/components/CommonTable/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,20 @@
:min-width="item.min_width"
:header-align="item.header_align"
:show-overflow-tooltip="item.show_overflow_tooltip"

/>
<el-table-column
label="操作"
align="center"
min-width="110px"
fixed="right"
>
<el-table-column label="操作" align="center" min-width="110px" fixed="right">
<template slot-scope="scope">

<v-btn
:key="index"
:color="btn.color"

v-for="(btn,index) in getShowButton" small dark @click.stop="handleOperation(btn.Fun,scope.row.id)">{{btn.label}}
<v-icon>{{btn.icon}}</v-icon>
</v-btn>


<v-btn
:key="index"
:color="btn.color"
v-for="(btn,index) in getShowButton"
small
dark
@click.stop="handleOperation(btn.Fun,scope.row.id)"
>
{{btn.label}}
<v-icon>{{btn.icon}}</v-icon>
</v-btn>
</template>
</el-table-column>
</el-table>
Expand All @@ -65,70 +60,68 @@
</template>

<script>
import operation from './handleButton.js'
import operation from './handleButton.js';
export default {
name: 'CommonTable',
props: {
list: {
type: Array, // 展示数据
default: () => ([]),
default: () => [],
},
tableJson: {
type: Array, // 列表配置json
default: () => ([]),
default: () => [],
},
listLoading: { // 正在加载
listLoading: {
// 正在加载
type: Boolean,
default: true,
},
listQuery: { // 列表查询以及分页参数
listQuery: {
// 列表查询以及分页参数
type: Object,
default: () => ({}),
},
handleButton: { // 操作列的默认按钮 (编辑 删除 查看)
handleButton: {
// 操作列的默认按钮 (编辑 删除 查看)
type: String,
default: 'edit,delete,detail',
},
},
data() {
return {
operation,
}
};
},
computed: {
getShowButton() {
return this.operation.filter(element => this.handleButton.includes(element.name));
},
},
methods: {
handleSizeChange(val) {
this.listQuery.pageSize = val
this.$emit('handleSizeChange', this.listQuery)
this.listQuery.pageSize = val;
this.$emit('handleSizeChange', this.listQuery);
},
handleCurrentChange(val) {
this.listQuery.pageNumber = val
this.$emit('handleCurrentChange', this.listQuery)
this.listQuery.pageNumber = val;
this.$emit('handleCurrentChange', this.listQuery);
},
handleOperation(eventName, id) {
this.$emit(eventName, id)
this.$emit(eventName, id);
},
},
}
};
</script>

<style lang="scss" scoped>
.el-table th,
.el-table tr.table-header-row {
background: #e5c5d2; /* 示例, 对表格样式上的修饰 */
}
.v-btn{
min-width:unset!important;
width:50px!important;
.v-btn {
min-width: unset !important;
width: 50px !important;
}
</style>
2 changes: 1 addition & 1 deletion src/components/FormDesigner/GenerateForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
:label-width="data.config.labelWidth + 'px'">
<template v-for="item in data.list">

<template v-if="item.type == 'grid'">
<template v-if="item.type === 'grid'">
<el-row
:key="item.key"
:gutter="item.options.gutter ? item.options.gutter : 0"
Expand Down
1 change: 0 additions & 1 deletion src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export const constantRouterMap = [{
meta: {
title: 'Dashboard',
icon: 'dashboard',
noCache: true,
},
}],
},
Expand Down
15 changes: 6 additions & 9 deletions src/views/404.vue
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
<template>
<div class="wscn-http404-container" />
<div class="wscn-http404-container"/>
</template>

<script>
export default {
name: 'Page404',
data() {
return {
}
return {};
},
computed: {
message() {
return '网管说这个页面你不能进......'
return '网管说这个页面你不能进......';
},
},
}
};
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.wscn-http404-container{
transform: translate(-50%,-50%);
.wscn-http404-container {
transform: translate(-50%, -50%);
position: absolute;
top: 40%;
left: 50%;
Expand Down
20 changes: 10 additions & 10 deletions src/views/DouBan/movie.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
</template>

<script>
import axios from 'axios'
import axios from 'axios';
export default {
name: 'Movie',
Expand All @@ -105,10 +105,10 @@ export default {
// 默认数据总数
totalCount: 1000,
listLoading: true,
}
};
},
created() {
this.loadData(this.currentPage, this.pagesize)
this.loadData(this.currentPage, this.pagesize);
},
methods: {
// 从服务器读取数据
Expand All @@ -117,23 +117,23 @@ export default {
.get(this.url)
.then(
(response) => {
this.tableData = response.data.subjects
this.listLoading = false
this.totalCount = response.data.total
this.tableData = response.data.subjects;
this.listLoading = false;
this.totalCount = response.data.total;
},
() => {
console.log('failed')
console.log('failed');
},
)
);
},
getImage(url) {
if (url !== undefined) {
// eslint-disable-next-line no-useless-escape
return url.replace('http:\/\/', 'https://images.weserv.nl/?url=')
return url.replace('http:\/\/', 'https://images.weserv.nl/?url=');
}
},
},
}
};
</script>
Loading

0 comments on commit 3d81706

Please sign in to comment.