mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 15:36:49 +08:00
feat 批量重新整理
This commit is contained in:
@@ -212,8 +212,10 @@ async function deleteConfirmHandler(deleteSrc: boolean, deleteDest: boolean) {
|
|||||||
async function removeHistoryBatch() {
|
async function removeHistoryBatch() {
|
||||||
if (selected.value.length === 0)
|
if (selected.value.length === 0)
|
||||||
return
|
return
|
||||||
|
// 清空当前操作记录
|
||||||
currentHistory.value = undefined
|
currentHistory.value = undefined
|
||||||
confirmTitle.value = `确认删除 ${selected.value.length} 条记录 ?`
|
confirmTitle.value = `确认删除 ${selected.value.length} 条记录 ?`
|
||||||
|
// 打开确认弹窗
|
||||||
deleteConfirmDialog.value = true
|
deleteConfirmDialog.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,8 +223,10 @@ async function removeHistoryBatch() {
|
|||||||
async function retransferBatch() {
|
async function retransferBatch() {
|
||||||
if (selected.value.length === 0)
|
if (selected.value.length === 0)
|
||||||
return
|
return
|
||||||
for (const item of selected.value)
|
// 清空当前操作记录
|
||||||
await retransfer(item)
|
currentHistory.value = undefined
|
||||||
|
// 打开识别弹窗
|
||||||
|
redoDialog.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// 调API重新整理
|
// 调API重新整理
|
||||||
@@ -257,14 +261,25 @@ async function retransfer(item: TransferHistory, redoType = '', redoTmdbId = 0)
|
|||||||
// 重新整理
|
// 重新整理
|
||||||
async function rehandleHistory() {
|
async function rehandleHistory() {
|
||||||
try {
|
try {
|
||||||
|
// 关闭弹窗
|
||||||
redoDialog.value = false
|
redoDialog.value = false
|
||||||
if (!redoTmdbId.value)
|
|
||||||
redoTmdbId.value = '0'
|
|
||||||
|
|
||||||
$toast.info(`正在重新整理 ${currentHistory.value?.title} ...`)
|
let tmdbid = 0
|
||||||
|
|
||||||
// 调用API接口重新转移
|
if (redoTmdbId.value)
|
||||||
await retransfer(currentHistory.value as TransferHistory, redoType.value, parseInt(redoTmdbId.value))
|
tmdbid = parseInt(redoTmdbId.value)
|
||||||
|
|
||||||
|
// 转移当前选中记录
|
||||||
|
if (currentHistory.value) {
|
||||||
|
$toast.info(`正在重新整理 ${currentHistory.value?.title} ...`)
|
||||||
|
await retransfer(currentHistory.value, redoType.value, tmdbid)
|
||||||
|
}
|
||||||
|
else if (selected.value.length > 0) {
|
||||||
|
for (const item of selected.value)
|
||||||
|
await retransfer(item, redoType.value, tmdbid)
|
||||||
|
}
|
||||||
|
// 批量转移
|
||||||
|
else { $toast.error('没有选中任何记录!') }
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
|
|||||||
Reference in New Issue
Block a user