Files
pqs-9100_client/frontend/src/views/home/components/channelsTestTable.vue

441 lines
20 KiB
Vue
Raw Normal View History

<template>
2025-10-10 13:23:40 +08:00
<div class="table-container table-main">
<el-table
:data="tableData"
:header-cell-style="{ textAlign: 'center' }"
:cell-style="{ textAlign: 'center' }"
style="width: 100%"
max-height="400px"
:span-method="objectSpanMethod"
>
<el-table-column prop="monitorNum" label="监测点序号" width="80" />
<el-table-column prop="desc" label="描述" width="90" />
<el-table-column label="电压通道">
<el-table-column prop="Ua" label="A相">
<el-table-column prop="aVuData" label="被检值(V)" width="100px">
<template #default="scope">
<el-icon v-if="scope.row.aVuData === '—' && scope.row.loading" class="loading-box">
2024-12-30 14:43:13 +08:00
<el-icon-loading />
2025-10-10 13:23:40 +08:00
</el-icon>
<span v-else>
2025-01-08 11:40:12 +08:00
{{ scope.row.aVuData }}
2025-10-10 13:23:40 +08:00
</span>
</template>
</el-table-column>
<el-table-column prop="aVuXi" label="检测结果" width="90px">
<template #default="scope">
<el-tooltip
2025-01-08 11:40:12 +08:00
v-if="scope.row.aVuXi === '不合格'"
2025-01-06 14:07:21 +08:00
class="item"
2025-01-08 11:40:12 +08:00
effect="dark"
placement="bottom-start"
2025-10-10 13:23:40 +08:00
>
2025-01-15 09:35:36 +08:00
<template #content>
2025-10-10 13:23:40 +08:00
误差范围
{{
(-0.001 * props.curV).toFixed(4) + 'V~' + (0.001 * props.curV).toFixed(4) + 'V'
}}
<br />
误差值{{ scope.row.aV + 'V' }}
2025-01-15 09:35:36 +08:00
</template>
2025-01-06 14:07:21 +08:00
<el-tag type="danger" class="tooltip-content">
2025-10-10 13:23:40 +08:00
{{ scope.row.aVuXi }}
2025-01-06 14:07:21 +08:00
</el-tag>
2025-10-10 13:23:40 +08:00
</el-tooltip>
<el-tooltip
2025-01-08 11:40:12 +08:00
v-else-if="scope.row.aVuXi === '合格'"
2025-01-06 14:07:21 +08:00
class="item"
2025-01-08 11:40:12 +08:00
effect="dark"
placement="bottom-start"
2025-10-10 13:23:40 +08:00
>
<template #content>
误差范围
{{
(-0.001 * props.curV).toFixed(4) + 'V~' + (0.001 * props.curV).toFixed(4) + 'V'
}}
<br />
误差值{{ scope.row.aV + 'V' }}
2025-01-15 09:35:36 +08:00
</template>
2025-01-08 11:40:12 +08:00
<el-tag type="success" class="tooltip-content">{{ scope.row.aVuXi }}</el-tag>
2025-10-10 13:23:40 +08:00
</el-tooltip>
<!-- <el-tag type="danger" v-if="scope.row.aVuXi === '不合格'">
2025-01-08 11:40:12 +08:00
{{ scope.row.aVuXi }}
2025-01-06 14:07:21 +08:00
</el-tag> -->
2025-10-10 13:23:40 +08:00
<el-icon v-else-if="scope.row.aVuXi === '—' && scope.row.loading" class="loading-box">
2024-12-30 14:43:13 +08:00
<el-icon-loading />
2025-10-10 13:23:40 +08:00
</el-icon>
<!-- <span v-else>
2025-01-08 11:40:12 +08:00
{{ scope.row.aVuXi }}
2025-01-06 14:07:21 +08:00
</span> -->
2025-10-10 13:23:40 +08:00
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="Ub" label="B相">
<el-table-column prop="bVuData" label="被检值(V)" width="100px">
<template #default="scope">
<el-icon v-if="scope.row.bVuData === '—' && scope.row.loading" class="loading-box">
2024-12-30 14:43:13 +08:00
<el-icon-loading />
2025-10-10 13:23:40 +08:00
</el-icon>
<span v-else>
2025-01-08 11:40:12 +08:00
{{ scope.row.bVuData }}
2025-10-10 13:23:40 +08:00
</span>
</template>
</el-table-column>
<el-table-column prop="bVuXi" label="检测结果" width="90px">
<template #default="scope">
<el-tooltip
2025-01-08 11:40:12 +08:00
v-if="scope.row.bVuXi === '不合格'"
2025-01-06 14:07:21 +08:00
class="item"
2025-01-08 11:40:12 +08:00
effect="dark"
placement="bottom-start"
2025-10-10 13:23:40 +08:00
>
<template #content>
误差范围
{{
(-0.001 * props.curV).toFixed(4) + 'V~' + (0.001 * props.curV).toFixed(4) + 'V'
}}
<br />
误差值{{ scope.row.bV + 'V' }}
2025-01-15 09:35:36 +08:00
</template>
2025-01-06 14:07:21 +08:00
<el-tag type="danger" class="tooltip-content">
2025-10-10 13:23:40 +08:00
{{ scope.row.bVuXi }}
2025-01-06 14:07:21 +08:00
</el-tag>
2025-10-10 13:23:40 +08:00
</el-tooltip>
<el-tooltip
2025-01-08 11:40:12 +08:00
v-else-if="scope.row.bVuXi === '合格'"
2025-01-06 14:07:21 +08:00
class="item"
2025-01-08 11:40:12 +08:00
effect="dark"
placement="bottom-start"
2025-10-10 13:23:40 +08:00
>
<template #content>
误差范围
{{
(-0.001 * props.curV).toFixed(4) + 'V~' + (0.001 * props.curV).toFixed(4) + 'V'
}}
<br />
误差值{{ scope.row.bV + 'V' }}
2025-01-15 09:35:36 +08:00
</template>
2025-01-08 11:40:12 +08:00
<el-tag type="success" class="tooltip-content">{{ scope.row.bVuXi }}</el-tag>
2025-10-10 13:23:40 +08:00
</el-tooltip>
<el-icon v-else-if="scope.row.bVuXi === '—' && scope.row.loading" class="loading-box">
2024-12-30 14:43:13 +08:00
<el-icon-loading />
2025-10-10 13:23:40 +08:00
</el-icon>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="Uc" label="C相">
<el-table-column prop="cVuData" label="被检值(V)" width="100px">
<template #default="scope">
<el-icon v-if="scope.row.cVuData === '—' && scope.row.loading" class="loading-box">
2024-12-30 14:43:13 +08:00
<el-icon-loading />
2025-10-10 13:23:40 +08:00
</el-icon>
<span v-else>
2025-01-08 11:40:12 +08:00
{{ scope.row.cVuData }}
2025-10-10 13:23:40 +08:00
</span>
</template>
</el-table-column>
<el-table-column prop="cVuXi" label="检测结果" width="90px">
<template #default="scope">
<el-tooltip
2025-01-08 11:40:12 +08:00
v-if="scope.row.cVuXi === '不合格'"
2025-01-06 14:07:21 +08:00
class="item"
2025-01-08 11:40:12 +08:00
effect="dark"
placement="bottom-start"
2025-10-10 13:23:40 +08:00
>
<template #content>
误差范围
{{
(-0.001 * props.curV).toFixed(4) + 'V~' + (0.001 * props.curV).toFixed(4) + 'V'
}}
<br />
误差值{{ scope.row.cV + 'V' }}
2025-01-15 09:35:36 +08:00
</template>
2025-01-06 14:07:21 +08:00
<el-tag type="danger" class="tooltip-content">
2025-10-10 13:23:40 +08:00
{{ scope.row.cVuXi }}
2025-01-06 14:07:21 +08:00
</el-tag>
2025-10-10 13:23:40 +08:00
</el-tooltip>
<el-tooltip
2025-01-08 11:40:12 +08:00
v-else-if="scope.row.cVuXi === '合格'"
2025-01-06 14:07:21 +08:00
class="item"
2025-01-08 11:40:12 +08:00
effect="dark"
placement="bottom-start"
2025-10-10 13:23:40 +08:00
>
<template #content>
误差范围
{{
(-0.001 * props.curV).toFixed(4) + 'V~' + (0.001 * props.curV).toFixed(4) + 'V'
}}
<br />
误差值{{ scope.row.cV + 'V' }}
2025-01-15 09:35:36 +08:00
</template>
2025-01-08 11:40:12 +08:00
<el-tag type="success" class="tooltip-content">{{ scope.row.cVuXi }}</el-tag>
2025-10-10 13:23:40 +08:00
</el-tooltip>
<el-icon v-else-if="scope.row.cVuXi === '—' && scope.row.loading" class="loading-box">
2024-12-30 14:43:13 +08:00
<el-icon-loading />
2025-10-10 13:23:40 +08:00
</el-icon>
</template>
</el-table-column>
2025-10-10 13:23:40 +08:00
</el-table-column>
</el-table-column>
<el-table-column label="电流通道">
<el-table-column prop="Ia" label="A相">
<el-table-column prop="aIeData" label="被检值(A)" width="100px">
<template #default="scope">
<el-icon v-if="scope.row.aIeData === '—' && scope.row.loading" class="loading-box">
2024-12-30 14:43:13 +08:00
<el-icon-loading />
2025-10-10 13:23:40 +08:00
</el-icon>
<span v-else>
2025-01-08 11:40:12 +08:00
{{ scope.row.aIeData }}
2025-10-10 13:23:40 +08:00
</span>
</template>
</el-table-column>
<el-table-column prop="aIeXi" label="检测结果" width="90px">
<template #default="scope">
<el-tooltip
2025-01-08 11:40:12 +08:00
v-if="scope.row.aIeXi === '不合格'"
2025-01-06 14:07:21 +08:00
class="item"
2025-01-08 11:40:12 +08:00
effect="dark"
placement="bottom-start"
2025-10-10 13:23:40 +08:00
>
<template #content>
误差范围 {{ -0.5 + '%~' + 0.5 + '%' }}
<br />
误差值{{ scope.row.aI + '%' }}
2025-01-15 09:35:36 +08:00
</template>
2025-01-06 14:07:21 +08:00
<el-tag type="danger" class="tooltip-content">
2025-10-10 13:23:40 +08:00
{{ scope.row.aIeXi }}
2025-01-06 14:07:21 +08:00
</el-tag>
2025-10-10 13:23:40 +08:00
</el-tooltip>
<el-tooltip
2025-01-08 11:40:12 +08:00
v-else-if="scope.row.aIeXi === '合格'"
2025-01-06 14:07:21 +08:00
class="item"
2025-01-08 11:40:12 +08:00
effect="dark"
placement="bottom-start"
2025-10-10 13:23:40 +08:00
>
<template #content>
误差范围 {{ -0.5 + '%~' + 0.5 + '%' }}
<br />
误差值{{ scope.row.aI + '%' }}
2025-01-15 09:35:36 +08:00
</template>
2025-01-08 11:40:12 +08:00
<el-tag type="success" class="tooltip-content">{{ scope.row.aIeXi }}</el-tag>
2025-10-10 13:23:40 +08:00
</el-tooltip>
<el-icon v-else-if="scope.row.aIeXi === '—' && scope.row.loading" class="loading-box">
2024-12-30 14:43:13 +08:00
<el-icon-loading />
2025-10-10 13:23:40 +08:00
</el-icon>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="Ib" label="B相">
<el-table-column prop="bIeData" label="被检值(A)" width="100px">
<template #default="scope">
<el-icon v-if="scope.row.bIeData === '—' && scope.row.loading" class="loading-box">
2024-12-30 14:43:13 +08:00
<el-icon-loading />
2025-10-10 13:23:40 +08:00
</el-icon>
<span v-else>
2025-01-08 11:40:12 +08:00
{{ scope.row.bIeData }}
2025-10-10 13:23:40 +08:00
</span>
</template>
</el-table-column>
<el-table-column prop="bIeXi" label="检测结果" width="90px">
<template #default="scope">
<el-tooltip
2025-01-08 11:40:12 +08:00
v-if="scope.row.bIeXi === '不合格'"
2025-01-06 14:07:21 +08:00
class="item"
2025-01-08 11:40:12 +08:00
effect="dark"
placement="bottom-start"
2025-10-10 13:23:40 +08:00
>
<template #content>
误差范围 {{ -0.5 + '%~' + 0.5 + '%' }}
<br />
误差值{{ scope.row.bI + '%' }}
2025-01-15 09:35:36 +08:00
</template>
2025-01-06 14:07:21 +08:00
<el-tag type="danger" class="tooltip-content">
2025-10-10 13:23:40 +08:00
{{ scope.row.bIeXi }}
2025-01-06 14:07:21 +08:00
</el-tag>
2025-10-10 13:23:40 +08:00
</el-tooltip>
<el-tooltip
2025-01-08 11:40:12 +08:00
v-else-if="scope.row.bIeXi === '合格'"
2025-01-06 14:07:21 +08:00
class="item"
2025-01-08 11:40:12 +08:00
effect="dark"
placement="bottom-start"
2025-10-10 13:23:40 +08:00
>
<template #content>
误差范围 {{ -0.5 + '%~' + 0.5 + '%' }}
<br />
误差值{{ scope.row.bI + '%' }}
2025-01-15 09:35:36 +08:00
</template>
2025-01-08 11:40:12 +08:00
<el-tag type="success" class="tooltip-content">{{ scope.row.bIeXi }}</el-tag>
2025-10-10 13:23:40 +08:00
</el-tooltip>
<el-icon v-else-if="scope.row.bIeXi === '—' && scope.row.loading" class="loading-box">
2024-12-30 14:43:13 +08:00
<el-icon-loading />
2025-10-10 13:23:40 +08:00
</el-icon>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="Ic" label="C相">
<el-table-column prop="cIeData" label="被检值(A)" width="100px">
<template #default="scope">
<el-icon v-if="scope.row.cIeData === '—' && scope.row.loading" class="loading-box">
2024-12-30 14:43:13 +08:00
<el-icon-loading />
2025-10-10 13:23:40 +08:00
</el-icon>
<span v-else>
2025-01-08 11:40:12 +08:00
{{ scope.row.cIeData }}
2025-10-10 13:23:40 +08:00
</span>
</template>
</el-table-column>
<el-table-column prop="cIeXi" label="检测结果" width="90px">
<template #default="scope">
<el-tooltip
2025-01-08 11:40:12 +08:00
v-if="scope.row.cIeXi === '不合格'"
2025-01-06 14:07:21 +08:00
class="item"
2025-01-08 11:40:12 +08:00
effect="dark"
placement="bottom-start"
2025-10-10 13:23:40 +08:00
>
<template #content>
误差范围 {{ -0.5 + '%~' + 0.5 + '%' }}
<br />
误差值{{ scope.row.cI + '%' }}
2025-01-15 09:35:36 +08:00
</template>
2025-01-06 14:07:21 +08:00
<el-tag type="danger" class="tooltip-content">
2025-10-10 13:23:40 +08:00
{{ scope.row.cIeXi }}
2025-01-06 14:07:21 +08:00
</el-tag>
2025-10-10 13:23:40 +08:00
</el-tooltip>
<el-tooltip
2025-01-08 11:40:12 +08:00
v-else-if="scope.row.cIeXi === '合格'"
2025-01-06 14:07:21 +08:00
class="item"
2025-01-08 11:40:12 +08:00
effect="dark"
placement="bottom-start"
2025-10-10 13:23:40 +08:00
>
<template #content>
误差范围 {{ -0.5 + '%~' + 0.5 + '%' }}
<br />
误差值{{ scope.row.cI + '%' }}
2025-01-15 09:35:36 +08:00
</template>
2025-01-08 11:40:12 +08:00
<el-tag type="success" class="tooltip-content">{{ scope.row.cIeXi }}</el-tag>
2025-10-10 13:23:40 +08:00
</el-tooltip>
<el-icon v-else-if="scope.row.cIeXi === '—' && scope.row.loading" class="loading-box">
2024-12-30 14:43:13 +08:00
<el-icon-loading />
2025-10-10 13:23:40 +08:00
</el-icon>
</template>
</el-table-column>
2025-10-10 13:23:40 +08:00
</el-table-column>
</el-table-column>
</el-table>
</div>
</template>
2025-10-10 13:23:40 +08:00
<script lang="ts" setup name="ErrorSystemDialog">
import { ElIcon, ElTag } from 'element-plus'
import type { ChannelsTest } from '@/api/home/interface/channelsTest'
2025-01-15 09:35:36 +08:00
interface Props {
2025-10-10 13:23:40 +08:00
tableData: ChannelsTest.CoefficientVO[]
big_V_loading: boolean
curV: number
2025-01-15 09:35:36 +08:00
}
const props = withDefaults(defineProps<Props>(), {
2025-10-10 13:23:40 +08:00
tableData: () => [],
big_V_loading: false,
curV: 0
})
2025-10-10 13:23:40 +08:00
function objectSpanMethod({
row,
column,
rowIndex,
columnIndex
}: {
row: any
column: any
rowIndex: number
columnIndex: number
}) {
2024-12-20 10:21:36 +08:00
if (columnIndex === 0) {
2024-12-30 14:43:13 +08:00
if (rowIndex % 4 === 0) {
2024-12-20 10:21:36 +08:00
return {
rowspan: 4,
2025-10-10 13:23:40 +08:00
colspan: 1
}
2024-12-20 10:21:36 +08:00
} else {
return {
rowspan: 0,
2025-10-10 13:23:40 +08:00
colspan: 0
}
2024-12-20 10:21:36 +08:00
}
}
2024-12-30 14:43:13 +08:00
if (columnIndex === 1) {
if (rowIndex % 2 === 0) {
return {
rowspan: 2,
2025-10-10 13:23:40 +08:00
colspan: 1
}
2024-12-30 14:43:13 +08:00
} else {
return {
rowspan: 0,
2025-10-10 13:23:40 +08:00
colspan: 0
}
2024-12-30 14:43:13 +08:00
}
}
2024-12-20 10:21:36 +08:00
}
2025-10-10 13:23:40 +08:00
</script>
2025-10-10 13:23:40 +08:00
<style scoped>
.form-grid {
display: flex;
flex-direction: row; /* 横向排列 */
flex-wrap: wrap; /* 允许换行 */
}
.form-grid .el-form-item {
flex: 1 1 30%; /* 控件宽度 */
margin-right: 20px; /* 控件间距 */
}
.form-grid .el-form-item:last-child {
margin-right: 0; /* 最后一个控件不需要右边距 */
}
.dialog-footer {
display: flex;
justify-content: flex-start;
margin-bottom: 10px; /* 调整这里的值以增加或减少间距 */
}
.el-tabs {
margin-bottom: 20px; /* 添加底部边距 */
}
2025-10-10 13:23:40 +08:00
.el-table th,
.el-table td {
text-align: center; /* 所有单元格文字居中 */
}
.table-container {
2025-10-10 13:23:40 +08:00
max-height: 400px; /* 根据需要调整高度 */
overflow-y: auto; /* 允许垂直滚动 */
overflow-x: hidden; /* 隐藏水平滚动条 */
}
2024-12-30 14:43:13 +08:00
2024-12-30 19:17:39 +08:00
/* 确保 el-icon-loading 的动画效果没有被覆盖 */
.loading-box {
2025-10-10 13:23:40 +08:00
animation: rotate 2s linear infinite;
2024-12-30 19:17:39 +08:00
}
2024-12-30 14:43:13 +08:00
2025-01-06 14:07:21 +08:00
.icon-margin {
2025-10-10 13:23:40 +08:00
margin-left: 0px;
2025-01-06 14:07:21 +08:00
}
.icon-align {
2025-10-10 13:23:40 +08:00
vertical-align: 0px;
2025-01-06 14:07:21 +08:00
}
.tooltip-content {
2025-10-10 13:23:40 +08:00
cursor: pointer;
2025-01-06 14:07:21 +08:00
}
2024-12-30 19:17:39 +08:00
@keyframes rotate {
2025-10-10 13:23:40 +08:00
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
2024-12-30 19:17:39 +08:00
}
</style>