-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #212 from SpeciesFileGroup/development
Add map popup for DwC data
- Loading branch information
Showing
11 changed files
with
201 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export const DISABLE_LAYER_OPTIONS = { | ||
allowEditing: false, | ||
allowRemoval: false, | ||
allowCutting: false, | ||
allowRotation: false, | ||
draggable: false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './disableLayerOptions' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const TYPE_MATERIAL = 'TypeMaterial' | ||
export const COLLECTION_OBJECT = 'CollectionObject' | ||
export const ASSERTED_DISTRIBUTION = 'AssertedDistribution' | ||
export const GEOREFERENCE = 'Georeference' | ||
export const AGGREGATE = 'Aggregate' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
src/modules/otus/components/Panel/PanelMap/components/DwcTable.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<template> | ||
<VModal | ||
v-if="isModalVisible" | ||
@close="() => (isModalVisible = false)" | ||
> | ||
<template #header> | ||
<h3 class="font-medium">{{ title }}</h3> | ||
</template> | ||
<VTable class="p-4 pt-0"> | ||
<VTableHeader> | ||
<VTableHeaderRow> | ||
<VTableHeaderCell>Field</VTableHeaderCell> | ||
<VTableHeaderCell>Value</VTableHeaderCell> | ||
</VTableHeaderRow> | ||
</VTableHeader> | ||
<VTableBody> | ||
<VTableBodyRow | ||
v-for="(value, key) in dwcData" | ||
:key="key" | ||
> | ||
<VTableBodyCell>{{ key }} </VTableBodyCell> | ||
<VTableBodyCell>{{ value }} </VTableBodyCell> | ||
</VTableBodyRow> | ||
</VTableBody> | ||
</VTable> | ||
<VSpinner v-if="isLoading" /> | ||
</VModal> | ||
</template> | ||
|
||
<script setup> | ||
import { ref } from 'vue' | ||
import { makeAPIRequest } from '@/utils' | ||
const isLoading = ref(false) | ||
const isModalVisible = ref(false) | ||
const dwcData = ref({}) | ||
const title = ref() | ||
function show({ label, id }) { | ||
isModalVisible.value = true | ||
isLoading.value = true | ||
dwcData.value = {} | ||
title.value = label | ||
makeAPIRequest(`/collection_objects/${id}/dwc`) | ||
.then(({ data }) => { | ||
dwcData.value = data | ||
}) | ||
.catch(() => {}) | ||
.finally(() => { | ||
isLoading.value = false | ||
}) | ||
} | ||
defineExpose({ | ||
show | ||
}) | ||
</script> |
32 changes: 32 additions & 0 deletions
32
src/modules/otus/components/Panel/PanelMap/components/MapPopup.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<template> | ||
<div class="max-h-32 overflow-y-auto text-xs min-w-80"> | ||
<ul> | ||
<li | ||
v-for="item in items" | ||
class="py-2 last:border-0 truncate border-b" | ||
title="label" | ||
> | ||
<span | ||
v-if="item.type === COLLECTION_OBJECT" | ||
class="cursor-pointer text-secondary-color" | ||
v-text="item.label" | ||
@click="() => emit('selected', item)" | ||
/> | ||
<span v-else>{{ item.label }}</span> | ||
</li> | ||
</ul> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { COLLECTION_OBJECT } from '@/constants/objectTypes.js' | ||
defineProps({ | ||
items: { | ||
type: Array, | ||
required: true | ||
} | ||
}) | ||
const emit = defineEmits(['selected']) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.