网络管理mapbox地图替换成高德地图

main
许宏杰 1 month ago
parent ec878e2303
commit ed0e3957b6

@ -5,6 +5,6 @@ ENV = 'development'
VUE_APP_BASE_API = '/dashboard'
# VUE_APP_BASE_API2 = 'http://39.101.188.84:9027'
VUE_APP_BASE_API2 = 'http://192.168.0.108:9035'
# VUE_APP_BASE_API2 = 'http://39.101.188.84:9035'
# VUE_APP_BASE_API2 = 'http://192.168.0.108:9035'
VUE_APP_BASE_API2 = 'http://39.101.188.84:9035'
BASE_API = 'http://10.10.3.35:9070'

@ -14,6 +14,7 @@
"test:ci": "npm run lint && npm run test:unit"
},
"dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1",
"@jiaminghi/data-view": "^2.9.6",
"@riophae/vue-treeselect": "^0.4.0",
"@turf/turf": "^6.5.0",

@ -6,73 +6,73 @@
* @LastEditTime: 2024-10-08 15:30:44
* @FilePath: \dzcBigScreenFrontPro\src\main.js
*/
import Vue from 'vue'
import Vue from "vue";
import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import "normalize.css/normalize.css"; // A modern alternative to CSS resets
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import '@/styles/index.scss' // global css
import '@/icons' // icon
import '@/permission' // permission control
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import "@/styles/index.scss"; // global css
import "@/icons"; // icon
import "@/permission"; // permission control
import App from './App'
import store from './store'
import router from './router'
import App from "./App";
import store from "./store";
import router from "./router";
import MyTable from '@/components/MyTable'
import Paginations from '@/components/Pagination'
import { filterDict } from '@/utils/common.js'
Vue.prototype.$filterDict = filterDict
Vue.component('MyTable', MyTable)
Vue.component('Paginations', Paginations)
import $ from 'jquery'
Vue.prototype.$ = $
import drag from '@/directive/el-drag-dialog/index'
Vue.use(drag)
import moment from 'moment'
Vue.prototype.$moment = moment // 赋值使用
import MyTable from "@/components/MyTable";
import Paginations from "@/components/Pagination";
import { filterDict } from "@/utils/common.js";
Vue.prototype.$filterDict = filterDict;
Vue.component("MyTable", MyTable);
Vue.component("Paginations", Paginations);
import $ from "jquery";
Vue.prototype.$ = $;
import drag from "@/directive/el-drag-dialog/index";
Vue.use(drag);
import moment from "moment";
Vue.prototype.$moment = moment; // 赋值使用
import * as echarts from 'echarts'
Vue.prototype.$echarts = echarts
import * as echarts from "echarts";
Vue.prototype.$echarts = echarts;
// 将自动注册所有组件为全局组件
import dataV from '@jiaminghi/data-view'
import dataV from "@jiaminghi/data-view";
Vue.use(dataV)
Vue.use(dataV);
// 全局修改默认配置,点击空白处不能关闭弹窗
ElementUI.Dialog.props.closeOnClickModal.default = false
ElementUI.Dialog.props.closeOnClickModal.default = false;
// set ElementUI lang to EN
// Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui按如下方式声明
Vue.use(ElementUI)
Vue.use(ElementUI);
import VueAMap from '@vuemap/vue-amap';
import '@vuemap/vue-amap/dist/style.css'
// import VueAMap from '@vuemap/vue-amap';
// import '@vuemap/vue-amap/dist/style.css'
VueAMap.initAMapApiLoader({
key: 'b3c7a7ce466721c3be1d4ea539f82421', // 高德key
securityJsCode: 'ec84db9c5dfc3d304ca9219e764ffeb8', // 安全密钥
});
// VueAMap.initAMapApiLoader({
// key: 'b3c7a7ce466721c3be1d4ea539f82421', // 高德key
// securityJsCode: 'ec84db9c5dfc3d304ca9219e764ffeb8', // 安全密钥
// });
import VueAwesomeSwiper from 'vue-awesome-swiper'
import 'swiper/swiper-bundle.css'
Vue.use(VueAwesomeSwiper)
import Swiper2, { Navigation, Pagination, Autoplay } from 'swiper'
Swiper2.use([Autoplay, Navigation, Pagination])
import VueAwesomeSwiper from "vue-awesome-swiper";
import "swiper/swiper-bundle.css";
Vue.use(VueAwesomeSwiper);
import Swiper2, { Navigation, Pagination, Autoplay } from "swiper";
Swiper2.use([Autoplay, Navigation, Pagination]);
Vue.config.productionTip = false
Vue.config.productionTip = false;
Vue.config.errorHandler = function(err, vm, info) {
console.log(`Error: ${err.toString()}\nInfo: ${info}`)
}
Vue.config.warnHandler = function(msg, vm, trace) {
Vue.config.errorHandler = function (err, vm, info) {
console.log(`Error: ${err.toString()}\nInfo: ${info}`);
};
Vue.config.warnHandler = function (msg, vm, trace) {
// console.log(`Warn: ${msg}\nTrace: ${trace}`);
}
};
new Vue({
el: '#app',
el: "#app",
router,
store,
render: (h) => h(App)
})
render: (h) => h(App),
});

