diff --git a/src/components/dialog/ReorganizeDialog.vue b/src/components/dialog/ReorganizeDialog.vue index aaaf88f2..ddedc070 100644 --- a/src/components/dialog/ReorganizeDialog.vue +++ b/src/components/dialog/ReorganizeDialog.vue @@ -249,39 +249,6 @@ function getFileName(path?: string) { return normalizedPath.split('/').pop() || normalizedPath } -// 获取目录路径 -function getDirectoryPath(path?: string) { - const normalizedPath = normalizePath(path) - if (!normalizedPath) return '' - if (normalizedPath.endsWith('/')) return normalizedPath - - const parts = normalizedPath.split('/') - parts.pop() - const joined = parts.join('/') - return joined ? `${joined}/` : '/' -} - -// 计算公共路径 -function getCommonPath(paths: string[]) { - const validPaths = paths.map(item => normalizePath(item)).filter(Boolean) - if (validPaths.length === 0) return '' - if (validPaths.length === 1) return validPaths[0] - - const splitPaths = validPaths.map(path => path.split('/')) - const commonParts: string[] = [] - - for (let index = 0; index < splitPaths[0].length; index++) { - const part = splitPaths[0][index] - if (splitPaths.every(pathParts => pathParts[index] === part)) { - commonParts.push(part) - } else { - break - } - } - - return commonParts.join('/') || '/' -} - // 获取唯一非空值 function getUniqueValues(values: (string | undefined)[]) { return [...new Set(values.map(item => item?.trim()).filter(Boolean) as string[])] @@ -324,18 +291,6 @@ function getPreviewSeasonNumber(item: ManualTransferPreviewItem) { ) } -// 顶部原始路径 -const previewSourcePath = computed(() => { - const paths = filteredPreviewItems.value.map(item => getDirectoryPath(item.source)) - return getCommonPath(paths) || '-' -}) - -// 顶部目的路径 -const previewTargetPath = computed(() => { - const targetDirs = filteredPreviewItems.value.map(item => item.target_dir || getDirectoryPath(item.target)) - return getCommonPath(targetDirs) || '-' -}) - // 顶部媒体信息 const previewMediaInfo = computed(() => { const titles = getUniqueValues(filteredPreviewItems.value.map(item => item.title)) @@ -415,11 +370,7 @@ const previewFileRows = computed(() => { // 是否需要拓宽窗口 const previewNeedsWideLayout = computed(() => { - const candidates = [ - previewSourcePath.value, - previewTargetPath.value, - ...previewFileRows.value.map(item => `${item.sourceName}${item.targetName}`), - ] + const candidates = [...previewFileRows.value.map(item => `${item.sourceName}${item.targetName}`)] return candidates.some(item => item.length > 72) }) @@ -1014,18 +965,6 @@ onUnmounted(() => { {{ previewData.message }}