Commit 78f8633c by 张杰

修复新增围栏(多边形围栏和行政区域报错的问题)

1 parent 01990e91
...@@ -11,17 +11,21 @@ ...@@ -11,17 +11,21 @@
<script> <script>
// import vBreadcrumb from 'components/Breadcrumb.vue' // import vBreadcrumb from 'components/Breadcrumb.vue'
export default{ export default {
components: { components: {
// vBreadcrumb // vBreadcrumb
} },
} };
</script> </script>
<style lang="scss"> <style lang="scss">
h1,h2,h3,h4,h5{ h1,
h2,
h3,
h4,
h5 {
margin: 0px; margin: 0px;
} }
.main-wrap.full-width{ .main-wrap.full-width {
position: fixed; position: fixed;
width: calc(100% - 200px); width: calc(100% - 200px);
height: calc(100% - 60px); height: calc(100% - 60px);
...@@ -29,24 +33,32 @@ export default{ ...@@ -29,24 +33,32 @@ export default{
left: 200px; left: 200px;
background: #fff; background: #fff;
padding: 0; padding: 0;
} }
.ibox{ .ibox {
background-color: #fff; background-color: #fff;
border-top: 2px solid #e7eaec; border-top: 2px solid #e7eaec;
padding: 10px; padding: 10px;
margin-bottom: 20px; margin-bottom: 20px;
.ibox-title{ .ibox-title {
padding-bottom: 10px; padding-bottom: 10px;
} }
.ibox-content{ .ibox-content {
padding: 20px 20px 0px; padding: 20px 20px 0px;
margin: 0px -10px; margin: 0px -10px;
border-top: 1px solid #e7eaec; border-top: 1px solid #e7eaec;
} }
.count{ .count {
font-size: 20px; font-size: 20px;
} }
}
.full_wrap_layout {
.full-width {
width: 100%;
height: 100%;
top: 0;
right: 0;
bottom: 0;
left: 0;
} }
}
</style> </style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<v-full-layout> <v-full-layout class="full_wrap_layout">
<template slot="breadcrumb"> <template slot="breadcrumb">
<el-breadcrumb-item>电子围栏</el-breadcrumb-item> <el-breadcrumb-item>电子围栏</el-breadcrumb-item>
</template> </template>
......
...@@ -22,7 +22,7 @@ const fence = { ...@@ -22,7 +22,7 @@ const fence = {
}); });
EventBus.$on('uiMap.fence.updateFenceRadius', (data) => { EventBus.$on('uiMap.fence.updateFenceRadius', (data) => {
console.log('监听围栏更新',data) console.log('监听围栏更新', data)
this.updateFenceInfo(data) this.updateFenceInfo(data)
}); });
//this.circle.setRadius(data * 1); //this.circle.setRadius(data * 1);
...@@ -66,12 +66,11 @@ const fence = { ...@@ -66,12 +66,11 @@ const fence = {
// 行政区域 // 行政区域
drawDistrict(data) { drawDistrict(data) {
const MAP = mapService.map;
this.destroy();
if (!data || data.length <= 0) { if (!data || data.length <= 0) {
return false; return false;
} }
const MAP = mapService.map;
this.destroy();
var opts = { var opts = {
subdistrict: 0, //返回下一级行政区 subdistrict: 0, //返回下一级行政区
extensions: 'all', extensions: 'all',
...@@ -335,10 +334,10 @@ const fence = { ...@@ -335,10 +334,10 @@ const fence = {
let mapInterval = setInterval(function () { let mapInterval = setInterval(function () {
if (MAP) { if (MAP) {
clearInterval(mapInterval); clearInterval(mapInterval);
MAP.clearMap(); if (_this.fenceCircle) {
MAP.remove(_this.fenceCircle)
}
_this.fenceType = data.fenceType; _this.fenceType = data.fenceType;
_this.polyEditor && _this.polyEditor.close(); _this.polyEditor && _this.polyEditor.close();
_this.mouseTool && _this.mouseTool.close(); _this.mouseTool && _this.mouseTool.close();
...@@ -358,27 +357,6 @@ const fence = { ...@@ -358,27 +357,6 @@ const fence = {
_this.createFenceCircle(data); _this.createFenceCircle(data);
return false; return false;
} }
// 更新行政区域围栏
if (data.fenceType === "area") {
_this.areaCode = data.areaCode;
_this.drawDistrict(data);
return false
}
// 更新多边形围栏
if (data.fenceType === "polygon") {
if (data) {
if (Array.isArray(data)) {
this.polygonPath = data;
this.isEditMode = true;
} else if (('isEdit' in data) && !data.isEdit) {
this.polygonPath = data.path;
this.isEditMode = false;
}
}
_this.drawPolygon();
}
mapService.setFitView() mapService.setFitView()
MAP.setZoom(14); MAP.setZoom(14);
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!