This commit is contained in:
caozehui
2025-01-06 14:50:36 +08:00
parent 9eac101794
commit 336ee843cc
4 changed files with 178 additions and 281 deletions

View File

@@ -1,7 +1,7 @@
<template>
<div class="table-main">
<el-table v-if="info.length <= 0" :data="tableData" height="335px" :header-cell-style="{ textAlign: 'center' } "
<el-table :data="tableData" height="335px" :header-cell-style="{ textAlign: 'center' } "
:cell-style="{ textAlign: 'center' }">
<!-- <el-table-column prop="chnNum" label="通道号" width="80">-->
<!-- <template #default="{row}">-->
@@ -27,8 +27,9 @@
<el-table-column prop="maxError" :label="`最大误差(${unit}`"/>
<el-table-column prop="result" label="检测结果" width="70">
<template #default="scope">
<el-tag type="danger" v-if="scope.row.result === '不符合'">{{ scope.row.result }}</el-tag>
<span v-if="scope.row.result != '不符合'">{{ scope.row.result }}</span>
<el-tag type="danger" v-if="scope.row.result === 2">不符合</el-tag>
<span v-if="scope.row.result === 1">符合</span>
<span v-if="scope.row.result === 4">/</span>
</template>
</el-table-column>
</template>
@@ -42,32 +43,14 @@
<el-table-column prop="maxError" label="最大误差V"/>
<el-table-column prop="result" label="检测结果">
<template #default="scope">
<el-tag type="danger" v-if="scope.row.result === '不符合'">{{ scope.row.result }}</el-tag>
<span v-if="scope.row.result != '不符合'">{{ scope.row.result }}</span>
<el-tag type="danger" v-if="scope.row.result === 2">不符合</el-tag>
<span v-if="scope.row.result === 1">符合</span>
<span v-if="scope.row.result === 4">/</span>
</template>
</el-table-column>
</template>
</el-table>
<el-collapse v-else v-model="activeNames">
<el-collapse-item v-for="(item, index) in info" :key="index" :title="item.title" :name="item.name">
<el-table :data="[tableData[index]]" :header-cell-style="{ textAlign: 'center' } "
:cell-style="{ textAlign: 'center' }">
<el-table-column :label="`T${unit}`">
<el-table-column prop="tStd" label="标准值V"/>
<el-table-column prop="tData" label="被检值"/>
<el-table-column prop="tError" label="误差值"/>
</el-table-column>
<el-table-column prop="maxError" label="最大误差V"/>
<el-table-column prop="result" label="检测结果">
<template #default="scope">
<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>
</el-table-column>
</el-table>
</el-collapse-item>
</el-collapse>
</el-table>
</div>
</template>
@@ -77,11 +60,9 @@ import {defineProps} from 'vue';
import {CheckData} from "@/api/check/interface";
const {tableData} = defineProps<{
info: { title: string, name: string }[],
tableData: CheckData.CheckResult[],
}>();
const activeNames = ref(["Voltage"])
const unit = computed(() => {
return "V"