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

208 lines
7.7 KiB
Vue
Raw Normal View History

<template>
2024-12-05 15:22:46 +08:00
<div class="table-container table-main">
2024-12-18 15:49:29 +08:00
<el-table :data="tableData"
:header-cell-style="{ textAlign: 'center' } "
:cell-style="{ textAlign: 'center' }"
style="width: 100%"
2024-12-20 10:21:36 +08:00
max-height="400px"
:span-method="objectSpanMethod">
2024-12-18 15:49:29 +08:00
<el-table-column prop="MonitorIdx" label="监测点序号"/>
<!-- <el-table-column prop="updateTime" label="上送时刻" width="180"/> -->
2024-12-20 10:21:36 +08:00
<!-- <el-table-column prop="deviceName" label="描述" /> -->
<el-table-column label="电压通道" >
<el-table-column prop="Ua" label="L1">
2024-12-20 10:21:36 +08:00
<el-table-column prop="UaData" label="数据(V)"/>
<el-table-column prop="UaChannel" label="系数">
<template #default="scope">
<el-tag type="danger" v-if="scope.row.UaChannel === '不合格'">{{ scope.row.UaChannel }}</el-tag>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="Ub" label="L2">
2024-12-20 10:21:36 +08:00
<el-table-column prop="UbData" label="数据(V)"/>
<el-table-column prop="UbChannel" label="系数">
<template #default="scope">
<el-tag type="danger" v-if="scope.row.UbChannel === '不合格'">{{ scope.row.UbChannel }}</el-tag>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="Uc" label="L3">
2024-12-20 10:21:36 +08:00
<el-table-column prop="UcData" label="数据(V)"/>
<el-table-column prop="UcChannel" label="系数">
<template #default="scope">
<el-tag type="danger" v-if="scope.row.UcChannel === '不合格'">{{ scope.row.UcChannel }}</el-tag>
</template>
</el-table-column>
</el-table-column>
</el-table-column>
<el-table-column label="电流通道" >
<el-table-column prop="Ia" label="L1">
2024-12-20 10:21:36 +08:00
<el-table-column prop="IaData" label="数据(A)"/>
<el-table-column prop="IaChannel" label="系数">
<template #default="scope">
<el-tag type="danger" v-if="scope.row.IaChannel === '不合格'">{{ scope.row.IaChannel }}</el-tag>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="Ib" label="L2">
2024-12-20 10:21:36 +08:00
<el-table-column prop="IbData" label="数据(A)"/>
<el-table-column prop="IbChannel" label="系数">
<template #default="scope">
<el-tag type="danger" v-if="scope.row.IbChannel === '不合格'">{{ scope.row.IbChannel }}</el-tag>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="Ic" label="L3">
2024-12-20 10:21:36 +08:00
<el-table-column prop="IcData" label="数据(A)"/>
<el-table-column prop="IcChannel" label="系数">
<template #default="scope">
<el-tag type="danger" v-if="scope.row.IcChannel === '不合格'">{{ scope.row.IcChannel }}</el-tag>
</template>
</el-table-column>
</el-table-column>
</el-table-column>
2024-12-20 10:21:36 +08:00
<!-- <el-table-column label="校准结果">
2024-11-21 23:02:43 +08:00
<template #default="scope">
2024-12-05 21:33:52 +08:00
<el-tag type="danger" v-if="scope.row.Result === '不合格'">{{ scope.row.Result }}</el-tag>
<span v-if="scope.row.Result != '不合格'">{{ scope.row.Result }}</span>
</template>
2024-12-20 10:21:36 +08:00
</el-table-column> -->
</el-table>
</div>
</template>
<script lang="ts" setup name="ErrorSystemDialog">
import { defineProps, defineEmits, reactive,watch,ref, Ref } from 'vue';
//import IndicatorTypeDialog from "@/views/machine/errorSystem/components/IndicatorTypeDialog.vue"; // 导入子组件
import {CirclePlus, Delete, EditPen,FolderOpened,CopyDocument} from '@element-plus/icons-vue'
import { useDictStore } from '@/stores/modules/dict'
const dictStore = useDictStore()
const props = defineProps<{
2024-12-20 10:21:36 +08:00
tableData: Array<{
2024-11-25 21:11:10 +08:00
id: string;
updateTime: string;
deviceName:string;
MonitorIdx:number;
2024-12-20 10:21:36 +08:00
UaData:number;
UaChannel:string;
UbData:number;
UbChannel:string;
UcData:number;
UcChannel:string;
IaData:number;
IaChannel:string;
IbData:number;
IbChannel:string;
IcData:number;
IcChannel:string;
2024-11-25 21:11:10 +08:00
Result: string;
2024-12-20 10:21:36 +08:00
}>
}>();
2024-12-20 10:21:36 +08:00
function objectSpanMethod({ row, column, rowIndex, columnIndex }: { row: any, column: any, rowIndex: number, columnIndex: number }) {
if (columnIndex === 0) {
if (rowIndex === 0 || rowIndex === 4 || rowIndex === 8 || rowIndex === 12) {
return {
rowspan: 4,
colspan: 1,
};
} else {
return {
rowspan: 0,
colspan: 0,
};
}
}
}
2024-11-25 21:11:10 +08:00
// const tableData = ref([
// {
// id: '1',
// updateTime: '2024-10-10 10:30:00',
// deviceName:'被检设备1',
// MonitorIdx: 1,
// Ua:1.0003,
// Ub:1.0003,
// Uc:0.0096,
// Ia:1.0003,
// Ib:1.0003,
// Ic:1.0008,
// Result: '合格',
// },
// {
// id: '2',
// updateTime: '2024-10-10 10:30:00',
// deviceName:'被检设备1',
// MonitorIdx: 2,
// Ua:1.0003,
// Ub:1.0003,
// Uc:0.0096,
// Ia:1.0003,
// Ib:1.0003,
// Ic:1.0008,
// Result: '合格',
// },
// {
// id: '3',
// updateTime: '2024-10-10 10:30:00',
// deviceName:'被检设备1',
// MonitorIdx: 3,
// Ua:1.0003,
// Ub:1.0003,
// Uc:0.0096,
// Ia:1.0003,
// Ib:1.0003,
// Ic:1.0008,
// Result: '合格',
// },
// {
// id: '4',
// updateTime: '2024-10-10 10:30:00',
// deviceName:'被检设备1',
// MonitorIdx: 4,
// Ua:1.0003,
// Ub:1.0003,
// Uc:0.0096,
// Ia:1.0003,
// Ib:1.0003,
// Ic:1.0008,
// Result: '合格',
// },
// ])
</script>
<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; /* 添加底部边距 */
}
.el-table th, .el-table td {
text-align: center; /* 所有单元格文字居中 */
}
.table-container {
max-height: 400px; /* 根据需要调整高度 */
overflow-y: auto; /* 允许垂直滚动 */
overflow-x: hidden; /* 隐藏水平滚动条 */
}
</style>