Files
zkxw/mobile-oa-h5/src/oa/components/OaProgressTimeline.vue
T
2026-08-12 16:17:24 +08:00

156 lines
3.5 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div class="oa-progress">
<div class="oa-progress__title">审批进度</div>
<div v-if="!items.length" class="oa-progress__empty">暂无任务记录</div>
<div v-else class="oa-progress__chain">
<div v-for="(item, idx) in items" :key="item.key || idx" class="oa-progress-step">
<div class="oa-progress-rail">
<div class="oa-progress-dot" :class="dotClass(item)" />
<div v-if="idx < items.length - 1" class="oa-progress-line" />
</div>
<div class="oa-progress-card">
<div class="oa-progress-card__row">
<span class="oa-progress-card__name">{{ item.title || '-' }}</span>
<span
v-if="item.status"
class="oa-progress-badge"
:class="statusTone(item.status)"
>
{{ statusText(item.status) }}
</span>
</div>
<div v-if="item.assignee" class="oa-progress-card__meta">
{{ item.assignee }}
</div>
<div v-if="item.timestamp" class="oa-progress-card__meta">
{{ item.timestamp }}
</div>
<div v-if="item.commentText" class="oa-progress-card__comment">
意见:{{ item.commentText }}
</div>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { statusText, statusTone } from '../status-label.js'
defineProps({
items: { type: Array, default: () => [] }
})
function dotClass(item) {
return statusTone(item?.status)
}
</script>
<style scoped>
.oa-progress {
margin-top: 16px;
padding: 14px 12px 8px;
background: #fff;
border-radius: 12px;
border: 1px solid var(--border, #d8f3e5);
}
.oa-progress__title {
margin-bottom: 12px;
font-size: 15px;
font-weight: 700;
color: var(--text-primary, #0f291e);
}
.oa-progress__empty {
padding: 12px 4px 16px;
color: var(--text-muted, #5f7a6d);
font-size: 13px;
line-height: 1.5;
}
.oa-progress-step {
display: flex;
gap: 10px;
min-height: 56px;
}
.oa-progress-rail {
display: flex;
flex-direction: column;
align-items: center;
width: 16px;
}
.oa-progress-dot {
width: 10px;
height: 10px;
margin-top: 6px;
border-radius: 50%;
background: var(--brand-green, #22c55e);
}
.oa-progress-dot.warn {
background: var(--warning, #d97706);
}
.oa-progress-dot.danger {
background: var(--danger, #ef4444);
}
.oa-progress-dot.mute {
background: #94a3b8;
}
.oa-progress-line {
flex: 1;
width: 2px;
margin: 4px 0;
background: #d1fae5;
}
.oa-progress-card {
flex: 1;
padding: 0 0 16px;
min-width: 0;
}
.oa-progress-card__row {
display: flex;
flex-wrap: wrap;
gap: 6px;
align-items: center;
}
.oa-progress-card__name {
font-size: 14px;
font-weight: 600;
color: var(--text-primary, #0f291e);
}
.oa-progress-badge {
flex-shrink: 0;
padding: 1px 6px;
border-radius: 4px;
font-size: 11px;
}
.oa-progress-badge.ok {
color: var(--success, #10b981);
background: var(--brand-green-soft, #ecfdf5);
}
.oa-progress-badge.warn {
color: var(--warning, #d97706);
background: var(--barley-yellow-soft, #fffbeb);
}
.oa-progress-badge.danger {
color: var(--danger, #ef4444);
background: #fef2f2;
}
.oa-progress-badge.mute {
color: var(--text-muted, #5f7a6d);
background: #f1f5f9;
}
.oa-progress-card__meta {
margin-top: 4px;
color: var(--text-muted, #5f7a6d);
font-size: 12px;
line-height: 1.4;
}
.oa-progress-card__comment {
margin-top: 6px;
padding: 8px 10px;
border-radius: 8px;
background: #f8fafc;
color: var(--text-primary, #0f291e);
font-size: 12px;
line-height: 1.5;
}
</style>