2020-01-30 04:37:25 +09:00
|
|
|
<template>
|
2022-06-20 17:38:49 +09:00
|
|
|
<MkStickyContainer>
|
2023-03-16 11:56:20 +09:00
|
|
|
<template #header><MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs"/></template>
|
|
|
|
|
2023-05-19 16:20:53 +09:00
|
|
|
<MkSpacer v-if="tab === 'note'" :contentMax="800">
|
2023-05-11 18:10:34 +09:00
|
|
|
<div v-if="notesSearchAvailable">
|
|
|
|
<XNote/>
|
2023-02-25 09:01:21 +09:00
|
|
|
</div>
|
|
|
|
<div v-else>
|
2023-03-16 11:56:20 +09:00
|
|
|
<MkInfo warn>{{ i18n.ts.notesSearchNotAvailable }}</MkInfo>
|
|
|
|
</div>
|
|
|
|
</MkSpacer>
|
|
|
|
|
2023-05-19 16:20:53 +09:00
|
|
|
<MkSpacer v-else-if="tab === 'user'" :contentMax="800">
|
2023-05-11 18:10:34 +09:00
|
|
|
<XUser/>
|
2022-06-20 17:38:49 +09:00
|
|
|
</MkSpacer>
|
2023-04-24 02:37:42 +09:00
|
|
|
|
2023-06-18 04:51:25 +09:00
|
|
|
<MkSpacer v-else-if="tab === 'event'" :contentMax="800">
|
|
|
|
<XEvent/>
|
2023-04-24 02:37:42 +09:00
|
|
|
</MkSpacer>
|
2022-06-20 17:38:49 +09:00
|
|
|
</MkStickyContainer>
|
2020-01-30 04:37:25 +09:00
|
|
|
</template>
|
|
|
|
|
2022-01-13 02:21:43 +09:00
|
|
|
<script lang="ts" setup>
|
2023-06-18 06:27:42 +09:00
|
|
|
import { computed, defineAsyncComponent } from 'vue';
|
2022-01-13 02:21:43 +09:00
|
|
|
import { i18n } from '@/i18n';
|
2022-06-20 17:38:49 +09:00
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata';
|
2023-03-16 11:56:20 +09:00
|
|
|
import { $i } from '@/account';
|
|
|
|
import { instance } from '@/instance';
|
|
|
|
import MkInfo from '@/components/MkInfo.vue';
|
2020-01-30 04:37:25 +09:00
|
|
|
|
2023-05-11 18:10:34 +09:00
|
|
|
const XNote = defineAsyncComponent(() => import('./search.note.vue'));
|
|
|
|
const XUser = defineAsyncComponent(() => import('./search.user.vue'));
|
2023-06-18 04:51:25 +09:00
|
|
|
const XEvent = defineAsyncComponent(() => import('./search.event.vue'));
|
2020-01-30 04:37:25 +09:00
|
|
|
|
2023-03-16 11:56:20 +09:00
|
|
|
let tab = $ref('note');
|
|
|
|
|
|
|
|
const notesSearchAvailable = (($i == null && instance.policies.canSearchNotes) || ($i != null && $i.policies.canSearchNotes));
|
2023-02-25 09:01:21 +09:00
|
|
|
|
2022-06-20 17:38:49 +09:00
|
|
|
const headerActions = $computed(() => []);
|
|
|
|
|
2023-03-16 11:56:20 +09:00
|
|
|
const headerTabs = $computed(() => [{
|
|
|
|
key: 'note',
|
|
|
|
title: i18n.ts.notes,
|
|
|
|
icon: 'ti ti-pencil',
|
|
|
|
}, {
|
|
|
|
key: 'user',
|
|
|
|
title: i18n.ts.users,
|
|
|
|
icon: 'ti ti-users',
|
2023-04-24 02:37:42 +09:00
|
|
|
}, {
|
|
|
|
key: 'event',
|
2023-04-24 12:29:47 +09:00
|
|
|
title: i18n.ts.events,
|
2023-04-24 02:37:42 +09:00
|
|
|
icon: 'ti ti-calendar',
|
2023-03-16 11:56:20 +09:00
|
|
|
}]);
|
2022-06-20 17:38:49 +09:00
|
|
|
|
|
|
|
definePageMetadata(computed(() => ({
|
2023-05-11 18:10:34 +09:00
|
|
|
title: i18n.ts.search,
|
2022-12-19 19:01:30 +09:00
|
|
|
icon: 'ti ti-search',
|
2022-06-20 17:38:49 +09:00
|
|
|
})));
|
2020-01-30 04:37:25 +09:00
|
|
|
</script>
|