fix(测试用例): 修复用例继续保存成功后显示的新的创建用例页未显示模板内的默认内容&报告style微调

This commit is contained in:
xinxin.wu 2024-08-13 11:52:34 +08:00 committed by 刘瑞斌
parent 21391bd378
commit 579e032de2
4 changed files with 21 additions and 23 deletions

View File

@ -783,8 +783,9 @@
}); });
return data; return data;
} }
//
async function resetForm() { async function resetForm() {
caseFormRef.value?.resetFields();
form.value = { ...initForm, templateId: form.value.templateId }; form.value = { ...initForm, templateId: form.value.templateId };
await initDefaultFields(); await initDefaultFields();
form.value.customFields = formItem.value.map((item: any) => { form.value.customFields = formItem.value.map((item: any) => {
@ -795,16 +796,6 @@
}); });
fileList.value = []; fileList.value = [];
form.value.tags = []; form.value.tags = [];
stepData.value = [
{
id: getGenerateId(),
step: '',
expected: '',
showStep: false,
showExpected: false,
},
];
caseFormRef.value?.resetFields();
} }
const caseId = ref(props.caseId); const caseId = ref(props.caseId);

View File

@ -432,8 +432,9 @@
} }
} }
.config-right-container { .config-right-container {
padding: 16px; padding: 16px 0 16px 16px;
width: calc(100% - 300px); width: calc(100% - 300px);
min-width: 1000px;
background: var(--color-bg-3); background: var(--color-bg-3);
} }
} }

View File

@ -1,12 +1,16 @@
<template> <template>
<div :class="`${hasAnyPermission(['PROJECT_TEST_PLAN_REPORT:READ+UPDATE']) && !shareId ? '' : 'cursor-not-allowed'}`"> <div
:class="`${
hasAnyPermission(['PROJECT_TEST_PLAN_REPORT:READ+UPDATE']) && !shareId ? '' : 'cursor-not-allowed'
} w-full`"
>
<MsRichText <MsRichText
ref="msRichTextRef" ref="msRichTextRef"
v-model:raw="innerSummary.content" v-model:raw="innerSummary.content"
v-model:filedIds="innerSummary.richTextTmpFileIds" v-model:filedIds="innerSummary.richTextTmpFileIds"
:upload-image="handleUploadImage" :upload-image="handleUploadImage"
:preview-url="`${ReportPlanPreviewImageUrl}/${appStore.currentProjectId}`" :preview-url="`${ReportPlanPreviewImageUrl}/${appStore.currentProjectId}`"
class="mt-[8px] w-full" class="mt-[8px]"
:editable="props.canEdit" :editable="props.canEdit"
@click="handleRichClick" @click="handleRichClick"
@update="emit('handleSetSave')" @update="emit('handleSetSave')"

View File

@ -2,7 +2,7 @@
<ReportHeader v-if="!props.isDrawer && props.isPreview" :detail="detail" :share-id="shareId" :is-group="false" /> <ReportHeader v-if="!props.isDrawer && props.isPreview" :detail="detail" :share-id="shareId" :is-group="false" />
<div class="analysis-wrapper" :data-cards="cardCount"> <div class="analysis-wrapper" :data-cards="cardCount">
<SystemTrigger :is-preview="props.isPreview"> <SystemTrigger :is-preview="props.isPreview">
<div :class="`${getAnalysisHover} analysis min-w-[238px]`"> <div :class="`${getAnalysisHover} analysis min-w-[330px]`">
<div class="block-title">{{ t('report.detail.api.reportAnalysis') }}</div> <div class="block-title">{{ t('report.detail.api.reportAnalysis') }}</div>
<ReportMetricsItem <ReportMetricsItem
v-for="analysisItem in reportAnalysisList" v-for="analysisItem in reportAnalysisList"
@ -161,7 +161,7 @@
</a-tooltip> </a-tooltip>
</div> </div>
</div> </div>
<MsCard simple auto-height auto-width> <div class="wrapper-preview-card">
<div v-if="item.value !== ReportCardTypeEnum.CUSTOM_CARD" class="mb-[8px] font-medium"> <div v-if="item.value !== ReportCardTypeEnum.CUSTOM_CARD" class="mb-[8px] font-medium">
{{ t(item.label) }} {{ t(item.label) }}
</div> </div>
@ -226,7 +226,7 @@
@cancel="() => handleCancelCustom(item)" @cancel="() => handleCancelCustom(item)"
@handle-set-save="setIsSave(false)" @handle-set-save="setIsSave(false)"
/> />
</MsCard> </div>
</div> </div>
</VueDraggable> </VueDraggable>
</div> </div>
@ -240,7 +240,6 @@
import { VueDraggable } from 'vue-draggable-plus'; import { VueDraggable } from 'vue-draggable-plus';
import MsChart from '@/components/pure/chart/index.vue'; import MsChart from '@/components/pure/chart/index.vue';
import MsCard from '@/components/pure/ms-card/index.vue';
import SingleStatusProgress from '@/views/test-plan/report/component/singleStatusProgress.vue'; import SingleStatusProgress from '@/views/test-plan/report/component/singleStatusProgress.vue';
import CustomRichText from '@/views/test-plan/report/detail/component/custom-card/customRichText.vue'; import CustomRichText from '@/views/test-plan/report/detail/component/custom-card/customRichText.vue';
import ApiAndScenarioTable from '@/views/test-plan/report/detail/component/system-card/apiAndScenarioTable.vue'; import ApiAndScenarioTable from '@/views/test-plan/report/detail/component/system-card/apiAndScenarioTable.vue';
@ -646,11 +645,6 @@
.block-title { .block-title {
@apply mb-4 font-medium; @apply mb-4 font-medium;
} }
.config-right-container {
padding: 16px;
width: calc(100% - 300px);
background: var(--color-bg-3);
}
.analysis-wrapper { .analysis-wrapper {
@apply mb-4 grid items-center gap-4; @apply mb-4 grid items-center gap-4;
.analysis { .analysis {
@ -695,6 +689,7 @@
.drag-container { .drag-container {
.card-item { .card-item {
position: relative; position: relative;
width: 100%;
border: 1px solid transparent; border: 1px solid transparent;
border-radius: 12px; border-radius: 12px;
.action { .action {
@ -727,4 +722,11 @@
background: var(--color-text-n9); background: var(--color-text-n9);
} }
} }
.wrapper-preview-card {
display: flex;
padding: 16px;
border-radius: 12px;
box-shadow: 0 0 10px rgb(120 56 135 / 5%);
@apply flex-col bg-white;
}
</style> </style>