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 { }; +