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

View File

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