nidus-sync/ts/view/review/Contact.vue

41 lines
1.3 KiB
Vue
Raw Normal View History

2026-05-15 17:19:06 +00:00
<template>
<ThreeColumn>
<template #left>
<ReviewContactColumnList
:contacts="contacts"
:loading="storeResource.contact.loadingAll()"
2026-05-18 23:37:59 +00:00
@selection-change="handleSelectionChange"
/>
2026-05-15 17:19:06 +00:00
</template>
<template #center>
2026-05-18 23:37:59 +00:00
<ReviewContactColumnDetail :contact="selectedContact" />
2026-05-15 17:19:06 +00:00
</template>
<template #right>
<ReviewContactColumnAction />
</template>
</ThreeColumn>
</template>
<script setup lang="ts">
2026-05-22 13:58:21 +00:00
import { onMounted, ref } from "vue";
2026-05-15 20:10:14 +00:00
import { computedAsync } from "@vueuse/core";
2026-05-15 17:19:06 +00:00
import ThreeColumn from "@/components/layout/ThreeColumn.vue";
import ReviewContactColumnAction from "@/components/ReviewContactColumnAction.vue";
import ReviewContactColumnDetail from "@/components/ReviewContactColumnDetail.vue";
import ReviewContactColumnList from "@/components/ReviewContactColumnList.vue";
2026-05-15 20:10:14 +00:00
import { useStoreResource } from "@/store/resource";
2026-05-18 23:37:59 +00:00
import { Contact } from "@/type/api";
2026-05-15 20:10:14 +00:00
const storeResource = useStoreResource();
const contacts = computedAsync(() => {
return Array.from(storeResource.contact.byURI.values());
2026-05-15 20:10:14 +00:00
});
2026-05-18 23:37:59 +00:00
const selectedContact = ref<Contact | undefined>(undefined);
const handleSelectionChange = (selection: Contact | undefined) => {
selectedContact.value = selection;
};
2026-05-22 13:58:21 +00:00
onMounted(async () => {
await storeResource.contact.fetchAll();
});
2026-05-15 17:19:06 +00:00
</script>