|
@@ -16,6 +16,8 @@
|
|
|
<bm-context-menu-item text="添加风场" disabled ></bm-context-menu-item>
|
|
|
<bm-context-menu-item :callback="addCircleWind" text="◯ 圆形"></bm-context-menu-item>
|
|
|
<bm-context-menu-item :callback="addPolygonWind" text="▱ 多边形"></bm-context-menu-item>
|
|
|
+ <!-- <div class="head_control_btn" @click="openDistanceTool"><i class="el-icon-paperclip"></i>测距</div> -->
|
|
|
+
|
|
|
</bm-context-menu>
|
|
|
<!-- 控件 -->
|
|
|
<bm-scale anchor="BMAP_ANCHOR_BOTTOM_LEFT" :offset="scaleOffset"></bm-scale>
|
|
@@ -26,9 +28,20 @@
|
|
|
<bm-local-search :keyword="keyword" :auto-viewport="true" :panel="false"></bm-local-search>
|
|
|
<!-- 自定义控件 -->
|
|
|
<bm-control id="normalCtrl" anchor="BMAP_ANCHOR_TOP_LEFT" :offset="searchbarOffset">
|
|
|
- <bm-auto-complete v-model="keyword" :sugStyle="{zIndex: 1}">
|
|
|
- <el-input v-model="keyword" size="medium" autocomplete="off" maxlength="256" placeholder="输入地址关键字进行搜索,在空白处点击鼠标右键添加" />
|
|
|
+ <el-select v-model="searchType" class="searchType" placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in searchOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <bm-auto-complete v-if=" searchType =='area' " :sugStyle="{zIndex: 1}">
|
|
|
+ <el-input size="medium" class="searchInput" v-model="keyword" autocomplete="off" maxlength="256" placeholder="输入地址关键字进行搜索,在空白处点击鼠标右键添加" />
|
|
|
</bm-auto-complete>
|
|
|
+ <el-input v-if=" searchType =='wind' " v-model="windWord" @keyup.enter.native="searchWindList" size="medium" class="searchInput" autocomplete="off" maxlength="256" placeholder="输入风场名称或者风场编号等进行搜索" />
|
|
|
+ <el-input v-if=" searchType =='pump' " v-model="pumpWord" @keyup.enter.native="searchPumpList" size="medium" class="searchInput" autocomplete="off" maxlength="256" placeholder="输入液压泵名称或者液压泵编号等进行搜索" />
|
|
|
+
|
|
|
<!-- 搜索栏 -->
|
|
|
<div id="searchbox"></div>
|
|
|
</bm-control>
|
|
@@ -36,6 +49,7 @@
|
|
|
<!-- 显示/隐藏覆盖物 -->
|
|
|
<div id="checkboxArea">
|
|
|
<el-row class="checkbox-item">
|
|
|
+ <el-checkbox v-model="showPumpOverlay" @change="toggleMarkers('pump', $event)">液压泵</el-checkbox>
|
|
|
<el-checkbox v-model="showWindOverlay" @change="toggleMarkers('wind', $event)">风场范围</el-checkbox>
|
|
|
</el-row>
|
|
|
</div>
|
|
@@ -43,19 +57,27 @@
|
|
|
</baidu-map>
|
|
|
<!-- 风场表单 -->
|
|
|
<el-dialog title="风场信息" :visible.sync="visibleWindDialog" destroy-on-close width="600px">
|
|
|
- <add-edit-wind @result="addEditWindResult" :windData="windData" :formData="windFormData" />
|
|
|
+ <add-edit-wind @result="addEditWindResult" :formData="windFormData" />
|
|
|
</el-dialog>
|
|
|
<div id="rightPanel">
|
|
|
+
|
|
|
+ <div id="DistanceToolBtn" @click="openDistanceTool"><i class="el-icon-paperclip"></i>测距</div>
|
|
|
<!-- 收起列表 -->
|
|
|
<el-button id="toggleListBtn" @click="toggleTabs" :icon="'el-icon-d-arrow-'+toggleIcon"></el-button>
|
|
|
<!-- 保存按钮 -->
|
|
|
<el-button id="saveWindBtn" @click="showWindFormDialog" v-show="showSaveWindBtn" type="success" round>保存信息</el-button>
|
|
|
<el-button id="clearWindBtn" @click="clearWind" v-show="showSaveWindBtn" type="danger" round>取消</el-button>
|
|
|
+ <!-- 形状保存按钮 -->
|
|
|
+ <el-button id="saveWindBtn" @click="saveWindShapeInfo" v-show="showUpdateShapeWindBtn" type="success" round>保存修改</el-button>
|
|
|
+ <el-button id="clearWindBtn" @click="clearWind" v-show="showUpdateShapeWindBtn" type="danger" round>取消修改</el-button>
|
|
|
<!-- 风场 -->
|
|
|
<div id="tableTabs" v-show="showTabs">
|
|
|
<el-tabs type="border-card">
|
|
|
<el-tab-pane label="风场列表">
|
|
|
- <wind-table ref="windTable" @updateInfo="updateWindInfo" @rowClick="clickWindRow($event, 0)" @afterDeleted="afterDeletedWind" />
|
|
|
+ <wind-table ref="windTable" name="wind" @updateInfo="showUpdateWindForm" @updateShapeInfo="updateWindInfo" @rowClick="clickWindRow($event, 0)" @afterDeleted="afterDeletedWind" />
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="液压泵列表">
|
|
|
+ <pump-table ref="pumpTable" name="pump" @rowClick="addSingleMarker($event, 0)"/>
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</div>
|
|
@@ -69,17 +91,36 @@
|
|
|
import AddEditWind from './form/AddEditWind';
|
|
|
import Regionals from "@/components/Cascader/Regionals";
|
|
|
import WindTable from './table/WindTable';
|
|
|
-
|
|
|
+import PumpTable from './table/PumpTable';
|
|
|
+import DistanceTool from '@/utils/DistanceTool';
|
|
|
+import $ from "jquery";
|
|
|
export default {
|
|
|
name: "wind_index",
|
|
|
components: {
|
|
|
AddEditWind,
|
|
|
Regionals,
|
|
|
WindTable,
|
|
|
+ PumpTable
|
|
|
},
|
|
|
data: function() {
|
|
|
return {
|
|
|
loading: false, // 加载
|
|
|
+ activeName:'wind',
|
|
|
+ searchType:'area',
|
|
|
+ searchOptions:[
|
|
|
+ {
|
|
|
+ value: 'area',
|
|
|
+ label: '地区'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'wind',
|
|
|
+ label: '风场'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'pump',
|
|
|
+ label: '液压泵'
|
|
|
+ },
|
|
|
+ ],
|
|
|
loadingText: '加载中',
|
|
|
// 地图
|
|
|
BMap: null,
|
|
@@ -89,6 +130,8 @@ export default {
|
|
|
zoom: 13,
|
|
|
currentCityId: null, // 当前城市id
|
|
|
keyword: '', // 搜索关键字
|
|
|
+ windWord:'',
|
|
|
+ pumpWord:'',
|
|
|
currentCityText: null, // 当前城市全名称,可用于地图中心
|
|
|
markerIcons: { // 覆盖物图标
|
|
|
building: '/icons/building.png',
|
|
@@ -108,21 +151,25 @@ export default {
|
|
|
visibleWindDialog: false, // 显示风场
|
|
|
|
|
|
showSaveWindBtn: false, // 显示保存风场信息按钮
|
|
|
+ showUpdateShapeWindBtn:false,//修改风场范围
|
|
|
currentWindObject: null, // 当前添加风场对象
|
|
|
windGroup: [], // 风场覆盖物群组
|
|
|
windData: [], // 风场数据
|
|
|
+ pumpGroup:[],
|
|
|
|
|
|
addWindType:'0',
|
|
|
showWindOverlay: true,
|
|
|
-
|
|
|
+ showPumpOverlay:true,
|
|
|
queryParams: {
|
|
|
- province_id: null,
|
|
|
- city_id: null,
|
|
|
- district_id: null,
|
|
|
+
|
|
|
},
|
|
|
+ markerIcons: 'https://rlfd.oss-cn-hangzhou.aliyuncs.com/smart_tool/beng.png',
|
|
|
|
|
|
}
|
|
|
},
|
|
|
+ unmount () {
|
|
|
+ distanceTool && distanceTool.close()
|
|
|
+ },
|
|
|
created() {
|
|
|
|
|
|
},
|
|
@@ -142,6 +189,7 @@ export default {
|
|
|
|
|
|
let that = this
|
|
|
this.center=new this.BMap.Point(116.403694, 39.913828)
|
|
|
+ this.distanceTool = new BMapLib.DistanceTool(map);
|
|
|
// 浏览器定位
|
|
|
// let geo = new this.BMap.Geolocation
|
|
|
// geo.getCurrentPosition(function(e){
|
|
@@ -166,6 +214,8 @@ export default {
|
|
|
initData() {
|
|
|
// 获取风场数据
|
|
|
this.getwindData()
|
|
|
+ // 获取泵数据
|
|
|
+ this.getPumpData()
|
|
|
},
|
|
|
// 添加多覆盖物
|
|
|
addMultiMarkers(data, type = '') {
|
|
@@ -216,9 +266,7 @@ export default {
|
|
|
})
|
|
|
this.windGroup = []
|
|
|
}
|
|
|
- this.$http.get('wind').then(resp => {
|
|
|
- console.log(resp);
|
|
|
- // this.isSetCenter=false
|
|
|
+ this.$http.get('wind/getWindList').then(resp => {
|
|
|
if (resp.code === 10000) {
|
|
|
this.windData = resp.data
|
|
|
this.windData.forEach(wind => {
|
|
@@ -229,6 +277,64 @@ export default {
|
|
|
}
|
|
|
}).catch(() => {})
|
|
|
},
|
|
|
+ getPumpData(){
|
|
|
+ if (this.pumpGroup && this.pumpGroup.length) {
|
|
|
+ // 移除覆盖物
|
|
|
+ this.pumpGroup.forEach(pump => {
|
|
|
+ pump.remove()
|
|
|
+ })
|
|
|
+ this.pumpGroup = []
|
|
|
+ }
|
|
|
+ this.$http.get('map/queryLocationList').then(response => {
|
|
|
+ if(response.data.length>0){
|
|
|
+ this.addMarkerPoint(response.data);
|
|
|
+ }
|
|
|
+ }).catch(() => {})
|
|
|
+ },
|
|
|
+ addMarkerPoint(data) {
|
|
|
+ var myIcon;
|
|
|
+ Object.keys(data).forEach((k)=>{
|
|
|
+
|
|
|
+ let item=data[k]
|
|
|
+ var pt = new BMap.Point(item.longitude, item.latitude);
|
|
|
+
|
|
|
+ myIcon = new BMap.Icon(this.markerIcons, new BMap.Size(32, 32));
|
|
|
+ myIcon.setImageSize(new BMap.Size(32, 32));
|
|
|
+
|
|
|
+ var marker = new BMap.Marker(pt, {
|
|
|
+ icon: myIcon
|
|
|
+ }); // 创建标注
|
|
|
+
|
|
|
+ let that=this
|
|
|
+ marker.addEventListener("click", function(){
|
|
|
+ let content=that.createMarkerContent(item);
|
|
|
+ var opts = {
|
|
|
+ width : 320, // 信息窗口宽度
|
|
|
+ enableAutoPan:false
|
|
|
+ }
|
|
|
+ var infoWindow = new BMap.InfoWindow(content,opts); // 创建信息窗口对象
|
|
|
+ this.map.openInfoWindow(infoWindow, pt); //开启信息窗口
|
|
|
+ });
|
|
|
+ this.map.addOverlay(marker);
|
|
|
+ this.pumpGroup.push(marker);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ createMarkerContent(data){
|
|
|
+ let address
|
|
|
+ var myGeo = new BMap.Geocoder();
|
|
|
+ // 根据坐标得到地址描述
|
|
|
+ myGeo.getLocation(new BMap.Point(data.longitude,data.latitude), function(result){
|
|
|
+ address=result.address
|
|
|
+ $('#marker_address').text(address);
|
|
|
+ });
|
|
|
+ var content ='<div class="info_label">设备名称:' + (data.name) + '</div>'
|
|
|
+ content +='<div class="info_label">设备编号:' + (data.number) + '</div>'
|
|
|
+ content += '<div class="info_label">定位地址:<a id="marker_address">' + address + '</a></div>'
|
|
|
+ content+='<div class="handle_btn info_label">'
|
|
|
+ content+='</div>'
|
|
|
+
|
|
|
+ return content
|
|
|
+ },
|
|
|
SetMapCenter(windGroup){
|
|
|
if(this.isSetCenter || !this[windGroup][0]){
|
|
|
return
|
|
@@ -253,36 +359,7 @@ export default {
|
|
|
this.searchbarOffset = null
|
|
|
this.showHideOffset = null
|
|
|
},
|
|
|
- // 切换城市
|
|
|
- changeCity(data) {
|
|
|
- // 清除覆盖物
|
|
|
- this.map && this.map.clearOverlays()
|
|
|
- // 清空数据
|
|
|
- this.clearData()
|
|
|
-
|
|
|
- if (!data || !data.key) {
|
|
|
- return;
|
|
|
- }
|
|
|
- this.currentCityId = data.key
|
|
|
- // 移动地图中心点
|
|
|
- this.currentCityText = data.fullLabels.join('')
|
|
|
- this.map.setCenter(this.currentCityText)
|
|
|
- // 设置缩放等级
|
|
|
- let length = data.fullKeys.length
|
|
|
- let zoom = 9 // 省/无
|
|
|
- if (length == 2) { // 市
|
|
|
- zoom = 11
|
|
|
- } else if (length == 3) {
|
|
|
- zoom = 13
|
|
|
- }
|
|
|
- this.map.setZoom(zoom)
|
|
|
- // 请求参数
|
|
|
- this.queryParams.province_id = data.fullKeys[0] || null
|
|
|
- this.queryParams.city_id = data.fullKeys[1] || null
|
|
|
- this.queryParams.district_id = data.fullKeys[2] || null
|
|
|
-
|
|
|
- this.initData()
|
|
|
- },
|
|
|
+
|
|
|
// 添加修改结果
|
|
|
addEditResult(info) {
|
|
|
if (!info || !info.id) {
|
|
@@ -449,6 +526,7 @@ export default {
|
|
|
var bm = document.getElementsByClassName('bm-view')[0]
|
|
|
var tabs = document.getElementById('rightPanel')
|
|
|
var toggleListBtn = document.getElementById('toggleListBtn')
|
|
|
+ // var DistanceToolBtn = document.getElementById('DistanceToolBtn')
|
|
|
var saveWindBtn = document.getElementById('saveWindBtn')
|
|
|
var clearWindBtn = document.getElementById('clearWindBtn')
|
|
|
|
|
@@ -457,6 +535,8 @@ export default {
|
|
|
tabs && (tabs.style.width = '500px')
|
|
|
bm && (bm.style.width = 'calc(100% - 500px)')
|
|
|
toggleListBtn && (toggleListBtn.style.right = '510px')
|
|
|
+ // DistanceToolBtn && (DistanceToolBtn.style.right = '560px')
|
|
|
+
|
|
|
saveWindBtn && (saveWindBtn.style.right = '510px')
|
|
|
clearWindBtn && (clearWindBtn.style.right = '510px')
|
|
|
} else {
|
|
@@ -464,13 +544,23 @@ export default {
|
|
|
tabs && (tabs.style.width = '0px')
|
|
|
bm && (bm.style.width = '100%')
|
|
|
toggleListBtn && (toggleListBtn.style.right = '10px')
|
|
|
+ // DistanceToolBtn && (DistanceToolBtn.style.right = '60px')
|
|
|
saveWindBtn && (saveWindBtn.style.right = '10px')
|
|
|
clearWindBtn && (clearWindBtn.style.right = '10px')
|
|
|
}
|
|
|
|
|
|
},
|
|
|
// 显示风场表单窗口
|
|
|
- showWindFormDialog(e) {
|
|
|
+ showUpdateWindForm(info) {
|
|
|
+ this.windFormData = info;
|
|
|
+ if(this.addWindType=='2'){
|
|
|
+ }else if(this.addWindType=='3'){
|
|
|
+ }else{
|
|
|
+ this.visibleWindDialog = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ showWindFormDialog() {
|
|
|
+
|
|
|
if(this.addWindType=='2'){
|
|
|
}else if(this.addWindType=='3'){
|
|
|
}else{
|
|
@@ -517,25 +607,6 @@ export default {
|
|
|
}
|
|
|
this.isSetCenter=true
|
|
|
}
|
|
|
- // 双击事件
|
|
|
- windObj.addEventListener('dblclick', function(e){
|
|
|
- // console.log(e);
|
|
|
- // 清除上个风场样式
|
|
|
- that.clearWind();
|
|
|
-
|
|
|
- // 赋值当前对象
|
|
|
- that.currentWindObject = e.currentTarget;
|
|
|
- that.addWindType = windType;
|
|
|
- // 可编辑
|
|
|
- that.currentWindObject.enableEditing();
|
|
|
- that.currentWindObject.setStrokeColor(that.currentWindObject._infoData.side_color);
|
|
|
- that.currentWindObject.setStrokeStyle('dashed');
|
|
|
- // 当前风场数据
|
|
|
- that.windFormData = that.currentWindObject._infoData;
|
|
|
- // 显示保存按钮
|
|
|
- that.showSaveWindBtn = true;
|
|
|
-
|
|
|
- })
|
|
|
// 加入群组
|
|
|
if (windType == 0) {
|
|
|
this.windGroup.push(windObj);
|
|
@@ -568,18 +639,8 @@ export default {
|
|
|
this.currentWindObject.setFillColor('pink');
|
|
|
|
|
|
var that = this;
|
|
|
- this.currentWindObject.addEventListener('dblclick', function(e){
|
|
|
- // 清除上个风场样式
|
|
|
- that.clearWind();
|
|
|
- // 赋值当前对象
|
|
|
- that.currentWindObject = e.currentTarget;
|
|
|
- that.currentWindObject.enableEditing();
|
|
|
- that.showSaveWindBtn = true;
|
|
|
-
|
|
|
- if (that.currentWindObject._infoData) {
|
|
|
- that.windFormData = that.currentWindObject._infoData;
|
|
|
- }
|
|
|
- })
|
|
|
+ this.RightAndDblClickAdd(this.currentWindObject)
|
|
|
+
|
|
|
// 加入分组
|
|
|
this.windGroup.push(this.currentWindObject);
|
|
|
},
|
|
@@ -609,18 +670,19 @@ export default {
|
|
|
this.currentWindObject.setFillColor('pink');
|
|
|
|
|
|
var that = this
|
|
|
- this.currentWindObject.addEventListener('dblclick', function(e){
|
|
|
- // 清除上个风场样式
|
|
|
- that.clearWind();
|
|
|
- // 赋值当前对象
|
|
|
- that.currentWindObject = e.currentTarget
|
|
|
- that.currentWindObject.enableEditing();
|
|
|
- that.showSaveWindBtn = true;
|
|
|
-
|
|
|
- if (that.currentWindObject._infoData) {
|
|
|
- that.windFormData = that.currentWindObject._infoData
|
|
|
- }
|
|
|
- })
|
|
|
+ this.RightAndDblClickAdd(this.currentWindObject)
|
|
|
+ // this.currentWindObject.addEventListener('dblclick', function(e){
|
|
|
+ // // 清除上个风场样式
|
|
|
+ // that.clearWind();
|
|
|
+ // // 赋值当前对象
|
|
|
+ // that.currentWindObject = e.currentTarget
|
|
|
+ // that.currentWindObject.enableEditing();
|
|
|
+ // that.showSaveWindBtn = true;
|
|
|
+
|
|
|
+ // if (that.currentWindObject._infoData) {
|
|
|
+ // that.windFormData = that.currentWindObject._infoData
|
|
|
+ // }
|
|
|
+ // })
|
|
|
// 加入分组
|
|
|
this.windGroup.push(this.currentWindObject);
|
|
|
},
|
|
@@ -637,6 +699,7 @@ export default {
|
|
|
this.currentWindObject.setStrokeStyle('solid');
|
|
|
}
|
|
|
this.showSaveWindBtn = false;
|
|
|
+ this.showUpdateShapeWindBtn=false;
|
|
|
},
|
|
|
// 添加修改风场结果
|
|
|
addEditWindResult(result) {
|
|
@@ -660,7 +723,7 @@ export default {
|
|
|
if (wind._infoData && info.id == wind._infoData.id) {
|
|
|
wind.enableEditing() // 可编辑
|
|
|
wind.setStrokeColor(wind._infoData.side_color);
|
|
|
- this.showSaveWindBtn = true;
|
|
|
+ this.showUpdateShapeWindBtn = true;
|
|
|
// 设置中心点并移动
|
|
|
if (info.wind_shape == 'circle') {
|
|
|
this.map.setViewport(wind.getBounds(), {zoomFactor: -1});
|
|
@@ -670,6 +733,7 @@ export default {
|
|
|
|
|
|
this.windFormData = info;
|
|
|
this.currentWindObject = wind;
|
|
|
+ this.RightAndDblClickHandler(wind)
|
|
|
wind.setStrokeStyle('dashed');
|
|
|
} else {
|
|
|
wind.disableEditing(); // 不可编辑
|
|
@@ -678,6 +742,89 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ RightAndDblClickAdd(marker){
|
|
|
+ const that=this
|
|
|
+ var removeMarker = function(e,ee,marker){//右键删除站点
|
|
|
+ that.showWindFormDialog()
|
|
|
+
|
|
|
+ };
|
|
|
+ var updateMarker = function(marker){//右键更新
|
|
|
+ that.getwindData()
|
|
|
+ that.showSaveWindBtn=false
|
|
|
+ };
|
|
|
+ var markerMenu=new BMap.ContextMenu();
|
|
|
+ markerMenu.addItem(new BMap.MenuItem('确认添加',removeMarker.bind(marker)));
|
|
|
+ markerMenu.addItem(new BMap.MenuItem('取消添加',updateMarker.bind(marker)));
|
|
|
+ marker.addContextMenu(markerMenu);//给标记添加右键菜单
|
|
|
+ marker.addEventListener('dblclick', function(e){
|
|
|
+ that.showWindFormDialog()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ RightAndDblClickHandler(marker){
|
|
|
+ const that=this
|
|
|
+ var removeMarker = function(e,ee,marker){//右键删除站点
|
|
|
+
|
|
|
+ that.$confirm('是否保存风场范围?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'info'
|
|
|
+ }).then(() => {
|
|
|
+ that.saveWindShapeInfo()
|
|
|
+
|
|
|
+ }).catch(() => {
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ };
|
|
|
+ var updateMarker = function(marker){//右键更新
|
|
|
+ that.getwindData()
|
|
|
+ that.showUpdateShapeWindBtn=false
|
|
|
+ };
|
|
|
+ var markerMenu=new BMap.ContextMenu();
|
|
|
+ markerMenu.addItem(new BMap.MenuItem('保存修改',removeMarker.bind(marker)));
|
|
|
+ markerMenu.addItem(new BMap.MenuItem('取消修改',updateMarker.bind(marker)));
|
|
|
+ marker.addContextMenu(markerMenu);//给标记添加右键菜单
|
|
|
+ marker.addEventListener('dblclick', function(e){
|
|
|
+ that.$confirm('是否保存风场范围?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'info'
|
|
|
+ }).then(() => {
|
|
|
+ that.saveWindShapeInfo()
|
|
|
+ }).catch(() => {
|
|
|
+
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ saveWindShapeInfo(){
|
|
|
+
|
|
|
+ if (this.windFormData.wind_shape == 'circle') {
|
|
|
+ this.windFormData.wind_info = {
|
|
|
+ radius: this.currentWindObject.getRadius(),
|
|
|
+ center: {lng: this.currentWindObject.point.lng, lat: this.currentWindObject.point.lat},
|
|
|
+ }
|
|
|
+ } else if (this.windFormData.wind_shape == 'polygon') {
|
|
|
+ this.windFormData.wind_info = this.currentWindObject.getPath()
|
|
|
+ }
|
|
|
+
|
|
|
+ var saveData = {
|
|
|
+
|
|
|
+ wind_shape: this.windFormData.wind_shape,
|
|
|
+ wind_info: this.windFormData.wind_info,
|
|
|
+
|
|
|
+ };
|
|
|
+ this.showUpdateShapeWindBtn=false
|
|
|
+ this.$http.put("wind/" + this.windFormData.id, saveData).then((resp) => {
|
|
|
+ if (resp.code != 10000) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ this.currentWindObject.disableEditing()
|
|
|
+ // this.getwindData()
|
|
|
+ this.$message.success("修改成功");
|
|
|
+
|
|
|
+ });
|
|
|
+ },
|
|
|
// 删除风场
|
|
|
afterDeletedWind(id) {
|
|
|
if (!id) return;
|
|
@@ -739,6 +886,34 @@ export default {
|
|
|
|
|
|
},
|
|
|
|
|
|
+ addSingleMarker(data){
|
|
|
+ // 如果没有经纬度
|
|
|
+ if (!data.latitude || !data.longitude) {
|
|
|
+ this.$message.warning('暂无定位数据');
|
|
|
+ // return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ var pt = new BMap.Point(data.longitude, data.latitude);
|
|
|
+ var opts = {
|
|
|
+ width : 320, // 信息窗口宽度
|
|
|
+ enableAutoPan:false
|
|
|
+ }
|
|
|
+ let studentWindowContent=this.createMarkerContent(data)
|
|
|
+ var infoWindow = new BMap.InfoWindow(studentWindowContent,opts); // 创建信息窗口对象
|
|
|
+ this.map.openInfoWindow(infoWindow, pt); //开启信息窗口
|
|
|
+ this.map.centerAndZoom(pt,19);
|
|
|
+ },
|
|
|
+ openDistanceTool (e) {
|
|
|
+ const {distanceTool} = this
|
|
|
+ distanceTool && distanceTool.open()
|
|
|
+ },
|
|
|
+ searchWindList(){
|
|
|
+ console.log(this.windWord)
|
|
|
+ },
|
|
|
+ searchPumpList(){
|
|
|
+ console.log(this.pumpWord)
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|