#90 add multiple airlines

This commit is contained in:
Keith Paterson
2021-01-02 19:51:22 +01:00
parent 67b2220bbe
commit 84fd39c3b5
3 changed files with 1165 additions and 412 deletions
+7 -4
View File
@@ -15,13 +15,12 @@ You should have received a copy of the GNU General Public License along with FG
<el-dialog
title="Add Airline"
:visible.sync="dialogVisible"
width="20%"
width="40%"
:before-close="handleClose">
<span>Add an selectable airline to {{ icao }} {{ name }}</span>
<el-input
placeholder="Please input airline"
placeholder="Please input airline(s)"
v-model="airlineCode"
maxlength="3"
></el-input>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">Cancel</el-button>
@@ -193,7 +192,11 @@ export default {
},
addAirline () {
this.dialogVisible = false
this.$store.dispatch('addAirline', this.airlineCode)
this.airlineCode.split(/[ ,]/).forEach(element => {
if (element.length === 3) {
this.$store.dispatch('addAirline', element)
}
})
},
addFrequency () {
this.$store.dispatch('addFrequency', {type: 'AWOS', value: 0})