From 7c24257d14c8a773aef0586c0195642c15246038 Mon Sep 17 00:00:00 2001
From: yxl <584911253@qq.com>
Date: 星期一, 20 一月 2025 17:59:41 +0800
Subject: [PATCH] commit

---
 src/views/chartView/index.vue |  172 ++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 140 insertions(+), 32 deletions(-)

diff --git a/src/views/chartView/index.vue b/src/views/chartView/index.vue
index d566150..95beaf3 100644
--- a/src/views/chartView/index.vue
+++ b/src/views/chartView/index.vue
@@ -50,6 +50,7 @@
         dept: "鏈�绠�鍗曘�佹渶渚挎嵎",
         callback: this.bindCover,
       },
+      closeMap: false,
     };
   },
   computed: {
@@ -130,7 +131,7 @@
         // console.log('Received message:', event.data);
         console.log(event);
 
-        if (event.data != "杩炴帴鎴愬姛") {
+        if (event.data != "杩炴帴鎴愬姛" || event.data != "鏀跺埌娑堟伅锛屾秷鎭唴瀹癸細蹇冭烦鍖呮娴�") {
           console.log(event.data);
           const val = JSON.parse(event.data);
           if (val.session_id == this.uuid) {
@@ -201,19 +202,52 @@
       }
     },
     async setMsgStart(res) {
+      console.log("res----", res);
+      //杈撳叆@map鎵撳紑鍦板浘
+      if (res == "@map") {
+        var rolMsg = [
+          {
+            type: "text",
+            val: "鍦板浘宸叉墦寮�",
+          },
+        ];
+        this.refashMsg(rolMsg);
+        //鎵撳紑鍦板浘
+        this.$store.state.setScreenFlag = true;
+        this.closeMap = true;
+        earthCtrl.viewer.camera.flyTo({
+          destination: {
+            x: -1803769.3854512463,
+            y: 29158371.286777183,
+            z: 13465105.223495383,
+          },
+          orientation: {
+            heading: 6.283185307179586,
+            pitch: -1.5707963267948966,
+            roll: 0,
+          },
+        });
+      }
+      //鏈塵ap鍏抽敭瀛楀畾浣�
+      else if (res.indexOf("@map") > -1) {
+        this.closeMap = true;
+        window.earthCtrl.camera.flyTo(
+          121.5898036178841,
+          23.93799083591751,
+          2732.163687177577,
+          4.501790216143808,
+          -32.230361363631324,
+          0.001313831409284339,
+          2
+        );
+      } else {
+        //鍏抽棴鍦板浘
+        // this.$store.state.setScreenFlag = false;
+      }
       mapImg.removeInit();
       mapSetFunc.removeAll();
       this.$store.state.setListColor = [];
       this.$store.state.showLenged = false;
-      window.earthCtrl.camera.flyTo(
-        121.5898036178841,
-        23.93799083591751,
-        2732.163687177577,
-        4.501790216143808,
-        -32.230361363631324,
-        0.001313831409284339,
-        2
-      );
 
       // const formData = new FormData();
       // formData.append("message", res);
@@ -244,27 +278,60 @@
       });
     },
     async setAgentIntention(obj, formData) {
-      getAgentIntention(formData).then((response) => {
-        if (response.code != 200) {
+      console.log("obj", formData);
+      getAgentIntention(formData)
+        .then((response) => {
+          if (response.code != 200) {
+            if (formData.message != "@map") {
+              var rolMsg = [
+                {
+                  type: "text",
+                  val: "鏈煡璇㈠埌鐩稿叧淇℃伅銆�",
+                },
+              ];
+              this.refashMsg(rolMsg);
+            }
+            return;
+          }
+
+          const type = response.type;
+          //鏅�氬璇濅俊鎭煡璇�
+          if (type == "message") {
+            //鍏抽棴鍦板浘
+            if (!this.closeMap) {
+              this.$store.state.setScreenFlag = false;
+            }
+            var rolMsg = [
+              {
+                type: "text",
+                val: response.msg,
+              },
+            ];
+            this.refashMsg(rolMsg);
+          }
+          //鍦板浘鏌ヨ
+          else {
+            //鎵撳紑鍦板浘
+            this.$store.state.setScreenFlag = true;
+            this.setMapfunc(response.content, obj);
+          }
+          // if (type == "Map") {
+          //   this.setMapfunc(response.content, obj);
+          // } else if (type == "Rag") {
+          //   this.setMapRag(response, obj);
+          // } else {
+          //   // this.setMapfunc(response.content, obj);
+          // }
+        })
+        .catch((error) => {
           var rolMsg = [
             {
               type: "text",
-              val: "鏈煡璇㈠埌鐩稿叧淇℃伅銆�",
+              val: "鎶辨瓑锛屾湇鍔″櫒浼间箮鍑轰簡鐐归棶棰橈紝鎴戜滑姝e湪淇涓��",
             },
           ];
           this.refashMsg(rolMsg);
-          return;
-        }
-
-        const type = response.type;
-        if (type == "Map") {
-          this.setMapfunc(response.content, obj);
-        } else if (type == "Rag") {
-          this.setMapRag(response, obj);
-        } else {
-          this.setMapfunc(response.content, obj);
-        }
-      });
+        });
     },
     setMapfunc(res, obj) {
       this.$store.state.showLenged = false;
@@ -366,6 +433,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);
@@ -396,13 +504,13 @@
           this.setUpdateHistoryInFor(obj, res.msg);
           this.refashMsg(roleMsg.list);
           break;
-        default:
-          this.setUpdateHistoryInFor(obj, res.msg);
-          var roleMsg1 = msgData.getAffairsData([
-            { type: "text", val: res.msg },
-          ]);
-          this.refashMsg(roleMsg1.list);
-          break;
+        // default:
+        //   this.setUpdateHistoryInFor(obj, res.msg);
+        //   var roleMsg1 = msgData.getAffairsData([
+        //     { type: "text", val: res.msg },
+        //   ]);
+        //   this.refashMsg(roleMsg1.list);
+        //   break;
       }
     },
     setUpdateHistoryInFor(obj, message) {

--
Gitblit v1.9.3