Преглед на файлове

修改压风一个图表

namin преди 3 години
родител
ревизия
34352d2992
променени са 2 файла, в които са добавени 30 реда и са изтрити 11 реда
  1. 23 3
      src/views/Home.vue
  2. 7 8
      src/views/compressed/dataBoard/twoline2.vue

+ 23 - 3
src/views/Home.vue

@@ -31,7 +31,7 @@
           @select="handleSelect"
         >
           <template v-for="item in menu_left">
-            <el-menu-item :index="item.path" :key="item.id">
+            <el-menu-item :index="item.path" :key="item.id+''">
               <div
                 style="
                   background-color: #c0c0c0;
@@ -195,16 +195,36 @@ export default {
     },
   },
   computed: {
+    // menu_left() {
+    //   return this.$router.options.routes[0].children.filter(
+    //     (item) => !item.hidden
+    //   );
+    // },
     menu_left() {
-      return this.$router.options.routes[0].children.filter(
+      let arr1 = this.$router.options.routes[0].children.filter(
         (item) => !item.hidden
       );
+      let arr11 = arr1.map((e)=>({path:e.path ,id:e.id,name:e.name})).slice(0,10)
+      console.log('arr11',arr11)
+      return arr11;
     },
     menu_right() {
-      return this.$router.options.routes[1].children.filter(
+      let arr2 = this.$router.options.routes[1].children.filter(
         (item) => !item.hidden
       );
+      console.log('arr2',arr2)
+      return arr2;
     },
+    //  menu_left() {
+    //   let arr = [{path: '/tunnelling', name: '掘进工作面', id: 101, hidden: false}]
+    //   console.log('arr',arr)
+    //   return arr;
+    // },
+    // menu_right() {
+    //   return this.$router.options.routes[1].children.filter(
+    //     (item) => !item.hidden
+    //   );
+    // },
   },
 };
 </script>

+ 7 - 8
src/views/compressed/dataBoard/twoline2.vue

@@ -366,8 +366,7 @@ export default {
               data: this.y1Data,
             },
             {
-              name: this.legend[1],
-              data: this.y2Data,
+            
             },
           ],
         });
@@ -397,8 +396,8 @@ export default {
           ],
           series: [
             {
-              name: this.legend[0],
-              data: this.y1Data,
+              // name: this.legend[0],
+              // data: this.y1Data,
             },
             {
               name: this.legend[1],
@@ -446,14 +445,14 @@ export default {
     // console.log(this.legend[0]);
     this.myChart = this.$echarts.init(this.$refs.testLine);
     this.myChart.setOption(this.option);
-    this.websocket1 = new WebSocket(
+    let websocket1 = new WebSocket(
       `ws://${this.websocketIP}/hbase/ws/belt/${this.id[0]}`
     );
-    this.initWebSocket(this.websocket1, this.legend[0], 1);
-    this.websocket2 = new WebSocket(
+    this.initWebSocket(websocket1, this.legend[0], 1);
+    let websocket2 = new WebSocket(
       `ws://${this.websocketIP}/hbase/ws/belt/${this.id[1]}`
     );
-    this.initWebSocket(this.websocket2, this.legend[1], 1);
+    this.initWebSocket(websocket2, this.legend[1], 1);
   },
 };
 </script>