fix(测试计划): 修复测试计划报告预览初始化不正确紧急bug

This commit is contained in:
xinxin.wu 2024-07-16 15:08:06 +08:00 committed by 刘瑞斌
parent 0f0fe1ebae
commit 5bd094d3a8
6 changed files with 56 additions and 25 deletions

View File

@ -41,6 +41,11 @@ export default mergeConfig(
changeOrigin: true,
rewrite: (path: string) => path.replace(/^\/front\/bug\/attachment/, ''),
},
'/test-plan/report': {
target: process.env.VITE_DEV_DOMAIN,
changeOrigin: true,
rewrite: (path: string) => path.replace(/^\/front\/test-plan\/report/, ''),
},
'/plugin/image': {
target: process.env.VITE_DEV_DOMAIN,
changeOrigin: true,

View File

@ -21,6 +21,7 @@
v-model:raw="innerTextForm.content"
v-model:filedIds="innerTextForm.richTextTmpFileIds"
:upload-image="handleUploadImage"
:preview-url="ReportPlanPreviewImageUrl"
class="mt-[8px] w-full"
:editable="props.canEdit"
@click="handleClick"
@ -41,6 +42,7 @@
import MsRichText from '@/components/pure/ms-rich-text/MsRichText.vue';
import { editorUploadFile } from '@/api/modules/test-plan/report';
import { ReportPlanPreviewImageUrl } from '@/api/requrls/test-plan/report';
import useDoubleClick from '@/hooks/useDoubleClick';
import { useI18n } from '@/hooks/useI18n';
import { hasAnyPermission } from '@/utils/permission';

View File

@ -186,12 +186,18 @@
}
}
onMounted(() => {
if (props.reportId && props.isPreview) {
currentCaseTable.value.resetPagination();
loadCaseList();
} else {
currentCaseTable.value.propsRes.value.data = detailTableExample[props.activeType];
watch(
[() => props.reportId, () => props.isPreview],
() => {
if (props.reportId && props.isPreview) {
currentCaseTable.value.resetPagination();
loadCaseList();
} else {
currentCaseTable.value.propsRes.value.data = detailTableExample[props.activeType];
}
},
{
immediate: true,
}
});
);
</script>

View File

@ -84,11 +84,17 @@
loadList();
}
onMounted(() => {
if (props.reportId && props.isPreview) {
loadCaseList();
} else {
propsRes.value.data = detailTableExample[ReportCardTypeEnum.BUG_DETAIL];
watch(
[() => props.reportId, () => props.isPreview],
() => {
if (props.reportId && props.isPreview) {
loadCaseList();
} else {
propsRes.value.data = detailTableExample[ReportCardTypeEnum.BUG_DETAIL];
}
},
{
immediate: true,
}
});
);
</script>

View File

@ -163,13 +163,19 @@
loadList();
}
onMounted(() => {
if (props.reportId && props.isPreview) {
loadCaseList();
} else {
propsRes.value.data = detailTableExample[ReportCardTypeEnum.FUNCTIONAL_DETAIL];
watch(
[() => props.reportId, () => props.isPreview],
() => {
if (props.reportId && props.isPreview) {
loadCaseList();
} else {
propsRes.value.data = detailTableExample[ReportCardTypeEnum.FUNCTIONAL_DETAIL];
}
},
{
immediate: true,
}
});
);
const showDetailVisible = ref<boolean>(false);

View File

@ -143,13 +143,19 @@
loadList();
}
onMounted(() => {
if (props.reportId && props.isPreview) {
loadReportDetailList();
} else {
propsRes.value.data = detailTableExample[ReportCardTypeEnum.SUB_PLAN_DETAIL];
watch(
[() => props.reportId, () => props.isPreview],
() => {
if (props.reportId && props.isPreview) {
loadReportDetailList();
} else {
propsRes.value.data = detailTableExample[ReportCardTypeEnum.SUB_PLAN_DETAIL];
}
},
{
immediate: true,
}
});
);
const reportVisible = ref(false);