mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 15:36:49 +08:00
添加文件浏览器目录树切换功能,优化用户界面交互
This commit is contained in:
@@ -30,10 +30,19 @@ const inProps = defineProps({
|
||||
},
|
||||
sort: String,
|
||||
listStyle: String,
|
||||
showTree: Boolean,
|
||||
})
|
||||
|
||||
// 对外事件
|
||||
const emit = defineEmits(['loading', 'pathchanged', 'refreshed', 'filedeleted', 'renamed', 'items-updated'])
|
||||
const emit = defineEmits([
|
||||
'loading',
|
||||
'pathchanged',
|
||||
'refreshed',
|
||||
'filedeleted',
|
||||
'renamed',
|
||||
'items-updated',
|
||||
'switch-tree',
|
||||
])
|
||||
|
||||
// 确认框
|
||||
const createConfirm = useConfirm()
|
||||
@@ -369,6 +378,11 @@ function formatTime(timestape: number) {
|
||||
return new Date(timestape * 1000).toLocaleString()
|
||||
}
|
||||
|
||||
// 切换文件树显示
|
||||
function switchFileTree() {
|
||||
emit('switch-tree', inProps.showTree)
|
||||
}
|
||||
|
||||
// 监听refreshPending变化
|
||||
watch(
|
||||
() => inProps.refreshpending,
|
||||
@@ -535,6 +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>
|
||||
<VTextField
|
||||
v-if="!isFile"
|
||||
v-model="filter"
|
||||
|
||||
Reference in New Issue
Block a user