This commit is contained in:
yanran200730
2023-04-17 17:34:53 +08:00

View File

@@ -7,6 +7,7 @@
<el-table-column slot="resident" class="ai-table__header"> <el-table-column slot="resident" class="ai-table__header">
<template #header> <template #header>
<b v-text="tableTitle"/> <b v-text="tableTitle"/>
<el-button type="text" @click="handleSelectAll">全选</el-button>
<el-input class="fill searchbar" v-model="search[searchKey]" size="small" placeholder="搜索" clearable <el-input class="fill searchbar" v-model="search[searchKey]" size="small" placeholder="搜索" clearable
@change="page.current=1,getTableData()"/> @change="page.current=1,getTableData()"/>
</template> </template>
@@ -26,6 +27,7 @@
<el-table-column slot="resident"> <el-table-column slot="resident">
<template #header> <template #header>
<b v-text="tableTitle"/> <b v-text="tableTitle"/>
<el-button type="text" @click="handleSelectAll">全选</el-button>
<el-input class="fill searchbar" v-model="search[searchKey]" size="small" placeholder="搜索" clearable <el-input class="fill searchbar" v-model="search[searchKey]" size="small" placeholder="搜索" clearable
@change="page.current=1,getTableData()"/> @change="page.current=1,getTableData()"/>
</template> </template>
@@ -180,6 +182,9 @@ export default {
let {nodeKey} = this let {nodeKey} = this
return this.selected?.findIndex(e => e[nodeKey] == item[nodeKey]) return this.selected?.findIndex(e => e[nodeKey] == item[nodeKey])
}, },
handleSelectAll() {
this.selected = this.$copy(this.tableData)
}
}, },
created() { created() {
this.$set(this.search, this.searchKey, "") this.$set(this.search, this.searchKey, "")
@@ -191,7 +196,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
:deep(.AiTableSelect){ :deep(.AiTableSelect) {
.el-row { .el-row {
width: 100%; width: 100%;
@@ -231,6 +236,7 @@ export default {
} }
} }
:deep(.ai-table__header) { :deep(.ai-table__header) {
& > .cell { & > .cell {
display: flex !important; display: flex !important;
@@ -238,6 +244,7 @@ export default {
justify-content: space-between !important; justify-content: space-between !important;
} }
} }
:deep(.ai-table .el-table__header tr th:first-child .cell) { :deep(.ai-table .el-table__header tr th:first-child .cell) {
padding-left: 20px !important; padding-left: 20px !important;
} }