Work in progress

This commit is contained in:
portree_kid 2020-04-10 13:37:49 +02:00
parent 70a0f5a7de
commit a4baeee2ea
6 changed files with 133 additions and 7 deletions

View File

@ -0,0 +1,55 @@
<template>
<div>
<span>
<el-row>
<el-col :span="6" class='text'>
{{airport.icao}}
</el-col>
<el-col :span="10" class='text'>
{{date}}
</el-col>
<el-col :span="6">
<el-button @click="goto">Goto</el-button>
</el-col>
</el-row>
</span>
</div>
</template>
<script lang="js">
/* eslint-disable */
export default {
name: 'airport',
props: {airport: Object},
mounted () {
},
data () {
return {
ok: true
}
},
methods: {
goto() {
let airports = this.$store.state.Airports.airports
.filter(a => a.properties.icao.match(this.airport.icao))
if (airports.length > 0) {
this.$store.commit('CENTER', [airports[0].geometry.coordinates[1], airports[0].geometry.coordinates[0]])
}
}
},
computed: {
date: function () {
var d = new Date(this.airport.time)
return d.toLocaleDateString() + ' ' + d.toLocaleTimeString()
}
}
}
</script>
<style scoped lang="scss">
.text {
padding: 10px;
}
</style>

View File

@ -147,7 +147,7 @@
l.bringToFront()
}
})
},
this.$store.dispatch('addWip', {icao: this.icao}); },
disableEdit () {
this.editable = false
this.editing = false

View File

@ -8,6 +8,7 @@
<li><a href="#parking" role="tab"><i class="fas fa-parking"></i></a></li>
<li><a href="#search" role="tab"><i class="fa fa-search"></i></a></li>
<li><a href="#check" role="tab"><i class="far fa-check-square"></i></a></li>
<li><a href="#wip" role="tab"><i class="fas fa-wrench"></i></a></li>
</ul>
<ul role="tablist"> <!-- bottom aligned tabs -->
@ -44,6 +45,9 @@
<div class="leaflet-sidebar-pane" id="check">
<CheckPanel></CheckPanel>
</div>
<div class="leaflet-sidebar-pane" id="wip">
<WorkInProgress></WorkInProgress>
</div>
</div>
</div>
</template>
@ -64,10 +68,11 @@
import RunScan from './RunScan'
import SettingsPanel from './SettingsPanel'
import Search from './Search'
import WorkInProgress from './WorkInProgress'
export default {
name: 'leaflet-sidebar',
components: { Help, AirportEdit, ArcEdit, CheckPanel, NodeEdit, ParkingEdit, ParkingList, RunScan, FileSelect, SettingsPanel, Search },
components: { Help, AirportEdit, ArcEdit, CheckPanel, NodeEdit, ParkingEdit, ParkingList, RunScan, FileSelect, SettingsPanel, Search, WorkInProgress },
props: [],
mounted () {
this.add()

View File

@ -59,7 +59,7 @@
console.log("File uploading completed! ");
console.log(e);
if (e.srcElement.status===500) {
parent.$refs.upload.message == e.srcElement.statusMessage
parent.$refs.upload.message == e.srcElement.statusText
} else if(JSON.parse(e.srcElement.response).message.match('[A-Z0-9]* Imported Successfully')) {
Vue.set(parent, 'uploadVisible', false)
} else if(JSON.parse(e.srcElement.response).message === 'XML Errors') {

View File

@ -0,0 +1,53 @@
<template>
<section class="work-in-progress">
<h1 class="leaflet-sidebar-header">
Work in progress
<div class="leaflet-sidebar-close"><i class="fa fa-caret-left"></i></div>
</h1>
<div>
<el-row>
<el-col :span="6" class="text">
ICAO
</el-col>
<el-col :span="10" class="text">
Edited
</el-col>
<el-col :span="6" class="text">
</el-col>
</el-row>
<el-row v-for="w in wip" :key="w.icao">
<Airport :airport="w"></Airport>
</el-row>
</div>
</section>
</template>
<script lang="js">
import Airport from './Airport'
export default {
name: 'work-in-progress',
props: [],
components: {Airport},
mounted () {
},
data () {
return {
}
},
methods: {
},
computed: {
wip: function () {
return this.$store.state.Settings.wip
}
}
}
</script>
<style scoped lang="scss">
.text {
padding: 10px;
}
</style>

View File

@ -1,8 +1,9 @@
const state = {
settings: {flightgearDirectory: '.', email: 'x'},
settings: { flightgearDirectory: '.', email: 'x' },
zoom: 14,
center: [47.413220, -1.219482],
bounds: undefined
bounds: undefined,
wip: []
}
const mutations = {
@ -27,6 +28,15 @@ const mutations = {
},
'SET_EMAIL' (state, email) {
state.settings.email = email
},
'ADD_WIP' (state, airport) {
const item = state.wip.find((e) => e.icao === airport.icao)
airport.time = Date.now()
if (item === null) {
state.wip.push(airport)
} else {
Object.assign(item, airport);
}
}
}
@ -41,6 +51,9 @@ const actions = {
},
async setBounds (context, bounds) {
context.commit('BOUNDS', bounds)
},
async addWip (context, airport) {
context.commit('ADD_WIP', airport)
}
}