fix(测试用例): 修复用例步骤描述文本选择与表单重叠覆盖

This commit is contained in:
xinxin.wu 2024-08-13 14:53:56 +08:00 committed by Craftsman
parent 595590b1b0
commit a9f6679319
5 changed files with 99 additions and 113 deletions

View File

@ -122,7 +122,7 @@
<template #default="{ detail, loading }"> <template #default="{ detail, loading }">
<div ref="wrapperRef" class="bg-white"> <div ref="wrapperRef" class="bg-white">
<div class="header relative h-[48px] border-b pl-2"> <div class="header relative h-[48px] border-b pl-2">
<div class="max-w-[calc(100%-72px)]"> <div class="max-w-[calc(100%-100px)]">
<MsTab <MsTab
v-model:active-key="activeTab" v-model:active-key="activeTab"
:content-tab-list="tabSetting" :content-tab-list="tabSetting"
@ -683,6 +683,7 @@
right: 16px; right: 16px;
height: 48px; height: 48px;
line-height: 48px; line-height: 48px;
@apply bg-white;
} }
:deep(.arco-menu-light) { :deep(.arco-menu-light) {
height: 50px; height: 50px;

View File

@ -24,42 +24,19 @@
:preview-url="`${PreviewEditorImageUrl}/${currentProjectId}`" :preview-url="`${PreviewEditorImageUrl}/${currentProjectId}`"
/> />
</a-form-item> </a-form-item>
<a-form-item <StepDescription v-model:caseEditType="form.caseEditType" />
field="step" <div v-if="form.caseEditType === 'STEP'" class="mb-[20px] w-full">
:label=" <AddStep v-model:step-list="stepData" :is-disabled="false" />
form.caseEditType === 'STEP' </div>
? t('system.orgTemplate.stepDescription') <!-- 文本描述 -->
: t('system.orgTemplate.textDescription') <MsRichText
" v-else
class="relative" v-model:raw="form.textDescription"
> v-model:filed-ids="textDescriptionFileIds"
<div class="absolute left-16 top-0"> class="mb-[20px]"
<a-divider direction="vertical" /> :upload-image="handleUploadImage"
<a-dropdown :popup-max-height="false" @select="handleSelectType"> :preview-url="`${PreviewEditorImageUrl}/${currentProjectId}`"
<span class="changeType">{{ t('system.orgTemplate.changeType') }} <icon-down /></span> />
<template #content>
<a-doption value="STEP" :class="getSelectTypeClass('STEP')">
{{ t('system.orgTemplate.stepDescription') }}</a-doption
>
<a-doption value="TEXT" :class="getSelectTypeClass('TEXT')">{{
t('system.orgTemplate.textDescription')
}}</a-doption>
</template>
</a-dropdown>
</div>
<!-- 步骤描述 -->
<div v-if="form.caseEditType === 'STEP'" class="w-full">
<AddStep v-model:step-list="stepData" :is-disabled="false" />
</div>
<!-- 文本描述 -->
<MsRichText
v-else
v-model:raw="form.textDescription"
v-model:filed-ids="textDescriptionFileIds"
:upload-image="handleUploadImage"
:preview-url="`${PreviewEditorImageUrl}/${currentProjectId}`"
/>
</a-form-item>
<a-form-item <a-form-item
v-if="form.caseEditType === 'TEXT'" v-if="form.caseEditType === 'TEXT'"
field="remark" field="remark"
@ -269,6 +246,7 @@
import SaveAsFilePopover from '@/components/business/ms-add-attachment/saveAsFilePopover.vue'; import SaveAsFilePopover from '@/components/business/ms-add-attachment/saveAsFilePopover.vue';
import LinkFileDrawer from '@/components/business/ms-link-file/associatedFileDrawer.vue'; import LinkFileDrawer from '@/components/business/ms-link-file/associatedFileDrawer.vue';
import AddStep from './addStep.vue'; import AddStep from './addStep.vue';
import StepDescription from '@/views/case-management/caseManagementFeature/components/tabContent/stepDescription.vue';
import { import {
checkFileIsUpdateRequest, checkFileIsUpdateRequest,

View File

@ -0,0 +1,49 @@
<template>
<div class="mb-[16px] flex items-center">
<div class="font-bold text-[var(--color-text-1)]">
{{
innerCaseEditType === 'STEP' ? t('system.orgTemplate.stepDescription') : t('system.orgTemplate.textDescription')
}}
</div>
<div v-if="!props.isTestPlan" class="font-normal">
<a-divider direction="vertical" />
<a-dropdown :popup-max-height="false" @select="handleSelectType">
<span class="changeType">{{ t('system.orgTemplate.changeType') }} <icon-down /></span>
<template #content>
<a-doption value="STEP" :class="getSelectTypeClass('STEP')">
{{ t('system.orgTemplate.stepDescription') }}
</a-doption>
<a-doption value="TEXT" :class="getSelectTypeClass('TEXT')">
{{ t('system.orgTemplate.textDescription') }}
</a-doption>
</template>
</a-dropdown>
</div>
</div>
</template>
<script setup lang="ts">
import { useI18n } from '@/hooks/useI18n';
const { t } = useI18n();
const props = defineProps<{
isTestPlan?: boolean;
}>();
const innerCaseEditType = defineModel<string>('caseEditType', {
required: true,
});
//
const handleSelectType = (value: string | number | Record<string, any> | undefined) => {
innerCaseEditType.value = value as string;
};
//
function getSelectTypeClass(type: string) {
return innerCaseEditType.value === type ? ['bg-[rgb(var(--primary-1))]', '!text-[rgb(var(--primary-5))]'] : [];
}
</script>
<style scoped></style>

View File

@ -36,58 +36,34 @@
class="markdown-body list-item-css !break-words break-all" class="markdown-body list-item-css !break-words break-all"
></div> ></div>
</a-form-item> </a-form-item>
<a-form-item <StepDescription v-model:caseEditType="detailForm.caseEditType" :is-test-plan="props.isTestPlan" />
field="step" <!-- 步骤描述 -->
:label=" <div v-if="detailForm.caseEditType === 'STEP'" class="mb-[20px] w-full">
detailForm.caseEditType === 'STEP' <AddStep
? t('system.orgTemplate.stepDescription') v-model:step-list="stepData"
: t('system.orgTemplate.textDescription') :is-scroll-y="false"
" :is-test-plan="props.isTestPlan"
class="relative" :is-disabled-test-plan="props.isDisabledTestPlan"
> :is-disabled="!isEditPreposition"
<div v-if="!props.isTestPlan" class="absolute left-16 top-0 font-normal">
<a-divider direction="vertical" />
<a-dropdown :popup-max-height="false" @select="handleSelectType">
<span class="changeType cursor-pointer text-[var(--color-text-3)]"
>{{ t('system.orgTemplate.changeType') }} <icon-down
/></span>
<template #content>
<a-doption value="STEP" :class="getSelectTypeClass('STEP')">
{{ t('system.orgTemplate.stepDescription') }}</a-doption
>
<a-doption value="TEXT" :class="getSelectTypeClass('TEXT')">{{
t('system.orgTemplate.textDescription')
}}</a-doption>
</template>
</a-dropdown>
</div>
<!-- 步骤描述 -->
<div v-if="detailForm.caseEditType === 'STEP'" class="w-full">
<AddStep
v-model:step-list="stepData"
:is-scroll-y="false"
:is-test-plan="props.isTestPlan"
:is-disabled-test-plan="props.isDisabledTestPlan"
:is-disabled="!isEditPreposition"
/>
</div>
<!-- 文本描述 -->
<MsRichText
v-if="detailForm.caseEditType === 'TEXT' && isEditPreposition"
v-model:raw="detailForm.textDescription"
v-model:filed-ids="textDescriptionFileIds"
:upload-image="handleUploadImage"
:preview-url="`${PreviewEditorImageUrl}/${currentProjectId}`"
/> />
<div </div>
v-if="detailForm.caseEditType === 'TEXT' && !isEditPreposition" <!-- 文本描述 -->
v-dompurify-html="detailForm.textDescription || '-'" <MsRichText
class="markdown-body !break-words break-all" v-if="detailForm.caseEditType === 'TEXT' && isEditPreposition"
></div> v-model:raw="detailForm.textDescription"
</a-form-item> v-model:filed-ids="textDescriptionFileIds"
:upload-image="handleUploadImage"
:preview-url="`${PreviewEditorImageUrl}/${currentProjectId}`"
/>
<div
v-if="detailForm.caseEditType === 'TEXT' && !isEditPreposition"
v-dompurify-html="detailForm.textDescription || '-'"
class="markdown-body !break-words break-all"
></div>
<a-form-item <a-form-item
v-if="detailForm.caseEditType === 'TEXT'" v-if="detailForm.caseEditType === 'TEXT'"
field="remark" field="remark"
class="mt-[20px]"
:label="t('caseManagement.featureCase.expectedResult')" :label="t('caseManagement.featureCase.expectedResult')"
> >
<MsRichText <MsRichText
@ -263,6 +239,7 @@
import SaveAsFilePopover from '@/components/business/ms-add-attachment/saveAsFilePopover.vue'; import SaveAsFilePopover from '@/components/business/ms-add-attachment/saveAsFilePopover.vue';
import LinkFileDrawer from '@/components/business/ms-link-file/associatedFileDrawer.vue'; import LinkFileDrawer from '@/components/business/ms-link-file/associatedFileDrawer.vue';
import AddStep from '../addStep.vue'; import AddStep from '../addStep.vue';
import StepDescription from '@/views/case-management/caseManagementFeature/components/tabContent/stepDescription.vue';
import { import {
checkFileIsUpdateRequest, checkFileIsUpdateRequest,

View File

@ -24,41 +24,21 @@
:editable="!props.isDisabled" :editable="!props.isDisabled"
/> />
</a-form-item> </a-form-item>
<a-form-item <StepDescription v-model:caseEditType="form.caseEditType" />
field="step" <!-- 步骤描述 -->
:label=" <div v-if="form.caseEditType === 'STEP'" class="mb-[20px] w-full">
form.caseEditType === 'STEP' ? t('system.orgTemplate.stepDescription') : t('system.orgTemplate.textDescription') <AddStep v-model:step-list="stepData" :is-disabled="props.isDisabled" />
" </div>
class="relative" <!-- 文本描述 -->
> <div v-else class="pb-[20px]">
<div class="absolute left-16 top-0">
<a-divider direction="vertical" />
<a-dropdown :popup-max-height="false" @select="handleSelectType">
<span class="changeType">{{ t('system.orgTemplate.changeType') }} <icon-down /></span>
<template #content>
<a-doption value="STEP" :class="getSelectTypeClass('STEP')">
{{ t('system.orgTemplate.stepDescription') }}</a-doption
>
<a-doption value="TEXT" :class="getSelectTypeClass('TEXT')">{{
t('system.orgTemplate.textDescription')
}}</a-doption>
</template>
</a-dropdown>
</div>
<!-- 步骤描述 -->
<div v-if="form.caseEditType === 'STEP'" class="w-full">
<AddStep v-model:step-list="stepData" :is-disabled="props.isDisabled" />
</div>
<!-- 文本描述 -->
<MsRichText <MsRichText
v-else
v-model:raw="form.textDescription" v-model:raw="form.textDescription"
v-model:filed-ids="textDescriptionFileIds" v-model:filed-ids="textDescriptionFileIds"
:upload-image="handleUploadImage" :upload-image="handleUploadImage"
:preview-url="previewEditorImageUrl" :preview-url="previewEditorImageUrl"
:editable="!props.isDisabled" :editable="!props.isDisabled"
/> />
</a-form-item> </div>
<a-form-item <a-form-item
v-if="form.caseEditType === 'TEXT'" v-if="form.caseEditType === 'TEXT'"
field="remark" field="remark"
@ -94,6 +74,7 @@
import MsRichText from '@/components/pure/ms-rich-text/MsRichText.vue'; import MsRichText from '@/components/pure/ms-rich-text/MsRichText.vue';
import AddAttachment from '@/components/business/ms-add-attachment/index.vue'; import AddAttachment from '@/components/business/ms-add-attachment/index.vue';
import AddStep from '@/views/case-management/caseManagementFeature/components/addStep.vue'; import AddStep from '@/views/case-management/caseManagementFeature/components/addStep.vue';
import StepDescription from '@/views/case-management/caseManagementFeature/components/tabContent/stepDescription.vue';
import { editorUploadFile } from '@/api/modules/setting/template'; import { editorUploadFile } from '@/api/modules/setting/template';
import { previewOrgImageUrl, previewProImageUrl } from '@/api/requrls/setting/template'; import { previewOrgImageUrl, previewProImageUrl } from '@/api/requrls/setting/template';