轨迹二次不显示问题

main
Tuzki 2 years ago
parent ef0e53db4e
commit aeba5b526c
  1. 17
      ruoyi-ui/src/components/CommonComponents/PublicCoponents/map/NewMap.vue
  2. 3
      ruoyi-ui/src/views/system/management/electronic-patrol/patrol-record/index.vue
  3. 13
      ruoyi-ui/src/views/system/management/emergency-command/info/index.vue

@ -69,6 +69,7 @@ export default {
map: null,//
marker: null,
markers: [],//
lineMarkers: [],//
selectedMarker: null, //
searchAddress: '',//
pathArr: [],//线
@ -130,6 +131,7 @@ export default {
// immediate: true,
handler(newVal) {
if (newVal) {
debugger
this.pathArr = newVal
this.startEdit()
}
@ -156,6 +158,7 @@ export default {
this.map.setFitView()
}
if (this.pathArr !== undefined && this.pathArr.length > 1) {
debugger
this.startEdit()
}
this.initEvents()
@ -228,6 +231,13 @@ export default {
}
this.map.setZoom(11)
this.map.setFitView()
console.log(this.pathArr,'还有数据吗');
},
destroyMap(){
if (this.map){
this.map.destroy()
}
},
searchMap(addr) {
let this_ = this
@ -277,13 +287,16 @@ export default {
if (this.pathArr.length < 1) {
return
}
this.lineMarkers = []
this.pathArr.forEach(item => {
debugger
console.log(item,'ziobiao');
let marker = new window.AMap.Marker({
position: [item[0], item[1]]
position: [item[0], item[1]],
})
marker.setMap(this.map)
this.lineMarkers.push(marker)
})
this.lineMarkers.setMap(this.map)
// this.editing = true
//
if (this.mouseTool) {

@ -157,7 +157,7 @@
</el-dialog>
</div>
<div class="m-map-box-father">
<new-map :point-type="false" :line-type="true" :map-center="[114.538516,37.033135]"
<new-map ref="newMaps" :point-type="false" :line-type="true" :map-center="[114.538516,37.033135]"
:path-array="checkPoint"></new-map>
</div>
</div>
@ -288,6 +288,7 @@ export default {
listPatrolRecord(this.queryParams).then(response => {
this.patrolRecordList = response.data;
this.loading = false;
this.$refs.newMaps.cleanMap()
this.checkPoint = []
response.data.forEach(item => {
this.checkPoint.push([item.longitude, item.dimension])

@ -951,7 +951,7 @@
/>
</div>
<div class="m-map-box-father">
<new-map :point-type="false" :line-type="true" :map-center="[114.54,38.05]" :path-array="checkPoint"
<new-map ref="newMaps" :point-type="false" :line-type="true" :map-center="[114.54,38.05]" :path-array="checkPoint"
:show-search="false"></new-map>
</div>
</div>
@ -1001,6 +1001,11 @@ import infoConfig from "@/views/system/management/emergency-command/utils/infoCo
import {deptTreeSelect} from "@/api/system/user";
import NewMap from "@/components/CommonComponents/PublicCoponents/map/NewMap";
import elImageViewer from "element-ui/packages/image/src/image-viewer"
import Docxtemplater from 'docxtemplater';
import JSZip from 'jszip';
import { Document } from 'docxtemplater';
export default {
components: {NewMap,elImageViewer},
mixins: [infoConfig],
@ -1183,6 +1188,10 @@ export default {
immediate: true,
handler(val) {
if (val == false) {
if (this.type == 4){
this.$refs.newMaps.destroyMap()
this.$refs.newMaps.cleanMap()
}
this.resetForm("queryForms");
}
}
@ -1656,7 +1665,6 @@ export default {
},
//
handleQuerys(val) {
debugger
if (val !== 2) {
this.getGroupingUsersPath(val)
} else {
@ -1669,6 +1677,7 @@ export default {
},
getGroupingUsersPath(val) {
getGroupingUsersPath(val).then(response => {
this.checkPoint = []
response.rows.forEach(item => {
this.checkPoint.push([item.longitude, item.dimension])
})

Loading…
Cancel
Save