mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 09:17:08 +00:00
Enable the ‘view on map’ log action item.
This commit is contained in:
@@ -267,15 +267,15 @@
|
||||
<!-- Actions column (FIXME currently not used) -->
|
||||
<template v-slot:item.actions="{ item }">
|
||||
<div style="white-space:nowrap;">
|
||||
<v-icon v-if="$root.user || true"
|
||||
small
|
||||
class="mr-2"
|
||||
title="View on map"
|
||||
@click="viewOnMap(item)"
|
||||
disabled
|
||||
>
|
||||
mdi-map
|
||||
</v-icon>
|
||||
<a :href="viewOnMap(item)" v-if="viewOnMap(item)">
|
||||
<v-icon v-if="$root.user || true"
|
||||
small
|
||||
class="mr-2"
|
||||
title="View on map"
|
||||
>
|
||||
mdi-map
|
||||
</v-icon>
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -746,6 +746,15 @@ export default {
|
||||
item.items.some( i => i.labels.some( l => l.toLowerCase().includes(s) ));
|
||||
}
|
||||
},
|
||||
|
||||
viewOnMap(row) {
|
||||
if (row && row.items && row.items.length) {
|
||||
if (row.items[0].geometry && row.items[0].geometry.type == "Point") {
|
||||
const [ lon, lat ] = row.items[0].geometry.coordinates;
|
||||
return `map#15/${lon.toFixed(6)}/${lat.toFixed(6)}`;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
...mapActions(["api", "showSnack"])
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user