Skip to content

Commit 0e5f595

Browse files
author
Taois
committed
feat: 书画柜支持本地图书的删除和阅读
1 parent cb3c597 commit 0e5f595

File tree

10 files changed

+1987
-47
lines changed

10 files changed

+1987
-47
lines changed

dashboard/src/components/downloader/DownloadTaskItem.vue

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,29 @@
110110
</a-button-group>
111111

112112
<a-button-group v-else-if="task.status === 'completed'">
113-
<a-button size="small" type="primary" @click="$emit('export', task.id)">
114-
<template #icon>
115-
<icon-download />
113+
<a-dropdown @select="handleExportSelect">
114+
<a-button size="small" type="primary">
115+
<template #icon>
116+
<icon-download />
117+
</template>
118+
导出
119+
<icon-down />
120+
</a-button>
121+
<template #content>
122+
<a-doption value="download">
123+
<template #icon>
124+
<icon-download />
125+
</template>
126+
下载TXT文件
127+
</a-doption>
128+
<a-doption value="gallery">
129+
<template #icon>
130+
<icon-book />
131+
</template>
132+
导出到书画柜
133+
</a-doption>
116134
</template>
117-
导出TXT
118-
</a-button>
135+
</a-dropdown>
119136
<a-button size="small" @click="$emit('delete', task.id)">
120137
<template #icon>
121138
<icon-delete />
@@ -164,7 +181,8 @@ import {
164181
IconList,
165182
IconDown,
166183
IconUp,
167-
IconExclamationCircleFill
184+
IconExclamationCircleFill,
185+
IconBook
168186
} from '@arco-design/web-vue/es/icon'
169187
170188
// Props
@@ -176,7 +194,7 @@ const props = defineProps({
176194
})
177195
178196
// Emits
179-
defineEmits([
197+
const emit = defineEmits([
180198
'retry',
181199
'pause',
182200
'resume',
@@ -240,6 +258,15 @@ const toggleDetails = () => {
240258
showDetails.value = !showDetails.value
241259
}
242260
261+
// 处理导出选择
262+
const handleExportSelect = (value) => {
263+
if (value === 'download') {
264+
emit('export', props.task.id, { exportToGallery: false })
265+
} else if (value === 'gallery') {
266+
emit('export', props.task.id, { exportToGallery: true })
267+
}
268+
}
269+
243270
const formatTime = (timestamp) => {
244271
if (!timestamp) return '-'
245272
return new Date(timestamp).toLocaleString('zh-CN')

dashboard/src/components/downloader/NovelDownloader.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ const handleDeleteTask = (taskId) => {
180180
Message.success('下载任务已删除')
181181
}
182182
183-
const handleExportTask = (taskId) => {
184-
downloadStore.exportTask(taskId)
183+
const handleExportTask = async (taskId, options = {}) => {
184+
await downloadStore.exportTask(taskId, options)
185185
}
186186
187187
const handleViewChapters = (task) => {

0 commit comments

Comments
 (0)