feat: 初始化表单数据,重置功能完善

This commit is contained in:
zhanghao 2026-08-26 14:52:39 +08:00
parent 4a81782825
commit 9070333bbc

View File

@ -187,10 +187,17 @@ const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const createEmptyForm = () => ({
caseName: "",
expectedResult: "",
precondition: "",
testSteps: "",
testDescription: ""
});
const data = reactive({
form: {},
form: createEmptyForm(),
queryParams: {
pageNum: 1,
pageSize: 10,
@ -283,7 +290,8 @@ function handleStatusChange(row) {
}
const reset = () => {
testCaseRef.value.resetFields()
testCaseRef.value?.resetFields()
form.value = createEmptyForm()
};
const testCaseRef = ref()
@ -291,6 +299,7 @@ const isNew = ref(true)
/** 添加 */
function handleAdd() {
reset();
open.value = true;
isNew.value = true
title.value = "添加";