Browse Source

Merge branch 'yx' of http://61.161.152.110:10101/r/electronic-map into yx

chenminghua 3 years ago
parent
commit
4b10825fbe

+ 13 - 9
src/App.vue

@@ -183,6 +183,7 @@ l16.229-16.229l16.229,16.229l42.867-42.867C115.034,45.228,109.133,42.189,102.956
 // 导入header.vue文件
 import Menu from "@/views/layout/Menu.vue";
 import Header from "@/views/layout/Header.vue";
+
 import { mapMutations } from "vuex";
 
 export default {
@@ -190,7 +191,16 @@ export default {
     Menu,
     Header,
   },
-  mounted() {
+
+  data() {
+    return {
+      isShowMenu: false,
+      // 当前子系统
+      root: "",
+    };
+  },
+
+  created() {
     let that = this;
     that.$nextTick(() => {
       that.API.requestData({
@@ -220,13 +230,7 @@ export default {
       });
     });
   },
-  data() {
-    return {
-      isShowMenu: false,
-      // 当前子系统
-      root: "",
-    };
-  },
+  
   methods: {
     // 切换子系统事件
     HeaderMenuClick(data) {
@@ -237,7 +241,7 @@ export default {
     },
     hideMenu() {
       this.isShowMenu = false;
-    },
+    }
   },
 };
 </script>

+ 7 - 0
src/components/chart/line/simple-line-chart.vue

@@ -132,6 +132,10 @@ export default {
       type: String,
       default: "green",
     },
+    lineTitle:{
+      type: Array,
+      default: () => [],
+    }
   },
   data() {
     return {
@@ -352,11 +356,13 @@ export default {
     },
   },
   created() {
+    this.xData = this.lineTitle;
     this.$nextTick(()=>{
       this.id = "pie-chart-" + util.newGUID();
     });
   },
   mounted() {
+    this.xData = this.lineTitle;
     this.$nextTick(() => {
       this.$el.style.width = this.width;
       this.$el.style.height = this.height;
@@ -364,6 +370,7 @@ export default {
     });
   },
   updated() {
+    this.xData = this.lineTitle;
     this.$nextTick(() => {
       this.initChart();
     });

+ 1 - 1
src/router/index.js

@@ -155,7 +155,7 @@ const routes = [
     path: '/health/health4',
     name: 'health4',
     children: [{
-      path: 'healthLineChart/:wtId', // 健康趋势
+      path: 'healthLineChart/:wtId', // 风机健康趋势
       component: () => import(/* webpackChunkName: "healthLineChart" */ '../views/HealthControl/healthLineChart.vue'),
     },
     {

+ 25 - 0
src/tools/basicTool.js

@@ -223,6 +223,31 @@ export default {
     });
   },
 
+  // JS 触发全屏功能
+  requestFullscreen () {
+    //全屏
+    const docElm = document.documentElement;
+    //W3C
+    if (docElm.requestFullscreen) {
+      docElm.requestFullscreen();
+    }
+
+    //FireFox
+    else if (docElm.mozRequestFullScreen) {
+      docElm.mozRequestFullScreen();
+    }
+
+    //Chrome等
+    else if (docElm.webkitRequestFullScreen) {
+      docElm.webkitRequestFullScreen();
+    }
+
+    //IE11
+    else if (docElm.msRequestFullscreen) {
+      docElm.msRequestFullscreen();
+    }
+  },
+
   /**
    * 颜色进制转换  16 <--> 10 互转
    * @param {String} colorStr 传入一个颜色字符串, 16进制 或者 10进制 ,返回转换后的结果,例:传入 #1890ff ,返回 rgb(24, 144, 255),反之亦然

+ 34 - 7
src/views/HealthControl/healthLineChart.vue

@@ -1,10 +1,6 @@
 <template>
   <div class="pageBox">
-    <simple-line-chart :height="'100px'" />
-    <simple-line-chart :height="'100px'" :color="'yellow'" :title="'发电机'" />
-    <simple-line-chart :height="'100px'" :color="'purple'" :title="'变桨系统'" />
-    <simple-line-chart :height="'100px'" :color="'blue'" :title="'主控系统'" />
-    <simple-line-chart :height="'100px'" :color="'orange'" :title="'齿轮箱'" />
+    <simple-line-chart :height="'100px'" v-for="(item, index) in chartData" :key="index" :title="item.title" :data="item.data" :color="item.color" :lineTitle="item.lineTitle" />
   </div>
 </template>
 
@@ -14,15 +10,46 @@ export default {
   setup() {},
   components: { SimpleLineChart },
   data() {
-    return {};
+    return {
+      chartData:[]
+    };
   },
 
   created() {
     this.wtId = this.$route.params.wtId;
+    this.requestData();
   },
   
   methods:{
-   
+    requestData(){
+      let that=this;
+      that.API.requestData({
+        method: "POST",
+        subUrl: "healthsub/hsFjValueIndex",
+        data:{
+          wtId: that.wtId
+        },
+        success(res) {
+
+          const color=["green","yellow","purple","blue","orange"];
+          let chartData=[];
+          let lineTitle=[];
+
+          res.data.xData.forEach(ele=>{
+            lineTitle.push(new Date(ele).formatDate("hh:mm"));
+          });
+
+          res.data.datasets.forEach((ele,index)=>{
+            chartData.push({
+              title:ele.name,
+              data:ele.data,
+              color:color[index],
+              lineTitle
+            });
+          });
+          that.chartData=chartData;
+        },
+      });}
   }
 };
 </script>

+ 22 - 18
src/views/Home/Home.vue

@@ -116,17 +116,17 @@
               <td class="value green">{{jczbmap.zjts}}</td>
               <td class="unit gray">台</td>
             </tr>
-            <tr class="" @click="openDialog('日发电量详情', 'genreset/findDayInfo', 'rfdl', 'table')">
+            <tr class="curP" @click="openDialog('日发电量详情', 'genreset/findDayInfo', 'rfdl', 'table')">
               <td class="text gray">日发电量</td>
               <td class="value green">{{jczbmap.rfdl}}</td>
               <td class="unit gray">万kwh</td>
             </tr>
-            <tr class="" @click="openDialog('月发电量详情', 'genreset/findMonthInfo', 'yfdl', 'table')">
+            <tr class="curP" @click="openDialog('月发电量详情', 'genreset/findMonthInfo', 'yfdl', 'table')">
               <td class="text gray">月发电量</td>
               <td class="value green">{{jczbmap.yfdl}}</td>
               <td class="unit gray gray">万kwh</td>
             </tr>
-            <tr class="" @click="openDialog('年发电量详情', 'genreset/findYearInfo', 'nfdl', 'table')">
+            <tr class="curP" @click="openDialog('年发电量详情', 'genreset/findYearInfo', 'nfdl', 'table')">
               <td class="text gray">年发电量</td>
               <td class="value green">{{jczbmap.nfdl}}</td>
               <td class="unit gray">万kwh</td>
@@ -178,27 +178,27 @@
         <Col>
         <com-panel>
           <table class="table-card">
-            <tr class="" @click="openDialog('日性能损失详情', 'genreset/findDayInfo', 'rxnssdl', 'table')">
+            <tr class="curP" @click="openDialog('日性能损失详情', 'genreset/findDayInfo', 'rxnssdl', 'table')">
               <td class="text gray">日性能损失</td>
               <td class="value green">{{wxssmap.rqfssdl}}</td>
               <td class="unit gray">万kwh</td>
             </tr>
-            <tr class="" @click="openDialog('日故障损失详情', 'genreset/findDayInfo', 'rgzssdl', 'table')">
+            <tr class="curP" @click="openDialog('日故障损失详情', 'genreset/findDayInfo', 'rgzssdl', 'table')">
               <td class="text gray">日故障损失</td>
               <td class="value green">{{wxssmap.rgzssdl}}</td>
               <td class="unit gray">万kwh</td>
             </tr>
-            <tr class="" @click="openDialog('日检修损失详情', 'genreset/findDayInfo', 'rjxssdl', 'table')">
+            <tr class="curP" @click="openDialog('日检修损失详情', 'genreset/findDayInfo', 'rjxssdl', 'table')">
               <td class="text gray">日检修损失</td>
               <td class="value green">{{wxssmap.rjxssdl}}</td>
               <td class="unit gray">万kwh</td>
             </tr>
-            <tr class="" @click="openDialog('日限电损失详情', 'genreset/findDayInfo', 'rxdssdl', 'table')">
+            <tr class="curP" @click="openDialog('日限电损失详情', 'genreset/findDayInfo', 'rxdssdl', 'table')">
               <td class="text gray">日限电损失</td>
               <td class="value green">{{wxssmap.rxdssdl}}</td>
               <td class="unit gray gray">万kwh</td>
             </tr>
-            <tr class="" @click="openDialog('日受累损失详情', 'genreset/findDayInfo', 'rslssdl', 'table')">
+            <tr class="curP" @click="openDialog('日受累损失详情', 'genreset/findDayInfo', 'rslssdl', 'table')">
               <td class="text gray">日受累损失</td>
               <td class="value green">{{wxssmap.rslssdl}}</td>
               <td class="unit gray">万kwh</td>
@@ -214,27 +214,27 @@
         <Col>
         <com-panel>
           <table class="table-card">
-            <tr class="" @click="openDialog('月性能损失详情', 'genreset/findMonthInfo', 'yxnssdl', 'table')">
+            <tr class="curP" @click="openDialog('月性能损失详情', 'genreset/findMonthInfo', 'yxnssdl', 'table')">
               <td class="text gray">月性能损失</td>
               <td class="value green">{{wxssmap.yqfssdl}}</td>
               <td class="unit gray">万kwh</td>
             </tr>
-            <tr class="" @click="openDialog('月故障损失详情', 'genreset/findMonthInfo', 'ygzssdl', 'table')">
+            <tr class="curP" @click="openDialog('月故障损失详情', 'genreset/findMonthInfo', 'ygzssdl', 'table')">
               <td class="text gray">月故障损失</td>
               <td class="value green">{{wxssmap.ygzssdl}}</td>
               <td class="unit gray">万kwh</td>
             </tr>
-            <tr class="" @click="openDialog('月检修损失详情', 'genreset/findMonthInfo', 'yjxssdl', 'table')">
+            <tr class="curP" @click="openDialog('月检修损失详情', 'genreset/findMonthInfo', 'yjxssdl', 'table')">
               <td class="text gray">月检修损失</td>
               <td class="value green">{{wxssmap.yjxssdl}}</td>
               <td class="unit gray">万kwh</td>
             </tr>
-            <tr class="" @click="openDialog('月限电损失详情', 'genreset/findMonthInfo', 'yxdssdl', 'table')">
+            <tr class="curP" @click="openDialog('月限电损失详情', 'genreset/findMonthInfo', 'yxdssdl', 'table')">
               <td class="text gray">月限电损失</td>
               <td class="value green">{{wxssmap.yxdssdl}}</td>
               <td class="unit gray gray">万kwh</td>
             </tr>
-            <tr class="" @click="openDialog('月受累损失详情', 'genreset/findMonthInfo', 'yslssdl', 'table')">
+            <tr class="curP" @click="openDialog('月受累损失详情', 'genreset/findMonthInfo', 'yslssdl', 'table')">
               <td class="text gray">月受累损失</td>
               <td class="value green">{{wxssmap.yslssdl}}</td>
               <td class="unit gray">万kwh</td>
@@ -250,27 +250,27 @@
         <Col>
         <com-panel>
           <table class="table-card">
-            <tr class="" @click="openDialog('年性能损失详情', 'genreset/findYearInfo', 'nxnssdl', 'table')">
+            <tr class="curP" @click="openDialog('年性能损失详情', 'genreset/findYearInfo', 'nxnssdl', 'table')">
               <td class="text gray">年性能损失</td>
               <td class="value green">{{wxssmap.nqfssdl}}</td>
               <td class="unit gray">万kwh</td>
             </tr>
-            <tr class="" @click="openDialog('年故障损失详情', 'genreset/findYearInfo', 'ngzssdl', 'table')">
+            <tr class="curP" @click="openDialog('年故障损失详情', 'genreset/findYearInfo', 'ngzssdl', 'table')">
               <td class="text gray">年故障损失</td>
               <td class="value green">{{wxssmap.ngzssdl}}</td>
               <td class="unit gray">万kwh</td>
             </tr>
-            <tr class="" @click="openDialog('年检修损失详情', 'genreset/findYearInfo', 'njxssdl', 'table')">
+            <tr class="curP" @click="openDialog('年检修损失详情', 'genreset/findYearInfo', 'njxssdl', 'table')">
               <td class="text gray">年检修损失</td>
               <td class="value green">{{wxssmap.njxssdl}}</td>
               <td class="unit gray">万kwh</td>
             </tr>
-            <tr class="" @click="openDialog('年限电损失详情', 'genreset/findYearInfo', 'nxdssdl', 'table')">
+            <tr class="curP" @click="openDialog('年限电损失详情', 'genreset/findYearInfo', 'nxdssdl', 'table')">
               <td class="text gray">年限电损失</td>
               <td class="value green">{{wxssmap.nxdssdl}}</td>
               <td class="unit gray gray">万kwh</td>
             </tr>
-            <tr class="" @click="openDialog('年受累损失详情', 'genreset/findYearInfo', 'nslssdl', 'table')">
+            <tr class="curP" @click="openDialog('年受累损失详情', 'genreset/findYearInfo', 'nslssdl', 'table')">
               <td class="text gray">年受累损失</td>
               <td class="value green">{{wxssmap.nslssdl}}</td>
               <td class="unit gray">万kwh</td>
@@ -787,6 +787,10 @@ export default {
   border-collapse: collapse;
   width: 100%;
 
+  .curP{
+    cursor: pointer;
+  }
+
   tr {
     font-size: @fontsize-s;
     td {