From 266bf7454bcd0e3d814c974c6b0b05349fe549db Mon Sep 17 00:00:00 2001
From: yxl <584911253@qq.com>
Date: 星期二, 14 一月 2025 17:16:11 +0800
Subject: [PATCH] commit

---
 src/assets/js/mapSetFunc.js      |   79 ++++++++++++--------------
 src/components/Chat/chatList.vue |    2 
 src/views/chartView/index.vue    |   41 +++++++++++++
 3 files changed, 78 insertions(+), 44 deletions(-)

diff --git a/src/assets/js/mapSetFunc.js b/src/assets/js/mapSetFunc.js
index 2c8d2f9..7b8c046 100644
--- a/src/assets/js/mapSetFunc.js
+++ b/src/assets/js/mapSetFunc.js
@@ -13,6 +13,9 @@
       case "aroundPoi":
         this.creatAroundPoi(res);
         break;
+      case "getStrike":
+        this.creatAroundPoi(res);
+        break;
       case "queryRelationship":
         this.creatQueryRelationship(res);
         break;
@@ -395,6 +398,7 @@
     });
     this.addRaderLayer(res);
   },
+  //闆疯揪閬僵鎵弿
   addRaderLayer(res) {
     //闆疯揪閬僵鎵弿锛堣嚜瀹氫箟锛�
     const option = {
@@ -421,7 +425,13 @@
   },
   //瑙嗛敟
   addTetrahedron(res) {
-    res.data.forEach((item,index) => {
+    const modelLayer = mapServer.listData.filter((obj) => {
+      if (obj.name == config.modelLayer) {
+        return obj;
+      }
+    });
+    let ids = [];
+    res.data.forEach((item, index) => {
       const tetrahedron = earthCtrl.factory.addTetrahedron({
         position: {
           lon: item.lontitude,
@@ -429,58 +439,41 @@
           height: item.height
         },
         multiple: 0.05,
-        scale: new SmartEarth.Cesium.Cartesian3(100, 100, 100),
+        scale: new SmartEarth.Cesium.Cartesian3(30, 30, 30),
         color: "#FF0000",
         outlineColor: "#FF0000"
       });
       if (index == 0) {
-        earthCtrl.camera.flyTo(item.lontitude, item.lattitude, 5000, 0, -90, 0, 2);
-        const modelLayer = mapServer.listData.filter((obj) => {
-          if (obj.name == config.modelLayer) {
-            return obj;
-          }
+        // 灏嗙粡绾害杞崲涓篊artesian3鍧愭爣
+        const position = Cesium.Cartesian3.fromDegrees(item.lontitude, item.lattitude - 0.01, 500);
+        // 鍒涘缓涓�涓竟鐣岀悆 (Bounding Sphere)锛屽亣璁惧崐寰勪负500
+        const boundingSphere = new Cesium.BoundingSphere(position, 1000);
+        // 浣跨敤 flyToBoundingSphere 瀹氫綅鐩告満
+        earthCtrl.viewer.camera.flyToBoundingSphere(boundingSphere, {
+          duration: 3.0,  // 椋炶鐨勬椂闂�
+          offset: new Cesium.HeadingPitchRange(0, Cesium.Math.toRadians(-30), 6.28316028073749),
         });
-        // debugger
-        if (modelLayer.length <= 0) return;
-        // earthCtrl.userScene.flyTo(modelLayer[0].layer);
-        // modelLayer[0].layer.style = new Cesium.Cesium3DTileStyle({
-        //   color: {
-        //     evaluateColor: (feature) => {
-        //       const id = feature.getProperty("id");
-        //       // if (id === 'de9b9f1f-bea5-11ef-bbd1-ac82473c08a6') {
-        //       //   debugger
-        //       //   // const boundingVolume = feature.tileset.root.boundingVolume
-        //       //   // const center = Cesium.BoundingVolume.computeBoundingVolume(boundingVolume, feature.tileset.root.transform);
-        //       //   // debugger
-        //       //   earthCtrl.viewer.camera.flyTo({
-        //       //     destination: center,
-        //       //     duration: 2.0
-        //       //   });
-        //       //   // earthCtrl.userScene.flyTo(feature);
-        //       //   // return new SmartEarth.Cesium.Color.fromCssColorString(
-        //       //   //   '#FF0000'
-        //       //   // );
-        //       // }
-        //       // console.log("id**********", id);
-        //       // const color = res.filter((item) => {
-        //       //   if (item.ids.indexOf(id) > -1) {
-        //       //     return item;
-        //       //   }
-        //       // });
-        //       // if (color.length > 0) {
-        //         // return new SmartEarth.Cesium.Color.fromCssColorString(
-        //         //   color[0].color
-        //         // );
-        //       // }
-        //     }
-        //   }
-        // });
+        // earthCtrl.camera.flyTo(item.lontitude, item.lattitude, 5000, 0, -90, 0, 2);
       }
+      ids.push(item.uuid);
       this.layerList.push({
         layer: tetrahedron,
         func: 'tetrahedron'
       });
-    })
+    });
+    modelLayer[0].layer.style = new Cesium.Cesium3DTileStyle({
+      color: {
+        evaluateColor: (feature) => {
+          const id = feature.getProperty("id");
+          if (ids.indexOf(id) > -1) {
+            console.log("id**********", id);
+            return new SmartEarth.Cesium.Color.fromCssColorString(
+              '#FF0000'
+            );
+          }
+        }
+      }
+    });
   },
 
   removeAll() {
diff --git a/src/components/Chat/chatList.vue b/src/components/Chat/chatList.vue
index ef29cd0..caa238e 100644
--- a/src/components/Chat/chatList.vue
+++ b/src/components/Chat/chatList.vue
@@ -784,7 +784,7 @@
 
 .newConcentLeft table {
   border: 1px solid white;
-  text-align: center;
+  text-align: left;
   line-height: 30px;
   font-family: "Arial", sans-serif;
   font-size: 16px;
diff --git a/src/views/chartView/index.vue b/src/views/chartView/index.vue
index d566150..9db5c54 100644
--- a/src/views/chartView/index.vue
+++ b/src/views/chartView/index.vue
@@ -366,6 +366,47 @@
           };
           mapSetFunc.init(finalData);
           break;
+        case "getStrike":
+          let dataList1 = [
+            {
+              type: "鍙墦鍑荤洰鏍�",
+              color: "#FF3366",
+              list: [],
+            },
+            {
+              type: "涓嶅彲鎵撳嚮鐩爣",
+              color: "#33FF66",
+              list: [],
+            },
+            {
+              type: "鍏朵粬",
+              color: "#3366FF",
+              list: [],
+            },
+          ];
+          res.data.forEach((item) => {
+            if (item.ifstrike === "1") {
+              dataList1[0].list.push(item.uuid);
+            } else if (item.ifstrike === "2") {
+              dataList1[1].list.push(item.uuid);
+            } else {
+              dataList1[2].list.push(item.uuid);
+            }
+          });
+          const resultData1 = dataList1
+            .map((item) => `| ${item.type} | ${item.list.length} |`)
+            .join("\n");
+          var a = `| 鏁版嵁绫诲瀷 | 鏁版嵁閲� |\n|------|------|\n` + resultData1;
+          console.log("aaa", a);
+          this.setUpdateHistoryInFor(obj, a);
+          var roleMsg = msgData.getMdData("markdown", a);
+          this.refashMsg(roleMsg.list);
+          const finalData1 = {
+            func: "aroundPoi",
+            data: dataList1,
+          };
+          mapSetFunc.init(finalData1);
+          break;
         case "getParam":
           mapSetFunc.init(res);
           console.log("res.data.targetinfo", res);

--
Gitblit v1.9.3