mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-25 02:09:59 +08:00
新增订阅分享页面及相关搜索功能
This commit is contained in:
@@ -298,6 +298,19 @@ function searchHistory() {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
// 跳转到订阅分享页面
|
||||
function searchSubscribeShares() {
|
||||
if (!searchWord.value) return
|
||||
saveRecentSearches(searchWord.value)
|
||||
router.push({
|
||||
path: '/subscribe-share',
|
||||
query: {
|
||||
keyword: searchWord.value,
|
||||
},
|
||||
})
|
||||
emit('close')
|
||||
}
|
||||
|
||||
// 跳转插件页面
|
||||
function showPlugin(pluginId: string) {
|
||||
router.push({
|
||||
@@ -484,6 +497,37 @@ onMounted(() => {
|
||||
</template>
|
||||
</VHover>
|
||||
|
||||
<VHover v-if="hasSubscribePermission">
|
||||
<template #default="hover">
|
||||
<VListItem
|
||||
density="comfortable"
|
||||
link
|
||||
rounded="xl"
|
||||
v-bind="hover.props"
|
||||
@click="searchSubscribeShares"
|
||||
class="search-option mx-2 mx-sm-4 my-1"
|
||||
>
|
||||
<template #prepend>
|
||||
<div class="option-icon-wrapper d-flex align-center justify-center">
|
||||
<VIcon
|
||||
icon="mdi-share-variant"
|
||||
:color="hover.isHovering ? 'primary' : 'medium-emphasis'"
|
||||
size="small"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<VListItemTitle class="font-weight-medium">{{ t('subscribe.searchShares') }}</VListItemTitle>
|
||||
<VListItemSubtitle class="text-body-2 text-medium-emphasis mt-1">
|
||||
{{ t('common.search') }} <span class="primary-text font-weight-medium">{{ searchWord }}</span>
|
||||
{{ t('dialog.searchBar.subscribeShareSearch') }}
|
||||
</VListItemSubtitle>
|
||||
<template #append>
|
||||
<VIcon v-if="hover.isHovering" icon="mdi-chevron-right" color="primary" />
|
||||
</template>
|
||||
</VListItem>
|
||||
</template>
|
||||
</VHover>
|
||||
|
||||
<VHover v-if="hasManagePermission">
|
||||
<template #default="hover">
|
||||
<VListItem
|
||||
|
||||
@@ -1733,6 +1733,7 @@ export default {
|
||||
collectionSearch: 'Related series works',
|
||||
actorSearch: 'Related actors, directors, etc.',
|
||||
historySearch: 'Related history records',
|
||||
subscribeShareSearch: 'Related subscription shares',
|
||||
siteResources: 'Site Resources',
|
||||
searchInSites: 'Search for torrent resources in sites',
|
||||
relatedResources: 'Related Resources',
|
||||
|
||||
@@ -1712,6 +1712,7 @@ export default {
|
||||
collectionSearch: '相关的系列作品',
|
||||
actorSearch: '相关的演员、导演等',
|
||||
historySearch: '相关的历史记录',
|
||||
subscribeShareSearch: '相关的订阅分享',
|
||||
siteResources: '站点资源',
|
||||
searchInSites: '在站点中搜索种子资源',
|
||||
relatedResources: '相关资源',
|
||||
|
||||
@@ -1711,6 +1711,7 @@ export default {
|
||||
collectionSearch: '相關的系列作品',
|
||||
actorSearch: '相關的演員、導演等',
|
||||
historySearch: '相關的歷史記錄',
|
||||
subscribeShareSearch: '相關的訂閱分享',
|
||||
siteResources: '站點資源',
|
||||
searchInSites: '在站點中搜索種子資源',
|
||||
relatedResources: '相關資源',
|
||||
|
||||
16
src/pages/subscribe-share.vue
Normal file
16
src/pages/subscribe-share.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<script setup lang="ts">
|
||||
import SubscribeShareView from '@/views/subscribe/SubscribeShareView.vue'
|
||||
// 从路由参数中获取搜索关键字
|
||||
const route = useRoute()
|
||||
const keyword = route.query.keyword as string
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<SubscribeShareView :keyword="keyword" />
|
||||
<!-- 滚动到顶部按钮 -->
|
||||
<Teleport to="body" v-if="route.path === '/subscribe-share'">
|
||||
<VScrollToTopBtn />
|
||||
</Teleport>
|
||||
</div>
|
||||
</template>
|
||||
@@ -69,6 +69,14 @@ const router = createRouter({
|
||||
subType: '电视剧',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/subscribe-share',
|
||||
component: () => import('../pages/subscribe-share.vue'),
|
||||
meta: {
|
||||
keepAlive: true,
|
||||
requiresAuth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/workflow',
|
||||
component: () => import('../pages/workflow.vue'),
|
||||
|
||||
@@ -28,6 +28,18 @@ const page = ref(1)
|
||||
// 搜索关键字
|
||||
const keyword = ref(props.keyword)
|
||||
|
||||
// 监听 props.keyword 变化
|
||||
watch(
|
||||
() => props.keyword,
|
||||
newKeyword => {
|
||||
keyword.value = newKeyword || ''
|
||||
// 重置页码和数据
|
||||
page.value = 1
|
||||
dataList.value = []
|
||||
isRefreshed.value = false
|
||||
},
|
||||
)
|
||||
|
||||
// 是否加载中
|
||||
const loading = ref(false)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user