Skip to content

Commit

Permalink
feat(frontend): 集群、实例补充字段 TencentBlueKing#7813
Browse files Browse the repository at this point in the history
  • Loading branch information
hLinx committed Dec 5, 2024
1 parent f05b167 commit de67b4d
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
let isInit = true;
const { pause: pauseFetchData } = watch(
const { pause: pauseFetchData, resume: resumeFetchData } = watch(
[formatDateValue, formatSearchValue],
_.debounce(() => {
if (!isInit) {
Expand Down Expand Up @@ -188,6 +188,7 @@
};
onActivated(() => {
resumeFetchData();
currentTicketScrollToTop();
eventBus.on('refreshTicketStatus', fetchData);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
:text="false"
theme="" />
<TicketRevoke :data="ticketData" />
<BkButton
v-if="isShowGoDetail"
@click="handleGoDetail">
{{ t('新窗口打开') }}
</BkButton>
</template>
</SmartAction>
</PermissionCatch>
Expand All @@ -56,6 +61,7 @@
<script setup lang="tsx">
import { useI18n } from 'vue-i18n';
import { useRequest } from 'vue-request';
import { useRoute, useRouter } from 'vue-router';

import TicketModel from '@services/model/ticket/ticket';
import { getTicketDetails } from '@services/source/ticket';
Expand All @@ -79,13 +85,16 @@

const props = defineProps<Props>();

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

const getOffsetTarget = () => document.body.querySelector('.ticket-details-page .db-card');

const isTaskInfoCardCollapse = useStorage('ticketTaskInfo', false);
const isShowGoDetail = route.name !== 'ticketDetail';

const isTaskInfoCardCollapse = useStorage('ticketTaskInfo', false);
const isLoading = ref(true);
const ticketData = shallowRef<TicketModel>();

Expand Down Expand Up @@ -131,6 +140,16 @@
},
);

const handleGoDetail = () => {
const { href } = router.resolve({
name: 'ticketDetail',
params: {
ticketId: props.ticketId,
},
});
window.open(href);
};

eventBus.on('refreshTicketStatus', refreshTicketData);

onBeforeUnmount(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
{{ t('查看详情') }}
</a>
</template>
<TodoList
v-if="data.todos.length > 0"
:data="data.todos"
:flow-data="data" />
</template>
</StatusSucceeded>
</template>
Expand All @@ -30,6 +34,7 @@
import { utcTimeToSeconds } from '@utils';
import StatusSucceeded from '../flow-type-common/StatusSucceeded.vue';
import TodoList from '../todo-list/Index.vue';
interface Props {
data: FlowMode<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import StatusCommon from '../common';
import StatusDoneFailed from './StatusDoneFailed.vue';
import StatusSuccess from './StatusSuccess.vue';
import StatusTodo from './StatusTodo.vue';
interface Props {
Expand All @@ -24,5 +25,8 @@
const renderCom = Object.assign({}, StatusCommon, {
[FlowMode.TODO_STATUS_TODO]: StatusTodo,
[FlowMode.TODO_STATUS_DONE_FAILED]: StatusDoneFailed,
[FlowMode.TODO_STATUS_DONE_SUCCESS]: StatusSuccess,
})[props.data.status];
console.log('props.data.status = ', props.data.status, renderCom);
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<template>
<div style="margin-top: 10px; color: #979ba5">{{ utcDisplayTime(data.done_at) }}</div>
</template>
<script setup lang="ts">
import FlowMode from '@services/model/ticket/flow';
import { utcDisplayTime } from '@utils';
interface Props {
data: FlowMode<unknown>['todos'][number];
}
defineProps<Props>();
defineOptions({
name: FlowMode.TODO_STATUS_DONE_SUCCESS,
});
</script>

0 comments on commit de67b4d

Please sign in to comment.