【类 型】:factor
【原 因】:限飞区 禁飞区 分成两个单独的组件 【过 程】: 【影 响】: # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
bd7c6ef0d2
commit
d731a42bfa
56
src/views/layout/components/main/nofly/setNofly.vue
Normal file
56
src/views/layout/components/main/nofly/setNofly.vue
Normal file
@ -0,0 +1,56 @@
|
||||
<template>
|
||||
<div class="h-100">
|
||||
<map-box v-if="showMapbox" :key="mapboxKey" ref="mapbox" :enableNofly="true" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MapBox from '@/components/MapBox'
|
||||
|
||||
export default {
|
||||
name: 'Nofly',
|
||||
components: {
|
||||
MapBox
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
showMapbox: true, // 数据更新的时候 用于刷新地图组件
|
||||
mapboxKey: 0 // 初始化一个变量用于控制map-box组件的重新渲染
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
noflyData () {
|
||||
return this.$store.state.noflyData
|
||||
},
|
||||
isCollapse () {
|
||||
return this.$store.state.app.isCollapse
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
mounted () {
|
||||
},
|
||||
watch: {
|
||||
noflyData: {
|
||||
deep: true,
|
||||
immediate: true,
|
||||
handler () {
|
||||
this.showMapbox = false
|
||||
this.$nextTick(() => {
|
||||
this.mapboxKey++
|
||||
this.showMapbox = true
|
||||
})
|
||||
}
|
||||
},
|
||||
isCollapse (val) {
|
||||
if (val) {
|
||||
this.$refs.mapbox.handleResize()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
56
src/views/layout/components/main/nofly/setRestrictfly.vue
Normal file
56
src/views/layout/components/main/nofly/setRestrictfly.vue
Normal file
@ -0,0 +1,56 @@
|
||||
<template>
|
||||
<div class="h-100">
|
||||
<map-box v-if="showMapbox" :key="mapboxKey" ref="mapbox" :enableNofly="true" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MapBox from '@/components/MapBox'
|
||||
|
||||
export default {
|
||||
name: 'Nofly',
|
||||
components: {
|
||||
MapBox
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
showMapbox: true, // 数据更新的时候 用于刷新地图组件
|
||||
mapboxKey: 0 // 初始化一个变量用于控制map-box组件的重新渲染
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
noflyData () {
|
||||
return this.$store.state.noflyData
|
||||
},
|
||||
isCollapse () {
|
||||
return this.$store.state.app.isCollapse
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
mounted () {
|
||||
},
|
||||
watch: {
|
||||
noflyData: {
|
||||
deep: true,
|
||||
immediate: true,
|
||||
handler () {
|
||||
this.showMapbox = false
|
||||
this.$nextTick(() => {
|
||||
this.mapboxKey++
|
||||
this.showMapbox = true
|
||||
})
|
||||
}
|
||||
},
|
||||
isCollapse (val) {
|
||||
if (val) {
|
||||
this.$refs.mapbox.handleResize()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
Loading…
Reference in New Issue
Block a user