mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-06-28 02:51:56 +08:00
优化文件浏览器组件,修复目录树切换逻辑
This commit is contained in:
@@ -168,7 +168,7 @@ function sortChanged(s: string) {
|
||||
|
||||
// 切换目录树
|
||||
function switchDirTree(state: boolean) {
|
||||
showDirTree.value = !state
|
||||
showDirTree.value = state
|
||||
}
|
||||
|
||||
// 文件列表
|
||||
@@ -210,18 +210,15 @@ const fileListStyle = computed(() => {
|
||||
@sortchanged="sortChanged"
|
||||
/>
|
||||
<div class="flex" :style="scrollStyle">
|
||||
<VSlideXTransition v-if="showDirTree">
|
||||
<div>
|
||||
<FileNavigator
|
||||
:storage="activeStorage"
|
||||
:currentPath="item.path"
|
||||
:items="fileListItems"
|
||||
:endpoints="endpoints"
|
||||
:axios="axios"
|
||||
@navigate="pathChanged"
|
||||
/>
|
||||
</div>
|
||||
</VSlideXTransition>
|
||||
<FileNavigator
|
||||
v-if="showDirTree"
|
||||
:storage="activeStorage"
|
||||
:currentPath="item.path"
|
||||
:items="fileListItems"
|
||||
:endpoints="endpoints"
|
||||
:axios="axios"
|
||||
@navigate="pathChanged"
|
||||
/>
|
||||
<FileList
|
||||
class="flex-grow"
|
||||
:item="item"
|
||||
|
||||
@@ -379,8 +379,8 @@ function formatTime(timestape: number) {
|
||||
}
|
||||
|
||||
// 切换文件树显示
|
||||
function switchFileTree() {
|
||||
emit('switch-tree', inProps.showTree)
|
||||
function switchFileTree(state: boolean) {
|
||||
emit('switch-tree', state)
|
||||
}
|
||||
|
||||
// 监听refreshPending变化
|
||||
@@ -549,8 +549,9 @@ onMounted(() => {
|
||||
<template>
|
||||
<VCard class="d-flex flex-column w-full h-full">
|
||||
<VToolbar v-if="!loading" density="compact" flat color="gray">
|
||||
<IconBtn>
|
||||
<VIcon :icon="showTree ? 'mdi-file-tree' : 'mdi-file-tree-outline'" @@click="switchFileTree" />
|
||||
<IconBtn v-if="display.mdAndUp.value">
|
||||
<VIcon v-if="showTree" icon="mdi-file-tree" @click="switchFileTree(false)" />
|
||||
<VIcon v-else icon="mdi-file-tree-outline" @click="switchFileTree(true)" />
|
||||
</IconBtn>
|
||||
<VTextField
|
||||
v-if="!isFile"
|
||||
|
||||
Reference in New Issue
Block a user