fix: 使用 NScrollbar 统一内容区滚动条

This commit is contained in:
GouJ committed 2026-09-01 16:44:30 +08:00
1 parent db8c176b55
commit 3fe1b3f5c3
17 files changed
+967 -737

No files matched your search

+28 -24
View File
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { computed } from 'vue'
import { NEmpty, NTimeline, NTimelineItem } from 'naive-ui'
import { NScrollbar, NEmpty, NTimeline, NTimelineItem } from 'naive-ui'
import { Clock3 } from '@lucide/vue'
import { formatDate, nodeLabel } from '../../lib/format'
import { workflowCheckpoints } from './selectors'
@@ -13,29 +13,33 @@ const history = computed(() => workflowCheckpoints(props.checkpoints, props.work
<template>
<aside class="history-panel">
<h3 class="mb-1 flex items-center gap-2 text-sm font-semibold"><Clock3 :size="15" />执行记录</h3>
<p class="mb-6 text-xs leading-5 text-muted">最近 18 个 checkpoint · 自动刷新</p>
<NEmpty v-if="!history.length" size="small" description="工作流尚未保存执行记录。" />
<NTimeline v-else>
<NTimelineItem
v-for="item in history"
:key="item.checkpointId"
:type="item.state.workflowExecution?.status === 'failed' ? 'error' : 'default'"
>
<p class="text-xs font-medium">{{ nodeLabel(item.metadata?.nodeName) }}</p>
<p class="mt-1 text-[11px] text-muted">
{{ formatDate(item.createdAt)
}}<span v-if="item.metadata?.nodeDurationMs">
· {{ (item.metadata.nodeDurationMs / 1000).toFixed(1) }}s</span
>
</p>
<span v-if="item.state.workflowExecution?.status === 'failed'" class="mt-1 block text-xs text-danger"
>运行失败</span
<NScrollbar class="panel-scroll" content-class="history-content">
<h3 class="mb-1 flex items-center gap-2 text-sm font-semibold"><Clock3 :size="15" />执行记录</h3>
<p class="mb-6 text-xs leading-5 text-muted">最近 18 个 checkpoint · 自动刷新</p>
<NEmpty v-if="!history.length" size="small" description="工作流尚未保存执行记录。" />
<NTimeline v-else>
<NTimelineItem
v-for="item in history"
:key="item.checkpointId"
:type="item.state.workflowExecution?.status === 'failed' ? 'error' : 'default'"
>
</NTimelineItem>
</NTimeline>
<p class="mt-5 border-t border-line pt-4 text-[11px] leading-5 text-muted">
记录在节点或批次结束后更新,长时间无新记录不一定意味着任务失败。
</p>
<p class="text-xs font-medium">{{ nodeLabel(item.metadata?.nodeName) }}</p>
<p class="mt-1 text-[11px] text-muted">
{{ formatDate(item.createdAt)
}}<span v-if="item.metadata?.nodeDurationMs">
· {{ (item.metadata.nodeDurationMs / 1000).toFixed(1) }}s</span
>
</p>
<span
v-if="item.state.workflowExecution?.status === 'failed'"
class="mt-1 block text-xs text-danger"
>运行失败</span
>
</NTimelineItem>
</NTimeline>
<p class="mt-5 border-t border-line pt-4 text-[11px] leading-5 text-muted">
记录在节点或批次结束后更新,长时间无新记录不一定意味着任务失败。
</p>
</NScrollbar>
</aside>
</template>