Parking group selection

This commit is contained in:
portree_kid 2020-06-30 21:45:00 +02:00
parent 57b83daa51
commit 72dc611764
5 changed files with 15 additions and 13 deletions

View File

@ -45,12 +45,15 @@
export default { export default {
data () { data () {
return {activeTab: 'first', editLayer: null} return {activeTab: 'first', editing: Boolean}
}, },
components: { components: {
Frequency, ParkingList Frequency, ParkingList
}, },
methods: { methods: {
setEditing (editing) {
this.editing = editing
},
addFrequency () { addFrequency () {
this.$store.dispatch('addFrequency', {type: 'AWOS', value: 0}) this.$store.dispatch('addFrequency', {type: 'AWOS', value: 0})
}, },
@ -66,14 +69,6 @@ export default {
} }
}, },
computed: { computed: {
editing: {
get: function () {
if (this.editLayer === null) {
this.initLayer()
}
return this.editLayer !== null && this.editLayer.editing
}
},
icao: function () { icao: function () {
return this.$store.state.Airports.currentAirport.icao return this.$store.state.Airports.currentAirport.icao
}, },

View File

@ -118,8 +118,10 @@ You should have received a copy of the GNU General Public License along with FG
methods: { methods: {
onSelectedPolygon (ring) { onSelectedPolygon (ring) {
var parkings = this.$refs.editLayer.getParkings(ring) var parkings = this.$refs.editLayer.getParkings(ring)
console.log(ring) console.debug(ring)
console.log(parkings) console.debug(parkings)
this.$store.commit('SET_EDIT_TYPE', 'parking-group')
this.$refs.sidebar.setData(parkings) this.$refs.sidebar.setData(parkings)
}, },
onEdit (event) { onEdit (event) {

View File

@ -40,7 +40,7 @@ You should have received a copy of the GNU General Public License along with FG
<ArcEdit></ArcEdit> <ArcEdit></ArcEdit>
<NodeEdit></NodeEdit> <NodeEdit></NodeEdit>
<ParkingGroupEdit ref="parkingGroupEdit" @edit="(msg) => $emit('edit', msg)"></ParkingGroupEdit> <ParkingGroupEdit ref="parkingGroupEdit" @edit="(msg) => $emit('edit', msg)"></ParkingGroupEdit>
<AirportEdit></AirportEdit> <AirportEdit ref="airportEdit"></AirportEdit>
</div> </div>
<!-- <!--
<div class="leaflet-sidebar-pane" id="parking"> <div class="leaflet-sidebar-pane" id="parking">
@ -137,6 +137,7 @@ You should have received a copy of the GNU General Public License along with FG
}, },
setEditing (editing) { setEditing (editing) {
this.$refs.parkingGroupEdit.setEditing(editing) this.$refs.parkingGroupEdit.setEditing(editing)
this.$refs.airportEdit.setEditing(editing)
}, },
setData (data) { setData (data) {
if (data.length > 0) { if (data.length > 0) {

View File

@ -175,7 +175,8 @@ const convert = require('geo-coordinates-parser');
}, },
computed: { computed: {
parking: function () { parking: function () {
return this.data !== null return this.data !== null && this.$store.state.Editable.type === 'parking-group'
}, },
airlines: function () { airlines: function () {
var airlineCodes = []; var airlineCodes = [];

View File

@ -13,6 +13,9 @@ const SET_EDIT_ARC = 'SET_EDIT_ARC'
const SET_EDIT_RUNWAY = 'SET_EDIT_RUNWAY' const SET_EDIT_RUNWAY = 'SET_EDIT_RUNWAY'
const mutations = { const mutations = {
SET_EDIT_TYPE (state, type) {
state.type = type
},
SET_EDIT (state, editing) { SET_EDIT (state, editing) {
state.editing = editing state.editing = editing
}, },