需求清单---增删改查

master
xce 2026-01-14 00:51:04 +08:00
parent e6dd93498f
commit 63d0355c27
1 changed files with 5 additions and 0 deletions

View File

@ -265,6 +265,7 @@ export default {
pageSize: 10
},
loading: false,
selectIds:[],
selectedIndexs: [], //
//
dialogType: 'add', // add- edit-
@ -294,6 +295,7 @@ export default {
methods: {
//
selectedItems() {
this.selectIds = this.selectedIndexs.map(i => this.tableData[i].id);
return this.selectedIndexs.map(i => this.tableData[i])
},
// selection-change
@ -318,6 +320,9 @@ export default {
// ========== ==========
//
batchDel() {
const data = this.tableData.filter(item => !this.selectIds.includes(item.id));
console.info(`${this.selectIds}选中的数据:${JSON.stringify(data)} `)
// todo bug
const selectedItems = this.selectedItems()
if (selectedItems.length === 0) {
uni.showToast({ title: '请选择要删除的数据', icon: 'none' })