From 1477a1353e96b5620a29c78e2b08647a1a2bc5b7 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期二, 15 十月 2024 19:07:25 +0800
Subject: [PATCH] ll

---
 admin/src/views/index.vue |   65 +++++++++++++++++---------------
 1 files changed, 34 insertions(+), 31 deletions(-)

diff --git a/admin/src/views/index.vue b/admin/src/views/index.vue
index e223287..c96cdaa 100644
--- a/admin/src/views/index.vue
+++ b/admin/src/views/index.vue
@@ -89,21 +89,10 @@
                   <div class="echart" id="echart1"></div>
                 </div>
                 <div class="list">
-                  <div class="item">
-                    <div class="icon"></div>
-                    <div class="text">璁垮</div>
-                    <div class="num">{{ headerData.inParkVisitUserNum }}</div>
-                  </div>
-                  <div class="item">
-                    <div :style="{ background: colors[0] }" class="icon"></div>
-                    <div class="text">鍐呴儴鍛樺伐</div>
-                    <div class="num">{{ headerData.todayInParkUserNum - headerData.inParkLwUserNum -
-                      headerData.inParkVisitUserNum }}</div>
-                  </div>
-                  <div class="item">
-                    <div :style="{ background: colors[1] }" class="icon"></div>
-                    <div class="text">闀挎湡鐩稿叧鏂�</div>
-                    <div class="num">{{ headerData.inParkLwUserNum }}</div>
+                  <div class="item" v-for="item, i in manningRatio" :key="i">
+                    <div :style="{ background: colors[i] }" class="icon"></div>
+                    <div class="text">{{ item.name }}</div>
+                    <div class="num">{{ item.value }}</div>
                   </div>
                 </div>
               </div>
@@ -189,7 +178,7 @@
                 <div class="btn" @click="departure(item.id)">绂诲満</div>
               </div>
             </div>
-          </div>  
+          </div>
           <div v-if="warningList.length == 0" class="empty">
             <img src="@/assets/images/default_nodata.png" alt="">
           </div>
@@ -243,6 +232,7 @@
       nowWeek: '',
       headerData: {},
       staticData: {},
+      manningRatio: [],
       taskList: [],
       taskTotal: 0,
       warningList: [],
@@ -320,6 +310,12 @@
     getWorkHead() {
       getWorkbenchData({ queryType: 1 }).then(res => {
         this.headerData = res || {}
+        let arr = []
+        arr.push({ name: '璁垮', value: this.headerData.inParkVisitUserNum })
+        arr.push({ name: '鍐呴儴鍛樺伐', value: this.headerData.todayInParkUserNum - this.headerData.inParkLwUserNum - this.headerData.inParkVisitUserNum })
+        arr.push({ name: '闀挎湡鐩稿叧鏂�', value: this.headerData.inParkLwUserNum })
+        arr.sort((a, b) => b.value - a.value)
+        this.manningRatio = arr
         this.initEchart1()
       })
     },
@@ -340,7 +336,7 @@
 
       })
     },
-    handleDetail (row) {
+    handleDetail(row) {
       if (row.objType === 2) {
         this.$refs.OperaDetailsWindow.open('鍏姟杞︾敵璇疯鎯�', { ...row, id: row.objId })
         return
@@ -386,6 +382,9 @@
       let that = this
 
       const option = {
+        tooltip: {
+          trigger: 'item'
+        },
         series: [
           {
             type: 'pie',
@@ -398,11 +397,12 @@
             labelLine: {
               show: false
             },
-            data: [
-              { value: that.headerData.inParkVisitUserNum, name: '璁垮' },
-              { value: that.headerData.todayInParkUserNum - that.headerData.inParkVisitUserNum - that.headerData.inParkLwUserNum, name: '鍐呴儴鍛樺伐' },
-              { value: that.headerData.inParkLwUserNum, name: '闀挎湡鐩稿叧鏂�' }
-            ]
+            data: that.manningRatio
+            // data: [
+            //   { value: that.headerData.inParkVisitUserNum, name: '璁垮' },
+            //   { value: that.headerData.todayInParkUserNum - that.headerData.inParkVisitUserNum - that.headerData.inParkLwUserNum, name: '鍐呴儴鍛樺伐' },
+            //   { value: that.headerData.inParkLwUserNum, name: '闀挎湡鐩稿叧鏂�' }
+            // ]
           }
         ]
       }
@@ -929,19 +929,21 @@
         }
       }
     }
-    .more{
+
+    .more {
       cursor: pointer;
     }
-    .empty {
-        height: 300px;
-        display: flex;
-        justify-content: center;
-        align-items: center;
 
-        img {
-          width: 140px;
-        }
+    .empty {
+      height: 300px;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+
+      img {
+        width: 140px;
       }
+    }
   }
 
   .static_wrap {
@@ -979,6 +981,7 @@
         display: flex;
         justify-content: center;
         align-items: center;
+        height: 100%;
 
         .echart_wrap {
           position: relative;

--
Gitblit v1.9.3