feat: 防止JSON.parse出错

This commit is contained in:
zhanghao 2026-03-10 17:00:16 +08:00
parent a7671691c0
commit 243d0a60c4

View File

@ -546,7 +546,11 @@ const handleUpdate = (row) => {
isAdd.value = false; isAdd.value = false;
title.value = "修改测试项目"; title.value = "修改测试项目";
form.value = row; form.value = row;
form.value.testFuncIds = JSON.parse(form.value.testFuncIds); const arr = []
try {
arr = JSON.parse(form.value.testFuncIds);
} catch {}
form.value.testFuncIds = arr
getFuncList(form.value.vehicleConfigId) getFuncList(form.value.vehicleConfigId)
}; };
@ -616,7 +620,12 @@ const handleExecute = (row) => {
executeOpen.value = true; executeOpen.value = true;
executeProjectId.value = row.projectId; executeProjectId.value = row.projectId;
// //
functionIds.value = JSON.parse(row.testFuncIds) const arr = []
try {
arr = JSON.parse(form.value.testFuncIds);
} catch {}
form.value.testFuncIds = arr
functionIds.value = arr
} }
const router = useRouter() const router = useRouter()