Skip to content

Commit

Permalink
add 2 compnents
Browse files Browse the repository at this point in the history
  • Loading branch information
BoBoooooo committed Dec 5, 2018
1 parent 5117b13 commit ac6a049
Show file tree
Hide file tree
Showing 7 changed files with 220 additions and 219 deletions.
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,32 @@
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
},
"dependencies": {
"ace": "1.3.0",
"axios": "0.18.0",
"clipboard": "^2.0.1",
"echarts": "^3.8.5",
"element-ui": "2.4.6",
"eslint-import-resolver-webpack": "^0.10.1",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"font-awesome": "4.7.0",
"http-proxy-middleware": "^0.17.3",
"js-cookie": "2.2.0",
"jsoneditor": "5.25.0",
"mini-css-extract-plugin": "^0.4.1",
"multiparty": "4.2.1",
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"screenfull": "3.3.3",
"vue": "2.5.17",
"vue-multiselect": "^2.0.8",
"vue-router": "3.0.1",
"vuex": "3.0.1",
"ace": "1.3.0",
"clipboard": "^2.0.1",
"jsoneditor": "5.25.0",
"multiparty": "4.2.1",
"tinymce": "4.8.5",
"tui-color-picker": "^2.2.0",
"tui-editor": "1.2.6",
"viewerjs": "1.3.0",
"vue": "2.5.17",
"vue-awesome": "3.2.0",
"vuedraggable": "2.16.0"
"vue-multiselect": "^2.0.8",
"vue-router": "3.0.1",
"vuedraggable": "2.16.0",
"vuex": "3.0.1"
},
"devDependencies": {
"autoprefixer": "8.5.0",
Expand Down
4 changes: 2 additions & 2 deletions src/api/Archive/person.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import fetch from '@/utils/fetch'
export function GetUsers(params){
export function GetUsers(data){
return fetch({
url: '/person/list',
method: 'post',
params
data
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<script>
export default {
name: 'BasicTable',
name: 'CommonTable',
props:{
list:{
type:Array //展示数据
Expand All @@ -50,23 +50,13 @@ export default {
listLoading:{ //正在加载
type:Boolean,
default:true
},
listQuery:{
type:Object,
default:{}
}
},
data() {
return {
listQuery: {
totalCount: 0,
pageSize: 10,
pageNumber: 1,
SearchKey: '',
SearchValue: ''
}
}
},
methods: {
handleSizeChange(val) {
Expand All @@ -75,8 +65,9 @@ export default {
},
handleCurrentChange(val) {
this.listQuery.pageNumber = val
this.$emit('Refresh',this.listQuery)
this.$emit('handleCurrentChange',this.listQuery)
},
Edit(id){
this.$emit('Edit',id)
Expand All @@ -87,31 +78,15 @@ export default {
}
},
watch:{
'list':{
deep:true,
immediate:true,
handler(val){
this.listQuery.totalCount = val.length||0;
}
}
}
}
</script>

<style lang="scss" scoped>
.searchContainer {
position: absolute;
top: 62px;
left: 20px;
padding: 15px;
min-height: 100px;
z-index: 10;
right: 20px;
background-color: white;
; box-shadow: 0px 0px 10px gray;
}
.el-table th,
.el-table tr.table-header-row {
background: #e5c5d2; /* 示例, 对表格样式上的修饰 */
}
</style>
155 changes: 155 additions & 0 deletions src/components/CommonToolBar/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
<template>
<div id="toolbar">
<div v-show="buttonVisible=='el-icon-arrow-up'" class="searchContainer">
<el-row v-for="(item,index) in searchArr" :key="index" style="margin-top:2px">
<el-col :span="6">
<el-select v-model="item.SearchKey" style="width:100%" placeholder="请选择查询项">
<el-option v-for="(subitem,index_) in filter_search(optionJson)" :key="index_" :label="subitem.label" :value="subitem.prop" />
</el-select>
</el-col>
<el-col :span="6">

<el-select v-model="item.SearchType" style="width:100%" placeholder="请选择查询条件">
<el-option v-for="(subitem,index__) in SearchType" :key="index__" :label="subitem.label" :value="subitem.key" />
</el-select>
</el-col>

<el-col :span="10">
<el-input v-model="item.SearchValue" style="width:100%" placeholder="请输入查询内容" />

</el-col>

<el-col :span="2" style="text-align:center">
<el-button style="margin:5px 0px 0px 10px;padding:10px" type="danger" size="mini" circle icon="el-icon-minus" @click="removeItem" />

</el-col>

</el-row>
<el-button style="margin:0 auto;display:block;margin-top:10px" type="primary" size="mini" circle icon="el-icon-plus" @click="addItem" />

</div>

<el-row style="margin-bottom:10px">

<el-col :span="24">
<el-button-group style="float:right">
<el-button icon="el-icon-plus" @click="New()" />

<el-button icon="el-icon-search" @click="Refresh" />
<el-button icon="el-icon-refresh" @click="ClearOption" />

<el-button class="buttonVisible" :icon="buttonVisible" @click="changeVisible" />
</el-button-group>
</el-col>
</el-row>

</div>

</template>

<script>
export default {
name: 'CommonToolBar',
props:{
optionJson:{
type:Array //展示数据
},
searchArr:{
type:Array //列表配置json
},
},
data() {
return {
buttonVisible: 'el-icon-arrow-down',
SearchType: [
{
label: '等于',
key: '='
},
{
label: '不等于',
key: '<>'
},
{
label: '大于',
key: '>'
},
{
label: '大于等于',
key: '>='
},
{
label: '小于',
key: '<'
},
{
label: '小于等于',
key: '<='
}
],
}
},
methods: {
removeItem(item) {
let index = this.searchArr.indexOf(item)
if (index) {
this.searchArr.splice(index, 1)
}
},
New(){
this.$emit('addEvent')
},
addItem() {
this.searchArr.push({
SearchKey: '',
SearchValue: '',
SearchType: ''
})
},
changeVisible() {
if (this.buttonVisible === 'el-icon-arrow-down') { this.buttonVisible = 'el-icon-arrow-up' } else this.buttonVisible = 'el-icon-arrow-down'
},
filter_search(item) {
return item.filter(item => item.searchable)
},
Refresh(){
this.$emit('searchEvent')
},
ClearOption() {
this.searchArr = [
{
SearchKey: '',
SearchValue: ''
}
]
this.buttonVisible = 'el-icon-arrow-down'
this.$emit('clearEvent')
},
},
}
</script>

<<style lang="scss" scoped>
.searchContainer {
position: absolute;
top: 62px;
left: 20px;
padding: 15px;
min-height: 100px;
z-index: 10;
right: 20px;
background-color: white;
; box-shadow: 0px 0px 10px gray;
}
</style>
6 changes: 1 addition & 5 deletions src/store/modules/permission.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,4 @@ const permission = {
}
}

export default permission


// var => let
//
export default permission
Loading

0 comments on commit ac6a049

Please sign in to comment.