优化
This commit is contained in:
@@ -24,19 +24,21 @@ const emit = defineEmits<{
|
||||
<footer class="editor-page-footer"><slot name="footer" /></footer>
|
||||
</section>
|
||||
|
||||
<el-drawer
|
||||
<el-dialog
|
||||
v-else
|
||||
class="first-leg-editor"
|
||||
class="first-leg-editor-dialog"
|
||||
:model-value="modelValue"
|
||||
:title="title"
|
||||
size="1080px"
|
||||
width="94vw"
|
||||
top="3vh"
|
||||
destroy-on-close
|
||||
append-to-body
|
||||
:before-close="beforeClose"
|
||||
@update:model-value="emit('update:modelValue', $event)"
|
||||
>
|
||||
<slot />
|
||||
<template #footer><slot name="footer" /></template>
|
||||
</el-drawer>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
@@ -48,15 +50,24 @@ const emit = defineEmits<{
|
||||
.editor-page-footer :deep(.editor-actions) { width: min(100%, 900px); justify-content: flex-start; }
|
||||
.editor-page-footer :deep(.editor-actions > .el-button) { min-width: 132px; min-height: 42px; }
|
||||
.editor-page-footer :deep(.editor-actions > .el-button:last-child) { min-width: 172px; }
|
||||
:global(.first-leg-editor-dialog.el-dialog) { display: flex; max-width: 1500px; height: 94vh; margin-bottom: 0; flex-direction: column; overflow: hidden; border-radius: 6px; }
|
||||
:global(.first-leg-editor-dialog .el-dialog__header) { flex: 0 0 auto; margin-right: 0; padding: 17px 22px; border-bottom: 1px solid var(--border); }
|
||||
:global(.first-leg-editor-dialog .el-dialog__title) { color: var(--navy); font-size: 16px; font-weight: 700; }
|
||||
:global(.first-leg-editor-dialog .el-dialog__headerbtn) { top: 8px; right: 10px; width: 44px; height: 44px; }
|
||||
:global(.first-leg-editor-dialog .el-dialog__body) { min-height: 0; flex: 1 1 auto; overflow-y: auto; padding: 22px 24px 28px; overscroll-behavior: contain; }
|
||||
:global(.first-leg-editor-dialog .el-dialog__footer) { flex: 0 0 auto; padding: 12px 22px; border-top: 1px solid var(--border); background: #fff; }
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.editor-page-nav { align-items: flex-start; flex-direction: column; gap: 2px; padding: 10px 16px; }
|
||||
.editor-page-nav span { padding-left: 1px; line-height: 1.5; }
|
||||
.editor-page-body { padding: 18px 16px 24px; }
|
||||
.editor-page-footer { padding: 10px 16px; }
|
||||
:global(.first-leg-editor-dialog.el-dialog) { width: calc(100vw - 24px) !important; height: 96vh; margin-top: 2vh; }
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.editor-page-footer { position: static; }
|
||||
:global(.first-leg-editor-dialog.el-dialog) { width: 100vw !important; height: 100vh; margin: 0; border-radius: 0; }
|
||||
:global(.first-leg-editor-dialog .el-dialog__body) { padding: 16px 12px 22px; }
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { Check, CircleDot, Clock3, Paperclip } from '@lucide/vue'
|
||||
import { Check, CircleDot } from '@lucide/vue'
|
||||
import type { FirstLegOrder } from '@/modules/first-leg/types/firstLegOrder'
|
||||
import {
|
||||
FIRST_LEG_PROGRESS_STAGES,
|
||||
@@ -11,27 +11,11 @@ import {
|
||||
const props = defineProps<{ order: FirstLegOrder }>()
|
||||
|
||||
const currentIndex = computed(() => getFirstLegProgressIndex(props.order.status))
|
||||
const timeline = computed(() => [...props.order.timeline].reverse())
|
||||
|
||||
function stageState(index: number) {
|
||||
if (index < currentIndex.value) return 'is-complete'
|
||||
if (index === currentIndex.value) return 'is-current'
|
||||
return 'is-pending'
|
||||
}
|
||||
|
||||
function formatDateTime(value: string) {
|
||||
if (!value) return '时间待更新'
|
||||
const date = new Date(value)
|
||||
if (Number.isNaN(date.getTime())) return value
|
||||
return date.toLocaleString('zh-CN', {
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
hour12: false,
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -54,37 +38,17 @@ function formatDateTime(value: string) {
|
||||
</ol>
|
||||
<p v-if="order.status === 'DRAFT'" class="draft-progress-note">订单提交后开始记录主状态进度。</p>
|
||||
|
||||
<div class="timeline-heading">
|
||||
<h4>进度记录</h4>
|
||||
<span>{{ timeline.length }} 条</span>
|
||||
</div>
|
||||
<el-empty v-if="timeline.length === 0" class="timeline-empty" description="暂无进度记录" :image-size="52" />
|
||||
<el-timeline v-else class="order-timeline">
|
||||
<el-timeline-item v-for="item in timeline" :key="item.id" :timestamp="formatDateTime(item.occurredAt)" placement="top" :type="item.kind === 'MAIN_STATUS' ? 'primary' : 'info'">
|
||||
<div class="timeline-title">
|
||||
<strong>{{ item.title }}</strong>
|
||||
<el-tag v-if="item.kind === 'CUSTOM_NODE'" size="small" effect="plain">业务节点</el-tag>
|
||||
<el-tag v-else-if="item.status" size="small" effect="plain">{{ getFirstLegStatusLabel(item.status) }}</el-tag>
|
||||
</div>
|
||||
<p v-if="item.description">{{ item.description }}</p>
|
||||
<div class="timeline-meta">
|
||||
<span>{{ item.operatorName || '平台' }}</span>
|
||||
<span v-if="item.kind === 'CUSTOM_NODE' && item.plannedAt"><Clock3 :size="13" />计划 {{ formatDateTime(item.plannedAt) }}</span>
|
||||
<span v-if="item.attachmentCount"><Paperclip :size="13" />{{ item.attachmentCount }} 个附件</span>
|
||||
</div>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.order-progress { margin-top: 22px; }
|
||||
.progress-heading, .timeline-heading, .timeline-title, .timeline-meta { display: flex; align-items: center; }
|
||||
.progress-heading { display: flex; align-items: center; }
|
||||
.progress-heading { justify-content: space-between; gap: 14px; }
|
||||
.progress-heading > div { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
|
||||
.progress-heading h3, .timeline-heading h4 { margin: 0; color: var(--navy); }
|
||||
.progress-heading h3 { margin: 0; color: var(--navy); }
|
||||
.progress-heading h3 { font-size: 15px; }
|
||||
.progress-heading span, .timeline-heading span { color: var(--muted); font-size: 11px; }
|
||||
.progress-heading span { color: var(--muted); font-size: 11px; }
|
||||
.progress-stages { display: grid; grid-template-columns: repeat(7, minmax(76px, 1fr)); margin: 16px 0 0; padding: 0; overflow-x: auto; list-style: none; }
|
||||
.progress-stages li { position: relative; display: flex; min-width: 76px; align-items: center; flex-direction: column; gap: 7px; color: #96a0a6; font-size: 10px; text-align: center; }
|
||||
.progress-stages li::before { position: absolute; top: 10px; right: 50%; left: -50%; height: 2px; background: #e1e6e8; content: ''; }
|
||||
@@ -95,15 +59,6 @@ function formatDateTime(value: string) {
|
||||
.is-complete .stage-marker { background: var(--primary); color: #fff; }
|
||||
.is-current .stage-label { color: var(--navy); font-weight: 700; }
|
||||
.draft-progress-note { margin: 12px 0 0; padding: 10px 12px; background: #f6f8f8; color: var(--muted); font-size: 11px; }
|
||||
.timeline-heading { justify-content: space-between; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
|
||||
.timeline-heading h4 { font-size: 13px; }
|
||||
.order-timeline { margin-top: 14px; padding-left: 5px; }
|
||||
.timeline-title { flex-wrap: wrap; gap: 8px; }
|
||||
.timeline-title strong { color: var(--navy); font-size: 12px; }
|
||||
.order-timeline p { margin: 6px 0; overflow-wrap: anywhere; color: var(--muted); font-size: 11px; line-height: 1.55; white-space: pre-wrap; }
|
||||
.timeline-meta { flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 10px; }
|
||||
.timeline-meta span { display: inline-flex; align-items: center; gap: 4px; }
|
||||
.timeline-empty { padding: 12px 0 0; }
|
||||
@media (max-width: 720px) {
|
||||
.progress-stages { grid-template-columns: repeat(7, 82px); padding-bottom: 8px; }
|
||||
.progress-heading { align-items: flex-start; }
|
||||
|
||||
Reference in New Issue
Block a user