Skip to content

Commit

Permalink
fix(frontend): 平台管理任务列表中链接跳转时业务 id 错误 #9082
Browse files Browse the repository at this point in the history
  • Loading branch information
hLinx committed Jan 15, 2025
1 parent fe619d9 commit 892bef9
Showing 1 changed file with 43 additions and 30 deletions.
73 changes: 43 additions & 30 deletions dbm-ui/frontend/src/views/task-history/list/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,15 @@
label="ID"
:min-width="120">
<template #default="{data}: {data: TaskFlowModel}">
<AuthRouterLink
<AuthButton
action-id="flow_detail"
:permission="data.permission.flow_detail"
:resource="data.root_id"
:to="{
name: 'taskHistoryDetail',
params: {
root_id: data.root_id,
},
query: {
from: route.name,
},
}">
text
theme="primary"
@click="handleGoDetail(data)">
{{ data.root_id }}
</AuthRouterLink>
</AuthButton>
</template>
</BkTableColumn>
<BkTableColumn
Expand Down Expand Up @@ -99,20 +93,16 @@
:label="t('关联单据')"
:width="100">
<template #default="{data}: {data: TaskFlowModel}">
<AuthRouterLink
<AuthButton
v-if="data.uid"
action-id="ticket_view"
:permission="data.permission.ticket_view"
:resource="data.uid"
target="_blank"
:to="{
name: 'bizTicketManage',
params: {
ticketId: data.uid,
},
}">
text
theme="primary"
@click="handleGoTicketDetail(data)">
{{ data.uid }}
</AuthRouterLink>
</AuthButton>
<span v-else>--</span>
</template>
</BkTableColumn>
Expand Down Expand Up @@ -144,18 +134,15 @@
:label="t('操作')"
:width="120">
<template #default="{data}: {data: TaskFlowModel}">
<AuthRouterLink
<AuthButton
action-id="flow_detail"
:permission="data.permission.flow_detail"
:resource="data.root_id"
:to="{
name: 'taskHistoryDetail',
params: {
root_id: data.root_id,
},
}">
text
theme="primary"
@click="handleGoDetail(data)">
{{ t('查看详情') }}
</AuthRouterLink>
</AuthButton>
<BkButton
v-if="includesResultFiles.includes(data.ticket_type) && data.status === 'FINISHED'"
class="ml-6"
Expand All @@ -179,7 +166,7 @@
import { format } from 'date-fns';
import { useI18n } from 'vue-i18n';
import { useRequest } from 'vue-request';
import { useRoute } from 'vue-router';
import { useRoute, useRouter } from 'vue-router';

import TaskFlowModel from '@services/model/taskflow/taskflow';
import { getTaskflow } from '@services/source/taskflow';
Expand All @@ -193,11 +180,12 @@

import DbStatus from '@components/db-status/index.vue';

import { getCostTimeDisplay, getMenuListSearch, getSearchSelectorParams } from '@utils';
import { getBusinessHref, getCostTimeDisplay, getMenuListSearch, getSearchSelectorParams } from '@utils';

import type { ListState } from '../common/types';
import RedisResultFiles from '../components/RedisResultFiles.vue';

const router = useRouter();
const route = useRoute();
const { t } = useI18n();

Expand Down Expand Up @@ -340,6 +328,31 @@
resultFileState.isShow = true;
resultFileState.rootId = id;
};

const handleGoDetail = (data: TaskFlowModel) => {
const { href } = router.resolve({
name: 'taskHistoryDetail',
params: {
root_id: data.root_id,
},
query: {
from: route.name as string,
},
});

window.open(getBusinessHref(href), '_blank');
};

const handleGoTicketDetail = (data: TaskFlowModel) => {
const { href } = router.resolve({
name: 'bizTicketManage',
params: {
ticketId: data.uid,
},
});

window.open(getBusinessHref(href), '_blank');
};
</script>

<style lang="less">
Expand Down

0 comments on commit 892bef9

Please sign in to comment.