MSI\liwei 3 лет назад
Родитель
Сommit
7627538bf6

+ 10 - 1
ruoyi-ui/src/api/data/staticalData.js

@@ -61,4 +61,13 @@ export function getStaticDevice() {
         method: 'get',
         params: query
       })
-    }  
+    }  
+
+  //   //查询桥坐标数据
+  //   export function getThresholdList(query) {
+  //     return request({
+  //         url: 'threshold/list?type='+query,
+  //         method: 'get',
+  //         // params: query
+  //     })
+  // }

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

@@ -427,7 +427,7 @@ export default {
                 let tadata = feature.get("tadata"); //我们可以通过给点标记传不同的值,来判断点击不同的点标记触发的事件。
                 if (tadata) {
                     if (tadata.sectionId == "line") {
-                        alert("我是线:" + tadata.towerNumber)
+                        // alert("我是线:" + tadata.towerNumber)
                     }
                     if (tadata.sectionId == "point") {
                         console.log(tadata);
@@ -792,12 +792,9 @@ export default {
             map.getView().setZoom(13);
         },
 
-        addline: function() {
+        addline: function(linePoint) {
 
-            var points = this.transpoints([
-                [118.78, 32.04],
-                [118.88, 32.14]
-            ], 0)
+            var points = this.transpoints(linePoint, 0)
 
             let line = new Feature({
                 tadata: {

+ 13 - 0
ruoyi-ui/src/views/components/table/homeTable.vue

@@ -122,6 +122,7 @@ import scroll from "./scroll.vue"
 import {getDeviceType, getIllegalShipStatic, getSo2Time, getStaticDevice} from "@/api/data/staticalData";
 import {getdeviceList, queryShipData} from "@/api/data/deviceData";
 import mapdiv from '../../../components/map/index.vue'
+import {getThresholdList} from "@/api/data/liuData";
 
 export default {
   name: "homeTable",
@@ -214,6 +215,7 @@ export default {
     this.getStaticDevice();
     this.getIllegalShipStatic();
     this.getshipData();
+    this.getThresholdList();
     // this.addDevicePoint();
     // this.addAisPoint();
     // this.addSo2Point();
@@ -222,6 +224,17 @@ export default {
     //  this.getChart();
   },
   methods: {
+    getThresholdList(){
+           getThresholdList({type: 'bridge'}).then(response => {
+           console.log(response);
+           for(var index in response.rows){
+                var obj = response.rows[index];
+                var points ='['+obj.configValue+']';
+                console.log(JSON.parse(points));
+                this.$refs.mapv.addline(JSON.parse(points));          
+           }
+      });
+    },
     getdeviceList() {
       var dlist = [];
       getdeviceList().then(data => {

+ 0 - 1
ruoyi-ui/src/views/components/table/liuTable.vue

@@ -416,7 +416,6 @@ export default {
       getThresholdList({type: 'so2'}).then(response => {
         this.liuCount = response.rows[0].configValue;
         this.liuCountId = response.rows[0].configId;
-
       });
     }, getThresholdEdit() {
       getThresholdEdit({'configId': this.liuCountId, 'configValue': this.liuCount}).then(response => {