mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-07-12 16:01:35 +08:00
fix ui
This commit is contained in:
@@ -26,6 +26,9 @@ const emit = defineEmits(['loading', 'pathchanged', 'refreshed', 'filedeleted',
|
|||||||
// 提示框
|
// 提示框
|
||||||
const $toast = useToast()
|
const $toast = useToast()
|
||||||
|
|
||||||
|
// 是否正在加载
|
||||||
|
const loading = ref(true)
|
||||||
|
|
||||||
// 确认框
|
// 确认框
|
||||||
const createConfirm = useConfirm()
|
const createConfirm = useConfirm()
|
||||||
|
|
||||||
@@ -101,6 +104,7 @@ const isImage = computed(() => {
|
|||||||
|
|
||||||
// 调API加载内容
|
// 调API加载内容
|
||||||
async function load() {
|
async function load() {
|
||||||
|
loading.value = true
|
||||||
emit('loading', true)
|
emit('loading', true)
|
||||||
if (isDir.value) {
|
if (isDir.value) {
|
||||||
const url = inProps.endpoints?.list.url
|
const url = inProps.endpoints?.list.url
|
||||||
@@ -115,6 +119,7 @@ async function load() {
|
|||||||
items.value = await axiosInstance.value.request(config) ?? []
|
items.value = await axiosInstance.value.request(config) ?? []
|
||||||
}
|
}
|
||||||
emit('loading', false)
|
emit('loading', false)
|
||||||
|
loading.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除项目
|
// 删除项目
|
||||||
@@ -295,6 +300,16 @@ onMounted(() => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VCard class="d-flex flex-column">
|
<VCard class="d-flex flex-column">
|
||||||
|
<VCardText
|
||||||
|
v-if="loading"
|
||||||
|
class="text-center flex flex-col items-center"
|
||||||
|
>
|
||||||
|
<VProgressCircular
|
||||||
|
size="48"
|
||||||
|
indeterminate
|
||||||
|
color="primary"
|
||||||
|
/>
|
||||||
|
</VCardText>
|
||||||
<VCardText
|
<VCardText
|
||||||
v-if="!path"
|
v-if="!path"
|
||||||
class="grow d-flex justify-center align-center grey--text"
|
class="grow d-flex justify-center align-center grey--text"
|
||||||
@@ -424,13 +439,13 @@ onMounted(() => {
|
|||||||
没有目录或文件
|
没有目录或文件
|
||||||
</VCardText>
|
</VCardText>
|
||||||
<VCardText
|
<VCardText
|
||||||
v-else
|
v-else-if="!loading"
|
||||||
class="grow d-flex justify-center align-center grey--text py-5"
|
class="grow d-flex justify-center align-center grey--text py-5"
|
||||||
>
|
>
|
||||||
空目录
|
空目录
|
||||||
</VCardText>
|
</VCardText>
|
||||||
<VDivider v-if="path" />
|
<VDivider v-if="path" />
|
||||||
<VToolbar density="compact" flat color="gray">
|
<VToolbar v-if="!loading" density="compact" flat color="gray">
|
||||||
<VTextField
|
<VTextField
|
||||||
v-if="!isFile"
|
v-if="!isFile"
|
||||||
v-model="filter"
|
v-model="filter"
|
||||||
|
|||||||
Reference in New Issue
Block a user