Commit d4b99f10 by 张杰

修复围栏报错

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