fix: 代码生成批量删除相关 setCheckedIds -> handleRowCheckboxChange、deleteIds -> checkedIds 然后注释去掉

This commit is contained in:
puhui999
2025-06-06 16:03:13 +08:00
parent 2c9032e595
commit 2abe2e21bc
12 changed files with 81 additions and 83 deletions

View File

@@ -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" />