61 lines
1.8 KiB
Vue
61 lines
1.8 KiB
Vue
<script setup lang="ts">
|
|
/**
|
|
* features/admin/modules/wecom/WecomLayout.vue
|
|
* 企微管理壳层:二级 Tab、共享 composable、子路由出口。
|
|
*/
|
|
import { onMounted, provide } from 'vue';
|
|
import { useI18n } from 'vue-i18n';
|
|
import { RefreshCw } from 'lucide-vue-next';
|
|
import DeleteConfirmDialog from '@/shared/components/DeleteConfirmDialog.vue';
|
|
import WecomSubNav from './components/WecomSubNav.vue';
|
|
import { useWecomAdmin } from './composables/useWecomAdmin';
|
|
import { WECOM_ADMIN_KEY } from './wecom.context';
|
|
|
|
const { t } = useI18n();
|
|
const wecomAdmin = useWecomAdmin();
|
|
provide(WECOM_ADMIN_KEY, wecomAdmin);
|
|
const {
|
|
isLoading,
|
|
showDeleteConfirmDialog,
|
|
deleteConfirmMessage,
|
|
confirmDelete,
|
|
refreshWecomData,
|
|
} = wecomAdmin;
|
|
|
|
onMounted(() => {
|
|
void wecomAdmin.loadAll();
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<div v-if="isLoading" class="flex items-center justify-center py-20">
|
|
<div class="animate-spin rounded-full h-10 w-10 border-b-2 border-brand-600" />
|
|
</div>
|
|
|
|
<section v-else class="section-gap animate-fade-in-up space-y-6">
|
|
<div class="flex flex-col md:flex-row items-start md:items-center justify-between gap-4">
|
|
<div>
|
|
<h2 class="section-title">{{ t('admin.wecom.title') }}</h2>
|
|
<p class="section-desc mt-1">{{ t('admin.wecom.subtitle') }}</p>
|
|
</div>
|
|
<button
|
|
type="button"
|
|
class="btn-secondary inline-flex items-center gap-2 px-4 py-2 text-secondary rounded-xl hover-surface-soft transition-all shadow-sm"
|
|
@click="refreshWecomData()"
|
|
>
|
|
<RefreshCw class="w-4 h-4" />
|
|
{{ t('admin.wecom.refresh') }}
|
|
</button>
|
|
</div>
|
|
|
|
<WecomSubNav />
|
|
<router-view />
|
|
|
|
<DeleteConfirmDialog
|
|
v-model="showDeleteConfirmDialog"
|
|
:message="deleteConfirmMessage"
|
|
@confirm="confirmDelete"
|
|
/>
|
|
</section>
|
|
</template>
|