From 4f32a014e7ddbaf2c0ddd6749cdcbfe823a3b72d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Fri, 15 Mar 2024 19:26:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/index_v1.vue | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/src/views/index_v1.vue b/src/views/index_v1.vue index 48d4404..63d7e90 100644 --- a/src/views/index_v1.vue +++ b/src/views/index_v1.vue @@ -9,6 +9,7 @@ header-cell-style="text-align:center;background-color:#57c9cd;color:#fff" cell-style="text-align:center" :row-style="tableRowStyle" + :row-class-name="tableRowClass" style="width: 100%"> 10 ? (new Date().getMonth() + 1) : ('0' + (new Date().getMonth() + 1))}-${(new Date().getDate() > 10) ? (new Date().getDate()) : ('0' + new Date().getDate())}` + let date1 = new Date(row.PLAN_DATE).getTime() + let date2 = new Date(date).getTime() + if ((date2 - date1) === (1000 * 60 * 60 * 24)) { + return {'background-color': 'yellow', color: '#fff'}; + } if (row.STATUS === 1) { - console.log(123) - return {'background-color': 'red',color:'#fff'}; - } else { - console.log(456) + return {'background-color': 'red', color: '#fff'}; + } else { return {} } - } + }, + tableRowClass({row, rowIndex}) { + let date = `${new Date().getFullYear()}-${(new Date().getMonth()) > 10 ? (new Date().getMonth() + 1) : ('0' + (new Date().getMonth() + 1))}-${(new Date().getDate() > 10) ? (new Date().getDate()) : ('0' + new Date().getDate())}` + let date1 = new Date(row.PLAN_DATE).getTime() + let date2 = new Date(date).getTime() + if ((date2 - date1) === (1000 * 60 * 60 * 24)) { + return 'blackHover' + } + if (row.STATUS === 1) { + return 'blackHover' + } else { + return {} + } + }, } } -