fix(缺陷管理): 修复缺陷管理复制缺陷模板下拉回显bug
This commit is contained in:
parent
94dc028725
commit
f7355b11ec
|
@ -81,7 +81,7 @@
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const res = await getTemplateOption(appStore.currentProjectId);
|
const res = await getTemplateOption(appStore.currentProjectId);
|
||||||
templateOption.value = res.map((item) => {
|
templateOption.value = res.map((item) => {
|
||||||
if (item.enableDefault && !isEdit.value) {
|
if (item.enableDefault && !route.query.id) {
|
||||||
// 选中默认模板
|
// 选中默认模板
|
||||||
bugTemplateId.value = item.id;
|
bugTemplateId.value = item.id;
|
||||||
}
|
}
|
||||||
|
|
|
@ -774,6 +774,7 @@
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const res = await getBugDetail(bugId.value as string);
|
const res = await getBugDetail(bugId.value as string);
|
||||||
const { templateId, attachments } = res;
|
const { templateId, attachments } = res;
|
||||||
|
|
||||||
if (templateId) {
|
if (templateId) {
|
||||||
await setTemplateValue(res);
|
await setTemplateValue(res);
|
||||||
}
|
}
|
||||||
|
@ -855,26 +856,33 @@
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const originTemId = ref<string>('');
|
||||||
watch(
|
watch(
|
||||||
() => innerTemplateId.value,
|
() => innerTemplateId.value,
|
||||||
(val) => {
|
(val) => {
|
||||||
if (val) {
|
if (val) {
|
||||||
form.value.templateId = val;
|
form.value.templateId = val;
|
||||||
templateChange(val);
|
if (props.isCopyBug && originTemId.value === val) {
|
||||||
|
getDetailInfo();
|
||||||
|
} else {
|
||||||
|
templateChange(val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
immediate: true,
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const { registerCatchSaveShortcut, removeCatchSaveShortcut } = useShortcutSave(() => {
|
const { registerCatchSaveShortcut, removeCatchSaveShortcut } = useShortcutSave(() => {
|
||||||
saveHandler();
|
saveHandler();
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
if (isEditOrCopy.value) {
|
if (isEditOrCopy.value) {
|
||||||
// 获取详情
|
// 获取详情
|
||||||
await getDetailInfo();
|
await getDetailInfo();
|
||||||
|
if (props.isCopyBug) {
|
||||||
|
originTemId.value = form.value.templateId;
|
||||||
|
innerTemplateId.value = form.value.templateId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
registerCatchSaveShortcut();
|
registerCatchSaveShortcut();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue