|
@@ -207,7 +207,7 @@ export default {
|
|
|
// 打开对应类型的窗体
|
|
|
this[_type + 'Window'](_info);
|
|
|
},
|
|
|
- // 获取围栏数据
|
|
|
+ // 获取风场数据
|
|
|
getwindData() {
|
|
|
if (this.windGroup && this.windGroup.length) {
|
|
|
// 移除覆盖物
|
|
@@ -487,7 +487,7 @@ export default {
|
|
|
this.windFormData.wind_info = this.currentWindObject.getPath()
|
|
|
}
|
|
|
},
|
|
|
- // 添加围栏图形
|
|
|
+ // 添加风场图形
|
|
|
addShapeWind(info, windType) {
|
|
|
let side_color = info.side_color;
|
|
|
let inside_color=info.inside_color
|
|
@@ -519,7 +519,8 @@ export default {
|
|
|
}
|
|
|
// 双击事件
|
|
|
windObj.addEventListener('dblclick', function(e){
|
|
|
- // 清除上个围栏样式
|
|
|
+ // console.log(e);
|
|
|
+ // 清除上个风场样式
|
|
|
that.clearWind();
|
|
|
|
|
|
// 赋值当前对象
|
|
@@ -527,7 +528,7 @@ export default {
|
|
|
that.addWindType = windType;
|
|
|
// 可编辑
|
|
|
that.currentWindObject.enableEditing();
|
|
|
- that.currentWindObject.setStrokeColor('red');
|
|
|
+ that.currentWindObject.setStrokeColor(that.currentWindObject._infoData.side_color);
|
|
|
that.currentWindObject.setStrokeStyle('dashed');
|
|
|
// 当前风场数据
|
|
|
that.windFormData = that.currentWindObject._infoData;
|
|
@@ -545,9 +546,9 @@ export default {
|
|
|
}
|
|
|
|
|
|
},
|
|
|
- // 新增圆形围栏
|
|
|
+ // 新增圆形风场
|
|
|
addCircleWind(e) {
|
|
|
- // 清除上个围栏样式
|
|
|
+ // 清除上个风场样式
|
|
|
this.clearWind();
|
|
|
|
|
|
this.showSaveWindBtn = true;
|
|
@@ -568,7 +569,7 @@ export default {
|
|
|
|
|
|
var that = this;
|
|
|
this.currentWindObject.addEventListener('dblclick', function(e){
|
|
|
- // 清除上个围栏样式
|
|
|
+ // 清除上个风场样式
|
|
|
that.clearWind();
|
|
|
// 赋值当前对象
|
|
|
that.currentWindObject = e.currentTarget;
|
|
@@ -585,7 +586,7 @@ export default {
|
|
|
|
|
|
|
|
|
addPolygonWind(e) {
|
|
|
- // 清除上个围栏样式
|
|
|
+ // 清除上个风场样式
|
|
|
this.clearWind();
|
|
|
|
|
|
this.addWindType = 0;
|
|
@@ -609,7 +610,7 @@ export default {
|
|
|
|
|
|
var that = this
|
|
|
this.currentWindObject.addEventListener('dblclick', function(e){
|
|
|
- // 清除上个围栏样式
|
|
|
+ // 清除上个风场样式
|
|
|
that.clearWind();
|
|
|
// 赋值当前对象
|
|
|
that.currentWindObject = e.currentTarget
|
|
@@ -627,16 +628,17 @@ export default {
|
|
|
if (!this.currentWindObject) {
|
|
|
return;
|
|
|
}
|
|
|
+ // console.log(this.currentWindObject);
|
|
|
this.currentWindObject.disableEditing();
|
|
|
if (!this.currentWindObject._infoData) { // 添加
|
|
|
this.currentWindObject.remove();
|
|
|
} else {
|
|
|
- this.currentWindObject.setStrokeColor('blue');
|
|
|
+ this.currentWindObject.setStrokeColor(this.currentWindObject._infoData.side_color);
|
|
|
this.currentWindObject.setStrokeStyle('solid');
|
|
|
}
|
|
|
this.showSaveWindBtn = false;
|
|
|
},
|
|
|
- // 添加修改围栏结果
|
|
|
+ // 添加修改风场结果
|
|
|
addEditWindResult(result) {
|
|
|
if (result.success) {
|
|
|
this.visibleWindDialog = false
|
|
@@ -646,9 +648,9 @@ export default {
|
|
|
}
|
|
|
|
|
|
},
|
|
|
- // 修改围栏
|
|
|
+ // 修改风场
|
|
|
updateWindInfo(info) {
|
|
|
- console.log(info);
|
|
|
+ // console.log(info);
|
|
|
if (!this.windGroup || !this.windGroup.length) {
|
|
|
this.$message.error('风场数据不存在');
|
|
|
return;
|
|
@@ -657,7 +659,7 @@ export default {
|
|
|
this.windGroup.forEach(wind => {
|
|
|
if (wind._infoData && info.id == wind._infoData.id) {
|
|
|
wind.enableEditing() // 可编辑
|
|
|
- wind.setStrokeColor('red');
|
|
|
+ wind.setStrokeColor(wind._infoData.side_color);
|
|
|
this.showSaveWindBtn = true;
|
|
|
// 设置中心点并移动
|
|
|
if (info.wind_shape == 'circle') {
|
|
@@ -671,12 +673,12 @@ export default {
|
|
|
wind.setStrokeStyle('dashed');
|
|
|
} else {
|
|
|
wind.disableEditing(); // 不可编辑
|
|
|
- wind.setStrokeColor('blue');
|
|
|
+ // wind.setStrokeColor(info.side_color);
|
|
|
wind.setStrokeStyle('solid');
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 删除围栏
|
|
|
+ // 删除风场
|
|
|
afterDeletedWind(id) {
|
|
|
if (!id) return;
|
|
|
|
|
@@ -699,7 +701,6 @@ export default {
|
|
|
},
|
|
|
// 点击风场
|
|
|
clickWindRow(info, windType) {
|
|
|
- console.log(info);
|
|
|
let windGroup = [];
|
|
|
if (windType == 0) {
|
|
|
this.addWindType = 0;
|
|
@@ -717,9 +718,9 @@ export default {
|
|
|
}
|
|
|
|
|
|
windGroup.forEach(wind => {
|
|
|
- console.log(wind);
|
|
|
+ // console.log(wind);
|
|
|
if (wind._infoData && info.id == wind._infoData.id) {
|
|
|
- // 清除上个围栏样式
|
|
|
+ // 清除上个风场样式
|
|
|
this.clearWind();
|
|
|
// 设置中心点并移动
|
|
|
if (info.wind_shape == 'circle') {
|
|
@@ -728,9 +729,9 @@ export default {
|
|
|
this.map.setViewport(wind._infoData.wind_info, {zoomFactor: -1})
|
|
|
}
|
|
|
// 设置颜色
|
|
|
- wind.setStrokeColor('red');
|
|
|
+ wind.setStrokeColor(info.side_color);
|
|
|
wind.setStrokeStyle('dashed');
|
|
|
- // 选中围栏信息赋值
|
|
|
+ // 选中风场信息赋值
|
|
|
this.windFormData = info;
|
|
|
this.currentWindObject = wind;
|
|
|
}
|