去除协议校验
This commit is contained in:
@@ -1,65 +1,78 @@
|
||||
<template>
|
||||
<el-button v-if="tableData.length > 0" type="primary" @click="exportData" style="margin-bottom: 10px">导出</el-button>
|
||||
<div class="table-main" max-height="282px">
|
||||
<el-table v-if="tableData.length > 0" :data="tableData" stripe border :header-cell-style="{ textAlign: 'center' } "
|
||||
<el-table :data="tableData" stripe border :header-cell-style="{ textAlign: 'center' } "
|
||||
:cell-style="{ textAlign: 'center' }" max-height="282px"
|
||||
style="width: 100%;">
|
||||
<el-table-column type="index" label="序号" width="70" fixed="left"/>
|
||||
<el-table-column prop="time" label="数据时间"/>
|
||||
<el-table-column v-if="!isThreePhase && phaseA==1" prop="dataA" :label="'A相'+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column v-if="!isThreePhase && phaseB==1" prop="dataB" :label="'B相'+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column v-if="!isThreePhase && phaseC==1" prop="dataC" :label="'C相'+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column v-if="!isThreePhase && phaseT === 1" prop="dataT" :label="tableHeader+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column v-if="isThreePhase" prop="dataB" :label="'负序不平衡度'+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column prop="dataA" :label="'A相'">
|
||||
<el-table-column prop="dataA" :label="'被检值'"/>
|
||||
<el-table-column prop="isDataA" label="标准值"/>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dataB" :label="'B相'">
|
||||
<el-table-column prop="dataA" :label="'被检值'"/>
|
||||
<el-table-column prop="isDataA" label="标准值"/>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dataC" :label="'C相'">
|
||||
<el-table-column prop="dataA" :label="'被检值'"/>
|
||||
<el-table-column prop="isDataA" label="标准值"/>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script lang="tsx" setup>
|
||||
import {CheckData} from "@/api/check/interface";
|
||||
import {computed} from "vue";
|
||||
|
||||
const {tableData, currentScriptTypeName} = defineProps<{
|
||||
tableData: CheckData.RawDataItem[]
|
||||
currentScriptTypeName: string
|
||||
}>()
|
||||
|
||||
const emit = defineEmits(['exportRawDataHandler'])
|
||||
|
||||
const unit = computed(() => {
|
||||
return tableData.length > 0 ? tableData[0].unit : '';
|
||||
})
|
||||
|
||||
const phaseA = computed(() => {
|
||||
return tableData[0].dataA == '/' ? 0 : 1
|
||||
})
|
||||
const phaseB = computed(() => {
|
||||
return tableData[0].dataB == '/' ? 0 : 1
|
||||
})
|
||||
const phaseC = computed(() => {
|
||||
return tableData[0].dataC == '/' ? 0 : 1
|
||||
})
|
||||
|
||||
const phaseT = computed(() => {
|
||||
return tableData[0].dataT == '/' ? 0 : 1
|
||||
})
|
||||
|
||||
const tableHeader = computed(() => {
|
||||
if (phaseT.value === 1) {
|
||||
let index = currentScriptTypeName.indexOf('=');
|
||||
return currentScriptTypeName.substring(0, index);
|
||||
// 模拟数据数组
|
||||
const tableData = [
|
||||
{
|
||||
time: "2023-10-25 14:30:00",
|
||||
dataA: "220.12",
|
||||
isDataA: "220.05",
|
||||
dataB: "219.98",
|
||||
isDataB: "220.02",
|
||||
dataC: "220.05",
|
||||
isDataC: "220.10"
|
||||
},
|
||||
{
|
||||
time: "2023-10-25 14:30:03",
|
||||
dataA: "219.85",
|
||||
isDataA: "220.00",
|
||||
dataB: "220.15",
|
||||
isDataB: "220.08",
|
||||
dataC: "220.20",
|
||||
isDataC: "220.18"
|
||||
},
|
||||
{
|
||||
time: "2023-10-25 14:30:06",
|
||||
dataA: "220.03",
|
||||
isDataA: "219.95",
|
||||
dataB: "220.10",
|
||||
isDataB: "220.00",
|
||||
dataC: "219.90",
|
||||
isDataC: "220.05"
|
||||
},
|
||||
{
|
||||
time: "2023-10-25 14:30:09",
|
||||
dataA: "220.25",
|
||||
isDataA: "220.15",
|
||||
dataB: "219.80",
|
||||
isDataB: "219.90",
|
||||
dataC: "220.10",
|
||||
isDataC: "220.00"
|
||||
},
|
||||
{
|
||||
time: "2023-10-25 14:30:12",
|
||||
dataA: "219.95",
|
||||
isDataA: "220.05",
|
||||
dataB: "220.20",
|
||||
isDataB: "220.15",
|
||||
dataC: "220.05",
|
||||
isDataC: "219.98"
|
||||
}
|
||||
return currentScriptTypeName
|
||||
})
|
||||
];
|
||||
|
||||
const isThreePhase = computed(() => {
|
||||
return currentScriptTypeName.includes('三相电压不平衡度') || currentScriptTypeName.includes('三相电流不平衡度')
|
||||
})
|
||||
|
||||
const exportData = () => {
|
||||
emit('exportRawDataHandler')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user