From d5a8ed1d311b0b7d296cd4879463a1b23b8dcc1f Mon Sep 17 00:00:00 2001 From: yangzhq68909 <993367776@qq.com> Date: Wed, 4 Jun 2025 10:49:30 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E8=83=8C=E6=99=AF=E5=9B=BE?= =?UTF-8?q?=202.=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6=E6=98=BE=E7=A4=BA?= =?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/pages-operate/file/index.vue | 43 ++++++++++++++++++++++--------- src/pages/index/index.vue | 2 +- src/pages/login/login.vue | 11 ++++++++ src/pages/user/people.vue | 7 +---- src/static/backgroud.jpg | Bin 0 -> 2532628 bytes src/static/blue.png | Bin 42984 -> 0 bytes src/utils/index.ts | 6 ++--- 7 files changed, 47 insertions(+), 22 deletions(-) create mode 100644 src/static/backgroud.jpg delete mode 100644 src/static/blue.png diff --git a/src/pages-operate/file/index.vue b/src/pages-operate/file/index.vue index 6ede297..428f5e0 100644 --- a/src/pages-operate/file/index.vue +++ b/src/pages-operate/file/index.vue @@ -18,12 +18,13 @@ - + - - {{item.time}} - - + + {{ item.time }} + + {{item.depart.length > 19 ? item.depart.substring(0, 18) + '...': item.depart}} @@ -117,7 +118,11 @@ zdmc: formatSearchkey() }).then((res) => { if (res.success) { - list.value = [...list.value, ...formatObj(res.result.records, 'zdmc', 'updateTime2', 'zbbm', + const recordsWithColor = res.result.records.map(item => ({ + ...item, + color: DateDiff(item.updateTime2) // 假设 updateTime2 是时间字段 + })); + list.value = [...list.value, ...formatObj(recordsWithColor, 'zdmc', 'updateTime2', 'zbbm', 'sszd')] } loading = false @@ -151,7 +156,11 @@ flfgmc: formatSearchkey() }).then((res) => { if (res.success) { - list.value = [...list.value, ...formatObj(res.result.records, 'flfgmc', 'updateTime2', + const recordsWithColor = res.result.records.map(item => ({ + ...item, + color: DateDiff(item.updateTime2) // 假设 updateTime2 是时间字段 + })); + list.value = [...list.value, ...formatObj(recordsWithColor, 'flfgmc', 'updateTime2', 'fabubumen', 'mingcheng')] } loading = false @@ -187,6 +196,21 @@ list.value = [] getList(1) } + + const DateDiff = (time) => { + var today = new Date(); + time = new Date(time); + var days = parseInt((today - time) / 1000 / 60 / 60 / 24); //当前时间-更新时间 + if (days < 90) { //三个月内 + return '#ff0000'; // red + } else if (days > 90 && days < 180) { + return '#aa00ff'; // purple + } else if (days > 180 && days < 365) { + return '#00c861'; // green + } else { + return ''; // black + } + } onReachBottom(() => { if (loading) return @@ -238,11 +262,6 @@ display: flex; align-items: center; font-size: 12px; - color: #666; - - .meta-text { - margin-left: 4px; - } } } diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 472dec8..1b981c6 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -9,7 +9,7 @@