fix(测试用例): 修复创建用例保存并继续步骤信息未继承模板默认值

This commit is contained in:
xinxin.wu 2024-10-31 11:37:24 +08:00 committed by 刘瑞斌
parent 4c6c1e69eb
commit 23e23d1392
1 changed files with 10 additions and 9 deletions

View File

@ -318,16 +318,16 @@
const formRef = ref<FormInstance>(); const formRef = ref<FormInstance>();
const caseFormRef = ref<FormInstance>(); const caseFormRef = ref<FormInstance>();
const initStepData: StepList = {
id: getGenerateId(),
step: '',
expected: '',
showStep: false,
showExpected: false,
};
// //
const stepData = ref<StepList[]>([ const stepData = ref<StepList[]>([{ ...initStepData }]);
{
id: getGenerateId(),
step: '',
expected: '',
showStep: false,
showExpected: false,
},
]);
const featureCaseStore = useFeatureCaseStore(); const featureCaseStore = useFeatureCaseStore();
const modelId = computed(() => featureCaseStore.moduleId[0] || 'root'); const modelId = computed(() => featureCaseStore.moduleId[0] || 'root');
@ -778,6 +778,7 @@
async function resetForm() { async function resetForm() {
caseFormRef.value?.resetFields(); caseFormRef.value?.resetFields();
form.value = { ...initForm, templateId: form.value.templateId }; form.value = { ...initForm, templateId: form.value.templateId };
stepData.value = [{ ...initStepData }];
await initDefaultFields(); await initDefaultFields();
form.value.customFields = formItem.value.map((item: any) => { form.value.customFields = formItem.value.map((item: any) => {
return { return {