Parking List
This commit is contained in:
parent
d5f68613a1
commit
bf59d025f6
26
src/renderer/components/ParkingItem.vue
Normal file
26
src/renderer/components/ParkingItem.vue
Normal file
@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<el-link type="primary" @click="show(parking.index)">{{parking.name}}{{parking.number}}</el-link>
|
||||
</template>
|
||||
|
||||
<script lang="js">
|
||||
export default {
|
||||
name: 'parking-item',
|
||||
props: {parking: Object},
|
||||
mounted () {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
show (idx) {
|
||||
this.$parent.$parent.$parent.$parent.$parent.$refs.editLayer.show(idx)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
</style>
|
@ -7,27 +7,21 @@
|
||||
</div>
|
||||
</h1>
|
||||
<el-container direction="vertical">
|
||||
<el-row>
|
||||
<li v-for="p in parkings" v-bind:key="p.index">
|
||||
<el-link type="primary" @click="show(p.index)">{{p.name}} {{p.number}}</el-link>
|
||||
<ParkingItem :parking="p"></ParkingItem>
|
||||
</li>
|
||||
</el-row>
|
||||
</el-container>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="js">
|
||||
import ParkingItem from './ParkingItem'
|
||||
export default {
|
||||
name: 'parking-list',
|
||||
components: {ParkingItem},
|
||||
props: [],
|
||||
data () {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
show (idx) {
|
||||
this.$parent.$parent.$parent.$refs.editLayer.show(idx)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -35,13 +29,7 @@
|
||||
// getter
|
||||
get: function () {
|
||||
if (this.$store.state.Parkings.items !== undefined) {
|
||||
return this.$store.state.Parkings.items.sort((p1, p2) => {
|
||||
if (p1.name === p2.name) {
|
||||
return p1.number.localeCompare(p2.number)
|
||||
} else {
|
||||
return p1.name.localeCompare(p2.name)
|
||||
}
|
||||
})
|
||||
return this.$store.state.Parkings.items
|
||||
}
|
||||
},
|
||||
// setter
|
||||
|
@ -102,10 +102,10 @@ exports.readGroundnetXML = function (fDir, icao, force) {
|
||||
}).sort();
|
||||
|
||||
store.default.dispatch('setParkings', parkingNodes.map(
|
||||
p => ({index: Number(p.attrs.index), name: String(p.attrs.name), number: String(p.attrs.number)}
|
||||
p => ({index: Number(p.attrs.index), name: String(p.attrs.name), number: Number(p.attrs.number)}
|
||||
)).sort((p1, p2) => {
|
||||
if (p1.name === p2.name) {
|
||||
return p1.number.localeCompare(p2.number)
|
||||
return p1.number - p2.number
|
||||
} else {
|
||||
return p1.name.localeCompare(p2.name)
|
||||
}}));
|
||||
|
Loading…
Reference in New Issue
Block a user