Edit/View Airport

This commit is contained in:
portree_kid 2020-02-14 07:38:34 +01:00
parent a06e6eab48
commit 77bb7c5ba6
2 changed files with 28 additions and 13 deletions

View File

@ -3,19 +3,19 @@
<div>
<el-row>
<el-col :span="7">ICAO :</el-col>
<el-col :span="15">{{ this.$store.state.Editable.data.airports[this.$store.state.Editable.index].icao }}</el-col>
<el-col :span="15">{{ icao }}</el-col>
</el-row>
<el-row>
<el-col :span="7">Name :</el-col>
<el-col :span="15">{{ this.$store.state.Editable.data.airports[this.$store.state.Editable.index].name }}</el-col>
<el-col :span="15">{{ name }}</el-col>
</el-row>
<el-row>
<el-col :span="7">Flights :</el-col>
<el-col :span="15">{{ this.$store.state.Editable.data.airports[this.$store.state.Editable.index].flights }}</el-col>
<el-col :span="15">{{ flights }}</el-col>
</el-row>
<el-row>
<el-col :span="7">Airlines :</el-col>
<el-col :span="15">{{ this.$store.state.Editable.data.airports[this.$store.state.Editable.index].airlines }}</el-col>
<el-col :span="15">{{ airlines }}</el-col>
</el-row>
<el-row>
<el-col :span="7">Groundnet :</el-col>
@ -23,7 +23,7 @@
</el-row>
<el-row>
<el-col :span="7">Parking Positions :</el-col>
<el-col :span="15">{{ this.$store.state.Editable.data.airports[this.$store.state.Editable.index].parking }}</el-col>
<el-col :span="15">{{ parking }}</el-col>
</el-row>
</div>
</div>
@ -32,11 +32,26 @@
<script lang="js">
export default {
computed: {
airport: function () {
return this.$store.state.Editable.type === 'airport'
icao: function () {
return this.$store.state.Editable.data.airport.icao
},
name: function () {
return this.$store.state.Editable.data.airport.name
},
flights: function () {
return this.$store.state.Editable.data.airport.flights
},
airlines: function () {
return this.$store.state.Editable.data.airport.airlines
},
groundnet: function () {
return this.$store.state.Editable.data.airports[this.$store.state.Editable.index].groundnet
return this.$store.state.Editable.data.airport.groundnet
},
parking: function () {
return this.$store.state.Editable.data.airport.parking
},
airport: function () {
return this.$store.state.Editable.type === 'airport'
}
}
}

View File

@ -12,19 +12,19 @@ const SET_EDIT_ARC = 'SET_EDIT_ARC'
const mutations = {
SET_EDIT_AIRPORT (state, airport) {
state.data.airports[airport.icao] = airport
Vue.set(state.data, 'airport', airport)
state.index = airport.icao
state.type = 'airport'
},
SET_EDIT_PARKING (state, parking) {
state.data = {}
Vue.set(state.data, 'parking', parking)
Vue.set(state.data, 'parking', parking)
state.index = parking.index
state.type = 'parking'
},
'SET_EDIT_NODE' (state, node) {
state.data = {}
Vue.set(state.data, 'node', node)
Vue.set(state.data, 'node', node)
state.index = node.index
state.type = 'node'
},
@ -38,10 +38,10 @@ const mutations = {
state.type = 'arc'
},
'SET_EDIT_PARKING_NAME' (state, parkingName) {
Vue.set(state.data.parking, 'name', parkingName)
Vue.set(state.data.parking, 'name', parkingName)
},
'SET_EDIT_ARC_NAME' (state, arcName) {
Vue.set(state.data.arc, 'name', arcName)
Vue.set(state.data.arc, 'name', arcName)
},
'SET_EDIT_PUSHBACK' (state, isPushBackRoute) {
state.data.arc.isPushBackRoute = isPushBackRoute