master
loveflow 8 months ago
parent 9bddca975b
commit 9d8e500f53

@ -89,6 +89,11 @@ export default {
selectionChange(item) { selectionChange(item) {
this.$emit("selectionChange", item, this.rowKey); this.$emit("selectionChange", item, this.rowKey);
}, },
//
clearSelection() {
this.$refs.gMainTable.clearSelection();
this.$emit("onClearSelected");
},
}, },
}; };
</script> </script>

@ -4,7 +4,7 @@ export const tableListMixins = {
data() { data() {
return { return {
/* 查询条件 */ /* 查询条件 */
quaryParam: {}, queryParam: {},
/* 数据源 */ /* 数据源 */
dataSource: [], dataSource: [],
/* 分页参数 */ /* 分页参数 */
@ -86,12 +86,16 @@ export const tableListMixins = {
this.selectedRowKeys = []; this.selectedRowKeys = [];
this.selectionRows = []; this.selectionRows = [];
}, },
//查询
searchQuery() { searchQuery() {
this.ipagination.currentPage = 1; this.ipagination.currentPage = 1;
this.loadData(); this.loadData();
this.selectedRowKeys = []; this.onClearSelected();
this.selectionRows = []; },
//重置
searchReset() {
this.queryParam = {};
this.searchQuery();
}, },
}, },
}; };

@ -9,12 +9,16 @@
type="primary" type="primary"
plain plain
v-if="selectedRowKeys.length" v-if="selectedRowKeys.length"
@click="onClearSelected" @click="clearSelection"
> >
清空选择 清空选择
</el-button> </el-button>
<el-input v-model="queryParam.a" placeholder="请输入内容"></el-input>
<el-input v-model="queryParam.b" placeholder="请输入内容"></el-input>
<el-button type="primary" @click="searchQuery"></el-button> <el-button type="primary" @click="searchQuery"></el-button>
<el-button type="primary" plain @click="searchReset"></el-button>
<div style="width: 800px"> <div style="width: 800px">
<gMainTable <gMainTable
@ -119,6 +123,9 @@ export default {
this.$refs.formDialog.openDialog(); this.$refs.formDialog.openDialog();
}, },
dialogSubmit() {}, dialogSubmit() {},
clearSelection() {
this.$refs.gMainTable.clearSelection();
},
}, },
}; };
</script> </script>

Loading…
Cancel
Save