mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-23 21:36:37 +08:00
v1.9 优化巡检地图展示问题
This commit is contained in:
parent
0b10c798d6
commit
57c370b2dd
@ -29,6 +29,24 @@ export default {
|
||||
},
|
||||
|
||||
initMap() {
|
||||
// 若已有地图或图层,先清理避免重复初始化
|
||||
if (this.markerLayer) {
|
||||
this.markerLayer.setMap(null)
|
||||
this.markerLayer = null
|
||||
}
|
||||
if (this.labelLayer) {
|
||||
this.labelLayer.setMap(null)
|
||||
this.labelLayer = null
|
||||
}
|
||||
if (this.polylineLayer) {
|
||||
this.polylineLayer.setMap(null)
|
||||
this.polylineLayer = null
|
||||
}
|
||||
if (this.map) {
|
||||
this.map.destroy()
|
||||
this.map = null
|
||||
}
|
||||
|
||||
// 默认中心点(北京)
|
||||
const center = new window.TMap.LatLng(39.916527, 116.397128)
|
||||
|
||||
|
||||
@ -26,12 +26,33 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
loadData(task) {
|
||||
console.log('loadData',task)
|
||||
this.initMap()
|
||||
this.loadTask(task)
|
||||
},
|
||||
initMap() {
|
||||
// 若已有地图或图层,先清理避免重复初始化
|
||||
if (this.markerLayer) {
|
||||
this.markerLayer.setMap(null)
|
||||
this.markerLayer = null
|
||||
}
|
||||
if (this.labelLayer) {
|
||||
this.labelLayer.setMap(null)
|
||||
this.labelLayer = null
|
||||
}
|
||||
if (this.polylineLayer) {
|
||||
this.polylineLayer.setMap(null)
|
||||
this.polylineLayer = null
|
||||
}
|
||||
if (this.map) {
|
||||
this.map.destroy()
|
||||
this.map = null
|
||||
}
|
||||
console.log('initMap',this.map)
|
||||
|
||||
// 默认中心点(北京)
|
||||
const center = new window.TMap.LatLng(39.916527, 116.397128)
|
||||
console.log('center',center)
|
||||
|
||||
// 创建地图实例
|
||||
this.map = new window.TMap.Map(document.getElementById('inspectionTaskMap'), {
|
||||
|
||||
@ -129,7 +129,7 @@ export default {
|
||||
|
||||
<style scoped>
|
||||
.point-plan-container {
|
||||
padding: 20px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.margin-top {
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<div class="point-route-container">
|
||||
<el-row :gutter="20">
|
||||
<div class="point-route-container" >
|
||||
<el-row :gutter="20" v-if="pointRouteInfo.routes && pointRouteInfo.routes.length>0">
|
||||
<el-col :span="6">
|
||||
<el-card class="route-list-card">
|
||||
<div class="route-list">
|
||||
<ul>
|
||||
<li v-for="(route, index) in pointRouteInfo.routes" :key="index" @click="_switchPointRoute(route)"
|
||||
:class="{ 'active': route.inspectionRouteId === pointRouteInfo.inspectionRouteId }">
|
||||
:class="{ 'active': route.inspectionRouteId == pointRouteInfo.inspectionRouteId }">
|
||||
{{ route.routeName }}
|
||||
</li>
|
||||
</ul>
|
||||
@ -116,7 +116,6 @@ export default {
|
||||
|
||||
.route-list li {
|
||||
padding: 12px 15px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<div class="point-task-container">
|
||||
<el-row :gutter="20">
|
||||
<el-row :gutter="20" v-if="pointTaskInfo.tasks && pointTaskInfo.tasks.length>0">
|
||||
<el-col :span="6">
|
||||
<el-card class="task-list-card">
|
||||
<div class="task-list">
|
||||
<ul>
|
||||
<li v-for="(task, index) in pointTaskInfo.tasks" :key="index" @click="_switchPointTask(task)"
|
||||
:class="{ 'active': task.inspectionRouteId === pointTaskInfo.inspectionRouteId }">
|
||||
:class="{ 'active': task.inspectionRouteId == pointTaskInfo.inspectionRouteId }">
|
||||
{{ task.planUserName }}({{ task.inspectionPlanName }})
|
||||
</li>
|
||||
</ul>
|
||||
@ -82,7 +82,7 @@ export default {
|
||||
// 通知地图组件加载任务
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.inspectionTaskMap) {
|
||||
this.$refs.inspectionTaskMap.loadTask(task)
|
||||
this.$refs.inspectionTaskMap.loadData(task)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="point-task-detail-container">
|
||||
<el-row :gutter="20" class="margin-top-lg">
|
||||
<el-row :gutter="20" class="">
|
||||
<el-col :span="6">
|
||||
<el-input :placeholder="$t('pointTaskDetail.placeholder.planUserName')" v-model="pointTaskDetailInfo.planUserName"
|
||||
clearable />
|
||||
|
||||
@ -29,10 +29,10 @@
|
||||
<div slot="header" class="flex justify-between">
|
||||
<span>{{ $t('inspectionItemManage.inspectionItems') }}</span>
|
||||
<div style="float: right;">
|
||||
<el-button type="primary" size="small" @click="handleShowDoc">
|
||||
<!-- <el-button type="primary" size="small" @click="handleShowDoc">
|
||||
<i class="el-icon-document"></i>
|
||||
{{ $t('inspectionItemManage.doc') }}
|
||||
</el-button>
|
||||
</el-button> -->
|
||||
<el-button type="primary" size="small" @click="openAddModal">
|
||||
<i class="el-icon-plus"></i>
|
||||
{{ $t('inspectionItemManage.addBtn') }}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="padding">
|
||||
<!-- 查询条件 -->
|
||||
<el-card class="search-wrapper">
|
||||
<div slot="header" class="flex juistify-between">
|
||||
|
||||
@ -275,7 +275,6 @@ export default {
|
||||
.point-list li {
|
||||
padding: 10px;
|
||||
cursor: pointer;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
}
|
||||
|
||||
.point-list li:last-child {
|
||||
|
||||
@ -223,7 +223,6 @@ export default {
|
||||
li {
|
||||
padding: 10px;
|
||||
cursor: pointer;
|
||||
border-bottom: 1px solid #eee;
|
||||
|
||||
&:hover {
|
||||
background-color: #f5f5f5;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user