-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
220 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,8 +64,4 @@ const permission = { | |
} | ||
} | ||
|
||
export default permission | ||
|
||
|
||
// var => let | ||
// | ||
export default permission |
Oops, something went wrong.