fix: vue 模板删除id重复声明问题修复

This commit is contained in:
ray
2024-09-16 20:13:08 +08:00
parent ef6889857a
commit 7a5f4f13e7

View File

@@ -100,7 +100,7 @@
<el-button
v-hasPerm="['${moduleName}:${lowerFirstEntityName}:delete']"
type="danger"
:disabled="ids.length === 0"
:disabled="removeIds.length === 0"
@click="handleDelete()"
><i-ep-delete />
删除
@@ -254,7 +254,7 @@
const dataFormRef = ref(ElForm);
const loading = ref(false);
const ids = ref<number[]>([]);
const removeIds = ref<number[]>([]);
const total = ref(0);
const queryParams = reactive<${entityName}PageQuery>({
@@ -307,7 +307,7 @@
/** 行复选框选中记录选中ID集合 */
function handleSelectionChange(selection: any) {
ids.value = selection.map((item: any) => item.id);
removeIds.value = selection.map((item: any) => item.id);
}
/** 打开$!{businessName}弹窗 */
@@ -360,7 +360,7 @@
/** 删除$!{businessName} */
function handleDelete(id?: number) {
const ids = [id || ids.value].join(",");
const ids = [id || removeIds.value].join(",");
if (!ids) {
ElMessage.warning("请勾选删除项");
return;