-
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.
feat: updated domain, geo search, geotiff (#80)
* feat: added building element materials #56 (wip) * feat: save building element materials #56 * fix: epfl push deploy action version added * feat: more building element relations * feat: display addresses * fix: styling * feat: search docs within a bounding box * fix: reset bounding box on search page display * fix: map features not depending on bbox filter * fix: no results position * feat: heatmap added using titiler (wip) * feat: added toggle to show/hide heatmap of straw fields
- Loading branch information
Showing
31 changed files
with
1,175 additions
and
79 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
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,99 @@ | ||
<template> | ||
<div> | ||
<q-select | ||
filled | ||
v-model="entity.building_material_id" | ||
:options="buildingMaterialsOptions" | ||
map-options | ||
emit-value | ||
clearable | ||
:label="$t('building_material')" | ||
:hint="$t('building_element_building_material_used_hint')" | ||
class="q-mb-md" | ||
@update:model-value="onBuildingMaterialChange" | ||
/> | ||
<div class="row q-col-gutter-lg"> | ||
<div class="col"> | ||
<q-input | ||
v-model.number="entity.distance" | ||
type="number" | ||
filled | ||
min="0" | ||
:disable="!entity.building_material_id" | ||
:label="$t('distance')" | ||
:hint="$t('building_element_building_material_distance_hint')" | ||
/> | ||
</div> | ||
<div class="col"> | ||
<q-input | ||
v-model.number="entity.weight" | ||
type="number" | ||
filled | ||
min="0" | ||
:disable="!entity.building_material_id" | ||
:label="$t('weight')" | ||
:hint="$t('building_element_building_material_weight_hint')" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
export default defineComponent({ | ||
name: 'BuildingElementMaterialForm', | ||
}); | ||
</script> | ||
<script setup lang="ts"> | ||
import { BuildingElementMaterial, TechnicalConstruction } from 'src/models'; | ||
import { OptionNumber } from './models'; | ||
const services = useServices(); | ||
const tcService = services.make('technical-construction'); | ||
interface Props { | ||
modelValue: BuildingElementMaterial; | ||
technicalContructionId: number; | ||
} | ||
const props = defineProps<Props>(); | ||
const entity = ref(props.modelValue); | ||
const buildingMaterialsOptions = ref<OptionNumber[]>([]); | ||
onMounted(() => { | ||
initBuildingMaterialsOptions(); | ||
}); | ||
watch([() => props.modelValue, () => props.technicalContructionId], () => { | ||
entity.value = props.modelValue; | ||
initBuildingMaterialsOptions(); | ||
}); | ||
function initBuildingMaterialsOptions() { | ||
buildingMaterialsOptions.value = []; | ||
if (!props.technicalContructionId) { | ||
return; | ||
} | ||
tcService.get(props.technicalContructionId).then((response: TechnicalConstruction) => { | ||
buildingMaterialsOptions.value = | ||
response.building_materials?.map( | ||
(bm) => | ||
({ | ||
label: bm.name, | ||
value: bm.id, | ||
}) as OptionNumber, | ||
) || []; | ||
if (!entity.value.building_material_id) { | ||
entity.value.building_material_id = buildingMaterialsOptions.value[0]?.value; | ||
} | ||
}); | ||
} | ||
function onBuildingMaterialChange() { | ||
if (entity.value.building_material_id === undefined) { | ||
entity.value.distance = undefined; | ||
entity.value.weight = undefined; | ||
} | ||
} | ||
</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
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
Oops, something went wrong.