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; name: string;
status: planStatusType; status: planStatusType;
type: keyof typeof testPlanTypeEnum; type: keyof typeof testPlanTypeEnum;
tags: string[]; tags: string[] | { id: string; name: string }[];
schedule: string; // 是否定时 schedule: string; // 是否定时
createUser: string; createUser: string;
createTime: string; createTime: string;

View File

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

View File

@ -40,7 +40,7 @@
> >
<template #tree-slot-title="node"> <template #tree-slot-title="node">
<a-tooltip :content="`${node.name}`" position="tl"> <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> </a-tooltip>
</template> </template>
</a-tree-select> </a-tree-select>