mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-22 00:39:43 +08:00
Refactor page titles and dialog close buttons across multiple views
- Replaced instances of `DialogCloseBtn` with `VDialogCloseBtn` in TransferHistoryView, AccountSettingAbout, AccountSettingSystem, and UserProfileView for consistency. - Introduced a new component `PageContentTitle` to standardize page titles in SiteCardListView, SubscribeListView, UserListView, and WorkflowListView, improving layout and readability. - Added keyword filtering functionality in SubscribeListView and SubscribeShareView to enhance user experience during searches. - Added a new site logo image to the assets.
This commit is contained in:
@@ -27,16 +27,7 @@ function getApiPath(paths: string[] | string) {
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="title" class="my-3 md:flex md:items-center md:justify-between">
|
||||
<div class="min-w-0 flex-1 mx-0">
|
||||
<h2
|
||||
class="ms-1 truncate text-2xl font-bold leading-7 text-gray-100 sm:overflow-visible sm:text-3xl sm:leading-9 md:mb-0"
|
||||
data-testid="page-header"
|
||||
>
|
||||
<span class="text-moviepilot">{{ title }}</span>
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
<VPageContentTitle :title="title" />
|
||||
<PersonCardListView v-if="type === 'person'" :apipath="getApiPath(props.paths || '')" :params="route.query" />
|
||||
<MediaCardListView v-else :apipath="getApiPath(props.paths || '')" :params="route.query" />
|
||||
<VScrollToTopBtn />
|
||||
|
||||
@@ -18,26 +18,14 @@ const type = route.query?.type?.toString()
|
||||
|
||||
// 计算API路径
|
||||
function getApiPath(paths: string[] | string) {
|
||||
if (Array.isArray(paths))
|
||||
return paths.join('/')
|
||||
else
|
||||
return paths
|
||||
if (Array.isArray(paths)) return paths.join('/')
|
||||
else return paths
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="title" class="mt-3 md:flex md:items-center md:justify-between">
|
||||
<div class="min-w-0 flex-1 mx-0">
|
||||
<h2 class="mb-4 truncate text-2xl font-bold leading-7 text-gray-100 sm:overflow-visible sm:text-4xl sm:leading-9 md:mb-0" data-testid="page-header">
|
||||
<span class="text-moviepilot">{{ title }}</span>
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
<PersonCardListView
|
||||
:apipath="getApiPath(props.paths || '')"
|
||||
:params="route.query"
|
||||
:type="type"
|
||||
/>
|
||||
<VPageContentTitle :title="title" />
|
||||
<PersonCardListView :apipath="getApiPath(props.paths || '')" :params="route.query" :type="type" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -347,7 +347,7 @@ onDeactivated(() => {
|
||||
<VIcon icon="mdi-tune" size="small" class="me-2" />
|
||||
设置仪表板
|
||||
</VCardTitle>
|
||||
<DialogCloseBtn @click="dialog = false" />
|
||||
<VDialogCloseBtn @click="dialog = false" />
|
||||
</VCardItem>
|
||||
<VDivider />
|
||||
<VCardText>
|
||||
|
||||
@@ -135,7 +135,7 @@ onActivated(async () => {
|
||||
<VBtn
|
||||
icon="mdi-order-alphabetical-ascending"
|
||||
variant="text"
|
||||
color="primary"
|
||||
color="grey"
|
||||
size="default"
|
||||
class="settings-icon-button"
|
||||
@click="orderConfigDialog = true"
|
||||
@@ -181,7 +181,7 @@ onActivated(async () => {
|
||||
<VIcon icon="mdi-order-alphabetical-ascending" size="small" class="me-2" />
|
||||
设置标签顺序
|
||||
</VCardTitle>
|
||||
<DialogCloseBtn @click="orderConfigDialog = false" />
|
||||
<VDialogCloseBtn @click="orderConfigDialog = false" />
|
||||
</VCardItem>
|
||||
<VDivider />
|
||||
<VCardText>
|
||||
|
||||
@@ -205,7 +205,7 @@ onActivated(async () => {
|
||||
<VBtn
|
||||
icon="mdi-tune"
|
||||
variant="text"
|
||||
color="primary"
|
||||
color="grey"
|
||||
size="default"
|
||||
class="settings-icon-button"
|
||||
@click="dialog = true"
|
||||
@@ -234,7 +234,7 @@ onActivated(async () => {
|
||||
<VIcon icon="mdi-tune" size="small" class="me-2" />
|
||||
自定义内容
|
||||
</VCardTitle>
|
||||
<DialogCloseBtn @click="dialog = false" />
|
||||
<VDialogCloseBtn @click="dialog = false" />
|
||||
</VCardItem>
|
||||
<VDivider />
|
||||
<VCardText>
|
||||
|
||||
@@ -12,17 +12,30 @@ const subType = route.meta.subType?.toString()
|
||||
const subId = ref(route.query.id as string)
|
||||
const activeTab = ref(route.query.tab)
|
||||
const shareViewKey = ref(0)
|
||||
const subscribeViewKey = ref(0)
|
||||
|
||||
// 默认订阅设置弹窗
|
||||
const subscribeEditDialog = ref(false)
|
||||
|
||||
// 订阅过滤弹窗
|
||||
const filterSubscribeDialog = ref(false)
|
||||
|
||||
// 搜索订阅分享弹窗
|
||||
const searchShareDialog = ref(false)
|
||||
|
||||
// 分享订阅过滤词
|
||||
const shareFilter = ref('')
|
||||
// 订阅过滤词
|
||||
const subscribeFilter = ref('')
|
||||
|
||||
// 触发搜索订阅
|
||||
// 分享搜索词
|
||||
const shareKeyword = ref('')
|
||||
|
||||
// 过滤订阅
|
||||
const filterSubscribes = () => {
|
||||
filterSubscribeDialog.value = false
|
||||
subscribeViewKey.value++
|
||||
}
|
||||
|
||||
// 搜索分享
|
||||
const searchShares = () => {
|
||||
searchShareDialog.value = false
|
||||
shareViewKey.value++
|
||||
@@ -33,26 +46,50 @@ const searchShares = () => {
|
||||
<div>
|
||||
<VHeaderTab :items="subType == '电影' ? SubscribeMovieTabs : SubscribeTvTabs" v-model="activeTab">
|
||||
<template #append>
|
||||
<VBtn
|
||||
<VMenu
|
||||
v-if="activeTab === '我的订阅'"
|
||||
icon="mdi-clipboard-edit-outline"
|
||||
variant="text"
|
||||
color="primary"
|
||||
size="default"
|
||||
class="settings-icon-button"
|
||||
@click="subscribeEditDialog = true"
|
||||
/>
|
||||
v-model="filterSubscribeDialog"
|
||||
width="25rem"
|
||||
:close-on-content-click="false"
|
||||
>
|
||||
<template #activator="{ props }">
|
||||
<VBtn
|
||||
icon="mdi-filter-cog-outline"
|
||||
variant="text"
|
||||
:color="subscribeFilter ? 'primary' : 'gray'"
|
||||
size="default"
|
||||
class="settings-icon-button"
|
||||
v-bind="props"
|
||||
/>
|
||||
</template>
|
||||
<VCard>
|
||||
<VCardItem>
|
||||
<VCardTitle>
|
||||
<VIcon icon="mdi-filter-cog-outline" class="mr-2" />
|
||||
筛选订阅
|
||||
</VCardTitle>
|
||||
<VDialogCloseBtn @click="filterSubscribeDialog = false" />
|
||||
</VCardItem>
|
||||
<VCardText>
|
||||
<VTextField v-model="subscribeFilter" label="名称" clearable density="comfortable">
|
||||
<template #append>
|
||||
<VBtn prepend-icon="mdi-check" color="primary" @click="filterSubscribes">确定</VBtn>
|
||||
</template>
|
||||
</VTextField>
|
||||
</VCardText>
|
||||
</VCard>
|
||||
</VMenu>
|
||||
<VMenu
|
||||
v-if="activeTab === '订阅分享'"
|
||||
v-model="searchShareDialog"
|
||||
width="35rem"
|
||||
width="25rem"
|
||||
:close-on-content-click="false"
|
||||
>
|
||||
<template #activator="{ props }">
|
||||
<VBtn
|
||||
icon="mdi-movie-search-outline"
|
||||
variant="text"
|
||||
color="primary"
|
||||
:color="shareKeyword ? 'primary' : 'gray'"
|
||||
size="default"
|
||||
class="settings-icon-button"
|
||||
v-bind="props"
|
||||
@@ -64,10 +101,10 @@ const searchShares = () => {
|
||||
<VIcon icon="mdi-movie-search-outline" class="mr-2" />
|
||||
搜索订阅分享
|
||||
</VCardTitle>
|
||||
<DialogCloseBtn @click="searchShareDialog = false" />
|
||||
<VDialogCloseBtn @click="searchShareDialog = false" />
|
||||
</VCardItem>
|
||||
<VCardText>
|
||||
<VTextField v-model="shareFilter" label="搜索关键词" clearable>
|
||||
<VTextField v-model="shareKeyword" label="关键词" clearable density="comfortable">
|
||||
<template #append>
|
||||
<VBtn prepend-icon="mdi-magnify" color="primary" @click="searchShares">搜索</VBtn>
|
||||
</template>
|
||||
@@ -75,14 +112,23 @@ const searchShares = () => {
|
||||
</VCardText>
|
||||
</VCard>
|
||||
</VMenu>
|
||||
<VBtn
|
||||
v-if="activeTab === '我的订阅'"
|
||||
icon="mdi-clipboard-edit-outline"
|
||||
variant="text"
|
||||
color="gray"
|
||||
size="default"
|
||||
class="settings-icon-button"
|
||||
@click="subscribeEditDialog = true"
|
||||
/>
|
||||
</template>
|
||||
</VHeaderTab>
|
||||
|
||||
<VWindow v-model="activeTab" class="disable-tab-transition" :touch="false">
|
||||
<VWindowItem value="我的订阅">
|
||||
<transition name="fade-slide" appear>
|
||||
<div class="mt-4">
|
||||
<SubscribeListView :type="subType" :subid="subId" />
|
||||
<div>
|
||||
<SubscribeListView :type="subType" :subid="subId" :key="subscribeViewKey" :keyword="subscribeFilter" />
|
||||
</div>
|
||||
</transition>
|
||||
</VWindowItem>
|
||||
@@ -96,7 +142,7 @@ const searchShares = () => {
|
||||
<VWindowItem value="订阅分享">
|
||||
<transition name="fade-slide" appear>
|
||||
<div>
|
||||
<SubscribeShareView :keyword="shareFilter" :key="shareViewKey" />
|
||||
<SubscribeShareView :keyword="shareKeyword" :key="shareViewKey" />
|
||||
</div>
|
||||
</transition>
|
||||
</VWindowItem>
|
||||
|
||||
Reference in New Issue
Block a user