ly 3 лет назад
Родитель
Сommit
e20b521a62

+ 7 - 14
ui/src/views/front/acrylicTank.vue

@@ -67,6 +67,7 @@
   import { selectLast } from "@/api/aspen/dashboarddata";
 
 export default {
+  props: ['dashboarddata'],
   data () {
     return {
       dashboarddata: {
@@ -81,23 +82,15 @@ export default {
     }
   },
   created() {
-    this.getList();
-    // 每隔30秒请求一次数据
-    window.setInterval(() => {undefined
-      setTimeout(() => {undefined
-        ///调取接口获取数据
-        this.getList();
-      }, 0)
-    }, 10000)
   },
   methods: {
     /** 查询dashboard抓取数据列表 */
-    getList()
-    {
-      selectLast(this.queryParams).then(response => {
-        this.dashboarddata = response.data;
-      });
-    }
+    // getList()
+    // {
+    //   selectLast(this.queryParams).then(response => {
+    //     this.dashboarddata = response.data;
+    //   });
+    // }
   }
 }
 </script>

+ 14 - 20
ui/src/views/front/ethyleneTank.vue

@@ -68,38 +68,32 @@
 import { selectLast } from "@/api/aspen/dashboarddata";
 
 export default {
+  props: ['dashboarddata'],
   data () {
     return {
-      dashboarddata: {
-        ehtOne: null,
-        ehtTwo: null,
-        ehtThree: null,
-        ehtFour: null,
-        ehtFive: null
-      },
       // 查询参数
       queryParams: {
       },
     }
   },
   created() {
-    this.getList();
+    // this.getList();
     // 每隔30秒请求一次数据
-    window.setInterval(() => {undefined
-      setTimeout(() => {undefined
-        ///调取接口获取数据
-        this.getList();
-      }, 0)
-    }, 10000)
+    // window.setInterval(() => {undefined
+    //   setTimeout(() => {undefined
+    //     ///调取接口获取数据
+    //     this.getList();
+    //   }, 0)
+    // }, 10000)
   },
   methods: {
     /** 查询dashboard抓取数据列表 */
-    getList()
-    {
-      selectLast(this.queryParams).then(response => {
-        this.dashboarddata = response.data;
-      });
-    }
+    // getList()
+    // {
+    //   selectLast(this.queryParams).then(response => {
+    //     this.dashboarddata = response.data;
+    //   });
+    // }
   }
 }
 </script>

+ 8 - 80
ui/src/views/front/materialBalance.vue

@@ -354,97 +354,25 @@
 
   export default {
     name: "materialBalance",
+    props: ['dashboarddata'],
     data () {
       return {
-        dashboarddata: {
-          energyYixi: null,
-          energyBingxi: null,
-          energyQingqi: null,
-          energyJiawan: null,
-          energyCsi: null,
-          energyBenzene: null,
-          energyToluene: null,
-          energyXylene: null,
-          energyTanliu: null,
-          energyWashoil: null,
-          energyTanwu: null,
-          energyIma: null,
-          energyCjiu: null,
-          energyRpg: null,
-          energyfeedNap: null,
-          energyfeedYiwan: null,
-          energyfeedTanwu: null,
-          energyfeedTanliu: null,
-          energyfeedLpg: null,
-          energyOffgas: null,
-          energyLpg: null,
-          steamSsinfur: null,
-          steamSsoutlet: null,
-          steamSsoutaeu: null,
-          steamSsoutesi: null,
-          steamSsoutksan: null,
-          steamSsoutsc: null,
-          steamHsinsub: null,
-          steamHsinlet: null,
-          steamHsinksan: null,
-          steamHsoutpjiu: null,
-          steamHsoutaeu: null,
-          steamHsoutlet: null,
-          steamHsoutesan: null,
-          steamHsoutphyi: null,
-          steamHsoutpher: null,
-          steamHsouthwu: null,
-          steamHsoutkliu: null,
-          steamHsoutsc: null,
-          steamHhpsub: null,
-          steamMsinaeu: null,
-          steamMsinlet: null,
-          steamMsinphyi: null,
-          steamMsinkliu: null,
-          steamMsoutflare: null,
-          steamMsoutaeu: null,
-          steamMsoutsctu: null,
-          steamMsouteer: null,
-          steamMsoutfur: null,
-          steamMsoutva: null,
-          steamMsouttracing: null,
-          steamLsinsub: null,
-          steamLsinpjiu: null,
-          steamLsinaeu: null,
-          steamLsineer: null,
-          steamLsinpher: null,
-          steamLsoutsctu: null,
-          steamLsoutvjiu: null,
-          steamLsoutewuliu: null,
-          steamLsoutewusan: null,
-          steamLsouttracing: null,
-          steamLsoutesan: null,
-          steamLsoutesi: null,
-          steamLsoutother: null
-        },
+
         // 查询参数
         queryParams: {
         },
       }
     },
     created() {
-      this.getList();
-      // 每隔30秒请求一次数据
-      window.setInterval(() => {undefined
-        setTimeout(() => {undefined
-          ///调取接口获取数据
-          this.getList();
-        }, 0)
-      }, 10000)
     },
     methods: {
       /** 查询dashboard抓取数据列表 */
-      getList()
-      {
-        selectLast(this.queryParams).then(response => {
-          this.dashboarddata = response.data;
-        });
-      }
+      // getList()
+      // {
+      //   selectLast(this.queryParams).then(response => {
+      //     this.dashboarddata = response.data;
+      //   });
+      // }
     }
   }
 </script>

+ 7 - 80
ui/src/views/front/steamBalance.vue

@@ -400,96 +400,23 @@
 
   export default {
     name: "steamBalance",
+    props: ['dashboarddata'],
     data () {
       return {
-        dashboarddata: {
-          energyYixi: null,
-          energyBingxi: null,
-          energyQingqi: null,
-          energyJiawan: null,
-          energyCsi: null,
-          energyBenzene: null,
-          energyToluene: null,
-          energyXylene: null,
-          energyTanliu: null,
-          energyWashoil: null,
-          energyTanwu: null,
-          energyIma: null,
-          energyCjiu: null,
-          energyRpg: null,
-          energyfeedNap: null,
-          energyfeedYiwan: null,
-          energyfeedTanwu: null,
-          energyfeedTanliu: null,
-          energyfeedLpg: null,
-          energyOffgas: null,
-          energyLpg: null,
-          steamSsinfur: null,
-          steamSsoutlet: null,
-          steamSsoutaeu: null,
-          steamSsoutesi: null,
-          steamSsoutksan: null,
-          steamSsoutsc: null,
-          steamHsinsub: null,
-          steamHsinlet: null,
-          steamHsinksan: null,
-          steamHsoutpjiu: null,
-          steamHsoutaeu: null,
-          steamHsoutlet: null,
-          steamHsoutesan: null,
-          steamHsoutphyi: null,
-          steamHsoutpher: null,
-          steamHsouthwu: null,
-          steamHsoutkliu: null,
-          steamHsoutsc: null,
-          steamHhpsub: null,
-          steamMsinaeu: null,
-          steamMsinlet: null,
-          steamMsinphyi: null,
-          steamMsinkliu: null,
-          steamMsoutflare: null,
-          steamMsoutaeu: null,
-          steamMsoutsctu: null,
-          steamMsouteer: null,
-          steamMsoutfur: null,
-          steamMsoutva: null,
-          steamMsouttracing: null,
-          steamLsinsub: null,
-          steamLsinpjiu: null,
-          steamLsinaeu: null,
-          steamLsineer: null,
-          steamLsinpher: null,
-          steamLsoutsctu: null,
-          steamLsoutvjiu: null,
-          steamLsoutewuliu: null,
-          steamLsoutewusan: null,
-          steamLsouttracing: null,
-          steamLsoutesan: null,
-          steamLsoutesi: null,
-          steamLsoutother: null
-        },
         // 查询参数
         queryParams: {},
       }
     },
     created() {
-      this.getList();
-      // 每隔30秒请求一次数据
-      window.setInterval(() => {undefined
-        setTimeout(() => {undefined
-          ///调取接口获取数据
-          this.getList();
-        }, 0)
-      }, 10000)
     },
     methods: {
       /** 查询dashboard抓取数据列表 */
-      getList()
-      {
-        selectLast(this.queryParams).then(response => {
-          this.dashboarddata = response.data;
-        });
-      }
+      // getList()
+      // {
+      //   selectLast(this.queryParams).then(response => {
+      //     this.dashboarddata = response.data;
+      //   });
+      // }
     }
   }
 </script>

+ 2 - 2
ui/src/views/login.vue

@@ -158,8 +158,8 @@ export default {
   justify-content: center;
   align-items: center;
   height: 100%;
-  //background-image: url("../assets/image/CPMS20210107.jpg");
-  background-image: url("../assets/image/CPMS20211128.jpg");
+  background-image: url("../assets/image/CPMS20210107.jpg");
+  //background-image: url("../assets/image/CPMS20211128.jpg");
   background-size: cover;
 }
 .title {

+ 29 - 10
ui/src/views/monitor/elec/index.vue

@@ -64,39 +64,39 @@
           <div style="display: flex;">
             <div style="width:1920px;display: flex;">
                 <div>
-                  <material-balance />
+                  <material-balance :dashboarddata = 'dashboarddata'/>
                 </div>
                 <div>
                   <chart-right/>
                 </div>
             </div>
             <div class="right" style="width: 1270px">
-              <steam-balance/>
+              <steam-balance :dashboarddata = 'dashboarddata'/>
             </div>
           </div>
         </div>
         <div class="three-bototm-box">
           <dv-border-box-12 style="width: 438px;height: 260px;">
-            <nap-tank />
+            <nap-tank :dashboarddata = 'dashboarddata'/>
             <!--<bottom-left />-->
           </dv-border-box-12>
           <dv-border-box-12 style="width: 438px;height: 260px;">
-            <ethylene-tank />
+            <ethylene-tank :dashboarddata = 'dashboarddata' />
           </dv-border-box-12>
           <dv-border-box-12 style="width: 438px;height: 260px;">
-            <acrylic-tank />
+            <acrylic-tank :dashboarddata = 'dashboarddata'/>
           </dv-border-box-12>
           <dv-border-box-12 style="width: 438px;height: 260px;">
-            <product-tank />
+            <product-tank :dashboarddata = 'dashboarddata'/>
           </dv-border-box-12>
           <dv-border-box-12 style="width: 438px;height: 260px;">
-            <bottom-left />
+            <bottom-left :dashboarddata = 'dashboarddata'/>
           </dv-border-box-12>
           <dv-border-box-12 style="width: 438px;height: 260px;">
-            <bottom-energy />
+            <bottom-energy :dashboarddata = 'dashboarddata'/>
           </dv-border-box-12>
           <dv-border-box-12 style="width: 438px;height: 260px;">
-            <bottom-right />
+            <bottom-right :dashboarddata = 'dashboarddata'/>
           </dv-border-box-12>
         </div>
       </div>
@@ -165,6 +165,7 @@
   import dayjs from "dayjs";
   import '@/common/flexible.js';
   import dataV from '@jiaminghi/data-view';
+  import {selectLast} from "@/api/aspen/dashboarddata";
 
   export default {
     data() {
@@ -175,7 +176,8 @@
         dateYear: null,
         dateWeek: null,
         weekday: [this.$t('周日'),this.$t('周一'),this.$t('周二'),this.$t('周三'),this.$t('周四'),this.$t('周五'),this.$t('周六')],
-        timer:null
+        timer:null,
+        dashboarddata: null
       };
     },
     components: {
@@ -205,12 +207,29 @@
         this.dateWeek = date.format(this.weekday[date.day()]);
       },1000);
     },
+    created() {
+      this.getList();
+      // 每隔30秒请求一次数据
+      window.setInterval(() => {undefined
+        setTimeout(() => {undefined
+          ///调取接口获取数据
+          this.getList();
+        }, 0)
+      }, 10000)
+    },
     beforeDestroy(){
       if(this.timer){
         clearInterval(this.timer);
       }
     },
     methods: {
+      /** 查询dashboard抓取数据列表 */
+      getList()
+      {
+        selectLast(this.queryParams).then(response => {
+          this.dashboarddata = response.data;
+        });
+      },
       cancelLoading() {
         setTimeout(() => {
           this.loading = false;