新增DropdownTable组件

This commit is contained in:
aoshiguchen
2022-09-01 22:55:30 +08:00
parent de6d70cbb3
commit de96b8937a
@@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<el-popover v-model="popVisible" width="700" trigger="click" placement="bottom"> <el-popover v-model="popVisible" :width="width" trigger="click" placement="bottom">
<div> <div>
<FBATable <FBATable
ref="countryTableRef" ref="countryTableRef"
@@ -10,7 +10,7 @@
@rowClick="handleRowClick" @rowClick="handleRowClick"
></FBATable> ></FBATable>
</div> </div>
<el-input v-model="keyWords" :placeholder="placeholder" slot="reference"/> <el-input v-model="name" :placeholder="placeholder" slot="reference"/>
</el-popover> </el-popover>
</div> </div>
</template> </template>
@@ -22,6 +22,10 @@
type: String, type: String,
default: '' default: ''
}, },
width: {
type: Number,
default: 700
},
placeholder: { placeholder: {
type: String, type: String,
default: '请选择' default: '请选择'
@@ -36,11 +40,6 @@
}, },
data() { data() {
return { return {
pagination: {
TotalCount: 0,
PageIndex: 1,
PageSize: 10
},
countryColumns: [ countryColumns: [
{ {
prop: 'NameCn', prop: 'NameCn',
@@ -64,35 +63,15 @@
} }
], ],
popVisible: false, popVisible: false,
selected: [],
timer: null timer: null
} }
}, },
created() {},
computed: {
keyWords: {
get() {
return this.name
},
set(val) {
this.$emit('update:name', val)
}
}
},
methods: { methods: {
handleRowClick(val) { handleRowClick(val) {
this.$emit('selectedData', val) this.$emit('selectedData', val)
this.timer = setTimeout(() => { this.timer = setTimeout(() => {
this.popVisible = false this.popVisible = false
}, 200) }, 200)
},
handleSizeChange(val) {
this.pagination.PageSize = val
this.getList()
},
handleCurrentChange(val) {
this.pagination.PageIndex = val
this.getList()
} }
}, },
destroyed() { destroyed() {