fix(用例管理): 修复用例详情关联需求列表点击跳转问题

--bug=1036086 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001036086
This commit is contained in:
guoyuqi 2024-02-29 13:43:32 +08:00 committed by 刘瑞斌
parent ffa22b9320
commit de94106303
2 changed files with 10 additions and 8 deletions

View File

@ -1,9 +1,8 @@
<template> <template>
<ms-base-table ref="tableRef" v-bind="propsRes" v-on="propsEvent"> <ms-base-table ref="tableRef" v-bind="propsRes" v-on="propsEvent">
<template #demandName="{ record }"> <template #demandName="{ record }">
<span class="ml-1" :class="[props.highlightName ? 'text-[rgb(var(--primary-5))]' : '']"> <a-button type="text" class="ml-1" :class="[props.highlightName ? 'text-[rgb(var(--primary-5))]' : '']" style="margin-left: -0.77rem" @click="emit('open', record)"
{{ record.demandName }} >{{ record.demandName }}<span>({{ (record.children || []).length || 0 }})</span></a-button
<span>({{ (record.children || []).length || 0 }})</span></span
> >
</template> </template>
<template #operation="{ record }"> <template #operation="{ record }">
@ -71,6 +70,7 @@
(e: 'create'): void; (e: 'create'): void;
(e: 'associate'): void; (e: 'associate'): void;
(e: 'cancel', record: DemandItem): void; (e: 'cancel', record: DemandItem): void;
(e: 'open', record: DemandItem): void;
}>(); }>();
const columns: MsTableColumn = [ const columns: MsTableColumn = [

View File

@ -26,6 +26,7 @@
@update="updateDemand" @update="updateDemand"
@create="addDemand" @create="addDemand"
@cancel="cancelLink" @cancel="cancelLink"
@open="openDemandUrl"
@associate="linkDemandDrawer = true" @associate="linkDemandDrawer = true"
></AssociatedDemandTable> ></AssociatedDemandTable>
<AddDemandModal <AddDemandModal
@ -67,9 +68,10 @@
</div> </div>
<ms-base-table ref="tableRef" v-bind="propsRes" v-on="propsEvent"> <ms-base-table ref="tableRef" v-bind="propsRes" v-on="propsEvent">
<template #demandName="{ record }"> <template #demandName="{ record }">
<a-button type="text" class="flex w-full" @click="openDemandUrl(record.demandUrl)" <span class="ml-1 text-[rgb(var(--primary-5))]">
>{{ record.demandName }}<span>({{ (record.children || []).length || 0 }})</span></a-button {{ record.demandName }}
> <span>({{ (record.children || []).length || 0 }})</span></span
>
</template> </template>
<template v-for="item in customFields" :key="item.slotName" #[item.dataIndex]="{ record }"> <template v-for="item in customFields" :key="item.slotName" #[item.dataIndex]="{ record }">
<span> {{ getSlotName(record, item) }} </span> <span> {{ getSlotName(record, item) }} </span>
@ -267,8 +269,8 @@
return record.customFields[item.dataIndex as string] || '-'; return record.customFields[item.dataIndex as string] || '-';
} }
function openDemandUrl(url: string) { function openDemandUrl(record: DemandItem) {
window.open(url); window.open(record.demandUrl);
} }
const platformInfo = ref<Record<string, any>>({}); const platformInfo = ref<Record<string, any>>({});