style(sj_map_reduce): 优化工作流批次详情样式

This commit is contained in:
xlsea 2024-06-21 11:22:37 +08:00
parent edbad0c914
commit 3f94657e8e
2 changed files with 123 additions and 96 deletions

View File

@ -12,7 +12,12 @@ import {
import { useWorkflowStore } from '@/store/modules/workflow'; import { useWorkflowStore } from '@/store/modules/workflow';
import { $t } from '@/locales'; import { $t } from '@/locales';
import { isNotNull } from '@/utils/common'; import { isNotNull } from '@/utils/common';
import { fetchGetJobBatchDetail, fetchGetJobDetail, fetchGetJobTaskList, fetchWorkflowNodeRetry } from '@/service/api'; import {
fetchGetJobBatchDetail,
fetchGetJobDetail,
fetchGetJobTaskList
// fetchWorkflowNodeRetry
} from '@/service/api';
defineOptions({ defineOptions({
name: 'DetailCard' name: 'DetailCard'
@ -139,16 +144,16 @@ const getLogRows = (task: Workflow.JobTaskType) => {
logOpen.value = true; logOpen.value = true;
}; };
const retry = async (item: Workflow.JobTaskType) => { // const retry = async (item: Workflow.JobTaskType) => {
const { error } = await fetchWorkflowNodeRetry(store.id!, item.workflowNodeId!); // const { error } = await fetchWorkflowNodeRetry(store.id!, item.workflowNodeId!);
if (!error) { // if (!error) {
window.$message?.success('执行重试成功'); // window.$message?.success('');
} // }
}; // };
const isRetry = (taskBatchStatus: number) => { // const isRetry = (taskBatchStatus: number) => {
return taskBatchStatus === 4 || taskBatchStatus === 5 || taskBatchStatus === 6; // return taskBatchStatus === 4 || taskBatchStatus === 5 || taskBatchStatus === 6;
}; // };
type ThemeColor = 'default' | 'error' | 'primary' | 'info' | 'success' | 'warning'; type ThemeColor = 'default' | 'error' | 'primary' | 'info' | 'success' | 'warning';
@ -260,8 +265,10 @@ const onUpdatePage = (page: number) => {
<NDrawerContent title="任务批次详情" closable> <NDrawerContent title="任务批次详情" closable>
<NTabs v-if="idList && idList.length > 0" v-model:value="currentIndex" type="segment" animated> <NTabs v-if="idList && idList.length > 0" v-model:value="currentIndex" type="segment" animated>
<NTabPane v-for="(item, index) in idList" :key="index" :name="index + 1" :tab="item"> <NTabPane v-for="(item, index) in idList" :key="index" :name="index + 1" :tab="item">
<NTabs class="detail-tabs" type="segment" animated>
<NTabPane name="info" :tab="$t('page.log.info')">
<NSpin :show="spinning"> <NSpin :show="spinning">
<NDescriptions label-placement="left" bordered :column="2"> <NDescriptions class="pt-12px" label-placement="left" bordered :column="2">
<NDescriptionsItem :label="$t('page.jobBatch.groupName')">{{ jobData?.groupName }}</NDescriptionsItem> <NDescriptionsItem :label="$t('page.jobBatch.groupName')">{{ jobData?.groupName }}</NDescriptionsItem>
<NDescriptionsItem :label="$t('page.jobBatch.jobName')">{{ jobData?.jobName }}</NDescriptionsItem> <NDescriptionsItem :label="$t('page.jobBatch.jobName')">{{ jobData?.jobName }}</NDescriptionsItem>
@ -273,7 +280,10 @@ const onUpdatePage = (page: number) => {
> >
{{ taskBatchStatusEnum[jobData.taskBatchStatus!].title }} {{ taskBatchStatusEnum[jobData.taskBatchStatus!].title }}
</NTag> </NTag>
<NTag v-if="isNotNull(jobData.jobStatus)" :color="getTagColor(jobStatusEnum[jobData.jobStatus!].color)"> <NTag
v-if="isNotNull(jobData.jobStatus)"
:color="getTagColor(jobStatusEnum[jobData.jobStatus!].color)"
>
{{ $t(jobStatusEnum[jobData.jobStatus!].name) }} {{ $t(jobStatusEnum[jobData.jobStatus!].name) }}
</NTag> </NTag>
</NDescriptionsItem> </NDescriptionsItem>
@ -309,21 +319,16 @@ const onUpdatePage = (page: number) => {
</NDescriptions> </NDescriptions>
</NSpin> </NSpin>
<slot></slot> <slot></slot>
<NCard </NTabPane>
:bordered="false" <NTabPane name="task">
size="small" <template #tab>
class="sm:flex-1-hidden card-wrapper" <span>任务项列表</span>
:content-style="{ padding: 0 }" <!--
:header-style="{ padding: 0 }" <div class="absolute right-16px top-9px">
>
<template #header>
<div class="header-border"><span class="pl-12px">任务项列表</span></div>
</template>
<template #header-extra>
<NTooltip trigger="hover"> <NTooltip trigger="hover">
<template #trigger> <template #trigger>
<NButton text @click="getRows(item)"> <NButton text @click="getRows(item)">
<icon-ant-design:sync-outlined class="mr-16px text-20px font-bold" /> <icon-ant-design:sync-outlined class="mr-8px text-20px font-bold" />
</NButton> </NButton>
</template> </template>
刷新 刷新
@ -336,7 +341,16 @@ const onUpdatePage = (page: number) => {
</template> </template>
重试 重试
</NTooltip> </NTooltip>
</div>
-->
</template> </template>
<NCard
:bordered="false"
size="small"
class="sm:flex-1-hidden card-wrapper pt-16px"
:content-style="{ padding: 0 }"
:header-style="{ padding: 0 }"
>
<NDataTable <NDataTable
:columns="columns" :columns="columns"
:data="dataSource" :data="dataSource"
@ -350,6 +364,8 @@ const onUpdatePage = (page: number) => {
</NCard> </NCard>
</NTabPane> </NTabPane>
</NTabs> </NTabs>
</NTabPane>
</NTabs>
<template v-if="ids && ids.length > 1" #footer> <template v-if="ids && ids.length > 1" #footer>
<NPagination <NPagination
v-model:page="currentIndex" v-model:page="currentIndex"
@ -386,4 +402,15 @@ const onUpdatePage = (page: number) => {
:deep(.n-tab-pane) { :deep(.n-tab-pane) {
padding-top: 0 !important; padding-top: 0 !important;
} }
.detail-tabs {
:deep(.n-tabs-nav) {
display: flex !important;
}
:deep(.n-tabs-tab__label) {
width: 100%;
justify-content: center;
}
}
</style> </style>

View File

@ -146,8 +146,8 @@ const onDragstop = () => {
</div> </div>
</div> </div>
</NAffix> </NAffix>
<div class="workflow-body">
<NSpin :show="spinning"> <NSpin :show="spinning">
<div class="workflow-body">
<VueDragResize <VueDragResize
class="vue-drag" class="vue-drag"
:is-draggable="true" :is-draggable="true"
@ -166,8 +166,8 @@ const onDragstop = () => {
</div> </div>
</div> </div>
</VueDragResize> </VueDragResize>
</NSpin>
</div> </div>
</NSpin>
</div> </div>
</div> </div>
</template> </template>