From 1efd0a3d5bbe353a2241e42025714ff94133a800 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sat, 21 Sep 2024 17:33:32 +0800 Subject: [PATCH] fix TransferHistoryView --- src/api/constants.ts | 23 ++++++++++++++++++++ src/api/types.ts | 4 ++++ src/components/dialog/ReorganizeDialog.vue | 22 ++----------------- src/views/reorganize/TransferHistoryView.vue | 14 +++++++++++- 4 files changed, 42 insertions(+), 21 deletions(-) create mode 100644 src/api/constants.ts diff --git a/src/api/constants.ts b/src/api/constants.ts new file mode 100644 index 00000000..f78629de --- /dev/null +++ b/src/api/constants.ts @@ -0,0 +1,23 @@ +export const storageOptions = [ + { + title: '本地', + value: 'local', + }, + { + title: '阿里云盘', + value: 'alipan', + }, + { + title: '115网盘', + value: 'u115', + }, + { + title: 'Rclone网盘', + value: 'rclone', + }, +] + +export const storageDict = storageOptions.reduce((dict, item) => { + dict[item.value] = item.title + return dict +}, {} as Record) diff --git a/src/api/types.ts b/src/api/types.ts index e0d71750..86695b4a 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -71,6 +71,10 @@ export interface Subscribe { export interface TransferHistory { // ID id: number + // 源存储 + src_storage?: string + // 目标存储 + dest_storage?: string // 源目录 src?: string // 目的目录 diff --git a/src/components/dialog/ReorganizeDialog.vue b/src/components/dialog/ReorganizeDialog.vue index 6bad1e7a..ef2b7290 100644 --- a/src/components/dialog/ReorganizeDialog.vue +++ b/src/components/dialog/ReorganizeDialog.vue @@ -3,6 +3,7 @@ import { useToast } from 'vue-toast-notification' import MediaIdSelector from '../misc/MediaIdSelector.vue' import store from '@/store' import api from '@/api' +import { storageOptions } from '@/api/constants' import { numberValidator } from '@/@validators' import { useDisplay } from 'vuetify' import ProgressDialog from './ProgressDialog.vue' @@ -36,25 +37,6 @@ const seasonItems = ref( })), ) -const storageOptions = [ - { - title: '本地', - value: 'local', - }, - { - title: '阿里云盘', - value: 'alipan', - }, - { - title: '115网盘', - value: 'u115', - }, - { - title: 'Rclone网盘', - value: 'rclone', - }, -] - // 提示框 const $toast = useToast() @@ -226,7 +208,7 @@ onMounted(() => { -