|
@@ -2,13 +2,15 @@
|
|
|
<div>
|
|
|
<el-dialog :visible.sync="visible" append-to-body width="900px">
|
|
|
<div class="flex-align-center flex-between mt-10">
|
|
|
- <el-input style="width:200px;" placeholder="搜索"
|
|
|
- :suffix-icon="search?search.length > 0?'':'':'el-icon-search'"
|
|
|
- v-model="search"
|
|
|
- @keyup.native.enter="searchQuery"
|
|
|
- @clear="searchQuery"
|
|
|
- size="small" class="input-with-select inline-16 layout_search__panel" clearable>
|
|
|
- </el-input>
|
|
|
+ <el-input
|
|
|
+ style="width:200px"
|
|
|
+ size="small"
|
|
|
+ suffix-icon="el-icon-search"
|
|
|
+ placeholder="搜索"
|
|
|
+ @input="valueChange"
|
|
|
+ v-model="condition"
|
|
|
+ @keyup.enter.native="listData(customParam ? customParam.content.pageNumber = 1 : param.content.pageNumber = 1)"
|
|
|
+ @clear="listData(customParam ? customParam.content.pageNumber = 1 : param.content.pageNumber = 1)" clearable></el-input>
|
|
|
</div>
|
|
|
<div>
|
|
|
<el-table
|
|
@@ -60,11 +62,10 @@
|
|
|
<el-pagination
|
|
|
background
|
|
|
small
|
|
|
- @size-change="handleSizeChange"
|
|
|
@current-change="handleCurrentChange"
|
|
|
- :current-page="currentPage"
|
|
|
- :page-size="param.content.pageSize"
|
|
|
- layout="total, prev, pager, next, jumper"
|
|
|
+ :current-page="customParam ? customParam.content.pageNumber : param.content.pageNumber"
|
|
|
+ :page-size="customParam ? customParam.content.pageSize : param.content.pageSize"
|
|
|
+ layout="total, pager, next, jumper"
|
|
|
:total="total">
|
|
|
</el-pagination>
|
|
|
</div>
|
|
@@ -93,7 +94,8 @@ export default {
|
|
|
tableData: [],
|
|
|
total:0,
|
|
|
currentPage:0,
|
|
|
- search:''
|
|
|
+ search:'',
|
|
|
+ condition:''
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
@@ -105,30 +107,36 @@ export default {
|
|
|
console.log(this.tableData);
|
|
|
|
|
|
},
|
|
|
- handleSizeChange(val) {
|
|
|
- // console.log(`每页 ${val} 条`);
|
|
|
- this.param.content.pageSize = val
|
|
|
- this.listData()
|
|
|
+ valueChange (data) {
|
|
|
+ console.log(data);
|
|
|
+ if (this.customParam) {
|
|
|
+ this.customParam.content.where.condition = data
|
|
|
+ } else {
|
|
|
+ this.param.content.where.condition = data
|
|
|
+ }
|
|
|
},
|
|
|
handleCurrentChange(val) {
|
|
|
// console.log(`当前页: ${val}`);
|
|
|
- this.param.content.pageNumber = val
|
|
|
+ if (this.customParam) {
|
|
|
+ this.customParam.content.pageNumber = val
|
|
|
+ } else {
|
|
|
+ this.param.content.pageNumber = val
|
|
|
+ }
|
|
|
this.listData()
|
|
|
},
|
|
|
selectRow (row) {
|
|
|
this.$emit('selectRow',row)
|
|
|
},
|
|
|
- searchQuery(){
|
|
|
- /*this.customParam.content.where.condition = this.search*/
|
|
|
- this.param.content.where.condition = this.search
|
|
|
- this.listData()
|
|
|
- }
|
|
|
+ // searchQuery(){
|
|
|
+ // /*this.customParam.content.where.condition = this.search*/
|
|
|
+ // this.param.content.where.condition = this.search
|
|
|
+ // this.listData()
|
|
|
+ // }
|
|
|
},
|
|
|
mounted() {
|
|
|
this.listData()
|
|
|
},
|
|
|
created () {
|
|
|
- this.listData()
|
|
|
},
|
|
|
}
|
|
|
|