hmp 5 лет назад
Родитель
Сommit
c53bb57060
2 измененных файлов с 24 добавлено и 18 удалено
  1. 1 1
      src/components/top-menu.vue
  2. 23 17
      src/views/grid/scenes/dataScreen.vue

+ 1 - 1
src/components/top-menu.vue

@@ -13,7 +13,7 @@
             <div style="display: flex;margin-top: 40px;">
               <dv-decoration-1 style="width:200px;height:50px;margin-top: 15px;" />
               <div style="width: 260px;">
-                <el-select style="z-index: 9999999999999;" class="myselect" popper-class="popperClass"
+                <el-select style="z-index: 99;" class="myselect" popper-class="popperClass"
                   @change="changeGrid" :value="currentGrid.gridName">
                   <el-option v-for="(item,index) in gridList" :label="item.gridName" :value="index">
                     <span class="" style="float: left;color: #fff;font-size: 22px;">{{ item.gridName }}</span>

+ 23 - 17
src/views/grid/scenes/dataScreen.vue

@@ -152,7 +152,7 @@
         style="height: 100%;width:calc(44% + 20px);margin:0 -10px;">
         <div class="full center" style="margin-top: 15px;flex-direction: column;">
           <div style="font-size: 20px;margin-bottom: -30px;font-weight: 800;" :style="{color:fontColor}">数据统计</div>
-          <div id="dataOption" style="width:100%;height:320px"></div>
+          <div id="dataOption" style="width:100%;height:100%"></div>
         </div>
       </dv-border-box-1>
 
@@ -251,12 +251,6 @@
             ['放假通知:放假放放假放假放放假放假放放假放假放放假放假放放假放假放放假'],
             ['防疫通知:防疫通行防'],
             ['停水通知,停水通知'],
-            ['放假通知:放假放假放'],
-            ['防疫通知:防疫通行防疫'],
-            ['停水通知:停水通知停水'],
-            ['放假通知:放假放假放假放'],
-            ['防疫通知:防疫通行防疫通行'],
-            ['停水通知:停水通知停水通知停'],
           ]
         },
         fontColor: "#00f9cf",
@@ -343,8 +337,6 @@
         this.fetchData(this.$route.query['id']);
         let _this = this
         setTimeout(() => {
-          // 获取数据统计
-          _this.getDataOption()
           //获取人员分布
           _this.getPersonnelDistribution()
           //获取年龄分布
@@ -544,13 +536,20 @@
         };
         myChart.setOption(option);
       },
-      getDataOption() {
+      getDataOption(data) {
         // 基于准备好的dom,初始化echarts实例
         var myChart = this.$echarts.init(document.getElementById('dataOption'));
         window.addEventListener('resize', function() { //执行
           myChart.resize();
         })
 
+        let nameList=[]
+        let valueList=[]
+        data.forEach(item=>{
+          nameList.push(item.name)
+          valueList.push(item.value)
+        })
+
         var option = {
           tooltip: {
             trigger: 'axis'
@@ -558,41 +557,47 @@
           textStyle: {
             color: "#fff"
           },
+          grid: {
+            left: '3%',
+            right: '4%',
+            bottom: '10%',
+            containLabel: true
+          },
           xAxis: {
             type: 'category',
-            data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
+            data: nameList
           },
           yAxis: {
             type: 'value'
           },
           series: [{
             data: [{
-              value: 300,
+              value: valueList[0],
               itemStyle: {
                 color: '#37a2da'
               }
             }, {
-              value: 200,
+              value: valueList[1],
               itemStyle: {
                 color: '#32c5e9'
               }
             }, {
-              value: 150,
+              value: valueList[2],
               itemStyle: {
                 color: '#67e0e3'
               }
             }, {
-              value: 120,
+              value: valueList[3],
               itemStyle: {
                 color: '#32c5e9'
               }
             }, {
-              value: 70,
+              value: valueList[4],
               itemStyle: {
                 color: '#ffdb5c'
               }
             }, {
-              value: 110,
+              value: valueList[5],
               itemStyle: {
                 color: '#91cc75'
               }
@@ -607,6 +612,7 @@
         this.data = (await getStaticData({
           id
         })).data.data;
+        this.getDataOption(this.data.communityCounts)
         this.device = this.data['deviceType'][this.currentDeviceIndex % this.data['deviceType'].length]
         await this.getDeviceStatic();
         this.setConfig(this.data['deviceJobList']);