fix(缺陷管理): 修复缺陷管理复制缺陷模板下拉回显bug
This commit is contained in:
parent
94dc028725
commit
f7355b11ec
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue