fix(测试计划): 修复测试计划报告初次上来禁用恢复默认

This commit is contained in:
xinxin.wu 2024-07-12 18:34:58 +08:00 committed by Craftsman
parent 949ede28f7
commit 1f5aca029f
1 changed files with 11 additions and 6 deletions

View File

@ -273,19 +273,24 @@
}; };
}); });
} }
const isInit = ref(true);
watch( watch(
[() => configList.value, () => cardItemList.value], [() => configList.value, () => cardItemList.value],
() => { () => {
const configValue = resetConfigEditList(configList.value); const configValue = resetConfigEditList(cloneDeep(configList.value));
const cardItemValue = resetConfigEditList(cardItemList.value); const cardItemValue = resetConfigEditList(cloneDeep(cardItemList.value));
const isisEqualList = props.isGroup ? cloneDeep(defaultGroupConfig) : cloneDeep(defaultSingleConfig); const isisEqualList = props.isGroup ? cloneDeep(defaultGroupConfig) : cloneDeep(defaultSingleConfig);
if (!isEqual(configValue, isisEqualList) || !isEqual(cardItemValue, isisEqualList)) { if (!isEqual(configValue, isisEqualList) || (!isEqual(cardItemValue, isisEqualList) && !isInit.value)) {
if (isInit.value) {
isInit.value = false;
} else {
nextTick(() => { nextTick(() => {
hasChange.value = true; hasChange.value = true;
}); });
} }
}
}, },
{ deep: true } { deep: true }
); );