From 0ff943145e7ce99b617bbf4035af5170a5a41ff9 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Fri, 22 Nov 2024 17:22:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/dashboard/components/PanelGroup.vue | 52 +++++++++++++++---- src/views/dashboard/index.vue | 42 +++++++++++++-- src/views/record/components/addRecord.vue | 12 ++--- src/views/record/components/addRecordLink.vue | 12 ++--- src/views/record/index.vue | 11 ++-- vue.config.js | 2 +- 6 files changed, 100 insertions(+), 31 deletions(-) diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue index c3ad2ea..ae559ee 100644 --- a/src/views/dashboard/components/PanelGroup.vue +++ b/src/views/dashboard/components/PanelGroup.vue @@ -52,7 +52,23 @@ -
+
+
+ 预警提醒 + +
+
+
总数
+
+
+
+ +
+
+
+
+
到期提醒 @@ -62,12 +78,13 @@
-
+
@@ -87,6 +104,7 @@ recordsTotal:0, organizesTotal:0, areasTotal:0, + status1Total:0, dateTotal:0 } } @@ -98,11 +116,14 @@ handleRoute(type) { this.$emit('handleRoute', type) }, - toUrl(){ - if(this.totaldata.dateTotal>0){ - + toUrl(type){ + if(type==1 && this.totaldata.status1Total>0){ + this.$router.push('/record/index?status1Total=1') + } + if(type==2 && this.totaldata.dateTotal>0){ this.$router.push('/record/index?dateTotal=1') } + }, toCaculateper(f1, f2) { return ((f1 / (f2 == 0 ? 1 : f2)) * 100).toFixed(2) + "%" @@ -145,7 +166,7 @@ .box { position: relative; - width: 24%; + width: 19%; // margin-left: 0.5%; // margin-right: 0.5%; margin-bottom: 10px; @@ -267,18 +288,31 @@ } } - .box4 { + .box5 { - background: linear-gradient(-55deg, #64A48E, #9ECABB); + background: linear-gradient(-55deg, #ee6666, #ae6666); .boxcline { width: 100%; - background: #9ECABB; + background: #ae6666; height: 0.125rem; margin-top: 1.25rem; margin-bottom: 1.25rem; } } + + .box4 { + + background: linear-gradient(-55deg, #53241d,#b3241d); + + .boxcline { + width: 100%; + background: #b3241d; + height: 0.125rem; + margin-top: 1.25rem; + margin-bottom: 1.25rem; + } + } .panel-group { // margin-top: 18px; diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index 5b60019..73817fc 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -39,6 +39,7 @@ recordsTotal: 0, organizesTotal: 0, areasTotal: 0, + status1Total:0, dateTotal:0 }, nowDate:'', @@ -52,26 +53,57 @@ created() { this.listHome() this.init() - this.getList() + this.getList() + this.getStatusList() }, mounted() { }, methods: { + // 获取 预警 async getList() { // this.nowDate = this.$moment().format("YYYY-MM-DD") - // this.nowDate = this.$moment().add(1, 'months').format('YYYY-MM-DD') - // this.startDate = this.$moment('1900-01-01').format("YYYY-MM-DD") + this.nowDate = this.$moment().add(1, 'months').format('YYYY-MM-DD') + this.startDate = this.$moment('1900-01-01').format("YYYY-MM-DD") // console.log("this.nowDate",this.nowDate,this.startDate) const res = await index({ page_size: 9999, page: 1, table_name: 'records', is_auth: 1, - catalogs_id: '', - records_status:1 + // catalogs_id: '', + // records_status:1 + filter:[{ + key:'status', + op:'eq', + value:0 + },{ + key:'end_date', + op:'range', + value:[this.startDate,this.nowDate] + }] }) this.list.dateTotal = res.total + }, + async getStatusList() { + // this.nowDate = this.$moment().format("YYYY-MM-DD") + this.nowDate = this.$moment().add(1, 'months').format('YYYY-MM-DD') + this.startDate = this.$moment('1900-01-01').format("YYYY-MM-DD") + // console.log("this.nowDate",this.nowDate,this.startDate) + const res = await index({ + page_size: 9999, + page: 1, + table_name: 'records', + is_auth: 1, + // catalogs_id: '', + // records_status:1 + filter:[{ + key:'status', + op:'eq', + value:1 + }] + }) + this.list.status1Total = res.total }, async listHome() { const res = await home() diff --git a/src/views/record/components/addRecord.vue b/src/views/record/components/addRecord.vue index d9282d4..6ce4efa 100644 --- a/src/views/record/components/addRecord.vue +++ b/src/views/record/components/addRecord.vue @@ -40,7 +40,7 @@