Skip to content

Commit

Permalink
feat(frontend): 单据人工确认新增确认详情及区分是否单据发起人 #3784
Browse files Browse the repository at this point in the history
  • Loading branch information
jinquantianxia authored and zhangzhw8 committed Apr 3, 2024
1 parent ab6a22c commit 14ccd70
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
},
};
InfoBox({
title: t('确认提交 n 个集群容量变更任务?', { n: totalNum.value }),
title: t('确认提交n个集群容量变更任务', { n: totalNum.value }),
width: 480,
onConfirm: () => {
isSubmitting.value = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
:data="item"
:href-target="getHrefTarget(content)" />
</template>
<!-- 人工确认 -->
<template
v-else-if="(content.status === 'PENDING' && content.flow_type === 'PAUSE') ||
(content.status === 'RUNNING' && !isSamePeople)">
<span>等待 {{ ticketData.creator }} 确认是否执行 "{{ manualNexFlowDisaply }}"</span>
</template>
<template v-else>
<p>
<template
Expand Down Expand Up @@ -119,9 +125,12 @@
</template>

<script setup lang="ts">
import TicketModel from '@services/model/ticket/ticket';
import { retryTicketFlow } from '@services/source/ticket';
import type { FlowItem } from '@services/types/ticket';

import { useUserProfile } from '@stores';

import CostTimer from '@components/cost-timer/CostTimer.vue';

import FlowContentInnerFlow from './components/ContentInnerFlow.vue';
Expand All @@ -132,27 +141,44 @@
}

interface Props {
ticketData: TicketModel,
content: FlowItem,
flows?: FlowItem[],
isTodos?: boolean
}

const props = withDefaults(defineProps<Props>(), {
isTodos: false,
flows: () => [],
});
const emits = defineEmits<Emits>();

const router = useRouter();
const { username } = useUserProfile();

const retryButtonRef = ref();
const state = reactive({
confirmTips: false,
isLoading: false,
});

const manualNexFlowDisaply = computed(() => {
if (props.flows.length > 0) {
const manualIndex = props.flows.findIndex(item => item.flow_type === 'PAUSE');
if (manualIndex > -1) {
return props.flows[manualIndex + 1].flow_type_display;
}
}
return '';
});

const isPause = computed(() => {
const { content } = props;
return content.status === 'RUNNING' && content.flow_type === 'PAUSE';
});

const isSamePeople = computed(() => props.ticketData.creator === username);

function getHrefTarget(content: FlowItem) {
return content.flow_type === 'BK_ITSM' ? '_blank' : '_self';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
:is="flowComponent"
:key="data.id"
:flows="state.flows"
:ticket-data="data"
@fetch-data="handleFecthData" />
</BkLoading>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,22 @@
<template #content="{content}">
<FlowContent
:content="content"
:flows="flows"
:ticket-data="ticketData"
@fetch-data="handleFetchData" />
</template>
</BkTimeline>
</template>

<script setup lang="tsx">
import TicketModel from '@services/model/ticket/ticket';
import type { FlowItem } from '@services/types/ticket';

import FlowIcon from '@views/tickets/common/components/flow-content/components/FlowIcon.vue';
import FlowContent from '@views/tickets/common/components/flow-content/Index.vue';

interface Props {
ticketData: TicketModel,
flows?: FlowItem[]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
<FlowContent
v-else
:content="content"
:flows="flows"
:ticket-data="ticketData"
@fetch-data="handleFetchData" />
</template>
</BkTimeline>
Expand All @@ -53,6 +55,7 @@
</template>

<script setup lang="tsx">
import TicketModel from '@services/model/ticket/ticket';
import type { FlowItem } from '@services/types/ticket';

import SqlFileComponent from '@views/tickets/common/components/demand-factory/mysql/LogDetails.vue';
Expand All @@ -63,6 +66,7 @@
import { getCostTimeDisplay } from '@utils';

interface Props {
ticketData: TicketModel,
flows?: FlowItem[]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
<template #content="{content}">
<FlowContent
:content="content"
:flows="flows"
:ticket-data="ticketData"
@fetch-data="handleFetchData">
<template #extra-text>
<template v-if="(content.isLast && content.status === 'SUCCEEDED')">
Expand All @@ -37,13 +39,15 @@
</template>

<script setup lang="tsx">
import TicketModel from '@services/model/ticket/ticket';
import type { FlowItem } from '@services/types/ticket';

import RedisResultFiles from '@views/task-history/components/RedisResultFiles.vue';
import FlowIcon from '@views/tickets/common/components/flow-content/components/FlowIcon.vue';
import FlowContent from '@views/tickets/common/components/flow-content/Index.vue';

interface Props {
ticketData: TicketModel,
flows?: FlowItem[]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
:is="flowComponent"
:key="data.id"
:flows="state.flows"
:ticket-data="data"
@processed="handleProcessed" />
</BkLoading>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@
<template v-else>
<FlowContent
:content="content"
is-todos />
:flows="flows"
is-todos
:ticket-data="ticketData" />
</template>
</template>
</BkTimeline>
Expand All @@ -137,6 +139,7 @@
<script setup lang="tsx">
import { useI18n } from 'vue-i18n';

import TicketModel from '@services/model/ticket/ticket';
import { processTicketTodo } from '@services/source/ticket';
import type {
FlowItem,
Expand All @@ -154,6 +157,7 @@
import { getCostTimeDisplay } from '@utils';

interface Props {
ticketData: TicketModel,
flows?: FlowItem[]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@
<template v-else>
<FlowContent
:content="content"
is-todos>
:flows="flows"
is-todos
:ticket-data="ticketData">
<template #extra-text>
<template v-if="(content.isLast && content.status === 'SUCCEEDED')">
Expand All @@ -145,6 +147,7 @@
<script setup lang="tsx">
import { useI18n } from 'vue-i18n';

import TicketModel from '@services/model/ticket/ticket';
import { processTicketTodo } from '@services/source/ticket';
import type {
FlowItem,
Expand All @@ -160,6 +163,7 @@
import { getCostTimeDisplay } from '@utils';

interface Props {
ticketData: TicketModel,
flows?: FlowItem[]
}

Expand All @@ -172,7 +176,6 @@
});
const emits = defineEmits<Emits>();


const { username } = useUserProfile();
const router = useRouter();
const { t } = useI18n();
Expand Down

0 comments on commit 14ccd70

Please sign in to comment.