From c7a16ca1b6fbcb0b82a4a09c2e75014624082e37 Mon Sep 17 00:00:00 2001
From: Riku <risaku@163.com>
Date: 星期四, 27 三月 2025 22:45:48 +0800
Subject: [PATCH] 修复走航融合功能bug
---
src/utils/map/dialog.js | 53 ++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 40 insertions(+), 13 deletions(-)
diff --git a/src/utils/map/dialog.js b/src/utils/map/dialog.js
index 5c1ada9..c7403eb 100644
--- a/src/utils/map/dialog.js
+++ b/src/utils/map/dialog.js
@@ -4,17 +4,14 @@
import { windDir } from '@/constant/wind-dir';
import { map } from './index_old';
import { checkboxOptions } from '@/constant/checkbox-options';
+import { useToolboxStore } from '@/stores/toolbox';
+
+const toolboxStore = useToolboxStore();
export const DialogUtil = {
- show: true,
- toggleDataDialog() {
- this.show = !this.show;
- if (this.show) {
- return '鏁版嵁寮规锛氬紑';
- } else {
- return '鏁版嵁寮规锛氬叧';
- }
- },
+ // 褰撳墠鎵撳紑鐨勫脊妗嗗強浣嶇疆鍧愭爣
+ marker: undefined,
+ lnglat: undefined,
/**
* 鍒涘缓寮瑰嚭妗�
* @param {*} factorDatas 鐩戞祴鏁版嵁
@@ -39,7 +36,7 @@
offset: new AMap.Pixel(16, -45),
autoMove: false
});
- return m.window;
+ return m;
},
/**
@@ -243,15 +240,45 @@
return info;
},
+ /**
+ * 寮�鍚竴涓柊鐨勬暟鎹脊妗�
+ * @param {String} deviceType 璁惧绫诲瀷
+ * @param {String} deviceCode 璁惧缂栧彿
+ * @param {Array} factorDatas 鐩戞祴鏁版嵁
+ * @param {Number} i 鏁版嵁绱㈠紩
+ * @param {Function} onClose 寮规鍏抽棴鍥炶皟
+ * @returns
+ */
openNewWindow(deviceType, deviceCode, factorDatas, i, onClose) {
- if (!this.show) return;
- const window = this.createInfoWindow(
+ if (!toolboxStore.dataDialogStatus) return;
+ this.marker = this.createInfoWindow(
deviceType,
deviceCode,
factorDatas,
i,
onClose
);
- window.open(map, factorDatas.lnglats_GD[i]);
+ this.marker.window.open(map, factorDatas.lnglats_GD[i]);
+ this.lnglat = factorDatas.lnglats_GD[i];
+ },
+
+ /**
+ * 鎵撳紑缂撳瓨涓殑寮规
+ */
+ openWindow() {
+ if (this.marker && this.lnglat) {
+ // this.marker.close();
+ this.marker.window.open(map, this.lnglat);
+ }
+ },
+
+ /**
+ * 鍏抽棴宸插脊鍑虹殑寮规
+ */
+ closeWindow() {
+ if (this.marker) {
+ // this.marker.close();
+ this.marker.window.close();
+ }
}
};
--
Gitblit v1.9.3