From 9c2cad000f9279969e76bfc206a7acbb8acc9079 Mon Sep 17 00:00:00 2001
From: lixuliang <lixuliang_hd@126.com>
Date: 星期一, 10 二月 2025 14:38:32 +0800
Subject: [PATCH] Merge branch 'master' of http://103.135.160.14:9034/r/PM20221203225_Web

---
 src/components/right/FCFH.vue |  152 ++++++++++++++++++++++++++++++++++----------------
 1 files changed, 104 insertions(+), 48 deletions(-)

diff --git a/src/components/right/FCFH.vue b/src/components/right/FCFH.vue
index 659a1a9..9e2f4c4 100644
--- a/src/components/right/FCFH.vue
+++ b/src/components/right/FCFH.vue
@@ -2,6 +2,28 @@
   <div class="FloorWrap">
     <div id="closeBtn_onclick"><span>脳</span></div>
     <div id="FloorBox">
+      <div>
+        鏌ョ湅妯″瀷锛�
+        <select id="modelFy">
+          <option value="/c3dserver/YHYQ1/tileset.json" style="background: rgba(0, 0, 0, 0.4)">姘歌緣澶у帵</option>
+          <option value="/ctsserver/yichengketing/tileset.json" style="background: rgba(0, 0, 0, 0.4)">浜﹀煄瀹㈠巺</option>
+          <option value="/ctsserver/fengdaguoji/tileset.json" style="background: rgba(0, 0, 0, 0.4)">涓板ぇ鍥介檯</option>
+        </select>
+      </div>
+      <br />
+      <div id="deviation" style="display:none">
+        鍋忕Щ鏂瑰悜锛�
+        <input name="offset" id="offsetX" class="styled" value="x" checked type="radio" />
+        <label>X杞�</label>
+        &nbsp;
+        <input name="offset" id="offsetY" class="styled" value="y" type="radio" />
+        <label>Y杞�</label>
+        &nbsp;
+        <input name="offset" id="offsetZ" class="styled" value="z" type="radio" />
+        <label>Z杞�</label>
+        <br />
+      </div>
+    
       <div class="checkbox checkbox-primary checkbox-inline" id="selectBox">
         鏌ョ湅灞傜骇锛�
         <select id="selectlevel">
@@ -28,28 +50,12 @@
       <div id="toolbar">
         <div>
           鍋忕Щ璺濈锛�
-          <input
-            type="range"
-            min="-200"
-            max="200"
-            step="1"
-            data-bind="value: distance, valueUpdate: 'input'"
-          />
+          <input type="range" min="-200" max="200" step="1" data-bind="value: distance, valueUpdate: 'input'" />
           <input type="text" size="5" data-bind="value: distance" />
           &nbsp;
-          <input
-            id="showBuild_onclick"
-            type="button"
-            class="btn btn-primary"
-            value="灞曞紑"
-          />
+          <input id="showBuild_onclick" type="button" class="btn btn-primary" value="灞曞紑" />
           &nbsp;
-          <input
-            id="restore_onclick"
-            type="button"
-            class="btn btn-primary"
-            value="鎭㈠"
-          />
+          <input id="restore_onclick" type="button" class="btn btn-primary" value="鎭㈠" />
         </div>
       </div>
     </div>
