This commit is contained in:
sjl
2025-01-13 18:13:55 +08:00
9 changed files with 78 additions and 44 deletions

View File

@@ -1,18 +1,18 @@
<template>
<el-button v-if="tableData.length > 0" type="primary" @click="exportData" style="margin-bottom: 10px">导出</el-button>
<div class="table-main">
<el-table v-if="tableData.length > 0" :data="tableData" stripe border :header-cell-style="{ textAlign: 'center' } "
:cell-style="{ textAlign: 'center' }" height="335px"
:cell-style="{ textAlign: 'center' }" height="315px"
style="width: 100%;">
<el-table-column type="index" label="序号" width="70" fixed="left"/>
<el-table-column prop="time" label="数据时间"/>
<template v-if="phaseT === 0">
<el-table-column prop="dataA" :label="`A${unit}`"/>
<el-table-column prop="dataB" :label="`B${unit}`"/>
<el-table-column prop="dataC" :label="`C${unit}`"/>
<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+'')"/>
</template>
<template v-if="phaseT === 1">
<el-table-column prop="dataT" :label="`T${unit}`"/>
<el-table-column prop="dataT" :label="'T'+(unit==''?'':''+unit+'')"/>
</template>
</el-table>
</div>
@@ -20,9 +20,10 @@
</template>
<script lang="tsx" setup>
import {CheckData} from "@/api/check/interface";
import { computed } from "vue";
import {useDownload} from "@/hooks/useDownload";
import {exportRawData} from "@/api/check/test"
const {tableData} = defineProps<{
tableData: CheckData.RawDataItem[]
@@ -36,7 +37,9 @@ const phaseT = computed(() => {
return tableData[0].dataT == '/' ? 0 : 1
})
const exportData = () => {
useDownload(exportRawData, '原始数据.xlsx', {}, false, '.xlsx')
}
</script>
<style scoped>