This commit is contained in:
扈兆增 2026-04-02 09:27:56 +08:00
parent 3d34172c58
commit fb76f42760

View File

@ -1,11 +1,11 @@
<template> <template>
<div class="map-controller" :style="{ right: drawerOpen ? '480px' : '12px' }"> <div class="map-controller" :style="{ right: drawerOpen ? '480px' : '12px' }">
<div class="map-controller-group"> <div class="map-controller-group" v-for="item in controllers" :key="item.key">
<div class="map-controller-item" v-for="item in controllers" :key="item.key">
<a-tooltip :title="item.name" placement="left"> <a-tooltip :title="item.name" placement="left">
<div class="map-controller-item">
<i class="icon iconfont" :class="'icon-' + item.icon"></i> <i class="icon iconfont" :class="'icon-' + item.icon"></i>
</a-tooltip>
</div> </div>
</a-tooltip>
</div> </div>
</div> </div>
</template> </template>
@ -18,25 +18,35 @@ const uiStore = useUiStore();
const drawerOpen = ref(uiStore.drawerOpen); const drawerOpen = ref(uiStore.drawerOpen);
// store drawerOpen // store drawerOpen
watch(() => uiStore.drawerOpen, (newVal) => { watch(
() => uiStore.drawerOpen,
(newVal) => {
drawerOpen.value = newVal; drawerOpen.value = newVal;
}); }
);
const isFullScreen = ref(false); const isFullScreen = ref(false);
const mapType = ref("2D"); const mapType = ref("2D");
// //
const controllers = ref([ const controllers = ref([
{
children: [
{ {
name: "全屏", name: "全屏",
key: "fullScreen", key: "fullScreen",
icon: isFullScreen.value ? "exitFullScreen" : "fullScreen", icon: isFullScreen.value ? "exitFullScreen" : "fullScreen",
}, },
],
},
{ {
name: "定位", name: "定位",
key: "positioning", key: "positioning",
icon: "iconGlobal", icon: "iconGlobal",
}, },
{
children: [
{ {
name: "放大", name: "放大",
key: "zoomIn", key: "zoomIn",
@ -47,6 +57,8 @@ const controllers = ref([
key: "zoomOut", key: "zoomOut",
icon: "zoomOut", icon: "zoomOut",
}, },
],
},
{ {
name: "3D", name: "3D",
key: "dim", key: "dim",
@ -78,7 +90,6 @@ const controllers = ref([
icon: "roaming", icon: "roaming",
}, },
]); ]);
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>