2026-04-07 00:04:40 +00:00
|
|
|
<template>
|
|
|
|
|
<div class="container-fluid px-3 py-3">
|
|
|
|
|
<HeaderCompliance :district="district" />
|
|
|
|
|
<!-- Progress Bar -->
|
|
|
|
|
<ProgressBarCompliance :step="2" />
|
|
|
|
|
<main>
|
|
|
|
|
<h2 class="h4 mb-3">Confirm the property address</h2>
|
|
|
|
|
|
|
|
|
|
<p class="text-muted mb-4">
|
|
|
|
|
Please enter the address so we can match your response with our records.
|
|
|
|
|
</p>
|
|
|
|
|
|
2026-04-27 19:40:24 +00:00
|
|
|
<AddressAndMapLocator :initialCamera="initialCamera" v-model="locator" />
|
2026-04-07 00:04:40 +00:00
|
|
|
|
2026-04-09 17:21:35 +00:00
|
|
|
<div class="d-flex gap-2 mt-4">
|
2026-04-22 14:49:04 +00:00
|
|
|
<RouterLink
|
|
|
|
|
class="btn btn-outline-secondary"
|
|
|
|
|
:to="routes.ComplianceIntro(props.publicID)"
|
|
|
|
|
>
|
2026-04-09 17:21:35 +00:00
|
|
|
Back
|
|
|
|
|
</RouterLink>
|
2026-04-29 22:27:08 +00:00
|
|
|
<ButtonLoading
|
|
|
|
|
class="flex-grow-1"
|
|
|
|
|
@click="doContinue"
|
|
|
|
|
icon="bi-caret-right-fill"
|
|
|
|
|
:loading="isUploading"
|
|
|
|
|
text="Continue"
|
|
|
|
|
/>
|
2026-04-09 17:21:35 +00:00
|
|
|
</div>
|
2026-04-07 00:04:40 +00:00
|
|
|
</main>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
2026-04-27 19:40:24 +00:00
|
|
|
import { computed, onMounted, ref } from "vue";
|
2026-04-09 17:24:50 +00:00
|
|
|
|
2026-04-22 14:31:05 +00:00
|
|
|
import { router } from "@/rmo/route/config";
|
2026-04-13 15:16:22 +00:00
|
|
|
import type { District, PublicReportCompliance } from "@/type/api";
|
2026-04-07 00:04:40 +00:00
|
|
|
import HeaderCompliance from "@/rmo/components/HeaderCompliance.vue";
|
2026-04-29 22:27:08 +00:00
|
|
|
import ButtonLoading from "@/components/common/ButtonLoading.vue";
|
2026-04-07 00:04:40 +00:00
|
|
|
import ProgressBarCompliance from "@/rmo/components/ProgressBarCompliance.vue";
|
2026-04-09 17:21:35 +00:00
|
|
|
import AddressAndMapLocator from "@/rmo/components/AddressAndMapLocator.vue";
|
2026-04-27 19:40:24 +00:00
|
|
|
import { Camera, Locator } from "@/type/map";
|
2026-04-22 14:49:04 +00:00
|
|
|
import { useRoutes } from "@/rmo/route/use";
|
2026-04-09 22:22:27 +00:00
|
|
|
|
2026-04-09 17:21:35 +00:00
|
|
|
interface Emits {
|
2026-04-10 16:59:29 +00:00
|
|
|
(e: "doAddress"): void;
|
2026-04-13 15:16:22 +00:00
|
|
|
(e: "update:modelValue", value: PublicReportCompliance): void;
|
2026-04-09 17:21:35 +00:00
|
|
|
}
|
2026-04-07 00:04:40 +00:00
|
|
|
interface Props {
|
|
|
|
|
district: District;
|
2026-04-29 22:27:08 +00:00
|
|
|
isUploading: boolean;
|
2026-04-13 15:16:22 +00:00
|
|
|
modelValue: PublicReportCompliance;
|
2026-04-22 14:49:04 +00:00
|
|
|
publicID: string;
|
2026-04-07 00:04:40 +00:00
|
|
|
}
|
2026-04-09 17:21:35 +00:00
|
|
|
const emit = defineEmits<Emits>();
|
2026-04-27 19:40:24 +00:00
|
|
|
|
2026-04-09 17:21:35 +00:00
|
|
|
const error = ref<string>("");
|
2026-04-27 19:40:24 +00:00
|
|
|
const locator = ref<Locator>(new Locator());
|
2026-04-07 00:04:40 +00:00
|
|
|
const props = defineProps<Props>();
|
2026-04-10 14:20:04 +00:00
|
|
|
const initialCamera = computed((): Camera | undefined => {
|
|
|
|
|
if (props.modelValue.location) {
|
|
|
|
|
return {
|
|
|
|
|
location: props.modelValue.location,
|
|
|
|
|
zoom: 15,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
return undefined;
|
|
|
|
|
});
|
2026-04-22 14:49:04 +00:00
|
|
|
const routes = useRoutes();
|
2026-04-09 17:21:35 +00:00
|
|
|
function doContinue() {
|
2026-04-27 19:40:24 +00:00
|
|
|
props.modelValue.address = locator.value.address;
|
|
|
|
|
props.modelValue.location = locator.value.location;
|
2026-04-09 22:22:27 +00:00
|
|
|
emit("update:modelValue", props.modelValue);
|
2026-04-10 16:59:29 +00:00
|
|
|
emit("doAddress");
|
2026-04-22 21:22:03 +00:00
|
|
|
if (props.modelValue.concerns.length > 0) {
|
|
|
|
|
router.push(routes.ComplianceConcern(props.publicID));
|
|
|
|
|
} else {
|
|
|
|
|
router.push(routes.ComplianceEvidence(props.publicID));
|
|
|
|
|
}
|
2026-04-09 17:21:35 +00:00
|
|
|
}
|
2026-04-27 19:40:24 +00:00
|
|
|
onMounted(() => {
|
|
|
|
|
locator.value.address = props.modelValue.address;
|
|
|
|
|
});
|
2026-04-07 00:04:40 +00:00
|
|
|
</script>
|