From 0a94001b2ca46314bef91c62eecd43c873d6f383 Mon Sep 17 00:00:00 2001
From: guoshipeng <3194674006@qq.com>
Date: Wed, 30 Aug 2023 08:42:55 +0800
Subject: [PATCH] fix:校验路段
---
src/components/map/pickCoordinate1.vue | 67 +++++-----------------
src/views/list/road.vue | 94 ++++++++++++++++++++++++-------
2 files changed, 88 insertions(+), 73 deletions(-)
diff --git a/src/components/map/pickCoordinate1.vue b/src/components/map/pickCoordinate1.vue
index 3fe8e5c..26078de 100644
--- a/src/components/map/pickCoordinate1.vue
+++ b/src/components/map/pickCoordinate1.vue
@@ -26,7 +26,12 @@
></a-input> -->
<input v-model="input" id="tipinput" /><button
@click="searchAddress"
- style="background-color: #1890ff; color:white; border:none;margin-left:5px"
+ style="
+ background-color: #1890ff;
+ color: white;
+ border: none;
+ margin-left: 5px;
+ "
>
������
</button>
@@ -160,50 +165,22 @@
// console.log(this.clickPoint,'clickPoint');
}
- // ���������������
- // private handler({BMap, map}) {
- // this.center.lng = this.typeOperation === 'add' ? '120.726838' : this.lnglat.split(',')[1]
- // this.center.lat = this.typeOperation === 'add' ? '31.3421' : this.lnglat.split(',')[0]
- // this.zoom = 19
-
- // }
- // private selectPoi(e){
- // console.log(e);
- // let poi = e
- // if (poi.length > 0) {
- // this.clickPoint = [poi[0].lng, poi[0].lat]
- // }
- // }
private input:any=''
private mark:any=''
- // private searchMap(){
- // var autoOptions = {
- // input: "tipinput"
- // };
- // var self=this
- // var auto = new AMap.Autocomplete(autoOptions);
- // const placeSearch = new AMap.PlaceSearch(self.input);
- // // console.log(window);
- // auto.on("select", select);//������������������������������������������������
- // function select(e) {
- // placeSearch.setCity(e.poi.adcode);
- // placeSearch.search(e.poi.name); //���������������������
- // self.clickPoint = [e.poi.location.lng, e.poi.location.lat]
- // }
- // }
+
private searchAddress() {
var map = new AMap.Map("amap", {
resizeEnable: true
});
- var placeSearch = new AMap.PlaceSearch({
- pageSize: 5, // ������������������������
- pageIndex: 1, // ������
- city: "������", // ���������������
- citylimit: false, //���������������������������������������������
- panel: "panel", // ���������������������������������������������
- map: map, // ���������������������������
- autoFitView: true // ������������������������������������������ Marker���������������������������������
- });
+ var placeSearch = new AMap.PlaceSearch({
+ pageSize: 5, // ������������������������
+ pageIndex: 1, // ������
+ city: "������", // ���������������
+ citylimit: false, //���������������������������������������������
+ panel: "panel", // ���������������������������������������������
+ map: map, // ���������������������������
+ autoFitView: true // ������������������������������������������ Marker���������������������������������
+ });
//���������������
placeSearch.search(this.input)
var salf=this
@@ -221,18 +198,6 @@
})
markerone=1
}
- // function click(e){
- // console.log(e);
- // salf.clickPoint=[e.lnglat.lng,e.lnglat.lat]
- // }
- // placeSearch.search(this.input,function(status, result){
- // console.log(result);
- // auto.on('click',click);
- // function click(e){
- // console.log(e);
- // }
- // });
- // console.log(this.input);
}
// ���������������������������
private clickPoint: any = this.lnglat === '' ? [
diff --git a/src/views/list/road.vue b/src/views/list/road.vue
index 972992d..f5fc431 100644
--- a/src/views/list/road.vue
+++ b/src/views/list/road.vue
@@ -7,12 +7,12 @@
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
@@ -24,6 +24,9 @@
</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>
@@ -130,6 +133,20 @@
</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>
@@ -240,19 +257,20 @@
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',{
@@ -271,6 +289,7 @@
private upa=''
private recordid:any=0
private handleEditModalVisible(record){
+ this.check=false
this.handlebatch()
this.startstate='none'
this.upa='upa'
@@ -312,6 +331,7 @@
}
private inupa(){
this.upa=''
+ this.selectCar()
}
private carvalue:any='������������������'
private carIndex:any=[]
@@ -321,6 +341,37 @@
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(){
@@ -362,13 +413,9 @@
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');
@@ -382,13 +429,12 @@
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){
@@ -417,11 +463,8 @@
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'
@@ -432,13 +475,13 @@
}
}
}); //������������
- }
+ // }
+ }
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)
@@ -447,6 +490,7 @@
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':
@@ -462,13 +506,10 @@
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'
@@ -477,10 +518,10 @@
}
}
}
- // that.indataList = Array.from(new Set(that.dataList))
}
}); //������������
- }
+ // }
+ }
//���������������������������������������
if(that.pointshow===false){
@@ -542,4 +583,13 @@
.BMap_Marker.BMap_noprint {
width: 23px;
}
+.fixeds {
+ width: 400px;
+ height: 150px;
+ background-color: white;
+ position: fixed;
+ top: 40%;
+ left: 55%;
+ z-index: 999;
+}
</style>
--
Gitblit v1.8.0