fix(功能用例): 修复功能用例等级为空表格错乱问题&替换后台对应用例等级字段
This commit is contained in:
parent
8891ac5b1f
commit
6aa5474860
|
@ -33,8 +33,7 @@
|
|||
<CaseLevel :case-level="filterContent.value" />
|
||||
</template>
|
||||
<template #caseLevel="{ record }">
|
||||
<CaseLevel v-if="record.caseLevel" :case-level="record.caseLevel" />
|
||||
<span v-else>-</span>
|
||||
<CaseLevel :case-level="record.caseLevel" />
|
||||
</template>
|
||||
<template #[FilterSlotNameEnum.CASE_MANAGEMENT_EXECUTE_RESULT]="{ filterContent }">
|
||||
<ExecuteResult :execute-result="filterContent.value" />
|
||||
|
@ -50,7 +49,6 @@
|
|||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { TableData } from '@arco-design/web-vue';
|
||||
|
||||
import MsButton from '@/components/pure/ms-button/index.vue';
|
||||
import MsBaseTable from '@/components/pure/ms-table/base-table.vue';
|
||||
|
@ -60,7 +58,6 @@
|
|||
import ExecuteResult from '@/components/business/ms-case-associate/executeResult.vue';
|
||||
import type { MsTreeNodeData } from '@/components/business/ms-tree/types';
|
||||
|
||||
import { useI18n } from '@/hooks/useI18n';
|
||||
import useOpenNewPage from '@/hooks/useOpenNewPage';
|
||||
import useTableStore from '@/hooks/useTableStore';
|
||||
|
||||
|
@ -76,10 +73,13 @@
|
|||
import useModuleSelection from './useModuleSelection';
|
||||
import { getPublicLinkCaseListMap } from './utils/page';
|
||||
import { casePriorityOptions } from '@/views/api-test/components/config';
|
||||
import { executionResultMap, statusIconMap } from '@/views/case-management/caseManagementFeature/components/utils';
|
||||
import {
|
||||
executionResultMap,
|
||||
getCaseLevels,
|
||||
statusIconMap,
|
||||
} from '@/views/case-management/caseManagementFeature/components/utils';
|
||||
|
||||
const { openNewPage } = useOpenNewPage();
|
||||
const { t } = useI18n();
|
||||
|
||||
const props = defineProps<{
|
||||
associationType: string; // 关联类型 项目 | 测试计划 | 用例评审
|
||||
|
@ -229,16 +229,6 @@
|
|||
return getPublicLinkCaseListMap[props.getPageApiType][props.activeSourceType];
|
||||
});
|
||||
|
||||
function getCaseLevel(record: TableData) {
|
||||
if (record.customFields && record.customFields.length) {
|
||||
const caseItem = record.customFields.find(
|
||||
(item: any) => item.fieldName === t('common.casePriority') && item.internal
|
||||
);
|
||||
return caseItem?.options.find((item: any) => item.value === caseItem?.defaultValue)?.text;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const { propsRes, propsEvent, loadList, setLoadListParams, resetFilterParams, setTableSelected } = useTable(
|
||||
getPageList.value,
|
||||
{
|
||||
|
@ -254,7 +244,7 @@
|
|||
(record) => {
|
||||
return {
|
||||
...record,
|
||||
caseLevel: getCaseLevel(record),
|
||||
caseLevel: getCaseLevels(record.customFields),
|
||||
};
|
||||
}
|
||||
);
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
></div>
|
||||
{{ caseLevel.label }}
|
||||
</div>
|
||||
<span v-else class="text-[var(--color-text-2)]"> - </span>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
|
|
@ -140,7 +140,7 @@
|
|||
<a-button type="text" class="px-0" @click="openDetail(record.id)">{{ record.num }} </a-button>
|
||||
</template>
|
||||
<template #caseLevel="{ record }">
|
||||
<caseLevel v-if="getCaseLevel(record)" :case-level="getCaseLevel(record)" />
|
||||
<caseLevel :case-level="getCaseLevels(record.customFields)" />
|
||||
</template>
|
||||
<template #lastExecuteResult="{ record }">
|
||||
<ExecuteStatusTag v-if="record.lastExecuteResult" :execute-result="record.lastExecuteResult" />
|
||||
|
@ -223,7 +223,11 @@
|
|||
|
||||
import { initGetModuleCountFunc, type RequestModuleEnum } from './utils';
|
||||
import { casePriorityOptions } from '@/views/api-test/components/config';
|
||||
import { executionResultMap, statusIconMap } from '@/views/case-management/caseManagementFeature/components/utils';
|
||||
import {
|
||||
executionResultMap,
|
||||
getCaseLevels,
|
||||
statusIconMap,
|
||||
} from '@/views/case-management/caseManagementFeature/components/utils';
|
||||
|
||||
const router = useRouter();
|
||||
const appStore = useAppStore();
|
||||
|
@ -512,18 +516,6 @@
|
|||
}
|
||||
);
|
||||
|
||||
// 用例等级
|
||||
// TODO: 这个版本用例和接口以及场景不存在用例等级 不展示等级内容
|
||||
function getCaseLevel(record: CaseManagementTable) {
|
||||
if (record.customFields && record.customFields.length) {
|
||||
const caseItem = record.customFields.find(
|
||||
(item: any) => item.fieldName === t('common.casePriority') && item.internal
|
||||
);
|
||||
return caseItem?.options.find((item: any) => item.value === caseItem?.defaultValue).text;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const searchParams = ref<TableQueryParams>({
|
||||
moduleIds: [],
|
||||
version: version.value,
|
||||
|
|
|
@ -334,12 +334,6 @@
|
|||
}
|
||||
);
|
||||
|
||||
// 用例等级
|
||||
function getCaseLevel(record: CaseManagementTable) {
|
||||
return record.customFields.find((item: any) => item.internal && item.internalFieldKey === 'functional_priority')
|
||||
?.value as CaseLevel;
|
||||
}
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
function cancel() {
|
||||
|
|
|
@ -123,10 +123,7 @@ export function getCaseLevels(customFields: CustomAttributes[]): CaseLevel {
|
|||
const caseLevelItem = (customFields || []).find(
|
||||
(it: any) => it.internal && it.internalFieldKey === 'functional_priority'
|
||||
);
|
||||
return (
|
||||
(caseLevelItem?.options.find((it: any) => it.value === caseLevelItem.defaultValue)?.text as CaseLevel) ||
|
||||
('P0' as CaseLevel)
|
||||
);
|
||||
return caseLevelItem?.options.find((it: any) => it.value === caseLevelItem.defaultValue)?.text as CaseLevel;
|
||||
}
|
||||
|
||||
// 获取对应模块name
|
||||
|
|
|
@ -817,7 +817,7 @@
|
|||
async function getCaseLevelFields() {
|
||||
const result = await getCaseDefaultFields(appStore.currentProjectId);
|
||||
caseLevelFields.value = result.customFields.find(
|
||||
(item: any) => item.fieldName === t('common.casePriority') && item.internal
|
||||
(item: any) => item.internal && item.internalFieldKey === 'functional_priority'
|
||||
);
|
||||
columns = columns.map((item) => {
|
||||
if (item.dataIndex === 'caseLevel') {
|
||||
|
|
Loading…
Reference in New Issue