Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/lifeline_develop_siping' into lifeline_develop_siping

wang_xy 3 giorni fa
parent
commit
27941e5ee7
3 ha cambiato i file con 220 aggiunte e 29 eliminazioni
  1. 199 15
      src/components/supermap-2.5d.vue
  2. 4 4
      src/views/Cockpit.vue
  3. 17 10
      src/views/SentryCockpit.vue

+ 199 - 15
src/components/supermap-2.5d.vue

@@ -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

+ 4 - 4
src/views/Cockpit.vue

@@ -575,10 +575,10 @@ import {
 let echarts = require('echarts')
 
 
-const cityOptions1_1 = [{ type: '企业', url:[] }, { type: '厂站', url:[] }, { type: '阀门', url: [] }, { type: '次高压管网', url: ['/3D-huashengranqi-2/rest/realspace',null] }, { type: '中压管网', url:[] }];
-const cityOptions1_2 = [{ type: '企业', url:[] }, { type: '厂站', url:[] }, { type: '阀门', url:[] }, { type: '次高压管网', url: ['/3D-GH_tiedong/rest/realspace','/map-GangHua/rest/maps/guandao_cigao@Ganghua_tiedong'] }, { type: '中压管网', url:[] }];
-const cityOptions1_3 = [{ type: '企业', url:[] }, { type: '厂站', url:[] }, { type: '阀门', url:[] }, { type: '次高压管网', url: ['/3D-aode/rest/realspace',null] }, { type: '中压管网', url:[] }];
-const cityOptions1_4 = [{ type: '企业', url:[] }, { type: '厂站', url:[] }, { type: '阀门', url:[] }, { type: '次高压管网', url: ['/3D-RunFaRanQi/rest/realspace',null] }, { type: '中压管网', url:[] }];
+const cityOptions1_1 = [{ type: '企业', url:[] }, { type: '厂站', url:[] },  { type: '次高压管网', url: ['/3D-huashengranqi/rest/realspace','/map-GHRQ/rest/maps/all@huasheng'] }, { type: '中压管网', url:[] }];
+const cityOptions1_2 = [{ type: '企业', url:[] }, { type: '厂站', url:[] },  { type: '次高压管网', url: ['/3D-GH_tiedong/rest/realspace','/map-GangHua/rest/maps/guandao_cigao@Ganghua_tiedong'] }, { type: '中压管网', url:['/3D-GH_tiedong/rest/realspace','/map-GangHua/rest/maps/guandao_zhong@Ganghua_tiedong'] }];
+const cityOptions1_3 = [{ type: '企业', url:[] }, { type: '厂站', url:[] },  { type: '次高压管网', url: ['/3D-aode_he/rest/realspace','/map-Aoderanqi/rest/maps/he@aode'] }, { type: '中压管网', url:[] }];
+const cityOptions1_4 = [{ type: '企业', url:[] }, { type: '厂站', url:[] },  { type: '次高压管网', url: ['/3D-runfa_he/rest/realspace','/map-RunFaRanQi/rest/maps/he@runfa'] }, { type: '中压管网', url:[] }];
 const cityOptions2 = [{ type: '企业', url:[] }, { type: '管廊', url:[] }];
 const cityOptions3 = [{ type: '企业', url:[] }, { type: '阀门', url:[] }, { type: '泵站', url:[] }, { type: '管网', url:[] }];
 const cityOptions4 = [{ type: '企业', url:[] }, { type: '合流管', url: ['/3D-PaiShui/rest/realspace',null] }, { type: '污水管', url:[] }, { type: '雨水管', url:[] }, { type: '雨水篦子', url:[] }];

+ 17 - 10
src/views/SentryCockpit.vue

@@ -17,13 +17,13 @@
       <div class="list_tit">监测长度</div>
       <div class="cd_fx" ref="jccd"></div>
         <div class="list_tit">图层控制</div>
-        <div class="map_tab">
-            <span v-for="(item,index) in tabList"
-                  :key="index"
-                  :class="{on:currentClass==index}"
-                  @click="toggleTab(index)">{{item}}</span>
+<!--        <div class="map_tab">-->
+<!--            <span v-for="(item,index) in tabList"-->
+<!--                  :key="index"-->
+<!--                  :class="{on:currentClass==index}"-->
+<!--                  @click="toggleTab(index)">{{item}}</span>-->
 
-        </div>
+<!--        </div>-->
         <div class="con_tckz_div">
           <div class="tab_con" v-show="currentTab==0">
                 <div class="rq_div tekz_div">
@@ -75,6 +75,7 @@
                   <button class="map_btn_span" @click="choseMeasuringArea()">测面</button>
                   <button class="map_btn_span" @click="choseMeasuringHeight()">测高</button>
                   <button class="map_btn_span" @click="boxSelection()">框选</button>
+<!--                  <button class="map_btn_span" @click="pipeBurstAnalysis()">爆管分析</button>-->
                   <button class="map_btn_span" @click="clearAll()">清除</button>
                   <!--                  <button class="map_btn_span" @click="showExcavationAnalyze()">填挖方分析</button>-->
                 </div>
@@ -129,6 +130,7 @@
                   <button class="map_btn_span" @click="choseMeasuringArea()">测面</button>
                   <button class="map_btn_span" @click="choseMeasuringHeight()">测高</button>
                   <button class="map_btn_span" @click="boxSelection()">框选</button>
+<!--                  <button class="map_btn_span" @click="pipeBurstAnalysis()">爆管分析</button>-->
                   <button class="map_btn_span" @click="clearAll()">清除</button>
                   <!--                  <button class="map_btn_span" @click="showExcavationAnalyze()">填挖方分析</button>-->
                 </div>
@@ -183,6 +185,7 @@
                   <button class="map_btn_span" @click="choseMeasuringArea()">测面</button>
                   <button class="map_btn_span" @click="choseMeasuringHeight()">测高</button>
                   <button class="map_btn_span" @click="boxSelection()">框选</button>
+<!--                  <button class="map_btn_span" @click="pipeBurstAnalysis()">爆管分析</button>-->
                   <button class="map_btn_span" @click="clearAll()">清除</button>
                   <!--                  <button class="map_btn_span" @click="showExcavationAnalyze()">填挖方分析</button>-->
                 </div>
@@ -233,10 +236,10 @@
   import {countByBrand} from "@/api/sentinel";
 
 
-  const cityOptions1_1 = [{ type: '企业', url:[] }, { type: '厂站', url:[] }, { type: '阀门', url: [] }, { type: '次高压管网', url: ['/3D-huashengranqi/rest/realspace','/map-GHRQ/rest/maps/all@huasheng'] }, { type: '中压管网', url:[] }];
-  const cityOptions1_2 = [{ type: '企业', url:[] }, { type: '厂站', url:[] }, { type: '阀门', url:[] }, { type: '次高压管网', url: ['/3D-GH_tiedong/rest/realspace','/map-GangHua/rest/maps/guandao_cigao@Ganghua_tiedong'] }, { type: '中压管网', url:[] }];
-  const cityOptions1_3 = [{ type: '企业', url:[] }, { type: '厂站', url:[] }, { type: '阀门', url:[] }, { type: '次高压管网', url: ['/3D-aode_he/rest/realspace','/map-Aoderanqi/rest/maps/he@aode'] }, { type: '中压管网', url:[] }];
-  const cityOptions1_4 = [{ type: '企业', url:[] }, { type: '厂站', url:[] }, { type: '阀门', url:[] }, { type: '次高压管网', url: ['/3D-runfa_he/rest/realspace','/map-RunFaRanQi/rest/maps/he@runfa'] }, { type: '中压管网', url:[] }];
+  const cityOptions1_1 = [{ type: '企业', url:[] }, { type: '厂站', url:[] },  { type: '次高压管网', url: ['/3D-huashengranqi/rest/realspace','/map-GHRQ/rest/maps/all@huasheng'] }, { type: '中压管网', url:[] }];
+  const cityOptions1_2 = [{ type: '企业', url:[] }, { type: '厂站', url:[] },  { type: '次高压管网', url: ['/3D-GH_tiedong/rest/realspace','/map-GangHua/rest/maps/guandao_cigao@Ganghua_tiedong'] }, { type: '中压管网', url:['/3D-GH_tiedong/rest/realspace','/map-GangHua/rest/maps/guandao_zhong@Ganghua_tiedong'] }];
+  const cityOptions1_3 = [{ type: '企业', url:[] }, { type: '厂站', url:[] },  { type: '次高压管网', url: ['/3D-aode_he/rest/realspace','/map-Aoderanqi/rest/maps/he@aode'] }, { type: '中压管网', url:[] }];
+  const cityOptions1_4 = [{ type: '企业', url:[] }, { type: '厂站', url:[] },  { type: '次高压管网', url: ['/3D-runfa_he/rest/realspace','/map-RunFaRanQi/rest/maps/he@runfa'] }, { type: '中压管网', url:[] }];
 	export default {
 		name: 'SentryCockpit',
 		components: {
@@ -366,6 +369,10 @@
       boxSelection() {
         this.$parent.$refs.supermap.boxSelection()
       },
+      //爆管分析
+      pipeBurstAnalysis() {
+        this.$parent.$refs.supermap.pipeBurstAnalysis()
+      },
       //清除
       clearAll() {
         this.$parent.$refs.supermap.closeMeasuringAll()