perf: 使用 modalApi.unlock() 替换 modalApi.lock(false)

This commit is contained in:
xingyu4j
2025-04-29 22:29:03 +08:00
parent 84584a6fd9
commit 0dacc08c2b
52 changed files with 90 additions and 91 deletions

View File

@@ -59,7 +59,7 @@ const [Modal, modalApi] = useVbenModal({
key: 'action_process_msg',
});
} finally {
modalApi.lock(false);
modalApi.unlock();
}
},
async onOpenChange(isOpen: boolean) {
@@ -78,7 +78,7 @@ const [Modal, modalApi] = useVbenModal({
try {
data = await getDemo01Contact(data.id);
} finally {
modalApi.lock(false);
modalApi.unlock();
}
}
// 设置到 values

View File

@@ -65,7 +65,7 @@ const [Modal, modalApi] = useVbenModal({
key: 'action_process_msg',
});
} finally {
modalApi.lock(false);
modalApi.unlock();
}
},
async onOpenChange(isOpen: boolean) {
@@ -86,7 +86,7 @@ const [Modal, modalApi] = useVbenModal({
try {
data = await getDemo02Category(data.id);
} finally {
modalApi.lock(false);
modalApi.unlock();
}
}
// 设置到 values

View File

@@ -61,7 +61,7 @@ const [Modal, modalApi] = useVbenModal({
key: 'action_process_msg',
});
} finally {
modalApi.lock(false);
modalApi.unlock();
}
},
async onOpenChange(isOpen: boolean) {
@@ -80,7 +80,7 @@ const [Modal, modalApi] = useVbenModal({
try {
data = await getDemo03Course(data.id);
} finally {
modalApi.lock(false);
modalApi.unlock();
}
}
// 设置到 values

View File

@@ -61,7 +61,7 @@ const [Modal, modalApi] = useVbenModal({
key: 'action_process_msg',
});
} finally {
modalApi.lock(false);
modalApi.unlock();
}
},
async onOpenChange(isOpen: boolean) {
@@ -80,7 +80,7 @@ const [Modal, modalApi] = useVbenModal({
try {
data = await getDemo03Grade(data.id);
} finally {
modalApi.lock(false);
modalApi.unlock();
}
}
// 设置到 values

View File

@@ -59,7 +59,7 @@ const [Modal, modalApi] = useVbenModal({
key: 'action_process_msg',
});
} finally {
modalApi.lock(false);
modalApi.unlock();
}
},
async onOpenChange(isOpen: boolean) {
@@ -78,7 +78,7 @@ const [Modal, modalApi] = useVbenModal({
try {
data = await getDemo03Student(data.id);
} finally {
modalApi.lock(false);
modalApi.unlock();
}
}
// 设置到 values

View File

@@ -61,9 +61,8 @@ const [Modal, modalApi] = useVbenModal({
// 提交表单
const data = (await formApi.getValues()) as Demo03StudentApi.Demo03Student;
// 拼接子表的数据
// TODO @puhui999字段对不上
data.demo03Courses = demo03CourseFormRef.value?.getData();
data.demo03Grade = await demo03GradeFormRef.value?.getValues();
data.demo03courses = demo03CourseFormRef.value?.getData();
data.demo03grade = await demo03GradeFormRef.value?.getValues();
try {
await (formData.value?.id
? updateDemo03Student(data)
@@ -76,7 +75,7 @@ const [Modal, modalApi] = useVbenModal({
key: 'action_process_msg',
});
} finally {
modalApi.lock(false);
modalApi.unlock();
}
},
async onOpenChange(isOpen: boolean) {
@@ -95,7 +94,7 @@ const [Modal, modalApi] = useVbenModal({
try {
data = await getDemo03Student(data.id);
} finally {
modalApi.lock(false);
modalApi.unlock();
}
}
// 设置到 values

View File

@@ -61,8 +61,8 @@ const [Modal, modalApi] = useVbenModal({
// 提交表单
const data = (await formApi.getValues()) as Demo03StudentApi.Demo03Student;
// 拼接子表的数据
data.demo03Courses = demo03CourseFormRef.value?.getData();
data.demo03Grade = await demo03GradeFormRef.value?.getValues();
data.demo03courses = demo03CourseFormRef.value?.getData();
data.demo03grade = await demo03GradeFormRef.value?.getValues();
try {
await (formData.value?.id
? updateDemo03Student(data)
@@ -75,7 +75,7 @@ const [Modal, modalApi] = useVbenModal({
key: 'action_process_msg',
});
} finally {
modalApi.lock(false);
modalApi.unlock();
}
},
async onOpenChange(isOpen: boolean) {
@@ -94,7 +94,7 @@ const [Modal, modalApi] = useVbenModal({
try {
data = await getDemo03Student(data.id);
} finally {
modalApi.lock(false);
modalApi.unlock();
}
}
// 设置到 values

View File

@@ -82,7 +82,7 @@ const [Modal, modalApi] = useVbenModal({
key: 'action_process_msg',
});
} finally {
modalApi.lock(false);
modalApi.unlock();
}
},
async onOpenChange(isOpen: boolean) {
@@ -101,7 +101,7 @@ const [Modal, modalApi] = useVbenModal({
try {
data = await getDemo01Contact(data.id);
} finally {
modalApi.lock(false);
modalApi.unlock();
}
}
formData.value = data;