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,9 +18,12 @@ const uiStore = useUiStore();
const drawerOpen = ref(uiStore.drawerOpen); const drawerOpen = ref(uiStore.drawerOpen);
// store drawerOpen // store drawerOpen
watch(() => uiStore.drawerOpen, (newVal) => { watch(
drawerOpen.value = newVal; () => uiStore.drawerOpen,
}); (newVal) => {
drawerOpen.value = newVal;
}
);
const isFullScreen = ref(false); const isFullScreen = ref(false);
const mapType = ref("2D"); const mapType = ref("2D");
@ -28,24 +31,33 @@ const mapType = ref("2D");
// //
const controllers = ref([ const controllers = ref([
{ {
name: "全屏", children: [
key: "fullScreen", {
icon: isFullScreen.value ? "exitFullScreen" : "fullScreen", name: "全屏",
key: "fullScreen",
icon: isFullScreen.value ? "exitFullScreen" : "fullScreen",
},
],
}, },
{ {
name: "定位", name: "定位",
key: "positioning", key: "positioning",
icon: "iconGlobal", icon: "iconGlobal",
}, },
{ {
name: "放大", children: [
key: "zoomIn", {
icon: "zoomIn", name: "放大",
}, key: "zoomIn",
{ icon: "zoomIn",
name: "缩小", },
key: "zoomOut", {
icon: "zoomOut", name: "缩小",
key: "zoomOut",
icon: "zoomOut",
},
],
}, },
{ {
name: "3D", name: "3D",
@ -78,7 +90,6 @@ const controllers = ref([
icon: "roaming", icon: "roaming",
}, },
]); ]);
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -112,4 +123,4 @@ const controllers = ref([
} }
} }
} }
</style> </style>