fix(缺陷管理): 修复缺陷管理复制缺陷模板下拉回显bug

This commit is contained in:
xinxin.wu 2024-12-20 18:51:52 +08:00 committed by 刘瑞斌
parent 94dc028725
commit f7355b11ec
2 changed files with 13 additions and 5 deletions

View File

@ -81,7 +81,7 @@
loading.value = true;
const res = await getTemplateOption(appStore.currentProjectId);
templateOption.value = res.map((item) => {
if (item.enableDefault && !isEdit.value) {
if (item.enableDefault && !route.query.id) {
//
bugTemplateId.value = item.id;
}

View File

@ -774,6 +774,7 @@
loading.value = true;
const res = await getBugDetail(bugId.value as string);
const { templateId, attachments } = res;
if (templateId) {
await setTemplateValue(res);
}
@ -855,26 +856,33 @@
return data;
}
const originTemId = ref<string>('');
watch(
() => innerTemplateId.value,
(val) => {
if (val) {
form.value.templateId = val;
if (props.isCopyBug && originTemId.value === val) {
getDetailInfo();
} else {
templateChange(val);
}
},
{
immediate: true,
}
}
);
const { registerCatchSaveShortcut, removeCatchSaveShortcut } = useShortcutSave(() => {
saveHandler();
});
onMounted(async () => {
if (isEditOrCopy.value) {
//
await getDetailInfo();
if (props.isCopyBug) {
originTemId.value = form.value.templateId;
innerTemplateId.value = form.value.templateId;
}
}
registerCatchSaveShortcut();
});