温红权 3 years ago
parent
commit
a3bfe753fd

+ 10 - 6
ruoyi-ui/src/components/map/index.vue

@@ -395,6 +395,7 @@ import {LineString, Point} from "ol/geom";
 import {Icon, Stroke, Style} from "ol/style";
 import {Vector as LayerVec} from "ol/layer";
 import {queryDatabymmsi, queryShipByDeviceId} from "@/api/data/deviceData";
+import WebGLPointsLayer from 'ol/layer/WebGLPoints';
 
 let ispro = process.env.NODE_ENV === "production";
 let that = null;
@@ -463,7 +464,7 @@ export default {
 
 
     this.map.on("click", function (e) {
-      console.log(e)
+      // console.log(e)
       var feature = that.map.forEachFeatureAtPixel(e.pixel,
         function (feature) {
           return feature;
@@ -505,6 +506,9 @@ export default {
       }
     });
 
+    this.map.on("change",function(e){
+      that.$parent.getallshipData();
+    });
     //  this.addpoint();
     //  this.addline();
 
@@ -542,7 +546,7 @@ export default {
 
       this.tabledatas = [];
       queryShipByDeviceId(q).then(data => {
-        console.log(data);
+        // console.log(data);
         data.data.forEach(element => {
           element["values"] = element.illegalType == "heiyan" ? element.rcgSoot : (element.illegalType == "guangpu" ? element.so2Percent : (element.illegalType == "xiutan" ? element.so2Percent : 0));
           this.tabledatas.push(element);
@@ -559,7 +563,7 @@ export default {
       that.addrlist.forEach(element => {
         if (element.name == value) {
           var lo = that.transpoints(element.location, 0)[0];
-          console.log(lo)
+          // console.log(lo)
           mapv.getView().setCenter(lo);
         }
       });
@@ -568,7 +572,7 @@ export default {
     clickly: (value) => {
       if (value.indexOf('普通船') != -1) {
         that.$parent.startgetall();
-        console.log(that.posints)
+        // console.log(that.posints)
 
       } else {
         that.$parent.stopgetall();
@@ -596,7 +600,7 @@ export default {
 
     },
     handleClick(tab, event) {
-      console.log(tab, event);
+      // console.log(tab, event);
       var sect = tab.name;
       if (sect == "first") {
         return;
@@ -607,7 +611,7 @@ export default {
 
       this.tableData = {minor: [], main: []};
       queryDatabymmsi(q).then(data => {
-        console.log(data);
+        // console.log(data);
         this.tableData = data.data;
         //  console.log(deviceList);
       });

+ 7 - 6
ruoyi-ui/src/views/components/table/homeTable.vue

@@ -256,11 +256,11 @@ export default {
     },
     getThresholdList() {
       getThresholdList({type: 'bridge'}).then(response => {
-        console.log(response);
+        // console.log(response);
         for (var index in response.rows) {
           var obj = response.rows[index];
           var points = '[' + obj.configValue + ']';
-          console.log(JSON.parse(points));
+          // console.log(JSON.parse(points));
           this.$refs.mapv.addline(JSON.parse(points));
         }
       });
@@ -268,7 +268,7 @@ export default {
     getdeviceList() {
       var dlist = [];
       getdeviceList().then(data => {
-        console.log(data);
+        // console.log(data);
         var deviceList = [];
         this.deviceList = data.data;
         for (var key in data.data) {
@@ -318,6 +318,7 @@ export default {
     },
 
     getallshipData() {
+      if(!this.isstart) return;
     //    this.allship = this.ship1;
     //  this.addshipPointall();
 
@@ -386,7 +387,7 @@ export default {
       }
     },
     getSo2Time() {
-      console.log(111);
+      // console.log(111);
       getSo2Time(this.shipDate).then(data => {
         this.getMonthArry(this.shipDate.startMonth, this.shipDate.endMonth);
         this.so2TimeData = data.data
@@ -424,7 +425,7 @@ export default {
         }
 
       }
-      console.log(this.shipDateArry);
+      // console.log(this.shipDateArry);
     },
     getMonthDate() {
       var time = new Date();
@@ -457,7 +458,7 @@ export default {
       }, 0);
     },
     handleClick(tab, event) {
-      console.log(tab, event);
+      // console.log(tab, event);
     },
     openChart() {
       const t = this;