|
@@ -87,8 +87,15 @@
|
|
|
</Form>
|
|
|
</div>
|
|
|
<!--地图选择、框选 显示 结束-->
|
|
|
-
|
|
|
-
|
|
|
+ <div id="pipeBurstAnalysis" v-if="showPipeBurstAnalysis" class="param-container tool-bar">
|
|
|
+ <select id="options" class="form-control">
|
|
|
+ <option selected value="down">下游分析</option>
|
|
|
+ <option value="up">上游分析</option>
|
|
|
+ <option value="faclilities">上游关键设施查找</option>
|
|
|
+ </select>
|
|
|
+ <button id="excavation">选择分析管线</button>
|
|
|
+ <button id="clear">清除结果</button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -110,6 +117,7 @@ export default {
|
|
|
showExcavation:false,//开挖图示
|
|
|
showExcavationAnalyze:false,//填开挖分析图示
|
|
|
showSoxSelection:false,//选择、框选
|
|
|
+ showPipeBurstAnalysis:false,//爆管分析
|
|
|
boxSelectionTooltip:null,//选择、框选Tooltip
|
|
|
boxSelectionObjects : {//选择、框选元素
|
|
|
isCallInMoving: false,
|
|
@@ -442,8 +450,15 @@ export default {
|
|
|
this.checkedCities=checkedCities
|
|
|
var checkedCities_2D=[]
|
|
|
var checkedCities_3D=[]
|
|
|
+
|
|
|
+ let List_2 = this.open_LifelineList_2D.map(item => item.url)
|
|
|
+ List_2.forEach(url => {
|
|
|
+ if (!url) return; // 如果没有 URL,跳过当前迭代
|
|
|
+ this.viewer.imageryLayers.remove(this.selectMapObj_2D(url));
|
|
|
+ });
|
|
|
+ this.open_LifelineList_2D = []
|
|
|
+
|
|
|
this.checkedCities.forEach(urlList => {
|
|
|
- debugger
|
|
|
if (!urlList.length) return; // 如果没有 URL,跳过当前迭代
|
|
|
|
|
|
//加载三维图层
|
|
@@ -467,27 +482,19 @@ export default {
|
|
|
}
|
|
|
|
|
|
//加载二维图层
|
|
|
- if(urlList[1]) {
|
|
|
- if (!this.open_LifelineList_2D.some(item => item.url === urlList[1])) {//查找已勾选的图层数组
|
|
|
+ if(urlList[1]){
|
|
|
let obj = this.viewer.imageryLayers.addImageryProvider(new SuperMap3D.SuperMapImageryProvider({
|
|
|
- url: this.superMapRootUrl + urlList[1]
|
|
|
+ url:this.superMapRootUrl + urlList[1]
|
|
|
}));
|
|
|
this.open_LifelineList_2D.push({
|
|
|
- url: urlList[1],
|
|
|
+ url: urlList[1],
|
|
|
mapObj: obj
|
|
|
})
|
|
|
- checkedCities_2D.push(urlList[1])
|
|
|
- }
|
|
|
+ checkedCities_2D.push(urlList[1])
|
|
|
}
|
|
|
});
|
|
|
const urlsToRemove_2D = this.open_LifelineList_2D.map(item => item.url).filter(url => !checkedCities_2D.includes(url));//查找没勾选的图层数组2D
|
|
|
const urlsToRemove_3D = this.open_LifelineList_3D.map(item => item.url).filter(url => !checkedCities_3D.includes(url));//查找没勾选的图层数组3D
|
|
|
- console.log('选中的url_2D:', checkedCities_2D);
|
|
|
- console.log('选中的url_3D:', checkedCities_3D);
|
|
|
- console.log('移除的url_2D:', urlsToRemove_2D);
|
|
|
- console.log('移除的url_3D:', urlsToRemove_3D);
|
|
|
- console.log('加载的url_2D:', this.open_LifelineList_2D);
|
|
|
- console.log('加载的url_3D:', this.open_LifelineList_3D);
|
|
|
urlsToRemove_3D.forEach(url => {
|
|
|
if (!url) return; // 如果没有 URL,跳过当前迭代
|
|
|
SuperMap3D.when.all(this.selectMapObj_3D(url), function (layers) {
|
|
@@ -500,6 +507,12 @@ export default {
|
|
|
if (!url) return; // 如果没有 URL,跳过当前迭代
|
|
|
this.viewer.imageryLayers.remove(this.selectMapObj_2D(url));
|
|
|
});
|
|
|
+ console.log('选中的url_2D:', checkedCities_2D);
|
|
|
+ console.log('选中的url_3D:', checkedCities_3D);
|
|
|
+ console.log('移除的url_2D:', urlsToRemove_2D);
|
|
|
+ console.log('移除的url_3D:', urlsToRemove_3D);
|
|
|
+ console.log('加载的url_2D:', this.open_LifelineList_2D);
|
|
|
+ console.log('加载的url_3D:', this.open_LifelineList_3D);
|
|
|
},
|
|
|
selectMapObj_2D(url) {
|
|
|
const item = this.open_LifelineList_2D.find(item => item.url === url);
|
|
@@ -1736,6 +1749,177 @@ export default {
|
|
|
|
|
|
}, 1000)
|
|
|
},
|
|
|
+ //爆管分析
|
|
|
+ pipeBurstAnalysis(){
|
|
|
+ let that=this;
|
|
|
+ that.showPipeBurstAnalysis=true
|
|
|
+ // 开启地下模式
|
|
|
+ that.scene.undergroundMode = true
|
|
|
+ that.scene.screenSpaceCameraController.minimumZoomDistance = -1000
|
|
|
+ that.scene.globe.show = false
|
|
|
+ that.viewer.resolutionScale = window.devicePixelRatio;
|
|
|
+ // 添加地下管线模型
|
|
|
+ let promise_underground = that.scene.open('http://116.142.80.12:8090/iserver/services/3D-burstAnalysis/rest/realspace');
|
|
|
+
|
|
|
+ // setTimeout(()=>{
|
|
|
+ // new SuperMap3D.when(promise_underground, function (layers) {
|
|
|
+ // alert(layers)
|
|
|
+ // // 设置图层的LOD层级切换距离缩放系数。
|
|
|
+ // for (let layer of layers) {
|
|
|
+ // layer.lodRangeScale = 50
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // //查询所有阀门
|
|
|
+ // queryALLValve()
|
|
|
+ // //粒子特效
|
|
|
+ // let multiFireUrl = '../src/particle/fountain.json';
|
|
|
+ // modelMatrix = new SuperMap3D.Matrix4();
|
|
|
+ // let pos = new SuperMap3D.Cartesian3.fromDegrees(0, 0, 0)
|
|
|
+ // new SuperMap3D.Transforms.eastNorthUpToFixedFrame(pos, undefined, modelMatrix);
|
|
|
+ // new SuperMap3D.ParticleHelper.fromJsonUrl(multiFireUrl, that.scene).then(function (particleSys) {
|
|
|
+ // particleSystem = particleSys;
|
|
|
+ // particleSystem.emitRate = 200
|
|
|
+ // particleSystem.gravity = new SuperMap3D.Cartesian3(0, 0, 4)
|
|
|
+ // particleSystem.minLifeTime = 1
|
|
|
+ // particleSystem.maxLifeTime = 2
|
|
|
+ // particleSystem.minSize = 1
|
|
|
+ // particleSystem.maxSize = 4
|
|
|
+ // particleSystem.modelMatrix = modelMatrix;
|
|
|
+ // particleSystem.start();
|
|
|
+ // });
|
|
|
+ // // 获取管线管点图层
|
|
|
+ // pipeedge = that.scene.layers.find('PipeNetWork@Pipe3D#1')
|
|
|
+ // pipenode = that.scene.layers.find('PipeNetWork_Node@Pipe3D#1')
|
|
|
+ // pipenode1 = that.scene.layers.find('PipeNetWork_Node@Pipe3D')
|
|
|
+ // handler = new SuperMap3D.ScreenSpaceEventHandler(that.scene.canvas);
|
|
|
+ //
|
|
|
+ // // 开始分析按钮事件
|
|
|
+ // document.getElementById('excavation').onclick = () => {
|
|
|
+ // if (handler) {
|
|
|
+ //
|
|
|
+ // handler.setInputAction(function (e) {
|
|
|
+ // // 获取点击的管线ID
|
|
|
+ // pipesec = pipeedge.getSelection()
|
|
|
+ // if (!pipesec && pipesec.length === 0) {
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // let position = that.scene.pickPosition(e.position)
|
|
|
+ // //爆管分析
|
|
|
+ // burstAnalysis(pipesec, position)
|
|
|
+ // }, SuperMap3D.ScreenSpaceEventType.LEFT_CLICK)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // // 清除按钮事件
|
|
|
+ // document.getElementById('clear').onclick = () => {
|
|
|
+ // if (handler) {
|
|
|
+ // handler.removeInputAction(SuperMap3D.ScreenSpaceEventType.LEFT_CLICK)
|
|
|
+ // }
|
|
|
+ // let pos = SuperMap3D.Cartesian3.fromDegrees(0, 0, 0)
|
|
|
+ // SuperMap3D.Transforms.eastNorthUpToFixedFrame(pos, undefined, modelMatrix);
|
|
|
+ // particleSystem.modelMatrix = modelMatrix;
|
|
|
+ // pipeedge.setObjsColor(edgeIds, SuperMap3D.Color.WHITE)
|
|
|
+ // pipenode.setObjsColor(nodeIds, SuperMap3D.Color.WHITE)
|
|
|
+ // pipenode1.setObjsColor(nodeIds, SuperMap3D.Color.WHITE)
|
|
|
+ //
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // },1000)
|
|
|
+
|
|
|
+ if (!that.scene.pickPositionSupported) {
|
|
|
+ alert('不支持深度纹理,无法绘制多边形,地形开挖功能无法使用!');
|
|
|
+ }
|
|
|
+ $('#toolbar').show();
|
|
|
+ $('#loadingbar').remove();
|
|
|
+
|
|
|
+ /*
|
|
|
+ 爆管分析,pipesec:选取管线id,position:鼠标点击位置
|
|
|
+ */
|
|
|
+ function burstAnalysis(pipesec, position) {
|
|
|
+ SuperMap3D.Transforms.eastNorthUpToFixedFrame(position, undefined, modelMatrix);
|
|
|
+ particleSystem.modelMatrix = modelMatrix;
|
|
|
+ console.log(pipesec)
|
|
|
+ // 获取当前选择的分析方式
|
|
|
+ let value = document.getElementById('options').value
|
|
|
+ // 根据分析方式创建请求体
|
|
|
+
|
|
|
+ if (value === "down") {
|
|
|
+ workURL = 'http://116.142.80.12:8090/iserver/services/networkAnalyst3D-burstAnalysis-2/rest/facilityanalyst3d/PipeNetWork@Pipe3D/tracedownresult.json'
|
|
|
+ queryObj = {
|
|
|
+ edgeID: pipesec[0],
|
|
|
+ isUncertainDirectionValid: true,
|
|
|
+ weightName: 'WeightField'
|
|
|
+ }
|
|
|
+ } else if (value === 'up') {
|
|
|
+ workURL = 'http://116.142.80.12:8090/iserver/services/networkAnalyst3D-burstAnalysis-2/rest/facilityanalyst3d/PipeNetWork@Pipe3D/traceupresult.json'
|
|
|
+ queryObj = {
|
|
|
+ edgeID: pipesec[0],
|
|
|
+ isUncertainDirectionValid: true,
|
|
|
+ weightName: 'WeightField'
|
|
|
+ }
|
|
|
+ } else if (value === 'faclilities') {
|
|
|
+ let valve = valves
|
|
|
+ let ids = JSON.stringify(valve)
|
|
|
+ workURL = 'http://116.142.80.12:8090/iserver/services/networkAnalyst3D-burstAnalysis-2/rest/facilityanalyst3d/PipeNetWork@Pipe3D/upstreamcirticalfaclilities.json'
|
|
|
+ queryObj = {
|
|
|
+ sourceNodeIDs: ids,
|
|
|
+ edgeID: pipesec[0],
|
|
|
+ isUncertainDirectionValid: true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 发送请求
|
|
|
+ $.ajax({
|
|
|
+ type: 'GET',
|
|
|
+ url: workURL,
|
|
|
+ data: queryObj,
|
|
|
+ success: data => {
|
|
|
+ // 得到结果
|
|
|
+ console.log(data)
|
|
|
+ if (data.edges) {
|
|
|
+ edgeIds = data.edges
|
|
|
+ pipeedge.setObjsColor(data.edges, SuperMap3D.Color.RED)
|
|
|
+ }
|
|
|
+ if (data.nodes) {
|
|
|
+ nodeIds = data.nodes
|
|
|
+ pipenode.setObjsColor(data.nodes, SuperMap3D.Color.RED)
|
|
|
+ pipenode1.setObjsColor(data.nodes, SuperMap3D.Color.RED)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: res => {
|
|
|
+ console.log(res)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 查询所有阀门
|
|
|
+ function queryALLValve() {
|
|
|
+ debugger
|
|
|
+ //查询阀门地址和参数
|
|
|
+ let dataServiceUrl = 'http://116.142.80.12:8090/iserver/services/data-burstAnalysis/rest/data/featureResults.json?returnContent=true';
|
|
|
+ let queryObj = {
|
|
|
+ getFeatureMode: 'SQL',
|
|
|
+ datasetNames: ['Pipe3D:PipeNetWork_Node'],
|
|
|
+ queryParameter: {
|
|
|
+ attributeFilter: "Name='阀门'"
|
|
|
+ }
|
|
|
+ };
|
|
|
+ queryObjJSON = JSON.stringify(queryObj); // 转化为JSON字符串作为查询参数
|
|
|
+ $.ajax({
|
|
|
+ type: "post",
|
|
|
+ url: dataServiceUrl,
|
|
|
+ data: queryObjJSON,
|
|
|
+ success: function (result) {
|
|
|
+ valves = []
|
|
|
+ result.features.map(function (element) {
|
|
|
+ // 遍历数组,对每个元素进行操作
|
|
|
+ valves.push(element.ID);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ error: function (msg) {
|
|
|
+ console.log(msg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
//清除框选
|
|
|
removeBoxSelection(){
|
|
|
this.showSoxSelection= false
|