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> <div>
<el-row> <el-row>
<el-col :span="7">ICAO :</el-col> <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-row> <el-row>
<el-col :span="7">Name :</el-col> <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-row> <el-row>
<el-col :span="7">Flights :</el-col> <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-row> <el-row>
<el-col :span="7">Airlines :</el-col> <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-row> <el-row>
<el-col :span="7">Groundnet :</el-col> <el-col :span="7">Groundnet :</el-col>
@ -23,7 +23,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="7">Parking Positions :</el-col> <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> </el-row>
</div> </div>
</div> </div>
@ -32,11 +32,26 @@
<script lang="js"> <script lang="js">
export default { export default {
computed: { computed: {
airport: function () { icao: function () {
return this.$store.state.Editable.type === 'airport' 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 () { 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,7 +12,7 @@ const SET_EDIT_ARC = 'SET_EDIT_ARC'
const mutations = { const mutations = {
SET_EDIT_AIRPORT (state, airport) { SET_EDIT_AIRPORT (state, airport) {
state.data.airports[airport.icao] = airport Vue.set(state.data, 'airport', airport)
state.index = airport.icao state.index = airport.icao
state.type = 'airport' state.type = 'airport'
}, },