fix: 代码生成批量删除相关 setCheckedIds -> handleRowCheckboxChange、deleteIds -> checkedIds 然后注释去掉
This commit is contained in:
@@ -122,7 +122,7 @@ async function onDeleteBatch() {
|
||||
key: 'action_process_msg',
|
||||
});
|
||||
try {
|
||||
await deleteDemo01ContactList(deleteIds.value);
|
||||
await deleteDemo01ContactList(checkedIds.value);
|
||||
message.success($t('ui.actionMessage.deleteSuccess'));
|
||||
await getList();
|
||||
} finally {
|
||||
@@ -130,13 +130,13 @@ async function onDeleteBatch() {
|
||||
}
|
||||
}
|
||||
|
||||
const deleteIds = ref<number[]>([]); // 待删除示例联系人 ID
|
||||
function setDeleteIds({
|
||||
const checkedIds = ref<number[]>([]);
|
||||
function handleRowCheckboxChange({
|
||||
records,
|
||||
}: {
|
||||
records: Demo01ContactApi.Demo01Contact[];
|
||||
}) {
|
||||
deleteIds.value = records.map((item) => item.id);
|
||||
checkedIds.value = records.map((item) => item.id);
|
||||
}
|
||||
|
||||
/** 导出表格 */
|
||||
@@ -241,7 +241,7 @@ onMounted(() => {
|
||||
type="primary"
|
||||
danger
|
||||
class="ml-2"
|
||||
:disabled="isEmpty(deleteIds)"
|
||||
:disabled="isEmpty(checkedIds)"
|
||||
@click="onDeleteBatch"
|
||||
v-access:code="['infra:demo01-contact:delete']"
|
||||
>
|
||||
@@ -254,8 +254,8 @@ onMounted(() => {
|
||||
:data="list"
|
||||
show-overflow
|
||||
:loading="loading"
|
||||
@checkbox-all="setDeleteIds"
|
||||
@checkbox-change="setDeleteIds"
|
||||
@checkbox-all="handleRowCheckboxChange"
|
||||
@checkbox-change="handleRowCheckboxChange"
|
||||
>
|
||||
<VxeColumn type="checkbox" width="40" />
|
||||
<VxeColumn field="id" title="编号" align="center" />
|
||||
|
||||
Reference in New Issue
Block a user