Commit 65527759 authored by 郭铭瑶's avatar 郭铭瑶 🤘

接入地图功能展示社区居委小区边界

parent 6f6da9e3
...@@ -183,6 +183,8 @@ import { CaretForward, ArrowBack, ArrowForward } from '@vicons/ionicons5' ...@@ -183,6 +183,8 @@ import { CaretForward, ArrowBack, ArrowForward } from '@vicons/ionicons5'
import exportIcon from '@images/export.svg' import exportIcon from '@images/export.svg'
import dot from '@images/dot.svg' import dot from '@images/dot.svg'
const emit = defineEmits(['boundary'])
const show = computed(() => store.state.showFilterDrawer) const show = computed(() => store.state.showFilterDrawer)
const close = () => { const close = () => {
store.dispatch('getBasicInfo') store.dispatch('getBasicInfo')
...@@ -445,9 +447,16 @@ const checkPathThenFetchInfo = () => { ...@@ -445,9 +447,16 @@ const checkPathThenFetchInfo = () => {
watch( watch(
[() => curArea.value, () => curCommittee.value, () => curCommunity.value], [() => curArea.value, () => curCommittee.value, () => curCommunity.value],
() => { ([area, committee, community]) => {
checkPathThenFetchInfo() checkPathThenFetchInfo()
// TODO 地图框出边界并撒点 if (community) {
emit('boundary', { type: 'community', name: community })
} else if (committee) {
emit('boundary', { type: 'committee', name: committee })
} else if (area) {
emit('boundary', { type: 'area', name: area })
}
// TODO 地图落点
}, },
) )
</script> </script>
......
...@@ -176,6 +176,15 @@ function showCommittee(name: string) { ...@@ -176,6 +176,15 @@ function showCommittee(name: string) {
function showCommunity(name: string) { function showCommunity(name: string) {
queryBound(0, name) queryBound(0, name)
} }
defineExpose({
resetMap,
switchBM,
switchJM,
showStreet,
showArea,
showCommittee,
showCommunity,
})
// function showBuilding(name: string) { // function showBuilding(name: string) {
// window.sceneView // window.sceneView
// .whenLayerView(window.sceneLayer0) // .whenLayerView(window.sceneLayer0)
......
...@@ -95,9 +95,6 @@ ...@@ -95,9 +95,6 @@
:search-key="searchKey" :search-key="searchKey"
@select="handleSelect" @select="handleSelect"
/> />
<FilterDrawer />
<ActivityDrawer />
<StructModal />
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -106,9 +103,6 @@ import store from '@/store' ...@@ -106,9 +103,6 @@ import store from '@/store'
import { useFetchOrg, useFetchMember } from '@/hooks/useFetch' import { useFetchOrg, useFetchMember } from '@/hooks/useFetch'
import useDebounce from '@/hooks/useDebounce' import useDebounce from '@/hooks/useDebounce'
import SearchModal from './search-modal.vue' import SearchModal from './search-modal.vue'
import FilterDrawer from './filter-drawer.vue'
import ActivityDrawer from './activity-drawer.vue'
import StructModal from './struct-modal.vue'
import nav1 from '@images/nav1.svg' import nav1 from '@images/nav1.svg'
import nav2 from '@images/nav2.svg' import nav2 from '@images/nav2.svg'
import nav3 from '@images/nav3.svg' import nav3 from '@images/nav3.svg'
......
<template> <template>
<Map /> <Map ref="map" />
<NavBar @focus="showTag = false" @blur="showTag = true" /> <NavBar @focus="showTag = false" @blur="showTag = true" />
<BasicInfo :visible="showTag" /> <BasicInfo :visible="showTag" />
<div v-if="showReset" class="reset"> <div v-if="showReset" class="reset" @click="resetMap">
<n-icon class="icon" size=".14rem"> <n-icon class="icon" size=".14rem">
<svg-icon :data="reset" original /> <svg-icon :data="reset" original />
</n-icon> </n-icon>
</div> </div>
<FilterDrawer @boundary="setBoundary" />
<ActivityDrawer />
<StructModal />
<InforModal class="fix1" /> <InforModal class="fix1" />
<ListModal class="fix2" pagination /> <ListModal class="fix2" pagination />
<!-- <ActivityDetail class="fix1" /> --> <!-- <ActivityDetail class="fix1" /> -->
...@@ -17,6 +21,9 @@ import { computed, ref } from 'vue' ...@@ -17,6 +21,9 @@ import { computed, ref } from 'vue'
import Map from './components/map.vue' import Map from './components/map.vue'
import NavBar from './components/nav-bar.vue' import NavBar from './components/nav-bar.vue'
import BasicInfo from './components/basic-info.vue' import BasicInfo from './components/basic-info.vue'
import FilterDrawer from './components/filter-drawer.vue'
import ActivityDrawer from './components/activity-drawer.vue'
import StructModal from './components/struct-modal.vue'
import InforModal from './components/info-modal.vue' import InforModal from './components/info-modal.vue'
import ListModal from './components/list-modal.vue' import ListModal from './components/list-modal.vue'
import ActivityDetail from './components/activity-detail.vue' import ActivityDetail from './components/activity-detail.vue'
...@@ -25,6 +32,24 @@ import store from '@/store' ...@@ -25,6 +32,24 @@ import store from '@/store'
const showTag = ref(true) const showTag = ref(true)
const showReset = computed(() => store.state.showBasicInfo) const showReset = computed(() => store.state.showBasicInfo)
const map = ref<any>()
const resetMap = () => map.value && map.value.resetMap()
const setBoundary = ({ type, name }: { type: string; name: string }) => {
if (!map.value) return
switch (type) {
case 'community':
map.value.showCommunity(name)
break
case 'committee':
map.value.showCommittee(name)
break
case 'area':
map.value.showArea(name)
break
default:
break
}
}
</script> </script>
<style lang="stylus"> <style lang="stylus">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment