mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 05:49:20 +08:00
40 lines
1.0 KiB
Vue
40 lines
1.0 KiB
Vue
<script setup lang="ts">
|
|
import { computed } from 'vue';
|
|
|
|
import { createIconifyIcon } from '@vben/icons';
|
|
|
|
import { Button } from 'ant-design-vue';
|
|
|
|
import { useImportTaskStore } from '#/store';
|
|
|
|
import ImportTaskDropdown from './ImportTaskDropdown.vue';
|
|
|
|
defineOptions({ name: 'ImportTaskButton' });
|
|
|
|
// 创建下载图标组件
|
|
const DownloadIcon = createIconifyIcon('lucide:download');
|
|
|
|
const importTaskStore = useImportTaskStore();
|
|
|
|
// 计算属性:是否有进行中的任务
|
|
const hasActiveTasks = computed(() => importTaskStore.hasActiveTasks);
|
|
</script>
|
|
|
|
<template>
|
|
<ImportTaskDropdown>
|
|
<template #trigger>
|
|
<div class="flex-center mr-2 h-full">
|
|
<Button type="text" shape="circle" class="relative">
|
|
<template #icon>
|
|
<DownloadIcon class="size-4" />
|
|
</template>
|
|
<span
|
|
v-if="hasActiveTasks"
|
|
class="bg-primary absolute right-0.5 top-0.5 h-2 w-2 rounded"
|
|
></span>
|
|
</Button>
|
|
</div>
|
|
</template>
|
|
</ImportTaskDropdown>
|
|
</template>
|