Commit c4d9cd06 authored by 刘怀志's avatar 刘怀志

全选反选

parent 2fa69f83
...@@ -508,11 +508,28 @@ export default { ...@@ -508,11 +508,28 @@ export default {
}, },
// 表格当前手动勾选的 // 表格当前手动勾选的
selectChange(selection, row) { selectChange(selection, row) {
selection.forEach(item => { // 选中行是没有则将当前list里面的数据从ids里情况
if (!this.ids.some(idItem => idItem === item.id)) { if (selection.length === 0) {
this.ids.push(item.id) const temp = this.registerList.map(item => {
return item.id
})
this.ids = this.ids.filter(item => {
return !temp.includes(item)
})
} else {
// 遍历当前页选中行如果没有的就加上
selection.forEach(item => {
if (!this.ids.some(idItem => idItem === item.id)) {
this.ids.push(item.id)
}
})
// 判断选中行是不是被勾掉了
if (row && !selection.some(item => item.id === row.id)) {
this.ids = this.ids.filter(item => {
return item !== row.id
})
} }
}) }
}, },
/** 功能按钮--导出按钮操作 */ /** 功能按钮--导出按钮操作 */
handleExport() { handleExport() {
...@@ -522,6 +539,7 @@ export default { ...@@ -522,6 +539,7 @@ export default {
this.download('business/register/export', exportTable, `挂号管理-${this.exportFormatTime(new Date())}.xlsx`) this.download('business/register/export', exportTable, `挂号管理-${this.exportFormatTime(new Date())}.xlsx`)
.then(res => { .then(res => {
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
this.ids = []
}) })
} else { } else {
this.$modal.msgWarning('请选择至少一条数据导出') this.$modal.msgWarning('请选择至少一条数据导出')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment