Commit d4b99f10 by 张杰

修复围栏报错

1 parent 09800889
......@@ -101,7 +101,7 @@
<div class="links_group">
<div>已关联{{tableData.length}}个设备</div>
<div>
<el-button v-if="!readonlyStatus" type="primary" @click="userDate" size="small" :loading="submitting">关联用户</el-button>
<el-button v-if="!readonlyStatus" type="primary" @click="userDate" size="small" :loading="submitting">关联设备</el-button>
<el-button size="small" :disabled="!selectedIds || selectedIds.length<=0" @click="batchRemove">批量删除</el-button>
</div>
</div>
......
......@@ -428,7 +428,7 @@ export default {
// 多边形围栏
if (o.shapeType == 3) {
oParams.lnglat = this.polygonPath;
oParams.lnglat = this.polygonPath.join("|");
}
// 行政区域围栏
......
......@@ -743,9 +743,11 @@ export default {
expandTreeItems(arr, isDevice) {
arr.forEach((item) => {
if (isDevice) {
console.log(item.id)
this.$refs.tree.setCheckedKeys(
this.$refs.tree.getCheckedKeys().concat(item.id)
);
//this.checkedKeys.push(item.id);
this.addMonitor({
sn: item.label,
name: item.label1,
......
......@@ -122,42 +122,46 @@ const fence = {
});
},
createFenceCircle(data) {
let _this = this
const MAP = mapService.map;
this.destroy();
this.circle = new AMap.Circle({
map: MAP,
center: mapService.getLngLat(data.lng, data.lat),
radius: data.radius * 1,
strokeColor: "#F33",
strokeOpacity: 1,
strokeWeight: 3,
fillColor: "ee2200",
fillOpacity: 0.35,
zIndex: 0,
});
this.circleEditor = new AMap.CircleEditor(MAP, this.circle);
this.circleEditor.on('adjust', function (e) {
//log.info('触发事件:adjust')
EventBus.$emit('uiMap.fence.onFenceRadiusChange', e.radius / 1)
})
this.circleEditor.on('move', function (e) {
EventBus.$emit('uiMap.fence.onFenceLngLatChange', {
lng: e.lnglat.lng,
lat: e.lnglat.lat
});
})
if (this.isEditMode) {
this.circleEditor.open();
} else {
this.circleEditor.close();
}
mapService.setFitView()
MAP.setZoom(14);
_this.destroy();
let mapInterval = setInterval(() => {
if(MAP){
clearInterval(mapInterval)
_this.circle = new AMap.Circle({
map: MAP,
center: mapService.getLngLat(data.lng, data.lat),
radius: data.radius * 1,
strokeColor: "#F33",
strokeOpacity: 1,
strokeWeight: 3,
fillColor: "ee2200",
fillOpacity: 0.35,
zIndex: 0,
});
_this.circleEditor = new AMap.CircleEditor(MAP, _this.circle);
_this.circleEditor.on('adjust', function (e) {
//log.info('触发事件:adjust')
EventBus.$emit('uiMap.fence.onFenceRadiusChange', e.radius / 1)
})
_this.circleEditor.on('move', function (e) {
EventBus.$emit('uiMap.fence.onFenceLngLatChange', {
lng: e.lnglat.lng,
lat: e.lnglat.lat
});
})
if (_this.isEditMode) {
_this.circleEditor.open();
} else {
_this.circleEditor.close();
}
mapService.setFitView()
MAP.setZoom(14);
}
}, 100);
},
createFenceMarker(data) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!