<script setup lang="ts">
|
import { computed } from "vue";
|
import type { PointCloudArtifactHealth, PointCloudSemanticModel } from "@/api/artifacts";
|
|
const props = defineProps<{ model?: PointCloudSemanticModel; health?: PointCloudArtifactHealth | null }>();
|
const modelHealth = computed(() => props.model ? props.health?.records.find((item) => item.artifactRoot === props.model?.artifactRoot) : undefined);
|
</script>
|
|
<template>
|
<a-alert v-if="model" class="model-card" :type="modelHealth?.status === 'invalid' ? 'error' : 'info'" show-icon :message="`模型版本:${model.label}`">
|
<template #description><a-space direction="vertical" :size="4"><span>测试 F1:{{ Object.entries(model.testF1).map(([key, score]) => `${key} ${score.toFixed(3)}`).join(';') || '未记录可用测试指标' }}</span><span>训练类别:{{ Object.values(model.classes).map((item) => item.label).join(' / ') }}</span><span v-if="modelHealth?.status === 'invalid'">产物校验失败:{{ [...modelHealth.missing, ...modelHealth.errors].join(';') }}</span><span v-else>产物校验:{{ health ? '通过当前本机检查' : '正在读取' }}</span></a-space></template>
|
</a-alert>
|
</template>
|
|
<style scoped>.model-card { margin-bottom: 12px; }</style>
|