Save Dialog / Bugfixes

This commit is contained in:
portree_kid 2020-02-27 19:31:23 +01:00
parent e1bf234cbb
commit 6fe95be8f7
4 changed files with 24 additions and 8 deletions

View File

@ -9,6 +9,9 @@
<el-button type="primary" @click="undoLast">Last save</el-button> <el-button type="primary" @click="undoLast">Last save</el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="Saving" :visible.sync="saveDialogVisible" width="30%" center>
<span style="center">Saving..</span>
</el-dialog>
<EditButton icon="fas fa-save" v-on:click="save" :show="editing" tooltip="Save"></EditButton> <EditButton icon="fas fa-save" v-on:click="save" :show="editing" tooltip="Save"></EditButton>
<EditButton icon="fas fa-draw-polygon" v-on:click="drawPolyline" :show="editing" tooltip="Draw Taxiline"></EditButton> <EditButton icon="fas fa-draw-polygon" v-on:click="drawPolyline" :show="editing" tooltip="Draw Taxiline"></EditButton>
@ -18,11 +21,13 @@
</template> </template>
<script lang="js"> <script lang="js">
/* eslint-disable */
import EditButton from './EditButton' import EditButton from './EditButton'
import Vue from 'vue'
export default { export default {
components: { EditButton }, components: { EditButton },
data () { data () {
return {isEditing: false, centerDialogVisible: false} return {isEditing: false, centerDialogVisible: false, saveDialogVisible: false}
}, },
created () { created () {
}, },
@ -45,8 +50,13 @@
}, },
save () { save () {
this.editing = false this.editing = false
Vue.set(this, 'saveDialogVisible', true)
this.editing = false
Vue.nextTick( () => {
this.$parent.$parent.$refs.editLayer.save() this.$parent.$parent.$refs.editLayer.save()
this.$parent.$parent.$refs.editLayer.disableEdit() this.$parent.$parent.$refs.editLayer.disableEdit()
Vue.set(this, 'saveDialogVisible', false)
}, this)
}, },
drawPolyline () { drawPolyline () {
this.$parent.$parent.$refs.editLayer.drawPolyline() this.$parent.$parent.$refs.editLayer.drawPolyline()

View File

@ -237,7 +237,7 @@
editedArc() { editedArc() {
console.log('Edited Arc : ' + this.$store.state.Editable.index); console.log('Edited Arc : ' + this.$store.state.Editable.index);
var arc = this.groundnetLayerGroup.getLayer(this.$store.state.Editable.index); var arc = this.groundnetLayerGroup.getLayer(this.$store.state.Editable.index);
if (arc) { if (arc && arc instanceof L.Polyline) {
arc.options.attributes = Object.assign({}, this.$store.state.Editable.data.arc) arc.options.attributes = Object.assign({}, this.$store.state.Editable.data.arc)
arc.updateStyle(); arc.updateStyle();
} }

View File

@ -39,7 +39,9 @@
this.groundnet.addTo(this.$parent.mapObject) this.groundnet.addTo(this.$parent.mapObject)
} }
this.groundnet.eachLayer(l => { this.groundnet.eachLayer(l => {
if (l) {
l.bringToBack() l.bringToBack()
}
}) })
}, },
visible (feature) { visible (feature) {

View File

@ -55,10 +55,14 @@ exports.extendTaxiSegment = function (taxiwaySegment) {
}, },
() => { () => {
// Reset colour // Reset colour
if(event.target instanceof L.Polyline &&
event.target.options.attributes &&
event.target.options.attributes.selected) {
event.target.options.attributes.selected = false; event.target.options.attributes.selected = false;
event.target.updateStyle(); event.target.updateStyle();
this.unwatch(); this.unwatch();
} }
}
, ,
{ {
deep: true //add this if u need to watch object properties change etc. deep: true //add this if u need to watch object properties change etc.