@ -0,0 +1,391 @@
<template>
<div class="map-container">
<div id="container"></div>
<el-dialog
v-if="isShowDialog"
title=""
class="screen-dialog"
:visible.sync="isShowDialog"
width="650px"
:modal-append-to-body="false"
center
:modal="false"
>
<div class="top_title">网络举报事件</div>
<div class="dialog_ctn">
<el-row>
<el-col :span="24">
<div class="col_title">被举报对象</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="col_ctn">{{ currentMsg.jbdx }}</div>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<div class="col_title">苏州编号</div>
</el-col>
<el-col :span="8">
<div class="col_title">举报时间</div>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<div class="col_ctn_little">{{ currentMsg.szbh }}</div>
</el-col>
<el-col :span="8">
<div class="col_ctn_little">{{ currentMsg.jbsj }}</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="col_title">地址</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="col_ctn_little">
{{ currentMsg.dz }}
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="col_title">举报内容</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<!-- <div class="col_ctn_little" v-html='currentMsg.jbnr'></div> -->
<div class="col_ctn_little">{{ currentMsg.jbnr }}</div>
</el-col>
</el-row>
</div>
<div class="dialogClose" @click="isShowDialog = false">关闭</div>
</el-dialog>
</div>
</template>
<script>
// import mapboxgl from 'mapbox-gl'
// import 'mapbox-gl/dist/mapbox-gl.css'
// import VueAMap from '@vuemap/vue-amap';
// import '@vuemap/vue-amap/dist/style.css'
import location from '@/assets/ecosphere/point.png'
// import { reportList, reportInfo } from '@/api/zongzhi/manage'
import {
listJbmap,
getJbmap,
} from "@/api/netManage/index.js";
export default {
data() {
// VueAMap.initAMapApiLoader({
// key: 'b3c7a7ce466721c3be1d4ea539f82421', // key
// securityJsCode: 'ec84db9c5dfc3d304ca9219e764ffeb8', //
// });
return {
isShowDialog: false,
center: [121.136909, 31.463778],
zoom: 14.5,
zooms:[14,18],
// markerOffset: [-35,-123],
// markers: [],
//
currentMsg: {
jbdx: '电子科技有限公司',
szbh: 'SZ2023',
jbsj: '2023-07-31',
dz: '太仓人民政府',
jbnr: '偷电'
},
map: null,
pointList: [
{ id: 1, lng: 121.136909, lat: 31.463778, title: '太仓人民政府' },
{ id: 2, lng: 121.086958, lat: 31.460883, title: '苏州吉闽物流有限公司' },
{ id: 3, lng: 121.05452, lat: 31.515175, title: '太仓星兴亮机械设备有限公司' },
{ id: 4, lng: 121.127801, lat: 31.472566, title: '兴和电子有限公司' },
{ id: 5, lng: 121.142345, lat: 31.477655, title: '太仓裕盛体育用品有限公司' }
],
layers:{
layer:null,
}
}
},
mounted() {
this.$nextTick(()=>{
var layer = new AMap.createDefaultLayer({
zooms:[14,18], //
visible:true, //
opacity:1, //
zIndex:10, //
// skyColor: '#032f58',
mapStyle: 'amap://styles/d02b66b0a7f190d5a1556a3f59c86518',
})
var map = new AMap.Map('container',{
zoom: 16, //
zooms: this.zooms,
center: this.center,//
mapStyle: 'amap://styles/d02b66b0a7f190d5a1556a3f59c86518', //
// skyColor: '#032f58',
layers: [
//
// new AMap.TileLayer.Satellite(),
layer,
//
new AMap.Buildings({
zooms: [14, 18],
zIndex: 11,
wallColor: 'rgba(24,79,129,1)',
roofColor: 'rgba(24,79,129,1)',
// heightFactor: 2//23D
})
],
resizeEnable: true,
rotateEnable:false,
pitchEnable:false,
pitch: 55,
rotation: 25,
viewMode: '3D', //
lang:'zh_cn', //
buildingAnimation:true,
// expandZoomRange:true,
});
this.layers.layer = new AMap.OverlayGroup(); //
map.add(this.layers.layer);
// console.log(map.getLayers());
map.getLayers().forEach((m)=>{
if(m.CLASS_NAME == 'AMap.SkyLayer') {
map.remove(m)
}
})
this.map = map;
this.init(this.map);
})
// let data = await reportList();
// listJbmap({isStatus:1,pageNum:1,pageSize:50}).then(data=>{
// let arr = []
// data.rows.map((item)=>{
// let obj = {}
// obj.id = item.id
// obj.lng = item.longitude
// obj.lat = item.latitude
// obj.title = item.jbObj
// arr.push(obj)
// })
// this.pointList = arr
// const _this = this
// mapboxgl.accessToken = 'pk.eyJ1Ijoic2hhcmVhbGV4IiwiYSI6ImNsaXNhZmRjbTFhbnczZmxib3h1OW05YXYifQ.PhlKv60ar3K359d8x2yBPw'
// const map = new mapboxgl.Map({
// container: 'map', // id
// style: 'mapbox://styles/sharealex/cl3ntpire000314ookb5o81oo', //
// center: [121.136909, 31.463778], //
// zoom: 14.5,
// pitch: 50
// })
// //
// map.on('load', function() {
// //
// _this.pointList.forEach(item => {
// const el = document.createElement('div')
// el.className = 'map-marker'
// el.innerHTML = `
// <img class="marker-img" src= "${require('@/assets/ecosphere/point.png')}" />
// <div class="marker-text">${item.title}</div>
// `
// new mapboxgl.Marker(el)
// .setLngLat([item.lng, item.lat])
// .addTo(map)
// el.addEventListener('click', () => {
// //
// // reportInfo(item.id).then(res=>{
// getJbmap(item.id).then(res=>{
// let { jbObj, number, jbTime, address, content } = res.data
// _this.currentMsg.jbdx = jbObj
// _this.currentMsg.szbh = number
// _this.currentMsg.jbsj = jbTime
// _this.currentMsg.dz = address
// _this.currentMsg.jbnr = content
// _this.isShowDialog = true
// })
// })
// })
// map.addLayer({
// id: 'lou-extrusion',
// type: 'fill-extrusion',
// source: {
// type: 'geojson',
// data: require('@/utils/mapGeojson/1.json')
// },
// paint: {
// //
// 'fill-extrusion-color': '#2998F8',
// // height
// 'fill-extrusion-height': ['get', 'height'],
// 'fill-extrusion-base': 0,
// //
// 'fill-extrusion-opacity': 0.7
// }
// })
// })
// this.map = map
// })
},
methods: {
init(map){
listJbmap({isStatus:1,pageNum:1,pageSize:50}).then(data=>{
// let arr = [];
map.clearMap();
data.rows.map((item)=>{
// let obj = {}
// obj.id = item.id;
// obj.imgSrc = location;
// obj.lng = item.longitude
// obj.lat = item.latitude
// obj.title = item.jbObj
var marker = new AMap.Marker({
position: new AMap.LngLat(item.longitude, item.latitude), // [116.39, 39.9]
// <span style="color: #fff; font-size: 25px;width:${item.jbObj.length * 26}px">${item.jbObj}</span>
content: `<div class="amap-markers" data-projectid="${item.id}">
<img src="${location}" />
<div style="color: #fff; font-size: 25px;width:${item.jbObj.length * 26}px">${item.jbObj}</div>
</div>`,
offset:new AMap.Pixel(-(item.jbObj.length * 10), -30),
});
marker.on('click', (e)=>{
getJbmap(item.id).then(res=>{
let { jbObj, number, jbTime, address, content } = res.data
this.currentMsg.jbdx = jbObj
this.currentMsg.szbh = number
this.currentMsg.jbsj = jbTime
this.currentMsg.dz = address
this.currentMsg.jbnr = content
this.isShowDialog = true
})
})
map.add(marker);
// arr.push(obj)
})
// this.pointList = arr;
})
},
}
}
</script>
<style lang='scss' scoped>
.map-container{
width: 100%;
height: $ScreenHeight;
#container{
width: 100%;
height: 100%;
background-color: rgb(26, 61, 106,0.3);
}
}
.screen-dialog {
left: 30%;
right: 30%;
top: 10%;
bottom: 20%;
z-index: 9999;
::v-deep .el-dialog__header {
background: rgba(255, 255, 255, 0);
}
::v-deep .el-dialog {
background: url('~@/assets/dialog/wlglDialog/bg.png') no-repeat 100% 100%;
//width: 1260px;
height: 590px;
//padding-top:20px;
background-size: cover;
}
::v-deep .el-dialog__headerbtn {
top: 1;
}
::v-deep .el-dialog__footer {
background: rgba(255, 255, 255, 0);
}
.top_title {
font-family: SourceHanSansCN-Bold;
font-size: 28px;
letter-spacing: 1px;
color: #ffffff;
margin-top: -35px;
margin-left: 20px;
}
.dialog_ctn {
padding: 60px 0 0 60px;
}
.col_title {
font-family: SourceHanSansCN-Regular;
font-size: 28px;
color: #1dd1fe;
}
.col_ctn {
font-family: SourceHanSansCN-Bold;
font-size: 30px;
color: #ffe90c;
margin: 13px 0;
}
.col_ctn_little {
font-family: DIN-Medium;
font-size: 28px;
color: #ffffff;
margin: 13px 0;
}
.dialogClose {
text-align: center;
width: 160px;
height: 50px;
position: absolute;
bottom: 25px;
left: 261px;
background: url('~@/assets/dialog/btn-bg.png') no-repeat 100% 100%;
font-family: SourceHanSansCN-Regular;
font-size: 28px;
font-weight: normal;
font-stretch: normal;
line-height: 50px;
letter-spacing: 2px;
color: #ffffff;
cursor: pointer;
}
.dialogClose:hover {
background: url('~@/assets/dialog/btn-bg-act.png') no-repeat 100% 100%;
}
}
.dialog-title {
text-align: center;
width: 756px;
margin: 0 auto;
font-family: SourceHanSansCN-Bold;
font-size: 36px;
font-weight: normal;
font-stretch: normal;
line-height: 38px;
letter-spacing: 0;
color: #ffe850;
}
.dialog-explain {
margin-top: 39px;
height: 125px;
background: url('~@/assets/dialog/信息-bg.png') no-repeat 100% 100%;
}
.dialog-content {
width: 1073px;
max-height: 500px;
margin: 20px auto;
font-family: SourceHanSansCN-Medium;
font-size: 30px;
font-weight: normal;
font-stretch: normal;
line-height: 50px;
letter-spacing: 2px;
color: #ffffff;
}
</style>

