2024-11-19 19:34:00 +08:00
|
|
|
|
<template>
|
2025-01-13 15:03:24 +08:00
|
|
|
|
<el-button v-if="tableData.length > 0" type="primary" @click="exportData" style="margin-bottom: 10px">导出</el-button>
|
2025-04-21 09:10:24 +08:00
|
|
|
|
<div class="table-main" max-height="282px">
|
2025-01-06 19:20:36 +08:00
|
|
|
|
<el-table v-if="tableData.length > 0" :data="tableData" stripe border :header-cell-style="{ textAlign: 'center' } "
|
2025-04-21 09:10:24 +08:00
|
|
|
|
:cell-style="{ textAlign: 'center' }" max-height="282px"
|
2024-12-20 10:19:58 +08:00
|
|
|
|
style="width: 100%;">
|
|
|
|
|
|
<el-table-column type="index" label="序号" width="70" fixed="left"/>
|
2025-01-06 19:20:36 +08:00
|
|
|
|
<el-table-column prop="time" label="数据时间"/>
|
2025-05-22 08:45:55 +08:00
|
|
|
|
<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+')')"/>
|
2024-12-20 10:19:58 +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 {CheckData} from "@/api/check/interface";
|
2025-01-21 14:52:44 +08:00
|
|
|
|
import {computed} from "vue";
|
2024-11-19 19:34:00 +08:00
|
|
|
|
|
2025-01-21 14:52:44 +08:00
|
|
|
|
const {tableData, currentScriptTypeName} = defineProps<{
|
2024-12-25 18:04:16 +08:00
|
|
|
|
tableData: CheckData.RawDataItem[]
|
2025-01-15 10:14:33 +08:00
|
|
|
|
currentScriptTypeName: string
|
2024-12-18 15:56:59 +08:00
|
|
|
|
}>()
|
2024-11-19 19:34:00 +08:00
|
|
|
|
|
2025-01-21 14:52:44 +08:00
|
|
|
|
const emit = defineEmits(['exportRawDataHandler'])
|
|
|
|
|
|
|
2024-12-31 14:27:36 +08:00
|
|
|
|
const unit = 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-05-22 08:45:55 +08:00
|
|
|
|
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
|
|
|
|
|
|
})
|
|
|
|
|
|
|
2025-01-07 11:19:33 +08:00
|
|
|
|
const phaseT = computed(() => {
|
2025-01-08 18:52:17 +08:00
|
|
|
|
return tableData[0].dataT == '/' ? 0 : 1
|
2024-12-31 14:27:36 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
2025-01-20 15:24:29 +08:00
|
|
|
|
const tableHeader = computed(() => {
|
2025-01-21 14:52:44 +08:00
|
|
|
|
if (phaseT.value === 1) {
|
2025-01-20 15:24:29 +08:00
|
|
|
|
let index = currentScriptTypeName.indexOf('=');
|
|
|
|
|
|
return currentScriptTypeName.substring(0, index);
|
|
|
|
|
|
}
|
|
|
|
|
|
return currentScriptTypeName
|
|
|
|
|
|
})
|
|
|
|
|
|
|
2025-01-22 14:03:50 +08:00
|
|
|
|
const isThreePhase = computed(() => {
|
|
|
|
|
|
return currentScriptTypeName.includes('三相电压不平衡度') || currentScriptTypeName.includes('三相电流不平衡度')
|
|
|
|
|
|
})
|
|
|
|
|
|
|
2025-01-13 13:57:24 +08:00
|
|
|
|
const exportData = () => {
|
2025-01-21 14:52:44 +08:00
|
|
|
|
emit('exportRawDataHandler')
|
2025-01-13 13:57:24 +08:00
|
|
|
|
}
|
2024-12-18 15:56:59 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
2024-11-19 19:34:00 +08:00
|
|
|
|
</style>
|