Selaa lähdekoodia

修改取值错误和设备页面的生产环境地址切换

459242451@qq.com 3 vuotta sitten
vanhempi
commit
18c2814ca1
2 muutettua tiedostoa jossa 182 lisäystä ja 182 poistoa
  1. 179 180
      ruoyi-ui/src/views/components/table/homeTable.vue
  2. 3 2
      ruoyi-ui/src/views/home.vue

+ 179 - 180
ruoyi-ui/src/views/components/table/homeTable.vue

@@ -8,7 +8,7 @@
         <div style="float:left">
           <div class="lcbBackground">
             <div style="margin-top:12rem">
-              {{ blackCount }}
+              {{ so2Count }}
               <br/>
               <span style="font-size:5rem">艘</span>
             </div>
@@ -18,7 +18,7 @@
         <div style="float:left">
           <div class="hyzpBackground">
             <div style="margin-top:12rem">
-              {{ so2Count }}
+              {{ blackCount }}
               <br/>
               <span style="font-size:5rem">艘</span>
             </div>
@@ -115,7 +115,7 @@
 
 <script>
 import scroll from "./scroll.vue"
-import {getDeviceType, getIllegalShipStatic, getStaticDevice,getSo2Time,queryIllegalInfoList} from "@/api/data/staticalData";
+import {getDeviceType, getIllegalShipStatic, getSo2Time, getStaticDevice} from "@/api/data/staticalData";
 import {getdeviceList} from "@/api/data/deviceData";
 import mapdiv from '../../../components/map/index.vue'
 
