Edit Arc 1

This commit is contained in:
portree_kid 2020-02-10 21:09:55 +01:00
parent feb86868cb
commit 4bc6054641
9 changed files with 48 additions and 49 deletions

View File

@ -1,12 +1,4 @@
<template> <template>
<div width="100%">
<h1 class="leaflet-sidebar-header" v-if="airport">
Airport
<div class="leaflet-sidebar-close">
<i class="fa fa-caret-left"></i>
</div>
</h1>
<div width="100%" v-if="airport"> <div width="100%" v-if="airport">
<div> <div>
<el-row> <el-row>
@ -35,7 +27,6 @@
</el-row> </el-row>
</div> </div>
</div> </div>
</div>
</template> </template>
<script lang="js"> <script lang="js">

View File

@ -1,13 +1,5 @@
<template> <template>
<div>
<h1 class="leaflet-sidebar-header" v-if="arc">
Arc Properties
<div class="leaflet-sidebar-close">
<i class="fa fa-caret-left"></i>
</div>
</h1>
<div width="100%" v-if="arc"> <div width="100%" v-if="arc">
<div>
<!-- <!--
airlineCodes: 0 airlineCodes: 0
heading: 341.34 heading: 341.34
@ -27,8 +19,14 @@
<el-input placeholder="Please input" v-model="name"></el-input> <el-input placeholder="Please input" v-model="name"></el-input>
</el-col> </el-col>
</el-row> </el-row>
</div> <el-row>
</div> <el-col :span="7">
<span class="demo-input-label">Pushback :</span>
</el-col>
<el-col :span="15">
<el-switch v-model="isPushback"></el-switch>
</el-col>
</el-row>
</div> </div>
</template> </template>
@ -41,15 +39,22 @@
name: { name: {
// getter // getter
get: function () { get: function () {
return this.$store.state.Editable.data.name return this.$store.state.Editable.data.arc.name
}, },
// setter // setter
set: function (newValue) { set: function (newValue) {
this.$store.commit('SET_EDIT_PARKING_NAME', newValue) this.$store.commit('SET_EDIT_ARC_NAME', newValue)
} }
}, },
airports_directory: function () { isPushback: {
return this.$store.state.Settings.settings.airportsDirectory // getter
get: function () {
return this.$store.state.Editable.data.arc.isPushBackRoute === '1'
},
// setter
set: function (newValue) {
this.$store.commit('SET_EDIT_PUSHBACK', newValue ? '1' : '0')
}
} }
} }
} }

View File

@ -73,7 +73,8 @@
}, },
data () { data () {
return { return {
url: 'http://{s}.tile.osm.org/{z}/{x}/{y}.png', // 'http://{s}.tile.osm.org/{z}/{x}/{y}.png'
url: 'https://a.tile.openstreetmap.de/{z}/{x}/{y}.png',
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors', attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors',
marker: L.latLng(47.413220, -1.219482), marker: L.latLng(47.413220, -1.219482),
airports: this.$store.state.Airports.airports, airports: this.$store.state.Airports.airports,

View File

@ -1,12 +1,5 @@
<template> <template>
<div v-if="parking"> <div v-if="parking">
<h1 class="leaflet-sidebar-header">
Parking
<div class="leaflet-sidebar-close">
<i class="fa fa-caret-left"></i>
</div>
</h1>
<div>
<!-- <!--
airlineCodes: 0 airlineCodes: 0
heading: 341.34 heading: 341.34
@ -18,13 +11,11 @@
radius: 18 radius: 18
type: "gate" type: "gate"
--> -->
{{this.$store.state.Editable.index}}
<el-row> <el-row>
<el-col :span="7"><span class="demo-input-label">Name :</span></el-col> <el-col :span="7"><span class="demo-input-label">Name :</span></el-col>
<el-col :span="15"><el-input placeholder="Please input" v-model="name"></el-input></el-col> <el-col :span="15"><el-input placeholder="Please input" v-model="name"></el-input></el-col>
</el-row> </el-row>
</div> </div>
</div>
</template> </template>
<script lang="js"> <script lang="js">
@ -36,17 +27,13 @@
name: { name: {
// getter // getter
get: function () { get: function () {
return this.$store.state.Editable.data.parking[this.$store.state.Editable.index].name return this.$store.state.Editable.data.parking.name
}, },
// setter // setter
set: function (newValue) { set: function (newValue) {
this.$store.commit('SET_EDIT_PARKING_NAME', newValue) this.$store.commit('SET_EDIT_PARKING_NAME', newValue)
} }
},
airports_directory: function () {
return this.$store.state.Settings.settings.airportsDirectory
} }
} }
} }
</script> </script>

