80 lines
2.8 KiB
Vue
80 lines
2.8 KiB
Vue
<template>
|
|
<div class="device-status-table">
|
|
<el-table :data="tableData" border style="width: 100%">
|
|
<el-table-column prop="name" label="参数" align="center" />
|
|
<el-table-column prop="arm1" label="扫描臂1" align="center">
|
|
<template #default="scope">
|
|
<template v-if="scope.row.type === 'tag'">
|
|
<el-tag :type="scope.row.arm1.type" effect="plain">
|
|
{{ scope.row.arm1.value }}
|
|
</el-tag>
|
|
</template>
|
|
<template v-else>
|
|
{{ scope.row.arm1 }}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="arm2" label="扫描臂2" align="center">
|
|
<template #default="scope">
|
|
<template v-if="scope.row.type === 'tag'">
|
|
<el-tag :type="scope.row.arm2.type" effect="plain">
|
|
{{ scope.row.arm2.value }}
|
|
</el-tag>
|
|
</template>
|
|
<template v-else>
|
|
{{ scope.row.arm2 }}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { computed } from 'vue'
|
|
|
|
const props = defineProps({
|
|
statusData: {
|
|
type: Object,
|
|
required: true
|
|
}
|
|
})
|
|
|
|
const tableData = computed(() => [
|
|
{ name: '通信状态', arm1: props.statusData.arm1.communication, arm2: props.statusData.arm2.communication },
|
|
{ name: '故障状态', arm1: props.statusData.arm1.fault, arm2: props.statusData.arm2.fault },
|
|
{ name: '使能状态', arm1: props.statusData.arm1.enable, arm2: props.statusData.arm2.enable },
|
|
{ name: '当前位置', arm1: props.statusData.arm1.position, arm2: props.statusData.arm2.position },
|
|
{ name: '当前速度[r/min]', arm1: props.statusData.arm1.speed, arm2: props.statusData.arm2.speed },
|
|
{
|
|
name: '射线电源开关',
|
|
type: 'tag',
|
|
arm1: props.statusData.arm1.powerSwitch,
|
|
arm2: props.statusData.arm2.powerSwitch
|
|
},
|
|
{ name: '射线电源安全锁', arm1: props.statusData.arm1.safetyLock, arm2: props.statusData.arm2.safetyLock },
|
|
{ name: '射线电源设定电压[V]', arm1: props.statusData.arm1.voltageSet, arm2: props.statusData.arm2.voltageSet },
|
|
{ name: '射线电源反馈电压[V]', arm1: props.statusData.arm1.voltageFeedback, arm2: props.statusData.arm2.voltageFeedback },
|
|
{ name: '射线电源反馈电流[μA]', arm1: props.statusData.arm1.currentFeedback, arm2: props.statusData.arm2.currentFeedback },
|
|
{ name: '射线电源设定电流[μA]', arm1: props.statusData.arm1.currentSet, arm2: props.statusData.arm2.currentSet }
|
|
])
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.device-status-table {
|
|
:deep(.el-table) {
|
|
.el-tag {
|
|
width: 100%;
|
|
justify-content: center;
|
|
|
|
&.el-tag--danger {
|
|
background-color: #fef0f0;
|
|
}
|
|
}
|
|
|
|
.cell {
|
|
padding: 8px 0;
|
|
}
|
|
}
|
|
}
|
|
</style> |