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

47 lines
1.6 KiB
Vue
Raw Normal View History

<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>
2024-12-18 15:56:59 +08:00
<div class="table-main">
2025-01-06 19:20:36 +08:00
<el-table v-if="tableData.length > 0" :data="tableData" stripe border :header-cell-style="{ textAlign: 'center' } "
:cell-style="{ textAlign: 'center' }" height="315px"
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-01-07 11:19:33 +08:00
<template v-if="phaseT === 0">
2025-01-13 15:03:24 +08:00
<el-table-column prop="dataA" :label="'A'+(unit==''?'':''+unit+'')"/>
<el-table-column prop="dataB" :label="'B'+(unit==''?'':''+unit+'')"/>
<el-table-column prop="dataC" :label="'C'+(unit==''?'':''+unit+'')"/>
2024-12-31 14:27:36 +08:00
</template>
2025-01-07 11:19:33 +08:00
<template v-if="phaseT === 1">
2025-01-13 15:03:24 +08:00
<el-table-column prop="dataT" :label="'T'+(unit==''?'':''+unit+'')"/>
2024-12-31 14:27:36 +08:00
</template>
</el-table>
2024-12-18 15:56:59 +08:00
</div>
</template>
<script lang="tsx" setup>
2024-12-31 14:27:36 +08:00
import {CheckData} from "@/api/check/interface";
2025-01-13 18:12:36 +08:00
import { computed } from "vue";
2025-01-13 13:57:24 +08:00
import {useDownload} from "@/hooks/useDownload";
import {exportRawData} from "@/api/check/test"
2024-12-18 15:56:59 +08:00
const {tableData} = defineProps<{
2024-12-25 18:04:16 +08:00
tableData: CheckData.RawDataItem[]
2024-12-18 15:56:59 +08:00
}>()
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-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-13 13:57:24 +08:00
const exportData = () => {
useDownload(exportRawData, '原始数据.xlsx', {}, false, '.xlsx')
}
2024-12-18 15:56:59 +08:00
</script>
<style scoped>
</style>