feat: 新增导入功能

This commit is contained in:
ah--desktop
2025-12-04 23:22:02 +08:00
parent e2caac2965
commit d3d9fd47d8
33 changed files with 1585 additions and 176 deletions
@@ -1,7 +1,7 @@
<script lang="ts" setup>
import type { NotificationItem } from '@vben/layouts';
import { computed, ref, watch } from 'vue';
import { computed, onMounted, ref, watch } from 'vue';
import { AuthenticationLoginExpiredModal } from '@vben/common-ui';
import { VBEN_DOC_URL, VBEN_GITHUB_URL } from '@vben/constants';
@@ -17,9 +17,10 @@ import { preferences } from '@vben/preferences';
import { useAccessStore, useUserStore } from '@vben/stores';
import { openWindow } from '@vben/utils';
import ImportTaskButton from '#/components/ImportTaskButton.vue';
import SwitchAccountModal from '#/components/SwitchAccountModal.vue';
import { $t } from '#/locales';
import { useAuthStore } from '#/store';
import { useAuthStore, useImportTaskStore } from '#/store';
import LoginForm from '#/views/_core/authentication/login.vue';
const notifications = ref<NotificationItem[]>([
@@ -56,11 +57,17 @@ const notifications = ref<NotificationItem[]>([
const userStore = useUserStore();
const authStore = useAuthStore();
const accessStore = useAccessStore();
const importTaskStore = useImportTaskStore();
const { destroyWatermark, updateWatermark } = useWatermark();
const showDot = computed(() =>
notifications.value.some((item) => !item.isRead),
);
// 初始化导入任务store
onMounted(() => {
importTaskStore.init();
});
// 切换账户模态框引用
const switchAccountModalRef = ref();
@@ -155,6 +162,9 @@ watch(
@logout="handleLogout"
/>
</template>
<template #header-right-90>
<ImportTaskButton />
</template>
<template #notification>
<Notification
:dot="showDot"