mirror of
https://gitee.com/dapppp/ruoyi-plus-vben5.git
synced 2026-04-09 18:03:14 +08:00
refactor: timeline样式
This commit is contained in:
@@ -1,14 +1,18 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Flow } from '#/api/workflow/instance/model';
|
import type { Flow } from '#/api/workflow/instance/model';
|
||||||
|
|
||||||
import { onMounted, ref } from 'vue';
|
import { computed, h, onMounted, ref } from 'vue';
|
||||||
|
|
||||||
import { VbenAvatar } from '@vben/common-ui';
|
import { VbenAvatar } from '@vben/common-ui';
|
||||||
import { DictEnum } from '@vben/constants';
|
import { DictEnum } from '@vben/constants';
|
||||||
import { cn } from '@vben/utils';
|
import { cn } from '@vben/utils';
|
||||||
|
|
||||||
import { MessageOutlined } from '@ant-design/icons-vue';
|
import {
|
||||||
import { TimelineItem } from 'ant-design-vue';
|
MessageOutlined,
|
||||||
|
UsergroupAddOutlined,
|
||||||
|
UserOutlined,
|
||||||
|
} from '@ant-design/icons-vue';
|
||||||
|
import { Avatar, TimelineItem } from 'ant-design-vue';
|
||||||
|
|
||||||
import { ossInfo } from '#/api/system/oss';
|
import { ossInfo } from '#/api/system/oss';
|
||||||
import { renderDict } from '#/utils/render';
|
import { renderDict } from '#/utils/render';
|
||||||
@@ -40,13 +44,27 @@ onMounted(async () => {
|
|||||||
name: item.originalName,
|
name: item.originalName,
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 这里无法处理昵称中带,的情况
|
||||||
|
*/
|
||||||
|
const isMultiplePerson = computed(
|
||||||
|
() => props.item.approveName?.split(',').length > 1,
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<TimelineItem>
|
<TimelineItem>
|
||||||
<template #dot>
|
<template #dot>
|
||||||
<div class="relative rounded-full border">
|
<div class="relative rounded-full border">
|
||||||
|
<Avatar
|
||||||
|
class="bg-primary-400"
|
||||||
|
v-if="isMultiplePerson"
|
||||||
|
:size="36"
|
||||||
|
:icon="h(UsergroupAddOutlined)"
|
||||||
|
/>
|
||||||
<VbenAvatar
|
<VbenAvatar
|
||||||
|
v-else
|
||||||
:alt="item?.approveName ?? 'unknown'"
|
:alt="item?.approveName ?? 'unknown'"
|
||||||
class="bg-primary size-[36px] rounded-full text-white"
|
class="bg-primary size-[36px] rounded-full text-white"
|
||||||
src=""
|
src=""
|
||||||
@@ -62,12 +80,28 @@ onMounted(async () => {
|
|||||||
></div>
|
></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<div class="ml-2 flex flex-col gap-0.5">
|
<div class="mb-5 ml-2 flex flex-col gap-1">
|
||||||
<div class="flex items-center gap-1">
|
<div class="flex items-center gap-1">
|
||||||
<div class="font-bold">{{ item.nodeName }}</div>
|
<div class="font-bold">{{ item.nodeName }}</div>
|
||||||
<component :is="renderDict(item.flowStatus, DictEnum.WF_TASK_STATUS)" />
|
<component :is="renderDict(item.flowStatus, DictEnum.WF_TASK_STATUS)" />
|
||||||
</div>
|
</div>
|
||||||
<div>{{ item.approveName }}</div>
|
|
||||||
|
<div :class="cn('mt-2 flex flex-wrap gap-2')" v-if="isMultiplePerson">
|
||||||
|
<div
|
||||||
|
:class="cn('bg-foreground/5 flex items-center rounded-full', 'p-1')"
|
||||||
|
v-for="(name, index) in item.approveName.split(',')"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<Avatar
|
||||||
|
class="bg-primary-400 flex items-center justify-center"
|
||||||
|
:size="24"
|
||||||
|
:icon="h(UserOutlined)"
|
||||||
|
/>
|
||||||
|
<span class="px-1">{{ name }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else>{{ item.approveName }}</div>
|
||||||
|
|
||||||
<div>{{ item.updateTime }}</div>
|
<div>{{ item.updateTime }}</div>
|
||||||
<div
|
<div
|
||||||
v-if="item.message"
|
v-if="item.message"
|
||||||
|
|||||||
Reference in New Issue
Block a user