|
@@ -257,6 +257,49 @@ export default {
|
|
|
// this.getChart();
|
|
|
},
|
|
|
methods: {
|
|
|
+ clickship(shipdata){
|
|
|
+
|
|
|
+ if (shipdata!=null && shipdata!=undefined) {
|
|
|
+ var ship = shipdata;
|
|
|
+ ship["shipName"] = ship.shipname_cn;
|
|
|
+ ship["locations"] = [[ship.lng, ship.lat]];
|
|
|
+ ship["type"] = 1;
|
|
|
+ ship["speed"] = ship.speed == null ? '-' : ship.speed;
|
|
|
+ ship["head"] = ship.head == null ? '-' : ship.head;
|
|
|
+ ship["course"] = ship.course == null ? '-' : ship.course;
|
|
|
+ ship["monitorPointName"] = '-';
|
|
|
+
|
|
|
+ var tt=[];
|
|
|
+ var obj = ship;
|
|
|
+ var img = 'zc.png'
|
|
|
+ if (obj.type == 2) {
|
|
|
+ img = 'xy.png'
|
|
|
+ } else if (obj.type == 3) {
|
|
|
+ img = 'wg.png'
|
|
|
+ }
|
|
|
+ var isin = false;
|
|
|
+ for(var i in this.ship){
|
|
|
+ if(this.ship[i]["mmsi"] == obj["mmsi"]){
|
|
|
+ this.ship[i] = obj;
|
|
|
+ isin = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!isin){
|
|
|
+ this.ship.push(obj);
|
|
|
+ }
|
|
|
+ this.addshipPoint();
|
|
|
+ this.$refs.mapv.map.getView().setCenter(this.$refs.mapv.transpoints(obj["locations"], 0)[0]);
|
|
|
+ this.$refs.mapv.map.getView().setZoom(18);
|
|
|
+ this.$refs.mapv.shipShow = true;
|
|
|
+ this.$refs.mapv.deviceShow = false;
|
|
|
+ this.$refs.mapv.deviceTableShow = false
|
|
|
+ this.$refs.mapv.shipName = obj;
|
|
|
+ this.$refs.mapv.activeName = "first";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
stopgetall() {
|
|
|
this.isstart = false;
|
|
|
},
|