fix(测试计划): 修复测试计划子级标签不展示&列表微调样式

This commit is contained in:
xinxin.wu 2024-06-20 13:42:14 +08:00 committed by Craftsman
parent 1d606166c9
commit 9985e02d3d
3 changed files with 27 additions and 10 deletions

View File

@ -92,7 +92,7 @@ export interface TestPlanItem {
name: string;
status: planStatusType;
type: keyof typeof testPlanTypeEnum;
tags: string[];
tags: string[] | { id: string; name: string }[];
schedule: string; // 是否定时
createUser: string;
createTime: string;

View File

@ -111,9 +111,15 @@
</div>
<div v-if="record.type === testPlanTypeEnum.TEST_PLAN" :class="`one-line-text ${hasIndent(record)}`"
><MsButton type="text" @click="openDetail(record.id)">{{ record.num }}</MsButton></div
><MsButton type="text" @click="openDetail(record.id)"
><a-tooltip :content="record.num.toString()"
><span>{{ record.num }}</span></a-tooltip
></MsButton
></div
>
<a-tooltip v-else :content="record.num.toString()"
><div :class="`one-line-text ${hasIndent(record)}`">{{ record.num }}</div></a-tooltip
>
<div v-else :class="`one-line-text ${hasIndent(record)}`">{{ record.num }}</div>
<a-tooltip position="right" :disabled="!getSchedule(record.id)" :mouse-enter-delay="300">
<MsTag
v-if="getSchedule(record.id)"
@ -550,7 +556,6 @@
dataIndex: 'moduleId',
showInTable: true,
showDrag: true,
showTooltip: true,
width: 200,
},
{
@ -814,6 +819,21 @@
draggableCondition: true,
});
function getTags(record: TestPlanItem) {
if (record.children && record.children.length) {
record.children = record.children.map((child: TestPlanItem) => getTags(child));
}
return {
...record,
tags: (record.tags || []).map((item: any, i: number) => {
return {
id: `${record.id}-${i}`,
name: item,
};
}),
};
}
const {
propsRes,
propsEvent,
@ -826,11 +846,8 @@
} = useTable(
getTestPlanList,
tableProps.value,
(item) => {
return {
...item,
tags: (item.tags || []).map((e: string) => ({ id: e, name: e })),
};
(item: any) => {
return getTags(item);
},
updatePlanName
);

View File

@ -40,7 +40,7 @@
>
<template #tree-slot-title="node">
<a-tooltip :content="`${node.name}`" position="tl">
<div class="one-line-text w-[300px]">{{ node.name }}</div>
<div class="one-line-text w-[400px]">{{ node.name }}</div>
</a-tooltip>
</template>
</a-tree-select>