From c8ae89c4be77c5034bdcbdff0e7ecddaaa3eb3c7 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期五, 09 五月 2025 16:13:49 +0800
Subject: [PATCH] 提交

---
 admin/src/views/business/admissionStatistics.vue |  110 ++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 84 insertions(+), 26 deletions(-)

diff --git a/admin/src/views/business/admissionStatistics.vue b/admin/src/views/business/admissionStatistics.vue
index 0488658..91c4840 100644
--- a/admin/src/views/business/admissionStatistics.vue
+++ b/admin/src/views/business/admissionStatistics.vue
@@ -34,8 +34,8 @@
         <div class="main_content">
             <div class="type_wrap">
                 <div class="title">鍏ㄥ勾鍏ュ洯浜哄憳瓒嬪娍</div>
-                <div class="echart1" ref="typeRef" v-if="info.cumulativeDataList"></div>
-                <div style="width: 100%;height: 100%;display: flex;align-items: center;justify-content: center;" v-else>
+                <div class="echart1" ref="typeRef" v-show="info.cumulativeDataList"></div>
+                <div style="width: 100%;height: 100%;display: flex;align-items: center;justify-content: center;" v-show="!info.cumulativeDataList">
                     <img style="width: 200px;" src="@/assets/images/default_homeimg.png" alt="">
                 </div>
             </div>
@@ -56,8 +56,8 @@
                         placeholder="璇烽�夋嫨">
                     </el-date-picker>
                 </div>
-                <div class="echart2" ref="deptRef" v-if="listZB.length > 0"></div>
-                <div style="width: 100%;height: 100%;display: flex;align-items: center;justify-content: center;" v-else>
+                <div id="echart2" v-show="listZB.length > 0"></div>
+                <div style="width: 100%;height: 100%;display: flex;align-items: center;justify-content: center;" v-show="listZB.length === 0">
                     <img style="width: 200px;" src="@/assets/images/default_homeimg.png" alt="">
                 </div>
             </div>
@@ -83,14 +83,17 @@
                     </div>
                     <el-button type="primary" icon="el-icon-upload2" style="margin-left: 20px;" @click="daochu">瀵煎嚭</el-button>
                 </div>
-                <div class="list_head">
-                    <div class="list_head_item" v-for="(item, index) in column" :key="index">{{item}}</div>
-                </div>
-                <div class="table_box">
-                    <div class="list_content" v-for="(item, index) in list" :key="index">
-                        <div class="list_head_item" v-for="(child, i) in item" :key="i">{{child}}</div>
+                <template v-if="column.length > 0">
+                    <div class="list_head">
+                        <div class="list_head_item" v-for="(item, index) in column" :key="index">{{item}}</div>
                     </div>
-                </div>
+                    <div class="table_box">
+                        <div class="list_content" v-for="(item, index) in list" :key="index">
+                            <div class="list_head_item" v-for="(child, i) in item" :key="i">{{child}}</div>
+                        </div>
+                    </div>
+                </template>
+                <div class="list_wu" v-else>鏆傛棤鏁版嵁</div>
             </div>
             <div class="main_table_list1">
                 <div class="title">
@@ -137,9 +140,9 @@
       this.value = `${year}-${month}`
       this.date1 = `${year}-${month}`
 
-      this.getData()
-      this.getRataLists()
-      this.getReportLists()
+    this.getData()
+    this.getRataLists()
+    this.getReportLists()
     },
     methods: {
       // 瀵煎嚭
@@ -165,7 +168,11 @@
       getReportLists() {
         getReportList({ dateStr: this.date1, isGroupBy: this.isGroupBy, type: 1 })
           .then(res => {
-            if (res.length === 0) return
+            if (res.length === 0) {
+              this.column = []
+              this.list = []
+              return
+            }
 
             this.column = res[0]
             this.list = res.slice(1, res.length);
@@ -189,18 +196,24 @@
         getRataList({ dateStr: this.value, isGroupBy: this.isGroupBy, type: 1 })
           .then(res => {
             this.listZB = res
-            this.$nextTick(() => {
+            // this.$nextTick(() => {
+            //   this.initDept()
+            // })
+            setTimeout(() => {
               this.initDept()
-            })
+            }, 1000)
           })
       },
       // 鍩虹鏁版嵁
       getData() {
         getInParkUserData({ isGroupBy: this.isGroupBy, type: 1 }).then(res => {
           this.info = res
-          this.$nextTick(() => {
+          // this.$nextTick(() => {
+          //   this.initType()
+          // })
+          setTimeout(() => {
             this.initType()
-          })
+          }, 1000)
         })
       },
       // 鍏ㄥ勾鍏ュ洯杞﹁締瓒嬪娍
@@ -221,14 +234,40 @@
             containLabel: true
           },
           tooltip: {
-            trigger: 'item'
+            trigger: 'axis',
+            axisPointer: {
+              type: 'line'
+            }
           },
           xAxis: {
             type: 'category',
             data: names
           },
           yAxis: {
-            type: 'value'
+            type: 'value',
+            axisLine: {
+              show: true
+            },
+            axisLabel: {
+              formatter: function (value) {
+                // 鍥涜垗浜斿叆鍒版渶杩戠殑鏁存暟
+                return Math.round(value);
+              }
+            }
+          },
+          graphic: {
+            elements: [
+              {
+                  type: 'text',
+                  left: 'left',
+                  top: 'top',
+                  style: {
+                    text: '浜哄憳鏁�',
+                    textAlign: 'center',
+                    fill: '#333'
+                  }
+                }
+            ]
           },
           series: [
             {
@@ -287,7 +326,9 @@
       initDept() {
         if (!this.listZB) return
 
-        const myChart = echarts.init(document.querySelector('.echart2'))
+        const dom = document.getElementById('echart2')
+        console.log(dom)
+        const myChart = echarts.init(dom)
 
         let data = this.listZB.map(item => {
           return {
@@ -298,7 +339,7 @@
 
         let option = {
           tooltip: {
-            trigger: 'item'
+            trigger: 'item',
           },
           legend: {
             show: false,
@@ -313,7 +354,7 @@
               labelLine: {
                 normal: {
                   length: 30,
-                  length2: 100,
+                  length2: 70,
                 }
               },
               label: {
@@ -465,6 +506,14 @@
                         color: #222222;
                     }
                 }
+                .list_wu {
+                    width: 100%;
+                    height: 100px;
+                    line-height: 100px;
+                    text-align: center;
+                    font-size: 16px;
+                    color: #222222;
+                }
                 .list_head {
                     width: 100%;
                     height: 50px;
@@ -519,6 +568,14 @@
                 .title {
                     font-weight: 500;
                     font-size: 18px;
+                    color: #222222;
+                }
+                .list_wu {
+                    width: 100%;
+                    height: 100px;
+                    line-height: 100px;
+                    text-align: center;
+                    font-size: 16px;
                     color: #222222;
                 }
                 .list_head {
@@ -578,7 +635,7 @@
             display: flex;
             align-items: center;
             justify-content: space-between;
-            height: 400px;
+            height: 350px;
 
             .title {
                 font-weight: 500;
@@ -598,6 +655,7 @@
                 .echart1 {
                     width: 100%;
                     height: 100%;
+                    margin-top: 18px;
                 }
             }
 
@@ -609,7 +667,7 @@
                 padding: 20px;
                 box-sizing: border-box;
                 margin-left: 10px;
-                .echart2 {
+                #echart2 {
                     width: 100%;
                     height: 100%;
                 }

--
Gitblit v1.9.3