2024-11-19 19:34:00 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
|
2024-12-18 15:56:59 +08:00
|
|
|
|
<div class="table-main">
|
2025-01-13 14:22:54 +08:00
|
|
|
|
<el-table v-if="tableData.length > 0" :data="tableData" height="357px" :header-cell-style="{ textAlign: 'center' } "
|
2024-12-18 15:56:59 +08:00
|
|
|
|
:cell-style="{ textAlign: 'center' }">
|
2025-01-06 08:51:14 +08:00
|
|
|
|
<!-- <el-table-column prop="chnNum" label="通道号" width="80">-->
|
|
|
|
|
|
<!-- <template #default="{row}">-->
|
|
|
|
|
|
<!-- {{ '通道' + row.chnNum }}-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
2025-01-07 11:19:33 +08:00
|
|
|
|
<template v-if="phaseT === 0">
|
2025-01-15 10:14:33 +08:00
|
|
|
|
<el-table-column label="A相">
|
2025-03-31 13:22:57 +08:00
|
|
|
|
<el-table-column prop="stdA" width="105" :label="'标准值'+(outerUnit==''?'':'('+outerUnit+')')"/>
|
|
|
|
|
|
<el-table-column prop="dataA" width="105" :label="'被检值'+(outerUnit==''?'':'('+outerUnit+')')"/>
|
2025-01-07 14:54:44 +08:00
|
|
|
|
<el-table-column prop="isDataA" label="检测结果">
|
2025-01-07 11:19:33 +08:00
|
|
|
|
<template #default="scope">
|
2025-01-07 14:54:44 +08:00
|
|
|
|
<el-tooltip effect="dark" placement="bottom">
|
|
|
|
|
|
<template #content>
|
2025-01-13 13:57:24 +08:00
|
|
|
|
误差范围:{{ scope.row.maxErrorA }} <br/>
|
2025-03-31 13:22:57 +08:00
|
|
|
|
误差值:{{ scope.row.errorA }} {{ scope.row.errorA !== '/' ? innerUnitA : '' }}
|
2025-01-07 14:54:44 +08:00
|
|
|
|
</template>
|
2025-01-07 17:34:15 +08:00
|
|
|
|
<el-tag type="success" v-if="scope.row.isDataA === 1">符合</el-tag>
|
2025-01-07 14:54:44 +08:00
|
|
|
|
<el-tag type="danger" v-if="scope.row.isDataA === 2">不符合</el-tag>
|
2025-01-09 15:49:32 +08:00
|
|
|
|
<el-tag type="warning" v-if="scope.row.isDataA === 4">/</el-tag>
|
2025-03-24 15:41:53 +08:00
|
|
|
|
<el-tag type="info" v-if="scope.row.isDataA === 5">-</el-tag>
|
2025-01-07 14:54:44 +08:00
|
|
|
|
</el-tooltip>
|
2025-01-07 11:19:33 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
2024-12-18 15:56:59 +08:00
|
|
|
|
</el-table-column>
|
2025-01-15 10:14:33 +08:00
|
|
|
|
<el-table-column label="B相">
|
2025-03-31 13:22:57 +08:00
|
|
|
|
<el-table-column prop="stdB" width="105" :label="'标准值'+(outerUnit==''?'':'('+outerUnit+')')"/>
|
|
|
|
|
|
<el-table-column prop="dataB" width="105" :label="'被检值'+(outerUnit==''?'':'('+outerUnit+')')"/>
|
2025-01-07 14:54:44 +08:00
|
|
|
|
<el-table-column prop="isDataB" label="检测结果">
|
2025-01-07 11:19:33 +08:00
|
|
|
|
<template #default="scope">
|
2025-01-07 14:54:44 +08:00
|
|
|
|
<el-tooltip effect="dark" placement="bottom">
|
|
|
|
|
|
<template #content>
|
2025-01-13 13:57:24 +08:00
|
|
|
|
误差范围:{{ scope.row.maxErrorB }}<br/>
|
2025-03-31 13:22:57 +08:00
|
|
|
|
误差值:{{ scope.row.errorB }} {{ scope.row.errorB !== '/' ? innerUnitB : '' }}
|
2025-01-07 14:54:44 +08:00
|
|
|
|
</template>
|
2025-01-07 17:34:15 +08:00
|
|
|
|
<el-tag type="success" v-if="scope.row.isDataB === 1">符合</el-tag>
|
2025-01-07 14:54:44 +08:00
|
|
|
|
<el-tag type="danger" v-if="scope.row.isDataB === 2">不符合</el-tag>
|
2025-01-09 15:49:32 +08:00
|
|
|
|
<el-tag type="warning" v-if="scope.row.isDataB === 4">/</el-tag>
|
2025-03-24 15:41:53 +08:00
|
|
|
|
<el-tag type="info" v-if="scope.row.isDataA === 5">-</el-tag>
|
2025-01-07 14:54:44 +08:00
|
|
|
|
</el-tooltip>
|
2025-01-07 11:19:33 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
2024-12-18 15:56:59 +08:00
|
|
|
|
</el-table-column>
|
2025-01-15 10:14:33 +08:00
|
|
|
|
<el-table-column label="C相">
|
2025-03-31 13:22:57 +08:00
|
|
|
|
<el-table-column prop="stdC" width="105" :label="'标准值'+(outerUnit==''?'':'('+outerUnit+')')"/>
|
|
|
|
|
|
<el-table-column prop="dataC" width="105" :label="'被检值'+(outerUnit==''?'':'('+outerUnit+')')"/>
|
2025-01-07 14:54:44 +08:00
|
|
|
|
<el-table-column prop="isDataC" label="检测结果">
|
2025-01-07 11:19:33 +08:00
|
|
|
|
<template #default="scope">
|
2025-01-07 14:54:44 +08:00
|
|
|
|
<el-tooltip effect="dark" placement="bottom">
|
|
|
|
|
|
<template #content>
|
2025-01-13 13:57:24 +08:00
|
|
|
|
误差范围: {{ scope.row.maxErrorC }}<br/>
|
2025-03-31 13:22:57 +08:00
|
|
|
|
误差值:{{ scope.row.errorC }} {{ scope.row.errorC !== '/' ? innerUnitC : '' }}
|
2025-01-07 14:54:44 +08:00
|
|
|
|
</template>
|
2025-01-07 17:34:15 +08:00
|
|
|
|
<el-tag type="success" v-if="scope.row.isDataC === 1">符合</el-tag>
|
2025-01-07 14:54:44 +08:00
|
|
|
|
<el-tag type="danger" v-if="scope.row.isDataC === 2">不符合</el-tag>
|
2025-01-09 15:49:32 +08:00
|
|
|
|
<el-tag type="warning" v-if="scope.row.isDataC === 4">/</el-tag>
|
2025-03-24 15:41:53 +08:00
|
|
|
|
<el-tag type="info" v-if="scope.row.isDataA === 5">-</el-tag>
|
2025-01-07 14:54:44 +08:00
|
|
|
|
</el-tooltip>
|
2025-01-07 11:19:33 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
2024-12-18 15:56:59 +08:00
|
|
|
|
</el-table-column>
|
2024-12-31 14:27:36 +08:00
|
|
|
|
</template>
|
2025-01-06 08:51:14 +08:00
|
|
|
|
|
2025-01-07 11:19:33 +08:00
|
|
|
|
<template v-if="phaseT === 1">
|
2025-01-20 15:24:29 +08:00
|
|
|
|
<el-table-column :label="tableHeader">
|
2025-03-31 13:22:57 +08:00
|
|
|
|
<el-table-column prop="stdT" :label="'标准值'+(outerUnit==''?'':'('+outerUnit+')')"/>
|
|
|
|
|
|
<el-table-column prop="dataT" :label="'被检值'+(outerUnit==''?'':'('+outerUnit+')')"/>
|
2025-01-08 14:33:47 +08:00
|
|
|
|
<el-table-column prop="isDataT" label="检测结果">
|
2025-01-07 14:54:44 +08:00
|
|
|
|
<template #default="scope">
|
|
|
|
|
|
<el-tooltip effect="dark" placement="bottom">
|
|
|
|
|
|
<template #content>
|
2025-01-13 13:57:24 +08:00
|
|
|
|
误差范围: {{ scope.row.maxErrorT }}<br/>
|
2025-03-31 13:22:57 +08:00
|
|
|
|
误差值:{{ scope.row.errorT }} {{ scope.row.errorT !== '/' ? innerUnitT : '' }}
|
2025-01-07 14:54:44 +08:00
|
|
|
|
</template>
|
2025-01-07 17:34:15 +08:00
|
|
|
|
<el-tag type="success" v-if="scope.row.isDataT === 1">符合</el-tag>
|
2025-01-07 14:54:44 +08:00
|
|
|
|
<el-tag type="danger" v-if="scope.row.isDataT === 2">不符合</el-tag>
|
2025-01-09 15:49:32 +08:00
|
|
|
|
<el-tag type="warning" v-if="scope.row.isDataT === 4">/</el-tag>
|
2025-03-24 15:41:53 +08:00
|
|
|
|
<el-tag type="info" v-if="scope.row.isDataA === 5">-</el-tag>
|
2025-01-07 14:54:44 +08:00
|
|
|
|
</el-tooltip>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
2024-12-18 15:56:59 +08:00
|
|
|
|
</el-table-column>
|
2025-01-13 13:57:24 +08:00
|
|
|
|
<!-- <el-table-column prop="maxError" label="误差范围"/>-->
|
2025-01-07 14:54:44 +08:00
|
|
|
|
<!-- <el-table-column prop="result" label="检测结果">-->
|
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
|
<!-- <span v-if="scope.row.result === 1">符合</span>-->
|
|
|
|
|
|
<!-- <el-tag type="danger" v-if="scope.row.result === 2">不符合</el-tag>-->
|
|
|
|
|
|
<!-- <span v-if="scope.row.result === 4">/</span>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </el-table-column>-->
|
2024-12-31 14:27:36 +08:00
|
|
|
|
</template>
|
2024-12-18 15:56:59 +08:00
|
|
|
|
|
2025-01-06 14:50:36 +08:00
|
|
|
|
</el-table>
|
2024-12-18 15:56:59 +08:00
|
|
|
|
</div>
|
2024-11-19 19:34:00 +08:00
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script lang="tsx" setup>
|
2024-12-31 14:27:36 +08:00
|
|
|
|
import {defineProps} from 'vue';
|
2024-12-25 18:04:16 +08:00
|
|
|
|
import {CheckData} from "@/api/check/interface";
|
2024-12-18 15:56:59 +08:00
|
|
|
|
|
2025-01-20 15:24:29 +08:00
|
|
|
|
const {tableData, currentScriptTypeName} = defineProps<{
|
2024-12-31 14:27:36 +08:00
|
|
|
|
tableData: CheckData.CheckResult[],
|
2025-01-15 10:14:33 +08:00
|
|
|
|
currentScriptTypeName: string
|
2024-12-18 15:56:59 +08:00
|
|
|
|
}>();
|
|
|
|
|
|
|
2025-01-06 08:51:14 +08:00
|
|
|
|
|
2025-03-31 13:22:57 +08:00
|
|
|
|
const outerUnit = computed(() => {
|
2025-01-06 19:20:36 +08:00
|
|
|
|
return tableData.length > 0 ? tableData[0].unit : '';
|
2024-12-31 14:27:36 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
2025-03-31 13:22:57 +08:00
|
|
|
|
const innerUnitA = computed(() => {
|
|
|
|
|
|
return tableData.length > 0 ? tableData[0].unitA : '';
|
|
|
|
|
|
})
|
|
|
|
|
|
const innerUnitB = computed(() => {
|
|
|
|
|
|
return tableData.length > 0 ? tableData[0].unitB : '';
|
|
|
|
|
|
})
|
|
|
|
|
|
const innerUnitC = computed(() => {
|
|
|
|
|
|
return tableData.length > 0 ? tableData[0].unitC : '';
|
|
|
|
|
|
})
|
|
|
|
|
|
const innerUnitT = computed(() => {
|
|
|
|
|
|
return tableData.length > 0 ? tableData[0].unitT : '';
|
|
|
|
|
|
})
|
|
|
|
|
|
|
2025-01-07 11:19:33 +08:00
|
|
|
|
const phaseT = computed(() => {
|
2025-01-08 14:33:47 +08:00
|
|
|
|
return tableData[0].dataT == null || tableData[0].dataT == undefined ? 0 : 1
|
2024-12-31 14:27:36 +08:00
|
|
|
|
})
|
2024-11-19 19:34:00 +08:00
|
|
|
|
|
2025-01-20 15:24:29 +08:00
|
|
|
|
const tableHeader = computed(() => {
|
|
|
|
|
|
if (phaseT.value === 1){
|
|
|
|
|
|
let index = currentScriptTypeName.indexOf('=');
|
|
|
|
|
|
return currentScriptTypeName.substring(0, index);
|
|
|
|
|
|
}
|
|
|
|
|
|
return currentScriptTypeName
|
|
|
|
|
|
})
|
|
|
|
|
|
|
2025-01-10 13:49:09 +08:00
|
|
|
|
// const maxErrorStr = computed((data) => {
|
|
|
|
|
|
// let result = tableData[0].maxError ?? '/'
|
|
|
|
|
|
// let idx = result.indexOf('~');
|
|
|
|
|
|
// if (idx > 0) {
|
2025-03-31 13:22:57 +08:00
|
|
|
|
// result = result.substring(0, idx) + outerUnit.value + result.substring(idx, result.length) + outerUnit.value;
|
2025-01-10 13:49:09 +08:00
|
|
|
|
// }
|
|
|
|
|
|
// return result;
|
|
|
|
|
|
// })
|
2025-01-07 14:54:44 +08:00
|
|
|
|
|
2024-11-19 19:34:00 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
|
|
|
|
|
.form-grid {
|
2024-12-31 14:27:36 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: row; /* 横向排列 */
|
|
|
|
|
|
flex-wrap: wrap; /* 允许换行 */
|
2024-11-19 19:34:00 +08:00
|
|
|
|
}
|
2024-12-31 14:27:36 +08:00
|
|
|
|
|
2024-11-19 19:34:00 +08:00
|
|
|
|
.form-grid .el-form-item {
|
2024-12-31 14:27:36 +08:00
|
|
|
|
flex: 1 1 30%; /* 控件宽度 */
|
|
|
|
|
|
margin-right: 20px; /* 控件间距 */
|
2024-11-19 19:34:00 +08:00
|
|
|
|
}
|
2024-12-31 14:27:36 +08:00
|
|
|
|
|
2024-11-19 19:34:00 +08:00
|
|
|
|
.form-grid .el-form-item:last-child {
|
2024-12-31 14:27:36 +08:00
|
|
|
|
margin-right: 0; /* 最后一个控件不需要右边距 */
|
2024-11-19 19:34:00 +08:00
|
|
|
|
}
|
2024-12-31 14:27:36 +08:00
|
|
|
|
|
2024-11-19 19:34:00 +08:00
|
|
|
|
.dialog-footer {
|
2024-12-31 14:27:36 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: flex-start;
|
|
|
|
|
|
margin-bottom: 10px; /* 调整这里的值以增加或减少间距 */
|
2024-11-19 19:34:00 +08:00
|
|
|
|
}
|
2024-12-31 14:27:36 +08:00
|
|
|
|
|
2024-11-19 19:34:00 +08:00
|
|
|
|
.el-tabs {
|
2024-12-31 14:27:36 +08:00
|
|
|
|
margin-bottom: 20px; /* 添加底部边距 */
|
2024-11-19 19:34:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.el-table th, .el-table td {
|
2024-12-31 14:27:36 +08:00
|
|
|
|
text-align: center; /* 所有单元格文字居中 */
|
2024-11-19 19:34:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
</style>
|