View File

@ -23,6 +23,10 @@
<p>A responsive sidebar for mapping libraries</p> <p>A responsive sidebar for mapping libraries</p>
</div> </div>
<div class="leaflet-sidebar-pane" id="edit"> <div class="leaflet-sidebar-pane" id="edit">
<h1 class="leaflet-sidebar-header">
Properties
<div class="leaflet-sidebar-close"><i class="fa fa-caret-left"></i></div>
</h1>
<AirportEdit></AirportEdit> <AirportEdit></AirportEdit>
<GroundnetEdit></GroundnetEdit> <GroundnetEdit></GroundnetEdit>
<ArcEdit></ArcEdit> <ArcEdit></ArcEdit>

View File

@ -1,11 +1,4 @@
<template> <template>
<div>
<h1 class="leaflet-sidebar-header" v-if="node">
Node Properties
<div class="leaflet-sidebar-close">
<i class="fa fa-caret-left"></i>
</div>
</h1>
<div width="100%" v-if="node"> <div width="100%" v-if="node">
<div> <div>
<el-row> <el-row>
@ -33,7 +26,6 @@
</el-row> </el-row>
</div> </div>
</div> </div>
</div>
</template> </template>
<script lang="js"> <script lang="js">

View File

@ -42,7 +42,14 @@ L.TaxiwaySegment = L.Polyline.extend({
this.on('click', function (event) { this.on('click', function (event) {
console.log("Click : " + event.target); console.log("Click : " + event.target);
store.default.dispatch('setArc', event.target.options.attributes); store.default.dispatch('setArc', event.target.options.attributes);
store.default.watch( function (state) {
return state.Editable.data.arc;
},
() => { console.log(this) }
,
{
deep: true //add this if u need to watch object properties change etc.
});
}); });
this.on('editable:drawing:move', function (event) { this.on('editable:drawing:move', function (event) {
console.log(event.target); console.log(event.target);

View File

@ -8,6 +8,8 @@ import { createPersistedState, createSharedMutations } from 'vuex-electron'
import modules from './modules' import modules from './modules'
Vue.use(Vuex) Vue.use(Vuex)
//https://a.tile.openstreetmap.de
//'http://{s}.tile.osm.org/{z}/{x}/{y}.png'
export default new Vuex.Store({ export default new Vuex.Store({
modules, modules,
@ -18,7 +20,7 @@ export default new Vuex.Store({
strict: process.env.NODE_ENV !== 'production', strict: process.env.NODE_ENV !== 'production',
state: { zoom: 13, state: { zoom: 13,
center: L.latLng(47.413220, -1.219482), center: L.latLng(47.413220, -1.219482),
url: 'http://{s}.tile.osm.org/{z}/{x}/{y}.png', url: 'http://{s}.tile.openstreetmap.de/{z}/{x}/{y}.png',
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors', attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors',
marker: L.latLng(47.413220, -1.219482)} marker: L.latLng(47.413220, -1.219482)}
}) })

View File

@ -26,10 +26,20 @@ const mutations = {
}, },
SET_EDIT_ARC (state, arc) { SET_EDIT_ARC (state, arc) {
state.data.arc = arc state.data.arc = arc
if (state.data.arc.name === undefined) {
state.data.arc.name = 'X'
}
state.index = arc.index
state.type = 'arc' state.type = 'arc'
}, },
'SET_EDIT_PARKING_NAME' (state, parkingName) { 'SET_EDIT_PARKING_NAME' (state, parkingName) {
state.data.name = parkingName state.data.arc.name = parkingName
},
'SET_EDIT_ARC_NAME' (state, arcName) {
state.data.arc.name = arcName
},
'SET_EDIT_PUSHBACK' (state, isPushBackRoute) {
state.data.arc.isPushBackRoute = isPushBackRoute
}, },
'SET_EDIT_HOLDPOINTTYPE' (state, holdPointType) { 'SET_EDIT_HOLDPOINTTYPE' (state, holdPointType) {
state.data.node.holdPointType = holdPointType state.data.node.holdPointType = holdPointType