@ -69,17 +69,9 @@
</template>
<script>
// import mapboxgl from 'mapbox-gl'
// import 'mapbox-gl/dist/mapbox-gl.css'
// import VueAMap from '@vuemap/vue-amap';
// import '@vuemap/vue-amap/dist/style.css'
import location from '@/assets/ecosphere/point.png'
// import { reportList, reportInfo } from '@/api/zongzhi/manage'
import {
listJbmap,
getJbmap,
} from "@/api/netManage/index.js";
import location from "@/assets/ecosphere/point.png";
import { listJbmap, getJbmap } from "@/api/netManage/index.js";
import AMapLoader from "@amap/amap-jsapi-loader";
export default {
data() {
// VueAMap.initAMapApiLoader({
@ -90,201 +82,143 @@ export default {
isShowDialog: false,
center: [121.136909, 31.463778],
zoom: 14.5,
zooms:[14,18],
zooms: [14, 18],
// markerOffset: [-35,-123],
// markers: [],
//
currentMsg: {
jbdx: '电子科技有限公司',
szbh: 'SZ2023',
jbsj: '2023-07-31',
dz: '太仓人民政府',
jbnr: '偷电'
jbdx: "电子科技有限公司",
szbh: "SZ2023",
jbsj: "2023-07-31",
dz: "太仓人民政府",
jbnr: "偷电",
},
map: null,
pointList: [
{ id: 1, lng: 121.136909, lat: 31.463778, title: '太仓人民政府' },
{ id: 2, lng: 121.086958, lat: 31.460883, title: '苏州吉闽物流有限公司' },
{ id: 3, lng: 121.05452, lat: 31.515175, title: '太仓星兴亮机械设备有限公司' },
{ id: 4, lng: 121.127801, lat: 31.472566, title: '兴和电子有限公司' },
{ id: 5, lng: 121.142345, lat: 31.477655, title: '太仓裕盛体育用品有限公司' }
{ id: 1, lng: 121.136909, lat: 31.463778, title: "太仓人民政府" },
{
id: 2,
lng: 121.086958,
lat: 31.460883,
title: "苏州吉闽物流有限公司",
},
{
id: 3,
lng: 121.05452,
lat: 31.515175,
title: "太仓星兴亮机械设备有限公司",
},
{ id: 4, lng: 121.127801, lat: 31.472566, title: "兴和电子有限公司" },
{
id: 5,
lng: 121.142345,
lat: 31.477655,
title: "太仓裕盛体育用品有限公司",
},
],
layers:{
layer:null,
}
}
layers: {
layer: null,
},
};
},
mounted() {
this.$nextTick(()=>{
var layer = new AMap.createDefaultLayer({
zooms:[14,18], //
visible:true, //
opacity:1, //
zIndex:10, //
// skyColor: '#032f58',
mapStyle: 'amap://styles/d02b66b0a7f190d5a1556a3f59c86518',
this.$nextTick(() => {
this.initGdMap();
});
},
methods: {
//
initGdMap() {
let _this = this;
AMapLoader.load({
key: "b3c7a7ce466721c3be1d4ea539f82421", // WebKey load
version: "2.0", // JSAPI 1.4.15
plugins: [], // 使'AMap.Scale'
})
var map = new AMap.Map('container',{
zoom: 16, //
zooms: this.zooms,
center: this.center,//
mapStyle: 'amap://styles/d02b66b0a7f190d5a1556a3f59c86518', //
// skyColor: '#032f58',
layers: [
//
// new AMap.TileLayer.Satellite(),
layer,
//
new AMap.Buildings({
zooms: [14, 18],
zIndex: 11,
wallColor: 'rgba(24,79,129,1)',
roofColor: 'rgba(24,79,129,1)',
// heightFactor: 2//23D
.then((AMap) => {
_this.map = new AMap.Map("container", {
// id
showLabel: false,
viewMode: "2D", // 3D
zoom: 15, //
center: _this.center, //
mapStyle: "amap://styles/darkblue",
});
_this.getMarkerData();
})
],
resizeEnable: true,
rotateEnable:false,
pitchEnable:false,
pitch: 55,
rotation: 25,
viewMode: '3D', //
lang:'zh_cn', //
buildingAnimation:true,
// expandZoomRange:true,
.catch((e) => {
console.log(e);
});
this.layers.layer = new AMap.OverlayGroup(); //
map.add(this.layers.layer);
// console.log(map.getLayers());
map.getLayers().forEach((m)=>{
if(m.CLASS_NAME == 'AMap.SkyLayer') {
map.remove(m)
},
//
async getMarkerData() {
let res = await listJbmap({ isStatus: 1, pageNum: 1, pageSize: 50 });
res.rows.map((row, index) => {
if (index == 0) {
//
this.map.setCenter([row.longitude, row.latitude]);
}
})
this.map = map;
this.init(this.map);
})
// let data = await reportList();
// listJbmap({isStatus:1,pageNum:1,pageSize:50}).then(data=>{
// let arr = []
// data.rows.map((item)=>{
// let obj = {}
// obj.id = item.id
// obj.lng = item.longitude
// obj.lat = item.latitude
// obj.title = item.jbObj
// arr.push(obj)
// })
// this.pointList = arr
// const _this = this
// mapboxgl.accessToken = 'pk.eyJ1Ijoic2hhcmVhbGV4IiwiYSI6ImNsaXNhZmRjbTFhbnczZmxib3h1OW05YXYifQ.PhlKv60ar3K359d8x2yBPw'
// const map = new mapboxgl.Map({
// container: 'map', // id
// style: 'mapbox://styles/sharealex/cl3ntpire000314ookb5o81oo', //
// center: [121.136909, 31.463778], //
// zoom: 14.5,
// pitch: 50
// })
var viaMarker = new AMap.Marker({
position: new AMap.LngLat(row.longitude, row.latitude),
// icon
icon: location,
extData: row,
// icon icon icon [center bottom]
// offset: new AMap.Pixel(-13, -30),
});
viaMarker.on("click", (e) => {
let rowItem = e.target.getExtData();
this.getMarkerInfo(rowItem.id);
});
// //
// map.on('load', function() {
// //
// _this.pointList.forEach(item => {
// const el = document.createElement('div')
// el.className = 'map-marker'
// el.innerHTML = `
// <img class="marker-img" src= "${require('@/assets/ecosphere/point.png')}" />
// <div class="marker-text">${item.title}</div>
// `
// new mapboxgl.Marker(el)
// .setLngLat([item.lng, item.lat])
// .addTo(map)
// el.addEventListener('click', () => {
// //
// // reportInfo(item.id).then(res=>{
// getJbmap(item.id).then(res=>{
// let { jbObj, number, jbTime, address, content } = res.data
// _this.currentMsg.jbdx = jbObj
// _this.currentMsg.szbh = number
// _this.currentMsg.jbsj = jbTime
// _this.currentMsg.dz = address
// _this.currentMsg.jbnr = content
// _this.isShowDialog = true
// })
// })
// })
// map.addLayer({
// id: 'lou-extrusion',
// type: 'fill-extrusion',
// source: {
// type: 'geojson',
// data: require('@/utils/mapGeojson/1.json')
// },
// paint: {
// //
// 'fill-extrusion-color': '#2998F8',
// // height
// 'fill-extrusion-height': ['get', 'height'],
// 'fill-extrusion-base': 0,
// //
// 'fill-extrusion-opacity': 0.7
// }
// })
// })
// this.map = map
// })
var text = new AMap.Text({
text: row.jbObj,
anchor: "bottom-center", //
cursor: "pointer",
angle: 0,
style: {
"font-size": "20px",
color: "#fff",
},
methods: {
init(map){
listJbmap({isStatus:1,pageNum:1,pageSize:50}).then(data=>{
// let arr = [];
map.clearMap();
data.rows.map((item)=>{
// let obj = {}
// obj.id = item.id;
// obj.imgSrc = location;
// obj.lng = item.longitude
// obj.lat = item.latitude
// obj.title = item.jbObj
var marker = new AMap.Marker({
position: new AMap.LngLat(item.longitude, item.latitude), // [116.39, 39.9]
// <span style="color: #fff; font-size: 25px;width:${item.jbObj.length * 26}px">${item.jbObj}</span>
content: `<div class="amap-markers" data-projectid="${item.id}">
<img src="${location}" />
<div style="color: #fff; font-size: 25px;width:${item.jbObj.length * 26}px">${item.jbObj}</div>
</div>`,
offset:new AMap.Pixel(-(item.jbObj.length * 10), -30),
offset: [30, 0],
position: new AMap.LngLat(row.longitude, row.latitude),
extData: row,
});
text.on("click", (e) => {
let rowItem = e.target.getExtData();
this.getMarkerInfo(rowItem.id);
});
this.map.add([viaMarker, text]);
});
marker.on('click', (e)=>{
getJbmap(item.id).then(res=>{
let { jbObj, number, jbTime, address, content } = res.data
this.currentMsg.jbdx = jbObj
this.currentMsg.szbh = number
this.currentMsg.jbsj = jbTime
this.currentMsg.dz = address
this.currentMsg.jbnr = content
this.isShowDialog = true
})
})
map.add(marker);
// arr.push(obj)
})
// this.pointList = arr;
})
},
}
}
//
async getMarkerInfo(id) {
let res = await getJbmap(id);
let { jbObj, number, jbTime, address, content } = res.data;
this.currentMsg.jbdx = jbObj;
this.currentMsg.szbh = number;
this.currentMsg.jbsj = jbTime;
this.currentMsg.dz = address;
this.currentMsg.jbnr = content;
this.isShowDialog = true;
},
},
beforeDestroy() {
this.map?.destroy();
},
};
</script>
<style lang='scss' scoped>
.map-container{
<style lang="scss" scoped>
.map-container {
width: 100%;
height: $ScreenHeight;
#container{
#container {
width: 100%;
height: 100%;
background-color: rgb(26, 61, 106,0.3);
background-color: rgb(26, 61, 106, 0.3);
}
}
@ -298,7 +232,7 @@ export default {
background: rgba(255, 255, 255, 0);
}
::v-deep .el-dialog {
background: url('~@/assets/dialog/wlglDialog/bg.png') no-repeat 100% 100%;
background: url("~@/assets/dialog/wlglDialog/bg.png") no-repeat 100% 100%;
//width: 1260px;
height: 590px;
//padding-top:20px;
@ -345,7 +279,7 @@ export default {
position: absolute;
bottom: 25px;
left: 261px;
background: url('~@/assets/dialog/btn-bg.png') no-repeat 100% 100%;
background: url("~@/assets/dialog/btn-bg.png") no-repeat 100% 100%;
font-family: SourceHanSansCN-Regular;
font-size: 28px;
font-weight: normal;
@ -356,7 +290,7 @@ export default {
cursor: pointer;
}
.dialogClose:hover {
background: url('~@/assets/dialog/btn-bg-act.png') no-repeat 100% 100%;
background: url("~@/assets/dialog/btn-bg-act.png") no-repeat 100% 100%;
}
}
.dialog-title {
@ -374,7 +308,7 @@ export default {
.dialog-explain {
margin-top: 39px;
height: 125px;
background: url('~@/assets/dialog/信息-bg.png') no-repeat 100% 100%;
background: url("~@/assets/dialog/信息-bg.png") no-repeat 100% 100%;
}
.dialog-content {
width: 1073px;

Loading…
Cancel
Save