fix: 月度数据-数据总览去除高低报值;修改名称

This commit is contained in:
LokerL 2024-10-13 11:00:12 +08:00
parent b3f842e4e7
commit 5fd4b77bba
1 changed files with 15 additions and 17 deletions

View File

@ -30,7 +30,17 @@
:border="true" :border="true"
:header-cell-style="headerStyle" :header-cell-style="headerStyle"
> >
<el-table-column prop="month" label="名称"> <!-- <el-table-column label="港区">
<template slot-scope="scope">
{{ deptName }}
</template>
</el-table-column>
<el-table-column label="月份">
<template slot-scope="scope">
<span>{{ dateValue.replace("-", "年") }}</span>
</template>
</el-table-column> -->
<el-table-column prop="month" label="名称" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ getTableFirstColumnName(scope.row) }} {{ getTableFirstColumnName(scope.row) }}
</template> </template>
@ -41,18 +51,6 @@
align="center" align="center"
:formatter="dataFormatter" :formatter="dataFormatter"
></el-table-column> ></el-table-column>
<el-table-column
prop="avgDbz"
label="低报值"
align="center"
:formatter="dataFormatter"
></el-table-column>
<el-table-column
prop="avgGbz"
label="高报值"
align="center"
:formatter="dataFormatter"
></el-table-column>
</el-table> </el-table>
<el-table <el-table
:data="cmDeviceDs" :data="cmDeviceDs"
@ -120,10 +118,10 @@ export default {
this.queryData(); this.queryData();
}, },
getTableFirstColumnName(row) { getTableFirstColumnName(row) {
if (row.month && row.month === this.month) { if (row.month && row.month === this.dateValue) {
return "本月均值"; return "本月均值";
} }
if (row.month && row.month !== this.month) { if (row.month && row.month !== this.dateValue) {
return "上月均值"; return "上月均值";
} }
return "变化率"; return "变化率";
@ -172,8 +170,8 @@ export default {
const ws_name = "SheetJS"; const ws_name = "SheetJS";
const ws_data = [ const ws_data = [
[filename], [filename],
["名称", "读数", "低报值", "高报值"], ["名称", "读数",],
...this.overViewTableData.map(row => [this.getTableFirstColumnName(row), row.avgDs, row.avgDbz, row.avgGbz]), ...this.overViewTableData.map(row => [this.getTableFirstColumnName(row), row.avgDs,]),
["港区", "企业", "编号", "平均值"], ["港区", "企业", "编号", "平均值"],
...this.cmDeviceDs.map(row => [row.gangQu, row.deptName, row.sn, row.avgDs]), ...this.cmDeviceDs.map(row => [row.gangQu, row.deptName, row.sn, row.avgDs]),
]; ];