Browse Source

健康总览模块完成

yangxiao 3 năm trước cách đây
mục cha
commit
2704013a01
2 tập tin đã thay đổi với 27 bổ sung3 xóa
  1. 1 1
      src/router/index.js
  2. 26 2
      src/views/HealthControl/Health6.vue

+ 1 - 1
src/router/index.js

@@ -134,7 +134,7 @@ const routes = [
     component: () => import('../views/HealthControl/Health5.vue'),
   },
   {
-    path: '/health/health6',
+    path: '/health/health6', // 健康总览
     name: 'health6',
     component: () => import('../views/HealthControl/Health6.vue'),
   },

+ 26 - 2
src/views/HealthControl/Health6.vue

@@ -68,7 +68,7 @@
     </div>
     <div class="mg-b-16 curStyle">
       <panel :title="'健康状态'" :showLine="false">
-        <MultipleLineChart :height="'250px'" />
+        <MultipleLineChart :list="statusData" :units="['']" :height="'250px'" />
       </panel>
       <div class="selections">
         <div class="item" @click="changeStatus('1')" :class="{ active: status === '1' }">
@@ -99,6 +99,7 @@ export default {
       status: "1",
       healPieData: [],
       stopPieData:[],
+      statusData:[],
       barData:{
         area: [],
         legend: [],
@@ -216,8 +217,31 @@ export default {
 
           let statusData = [];
 
+          const time = res.data.time;
+
+          for(let key in res.data){
+            if(key !== "name" && key !== "time"){
+              let item=res.data[key];
+
+              let statusItem = {
+                title: res.data.name[0][key],
+                yAxisIndex: 0,
+                value: []
+              }
+
+              time.forEach((text, index)=>{
+                statusItem.value.push({
+                  text:res.data.name[0][key],
+                  value:item[index]
+                });
+              });
+
+              statusData.push(statusItem);
+            }
+          }
+
+          that.statusData = statusData;
           
-          console.log(111,res);
         }
       });
     },