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/assets/js/map/mapView.js  |   18 +++---
 src/store/index.js            |    2 
 src/views/chartView/index.vue |  131 +++++++++++++++++++++++++++++++++----------
 src/views/homePage/index.vue  |    1 
 4 files changed, 110 insertions(+), 42 deletions(-)

diff --git a/src/assets/js/map/mapView.js b/src/assets/js/map/mapView.js
index 5c6cb30..53aa2dc 100644
--- a/src/assets/js/map/mapView.js
+++ b/src/assets/js/map/mapView.js
@@ -55,15 +55,15 @@
       height: 2732.163687177577
     };
     Viewer.clock.currentTime = Cesium.JulianDate.fromDate(todayNoon);
-    earthCtrl.camera.flyTo(
-      res.longitude,
-      res.latitude,
-      res.height,
-      4.501790216143808,
-      -32.230361363631324,
-      0.001313831409284339,
-      2
-    );
+    // earthCtrl.camera.flyTo(
+    //   res.longitude,
+    //   res.latitude,
+    //   res.height,
+    //   4.501790216143808,
+    //   -32.230361363631324,
+    //   0.001313831409284339,
+    //   2
+    // );
     // setTimeout(() => {
     //   mapModel.init();
     // }, 5000);
diff --git a/src/store/index.js b/src/store/index.js
index 07b4c45..5786f13 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -7,7 +7,7 @@
   state: {
     setMenuFlag: false,
     setMsgData: null,
-    setScreenFlag: true,
+    setScreenFlag: false,
     erroInfoMessage: null,
     token: null,
     ragList: [],
diff --git a/src/views/chartView/index.vue b/src/views/chartView/index.vue
index 9db5c54..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;
@@ -437,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) {
diff --git a/src/views/homePage/index.vue b/src/views/homePage/index.vue
index ea199c5..9d587b3 100644
--- a/src/views/homePage/index.vue
+++ b/src/views/homePage/index.vue
@@ -49,6 +49,7 @@
 
 .leftChart {
   flex: 1;
+  z-index: 999;
 }
 
 .chartContent {

--
Gitblit v1.9.3