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,10 +122,13 @@ const fence = { ...@@ -122,10 +122,13 @@ 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){
clearInterval(mapInterval)
_this.circle = new AMap.Circle({
map: MAP, map: MAP,
center: mapService.getLngLat(data.lng, data.lat), center: mapService.getLngLat(data.lng, data.lat),
radius: data.radius * 1, radius: data.radius * 1,
...@@ -137,27 +140,28 @@ const fence = { ...@@ -137,27 +140,28 @@ const fence = {
zIndex: 0, zIndex: 0,
}); });
this.circleEditor = new AMap.CircleEditor(MAP, this.circle); _this.circleEditor = new AMap.CircleEditor(MAP, _this.circle);
this.circleEditor.on('adjust', function (e) { _this.circleEditor.on('adjust', function (e) {
//log.info('触发事件:adjust') //log.info('触发事件:adjust')
EventBus.$emit('uiMap.fence.onFenceRadiusChange', e.radius / 1) EventBus.$emit('uiMap.fence.onFenceRadiusChange', e.radius / 1)
}) })
this.circleEditor.on('move', function (e) { _this.circleEditor.on('move', function (e) {
EventBus.$emit('uiMap.fence.onFenceLngLatChange', { EventBus.$emit('uiMap.fence.onFenceLngLatChange', {
lng: e.lnglat.lng, lng: e.lnglat.lng,
lat: e.lnglat.lat lat: e.lnglat.lat
}); });
}) })
if (this.isEditMode) { if (_this.isEditMode) {
this.circleEditor.open(); _this.circleEditor.open();
} else { } else {
this.circleEditor.close(); _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!