2026-04-06 22:38:17 +00:00
|
|
|
<style scoped>
|
|
|
|
|
body {
|
|
|
|
|
background-color: #f8f9fa;
|
|
|
|
|
min-height: 100vh;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
body > .container-fluid {
|
|
|
|
|
flex: 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.progress-bar {
|
|
|
|
|
background-color: #0d6efd;
|
|
|
|
|
transition: width 0.3s ease;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<template>
|
|
|
|
|
<template v-if="district">
|
2026-04-07 00:04:40 +00:00
|
|
|
<router-view v-slot="{ Component }">
|
2026-04-09 17:35:00 +00:00
|
|
|
<component
|
|
|
|
|
:is="Component"
|
|
|
|
|
:district="district"
|
|
|
|
|
@doComments="doComments"
|
|
|
|
|
@doImages="doImages"
|
|
|
|
|
@doLocator="doLocator"
|
|
|
|
|
/>
|
2026-04-07 00:04:40 +00:00
|
|
|
</router-view>
|
2026-04-06 22:38:17 +00:00
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<p>loading {{ slug }}...</p>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { computed, onMounted, ref } from "vue";
|
|
|
|
|
import { computedAsync } from "@vueuse/core";
|
|
|
|
|
|
2026-04-09 17:35:00 +00:00
|
|
|
import type { Image } from "@/components/ImageUpload.vue";
|
2026-04-08 17:49:32 +00:00
|
|
|
import { useStoreDistrict } from "@/rmo/store/district";
|
2026-04-06 22:38:17 +00:00
|
|
|
import Intro from "@/rmo/content/compliance/Intro.vue";
|
|
|
|
|
import type { District } from "@/type/api";
|
2026-04-09 17:21:35 +00:00
|
|
|
import { Locator } from "@/type/map";
|
|
|
|
|
|
2026-04-06 22:38:17 +00:00
|
|
|
interface Props {
|
|
|
|
|
slug: string;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-08 17:49:32 +00:00
|
|
|
const districtStore = useStoreDistrict();
|
2026-04-06 22:38:17 +00:00
|
|
|
|
|
|
|
|
const props = defineProps<Props>();
|
|
|
|
|
const district = computedAsync(async (): Promise<District | undefined> => {
|
2026-04-08 17:49:32 +00:00
|
|
|
const districts = await districtStore.list();
|
2026-04-06 22:38:17 +00:00
|
|
|
return districts.find((district: District) => district.slug == props.slug);
|
|
|
|
|
});
|
2026-04-09 17:35:00 +00:00
|
|
|
function doComments(comments: string) {
|
|
|
|
|
console.log("comments", comments);
|
|
|
|
|
}
|
|
|
|
|
function doImages(images: Image[]) {
|
|
|
|
|
console.log("images", images);
|
|
|
|
|
}
|
2026-04-09 17:21:35 +00:00
|
|
|
function doLocator(locator: Locator | null) {
|
|
|
|
|
console.log("locator", locator);
|
|
|
|
|
}
|
2026-04-06 22:38:17 +00:00
|
|
|
</script>
|