mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 07:28:37 +08:00
优化多个组件,调整样式和功能以提升用户体验,添加季数选择功能
This commit is contained in:
@@ -12,6 +12,7 @@ import tmdbImage from '@images/logos/tmdb.png'
|
|||||||
import doubanImage from '@images/logos/douban-black.png'
|
import doubanImage from '@images/logos/douban-black.png'
|
||||||
import bangumiImage from '@images/logos/bangumi.png'
|
import bangumiImage from '@images/logos/bangumi.png'
|
||||||
import { useUserStore } from '@/stores'
|
import { useUserStore } from '@/stores'
|
||||||
|
import SearchSiteDialog from '@/components/dialog/SearchSiteDialog.vue'
|
||||||
|
|
||||||
// 输入参数
|
// 输入参数
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -84,8 +85,8 @@ const selectedSites = ref<number[]>([])
|
|||||||
// 搜索菜单显示状态
|
// 搜索菜单显示状态
|
||||||
const searchMenuShow = ref(false)
|
const searchMenuShow = ref(false)
|
||||||
|
|
||||||
// 全选/全不选按钮文字
|
// 选择站点对话框
|
||||||
const checkAllText = computed(() => (selectedSites.value.length === allSites.value.length ? '全不选' : '全选'))
|
const chooseSiteDialog = ref(false)
|
||||||
|
|
||||||
// 全选/全不选
|
// 全选/全不选
|
||||||
function checkAllSitesorNot() {
|
function checkAllSitesorNot() {
|
||||||
@@ -423,9 +424,11 @@ function goMediaDetail(isHovering = false) {
|
|||||||
|
|
||||||
// 点击搜索
|
// 点击搜索
|
||||||
async function clickSearch() {
|
async function clickSearch() {
|
||||||
if (allSites.value?.length > 0) return
|
if (allSites.value?.length == 0) {
|
||||||
querySites()
|
querySites()
|
||||||
querySelectedSites()
|
querySelectedSites()
|
||||||
|
}
|
||||||
|
chooseSiteDialog.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// 开始搜索
|
// 开始搜索
|
||||||
@@ -444,6 +447,13 @@ function handleSearch() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 搜索多站点
|
||||||
|
function searchSites(sites: number[]) {
|
||||||
|
chooseSiteDialog.value = false
|
||||||
|
selectedSites.value = sites
|
||||||
|
handleSearch()
|
||||||
|
}
|
||||||
|
|
||||||
// 懒加载检查
|
// 懒加载检查
|
||||||
function handleCheckLazy() {
|
function handleCheckLazy() {
|
||||||
if (props.media?.collection_id) {
|
if (props.media?.collection_id) {
|
||||||
@@ -566,36 +576,7 @@ function onRemoveSubscribe() {
|
|||||||
</p>
|
</p>
|
||||||
<div v-if="props.media?.collection_id" class="mb-3" @click.stop=""></div>
|
<div v-if="props.media?.collection_id" class="mb-3" @click.stop=""></div>
|
||||||
<div v-else class="flex align-center justify-between">
|
<div v-else class="flex align-center justify-between">
|
||||||
<VMenu close-on-content-click v-model="searchMenuShow" max-width="450">
|
<IconBtn icon="mdi-magnify" color="white" @click.stop="clickSearch" />
|
||||||
<template v-slot:activator="{ props }">
|
|
||||||
<IconBtn v-bind="props" icon="mdi-magnify" color="white" @click.stop="clickSearch" />
|
|
||||||
</template>
|
|
||||||
<VList>
|
|
||||||
<VListItem>
|
|
||||||
<VChipGroup v-model="selectedSites" column multiple @click.stop>
|
|
||||||
<VChip
|
|
||||||
v-for="site in allSites"
|
|
||||||
:key="site.id"
|
|
||||||
:color="selectedSites.includes(site.id) ? 'primary' : ''"
|
|
||||||
filter
|
|
||||||
variant="outlined"
|
|
||||||
:value="site.id"
|
|
||||||
size="small"
|
|
||||||
>
|
|
||||||
{{ site.name }}
|
|
||||||
</VChip>
|
|
||||||
</VChipGroup>
|
|
||||||
<div>
|
|
||||||
<VBtn size="small" variant="text" @click.stop="checkAllSitesorNot">
|
|
||||||
{{ checkAllText }}
|
|
||||||
</VBtn>
|
|
||||||
</div>
|
|
||||||
</VListItem>
|
|
||||||
<VListItem>
|
|
||||||
<VBtn @click="handleSearch" block>搜索</VBtn>
|
|
||||||
</VListItem>
|
|
||||||
</VList>
|
|
||||||
</VMenu>
|
|
||||||
<IconBtn icon="mdi-heart" :color="isSubscribed ? 'error' : 'white'" @click.stop="handleSubscribe" />
|
<IconBtn icon="mdi-heart" :color="isSubscribed ? 'error' : 'white'" @click.stop="handleSubscribe" />
|
||||||
</div>
|
</div>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
@@ -701,4 +682,13 @@ function onRemoveSubscribe() {
|
|||||||
@save="subscribeEditDialog = false"
|
@save="subscribeEditDialog = false"
|
||||||
@remove="onRemoveSubscribe"
|
@remove="onRemoveSubscribe"
|
||||||
/>
|
/>
|
||||||
|
<!-- 站点选择对话框 -->
|
||||||
|
<SearchSiteDialog
|
||||||
|
v-if="chooseSiteDialog"
|
||||||
|
v-model="chooseSiteDialog"
|
||||||
|
:sites="allSites"
|
||||||
|
:selected="selectedSites"
|
||||||
|
@search="searchSites"
|
||||||
|
@close="chooseSiteDialog = false"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -332,7 +332,7 @@ onMounted(() => {
|
|||||||
</template>
|
</template>
|
||||||
<span>测试站点连通性</span>
|
<span>测试站点连通性</span>
|
||||||
</VTooltip>
|
</VTooltip>
|
||||||
<VTooltip>
|
<VTooltip v-if="!cardProps.site?.public">
|
||||||
<template #activator="{ props }">
|
<template #activator="{ props }">
|
||||||
<IconBtn v-bind="props" elevation="0" class="site-action-btn" @click.stop="handleSiteUserData">
|
<IconBtn v-bind="props" elevation="0" class="site-action-btn" @click.stop="handleSiteUserData">
|
||||||
<VIcon icon="mdi-chart-bell-curve" size="18" />
|
<VIcon icon="mdi-chart-bell-curve" size="18" />
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ const transferForm = reactive<TransferForm>({
|
|||||||
|
|
||||||
// 所有媒体库目录
|
// 所有媒体库目录
|
||||||
const directories = ref<TransferDirectoryConf[]>([])
|
const directories = ref<TransferDirectoryConf[]>([])
|
||||||
|
|
||||||
// 查询目录
|
// 查询目录
|
||||||
async function loadDirectories() {
|
async function loadDirectories() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,19 +1,15 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import type { Plugin, Site, Subscribe } from '@/api/types'
|
import type { Site, Plugin, Subscribe } from '@/api/types'
|
||||||
import { SystemNavMenus, SettingTabs } from '@/router/menu'
|
import { SystemNavMenus, SettingTabs } from '@/router/menu'
|
||||||
import { NavMenu } from '@/@layouts/types'
|
import { NavMenu } from '@/@layouts/types'
|
||||||
import { useUserStore } from '@/stores'
|
import { useUserStore } from '@/stores'
|
||||||
import { useTheme } from 'vuetify'
|
import SearchSiteDialog from '@/components/dialog/SearchSiteDialog.vue'
|
||||||
import { computed, onMounted, ref } from 'vue'
|
|
||||||
|
|
||||||
// 定义站点信息接口
|
// 定义props,接收modelValue
|
||||||
interface SiteInfo {
|
const props = defineProps<{
|
||||||
id: number
|
modelValue: boolean
|
||||||
name: string
|
}>()
|
||||||
is_active: boolean
|
|
||||||
[key: string]: any
|
|
||||||
}
|
|
||||||
|
|
||||||
// 路由
|
// 路由
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@@ -27,10 +23,13 @@ const superUser = userStore.superUser
|
|||||||
// 当前用户名
|
// 当前用户名
|
||||||
const userName = userStore.userName
|
const userName = userStore.userName
|
||||||
|
|
||||||
// 定义props,接收modelValue
|
// 所有订阅数据
|
||||||
const props = defineProps<{
|
const SubscribeItems = ref<Subscribe[]>([])
|
||||||
modelValue: boolean
|
|
||||||
}>()
|
// 站点选择对话框
|
||||||
|
const chooseSiteDialog = ref(false)
|
||||||
|
const selectedSites = ref<number[]>([])
|
||||||
|
const allSites = ref<Site[]>([])
|
||||||
|
|
||||||
// 定义事件
|
// 定义事件
|
||||||
const emit = defineEmits(['close', 'update:modelValue'])
|
const emit = defineEmits(['close', 'update:modelValue'])
|
||||||
@@ -50,20 +49,6 @@ const searchWordInput = ref<HTMLElement | null>(null)
|
|||||||
// 近期搜索词条
|
// 近期搜索词条
|
||||||
const recentSearches = ref<string[]>([])
|
const recentSearches = ref<string[]>([])
|
||||||
|
|
||||||
// 全选/全不选按钮文字
|
|
||||||
const checkAllText = computed(() => {
|
|
||||||
return selectedSites.value.length < allSites.value.length ? '选择全部' : '取消全选'
|
|
||||||
})
|
|
||||||
|
|
||||||
// 全选/全不选
|
|
||||||
const checkAllSitesorNot = () => {
|
|
||||||
if (selectedSites.value.length < allSites.value.length) {
|
|
||||||
selectedSites.value = allSites.value.map((item: SiteInfo) => item.id)
|
|
||||||
} else {
|
|
||||||
selectedSites.value = []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 保存近期搜索到本地
|
// 保存近期搜索到本地
|
||||||
function saveRecentSearches(keyword: string) {
|
function saveRecentSearches(keyword: string) {
|
||||||
if (!keyword) return
|
if (!keyword) return
|
||||||
@@ -158,15 +143,6 @@ const matchedPluginItems = computed(() => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// 所有订阅数据
|
|
||||||
const SubscribeItems = ref<Subscribe[]>([])
|
|
||||||
|
|
||||||
// 站点选择对话框
|
|
||||||
const showSiteDialog = ref(false)
|
|
||||||
const siteFilter = ref('')
|
|
||||||
const selectedSites = ref<number[]>([])
|
|
||||||
const allSites = ref<SiteInfo[]>([])
|
|
||||||
|
|
||||||
// 获取订阅列表数据
|
// 获取订阅列表数据
|
||||||
async function fetchSubscribes() {
|
async function fetchSubscribes() {
|
||||||
try {
|
try {
|
||||||
@@ -176,15 +152,6 @@ async function fetchSubscribes() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据筛选条件过滤站点
|
|
||||||
const filteredSites = computed(() => {
|
|
||||||
if (!siteFilter.value) return allSites.value
|
|
||||||
const filter = siteFilter.value.toLowerCase()
|
|
||||||
return allSites.value.filter((site: SiteInfo) =>
|
|
||||||
site.name.toLowerCase().includes(filter)
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
// 保存用户站点选择到本地
|
// 保存用户站点选择到本地
|
||||||
const saveUserSitePreferences = () => {
|
const saveUserSitePreferences = () => {
|
||||||
try {
|
try {
|
||||||
@@ -219,34 +186,37 @@ const loadUserSitePreferences = async () => {
|
|||||||
|
|
||||||
// 获取站点分类信息
|
// 获取站点分类信息
|
||||||
const getSiteCategories = () => {
|
const getSiteCategories = () => {
|
||||||
api.get('site/').then(async (res: any) => {
|
api
|
||||||
if (res && Array.isArray(res)) {
|
.get('site/')
|
||||||
allSites.value = res.filter((site: any) => site.is_active) || []
|
.then(async (res: any) => {
|
||||||
// 加载用户站点选择
|
if (res && Array.isArray(res)) {
|
||||||
await loadUserSitePreferences()
|
allSites.value = res.filter((site: any) => site.is_active) || []
|
||||||
// 如果没有选择任何站点并且有可用站点,才默认选择全部
|
// 加载用户站点选择
|
||||||
if (selectedSites.value.length === 0 && allSites.value.length > 0) {
|
await loadUserSitePreferences()
|
||||||
selectedSites.value = allSites.value.map((site: SiteInfo) => site.id)
|
// 如果没有选择任何站点并且有可用站点,才默认选择全部
|
||||||
|
if (selectedSites.value.length === 0 && allSites.value.length > 0) {
|
||||||
|
selectedSites.value = allSites.value.map((site: Site) => site.id)
|
||||||
|
}
|
||||||
|
} else if (res.data && Array.isArray(res.data)) {
|
||||||
|
allSites.value = res.data.filter((site: any) => site.is_active) || []
|
||||||
|
// 加载用户站点选择
|
||||||
|
await loadUserSitePreferences()
|
||||||
|
// 如果没有选择任何站点并且有可用站点,才默认选择全部
|
||||||
|
if (selectedSites.value.length === 0 && allSites.value.length > 0) {
|
||||||
|
selectedSites.value = allSites.value.map((site: Site) => site.id)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (res.data && Array.isArray(res.data)) {
|
console.log('站点数据:', allSites.value)
|
||||||
allSites.value = res.data.filter((site: any) => site.is_active) || []
|
console.log('已选站点:', selectedSites.value)
|
||||||
// 加载用户站点选择
|
})
|
||||||
await loadUserSitePreferences()
|
.catch(err => {
|
||||||
// 如果没有选择任何站点并且有可用站点,才默认选择全部
|
console.error('获取站点数据失败:', err)
|
||||||
if (selectedSites.value.length === 0 && allSites.value.length > 0) {
|
})
|
||||||
selectedSites.value = allSites.value.map((site: SiteInfo) => site.id)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
console.log('站点数据:', allSites.value)
|
|
||||||
console.log('已选站点:', selectedSites.value)
|
|
||||||
}).catch(err => {
|
|
||||||
console.error('获取站点数据失败:', err)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打开站点选择对话框
|
// 打开站点选择对话框
|
||||||
const openSiteDialog = () => {
|
const openSiteDialog = () => {
|
||||||
showSiteDialog.value = true
|
chooseSiteDialog.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// 匹配的订阅列表
|
// 匹配的订阅列表
|
||||||
@@ -258,8 +228,21 @@ const matchedSubscribeItems = computed(() => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// 搜索站点资源
|
// 搜索多站点
|
||||||
const searchTorrent = () => {
|
function searchSites(sites: number[]) {
|
||||||
|
chooseSiteDialog.value = false
|
||||||
|
selectedSites.value = sites
|
||||||
|
searchTorrent()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 选择站点
|
||||||
|
function chooseSitesDone(sites: number[]) {
|
||||||
|
chooseSiteDialog.value = false
|
||||||
|
selectedSites.value = sites
|
||||||
|
}
|
||||||
|
|
||||||
|
// 搜索资源
|
||||||
|
function searchTorrent() {
|
||||||
if (!searchWord.value) return
|
if (!searchWord.value) return
|
||||||
// 记录搜索词
|
// 记录搜索词
|
||||||
saveRecentSearches(searchWord.value)
|
saveRecentSearches(searchWord.value)
|
||||||
@@ -413,9 +396,7 @@ onMounted(() => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<VListItemTitle class="text-subtitle-1 font-weight-medium">
|
<VListItemTitle class="text-subtitle-1 font-weight-medium"> 电影、电视剧 </VListItemTitle>
|
||||||
电影、电视剧
|
|
||||||
</VListItemTitle>
|
|
||||||
<VListItemSubtitle class="text-body-2 text-medium-emphasis mt-1">
|
<VListItemSubtitle class="text-body-2 text-medium-emphasis mt-1">
|
||||||
搜索 <span class="primary-text font-weight-medium">{{ searchWord }}</span> 相关的影视作品
|
搜索 <span class="primary-text font-weight-medium">{{ searchWord }}</span> 相关的影视作品
|
||||||
</VListItemSubtitle>
|
</VListItemSubtitle>
|
||||||
@@ -445,9 +426,7 @@ onMounted(() => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<VListItemTitle class="text-subtitle-1 font-weight-medium">
|
<VListItemTitle class="text-subtitle-1 font-weight-medium"> 系列合集 </VListItemTitle>
|
||||||
系列合集
|
|
||||||
</VListItemTitle>
|
|
||||||
<VListItemSubtitle class="text-body-2 text-medium-emphasis mt-1">
|
<VListItemSubtitle class="text-body-2 text-medium-emphasis mt-1">
|
||||||
搜索 <span class="primary-text font-weight-medium">{{ searchWord }}</span> 相关的系列作品
|
搜索 <span class="primary-text font-weight-medium">{{ searchWord }}</span> 相关的系列作品
|
||||||
</VListItemSubtitle>
|
</VListItemSubtitle>
|
||||||
@@ -477,9 +456,7 @@ onMounted(() => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<VListItemTitle class="text-subtitle-1 font-weight-medium">
|
<VListItemTitle class="text-subtitle-1 font-weight-medium"> 演职人员 </VListItemTitle>
|
||||||
演职人员
|
|
||||||
</VListItemTitle>
|
|
||||||
<VListItemSubtitle class="text-body-2 text-medium-emphasis mt-1">
|
<VListItemSubtitle class="text-body-2 text-medium-emphasis mt-1">
|
||||||
搜索 <span class="primary-text font-weight-medium">{{ searchWord }}</span> 相关的演员、导演等
|
搜索 <span class="primary-text font-weight-medium">{{ searchWord }}</span> 相关的演员、导演等
|
||||||
</VListItemSubtitle>
|
</VListItemSubtitle>
|
||||||
@@ -502,16 +479,10 @@ onMounted(() => {
|
|||||||
>
|
>
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<div class="option-icon-wrapper d-flex align-center justify-center">
|
<div class="option-icon-wrapper d-flex align-center justify-center">
|
||||||
<VIcon
|
<VIcon icon="mdi-history" :color="hover.isHovering ? 'primary' : 'medium-emphasis'" size="small" />
|
||||||
icon="mdi-history"
|
|
||||||
:color="hover.isHovering ? 'primary' : 'medium-emphasis'"
|
|
||||||
size="small"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<VListItemTitle class="text-subtitle-1 font-weight-medium">
|
<VListItemTitle class="text-subtitle-1 font-weight-medium"> 整理记录 </VListItemTitle>
|
||||||
整理记录
|
|
||||||
</VListItemTitle>
|
|
||||||
<VListItemSubtitle class="text-body-2 text-medium-emphasis mt-1">
|
<VListItemSubtitle class="text-body-2 text-medium-emphasis mt-1">
|
||||||
搜索 <span class="primary-text font-weight-medium">{{ searchWord }}</span> 相关的历史记录
|
搜索 <span class="primary-text font-weight-medium">{{ searchWord }}</span> 相关的历史记录
|
||||||
</VListItemSubtitle>
|
</VListItemSubtitle>
|
||||||
@@ -529,10 +500,7 @@ onMounted(() => {
|
|||||||
<span class="category-title">订阅内容</span>
|
<span class="category-title">订阅内容</span>
|
||||||
</VListSubheader>
|
</VListSubheader>
|
||||||
|
|
||||||
<VHover
|
<VHover v-for="subscribe in matchedSubscribeItems" :key="subscribe.id">
|
||||||
v-for="subscribe in matchedSubscribeItems"
|
|
||||||
:key="subscribe.id"
|
|
||||||
>
|
|
||||||
<template #default="hover">
|
<template #default="hover">
|
||||||
<VListItem
|
<VListItem
|
||||||
density="comfortable"
|
density="comfortable"
|
||||||
@@ -552,7 +520,8 @@ onMounted(() => {
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<VListItemTitle class="text-subtitle-1 font-weight-medium">
|
<VListItemTitle class="text-subtitle-1 font-weight-medium">
|
||||||
{{ subscribe.name }}<span v-if="subscribe.season" class="text-body-2"> 第 {{ subscribe.season }} 季</span>
|
{{ subscribe.name
|
||||||
|
}}<span v-if="subscribe.season" class="text-body-2"> 第 {{ subscribe.season }} 季</span>
|
||||||
</VListItemTitle>
|
</VListItemTitle>
|
||||||
<VListItemSubtitle class="text-body-2 text-medium-emphasis mt-1">
|
<VListItemSubtitle class="text-body-2 text-medium-emphasis mt-1">
|
||||||
{{ subscribe.type }}
|
{{ subscribe.type }}
|
||||||
@@ -622,11 +591,7 @@ onMounted(() => {
|
|||||||
>
|
>
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<div class="option-icon-wrapper d-flex align-center justify-center">
|
<div class="option-icon-wrapper d-flex align-center justify-center">
|
||||||
<VIcon
|
<VIcon icon="mdi-puzzle" :color="hover.isHovering ? 'primary' : 'medium-emphasis'" size="small" />
|
||||||
icon="mdi-puzzle"
|
|
||||||
:color="hover.isHovering ? 'primary' : 'medium-emphasis'"
|
|
||||||
size="small"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<VListItemTitle class="text-subtitle-1 font-weight-medium">
|
<VListItemTitle class="text-subtitle-1 font-weight-medium">
|
||||||
@@ -650,7 +615,7 @@ onMounted(() => {
|
|||||||
<span class="category-title">站点资源搜索</span>
|
<span class="category-title">站点资源搜索</span>
|
||||||
</VListSubheader>
|
</VListSubheader>
|
||||||
|
|
||||||
<VCard class="mx-3 mx-sm-6 mb-4 mt-2 site-search-card" elevation="0">
|
<VCard class="mx-3 mx-sm-6 mb-4 mt-2 site-search-card">
|
||||||
<VCardText class="pa-3 pa-sm-4">
|
<VCardText class="pa-3 pa-sm-4">
|
||||||
<div class="d-flex flex-column">
|
<div class="d-flex flex-column">
|
||||||
<div class="d-flex align-center mb-3">
|
<div class="d-flex align-center mb-3">
|
||||||
@@ -667,10 +632,9 @@ onMounted(() => {
|
|||||||
color="primary"
|
color="primary"
|
||||||
@click="searchTorrent"
|
@click="searchTorrent"
|
||||||
prepend-icon="mdi-magnify"
|
prepend-icon="mdi-magnify"
|
||||||
rounded="pill"
|
|
||||||
size="small"
|
size="small"
|
||||||
variant="flat"
|
variant="flat"
|
||||||
elevation="0"
|
rounded="pill"
|
||||||
class="search-btn"
|
class="search-btn"
|
||||||
>
|
>
|
||||||
搜索
|
搜索
|
||||||
@@ -756,168 +720,17 @@ onMounted(() => {
|
|||||||
</VDialog>
|
</VDialog>
|
||||||
|
|
||||||
<!-- 站点选择对话框 -->
|
<!-- 站点选择对话框 -->
|
||||||
<VDialog v-model="showSiteDialog" max-width="640px" persistent fullscreen-mobile>
|
<SearchSiteDialog
|
||||||
<VCard class="site-dialog">
|
v-if="chooseSiteDialog"
|
||||||
<VCardTitle class="d-flex align-center pa-4">
|
v-model="chooseSiteDialog"
|
||||||
<span class="text-h6 font-weight-medium">选择搜索站点</span>
|
:sites="allSites"
|
||||||
<VSpacer />
|
:selected="selectedSites"
|
||||||
<VTextField
|
:savebtn="true"
|
||||||
v-model="siteFilter"
|
@search="searchSites"
|
||||||
placeholder="过滤站点..."
|
@close="chooseSiteDialog = false"
|
||||||
density="compact"
|
@reload="getSiteCategories"
|
||||||
variant="outlined"
|
@save="chooseSitesDone"
|
||||||
hide-details
|
/>
|
||||||
class="ml-4"
|
|
||||||
style="max-width: 200px"
|
|
||||||
prepend-inner-icon="mdi-magnify"
|
|
||||||
clearable
|
|
||||||
/>
|
|
||||||
</VCardTitle>
|
|
||||||
<VDivider class="search-divider" />
|
|
||||||
|
|
||||||
<VCardText style="max-height: 420px" class="overflow-y-auto px-4 py-4">
|
|
||||||
<!-- 站点列表 -->
|
|
||||||
<div v-if="filteredSites.length > 0">
|
|
||||||
<!-- 选择操作 -->
|
|
||||||
<div class="d-flex align-center mb-4">
|
|
||||||
<VBtn
|
|
||||||
size="small"
|
|
||||||
:color="selectedSites.length < allSites.length ? 'primary' : 'error'"
|
|
||||||
@click="checkAllSitesorNot"
|
|
||||||
class="me-2"
|
|
||||||
variant="flat"
|
|
||||||
rounded="pill"
|
|
||||||
elevation="0"
|
|
||||||
>
|
|
||||||
<VIcon start size="small">
|
|
||||||
{{ selectedSites.length < allSites.length ? 'mdi-check-all' : 'mdi-close-circle-outline' }}
|
|
||||||
</VIcon>
|
|
||||||
{{ checkAllText }}
|
|
||||||
</VBtn>
|
|
||||||
<div class="text-body-2 font-weight-medium" :class="selectedSites.length > 0 ? 'text-primary' : 'text-medium-emphasis'">
|
|
||||||
已选择 {{ selectedSites.length }}/{{ allSites.length }} 个站点
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 站点选择器 -->
|
|
||||||
<VRow dense>
|
|
||||||
<VCol
|
|
||||||
v-for="site in filteredSites"
|
|
||||||
:key="site.id"
|
|
||||||
cols="6"
|
|
||||||
sm="6"
|
|
||||||
md="4"
|
|
||||||
>
|
|
||||||
<VHover v-slot="{ isHovering, props }">
|
|
||||||
<div
|
|
||||||
v-bind="props"
|
|
||||||
:class="[
|
|
||||||
'site-checkbox-wrapper pa-2 pa-sm-3 rounded-lg d-flex align-center',
|
|
||||||
{
|
|
||||||
'site-selected': selectedSites.includes(site.id),
|
|
||||||
'site-hover': isHovering && !selectedSites.includes(site.id)
|
|
||||||
}
|
|
||||||
]"
|
|
||||||
@click="() => {
|
|
||||||
const index = selectedSites.indexOf(site.id);
|
|
||||||
if (index === -1) {
|
|
||||||
selectedSites.push(site.id);
|
|
||||||
} else {
|
|
||||||
selectedSites.splice(index, 1);
|
|
||||||
}
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
<VIcon
|
|
||||||
:icon="selectedSites.includes(site.id) ? 'mdi-check-circle' : 'mdi-checkbox-blank-circle-outline'"
|
|
||||||
:color="selectedSites.includes(site.id) ? 'primary' : 'medium-emphasis'"
|
|
||||||
class="me-2"
|
|
||||||
size="small"
|
|
||||||
/>
|
|
||||||
<span :class="[
|
|
||||||
'text-body-2 site-name',
|
|
||||||
{ 'font-weight-medium': selectedSites.includes(site.id) }
|
|
||||||
]">
|
|
||||||
{{ site.name }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</VHover>
|
|
||||||
</VCol>
|
|
||||||
</VRow>
|
|
||||||
</div>
|
|
||||||
<div v-else class="text-center py-8 empty-site-state">
|
|
||||||
<div class="search-icon-wrapper mb-4 mx-auto warning">
|
|
||||||
<VIcon icon="mdi-alert-circle-outline" size="large" color="warning" />
|
|
||||||
</div>
|
|
||||||
<div class="text-h6 font-weight-medium mb-2">没有找到匹配的站点</div>
|
|
||||||
<div class="text-subtitle-1 text-medium-emphasis mb-4">
|
|
||||||
{{ siteFilter ? '请尝试修改过滤条件' : '站点数据加载失败,请刷新页面重试' }}
|
|
||||||
</div>
|
|
||||||
<VBtn
|
|
||||||
v-if="siteFilter"
|
|
||||||
color="primary"
|
|
||||||
variant="flat"
|
|
||||||
class="mt-3"
|
|
||||||
prepend-icon="mdi-refresh"
|
|
||||||
rounded="pill"
|
|
||||||
elevation="0"
|
|
||||||
@click="siteFilter = ''"
|
|
||||||
>
|
|
||||||
清除过滤条件
|
|
||||||
</VBtn>
|
|
||||||
<VBtn
|
|
||||||
v-else
|
|
||||||
color="primary"
|
|
||||||
variant="flat"
|
|
||||||
class="mt-3"
|
|
||||||
prepend-icon="mdi-refresh"
|
|
||||||
rounded="pill"
|
|
||||||
elevation="0"
|
|
||||||
@click="getSiteCategories"
|
|
||||||
>
|
|
||||||
重新加载站点
|
|
||||||
</VBtn>
|
|
||||||
</div>
|
|
||||||
</VCardText>
|
|
||||||
|
|
||||||
<VDivider class="search-divider" />
|
|
||||||
|
|
||||||
<VCardActions class="pa-4">
|
|
||||||
<VSpacer />
|
|
||||||
<VBtn
|
|
||||||
color="grey-darken-1"
|
|
||||||
variant="text"
|
|
||||||
@click="showSiteDialog = false"
|
|
||||||
rounded="pill"
|
|
||||||
class="mr-2 d-flex align-center justify-center"
|
|
||||||
>
|
|
||||||
取消
|
|
||||||
</VBtn>
|
|
||||||
<VBtn
|
|
||||||
color="success"
|
|
||||||
variant="flat"
|
|
||||||
@click="showSiteDialog = false"
|
|
||||||
rounded="pill"
|
|
||||||
elevation="0"
|
|
||||||
class="mr-2 d-flex align-center justify-center"
|
|
||||||
:disabled="selectedSites.length === 0"
|
|
||||||
>
|
|
||||||
确定
|
|
||||||
</VBtn>
|
|
||||||
<VBtn
|
|
||||||
color="primary"
|
|
||||||
variant="flat"
|
|
||||||
:disabled="selectedSites.length === 0"
|
|
||||||
@click="() => { searchTorrent(); showSiteDialog = false; }"
|
|
||||||
prepend-icon="mdi-magnify"
|
|
||||||
rounded="pill"
|
|
||||||
elevation="0"
|
|
||||||
class="d-flex align-center justify-center"
|
|
||||||
>
|
|
||||||
直接搜索
|
|
||||||
</VBtn>
|
|
||||||
</VCardActions>
|
|
||||||
</VCard>
|
|
||||||
</VDialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@@ -945,7 +758,7 @@ onMounted(() => {
|
|||||||
.close-btn {
|
.close-btn {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 1.2rem;
|
right: 1.2rem;
|
||||||
top: 1.2rem;
|
top: 1.4rem;
|
||||||
background-color: rgba(var(--v-theme-on-surface), 0.04);
|
background-color: rgba(var(--v-theme-on-surface), 0.04);
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
width: 36px;
|
width: 36px;
|
||||||
@@ -1027,35 +840,10 @@ onMounted(() => {
|
|||||||
background-color: rgb(var(--v-theme-background));
|
background-color: rgb(var(--v-theme-background));
|
||||||
}
|
}
|
||||||
|
|
||||||
.site-checkbox-wrapper {
|
.site-search-card {
|
||||||
cursor: pointer;
|
|
||||||
transition: transform 0.2s ease, background-color 0.2s ease;
|
|
||||||
border: 1px solid rgba(var(--v-theme-on-surface), 0.08);
|
border: 1px solid rgba(var(--v-theme-on-surface), 0.08);
|
||||||
}
|
border-radius: 14px;
|
||||||
|
background-color: rgb(var(--v-theme-surface));
|
||||||
.site-checkbox-wrapper:hover {
|
|
||||||
transform: translateY(-2px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.site-name {
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
||||||
|
|
||||||
.site-selected {
|
|
||||||
background-color: rgba(var(--v-theme-primary), 0.08);
|
|
||||||
color: rgb(var(--v-theme-primary));
|
|
||||||
border-color: rgba(var(--v-theme-primary), 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.site-hover {
|
|
||||||
background-color: rgba(var(--v-theme-primary), 0.04);
|
|
||||||
}
|
|
||||||
|
|
||||||
.site-chips-container {
|
|
||||||
border-radius: 10px;
|
|
||||||
background-color: rgba(var(--v-theme-surface-variant), 0.06);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.site-chip {
|
.site-chip {
|
||||||
@@ -1068,12 +856,6 @@ onMounted(() => {
|
|||||||
color: rgb(var(--v-theme-primary));
|
color: rgb(var(--v-theme-primary));
|
||||||
}
|
}
|
||||||
|
|
||||||
.site-search-card {
|
|
||||||
border: 1px solid rgba(var(--v-theme-on-surface), 0.08);
|
|
||||||
border-radius: 14px;
|
|
||||||
background-color: rgb(var(--v-theme-surface));
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-btn {
|
.search-btn {
|
||||||
min-width: 70px;
|
min-width: 70px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
@@ -1111,6 +893,11 @@ onMounted(() => {
|
|||||||
padding: 0 12px;
|
padding: 0 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.site-chips-container {
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: rgba(var(--v-theme-surface-variant), 0.06);
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 600px) {
|
@media (max-width: 600px) {
|
||||||
.search-box-container {
|
.search-box-container {
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
@@ -1122,7 +909,7 @@ onMounted(() => {
|
|||||||
|
|
||||||
.close-btn {
|
.close-btn {
|
||||||
right: 0.8rem;
|
right: 0.8rem;
|
||||||
top: 0.8rem;
|
top: 1rem;
|
||||||
width: 32px;
|
width: 32px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,218 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import type { Site, Plugin, Subscribe } from '@/api/types'
|
||||||
|
import { PropType } from 'vue'
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
sites: {
|
||||||
|
type: Array as PropType<Site[]>,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
selected: Array as PropType<Number[]>,
|
||||||
|
savebtn: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
// 定义事件
|
||||||
|
const emit = defineEmits(['close', 'search', 'reload', 'save'])
|
||||||
|
|
||||||
|
// 过滤词
|
||||||
|
const siteFilter = ref('')
|
||||||
|
|
||||||
|
// 已选择站点
|
||||||
|
const selectedSites = ref<any[]>(props.selected || [])
|
||||||
|
|
||||||
|
// 全选/全不选按钮文字
|
||||||
|
const checkAllText = computed(() => {
|
||||||
|
return selectedSites.value.length < props.sites?.length ? '选择全部' : '取消全选'
|
||||||
|
})
|
||||||
|
|
||||||
|
// 全选/全不选
|
||||||
|
const checkAllSitesorNot = () => {
|
||||||
|
if (selectedSites.value.length < props.sites?.length) {
|
||||||
|
selectedSites.value = props.sites?.map((item: Site) => item.id)
|
||||||
|
} else {
|
||||||
|
selectedSites.value = []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据筛选条件过滤站点
|
||||||
|
const filteredSites = computed(() => {
|
||||||
|
if (!siteFilter.value) return props.sites
|
||||||
|
const filter = siteFilter.value.toLowerCase()
|
||||||
|
return props.sites?.filter((site: Site) => site.name.toLowerCase().includes(filter))
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<!-- 手动整理进度框 -->
|
||||||
|
<VDialog max-width="40rem" persistent fullscreen-mobile>
|
||||||
|
<VCard class="site-dialog">
|
||||||
|
<VCardTitle class="d-flex align-center pa-4">
|
||||||
|
<span class="text-h6 font-weight-medium">选择搜索站点</span>
|
||||||
|
<VSpacer />
|
||||||
|
<VTextField
|
||||||
|
v-model="siteFilter"
|
||||||
|
placeholder="过滤站点..."
|
||||||
|
density="compact"
|
||||||
|
variant="outlined"
|
||||||
|
hide-details
|
||||||
|
class="ml-4"
|
||||||
|
style="max-width: 200px"
|
||||||
|
prepend-inner-icon="mdi-magnify"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
|
</VCardTitle>
|
||||||
|
<VDivider class="search-divider" />
|
||||||
|
|
||||||
|
<VCardText style="max-height: 420px" class="overflow-y-auto px-4 py-4">
|
||||||
|
<!-- 站点列表 -->
|
||||||
|
<div v-if="filteredSites.length > 0">
|
||||||
|
<!-- 选择操作 -->
|
||||||
|
<div class="d-flex align-center mb-4">
|
||||||
|
<VBtn
|
||||||
|
size="small"
|
||||||
|
:color="selectedSites.length < sites.length ? 'primary' : 'error'"
|
||||||
|
@click="checkAllSitesorNot"
|
||||||
|
class="me-2"
|
||||||
|
rounded="pill"
|
||||||
|
variant="flat"
|
||||||
|
>
|
||||||
|
<VIcon start size="small">
|
||||||
|
{{ selectedSites.length < sites.length ? 'mdi-check-all' : 'mdi-close-circle-outline' }}
|
||||||
|
</VIcon>
|
||||||
|
{{ checkAllText }}
|
||||||
|
</VBtn>
|
||||||
|
<div
|
||||||
|
class="text-body-2 font-weight-medium"
|
||||||
|
:class="selectedSites.length > 0 ? 'text-primary' : 'text-medium-emphasis'"
|
||||||
|
>
|
||||||
|
已选择 {{ selectedSites.length }}/{{ sites.length }} 个站点
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 站点选择器 -->
|
||||||
|
<VRow dense>
|
||||||
|
<VCol v-for="site in filteredSites" :key="site.id" cols="6" sm="6" md="4">
|
||||||
|
<VHover v-slot="{ isHovering, props }">
|
||||||
|
<div
|
||||||
|
v-bind="props"
|
||||||
|
:class="[
|
||||||
|
'site-checkbox-wrapper pa-2 pa-sm-3 rounded-lg d-flex align-center',
|
||||||
|
{
|
||||||
|
'site-selected': selectedSites.includes(site.id),
|
||||||
|
'site-hover': isHovering && !selectedSites.includes(site.id),
|
||||||
|
},
|
||||||
|
]"
|
||||||
|
@click="
|
||||||
|
() => {
|
||||||
|
const index = selectedSites.indexOf(site.id)
|
||||||
|
if (index === -1) {
|
||||||
|
selectedSites.push(site.id)
|
||||||
|
} else {
|
||||||
|
selectedSites.splice(index, 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<VIcon
|
||||||
|
:icon="selectedSites.includes(site.id) ? 'mdi-check-circle' : 'mdi-checkbox-blank-circle-outline'"
|
||||||
|
:color="selectedSites.includes(site.id) ? 'primary' : 'medium-emphasis'"
|
||||||
|
class="me-2"
|
||||||
|
size="small"
|
||||||
|
/>
|
||||||
|
<span :class="['text-body-2 site-name', { 'font-weight-medium': selectedSites.includes(site.id) }]">
|
||||||
|
{{ site.name }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</VHover>
|
||||||
|
</VCol>
|
||||||
|
</VRow>
|
||||||
|
</div>
|
||||||
|
<div v-else class="text-center py-8 empty-site-state">
|
||||||
|
<div class="search-icon-wrapper mb-4 mx-auto warning">
|
||||||
|
<VIcon icon="mdi-alert-circle-outline" size="large" color="warning" />
|
||||||
|
</div>
|
||||||
|
<div class="text-h6 font-weight-medium mb-2">没有找到匹配的站点</div>
|
||||||
|
<div class="text-subtitle-1 text-medium-emphasis mb-4">
|
||||||
|
{{ siteFilter ? '请尝试修改过滤条件' : '站点数据加载失败,请刷新页面重试' }}
|
||||||
|
</div>
|
||||||
|
<VBtn
|
||||||
|
v-if="siteFilter"
|
||||||
|
color="primary"
|
||||||
|
variant="flat"
|
||||||
|
class="mt-3"
|
||||||
|
prepend-icon="mdi-refresh"
|
||||||
|
@click="siteFilter = ''"
|
||||||
|
>
|
||||||
|
重置
|
||||||
|
</VBtn>
|
||||||
|
<VBtn v-else color="primary" variant="flat" class="mt-3" prepend-icon="mdi-refresh" @click="emit('reload')">
|
||||||
|
重新加载站点
|
||||||
|
</VBtn>
|
||||||
|
</div>
|
||||||
|
</VCardText>
|
||||||
|
|
||||||
|
<VDivider class="search-divider" />
|
||||||
|
|
||||||
|
<VCardActions class="pa-4">
|
||||||
|
<VSpacer />
|
||||||
|
<VBtn
|
||||||
|
color="grey-darken-1"
|
||||||
|
variant="text"
|
||||||
|
@click="emit('close')"
|
||||||
|
class="mr-2 d-flex align-center justify-center"
|
||||||
|
>
|
||||||
|
取消
|
||||||
|
</VBtn>
|
||||||
|
<VBtn
|
||||||
|
v-if="savebtn"
|
||||||
|
color="success"
|
||||||
|
variant="flat"
|
||||||
|
@click="emit('save', selectedSites)"
|
||||||
|
class="mr-2 d-flex align-center justify-center"
|
||||||
|
:disabled="selectedSites.length === 0"
|
||||||
|
>
|
||||||
|
确定
|
||||||
|
</VBtn>
|
||||||
|
<VBtn
|
||||||
|
color="primary"
|
||||||
|
variant="flat"
|
||||||
|
:disabled="selectedSites.length === 0"
|
||||||
|
@click="emit('search', selectedSites)"
|
||||||
|
prepend-icon="mdi-magnify"
|
||||||
|
class="d-flex align-center justify-center px-5"
|
||||||
|
>
|
||||||
|
搜索
|
||||||
|
</VBtn>
|
||||||
|
</VCardActions>
|
||||||
|
</VCard>
|
||||||
|
</VDialog>
|
||||||
|
</template>
|
||||||
|
<style scoped>
|
||||||
|
.site-checkbox-wrapper {
|
||||||
|
cursor: pointer;
|
||||||
|
transition: transform 0.2s ease, background-color 0.2s ease;
|
||||||
|
border: 1px solid rgba(var(--v-theme-on-surface), 0.08);
|
||||||
|
}
|
||||||
|
|
||||||
|
.site-checkbox-wrapper:hover {
|
||||||
|
transform: translateY(-2px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.site-name {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.site-selected {
|
||||||
|
background-color: rgba(var(--v-theme-primary), 0.08);
|
||||||
|
color: rgb(var(--v-theme-primary));
|
||||||
|
border-color: rgba(var(--v-theme-primary), 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.site-hover {
|
||||||
|
background-color: rgba(var(--v-theme-primary), 0.04);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -143,7 +143,7 @@ onMounted(async () => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VDialog scrollable :close-on-back="false" eager max-width="50rem" :fullscreen="!display.mdAndUp.value">
|
<VDialog scrollable :close-on-back="false" eager max-width="45rem" :fullscreen="!display.mdAndUp.value">
|
||||||
<VCard
|
<VCard
|
||||||
:title="`${props.oper === 'add' ? '新增' : '编辑'}站点${props.oper !== 'add' ? ` - ${siteForm.name}` : ''}`"
|
:title="`${props.oper === 'add' ? '新增' : '编辑'}站点${props.oper !== 'add' ? ` - ${siteForm.name}` : ''}`"
|
||||||
class="rounded-t"
|
class="rounded-t"
|
||||||
|
|||||||
@@ -295,7 +295,7 @@ onBeforeMount(async () => {
|
|||||||
<VCard>
|
<VCard>
|
||||||
<VCardText class="d-flex align-center">
|
<VCardText class="d-flex align-center">
|
||||||
<div class="d-flex justify-space-between" style="inline-size: 100%">
|
<div class="d-flex justify-space-between" style="inline-size: 100%">
|
||||||
<div class="d-flex flex-column gap-y-1">
|
<div class="d-flex flex-column gap-y-1 overflow-hidden">
|
||||||
<span class="text-base">用户等级</span>
|
<span class="text-base">用户等级</span>
|
||||||
<h5 class="text-h5 d-flex align-center gap-2 text-wrap">
|
<h5 class="text-h5 d-flex align-center gap-2 text-wrap">
|
||||||
{{ siteData?.user_level || '无' }}
|
{{ siteData?.user_level || '无' }}
|
||||||
@@ -313,7 +313,7 @@ onBeforeMount(async () => {
|
|||||||
<VCard>
|
<VCard>
|
||||||
<VCardText class="d-flex align-center">
|
<VCardText class="d-flex align-center">
|
||||||
<div class="d-flex justify-space-between" style="inline-size: 100%">
|
<div class="d-flex justify-space-between" style="inline-size: 100%">
|
||||||
<div class="d-flex flex-column gap-y-1">
|
<div class="d-flex flex-column gap-y-1 overflow-hidden">
|
||||||
<span class="text-base">积分</span>
|
<span class="text-base">积分</span>
|
||||||
<h5 class="text-h5 d-flex align-center gap-2 text-wrap">
|
<h5 class="text-h5 d-flex align-center gap-2 text-wrap">
|
||||||
{{ siteData?.bonus?.toLocaleString() }}
|
{{ siteData?.bonus?.toLocaleString() }}
|
||||||
@@ -355,7 +355,7 @@ onBeforeMount(async () => {
|
|||||||
<VCard>
|
<VCard>
|
||||||
<VCardText class="d-flex align-center">
|
<VCardText class="d-flex align-center">
|
||||||
<div class="d-flex justify-space-between" style="inline-size: 100%">
|
<div class="d-flex justify-space-between" style="inline-size: 100%">
|
||||||
<div class="d-flex flex-column gap-y-1">
|
<div class="d-flex flex-column gap-y-1 overflow-hidden">
|
||||||
<span class="text-base">总上传量</span>
|
<span class="text-base">总上传量</span>
|
||||||
<h5 class="text-h5 d-flex align-center gap-2 text-wrap">
|
<h5 class="text-h5 d-flex align-center gap-2 text-wrap">
|
||||||
{{ formatFileSize(siteData?.upload || 0) }}
|
{{ formatFileSize(siteData?.upload || 0) }}
|
||||||
@@ -376,7 +376,7 @@ onBeforeMount(async () => {
|
|||||||
<VCard>
|
<VCard>
|
||||||
<VCardText class="d-flex align-center">
|
<VCardText class="d-flex align-center">
|
||||||
<div class="d-flex justify-space-between" style="inline-size: 100%">
|
<div class="d-flex justify-space-between" style="inline-size: 100%">
|
||||||
<div class="d-flex flex-column gap-y-1">
|
<div class="d-flex flex-column gap-y-1 overflow-hidden">
|
||||||
<span class="text-base">总下载量</span>
|
<span class="text-base">总下载量</span>
|
||||||
<h5 class="text-h5 d-flex align-center gap-2 text-wrap">
|
<h5 class="text-h5 d-flex align-center gap-2 text-wrap">
|
||||||
{{ formatFileSize(siteData?.download || 0) }}
|
{{ formatFileSize(siteData?.download || 0) }}
|
||||||
@@ -397,7 +397,7 @@ onBeforeMount(async () => {
|
|||||||
<VCard>
|
<VCard>
|
||||||
<VCardText class="d-flex align-center">
|
<VCardText class="d-flex align-center">
|
||||||
<div class="d-flex justify-space-between" style="inline-size: 100%">
|
<div class="d-flex justify-space-between" style="inline-size: 100%">
|
||||||
<div class="d-flex flex-column gap-y-1">
|
<div class="d-flex flex-column gap-y-1 overflow-hidden">
|
||||||
<span class="text-base">总做种数</span>
|
<span class="text-base">总做种数</span>
|
||||||
<h5 class="text-h5 d-flex align-center gap-2 text-wrap">
|
<h5 class="text-h5 d-flex align-center gap-2 text-wrap">
|
||||||
{{ siteData?.seeding?.toLocaleString() }}
|
{{ siteData?.seeding?.toLocaleString() }}
|
||||||
@@ -418,7 +418,7 @@ onBeforeMount(async () => {
|
|||||||
<VCard>
|
<VCard>
|
||||||
<VCardText class="d-flex align-center">
|
<VCardText class="d-flex align-center">
|
||||||
<div class="d-flex justify-space-between" style="inline-size: 100%">
|
<div class="d-flex justify-space-between" style="inline-size: 100%">
|
||||||
<div class="d-flex flex-column gap-y-1">
|
<div class="d-flex flex-column gap-y-1 overflow-hidden">
|
||||||
<span class="text-base">总做种体积</span>
|
<span class="text-base">总做种体积</span>
|
||||||
<h5 class="text-h5 d-flex align-center gap-2 text-wrap">
|
<h5 class="text-h5 d-flex align-center gap-2 text-wrap">
|
||||||
{{ formatFileSize(siteData?.seeding_size || 0) }}
|
{{ formatFileSize(siteData?.seeding_size || 0) }}
|
||||||
@@ -439,7 +439,7 @@ onBeforeMount(async () => {
|
|||||||
<VCard>
|
<VCard>
|
||||||
<VCardText class="d-flex align-center">
|
<VCardText class="d-flex align-center">
|
||||||
<div class="d-flex justify-space-between" style="inline-size: 100%">
|
<div class="d-flex justify-space-between" style="inline-size: 100%">
|
||||||
<div class="d-flex flex-column gap-y-1">
|
<div class="d-flex flex-column gap-y-1 overflow-hidden">
|
||||||
<span class="text-base">加入时间</span>
|
<span class="text-base">加入时间</span>
|
||||||
<h5 class="text-h5 d-flex align-center gap-2 text-wrap">
|
<h5 class="text-h5 d-flex align-center gap-2 text-wrap">
|
||||||
{{ siteData?.join_at?.split(' ')[0] }}
|
{{ siteData?.join_at?.split(' ')[0] }}
|
||||||
|
|||||||
@@ -64,6 +64,14 @@ const downloaderOptions = ref<{ title: string; value: string }[]>([])
|
|||||||
// 剧集组选项
|
// 剧集组选项
|
||||||
const episodeGroupOptions = ref<{ title: string; subtitle: string; value: number }[]>([])
|
const episodeGroupOptions = ref<{ title: string; subtitle: string; value: number }[]>([])
|
||||||
|
|
||||||
|
// 生成1到100季的下拉框选项
|
||||||
|
const seasonItems = ref(
|
||||||
|
Array.from({ length: 101 }, (_, i) => i).map(item => ({
|
||||||
|
title: `第 ${item} 季`,
|
||||||
|
value: item,
|
||||||
|
})),
|
||||||
|
)
|
||||||
|
|
||||||
// 剧集组选项属性
|
// 剧集组选项属性
|
||||||
function episodeGroupItemProps(item: { title: string; subtitle: string }) {
|
function episodeGroupItemProps(item: { title: string; subtitle: string }) {
|
||||||
return {
|
return {
|
||||||
@@ -526,7 +534,16 @@ onMounted(() => {
|
|||||||
persistent-hint
|
persistent-hint
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
<VCol cols="12" md="6" v-if="!props.default">
|
<VCol v-if="!props.default && subscribeForm.type === '电视剧'" cols="12" md="6">
|
||||||
|
<VSelect
|
||||||
|
v-model="subscribeForm.season"
|
||||||
|
:items="seasonItems"
|
||||||
|
label="指定季"
|
||||||
|
hint="指定任意季订阅"
|
||||||
|
persistent-hint
|
||||||
|
/>
|
||||||
|
</VCol>
|
||||||
|
<VCol cols="12" v-if="!props.default">
|
||||||
<VTextField
|
<VTextField
|
||||||
v-model="subscribeForm.media_category"
|
v-model="subscribeForm.media_category"
|
||||||
label="自定义类别"
|
label="自定义类别"
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ const statusItems = [
|
|||||||
|
|
||||||
// 扩展User类型以包含note字段
|
// 扩展User类型以包含note字段
|
||||||
interface ExtendedUser extends User {
|
interface ExtendedUser extends User {
|
||||||
nickname?: string;
|
nickname?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
// 用户编辑表单数据
|
// 用户编辑表单数据
|
||||||
@@ -79,7 +79,7 @@ const userForm = ref<ExtendedUser>({
|
|||||||
vocechat_userid: null,
|
vocechat_userid: null,
|
||||||
synologychat_userid: null,
|
synologychat_userid: null,
|
||||||
},
|
},
|
||||||
nickname: '', // 昵称字段
|
nickname: '', // 昵称字段
|
||||||
})
|
})
|
||||||
|
|
||||||
// 更新头像
|
// 更新头像
|
||||||
@@ -200,9 +200,9 @@ async function updateUser() {
|
|||||||
// 将nickname保存到settings中,后端可以直接处理JSON对象
|
// 将nickname保存到settings中,后端可以直接处理JSON对象
|
||||||
if (userForm.value.nickname) {
|
if (userForm.value.nickname) {
|
||||||
if (!userForm.value.settings) {
|
if (!userForm.value.settings) {
|
||||||
userForm.value.settings = {};
|
userForm.value.settings = {}
|
||||||
}
|
}
|
||||||
userForm.value.settings.nickname = userForm.value.nickname;
|
userForm.value.settings.nickname = userForm.value.nickname
|
||||||
}
|
}
|
||||||
|
|
||||||
const oldUserName = userForm.value.name
|
const oldUserName = userForm.value.name
|
||||||
@@ -213,7 +213,7 @@ async function updateUser() {
|
|||||||
startNProgress()
|
startNProgress()
|
||||||
try {
|
try {
|
||||||
// 确保昵称保存,使用一个临时变量存储完整数据
|
// 确保昵称保存,使用一个临时变量存储完整数据
|
||||||
const userData = { ...userForm.value };
|
const userData = { ...userForm.value }
|
||||||
|
|
||||||
const result: { [key: string]: any } = await api.put('user/', userData)
|
const result: { [key: string]: any } = await api.put('user/', userData)
|
||||||
|
|
||||||
@@ -286,7 +286,7 @@ onMounted(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VDialog scrollable :close-on-back="false" eager max-width="50rem" :fullscreen="!display.mdAndUp.value">
|
<VDialog scrollable :close-on-back="false" eager max-width="40rem" :fullscreen="!display.mdAndUp.value">
|
||||||
<VCard
|
<VCard
|
||||||
:title="`${props.oper === 'add' ? '新增' : '编辑'}用户${props.oper !== 'add' ? ` - ${userName}` : ''}`"
|
:title="`${props.oper === 'add' ? '新增' : '编辑'}用户${props.oper !== 'add' ? ` - ${userName}` : ''}`"
|
||||||
class="rounded-t"
|
class="rounded-t"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import * as Mousetrap from 'mousetrap'
|
import * as Mousetrap from 'mousetrap'
|
||||||
import SearchBarView from '@/views/system/SearchBarView.vue'
|
import SearchBarDialog from '@/components/dialog/SearchBarDialog.vue'
|
||||||
import { useDisplay } from 'vuetify'
|
import { useDisplay } from 'vuetify'
|
||||||
|
|
||||||
const display = useDisplay()
|
const display = useDisplay()
|
||||||
@@ -36,7 +36,7 @@ const metaKey = computed(() => (isMac() ? '⌘+K' : 'Ctrl+K'))
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<!-- 搜索弹窗 -->
|
<!-- 搜索弹窗 -->
|
||||||
<SearchBarView v-model="searchDialog" v-if="searchDialog" @close="searchDialog = false" />
|
<SearchBarDialog v-model="searchDialog" v-if="searchDialog" @close="searchDialog = false" />
|
||||||
</template>
|
</template>
|
||||||
<style type="scss" scoped>
|
<style type="scss" scoped>
|
||||||
.meta-key {
|
.meta-key {
|
||||||
|
|||||||
@@ -8,9 +8,10 @@ import NoDataFound from '@/components/NoDataFound.vue'
|
|||||||
import { doneNProgress, startNProgress } from '@/api/nprogress'
|
import { doneNProgress, startNProgress } from '@/api/nprogress'
|
||||||
import { formatSeason } from '@/@core/utils/formatters'
|
import { formatSeason } from '@/@core/utils/formatters'
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
import SubscribeEditDialog from '@/components/dialog/SubscribeEditDialog.vue'
|
|
||||||
import { isNullOrEmptyObject } from '@/@core/utils'
|
import { isNullOrEmptyObject } from '@/@core/utils'
|
||||||
import { useUserStore } from '@/stores'
|
import { useUserStore } from '@/stores'
|
||||||
|
import SubscribeEditDialog from '@/components/dialog/SubscribeEditDialog.vue'
|
||||||
|
import SearchSiteDialog from '@/components/dialog/SearchSiteDialog.vue'
|
||||||
|
|
||||||
// 输入参数
|
// 输入参数
|
||||||
const mediaProps = defineProps({
|
const mediaProps = defineProps({
|
||||||
@@ -68,17 +69,8 @@ const selectedSites = ref<number[]>([])
|
|||||||
// 搜索方式 title/imdbid
|
// 搜索方式 title/imdbid
|
||||||
const searchType = ref('title')
|
const searchType = ref('title')
|
||||||
|
|
||||||
// 全选/全不选按钮文字
|
// 选择站点对话框
|
||||||
const checkAllText = computed(() => (selectedSites.value.length === allSites.value.length ? '全不选' : '全选'))
|
const chooseSiteDialog = ref(false)
|
||||||
|
|
||||||
// 全选/全不选
|
|
||||||
function checkAllSitesorNot() {
|
|
||||||
if (selectedSites.value.length === allSites.value.length) {
|
|
||||||
selectedSites.value = []
|
|
||||||
} else {
|
|
||||||
selectedSites.value = allSites.value.map(item => item.id)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询所有站点
|
// 查询所有站点
|
||||||
async function querySites() {
|
async function querySites() {
|
||||||
@@ -503,10 +495,20 @@ function onSubscribeEditRemove() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 点击搜索
|
// 点击搜索
|
||||||
async function clickSearch() {
|
async function clickSearch(type: string) {
|
||||||
if (allSites.value?.length > 0) return
|
searchType.value = type
|
||||||
querySites()
|
if (allSites.value?.length == 0) {
|
||||||
querySelectedSites()
|
querySites()
|
||||||
|
querySelectedSites()
|
||||||
|
}
|
||||||
|
chooseSiteDialog.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
// 搜索多站点
|
||||||
|
function searchSites(sites: number[]) {
|
||||||
|
chooseSiteDialog.value = false
|
||||||
|
selectedSites.value = sites
|
||||||
|
handleSearch()
|
||||||
}
|
}
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
@@ -570,42 +572,18 @@ onBeforeMount(() => {
|
|||||||
variant="tonal"
|
variant="tonal"
|
||||||
color="info"
|
color="info"
|
||||||
class="mb-2"
|
class="mb-2"
|
||||||
@click="clickSearch"
|
|
||||||
>
|
>
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<VIcon icon="mdi-magnify" />
|
<VIcon icon="mdi-magnify" />
|
||||||
</template>
|
</template>
|
||||||
搜索资源
|
搜索资源
|
||||||
<VMenu activator="parent" close-on-content-click max-width="450">
|
<VMenu activator="parent" close-on-content-click>
|
||||||
<VList>
|
<VList>
|
||||||
<VListItem>
|
<VListItem @click="clickSearch('title')">
|
||||||
<VBtnToggle v-model="searchType" color="primary" @click.stop>
|
<VListItemTitle>标题</VListItemTitle>
|
||||||
<VBtn value="title">标题</VBtn>
|
|
||||||
<VBtn value="imdbid" v-show="mediaDetail.imdb_id">IMDB链接</VBtn>
|
|
||||||
</VBtnToggle>
|
|
||||||
</VListItem>
|
</VListItem>
|
||||||
<VListItem>
|
<VListItem @click="clickSearch('imdb')">
|
||||||
<VChipGroup v-model="selectedSites" column multiple @click.stop>
|
<VListItemTitle>IMDB链接</VListItemTitle>
|
||||||
<VChip
|
|
||||||
v-for="site in allSites"
|
|
||||||
:key="site.id"
|
|
||||||
:color="selectedSites.includes(site.id) ? 'primary' : ''"
|
|
||||||
filter
|
|
||||||
variant="outlined"
|
|
||||||
:value="site.id"
|
|
||||||
size="small"
|
|
||||||
>
|
|
||||||
{{ site.name }}
|
|
||||||
</VChip>
|
|
||||||
</VChipGroup>
|
|
||||||
<div>
|
|
||||||
<VBtn size="small" variant="text" @click.stop="checkAllSitesorNot">
|
|
||||||
{{ checkAllText }}
|
|
||||||
</VBtn>
|
|
||||||
</div>
|
|
||||||
</VListItem>
|
|
||||||
<VListItem>
|
|
||||||
<VBtn @click="handleSearch" block>搜索</VBtn>
|
|
||||||
</VListItem>
|
</VListItem>
|
||||||
</VList>
|
</VList>
|
||||||
</VMenu>
|
</VMenu>
|
||||||
@@ -974,6 +952,15 @@ onBeforeMount(() => {
|
|||||||
@save="subscribeEditDialog = false"
|
@save="subscribeEditDialog = false"
|
||||||
@remove="onSubscribeEditRemove"
|
@remove="onSubscribeEditRemove"
|
||||||
/>
|
/>
|
||||||
|
<!-- 站点选择对话框 -->
|
||||||
|
<SearchSiteDialog
|
||||||
|
v-if="chooseSiteDialog"
|
||||||
|
v-model="chooseSiteDialog"
|
||||||
|
:sites="allSites"
|
||||||
|
:selected="selectedSites"
|
||||||
|
@search="searchSites"
|
||||||
|
@close="chooseSiteDialog = false"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
Reference in New Issue
Block a user