| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- 审æ¹å®ä¾ï¼tasks å®¡æ¹æµç¨å±ç¤ºï¼æ¨ªåæ¥éª¤æ¡ï¼ --> |
| | | <template> |
| | | <div v-if="displayNodes.length" class="flow-track"> |
| | | <div |
| | | v-for="(node, index) in displayNodes" |
| | | :key="index" |
| | | class="flow-step" |
| | | :class="{ 'is-last': index === displayNodes.length - 1 }" |
| | | > |
| | | <div class="flow-step-card"> |
| | | <div class="flow-step-badge">{{ index + 1 }}</div> |
| | | <div class="flow-step-main"> |
| | | <div class="flow-step-head"> |
| | | <span class="flow-step-name">èç¹ {{ index + 1 }}</span> |
| | | <el-tag size="small" :type="node.signMode === 'or_sign' ? 'warning' : 'primary'" effect="plain"> |
| | | {{ nodeSignModeLabel(node.signMode) }} |
| | | </el-tag> |
| | | </div> |
| | | <div class="flow-approvers"> |
| | | <div |
| | | v-for="a in node.approvers" |
| | | :key="String(a.approverId ?? a.id)" |
| | | class="flow-approver" |
| | | > |
| | | <span class="flow-approver-name">{{ a.approverName || "â" }}</span> |
| | | <el-tag |
| | | v-if="a.status" |
| | | size="small" |
| | | :type="mapTaskStatusTagType(a.status)" |
| | | effect="plain" |
| | | > |
| | | {{ mapTaskStatusLabel(a.status) }} |
| | | </el-tag> |
| | | </div> |
| | | <span v-if="!node.approvers?.length" class="flow-empty">æªé
置审æ¹äºº</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-if="index < displayNodes.length - 1" class="flow-connector" aria-hidden="true"> |
| | | <el-icon><ArrowRight /></el-icon> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <el-empty v-else description="ææ æµç¨èç¹" :image-size="48" /> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { computed } from "vue"; |
| | | import { ArrowRight } from "@element-plus/icons-vue"; |
| | | import { nodeSignModeLabel } from "../../approve-template/approveTemplateConstants.js"; |
| | | import { |
| | | mapTaskStatusLabel, |
| | | mapTaskStatusTagType, |
| | | mapTasksToFlowNodes, |
| | | } from "../approveListConstants.js"; |
| | | |
| | | const props = defineProps({ |
| | | tasks: { type: Array, default: () => [] }, |
| | | nodes: { type: Array, default: () => [] }, |
| | | }); |
| | | |
| | | const displayNodes = computed(() => { |
| | | if (props.tasks?.length) return mapTasksToFlowNodes(props.tasks); |
| | | return props.nodes || []; |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .flow-track { |
| | | display: flex; |
| | | align-items: stretch; |
| | | gap: 0; |
| | | overflow-x: auto; |
| | | padding: 4px 2px 8px; |
| | | } |
| | | .flow-step { |
| | | display: flex; |
| | | align-items: center; |
| | | flex: 0 0 auto; |
| | | } |
| | | .flow-step-card { |
| | | display: flex; |
| | | gap: 12px; |
| | | min-width: 200px; |
| | | max-width: 260px; |
| | | padding: 14px; |
| | | border: 1px solid var(--el-border-color-lighter); |
| | | border-radius: 8px; |
| | | background: var(--el-bg-color); |
| | | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); |
| | | } |
| | | .flow-step-badge { |
| | | flex-shrink: 0; |
| | | width: 28px; |
| | | height: 28px; |
| | | border-radius: 50%; |
| | | background: var(--el-color-primary-light-9); |
| | | color: var(--el-color-primary); |
| | | font-size: 13px; |
| | | font-weight: 600; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .flow-step-main { |
| | | flex: 1; |
| | | min-width: 0; |
| | | } |
| | | .flow-step-head { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | gap: 8px; |
| | | margin-bottom: 10px; |
| | | } |
| | | .flow-step-name { |
| | | font-weight: 600; |
| | | font-size: 13px; |
| | | color: var(--el-text-color-primary); |
| | | } |
| | | .flow-approvers { |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 6px; |
| | | } |
| | | .flow-approver { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | align-items: center; |
| | | gap: 6px; |
| | | } |
| | | .flow-approver-name { |
| | | font-size: 13px; |
| | | color: var(--el-text-color-regular); |
| | | } |
| | | .flow-empty { |
| | | font-size: 12px; |
| | | color: var(--el-text-color-placeholder); |
| | | } |
| | | .flow-connector { |
| | | display: flex; |
| | | align-items: center; |
| | | padding: 0 6px; |
| | | color: var(--el-text-color-placeholder); |
| | | font-size: 16px; |
| | | } |
| | | </style> |