|
|
@ -172,18 +172,22 @@ const selections = ref([]) |
|
|
|
// const selections = computed(()=>mData.value.filter(item=>item.checked)) |
|
|
|
// 切换全选/不全选 |
|
|
|
const toggleAllSelection = (isAll)=>{ |
|
|
|
mData.value.forEach((row) => { |
|
|
|
row.checked = isAll |
|
|
|
}) |
|
|
|
//全选 |
|
|
|
selections.value = selections.value.filter(item=>mData.value.findIndex(item1=>item1.id==item.id)==-1) |
|
|
|
if(isAll){ |
|
|
|
//全选 |
|
|
|
mData.value.forEach((row) => { |
|
|
|
row.checked = isAll |
|
|
|
}) |
|
|
|
selections.value = [...selections.value,...mData.value] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const togglePageSelection = (isAll)=>{ |
|
|
|
selections.value = selections.value.filter(item=>mData.value.findIndex(item1=>item1.id==item.id)==-1) |
|
|
|
mData.value.forEach((row) => { |
|
|
|
row.checked = !row.checked |
|
|
|
}) |
|
|
|
selections.value = [...selections.value,...mData.value.filter(item=>item.checked)] |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|