Preserve the locator model

This makes it possible to move back-and-forth in the compliance process
and still retain data.
This commit is contained in:
Eli Ribble 2026-04-09 22:22:27 +00:00
parent dbc5db9727
commit d3662b8240
No known key found for this signature in database
6 changed files with 127 additions and 81 deletions

View file

@ -10,7 +10,7 @@
Please enter the address so we can match your response with our records.
</p>
<AddressAndMapLocator v-model="locator" />
<AddressAndMapLocator v-model="modelValue.locator" />
<div class="d-flex gap-2 mt-4">
<RouterLink class="btn btn-outline-secondary" to="../compliance">
@ -31,21 +31,25 @@ import type { District } from "@/type/api";
import HeaderCompliance from "@/rmo/components/HeaderCompliance.vue";
import ProgressBarCompliance from "@/rmo/components/ProgressBarCompliance.vue";
import AddressAndMapLocator from "@/rmo/components/AddressAndMapLocator.vue";
import { Compliance } from "@/rmo/view/Compliance.vue";
import { Locator } from "@/type/map";
interface Emits {
(e: "doLocator", locator: Locator | null): void;
(e: "doLocator"): void;
(e: "update:modelValue", value: Compliance): void;
}
interface Props {
district: District;
modelValue: Compliance;
}
const emit = defineEmits<Emits>();
const error = ref<string>("");
const props = defineProps<Props>();
const locator = ref<Locator | null>(null);
function doContinue() {
emit("doLocator", locator.value);
emit("update:modelValue", props.modelValue);
emit("doLocator");
// re-add when we have the concern data to show
// router.push("./concern");
router.push("./evidence");
router.push(`/district/${props.district.slug}/compliance/evidence`);
}
</script>