|
@@ -74,6 +74,14 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="name" label="名称" align="center" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column prop="num" label="数量" align="center" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="操作">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <download-excel style="display: inline-block;" :data="scope.row.data" :fields="scope.row.fields" type="xls"
|
|
|
+ :name="scope.row.name">
|
|
|
+ <el-button type="text">导出</el-button>
|
|
|
+ </download-excel>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -167,6 +175,16 @@ export default {
|
|
|
})
|
|
|
this.data.that.map.addLayer(this.vectorLayer)
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ // 监听面板是否被改变
|
|
|
+ '$store.state.map.P_editableTabsValue': function (val, oldVal) {
|
|
|
+ if (val == 'burstAnalysis') { this.vectorLayer.setVisible(true) }
|
|
|
+ else {
|
|
|
+ this.vectorLayer.setVisible(false)
|
|
|
+ unByKey(this.mapClickEvent) // 移除地图点击事件
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
destroyed() {
|
|
|
this.data.that.map.removeLayer(this.vectorLayer)
|
|
|
unByKey(this.mapClickEvent) // 移除地图点击事件
|
|
@@ -181,6 +199,7 @@ export default {
|
|
|
*/
|
|
|
mapSelect() {
|
|
|
// 定义地图点击事件
|
|
|
+ unByKey(this.mapClickEvent)
|
|
|
this.mapClickEvent = this.data.that.map.on("click", e => {
|
|
|
this.queryPipeData(e.coordinate)
|
|
|
})
|
|
@@ -211,7 +230,7 @@ export default {
|
|
|
*/
|
|
|
queryValveCompleted(res) {
|
|
|
if (this.burstSegmentID.length == 0) {
|
|
|
- alert("请选择爆管点");
|
|
|
+ this.$message.error('请选择爆管点!')
|
|
|
this.loading = false // 关闭执行状态
|
|
|
return;
|
|
|
}
|
|
@@ -255,7 +274,7 @@ export default {
|
|
|
*/
|
|
|
judgePipeSelect(coordinate) {
|
|
|
if (this.burstNetWorkConfigs.length == 0) {
|
|
|
- this.$message.error('未选中管道!')
|
|
|
+ this.$message.error('未选中给水管道或燃气管道!')
|
|
|
this.loading = false // 关闭执行状态
|
|
|
return
|
|
|
} else if (this.burstNetWorkConfigs.length == 1) {
|
|
@@ -454,6 +473,11 @@ export default {
|
|
|
let featureService = new FeatureService(url)
|
|
|
featureService.getFeaturesByGeometry(geometryParam, serviceResult => {
|
|
|
// console.log('设施点查询结果:', serviceResult)
|
|
|
+ if (serviceResult.type == "processFailed") {
|
|
|
+ this.$message.error(`查询受影响设施失败,${serviceResult.error.errorMsg}!`);
|
|
|
+ this.loading = false // 关闭执行状态
|
|
|
+ return
|
|
|
+ }
|
|
|
let features = serviceResult.result.features.features
|
|
|
if (features.length == 0) return
|
|
|
else {
|
|
@@ -461,7 +485,12 @@ export default {
|
|
|
pointFeature.properties['geometry'] = pointFeature.geometry
|
|
|
this.burstInfo.facilities.push(pointFeature.properties)
|
|
|
});
|
|
|
- this.totalResultTable.push({ name: '受影响设施', num: this.burstInfo.facilities.length + '个' })
|
|
|
+ this.totalResultTable.push({
|
|
|
+ name: '受影响设施',
|
|
|
+ num: this.burstInfo.facilities.length + '个',
|
|
|
+ data: this.burstInfo.facilities,
|
|
|
+ fields: this.getFields('point')
|
|
|
+ })
|
|
|
}
|
|
|
this.loading = false // 关闭执行状态
|
|
|
})
|
|
@@ -471,7 +500,7 @@ export default {
|
|
|
*/
|
|
|
processCompleted(res) {
|
|
|
this.showBurstPoint() // 重新显示爆管弧段和爆管点
|
|
|
- // console.log('分析最终结果', res)
|
|
|
+ console.log('分析最终结果', res)
|
|
|
let recordsets = res.result.recordsets
|
|
|
this.burstInfo.valveArray = []
|
|
|
this.burstInfo.pipeArray = []
|
|
@@ -481,41 +510,68 @@ export default {
|
|
|
let features = item.features.features
|
|
|
|
|
|
let pipeLength = new Number()
|
|
|
- if (features[0].geometry.type == 'Point') {
|
|
|
- features.forEach(pointFeature => {
|
|
|
- pointFeature.properties['geometry'] = pointFeature.geometry
|
|
|
- this.burstInfo.valveArray.push(pointFeature.properties)
|
|
|
- // 显示设施
|
|
|
- this.vectorLayer.getSource().addFeature(new Feature({
|
|
|
- geometry: new GeoJSON().readGeometry(pointFeature.geometry)
|
|
|
- }))
|
|
|
- });
|
|
|
- this.totalResultTable.push({ name: '受影响阀门', num: this.burstInfo.valveArray.length + '个' })
|
|
|
- } else {
|
|
|
- let unionEdgePolygon = null // 最终联合成的弧段多边形
|
|
|
- features.forEach((LineFeature, index) => {
|
|
|
- LineFeature.properties['geometry'] = LineFeature.geometry
|
|
|
- // this.queryAffectedFacilities(new GeoJSON().readGeometry(LineFeature.geometry)) // 查询受影响的设施点
|
|
|
- this.burstInfo.pipeArray.push(LineFeature.properties)
|
|
|
- pipeLength += parseFloat(LineFeature.properties.SmLength)
|
|
|
- // 管段生成小的缓冲区,再合并为一个多边形
|
|
|
- let edgeGeometry = new GeoJSON().readGeometry(LineFeature.geometry)
|
|
|
- let coordinate = edgeGeometry.getCoordinates() // 弧段的坐标
|
|
|
- let bufferPolygon = turf.buffer(turf.lineString(coordinate), 0.0006, { units: 'kilometers' }) // 得到弧段缓冲0.5米的多边形
|
|
|
- if (index == 0) unionEdgePolygon = bufferPolygon
|
|
|
- else unionEdgePolygon = turf.union(unionEdgePolygon, bufferPolygon) // 联合弧段
|
|
|
- // 显示管道
|
|
|
- this.vectorLayer.getSource().addFeature(new Feature({
|
|
|
- geometry: edgeGeometry
|
|
|
- }))
|
|
|
- });
|
|
|
- this.burstInfo.pipeLength = pipeLength.toFixed(1)
|
|
|
- // 进行几何查询受影响设施
|
|
|
- this.queryAffectedFacilities(new GeoJSON().readGeometry(unionEdgePolygon.geometry)) // 查询受影响的设施点
|
|
|
- this.totalResultTable.push({ name: '受影响管线', num: this.burstInfo.pipeArray.length + '个' + '/' + this.burstInfo.pipeLength + 'm' })
|
|
|
- }
|
|
|
+ if (features.length > 0)
|
|
|
+ if (features[0].geometry.type == 'Point') {
|
|
|
+ features.forEach(pointFeature => {
|
|
|
+ pointFeature.properties['geometry'] = pointFeature.geometry
|
|
|
+ this.burstInfo.valveArray.push(pointFeature.properties)
|
|
|
+ // 显示设施
|
|
|
+ this.vectorLayer.getSource().addFeature(new Feature({
|
|
|
+ geometry: new GeoJSON().readGeometry(pointFeature.geometry)
|
|
|
+ }))
|
|
|
+ });
|
|
|
+ this.totalResultTable.push({
|
|
|
+ name: '受影响阀门',
|
|
|
+ num: this.burstInfo.valveArray.length + '个',
|
|
|
+ data: this.burstInfo.valveArray,
|
|
|
+ fields: this.getFields('point')
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ let unionEdgePolygon = null // 最终联合成的弧段多边形
|
|
|
+ features.forEach((LineFeature, index) => {
|
|
|
+ LineFeature.properties['geometry'] = LineFeature.geometry
|
|
|
+ // this.queryAffectedFacilities(new GeoJSON().readGeometry(LineFeature.geometry)) // 查询受影响的设施点
|
|
|
+ this.burstInfo.pipeArray.push(LineFeature.properties)
|
|
|
+ pipeLength += parseFloat(LineFeature.properties.SmLength)
|
|
|
+ // 管段生成小的缓冲区,再合并为一个多边形
|
|
|
+ let edgeGeometry = new GeoJSON().readGeometry(LineFeature.geometry)
|
|
|
+ let coordinate = edgeGeometry.getCoordinates() // 弧段的坐标
|
|
|
+ let bufferPolygon = turf.buffer(turf.lineString(coordinate), 0.0006, { units: 'kilometers' }) // 得到弧段缓冲0.5米的多边形
|
|
|
+ if (index == 0) unionEdgePolygon = bufferPolygon
|
|
|
+ else unionEdgePolygon = turf.union(unionEdgePolygon, bufferPolygon) // 联合弧段
|
|
|
+ // 显示管道
|
|
|
+ this.vectorLayer.getSource().addFeature(new Feature({
|
|
|
+ geometry: edgeGeometry
|
|
|
+ }))
|
|
|
+ });
|
|
|
+ this.burstInfo.pipeLength = pipeLength.toFixed(1)
|
|
|
+ // 进行几何查询受影响设施
|
|
|
+ this.queryAffectedFacilities(new GeoJSON().readGeometry(unionEdgePolygon.geometry)) // 查询受影响的设施点
|
|
|
+ this.totalResultTable.push({
|
|
|
+ name: '受影响管线',
|
|
|
+ num: this.burstInfo.pipeArray.length + '个' + '/' + this.burstInfo.pipeLength + 'm',
|
|
|
+ data: this.burstInfo.pipeArray,
|
|
|
+ fields: this.getFields('line')
|
|
|
+ })
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 获取字段,Excel导出时使用
|
|
|
+ */
|
|
|
+ getFields(type) {
|
|
|
+ let fields = {}
|
|
|
+ if (type == 'line')
|
|
|
+ this.$store.state.common.PipeLineFields.forEach(item => {
|
|
|
+ fields[item.pipelineVal] = item.pipelineKey
|
|
|
+ });
|
|
|
+ else {
|
|
|
+ this.$store.state.common.PipePointFields.forEach(item => {
|
|
|
+ fields[item.pipelineVal] = item.pipelineKey
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return fields
|
|
|
+ },
|
|
|
/**
|
|
|
* 点击查看
|
|
|
*/
|