@@ -139,7 +139,7 @@ export default {
       normalCount: 1,
       dialogVisibleShip: false,
       beginTime: '',
-      so2TimeData:{},
+      so2TimeData: {},
       endTime: '',
       deviceTotal: 0,
       queryParams: {
@@ -187,58 +187,56 @@ export default {
         value: 0.09,
         count: 0.3,
         address: '上海市普陀区金沙江路 1516 弄'
-      }*/],shipDate:{
-               startMonth:'',
-               endMonth:''
-        },
-        shipDateArry:[
-
-        ],
-        heyDeviceData:[
-            {"name":"南京三桥黑烟1","locations":[[118.643133,31.969894]],"data":{'监测点':"南京三桥",'类型':'黑烟检测'}},
-            {"name":"南京三桥黑烟2","locations":[[118.642232,31.970804]],"data":{'监测点':"南京三桥",'类型':'黑烟检测'}},
-            {"name":"南京三桥黑烟3","locations":[[118.6503,31.965016]]},
-            {"name":"南京三桥黑烟4","locations":[[118.638434,31.973189]]},
-            {"name":"南京三桥黑烟5","locations":[[118.643283,31.970076]]},
-            {"name":"南京三桥黑烟6","locations":[[118.647403,31.967309]]},
-            {"name":"苏通大桥黑烟1","locations":[[121.001581,31.78503]]},
-            {"name":"苏通大桥黑烟2","locations":[[120.997083,31.76303]]},
-            {"name":"苏通大桥黑烟3","locations":[[120.998929,31.771094]]},
-            {"name":"苏通大桥黑烟4","locations":[[121.002491,31.791012]]},
-            {"name":"江阴大桥黑烟1","locations":[[120.27317,31.945522]]},
-            {"name":"江阴大桥黑烟2","locations":[[120.274763,31.942572]]},
-            {"name":"润扬大桥黑烟1","locations":[[119.366033,32.210959]]},
-            {"name":"润扬大桥黑烟2","locations":[[119.370324,32.202425]]},
-        ],
-          so2DeviceData:[
-            {"name":"南京三桥嗅探1","locations":[[118.640237,31.971992]]},
-            {"name":"南京三桥嗅探2","locations":[[118.647447,31.967359]]},
-            {"name":"南京三桥嗅探3","locations":[[118.641632,31.971064]]},
-            {"name":"苏通大桥嗅探1","locations":[[121.003306,31.792982]]},
-            {"name":"苏通大桥嗅探2","locations":[[120.999529,31.775326]]},
-            {"name":"江阴大桥嗅探1","locations":[[120.272167,31.947384]]},
-            {"name":"江阴大桥嗅探2","locations":[[120.274441,31.943087]]},
-            {"name":"润扬大桥嗅探1","locations":[[119.367277,32.209071]]},
-            {"name":"润扬大桥嗅探2","locations":[[119.369466,32.204568]]},
-        ],
-        aisDeviceData:[
-            {"name":"南京三桥光谱1","locations":[[118.642876,31.970445]]},
-            {"name":"南京三桥光谱2","locations":[[118.648949,31.966386]]},
-            {"name":"南京三桥光谱3","locations":[[118.651223,31.964747]]},
-            {"name":"苏通大桥光谱1","locations":[[121.003134,31.789772]]},
-            {"name":"苏通大桥光谱2","locations":[[120.997985,31.762921]]},
-            {"name":"江阴大桥光谱1","locations":[[120.272044,31.947069]]},
-            {"name":"江阴大桥光谱2","locations":[[120.276078,31.940587]]},
-            {"name":"润扬大桥光谱1","locations":[[119.367235,32.209107]]},
-            {"name":"润扬大桥光谱2","locations":[[119.369724,32.204459]]},
-        ],
-        ship:[
-             {"name":"一号船","locations":[[118.639711,31.96602]],'type':1},
-             {"name":"二号船","locations":[[118.649839,31.970352]],'type':2},
-             {"name":"三号船","locations":[[118.638466,31.970716]],'type':1},
-             {"name":"四号船","locations":[[118.643402,31.961505]],'type':3},
-             {"name":"五号船","locations":[[118.64941,31.973519]],'type':2},
-        ]
+      }*/], shipDate: {
+        startMonth: '',
+        endMonth: ''
+      },
+      shipDateArry: [],
+      heyDeviceData: [
+        {"name": "南京三桥黑烟1", "locations": [[118.643133, 31.969894]], "data": {'监测点': "南京三桥", '类型': '黑烟检测'}},
+        {"name": "南京三桥黑烟2", "locations": [[118.642232, 31.970804]], "data": {'监测点': "南京三桥", '类型': '黑烟检测'}},
+        {"name": "南京三桥黑烟3", "locations": [[118.6503, 31.965016]]},
+        {"name": "南京三桥黑烟4", "locations": [[118.638434, 31.973189]]},
+        {"name": "南京三桥黑烟5", "locations": [[118.643283, 31.970076]]},
+        {"name": "南京三桥黑烟6", "locations": [[118.647403, 31.967309]]},
+        {"name": "苏通大桥黑烟1", "locations": [[121.001581, 31.78503]]},
+        {"name": "苏通大桥黑烟2", "locations": [[120.997083, 31.76303]]},
+        {"name": "苏通大桥黑烟3", "locations": [[120.998929, 31.771094]]},
+        {"name": "苏通大桥黑烟4", "locations": [[121.002491, 31.791012]]},
+        {"name": "江阴大桥黑烟1", "locations": [[120.27317, 31.945522]]},
+        {"name": "江阴大桥黑烟2", "locations": [[120.274763, 31.942572]]},
+        {"name": "润扬大桥黑烟1", "locations": [[119.366033, 32.210959]]},
+        {"name": "润扬大桥黑烟2", "locations": [[119.370324, 32.202425]]},
+      ],
+      so2DeviceData: [
+        {"name": "南京三桥嗅探1", "locations": [[118.640237, 31.971992]]},
+        {"name": "南京三桥嗅探2", "locations": [[118.647447, 31.967359]]},
+        {"name": "南京三桥嗅探3", "locations": [[118.641632, 31.971064]]},
+        {"name": "苏通大桥嗅探1", "locations": [[121.003306, 31.792982]]},
+        {"name": "苏通大桥嗅探2", "locations": [[120.999529, 31.775326]]},
+        {"name": "江阴大桥嗅探1", "locations": [[120.272167, 31.947384]]},
+        {"name": "江阴大桥嗅探2", "locations": [[120.274441, 31.943087]]},
+        {"name": "润扬大桥嗅探1", "locations": [[119.367277, 32.209071]]},
+        {"name": "润扬大桥嗅探2", "locations": [[119.369466, 32.204568]]},
+      ],
+      aisDeviceData: [
+        {"name": "南京三桥光谱1", "locations": [[118.642876, 31.970445]]},
+        {"name": "南京三桥光谱2", "locations": [[118.648949, 31.966386]]},
+        {"name": "南京三桥光谱3", "locations": [[118.651223, 31.964747]]},
+        {"name": "苏通大桥光谱1", "locations": [[121.003134, 31.789772]]},
+        {"name": "苏通大桥光谱2", "locations": [[120.997985, 31.762921]]},
+        {"name": "江阴大桥光谱1", "locations": [[120.272044, 31.947069]]},
+        {"name": "江阴大桥光谱2", "locations": [[120.276078, 31.940587]]},
+        {"name": "润扬大桥光谱1", "locations": [[119.367235, 32.209107]]},
+        {"name": "润扬大桥光谱2", "locations": [[119.369724, 32.204459]]},
+      ],
+      ship: [
+        {"name": "一号船", "locations": [[118.639711, 31.96602]], 'type': 1},
+        {"name": "二号船", "locations": [[118.649839, 31.970352]], 'type': 2},
+        {"name": "三号船", "locations": [[118.638466, 31.970716]], 'type': 1},
+        {"name": "四号船", "locations": [[118.643402, 31.961505]], 'type': 3},
+        {"name": "五号船", "locations": [[118.64941, 31.973519]], 'type': 2},
+      ]
     }
   }, mounted() {
     this.getMonthDate();
@@ -253,21 +251,21 @@ export default {
     //  this.getChart();
   },
   methods: {
-    getdeviceList(){
-            getdeviceList().then(data =>{
-                      console.log(data);
-                      var deviceList = [];
-                       for (var key in data.data) {
-                              for(var index in data.data[key]){
-                                  var obj = data.data[key][index]
-                                  //  console.log(data.data[key][index].source);
-                                  //  deviceList.push(data.data[key][index]);
-                                   var locationArry = [[obj.latilongti]];
-                                   this.$refs.mapv.addpoint(locationArry,obj,obj.source+'.png','device');
-                              }
-                       }
-                      //  console.log(deviceList);
-            });
+    getdeviceList() {
+      getdeviceList().then(data => {
+        console.log(data);
+        var deviceList = [];
+        for (var key in data.data) {
+          for (var index in data.data[key]) {
+            var obj = data.data[key][index]
+            //  console.log(data.data[key][index].source);
+            //  deviceList.push(data.data[key][index]);
+            var locationArry = [[obj.latilongti]];
+            this.$refs.mapv.addpoint(locationArry, obj, obj.source + '.png', 'device');
+          }
+        }
+        //  console.log(deviceList);
+      });
     },
     // addDevicePoint(){
     //       for(var index in this.heyDeviceData){
@@ -288,82 +286,82 @@ export default {
     //             this.$refs.mapv.addpoint(obj.locations,obj.name,'so2.png','device');
     //       }
     // },
-    addshipPoint(){
-          for(var index in this.ship){
-                var obj = this.ship[index]
-                var img = 'zc.png'
-                if(obj.type == 2){
-                      img ='xy.png'
-                }else if(obj.type == 3){
-                      img ='wg.png'
-                }
-                this.$refs.mapv.addpoint(obj.locations,obj.name,img,'ship');
-          }
+    addshipPoint() {
+      for (var index in this.ship) {
+        var obj = this.ship[index]
+        var img = 'zc.png'
+        if (obj.type == 2) {
+          img = 'xy.png'
+        } else if (obj.type == 3) {
+          img = 'wg.png'
+        }
+        this.$refs.mapv.addpoint(obj.locations, obj.name, img, 'ship');
+      }
     },
-    getSo2Time(){
-           getSo2Time(this.shipDate).then(data =>{
-                  this.getMonthArry(this.shipDate.startMonth,this.shipDate.endMonth);
-                  this.so2TimeData = data.data
-                  this.getShipChart();
-          });
+    getSo2Time() {
+      getSo2Time(this.shipDate).then(data => {
+        this.getMonthArry(this.shipDate.startMonth, this.shipDate.endMonth);
+        this.so2TimeData = data.data
+        this.getShipChart();
+      });
     },
-    getMonthArry(start,end){
-          // this.shipDateArry.push(start);
-          var startYear = start.split('-')[0];
-          var startMonth = parseInt(start.split('-')[1]);
-          var endYear = end.split('-')[0];
-          var endMonth = parseInt(end.split('-')[1]);
-          if(startYear == endYear){
-              for(var i = startMonth;i<endMonth+1;i++){
-                if(i<10){
-                      this.shipDateArry.push(startYear+'-'+"0"+i);
-                }else{
-                      this.shipDateArry.push(startYear+'-'+i);
-                }
-              }
-          }else{
-              for(var i = startMonth;i<13;i++){
-                  if(i<10){
-                      this.shipDateArry.push(startYear+'-'+"0"+i);
-                }else{
-                      this.shipDateArry.push(startYear+'-'+i);
-                }
-              }
-            for(var i = 1;i<endMonth;i++){
-                if(i<10){
-                      this.shipDateArry.push(endYear+'-'+"0"+i);
-                }else{
-                      this.shipDateArry.push(endYear+'-'+i);
-                }
-              }
-
+    getMonthArry(start, end) {
+      // this.shipDateArry.push(start);
+      var startYear = start.split('-')[0];
+      var startMonth = parseInt(start.split('-')[1]);
+      var endYear = end.split('-')[0];
+      var endMonth = parseInt(end.split('-')[1]);
+      if (startYear == endYear) {
+        for (var i = startMonth; i < endMonth + 1; i++) {
+          if (i < 10) {
+            this.shipDateArry.push(startYear + '-' + "0" + i);
+          } else {
+            this.shipDateArry.push(startYear + '-' + i);
           }
-          console.log(this.shipDateArry);
-    },
-    getMonthDate(){
-          var time = new Date();
-          var year = time.getFullYear();
-          var month = time.getMonth();
-          if(month > 9){
-               this.shipDate.endMonth = year+"-"+month
-          }else if(month > 0){
-               this.shipDate.endMonth = year+"-"+"0"+month
-          }else{
-               this.shipDate.endMonth = (year-1)+"-"+'12';
+        }
+      } else {
+        for (var i = startMonth; i < 13; i++) {
+          if (i < 10) {
+            this.shipDateArry.push(startYear + '-' + "0" + i);
+          } else {
+            this.shipDateArry.push(startYear + '-' + i);
           }
-          if(month == 6){
-                this.shipDate.startMonth = year+"-"+'01';
-          }else if(month > 6){
-                this.shipDate.startMonth = year+"-"+'0'+(month-6);
-          }else if(month < 6){
-               if(month >= 3){
-                 this.shipDate.startMonth = (year-1)+"-"+(month+7);
-               }else{
-                 this.shipDate.startMonth = (year-1)+"-"+"0"+(month+7);
-               }
+        }
+        for (var i = 1; i < endMonth; i++) {
+          if (i < 10) {
+            this.shipDateArry.push(endYear + '-' + "0" + i);
+          } else {
+            this.shipDateArry.push(endYear + '-' + i);
           }
+        }
+
+      }
+      console.log(this.shipDateArry);
+    },
+    getMonthDate() {
+      var time = new Date();
+      var year = time.getFullYear();
+      var month = time.getMonth();
+      if (month > 9) {
+        this.shipDate.endMonth = year + "-" + month
+      } else if (month > 0) {
+        this.shipDate.endMonth = year + "-" + "0" + month
+      } else {
+        this.shipDate.endMonth = (year - 1) + "-" + '12';
+      }
+      if (month == 6) {
+        this.shipDate.startMonth = year + "-" + '01';
+      } else if (month > 6) {
+        this.shipDate.startMonth = year + "-" + '0' + (month - 6);
+      } else if (month < 6) {
+        if (month >= 3) {
+          this.shipDate.startMonth = (year - 1) + "-" + (month + 7);
+        } else {
+          this.shipDate.startMonth = (year - 1) + "-" + "0" + (month + 7);
+        }
+      }
     },
-    openShipChart(){
+    openShipChart() {
       const t = this;
       setTimeout(() => {
         //  执行echarts画图方法
@@ -411,34 +409,35 @@ export default {
       var aisArry = [];
       var hyArry = [];
       // console.log(data);
-       for(var index in this.shipDateArry){
-            // console.log(this.shipDateArry[index]+'-01T00:00:00Z');
-            // console.log(this.so2TimeData.so2['2021-01-01T00:00:00Z']);
-            if(this.so2TimeData.so2[this.shipDateArry[index]+'-01T00:00:00Z']){
-                  so2Arry.push(this.so2TimeData.so2[this.shipDateArry[index]+'-01T00:00:00Z']);
-            }else {
-                  so2Arry.push(0);
-            }
-            if(this.so2TimeData.ais[this.shipDateArry[index]+'-01T00:00:00Z']){
-                  aisArry.push(this.so2TimeData.ais[this.shipDateArry[index]+'-01T00:00:00Z']);
-            }else{
-                  aisArry.push(0);
-            }if(this.so2TimeData.ais[this.shipDateArry[index]+'-01T00:00:00Z']){
-                  hyArry.push(this.so2TimeData.black[this.shipDateArry[index]+'-01T00:00:00Z']);
-            }else{
-                  hyArry.push(0);
-            }
+      for (var index in this.shipDateArry) {
+        // console.log(this.shipDateArry[index]+'-01T00:00:00Z');
+        // console.log(this.so2TimeData.so2['2021-01-01T00:00:00Z']);
+        if (this.so2TimeData.so2[this.shipDateArry[index] + '-01T00:00:00Z']) {
+          so2Arry.push(this.so2TimeData.so2[this.shipDateArry[index] + '-01T00:00:00Z']);
+        } else {
+          so2Arry.push(0);
+        }
+        if (this.so2TimeData.ais[this.shipDateArry[index] + '-01T00:00:00Z']) {
+          aisArry.push(this.so2TimeData.ais[this.shipDateArry[index] + '-01T00:00:00Z']);
+        } else {
+          aisArry.push(0);
         }
+        if (this.so2TimeData.ais[this.shipDateArry[index] + '-01T00:00:00Z']) {
+          hyArry.push(this.so2TimeData.black[this.shipDateArry[index] + '-01T00:00:00Z']);
+        } else {
+          hyArry.push(0);
+        }
+      }
       var myChart = this.$echarts.init(document.getElementById('shipChart'));
       var option = {
-         color:['#FF2D3C','#FFA647','#61FAFB'],
+        color: ['#FF2D3C', '#FFA647', '#61FAFB'],
         legend: {
-            data: ['黑烟抓拍', '光谱', '嗅探'],
-            right: '10%',
-            textStyle:{
-               color:'#ffffff'
-            }
-          },
+          data: ['黑烟抓拍', '光谱', '嗅探'],
+          right: '10%',
+          textStyle: {
+            color: '#ffffff'
+          }
+        },
         xAxis: {
           type: 'category',
           data: this.shipDateArry,
@@ -591,13 +590,13 @@ export default {
             itemStyle: {
               normal: {
                 label: {
-                        show: true, //开启显示
-                        position: 'top', //在上方显示
-                        textStyle: { //数值样式
-                            color: 'white',
-                            fontSize: 10
-                        }
-                    },
+                  show: true, //开启显示
+                  position: 'top', //在上方显示
+                  textStyle: { //数值样式
+                    color: 'white',
+                    fontSize: 10
+                  }
+                },
                 color: new this.$echarts.graphic.LinearGradient(
                   0, 0, 0, 1,
                   [
@@ -695,14 +694,14 @@ export default {
             data: dataArry,
             itemStyle: {
               normal: {
-               label: {
-                        show: true, //开启显示
-                        position: 'top', //在上方显示
-                        textStyle: { //数值样式
-                            color: 'white',
-                            fontSize: 10
-                        }
-                    },
+                label: {
+                  show: true, //开启显示
+                  position: 'top', //在上方显示
+                  textStyle: { //数值样式
+                    color: 'white',
+                    fontSize: 10
+                  }
+                },
                 color: new this.$echarts.graphic.LinearGradient(
                   0, 0, 0, 1,
                   [

+ 3 - 2
ruoyi-ui/src/views/home.vue

@@ -115,17 +115,18 @@
       <liuTable v-if="showTable==6"></liuTable>
       <roleTable v-if="showTable==7"></roleTable>
       <homeTable v-if="showTable==8"></homeTable>
+      <!-- 9黑烟;10光谱http://101.133.159.237:8087/device.html?opt=1;11嗅探http://198.17.188.2:81/index.html?opt=1 -->
       <iframe style="height:350rem;width:100%" v-show="showTable==9" marginwidth="0" marginheight="0" vspace="0"
               hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true" frameborder="0" name="showHere"
               src="http://198.17.188.6:8091/?opt=1"
       ></iframe>
       <iframe style="height:350rem;width:100%" v-show="showTable==10" marginwidth="0" marginheight="0" vspace="0"
               hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true" frameborder="0" name="showHere"
-              src="http://101.133.159.237:8087/device.html?opt=1"
+              src="http://198.17.25.32:9001/device.html?opt=1"
       ></iframe>
       <iframe style="height:350rem;width:100%" v-show="showTable==11" marginwidth="0" marginheight="0" vspace="0"
               hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true" frameborder="0" name="showHere"
-              src="http://198.17.188.2:81/index.html?opt=1"
+              src="http://198.17.25.32:9011/index.html?opt=1"
       ></iframe>
     </div>