83 lines
5.2 KiB
Vue
83 lines
5.2 KiB
Vue
<template>
|
|
<ContentWrap>
|
|
<el-page-header @back="goBack" content="夹具详情" />
|
|
</ContentWrap>
|
|
<ContentWrap v-loading="loading">
|
|
<el-descriptions :column="3" border title="基本信息">
|
|
<el-descriptions-item label="夹具编号">{{ detail.fixtureCode }}</el-descriptions-item>
|
|
<el-descriptions-item label="夹具名称">{{ detail.fixtureName }}</el-descriptions-item>
|
|
<el-descriptions-item label="规格">
|
|
<dict-tag :type="DICT_TYPE.LAB_FIXTURE_SIZE" :value="detail.fixtureSize ?? ''" />
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="识别码">{{ detail.identifyCode || '-' }}</el-descriptions-item>
|
|
<el-descriptions-item label="外部编号">{{ detail.externalId || '-' }}</el-descriptions-item>
|
|
<el-descriptions-item label="状态">
|
|
<dict-tag :type="DICT_TYPE.LAB_MASTER_STATUS" :value="detail.status ?? ''" />
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="创建时间">{{ formatNullableDate(detail.createTime) }}</el-descriptions-item>
|
|
<el-descriptions-item label="更新时间" :span="2">{{ formatNullableDate(detail.updateTime) }}</el-descriptions-item>
|
|
<el-descriptions-item label="安装说明" :span="3">{{ detail.installDesc || '-' }}</el-descriptions-item>
|
|
</el-descriptions>
|
|
<div class="mb-8px mt-20px font-bold">适用对象</div>
|
|
<el-table :data="detail.applicables || []" border>
|
|
<el-table-column label="类型" prop="objectType" width="120">
|
|
<template #default="scope">{{ scope.row.objectType === 'SAMPLE' ? '样品' : '零件号' }}</template>
|
|
</el-table-column>
|
|
<el-table-column label="样品编号" prop="sampleCode" />
|
|
<el-table-column label="样品名称" prop="sampleName" />
|
|
<el-table-column label="零件号" prop="partNo" />
|
|
</el-table>
|
|
<div class="mb-8px mt-20px font-bold">夹具框架点</div>
|
|
<div class="flex items-center gap-12px"><el-tag :type="framework.current?.id ? 'success' : 'warning'">{{ framework.current?.id ? '可复用' : '未配置' }}</el-tag><el-button link type="primary" @click="frameworkRef.open(detail)">查看 / 下载 / 复制</el-button></div>
|
|
<p v-if="framework.current?.id" class="text-13px text-[var(--el-text-color-secondary)]">框架点保存时间:{{ formatNullableDate(framework.current.updatedAt) }}</p>
|
|
<div class="mb-8px mt-20px font-bold">扫描轨迹</div>
|
|
<el-descriptions :column="1" border>
|
|
<el-descriptions-item label="默认扫描方案">{{ detail.defaultTestCaseId ? detail.defaultTestCaseName || detail.defaultTestCaseId : '未关联' }}</el-descriptions-item>
|
|
<el-descriptions-item label="发布状态"><el-tag :type="scanStatus(detail).type">{{ scanStatus(detail).label }}</el-tag></el-descriptions-item>
|
|
</el-descriptions>
|
|
<p class="text-13px text-[var(--el-text-color-secondary)]">扫描任务选择此夹具时预选关联方案,准备时仍可手动更换。</p>
|
|
<div class="mb-8px mt-20px font-bold">机械臂轨迹文件</div>
|
|
<div class="flex items-center gap-12px">
|
|
<el-tag :type="detail.trajectoryStatus === 'LINKED' ? 'success' : 'info'">{{ detail.trajectoryStatus === 'LINKED' ? '已关联 · V' + detail.trajectoryVersion : '未关联' }}</el-tag>
|
|
<span>{{ detail.trajectoryFileName || '尚未关联机械臂轨迹文件' }}</span>
|
|
<el-button link type="primary" @click="trajectoryRef.open(detail)">查看与关联文件</el-button>
|
|
</div>
|
|
<div class="mb-8px mt-20px font-bold">附件</div>
|
|
<MasterAttachmentPanel v-if="detail.id" biz-type="FIXTURE" :biz-id="detail.id" />
|
|
</ContentWrap>
|
|
<FixtureTrajectory ref="trajectoryRef" @updated="load" />
|
|
<FixtureFramework ref="frameworkRef" @updated="load" />
|
|
</template>
|
|
<script lang="ts" setup>
|
|
import { formatNullableDate } from '@/utils/formatTime'
|
|
import { DICT_TYPE } from '@/utils/dict'
|
|
import * as FixtureApi from '@/api/lab/master/fixture'
|
|
import MasterAttachmentPanel from '../components/MasterAttachmentPanel.vue'
|
|
import FixtureTrajectory from './FixtureTrajectory.vue'
|
|
import FixtureFramework from './FixtureFramework.vue'
|
|
const scanStatus = (fixture: FixtureApi.LabFixtureVO): { type: 'info' | 'success' | 'warning'; label: string } => {
|
|
if (!fixture.defaultTestCaseId) return { type: 'info', label: '未关联' }
|
|
if (fixture.defaultScanStatus === 'PUBLISHED' && Number.isInteger(fixture.defaultVersionNo) && (fixture.defaultVersionNo ?? 0) > 0)
|
|
return { type: 'success', label: `已关联 · V${fixture.defaultVersionNo}` }
|
|
return { type: 'warning', label: fixture.defaultScanStatus === 'UNPUBLISHED' ? '已关联 · 未发布' : '关联方案不可用' }
|
|
}
|
|
const trajectoryRef = ref()
|
|
const frameworkRef=ref(),framework=shallowRef<any>({})
|
|
|
|
defineOptions({ name: 'LabFixtureDetail' })
|
|
const route = useRoute()
|
|
const { push } = useRouter()
|
|
const loading = ref(false)
|
|
const detail = ref<FixtureApi.LabFixtureVO>({} as FixtureApi.LabFixtureVO)
|
|
const load = async () => {
|
|
loading.value = true
|
|
try {
|
|
const [fixture,points]=await Promise.all([FixtureApi.getFixture(String(route.params.id)),FixtureApi.getFramework(String(route.params.id))]);detail.value=fixture;framework.value=points
|
|
} finally {
|
|
loading.value = false
|
|
}
|
|
}
|
|
const goBack = () => push({ name: 'LabFixture' })
|
|
onMounted(load)
|
|
</script>
|