@@ -69,34 +75,7 @@
   },
   mounted() {
     $(function () {
-      modelLayer = sgworld.Creator.create3DTilesets(
-        "",
-        "http://10.10.4.121:8070/gisserver/c3dserver/YHYQ1/tileset.json",
-        {},
-        {},
-        "0",
-        true,
-        (data) => {
-          let boundingSphere = data.item.boundingSphere;
-          Viewer.zoomTo(
-            data.item,
-            new SmartEarth.Cesium.HeadingPitchRange(
-              0,
-              -0.7,
-              3 * boundingSphere.radius
-            )
-          );
-        }
-      );
-      setTimeout(() => {
-        showModel = sgworld.analysis.ShowBuildingRoom({
-          model: modelLayer.item, //妯″瀷鍩哄厓Primitives
-          distance: { x: 30, y: 0, z: 0 },
-          //selectLevelColor: new SmartEarth.Cesium.Color.fromCssColorString("rgba(240,240,240,0.95)"), //灞曠ず妯″瀷鐨勯鑹�
-          //notSelectColor:new SmartEarth.Cesium.Color.fromCssColorString("rgba(102,204,255,0.5)"),    //闈炲睍绀烘ā鍨嬬殑棰滆壊
-          //highlightColor:new SmartEarth.Cesium.Color.fromCssColorString("rgba(255,215,0,0.9)"),   //閫夋嫨灞曠ず妯″瀷鐨勯珮浜鑹�
-        });
-      }, 1000);
+      getModelLayer();
       //閫夋嫨灞曞紑
       $("#showBuild_onclick").click(function () {
         let num = Number($("#selectlevel").val());
@@ -114,6 +93,12 @@
         sgworld.Creator.DeleteObject(modelLayer);
         Bus.$emit("ShowFCFH", false);
       });
+      $("#modelFy").change(() => {
+        getModelLayer();
+      })
+      $('input[type=radio][name=offset]').change((event) => {
+        setClippingModel();
+      })
       //琛ㄦ牸鏁版嵁
       const dataTable = document.getElementById("dataTable");
       function createTableRow(dataObj) {
@@ -133,6 +118,74 @@
       function loadTable(dataObj) {
         deleteAllRows();
         createTableRow(dataObj);
+      }
+      function getModelLayer() {
+        const val = document.getElementById("modelFy").value;
+        var falg = false;
+        if (val.indexOf('YHYQ1') > -1) {
+          $("#selectBox").show();
+          $("#toolbar").show();
+          $("#deviation").hide();
+          document.getElementById('offsetX').checked = true;
+        } else {
+          $("#deviation").show();
+          falg = true;
+          $("#selectBox").hide();
+          $("#toolbar").hide();
+          $("#offsetX").attr("checked", true);
+          $("#offsetY").attr("checked", false);
+          $("#offsetZ").attr("checked", false);
+        }
+        const url = "http://10.10.4.121:8070/gisserver" + val;
+        // console.log(document.getElementById("modelFy"));
+
+        addModelLayer(url, falg)
+      }
+      function addModelLayer(response, flag) {
+        if (modelLayer) {
+          sgworld.Creator.DeleteObject(modelLayer);
+          modelLayer = null
+        }
+        modelLayer = sgworld.Creator.create3DTilesets(
+          "",
+          response,
+          {},
+          {},
+          "0",
+          true,
+          (data) => {
+            let boundingSphere = data.item.boundingSphere;
+            Viewer.zoomTo(
+              data.item,
+              new SmartEarth.Cesium.HeadingPitchRange(
+                0,
+                -0.7,
+                3 * boundingSphere.radius
+              )
+            );
+          }
+        );
+        setTimeout(() => {
+          showModel = sgworld.analysis.ShowBuildingRoom({
+            model: modelLayer.item, //妯″瀷鍩哄厓Primitives
+            distance: { x: 30, y: 0, z: 0 },
+            //selectLevelColor: new SmartEarth.Cesium.Color.fromCssColorString("rgba(240,240,240,0.95)"), //灞曠ず妯″瀷鐨勯鑹�
+            //notSelectColor:new SmartEarth.Cesium.Color.fromCssColorString("rgba(102,204,255,0.5)"),    //闈炲睍绀烘ā鍨嬬殑棰滆壊
+            //highlightColor:new SmartEarth.Cesium.Color.fromCssColorString("rgba(255,215,0,0.9)"),   //閫夋嫨灞曠ず妯″瀷鐨勯珮浜鑹�
+          });
+          if (flag) {
+            setClippingModel()
+          }
+        }, 1000);
+      }
+      function setClippingModel() {
+        var radios = document.querySelectorAll('input[name="offset"]:checked');
+        if (radios.length > 0) {
+          var value = radios[0].value;
+          modelLayer.clippingModel({
+            direction: value
+          })
+        }
       }
       //鍒犻櫎琛ㄦ牸
       function deleteAllRows() {
@@ -225,18 +278,21 @@
 <style scoped>
 .FloorWrap {
   color: #fff;
+  min-width: 413px;
 }
+
 #closeBtn_onclick {
   width: 20px;
   cursor: pointer;
   margin-left: auto;
   margin-bottom: 8px;
 }
+
 #closeBtn_onclick span {
   font-size: 20px;
 }
 </style>
-<style >
+<style>
 #dataTable {
   background-color: rgba(0, 0, 0, 0.4);
   position: fixed;

--
Gitblit v1.9.3