From b3f842e4e796d1f18cabd613cfc241d3a5a4b109 Mon Sep 17 00:00:00 2001 From: LokerL Date: Sun, 13 Oct 2024 10:43:31 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4=E6=AF=8F?= =?UTF-8?q?=E6=97=A5=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 调整每日数据统计页面的样式,同一港区下的表格行颜色。 --- .../src/views/dataStatistics/daily/index.vue | 66 ++++++++++++++++--- 1 file changed, 56 insertions(+), 10 deletions(-) diff --git a/ruoyi-ui/src/views/dataStatistics/daily/index.vue b/ruoyi-ui/src/views/dataStatistics/daily/index.vue index c9e6d57..930e1cd 100644 --- a/ruoyi-ui/src/views/dataStatistics/daily/index.vue +++ b/ruoyi-ui/src/views/dataStatistics/daily/index.vue @@ -14,24 +14,32 @@
- 导出 + 导出
@@ -40,8 +48,10 @@ @@ -50,8 +60,10 @@ @@ -84,7 +96,18 @@ export default { this.day = moment().format("YYYY-MM-DD"); this.queryData(); }, + computed: { + pppList() { + return Array.from(new Set(this.tableData.map((item) => item.ppp))); + }, + }, methods: { + tableRowClassName({ row, rowIndex }) { + const classNames = ["default-row", "success-row", "error-row", "warning-row", "info-row"]; + const index = this.pppList.findIndex((item) => item === row.ppp); + if (index === -1) return "info-row"; + return index > classNames.length - 1 ? classNames[index % classNames.length] : classNames[index]; + }, changeDate() { this.queryData(); }, @@ -94,7 +117,7 @@ export default { this.tableData = res.data.map((item) => { return { ...item, - avgDs: parseFloat(item.avgDs.toFixed(2)) + avgDs: parseFloat(item.avgDs.toFixed(2)), }; }); } @@ -152,7 +175,9 @@ export default { } } // 计算平均值, 保留两位小数 - return (childList.reduce((a, b) => a + b, 0) / childList.length).toFixed(2); + return (childList.reduce((a, b) => a + b, 0) / childList.length).toFixed( + 2 + ); }, handleExport() { exportExcel("#dailyTable", `${this.day}-数据统计`); @@ -161,6 +186,27 @@ export default { }; +