温红权 3 년 전
부모
커밋
4919d8e340
3개의 변경된 파일30개의 추가작업 그리고 2개의 파일을 삭제
  1. 8 0
      ruoyi-ui/src/api/data/deviceData.js
  2. 2 0
      ruoyi-ui/src/components/map/index.vue
  3. 20 2
      ruoyi-ui/src/views/components/table/homeTable.vue

+ 8 - 0
ruoyi-ui/src/api/data/deviceData.js

@@ -15,4 +15,12 @@ export function queryShipByDeviceId(query) {
         method: "get",
         params: query
     });
+}
+
+export function queryShipData(query) {
+    return request({
+        url: "gas/common/queryShipList",
+        method: "get",
+        params: query,
+    });
 }

+ 2 - 0
ruoyi-ui/src/components/map/index.vue

@@ -510,6 +510,8 @@ export default {
     setaddrlist(list) {
       this.addrlist = list;
       this.caddr = list[0].name;
+      var lo = that.transpoints(list[0].location, 0)[0];
+      mapv.getView().setCenter(lo);
     },
 
     handleClick(tab, event) {

+ 20 - 2
ruoyi-ui/src/views/components/table/homeTable.vue

@@ -119,7 +119,7 @@
 
 <script>
 import scroll from "./scroll.vue"
-import {getDeviceType, getIllegalShipStatic, getSo2Time, getStaticDevice} from "@/api/data/staticalData";
+import {getDeviceType, getIllegalShipStatic, getSo2Time, getStaticDevice,queryShipData} from "@/api/data/staticalData";
 import {getdeviceList} from "@/api/data/deviceData";
 import mapdiv from '../../../components/map/index.vue'
 
@@ -247,10 +247,11 @@ export default {
     this.getdeviceList();
     this.getStaticDevice();
     this.getIllegalShipStatic();
+     this.getshipData();
     // this.addDevicePoint();
     // this.addAisPoint();
     // this.addSo2Point();
-    this.addshipPoint();
+    // this.addshipPoint();
     //  console.log(111111111111)
     //  this.getChart();
   },
@@ -287,6 +288,23 @@ export default {
         //  console.log(deviceList);
       });
     },
+    getshipData(){
+
+      queryShipData().then(data => {
+        var shipdatalist = [];
+        for (var key in data.data) {
+          var ship = data.data[key];
+          ship["name"] = ship.shipName;
+          ship["locations"] = [[ship.lat,ship.lng]];
+          ship["type"] = ship.illegalStatus;
+          shipdatalist.push(ship);
+        }
+        this.ship = shipdatalist;
+        this.addshipPoint();
+      });
+
+
+    },
     // addDevicePoint(){
     //       for(var index in this.heyDeviceData){
     //             var obj = this.heyDeviceData[index]