2024-11-21 16:29:40 +08:00
|
|
|
<script setup lang="ts">
|
2024-12-12 16:07:42 +08:00
|
|
|
import type { TaskInfo } from '#/api/workflow/task/model';
|
|
|
|
|
|
|
|
import { VbenAvatar } from '@vben/common-ui';
|
|
|
|
import { DictEnum } from '@vben/constants';
|
|
|
|
|
|
|
|
import { Descriptions, DescriptionsItem } from 'ant-design-vue';
|
|
|
|
|
|
|
|
import { renderDict } from '#/utils/render';
|
|
|
|
|
|
|
|
interface Props extends TaskInfo {
|
2024-11-21 19:21:20 +08:00
|
|
|
active: boolean;
|
2024-11-21 16:29:40 +08:00
|
|
|
}
|
|
|
|
|
2024-11-21 19:21:20 +08:00
|
|
|
const props = withDefaults(defineProps<{ info: Props }>(), {});
|
|
|
|
|
|
|
|
const emit = defineEmits<{ click: [string] }>();
|
|
|
|
|
|
|
|
function handleClick() {
|
|
|
|
emit('click', props.info.id);
|
|
|
|
}
|
2024-11-21 16:29:40 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div
|
2024-11-21 19:53:16 +08:00
|
|
|
:class="{
|
|
|
|
'border-primary': info.active,
|
|
|
|
'border-[2px]': info.active,
|
|
|
|
}"
|
|
|
|
class="cursor-pointer rounded-lg border-[1px] border-solid p-3 transition-shadow duration-300 ease-in-out hover:shadow-lg"
|
2024-11-21 19:21:20 +08:00
|
|
|
@click.stop="handleClick"
|
2024-11-21 16:29:40 +08:00
|
|
|
>
|
2024-12-12 16:07:42 +08:00
|
|
|
<Descriptions :column="1" :title="info.flowName" size="middle">
|
2024-11-21 16:29:40 +08:00
|
|
|
<template #extra>
|
2024-12-12 16:07:42 +08:00
|
|
|
<component
|
|
|
|
:is="renderDict(info.flowStatus, DictEnum.WF_BUSINESS_STATUS)"
|
|
|
|
/>
|
2024-11-21 16:29:40 +08:00
|
|
|
</template>
|
2024-12-12 16:07:42 +08:00
|
|
|
<DescriptionsItem label="当前节点名称">
|
|
|
|
<div class="font-bold">{{ info.nodeName }}</div>
|
|
|
|
</DescriptionsItem>
|
|
|
|
<DescriptionsItem label="开始时间">
|
|
|
|
{{ info.createTime }}
|
|
|
|
</DescriptionsItem>
|
|
|
|
<!-- <DescriptionsItem label="更新时间">
|
|
|
|
{{ info.updateTime }}
|
|
|
|
</DescriptionsItem> -->
|
2024-11-21 16:29:40 +08:00
|
|
|
</Descriptions>
|
|
|
|
<div class="flex items-center justify-between text-[14px]">
|
|
|
|
<div class="flex items-center gap-1">
|
2024-12-16 17:23:05 +08:00
|
|
|
<VbenAvatar
|
|
|
|
:alt="info.createByName"
|
|
|
|
class="bg-primary size-[24px] rounded-full text-white"
|
|
|
|
src=""
|
|
|
|
/>
|
2024-12-16 09:45:00 +08:00
|
|
|
<span class="opacity-50">{{ info.createByName }}</span>
|
2024-11-21 16:29:40 +08:00
|
|
|
</div>
|
2024-12-12 16:07:42 +08:00
|
|
|
<div class="opacity-50">更新时间: 2222-22-22</div>
|
2024-11-21 16:29:40 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
:deep(.ant-descriptions .ant-descriptions-header) {
|
|
|
|
margin-bottom: 12px !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
:deep(.ant-descriptions-item) {
|
|
|
|
padding-bottom: 8px !important;
|
|
|
|
}
|
|
|
|
</style>
|