|  |  |  | 
|---|
|  |  |  | show-time | 
|---|
|  |  |  | @ok="change1()" | 
|---|
|  |  |  | valueFormat="yyyy-MM-DD HH:MM:SS" | 
|---|
|  |  |  | style="width: 200px" | 
|---|
|  |  |  | style="width: 175px" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <a-select | 
|---|
|  |  |  | ref="select" | 
|---|
|  |  |  | v-model="carvalue" | 
|---|
|  |  |  | style="width: 200px; margin-left: 10px" | 
|---|
|  |  |  | style="width: 180px; margin-left: 10px" | 
|---|
|  |  |  | placeholder="请选择走航车" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <a-select-option | 
|---|
|  |  |  | 
|---|
|  |  |  | </a-select> | 
|---|
|  |  |  | <a-button type="primary" style="margin-left: 10px" @click="selectCar" | 
|---|
|  |  |  | >查询</a-button | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <a-button type="primary" style="margin-left: 10px" @click="selectCheck" | 
|---|
|  |  |  | >校验</a-button | 
|---|
|  |  |  | > | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | </a-modal> | 
|---|
|  |  |  | <div class="right"> | 
|---|
|  |  |  | <div id="roadmap" class="roadmap"></div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="fixeds" v-show="showfix === true"> | 
|---|
|  |  |  | <div style="font-size: 20px; margin-left: 50px; margin-top: 50px"> | 
|---|
|  |  |  | {{ messageshow }} | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <div style="font-size: 20px; margin-left: 50px"> | 
|---|
|  |  |  | <a-button | 
|---|
|  |  |  | type="primary" | 
|---|
|  |  |  | style="margin-top: 20px; float: right; margin-right: 20px" | 
|---|
|  |  |  | @click="closemess" | 
|---|
|  |  |  | >关闭</a-button | 
|---|
|  |  |  | > | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | 
|---|
|  |  |  | private batchid:any=0 | 
|---|
|  |  |  | private batchshow:boolean=false | 
|---|
|  |  |  | private handleEditbatch(record){ | 
|---|
|  |  |  | this.check=false | 
|---|
|  |  |  | this.startstate='batch' | 
|---|
|  |  |  | this.batchshow=true | 
|---|
|  |  |  | this.selectCar(); | 
|---|
|  |  |  | this.batchid=record.coordinateId | 
|---|
|  |  |  | } | 
|---|
|  |  |  | private handlebatch(){ | 
|---|
|  |  |  | this.selectCar() | 
|---|
|  |  |  | this.batchshow=false | 
|---|
|  |  |  | this.handlenull(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | private handlenull(){ | 
|---|
|  |  |  | this.starttime='' | 
|---|
|  |  |  | this.endtime='' | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | private insertbatch(){ | 
|---|
|  |  |  | post('coordinateDetail/batch',{ | 
|---|
|  |  |  | 
|---|
|  |  |  | private upa='' | 
|---|
|  |  |  | private recordid:any=0 | 
|---|
|  |  |  | private handleEditModalVisible(record){ | 
|---|
|  |  |  | this.check=false | 
|---|
|  |  |  | this.handlebatch() | 
|---|
|  |  |  | this.startstate='none' | 
|---|
|  |  |  | this.upa='upa' | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | private inupa(){ | 
|---|
|  |  |  | this.upa='' | 
|---|
|  |  |  | this.selectCar() | 
|---|
|  |  |  | } | 
|---|
|  |  |  | private carvalue:any='请选择走航车' | 
|---|
|  |  |  | private carIndex:any=[] | 
|---|
|  |  |  | 
|---|
|  |  |  | this.carIndex=res.data.data; | 
|---|
|  |  |  | console.log(this.carIndex); | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | private check:boolean=false | 
|---|
|  |  |  | private showfix:boolean=false | 
|---|
|  |  |  | private messageshow:any='' | 
|---|
|  |  |  | private selectCheck(){ | 
|---|
|  |  |  | if(this.carvalue==='请选择走航车'){ | 
|---|
|  |  |  | this.$message.warning('请选择走航车') | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(this.timevalue.length===0){ | 
|---|
|  |  |  | this.$message.warning('请选择时间') | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | get('cruiserInfo/getCruiserCompare',{ | 
|---|
|  |  |  | mac:this.carvalue, | 
|---|
|  |  |  | // time1:'2023-08-05 00:00:00', | 
|---|
|  |  |  | // time2:'2023-08-06 00:00:00' | 
|---|
|  |  |  | time1:this.timevalue[0], | 
|---|
|  |  |  | time2:this.timevalue[1] | 
|---|
|  |  |  | }).then((res)=>{ | 
|---|
|  |  |  | console.log(res.data.data,'res'); | 
|---|
|  |  |  | this.messageshow=res.data.data.message | 
|---|
|  |  |  | this.showfix=true | 
|---|
|  |  |  | // this.check=true | 
|---|
|  |  |  | this.carDate=[] | 
|---|
|  |  |  | this.pointshow=false | 
|---|
|  |  |  | this.setMarker(res) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | private closemess(){ | 
|---|
|  |  |  | this.showfix=false | 
|---|
|  |  |  | } | 
|---|
|  |  |  | private carDate:any=[] | 
|---|
|  |  |  | private selectCar(){ | 
|---|
|  |  |  | 
|---|
|  |  |  | that.carDate=[] | 
|---|
|  |  |  | that.carDataList=[] | 
|---|
|  |  |  | for(var i=0;i<res.data.data.rsData.length;i++){ | 
|---|
|  |  |  | // res.data.data.rsData[i].flylat=res.data.data.rsData[i].flylat+'°'.toString() | 
|---|
|  |  |  | // res.data.data.rsData[i].flylon=res.data.data.rsData[i].flylon+'°'.toString() | 
|---|
|  |  |  | that.carDate.push(res.data.data.rsData[i]) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | for(var i=0;i<res.data.data.data.length;i++){ | 
|---|
|  |  |  | // res.data.data.rsData[i].flylat=res.data.data.rsData[i].flylat+'°'.toString() | 
|---|
|  |  |  | // res.data.data.rsData[i].flylon=res.data.data.rsData[i].flylon+'°'.toString() | 
|---|
|  |  |  | that.carDataList.push(res.data.data.data[i]) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | console.log(that.carDate,'that.carDate'); | 
|---|
|  |  |  | 
|---|
|  |  |  | var myIcon = new BMapGL.Icon(require("@/assets/723cd95f31481a502d495b2d814d658.png"), new BMapGL.Size(50, 50), { | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | const statePoint = new BMapGL.Point(that.carDate[i].flylon,that.carDate[i].flylat); | 
|---|
|  |  |  | // console.log(statePoint,'statePoint'); | 
|---|
|  |  |  | bPoints.push(statePoint) | 
|---|
|  |  |  | //将marker保存在data函数中 后续需要使用 | 
|---|
|  |  |  | that.marker[i] = new BMapGL.Marker(statePoint,{icon:myIcon}); | 
|---|
|  |  |  | that.marker[i].customData = {data: that.carDate[i].data,state: that.carDate[i].state}; | 
|---|
|  |  |  | //在地图中添加marker | 
|---|
|  |  |  | that.map.addOverlay(that.marker[i]); | 
|---|
|  |  |  | // if(that.check===false){ | 
|---|
|  |  |  | that.marker[i].addEventListener("click",function(){ | 
|---|
|  |  |  | console.log(that.carDate[i].data,'that.carDate[i].data'); | 
|---|
|  |  |  | switch(that.carDate[i].state){ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (let i = 0; i < that.dataList.length; i++) { | 
|---|
|  |  |  | /*获取当前元素后的所有元素*/ | 
|---|
|  |  |  | for (let j = i + 1; j < that.dataList.length; j++) { | 
|---|
|  |  |  | //判断两个元素的值是否相等 | 
|---|
|  |  |  | if (that.dataList[i].code == that.dataList[j].code) { | 
|---|
|  |  |  | //如果相等则证明出现了重复的元素,则删除j对应的元素 | 
|---|
|  |  |  | that.dataList.splice(j, 1); | 
|---|
|  |  |  | if(that.dataList[i].state==='1'){ | 
|---|
|  |  |  | that.dataList[i].state='2' | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); //监听事件 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (let i = 0; i < that.carDataList.length; i++) { | 
|---|
|  |  |  | console.log(that.carDataList[i],'that.carDataList[i]'); | 
|---|
|  |  |  | // console.log(that.carDataList[i],'that.carDataList[i]'); | 
|---|
|  |  |  | //创建单个point | 
|---|
|  |  |  | var myIcon = new BMapGL.Icon(require("@/assets/fb259ce2e368f6853a58b91d6f6b293.png"), new BMapGL.Size(50, 50), { | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | var myIcon = new BMapGL.Icon(require("@/assets/fb259ce2e368f6853a58b91d6f6b293.png"), new BMapGL.Size(50, 50)); | 
|---|
|  |  |  | const statePoint = new BMapGL.Point(that.carDataList[i].longitude,that.carDataList[i].latitude); | 
|---|
|  |  |  | // console.log(statePoint,'statePoint'); | 
|---|
|  |  |  | aPoints.push(statePoint) | 
|---|
|  |  |  | 
|---|
|  |  |  | that.markerdata[i].customData = {data: that.carDataList[i].code,state: that.carDataList[i].state,id:that.carDataList[i].id}; | 
|---|
|  |  |  | //在地图中添加marker | 
|---|
|  |  |  | that.map.addOverlay(that.markerdata[i]); | 
|---|
|  |  |  | // if(that.check===false){ | 
|---|
|  |  |  | that.markerdata[i].addEventListener("click",function(){ | 
|---|
|  |  |  | switch(that.carDataList[i].state){ | 
|---|
|  |  |  | case '1': | 
|---|
|  |  |  | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | that.dataList.push({code:that.carDataList[i].code,state:that.carDataList[i].state,id:that.carDataList[i].id}); | 
|---|
|  |  |  | console.log(that.dataList); | 
|---|
|  |  |  | // console.log(that.dataList); | 
|---|
|  |  |  | for (let i = 0; i < that.dataList.length; i++) { | 
|---|
|  |  |  | /*获取当前元素后的所有元素*/ | 
|---|
|  |  |  | for (let j = i + 1; j < that.dataList.length; j++) { | 
|---|
|  |  |  | //判断两个元素的值是否相等 | 
|---|
|  |  |  | if (that.dataList[i].code == that.dataList[j].code) { | 
|---|
|  |  |  | //如果相等则证明出现了重复的元素,则删除j对应的元素 | 
|---|
|  |  |  | that.dataList.splice(j, 1); | 
|---|
|  |  |  | if(that.dataList[i].state==='1'){ | 
|---|
|  |  |  | that.dataList[i].state='2' | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // that.indataList = Array.from(new Set(that.dataList)) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); //监听事件 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //重新定义地图的缩放和中心点 | 
|---|
|  |  |  | if(that.pointshow===false){ | 
|---|
|  |  |  | 
|---|
|  |  |  | .BMap_Marker.BMap_noprint { | 
|---|
|  |  |  | width: 23px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .fixeds { | 
|---|
|  |  |  | width: 400px; | 
|---|
|  |  |  | height: 150px; | 
|---|
|  |  |  | background-color: white; | 
|---|
|  |  |  | position: fixed; | 
|---|
|  |  |  | top: 40%; | 
|---|
|  |  |  | left: 55%; | 
|---|
|  |  |  | z-index: 999; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </style> | 
|---|