From 2817417d1956a803a556148791847011332a24e5 Mon Sep 17 00:00:00 2001 From: zhangquan <2523589960@qq.com> Date: Tue, 22 Jul 2025 15:34:54 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=B0=94=E8=B1=A1=E6=95=88=E6=9E=9C=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E6=94=B9=E4=B8=BA=E5=88=87=E6=8D=A2=E7=8A=B6=E6=80=81?= =?UTF-8?q?=EF=BC=8C=E7=82=B9=E5=87=BB=E4=B8=80=E6=AC=A1=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E5=A4=A9=E6=B0=94=EF=BC=8C=E5=86=8D=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E4=B8=80=E6=AC=A1=E5=8F=96=E6=B6=88=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/icons/toolbar_sunny.png | Bin 1078 -> 0 bytes .../forestFire/Toolbar/Toolbar.vue | 38 ++++++++++++++++-- src/views/systemTemplate/forestFire/index.vue | 1 - 3 files changed, 34 insertions(+), 5 deletions(-) delete mode 100644 src/assets/icons/toolbar_sunny.png diff --git a/src/assets/icons/toolbar_sunny.png b/src/assets/icons/toolbar_sunny.png deleted file mode 100644 index b05f08bf4aaa5d18f379e71b79dada644a800851..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1078 zcmV-61j+k}P)FjFAb24Onm>Wj#iH%%;?Ir7CYF&dnVvIe=e$1OxaG`o&Y3^Nn?5)k=6v7#e9!m3 z&-=aa2wE69SC1=_g{%{-Y8FPCHB?o}dk7RD0kNCKX^Frf2@v4%5qKmX$a&hK3GDLQ zu=Zn-zoT4xKLi0okf`Z_ovKeJJ$xexe3r4~Y&qsbA;{g;?GSv*MZ>VMG9z*;ii8ni zk(2$7^hB-MtvYSe#Ssy7Q7;43OMfhZFK6jfg>jtVq9rsKE86JUBJxKwBKt!18Q;SX zw0)V+h-ahw6OoBn0%mfD>U7J)ak^(Qe_mD_omr8)<%T?&UG&jmzD=Ys_PI!*e11?h zEgsJBTRWd~#8^R$zrqKJ%mTx{;NcV(EL6dwtS#qZ;$FZzs@OoF6?~Egke-_4>u5r- zug}5(5z)M>?fia$-!CTZXJ6};-)~g&Vr&{3Po#Y;=(A*akLq0C#X-h$84wUFQ8g+g z_hZVz+7Csp4HR^7I)y8nL~cffu&#Sxz}Mx8Nqk3f&aF!eifcgq0FX(>@Tn9YwNc7CaDPJ#K%nhF*lUDni4W1UB-uw>}|OlH}<&Y~>7U(eNl~$HNJ3 z@)Aj$n&Dv8IuSQk1B0IK6V-Ke?GbMNX1LY**LdoW$q0c*S#aKuV#khnb{k1>-gs*Z zy}2uvK&dSU-kND4A7)!_m{Xkr4>w8R1_{iLbI)GYnXZRzcWms~D)L+1Sr7->2!S}9 wy6%B$0RIy(BFuUCg&H`YP0M=?r^uASJ^O^Zw1VyrWB>pF07*qoM6N<$f
@@ -310,6 +311,7 @@ const toolbarClear = () => { } }; +// 点击主工具,控制子工具栏的事件 const mainToolClick = (tool) => { // 触发工具事件 tool.name && bus.emit(`toolbar_${tool.name}`, params) @@ -327,7 +329,36 @@ const mainToolClick = (tool) => { } } +// 天气效果按钮点击事件 +const weatherSwitchClick = (name) => { + const list = options.value[2].subtools + const option = list.find(item => item.name === name) + if(option.active) { + option.active = false; + weatherParticle.destroy(); + } else { + // 取消其它天气按钮的激活状态 + list.forEach(item => { + if(item.name !== name) { + item.active = false; + } + }); + + option.active = true; + switch(name) { + case 'rain': + weatherParticle && weatherParticle.rain() + break + case 'snow': + weatherParticle && weatherParticle.snow() + break + case 'fog': + weatherParticle && weatherParticle.fog() + break + } + } +} watch(() => props.viewer, (v) => { if (v) { @@ -377,10 +408,9 @@ watch(() => props.viewer, (v) => { bus.on('toolbar_road', drawRoad); bus.on('toolbar_keyarea', drawKeyarea); // 气象效果部分 - bus.on('toolbar_sunny', () => weatherParticle && weatherParticle.destroy()) - bus.on('toolbar_rain', () => weatherParticle && weatherParticle.rain()) - bus.on('toolbar_snow', () => weatherParticle && weatherParticle.snow()) - bus.on('toolbar_fog', () => weatherParticle && weatherParticle.fog()) + bus.on('toolbar_rain', () => weatherSwitchClick('rain')) + bus.on('toolbar_snow', () => weatherSwitchClick('snow')) + bus.on('toolbar_fog', () => weatherSwitchClick('fog')) // 清空 bus.on('toolbar_clear', toolbarClear); } diff --git a/src/views/systemTemplate/forestFire/index.vue b/src/views/systemTemplate/forestFire/index.vue index 6344c7d..9817da1 100644 --- a/src/views/systemTemplate/forestFire/index.vue +++ b/src/views/systemTemplate/forestFire/index.vue @@ -40,7 +40,6 @@ const initMap = (v) => { const bus = useEventBus(viewerRef.value) // view 模式下,点击地图要素显示属性编辑弹窗 bus.onScreen(Cesium.ScreenSpaceEventType.LEFT_CLICK, ({ position }) => { - console.log('左键点击屏幕位置:', position); // 如果点击的是实体,则获取该实体的属性数据 const pickedObjectList = viewerRef.value.scene.drillPick(position); if (pickedObjectList.length > 0) {