Merge branch 'jxxghp:v2' into v2

This commit is contained in:
madrays
2025-04-08 01:05:39 +08:00
committed by GitHub
19 changed files with 1110 additions and 903 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "moviepilot", "name": "moviepilot",
"version": "2.3.7-1", "version": "2.3.8",
"private": true, "private": true,
"bin": "dist/service.js", "bin": "dist/service.js",
"scripts": { "scripts": {

View File

@@ -77,7 +77,9 @@ export interface Subscribe {
// 过滤规则组 // 过滤规则组
filter_groups?: string[] filter_groups?: string[]
// 下载器 // 下载器
downloader: string downloader?: string
// 自定义剧集组
episode_group?: string
} }
// 订阅分享 // 订阅分享
@@ -138,6 +140,8 @@ export interface SubscribeShare {
media_category?: string media_category?: string
// 复用次数 // 复用次数
count?: number count?: number
// 自定义剧集组
episode_group?: string
} }
// 历史记录 // 历史记录
@@ -286,6 +290,8 @@ export interface MediaInfo {
next_episode_to_air?: object next_episode_to_air?: object
// 别名 // 别名
names?: string[] names?: string[]
// 剧集组
episode_group?: string
} }
// 季信息 // 季信息
@@ -1214,6 +1220,8 @@ export interface TransferForm {
library_type_folder?: boolean library_type_folder?: boolean
// 媒体库类别子目录 // 媒体库类别子目录
library_category_folder?: boolean library_category_folder?: boolean
// 剧集组编号
episode_group?: string
} }
// 整理队列 // 整理队列

View File

@@ -134,6 +134,9 @@ const refreshPending = ref(false)
// 排序 // 排序
const sort = ref('name') const sort = ref('name')
// 是否显示目录树
const showDirTree = ref(false)
// 计算属性 // 计算属性
const storagesArray = computed(() => { const storagesArray = computed(() => {
const storageCodes = props.storages?.map(item => item.type) const storageCodes = props.storages?.map(item => item.type)
@@ -163,6 +166,11 @@ function sortChanged(s: string) {
refreshPending.value = true refreshPending.value = true
} }
// 切换目录树
function switchDirTree(state: boolean) {
showDirTree.value = state
}
// 文件列表 // 文件列表
const fileListItems = ref<FileItem[]>([]) const fileListItems = ref<FileItem[]>([])
@@ -203,6 +211,7 @@ const fileListStyle = computed(() => {
/> />
<div class="flex" :style="scrollStyle"> <div class="flex" :style="scrollStyle">
<FileNavigator <FileNavigator
v-if="showDirTree"
:storage="activeStorage" :storage="activeStorage"
:currentPath="item.path" :currentPath="item.path"
:items="fileListItems" :items="fileListItems"
@@ -220,12 +229,14 @@ const fileListStyle = computed(() => {
:refreshpending="refreshPending" :refreshpending="refreshPending"
:sort="sort" :sort="sort"
:listStyle="fileListStyle" :listStyle="fileListStyle"
:showTree="showDirTree"
@pathchanged="pathChanged" @pathchanged="pathChanged"
@loading="loadingChanged" @loading="loadingChanged"
@refreshed="refreshPending = false" @refreshed="refreshPending = false"
@filedeleted="refreshPending = true" @filedeleted="refreshPending = true"
@renamed="refreshPending = true" @renamed="refreshPending = true"
@items-updated="fileListUpdated" @items-updated="fileListUpdated"
@switch-tree="switchDirTree"
/> />
</div> </div>
</div> </div>

View File

@@ -1,17 +1,18 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { PropType, Ref } from 'vue'
import { useToast } from 'vue-toast-notification'
import SubscribeEditDialog from '../dialog/SubscribeEditDialog.vue'
import { formatSeason, formatRating } from '@/@core/utils/formatters'
import api from '@/api'
import { doneNProgress, startNProgress } from '@/api/nprogress'
import type { MediaInfo, NotExistMediaInfo, Subscribe, MediaSeason, Site } from '@/api/types'
import router, { registerAbortController } from '@/router'
import noImage from '@images/no-image.jpeg' import noImage from '@images/no-image.jpeg'
import tmdbImage from '@images/logos/tmdb.png' 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 api from '@/api'
import { useToast } from 'vue-toast-notification'
import { formatSeason, formatRating } from '@/@core/utils/formatters'
import { doneNProgress, startNProgress } from '@/api/nprogress'
import type { MediaInfo, Subscribe, MediaSeason, Site } from '@/api/types'
import router, { registerAbortController } from '@/router'
import { useUserStore } from '@/stores' import { useUserStore } from '@/stores'
import SubscribeEditDialog from '../dialog/SubscribeEditDialog.vue'
import SearchSiteDialog from '@/components/dialog/SearchSiteDialog.vue'
import SubscribeSeasonDialog from '../dialog/SubscribeSeasonDialog.vue'
// 输入参数 // 输入参数
const props = defineProps({ const props = defineProps({
@@ -35,18 +36,12 @@ const isImageLoaded = ref(false)
// 图片加载失败 // 图片加载失败
const imageLoadError = ref(false) const imageLoadError = ref(false)
// TMDB识别标志
const tmdbFlag = ref(true)
// 当前订阅状态 // 当前订阅状态
const isSubscribed = ref(false) const isSubscribed = ref(false)
// 本地存在状态 // 本地存在状态
const isExists = ref(false) const isExists = ref(false)
// 各季缺失状态0-已入库 1-部分缺失 2-全部缺失,没有数据也是已入库
const seasonsNotExisted = ref<{ [key: number]: number }>({})
// 订阅季弹窗 // 订阅季弹窗
const subscribeSeasonDialog = ref(false) const subscribeSeasonDialog = ref(false)
@@ -56,9 +51,6 @@ const subscribeEditDialog = ref(false)
// 订阅ID // 订阅ID
const subscribeId = ref<number>() const subscribeId = ref<number>()
// 季详情
const seasonInfos = ref<MediaSeason[]>([])
// 选中的订阅季 // 选中的订阅季
const seasonsSelected = ref<MediaSeason[]>([]) const seasonsSelected = ref<MediaSeason[]>([])
@@ -84,17 +76,11 @@ 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() { const episodeGroup = ref('')
if (selectedSites.value.length === allSites.value.length) {
selectedSites.value = []
} else {
selectedSites.value = allSites.value.map(item => item.id)
}
}
// 查询所有站点 // 查询所有站点
async function querySites() { async function querySites() {
@@ -112,7 +98,6 @@ async function querySites() {
async function querySelectedSites() { async function querySelectedSites() {
try { try {
const result: { [key: string]: any } = await api.get('system/setting/IndexerSites') const result: { [key: string]: any } = await api.get('system/setting/IndexerSites')
selectedSites.value = result.data?.value ?? [] selectedSites.value = result.data?.value ?? []
} catch (error) { } catch (error) {
console.log(error) console.log(error)
@@ -127,14 +112,6 @@ function getMediaId() {
else return `${props.media?.mediaid_prefix}:${props.media?.media_id}` else return `${props.media?.mediaid_prefix}:${props.media?.media_id}`
} }
// 订阅弹窗选择的多季
function subscribeSeasons() {
subscribeSeasonDialog.value = false
seasonsSelected.value.forEach(season => {
addSubscribe(season.season_number)
})
}
// 角标颜色 // 角标颜色
function getChipColor(type: string) { function getChipColor(type: string) {
if (type === '电影') return 'border-blue-500 bg-blue-600' if (type === '电影') return 'border-blue-500 bg-blue-600'
@@ -145,24 +122,9 @@ function getChipColor(type: string) {
// 添加订阅处理 // 添加订阅处理
async function handleAddSubscribe() { async function handleAddSubscribe() {
if (props.media?.type === '电视剧') { if (props.media?.type === '电视剧') {
// 查询所有季信息 // 弹出季选择列表,支持多选
await getMediaSeasons() seasonsSelected.value = []
if (!seasonInfos.value || seasonInfos.value.length === 0) { subscribeSeasonDialog.value = true
$toast.error(`${props.media?.title} 查询剧集信息失败!`)
return
}
// 检查各季的缺失状态
await checkSeasonsNotExists()
if (!tmdbFlag.value) return
if (seasonInfos.value.length === 1) {
// 添加订阅
addSubscribe(1)
} else {
// 弹出季选择列表,支持多选
seasonsSelected.value = []
subscribeSeasonDialog.value = true
}
} else { } else {
// 电影 // 电影
addSubscribe() addSubscribe()
@@ -170,15 +132,12 @@ async function handleAddSubscribe() {
} }
// 调用API添加订阅电视剧的话需要指定季 // 调用API添加订阅电视剧的话需要指定季
async function addSubscribe(season = 0) { async function addSubscribe(season: number = 0, best_version: number = 0) {
// 开始处理 // 开始处理
startNProgress() startNProgress()
try { try {
// 是否洗版 // 是否洗版
let best_version = isExists.value ? 1 : 0 if (!best_version && props.media?.type == '电影') best_version = isExists.value ? 1 : 0
if (season && props.media?.tmdb_id)
// 全部存在时洗版
best_version = !seasonsNotExisted.value[season] ? 1 : 0
// 请求API // 请求API
const result: { [key: string]: any } = await api.post('subscribe/', { const result: { [key: string]: any } = await api.post('subscribe/', {
name: props.media?.title, name: props.media?.title,
@@ -190,6 +149,7 @@ async function addSubscribe(season = 0) {
mediaid: props.media?.media_id ? `${props.media?.mediaid_prefix}:${props.media?.media_id}` : '', mediaid: props.media?.media_id ? `${props.media?.mediaid_prefix}:${props.media?.media_id}` : '',
season, season,
best_version, best_version,
episode_group: episodeGroup.value,
}) })
// 订阅状态 // 订阅状态
@@ -309,48 +269,6 @@ async function checkSubscribe(season = 0) {
return null return null
} }
// 检查所有季的缺失状态(数据库)
async function checkSeasonsNotExists() {
// 开始处理
startNProgress()
try {
const result: NotExistMediaInfo[] = await api.post('mediaserver/notexists', props.media)
if (result) {
result.forEach(item => {
// 0-已入库 1-部分缺失 2-全部缺失
let state = 0
if (item.episodes.length === 0) state = 2
else if (item.episodes.length < item.total_episode) state = 1
seasonsNotExisted.value[item.season] = state
})
}
} catch (error) {
$toast.error(`${props.media?.title}无法识别TMDB媒体信息`)
tmdbFlag.value = false
} finally {
// 处理完成
doneNProgress()
}
}
// 查询TMDB的所有季信息
async function getMediaSeasons() {
startNProgress()
try {
seasonInfos.value = await api.get('media/seasons', {
params: {
mediaid: getMediaId(),
title: props.media?.title,
year: props.media?.year,
season: props.media?.season,
},
})
} catch (error) {
console.error(error)
}
doneNProgress()
}
// 查询订阅弹窗规则 // 查询订阅弹窗规则
async function queryDefaultSubscribeConfig() { async function queryDefaultSubscribeConfig() {
// 非管理员不显示 // 非管理员不显示
@@ -359,9 +277,7 @@ async function queryDefaultSubscribeConfig() {
let subscribe_config_url = '' let subscribe_config_url = ''
if (props.media?.type === '电影') subscribe_config_url = 'system/setting/DefaultMovieSubscribeConfig' if (props.media?.type === '电影') subscribe_config_url = 'system/setting/DefaultMovieSubscribeConfig'
else subscribe_config_url = 'system/setting/DefaultTvSubscribeConfig' else subscribe_config_url = 'system/setting/DefaultTvSubscribeConfig'
const result: { [key: string]: any } = await api.get(subscribe_config_url) const result: { [key: string]: any } = await api.get(subscribe_config_url)
if (result.data?.value) return result.data.value.show_edit_dialog if (result.data?.value) return result.data.value.show_edit_dialog
} catch (error) { } catch (error) {
console.log(error) console.log(error)
@@ -375,24 +291,18 @@ function handleSubscribe() {
else handleAddSubscribe() else handleAddSubscribe()
} }
// 计算存在状态的颜色 // 订阅多季
function getExistColor(season: number) { function subscribeSeasons(seasons: MediaSeason[], seasonNoExists: { [key: number]: number }, groudId: string) {
const state = seasonsNotExisted.value[season] subscribeSeasonDialog.value = false
if (!state) return 'success' episodeGroup.value = groudId
seasonsSelected.value = seasons || []
if (state === 1) return 'warning' seasonsSelected.value.forEach(season => {
else if (state === 2) return 'error' let best_version = 0
else return 'success' if (season && props.media?.tmdb_id)
} // 全部存在时洗版
best_version = !seasonNoExists[season.season_number || 0] ? 1 : 0
// 计算存在状态的文本 addSubscribe(season.season_number, best_version)
function getExistText(season: number) { })
const state = seasonsNotExisted.value[season]
if (!state) return '已入库'
if (state === 1) return '部分缺失'
else if (state === 2) return '缺失'
else return '已入库'
} }
// 打开详情页 // 打开详情页
@@ -423,9 +333,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 +356,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) {
@@ -496,26 +415,6 @@ const getImgUrl: Ref<string> = computed(() => {
return url return url
}) })
// 拼装季图片地址
function getSeasonPoster(posterPath: string) {
if (!posterPath) return ''
return `https://${globalSettings.TMDB_IMAGE_DOMAIN}/t/p/w500${posterPath}`
}
// 将yyyy-mm-dd转换为yyyy年mm月dd日
function formatAirDate(airDate: string) {
if (!airDate) return ''
const date = new Date(airDate.replaceAll(/-/g, '/'))
return `${date.getFullYear()}${date.getMonth() + 1}${date.getDate()}`
}
// 从yyyy-mm-dd中提取年份
function getYear(airDate: string) {
if (!airDate) return ''
const date = new Date(airDate.replaceAll(/-/g, '/'))
return date.getFullYear()
}
// 移除订阅 // 移除订阅
function onRemoveSubscribe() { function onRemoveSubscribe() {
subscribeEditDialog.value = false subscribeEditDialog.value = false
@@ -566,36 +465,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>
@@ -636,62 +506,13 @@ function onRemoveSubscribe() {
</template> </template>
</VHover> </VHover>
<!-- 订阅季弹窗 --> <!-- 订阅季弹窗 -->
<VBottomSheet v-if="subscribeSeasonDialog" v-model="subscribeSeasonDialog" inset scrollable> <subscribeSeasonDialog
<VCard class="rounded-t"> v-if="subscribeSeasonDialog"
<DialogCloseBtn @click="subscribeSeasonDialog = false" /> v-model="subscribeSeasonDialog"
<VCardItem> :media="media"
<VCardTitle class="pe-10"> 订阅 - {{ props.media?.title }} </VCardTitle> @subscribe="subscribeSeasons"
</VCardItem> @close="subscribeSeasonDialog = false"
<VDivider /> />
<VCardText>
<VList v-model:selected="seasonsSelected" lines="three" select-strategy="classic">
<VListItem v-for="(item, i) in seasonInfos" :key="i" :value="item">
<template #prepend>
<VImg
height="90"
width="60"
:src="getSeasonPoster(item.poster_path || '')"
aspect-ratio="2/3"
class="object-cover rounded shadow ring-gray-500 me-3"
cover
>
<template #placeholder>
<div class="w-full h-full">
<VSkeletonLoader class="object-cover aspect-w-2 aspect-h-3" />
</div>
</template>
</VImg>
</template>
<VListItemTitle> {{ item.season_number }} </VListItemTitle>
<VListItemSubtitle class="mt-1 me-2">
<VChip v-if="item.vote_average" color="primary" size="small" class="mb-1">
<VIcon icon="mdi-star" /> {{ item.vote_average }}
</VChip>
{{ getYear(item.air_date || '') }} {{ item.episode_count }}
</VListItemSubtitle>
<VListItemSubtitle>
{{ media?.title }} {{ item.season_number }} 季于 {{ formatAirDate(item.air_date || '') }} 首播
</VListItemSubtitle>
<VListItemSubtitle>
<VChip v-if="seasonsNotExisted" class="mt-2" size="small" :color="getExistColor(item.season_number || 0)">
{{ getExistText(item.season_number || 0) }}
</VChip>
</VListItemSubtitle>
<template #append="{ isSelected }">
<VListItemAction start>
<VSwitch :model-value="isSelected" />
</VListItemAction>
</template>
</VListItem>
</VList>
</VCardText>
<div class="my-2 text-center">
<VBtn size="large" :disabled="seasonsSelected.length === 0" width="30%" @click="subscribeSeasons">
{{ seasonsSelected.length === 0 ? '请选择订阅季' : '提交订阅' }}
</VBtn>
</div>
</VCard>
</VBottomSheet>
<!-- 订阅编辑弹窗 --> <!-- 订阅编辑弹窗 -->
<SubscribeEditDialog <SubscribeEditDialog
v-if="subscribeEditDialog" v-if="subscribeEditDialog"
@@ -701,4 +522,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>

View File

@@ -9,6 +9,7 @@ import api from '@/api'
import type { Site, SiteStatistic, SiteUserData } from '@/api/types' import type { Site, SiteStatistic, SiteUserData } from '@/api/types'
import { isNullOrEmptyObject } from '@/@core/utils' import { isNullOrEmptyObject } from '@/@core/utils'
import { formatFileSize } from '@/@core/utils/formatters' import { formatFileSize } from '@/@core/utils/formatters'
import { useConfirm } from 'vuetify-use-dialog'
// 输入参数 // 输入参数
const cardProps = defineProps({ const cardProps = defineProps({
@@ -19,6 +20,9 @@ const cardProps = defineProps({
// 定义触发的自定义事件 // 定义触发的自定义事件
const emit = defineEmits(['update', 'remove']) const emit = defineEmits(['update', 'remove'])
// 确认框
const createConfirm = useConfirm()
// 图标 // 图标
const siteIcon = ref<string>('') const siteIcon = ref<string>('')
@@ -103,6 +107,25 @@ function openSitePage() {
window.open(cardProps.site?.url, '_blank') window.open(cardProps.site?.url, '_blank')
} }
// 调用API删除站点信息
async function deleteSiteInfo() {
const isConfirmed = await createConfirm({
title: '确认',
content: `是否确认删除站点?`,
})
if (!isConfirmed) return
try {
const result: { [key: string]: any } = await api.delete(`site/${cardProps.site?.id}`)
if (result.success) emit('remove')
else $toast.error(`${cardProps.site?.name} 删除失败:${result.message}`)
} catch (error) {
$toast.error(`${cardProps.site?.name} 删除失败!`)
console.error(error)
}
}
// 根据站点状态显示不同的状态图标 // 根据站点状态显示不同的状态图标
const statColor = computed(() => { const statColor = computed(() => {
if (isNullOrEmptyObject(siteStats.value)) { if (isNullOrEmptyObject(siteStats.value)) {
@@ -288,8 +311,9 @@ onMounted(() => {
<div class="site-card-actions"> <div class="site-card-actions">
<VTooltip> <VTooltip>
<template #activator="{ props }"> <template #activator="{ props }">
<button <IconBtn
v-bind="props" v-bind="props"
elevation="0"
class="site-action-btn test-btn" class="site-action-btn test-btn"
@click.stop="testSite" @click.stop="testSite"
:class="{ 'testing': testButtonDisable }" :class="{ 'testing': testButtonDisable }"
@@ -304,42 +328,39 @@ onMounted(() => {
</div> </div>
<span class="loading-text">测试中</span> <span class="loading-text">测试中</span>
</div> </div>
</button> </IconBtn>
</template> </template>
<span>测试站点连通性</span> <span>测试站点连通性</span>
</VTooltip> </VTooltip>
<VTooltip v-if="!cardProps.site?.public">
<VTooltip>
<template #activator="{ props }"> <template #activator="{ props }">
<button v-bind="props" 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" />
</button> </IconBtn>
</template> </template>
<span>查看站点数据</span> <span>查看站点数据</span>
</VTooltip> </VTooltip>
<VTooltip v-if="!cardProps.site?.public"> <VTooltip v-if="!cardProps.site?.public">
<template #activator="{ props }"> <template #activator="{ props }">
<button v-bind="props" class="site-action-btn" @click.stop="handleSiteUpdate"> <IconBtn v-bind="props" elevation="0" class="site-action-btn" @click.stop="handleSiteUpdate">
<VIcon icon="mdi-refresh" size="18" /> <VIcon icon="mdi-refresh" size="18" />
</button> </IconBtn>
</template> </template>
<span>更新Cookie/UA</span> <span>更新Cookie/UA</span>
</VTooltip> </VTooltip>
<VTooltip> <VTooltip>
<template #activator="{ props }"> <template #activator="{ props }">
<button v-bind="props" class="site-action-btn more-btn"> <IconBtn v-bind="props" elevation="0" class="site-action-btn more-btn">
<VIcon icon="mdi-dots-vertical" size="18" /> <VIcon icon="mdi-dots-vertical" size="18" />
<VMenu activator="parent" close-on-content-click location="left"> <VMenu activator="parent" close-on-content-click location="left">
<VList density="compact" nav class="dropdown-menu"> <VList density="compact" nav class="dropdown-menu">
<VListItem variant="plain" @click.stop="siteEditDialog = true" base-color="info"> <VListItem variant="plain" @click="siteEditDialog = true" base-color="info">
<template #prepend> <template #prepend>
<VIcon icon="mdi-file-edit-outline" size="small" /> <VIcon icon="mdi-file-edit-outline" size="small" />
</template> </template>
<VListItemTitle>编辑站点</VListItemTitle> <VListItemTitle>编辑站点</VListItemTitle>
</VListItem> </VListItem>
<VListItem variant="plain" @click.stop="emit('remove')"> <VListItem variant="plain" @click="deleteSiteInfo">
<template #prepend> <template #prepend>
<VIcon icon="mdi-delete-outline" size="small" color="error" /> <VIcon icon="mdi-delete-outline" size="small" color="error" />
</template> </template>
@@ -347,7 +368,7 @@ onMounted(() => {
</VListItem> </VListItem>
</VList> </VList>
</VMenu> </VMenu>
</button> </IconBtn>
</template> </template>
<span>更多操作</span> <span>更多操作</span>
</VTooltip> </VTooltip>
@@ -387,19 +408,19 @@ onMounted(() => {
<style scoped> <style scoped>
.site-card { .site-card {
background: rgba(var(--v-theme-surface), 0.95);
border-radius: 10px;
border: 1px solid rgba(var(--v-theme-on-surface), 0.09);
transition: all 0.3s ease;
cursor: pointer;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
border: 1px solid rgba(var(--v-theme-on-surface), 0.09);
border-radius: 10px;
background: rgba(var(--v-theme-surface), 0.95);
cursor: pointer;
transition: all 0.3s ease;
} }
.site-card:hover { .site-card:hover {
transform: translateY(-4px);
border-color: rgba(var(--v-theme-primary), 0.2); border-color: rgba(var(--v-theme-primary), 0.2);
box-shadow: 0 3px 12px -6px rgba(0, 0, 0, 0.1); box-shadow: 0 3px 12px -6px rgba(0, 0, 0, 10%);
transform: translateY(-4px);
} }
.inactive { .inactive {
@@ -408,19 +429,19 @@ onMounted(() => {
.site-card-content { .site-card-content {
z-index: 1; z-index: 1;
padding: 10px 12px 10px; padding-block: 10px;
padding-inline: 12px;
} }
/* 站点状态指示器 - 更精致的渐变指示 */ /* 站点状态指示器 - 更精致的渐变指示 */
.site-status-indicator { .site-status-indicator {
position: absolute; position: absolute;
top: 0;
left: 0;
right: 0;
height: 2px;
opacity: 0.5;
z-index: 1; z-index: 1;
transition: height 0.3s ease, opacity 0.3s ease; block-size: 2px;
inset-block-start: 0;
inset-inline: 0;
opacity: 0.5;
transition: block-size 0.3s ease, opacity 0.3s ease;
} }
.site-status-indicator.error { .site-status-indicator.error {
@@ -445,7 +466,7 @@ onMounted(() => {
/* 站点卡片悬停时状态指示器变化 */ /* 站点卡片悬停时状态指示器变化 */
.site-card:hover .site-status-indicator { .site-card:hover .site-status-indicator {
height: 2px; block-size: 2px;
opacity: 0.8; opacity: 0.8;
} }
@@ -457,9 +478,9 @@ onMounted(() => {
/* 数据显示相关样式 */ /* 数据显示相关样式 */
.data-transfer-stats { .data-transfer-stats {
margin-top: 6px; border-block-start: 1px solid rgba(var(--v-theme-on-surface), 0.05);
padding-top: 6px; margin-block-start: 6px;
border-top: 1px solid rgba(var(--v-theme-on-surface), 0.05); padding-block-start: 6px;
} }
.data-row { .data-row {
@@ -467,62 +488,59 @@ onMounted(() => {
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
gap: 12px; gap: 12px;
margin-bottom: 6px; margin-block-end: 6px;
} }
.data-row:last-child { .data-row:last-child {
margin-bottom: 0; margin-block-end: 0;
} }
.data-label { .data-label {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 0.8rem;
color: rgba(var(--v-theme-on-surface), 0.8); color: rgba(var(--v-theme-on-surface), 0.8);
min-width: 70px; font-size: 0.8rem;
min-inline-size: 70px;
} }
.data-progress-bar { .data-progress-bar {
position: relative; position: relative;
height: 4px;
overflow: hidden; overflow: hidden;
flex-grow: 1;
border-radius: 4px; border-radius: 4px;
background: rgba(var(--v-theme-on-surface), 0.08); background: rgba(var(--v-theme-on-surface), 0.08);
flex-grow: 1; block-size: 4px;
} }
.progress-filled { .progress-filled {
position: absolute; position: absolute;
left: 0;
top: 0;
height: 100%;
min-width: 3px;
border-radius: 4px;
transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
overflow: hidden; overflow: hidden;
border-radius: 4px;
block-size: 100%;
inset-block-start: 0;
inset-inline-start: 0;
min-inline-size: 3px;
transition: inline-size 0.5s cubic-bezier(0.4, 0, 0.2, 1);
} }
.upload-filled { .upload-filled {
background: linear-gradient(90deg, #4d79ff, #0077ff);
box-shadow: 0 0 4px rgba(0, 119, 255, 0.5);
animation: pulse-width 2s infinite; animation: pulse-width 2s infinite;
background: linear-gradient(90deg, #4d79ff, #07f);
box-shadow: 0 0 4px rgba(0, 119, 255, 50%);
} }
.download-filled { .download-filled {
background: linear-gradient(90deg, #42d392, #00b77e);
box-shadow: 0 0 4px rgba(0, 183, 126, 0.5);
animation: pulse-width 2s infinite; animation: pulse-width 2s infinite;
background: linear-gradient(90deg, #42d392, #00b77e);
box-shadow: 0 0 4px rgba(0, 183, 126, 50%);
} }
.progress-glow { .progress-glow {
position: absolute; position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
background-size: 200% 100%;
animation: shimmer 1.5s linear infinite; animation: shimmer 1.5s linear infinite;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 50%), transparent);
background-size: 200% 100%;
inset: 0;
} }
@keyframes pulse-width { @keyframes pulse-width {
@@ -530,6 +548,7 @@ onMounted(() => {
100% { 100% {
opacity: 0.85; opacity: 0.85;
} }
50% { 50% {
opacity: 1; opacity: 1;
} }
@@ -539,6 +558,7 @@ onMounted(() => {
0% { 0% {
background-position: -100% 0; background-position: -100% 0;
} }
100% { 100% {
background-position: 100% 0; background-position: 100% 0;
} }
@@ -546,24 +566,24 @@ onMounted(() => {
/* 速度等级样式 */ /* 速度等级样式 */
.speed-idle { .speed-idle {
width: 5% !important;
opacity: 0.5;
animation: none !important; animation: none !important;
inline-size: 5% !important;
opacity: 0.5;
} }
.speed-low { .speed-low {
width: 30% !important;
animation-duration: 6s !important; animation-duration: 6s !important;
inline-size: 30% !important;
} }
.speed-medium { .speed-medium {
width: 50% !important;
animation-duration: 4s !important; animation-duration: 4s !important;
inline-size: 50% !important;
} }
.speed-high { .speed-high {
width: 70% !important;
animation-duration: 2s !important; animation-duration: 2s !important;
inline-size: 70% !important;
} }
@keyframes pulse-width { @keyframes pulse-width {
@@ -571,6 +591,7 @@ onMounted(() => {
100% { 100% {
transform: scaleX(0.95); transform: scaleX(0.95);
} }
50% { 50% {
transform: scaleX(1.05); transform: scaleX(1.05);
} }
@@ -580,6 +601,7 @@ onMounted(() => {
0% { 0% {
background-position: -200% 0; background-position: -200% 0;
} }
100% { 100% {
background-position: 200% 0; background-position: 200% 0;
} }
@@ -587,14 +609,14 @@ onMounted(() => {
/* 站点图标 */ /* 站点图标 */
.site-icon-container { .site-icon-container {
width: 38px;
height: 38px;
border-radius: 8px;
overflow: hidden;
position: relative; position: relative;
transition: transform 0.2s ease; overflow: hidden;
border-radius: 8px;
block-size: 38px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 6%);
cursor: pointer; cursor: pointer;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06); inline-size: 38px;
transition: transform 0.2s ease;
} }
.site-icon-container:hover { .site-icon-container:hover {
@@ -602,18 +624,18 @@ onMounted(() => {
} }
.site-icon { .site-icon {
width: 100%; block-size: 100%;
height: 100%; inline-size: 100%;
object-fit: cover; object-fit: cover;
} }
.site-icon-edit-overlay { .site-icon-edit-overlay {
position: absolute; position: absolute;
inset: 0;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background-color: rgba(0, 0, 0, 0.5); background-color: rgba(0, 0, 0, 50%);
inset: 0;
opacity: 0; opacity: 0;
transition: opacity 0.2s ease; transition: opacity 0.2s ease;
} }
@@ -631,10 +653,10 @@ onMounted(() => {
/* 站点网址 */ /* 站点网址 */
.site-url { .site-url {
font-size: 0.9rem;
color: rgba(var(--v-theme-on-surface), 0.6); color: rgba(var(--v-theme-on-surface), 0.6);
transition: color 0.2s ease;
cursor: pointer; cursor: pointer;
font-size: 0.9rem;
transition: color 0.2s ease;
} }
.site-url:hover { .site-url:hover {
@@ -643,46 +665,46 @@ onMounted(() => {
/* 站点特性图标 */ /* 站点特性图标 */
.site-feature-icon { .site-feature-icon {
opacity: 0.85;
color: rgba(var(--v-theme-primary), 0.95); color: rgba(var(--v-theme-primary), 0.95);
filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 5%));
margin-block: 0;
margin-inline: 1px;
opacity: 0.85;
transition: all 0.2s ease; transition: all 0.2s ease;
filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.05));
margin: 0 1px;
} }
.site-feature-icon:hover { .site-feature-icon:hover {
filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 10%));
opacity: 1; opacity: 1;
transform: translateY(-1px); transform: translateY(-1px);
filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.1));
} }
/* 特性标签 */ /* 特性标签 */
.site-features { .site-features {
margin-top: 0; margin-block-start: 0;
} }
/* 数据统计 */ /* 数据统计 */
.site-stats { .site-stats {
margin-top: auto; margin-block-start: auto;
border-top: 1px solid rgba(var(--v-theme-on-surface), 0.05); padding-block-start: 1rem;
padding-top: 6px;
} }
.site-data-values { .site-data-values {
font-size: 12px;
color: rgba(var(--v-theme-on-surface), 0.8); color: rgba(var(--v-theme-on-surface), 0.8);
font-size: 12px;
} }
.site-data-bar { .site-data-bar {
height: 3px;
border-radius: 1.5px;
overflow: hidden; overflow: hidden;
border-radius: 1.5px;
block-size: 3px;
} }
.site-data-bar-bg { .site-data-bar-bg {
position: absolute; position: absolute;
inset: 0;
background-color: rgba(var(--v-theme-on-surface), 0.05); background-color: rgba(var(--v-theme-on-surface), 0.05);
inset: 0;
} }
.site-data-bar-upload { .site-data-bar-upload {
@@ -709,103 +731,101 @@ onMounted(() => {
/* 操作按钮 */ /* 操作按钮 */
.site-card-actions { .site-card-actions {
position: absolute; position: absolute;
right: 0; z-index: 20;
top: 0;
bottom: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 8px 4px;
background: rgba(var(--v-theme-surface), 0.97); background: rgba(var(--v-theme-surface), 0.97);
border-inline-start: 1px solid rgba(var(--v-theme-on-surface), 0.06);
inset-block: 0;
inset-inline-end: 0;
padding-block: 8px;
padding-inline: 4px;
transform: translateX(100%); transform: translateX(100%);
transition: transform 0.2s ease; transition: transform 0.2s ease;
z-index: 20;
border-left: 1px solid rgba(var(--v-theme-on-surface), 0.06);
} }
/* 测试按钮特殊样式 */ /* 测试按钮特殊样式 */
.test-btn { .test-btn {
width: 40px !important; position: relative;
min-width: 40px;
height: 40px !important;
padding: 0;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
position: relative; padding: 0;
border-radius: 50% !important; border-radius: 50% !important;
margin-bottom: 12px; block-size: 40px !important;
inline-size: 40px !important;
margin-block-end: 12px;
min-inline-size: 40px;
} }
.test-btn-content { .test-btn-content {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 100%; block-size: 100%;
height: 100%; inline-size: 100%;
} }
.loading-overlay { .loading-overlay {
position: absolute; position: absolute;
top: 0; z-index: 10;
left: 0;
right: 0;
bottom: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background: rgba(var(--v-theme-surface), 0.95);
border-radius: 50%; border-radius: 50%;
z-index: 10;
animation: fade-in 0.2s ease; animation: fade-in 0.2s ease;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); background: rgba(var(--v-theme-surface), 0.95);
box-shadow: 0 2px 10px rgba(0, 0, 0, 10%);
inset: 0;
} }
.loading-spinner { .loading-spinner {
position: relative; position: relative;
width: 24px; block-size: 24px;
height: 24px; inline-size: 24px;
} }
.spinner-circle { .spinner-circle {
position: absolute; position: absolute;
width: 100%;
height: 100%;
border: 2px solid rgba(var(--v-theme-primary), 0.2); border: 2px solid rgba(var(--v-theme-primary), 0.2);
border-top-color: rgba(var(--v-theme-primary), 1);
border-radius: 50%; border-radius: 50%;
animation: spin 0.8s linear infinite; animation: spin 0.8s linear infinite;
block-size: 100%;
border-block-start-color: rgba(var(--v-theme-primary), 1);
inline-size: 100%;
} }
.spinner-circle-dot { .spinner-circle-dot {
position: absolute; position: absolute;
top: 0;
left: 50%;
width: 4px;
height: 4px;
margin-left: -2px;
margin-top: -2px;
background-color: rgba(var(--v-theme-primary), 1);
border-radius: 50%; border-radius: 50%;
animation: spin 0.8s linear infinite reverse; animation: spin 0.8s linear infinite reverse;
background-color: rgba(var(--v-theme-primary), 1);
block-size: 4px;
inline-size: 4px;
inset-block-start: 0;
inset-inline-start: 50%;
margin-block-start: -2px;
margin-inline-start: -2px;
} }
@keyframes spin { @keyframes spin {
0% { 0% {
transform: rotate(0deg); transform: rotate(0deg);
} }
100% { 100% {
transform: rotate(360deg); transform: rotate(360deg);
} }
} }
.loading-text { .loading-text {
position: absolute;
color: rgba(var(--v-theme-primary), 1);
font-size: 12px; font-size: 12px;
font-weight: 500; font-weight: 500;
margin-top: 4px; inset-block-end: -20px;
color: rgba(var(--v-theme-primary), 1); margin-block-start: 4px;
position: absolute;
bottom: -20px;
white-space: nowrap; white-space: nowrap;
} }
@@ -813,40 +833,41 @@ onMounted(() => {
from { from {
opacity: 0; opacity: 0;
} }
to { to {
opacity: 1; opacity: 1;
} }
} }
.pulse-dot { .pulse-dot {
width: 22px;
height: 22px;
border-radius: 50%;
position: relative; position: relative;
border-radius: 50%;
background-color: transparent; background-color: transparent;
block-size: 22px;
box-shadow: inset 0 0 0 2px rgba(var(--v-theme-on-surface), 0.1); box-shadow: inset 0 0 0 2px rgba(var(--v-theme-on-surface), 0.1);
inline-size: 22px;
} }
.pulse-dot::before { .pulse-dot::before {
content: '';
position: absolute; position: absolute;
width: 70%;
height: 70%;
top: 15%;
left: 15%;
border-radius: 50%;
z-index: 1; z-index: 1;
border-radius: 50%;
block-size: 70%;
content: '';
inline-size: 70%;
inset-block-start: 15%;
inset-inline-start: 15%;
} }
.pulse-dot::after { .pulse-dot::after {
content: '';
position: absolute; position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
border-radius: 50%;
z-index: 2; z-index: 2;
border-radius: 50%;
block-size: 100%;
content: '';
inline-size: 100%;
inset-block-start: 0;
inset-inline-start: 0;
} }
.pulse-dot.error::before { .pulse-dot.error::before {
@@ -855,8 +876,8 @@ onMounted(() => {
} }
.pulse-dot.error::after { .pulse-dot.error::after {
box-shadow: 0 0 0 2px rgba(var(--v-theme-error), 0.3);
animation: pulse-animation-error 2s infinite; animation: pulse-animation-error 2s infinite;
box-shadow: 0 0 0 2px rgba(var(--v-theme-error), 0.3);
} }
.pulse-dot.warning::before { .pulse-dot.warning::before {
@@ -865,8 +886,8 @@ onMounted(() => {
} }
.pulse-dot.warning::after { .pulse-dot.warning::after {
box-shadow: 0 0 0 2px rgba(var(--v-theme-warning), 0.3);
animation: pulse-animation-warning 2s infinite; animation: pulse-animation-warning 2s infinite;
box-shadow: 0 0 0 2px rgba(var(--v-theme-warning), 0.3);
} }
.pulse-dot.success::before { .pulse-dot.success::before {
@@ -875,8 +896,8 @@ onMounted(() => {
} }
.pulse-dot.success::after { .pulse-dot.success::after {
box-shadow: 0 0 0 2px rgba(var(--v-theme-success), 0.3);
animation: pulse-animation-success 2s infinite; animation: pulse-animation-success 2s infinite;
box-shadow: 0 0 0 2px rgba(var(--v-theme-success), 0.3);
} }
.pulse-dot.secondary::before { .pulse-dot.secondary::before {
@@ -885,17 +906,19 @@ onMounted(() => {
} }
.pulse-dot.secondary::after { .pulse-dot.secondary::after {
box-shadow: 0 0 0 2px rgba(var(--v-theme-secondary), 0.3);
animation: pulse-animation-secondary 2s infinite; animation: pulse-animation-secondary 2s infinite;
box-shadow: 0 0 0 2px rgba(var(--v-theme-secondary), 0.3);
} }
@keyframes pulse-animation-error { @keyframes pulse-animation-error {
0% { 0% {
box-shadow: 0 0 0 0 rgba(var(--v-theme-error), 0.6); box-shadow: 0 0 0 0 rgba(var(--v-theme-error), 0.6);
} }
70% { 70% {
box-shadow: 0 0 0 10px rgba(var(--v-theme-error), 0); box-shadow: 0 0 0 10px rgba(var(--v-theme-error), 0);
} }
100% { 100% {
box-shadow: 0 0 0 0 rgba(var(--v-theme-error), 0); box-shadow: 0 0 0 0 rgba(var(--v-theme-error), 0);
} }
@@ -905,9 +928,11 @@ onMounted(() => {
0% { 0% {
box-shadow: 0 0 0 0 rgba(var(--v-theme-warning), 0.6); box-shadow: 0 0 0 0 rgba(var(--v-theme-warning), 0.6);
} }
70% { 70% {
box-shadow: 0 0 0 10px rgba(var(--v-theme-warning), 0); box-shadow: 0 0 0 10px rgba(var(--v-theme-warning), 0);
} }
100% { 100% {
box-shadow: 0 0 0 0 rgba(var(--v-theme-warning), 0); box-shadow: 0 0 0 0 rgba(var(--v-theme-warning), 0);
} }
@@ -917,9 +942,11 @@ onMounted(() => {
0% { 0% {
box-shadow: 0 0 0 0 rgba(var(--v-theme-success), 0.6); box-shadow: 0 0 0 0 rgba(var(--v-theme-success), 0.6);
} }
70% { 70% {
box-shadow: 0 0 0 10px rgba(var(--v-theme-success), 0); box-shadow: 0 0 0 10px rgba(var(--v-theme-success), 0);
} }
100% { 100% {
box-shadow: 0 0 0 0 rgba(var(--v-theme-success), 0); box-shadow: 0 0 0 0 rgba(var(--v-theme-success), 0);
} }
@@ -929,9 +956,11 @@ onMounted(() => {
0% { 0% {
box-shadow: 0 0 0 0 rgba(var(--v-theme-secondary), 0.6); box-shadow: 0 0 0 0 rgba(var(--v-theme-secondary), 0.6);
} }
70% { 70% {
box-shadow: 0 0 0 10px rgba(var(--v-theme-secondary), 0); box-shadow: 0 0 0 10px rgba(var(--v-theme-secondary), 0);
} }
100% { 100% {
box-shadow: 0 0 0 0 rgba(var(--v-theme-secondary), 0); box-shadow: 0 0 0 0 rgba(var(--v-theme-secondary), 0);
} }
@@ -942,37 +971,37 @@ onMounted(() => {
} }
.site-action-btn { .site-action-btn {
width: 36px; position: relative;
height: 36px;
display: flex; display: flex;
overflow: hidden;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border-radius: 8px;
margin-bottom: 8px;
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
background-color: rgba(var(--v-theme-surface), 1);
color: rgba(var(--v-theme-on-surface), 0.8);
border: none; border: none;
border-radius: 8px;
background-color: rgba(var(--v-theme-surface), 1);
block-size: 32px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 5%);
color: rgba(var(--v-theme-on-surface), 0.8);
cursor: pointer; cursor: pointer;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); inline-size: 36px;
position: relative; margin-block-end: 4px;
overflow: hidden; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
} }
.site-action-btn::before { .site-action-btn::before {
content: '';
position: absolute; position: absolute;
inset: 0;
background: radial-gradient(circle at center, rgba(var(--v-theme-primary), 0.1), transparent 70%); background: radial-gradient(circle at center, rgba(var(--v-theme-primary), 0.1), transparent 70%);
content: '';
inset: 0;
opacity: 0; opacity: 0;
transition: opacity 0.3s ease; transition: opacity 0.3s ease;
} }
.site-action-btn:hover { .site-action-btn:hover {
background-color: white; background-color: white;
box-shadow: 0 3px 6px rgba(0, 0, 0, 10%);
color: rgba(var(--v-theme-primary), 1); color: rgba(var(--v-theme-primary), 1);
transform: translateY(-2px); transform: translateY(-2px);
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
} }
.site-action-btn:hover::before { .site-action-btn:hover::before {
@@ -987,31 +1016,32 @@ onMounted(() => {
0% { 0% {
box-shadow: 0 0 0 0 rgba(var(--v-theme-primary), 0.4); box-shadow: 0 0 0 0 rgba(var(--v-theme-primary), 0.4);
} }
70% { 70% {
box-shadow: 0 0 0 6px rgba(var(--v-theme-primary), 0); box-shadow: 0 0 0 6px rgba(var(--v-theme-primary), 0);
} }
100% { 100% {
box-shadow: 0 0 0 0 rgba(var(--v-theme-primary), 0); box-shadow: 0 0 0 0 rgba(var(--v-theme-primary), 0);
} }
} }
.site-action-btn.more-btn { .site-action-btn.more-btn {
margin-bottom: 0; margin-block: auto 0;
margin-top: auto;
} }
.dropdown-menu { .dropdown-menu {
border-radius: 8px;
overflow: hidden; overflow: hidden;
border-radius: 8px;
} }
.feature-icon-wrapper { .feature-icon-wrapper {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 24px;
height: 24px;
border-radius: 4px; border-radius: 4px;
block-size: 24px;
inline-size: 24px;
transition: background-color 0.2s ease; transition: background-color 0.2s ease;
} }

View File

@@ -7,7 +7,7 @@ const props = defineProps({
<template> <template>
<!-- 手动整理进度框 --> <!-- 手动整理进度框 -->
<VDialog :scrim="false" width="25rem"> <VDialog :scrim="false" width="25rem">
<VCard color="primary"> <VCard color="primary" rounded="md">
<VCardText class="text-center"> <VCardText class="text-center">
{{ props.text }} {{ props.text }}
<VProgressLinear color="white" class="mb-0 mt-1" :model-value="props.value" indeterminate /> <VProgressLinear color="white" class="mb-0 mt-1" :model-value="props.value" indeterminate />

View File

@@ -87,6 +87,7 @@ const transferForm = reactive<TransferForm>({
// 所有媒体库目录 // 所有媒体库目录
const directories = ref<TransferDirectoryConf[]>([]) const directories = ref<TransferDirectoryConf[]>([])
// 查询目录 // 查询目录
async function loadDirectories() { async function loadDirectories() {
try { try {
@@ -221,7 +222,7 @@ onUnmounted(() => {
</script> </script>
<template> <template>
<VDialog scrollable max-width="50rem" :fullscreen="!display.mdAndUp.value"> <VDialog scrollable max-width="45rem" :fullscreen="!display.mdAndUp.value">
<VCard :title="dialogTitle" class="rounded-t"> <VCard :title="dialogTitle" class="rounded-t">
<DialogCloseBtn @click="emit('close')" /> <DialogCloseBtn @click="emit('close')" />
<VDivider /> <VDivider />
@@ -263,7 +264,7 @@ onUnmounted(() => {
</VCol> </VCol>
</VRow> </VRow>
<VRow> <VRow>
<VCol cols="12" md="4"> <VCol cols="12" md="6">
<VSelect <VSelect
v-model="transferForm.type_name" v-model="transferForm.type_name"
label="类型" label="类型"
@@ -276,7 +277,7 @@ onUnmounted(() => {
persistent-hint persistent-hint
/> />
</VCol> </VCol>
<VCol cols="12" md="4"> <VCol cols="12" md="6">
<VTextField <VTextField
v-if="mediaSource === 'themoviedb'" v-if="mediaSource === 'themoviedb'"
v-model="transferForm.tmdbid" v-model="transferForm.tmdbid"
@@ -302,19 +303,37 @@ onUnmounted(() => {
@click:append-inner="mediaSelectorDialog = true" @click:append-inner="mediaSelectorDialog = true"
/> />
</VCol> </VCol>
<VCol cols="12" md="4"> </VRow>
<VSelect <VRow v-show="transferForm.type_name === '电视剧'">
v-show="transferForm.type_name === '电视剧'" <VCol cols="12" md="6">
v-model.number="transferForm.season" <VTextField
label="季" v-model="transferForm.episode_group"
:items="seasonItems" label="剧集组编号"
hint="指定季数" placeholder="手动查询剧集组"
hint="指定剧集组"
persistent-hint persistent-hint
/> />
</VCol> </VCol>
</VRow> <VCol cols="12" md="3">
<VRow> <VSelect
<VCol cols="12" md="8"> v-model.number="transferForm.season"
label="季"
:items="seasonItems"
hint="第几季"
persistent-hint
/>
</VCol>
<VCol cols="12" md="3">
<VTextField
v-model="transferForm.episode_detail"
:disabled="disableEpisodeDetail"
label="集"
placeholder="起始集,终止集"
hint="集数或范围如1或1,2"
persistent-hint
/>
</VCol>
<VCol cols="12" md="6">
<VTextField <VTextField
v-model="transferForm.episode_format" v-model="transferForm.episode_format"
label="集数定位" label="集数定位"
@@ -323,26 +342,7 @@ onUnmounted(() => {
persistent-hint persistent-hint
/> />
</VCol> </VCol>
<VCol cols="12" md="4"> <VCol cols="12" md="6">
<VTextField
v-model="transferForm.episode_detail"
:disabled="disableEpisodeDetail"
label="指定集数"
placeholder="起始集,终止集如1或1,2"
hint="指定集数或范围如1或1,2"
persistent-hint
/>
</VCol>
<VCol cols="12" md="4">
<VTextField
v-model="transferForm.episode_part"
label="指定Part"
placeholder="如part1"
hint="指定Part如part1"
persistent-hint
/>
</VCol>
<VCol cols="12" md="4">
<VTextField <VTextField
v-model="transferForm.episode_offset" v-model="transferForm.episode_offset"
label="集数偏移" label="集数偏移"
@@ -351,7 +351,18 @@ onUnmounted(() => {
persistent-hint persistent-hint
/> />
</VCol> </VCol>
<VCol cols="12" md="4"> </VRow>
<VRow>
<VCol cols="12" md="6">
<VTextField
v-model="transferForm.episode_part"
label="指定Part"
placeholder="如part1"
hint="指定Part如part1"
persistent-hint
/>
</VCol>
<VCol cols="12" md="6">
<VTextField <VTextField
v-model.number="transferForm.min_filesize" v-model.number="transferForm.min_filesize"
label="最小文件大小MB" label="最小文件大小MB"

View File

@@ -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'
// // propsmodelValue
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
// propsmodelValue //
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 {
@@ -204,7 +171,7 @@ const loadUserSitePreferences = async () => {
console.log('从本地加载站点选择:', selectedSites.value) console.log('从本地加载站点选择:', selectedSites.value)
return return
} }
// //
const result = await api.get('system/setting/IndexerSites') const result = await api.get('system/setting/IndexerSites')
if (result && result.data && result.data.value) { if (result && result.data && result.data.value) {
@@ -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)
@@ -381,9 +364,9 @@ onMounted(() => {
</template> </template>
</DialogCloseBtn> </DialogCloseBtn>
</VCardItem> </VCardItem>
<VDivider class="search-divider" /> <VDivider class="search-divider" />
<!-- 主搜索结果区域 --> <!-- 主搜索结果区域 -->
<VCardText class="search-results-container pa-0"> <VCardText class="search-results-container pa-0">
<!-- 有搜索词时显示结果 --> <!-- 有搜索词时显示结果 -->
@@ -392,7 +375,7 @@ onMounted(() => {
<VListSubheader class="primary-text font-weight-medium text-uppercase py-2 px-4 px-sm-6"> <VListSubheader class="primary-text font-weight-medium text-uppercase py-2 px-4 px-sm-6">
<span class="category-title">媒体搜索</span> <span class="category-title">媒体搜索</span>
</VListSubheader> </VListSubheader>
<!-- 媒体搜索选项 --> <!-- 媒体搜索选项 -->
<VHover> <VHover>
<template #default="hover"> <template #default="hover">
@@ -406,16 +389,14 @@ 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-movie-search" icon="mdi-movie-search"
:color="hover.isHovering ? 'primary' : 'medium-emphasis'" :color="hover.isHovering ? 'primary' : 'medium-emphasis'"
size="small" 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>
@@ -425,7 +406,7 @@ onMounted(() => {
</VListItem> </VListItem>
</template> </template>
</VHover> </VHover>
<VHover> <VHover>
<template #default="hover"> <template #default="hover">
<VListItem <VListItem
@@ -438,16 +419,14 @@ 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-movie-filter" icon="mdi-movie-filter"
:color="hover.isHovering ? 'primary' : 'medium-emphasis'" :color="hover.isHovering ? 'primary' : 'medium-emphasis'"
size="small" 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>
@@ -457,29 +436,27 @@ onMounted(() => {
</VListItem> </VListItem>
</template> </template>
</VHover> </VHover>
<VHover> <VHover>
<template #default="hover"> <template #default="hover">
<VListItem <VListItem
density="comfortable" density="comfortable"
link link
rounded="xl" rounded="xl"
v-bind="hover.props" v-bind="hover.props"
@click="searchMedia('person')" @click="searchMedia('person')"
class="search-option mx-2 mx-sm-4 my-1" class="search-option mx-2 mx-sm-4 my-1"
> >
<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-account-search" icon="mdi-account-search"
:color="hover.isHovering ? 'primary' : 'medium-emphasis'" :color="hover.isHovering ? 'primary' : 'medium-emphasis'"
size="small" 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>
@@ -489,29 +466,23 @@ onMounted(() => {
</VListItem> </VListItem>
</template> </template>
</VHover> </VHover>
<VHover v-if="superUser"> <VHover v-if="superUser">
<template #default="hover"> <template #default="hover">
<VListItem <VListItem
density="comfortable" density="comfortable"
link link
rounded="xl" rounded="xl"
v-bind="hover.props" v-bind="hover.props"
@click="searchHistory" @click="searchHistory"
class="search-option mx-2 mx-sm-4 my-1" class="search-option mx-2 mx-sm-4 my-1"
> >
<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>
@@ -525,14 +496,11 @@ onMounted(() => {
<!-- 其他搜索结果 --> <!-- 其他搜索结果 -->
<template v-if="matchedSubscribeItems.length > 0"> <template v-if="matchedSubscribeItems.length > 0">
<VDivider class="mx-4 mx-sm-6 my-2 search-divider" /> <VDivider class="mx-4 mx-sm-6 my-2 search-divider" />
<VListSubheader class="primary-text font-weight-medium text-uppercase py-2 px-4 px-sm-6"> <VListSubheader class="primary-text font-weight-medium text-uppercase py-2 px-4 px-sm-6">
<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"
@@ -544,17 +512,18 @@ 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="subscribe.type === '电影' ? 'mdi-movie-roll' : 'mdi-television-classic'" :icon="subscribe.type === '电影' ? 'mdi-movie-roll' : 'mdi-television-classic'"
:color="hover.isHovering ? 'primary' : 'medium-emphasis'" :color="hover.isHovering ? 'primary' : 'medium-emphasis'"
size="small" size="small"
/> />
</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 }}
</VListItemSubtitle> </VListItemSubtitle>
<template #append> <template #append>
@@ -564,13 +533,13 @@ onMounted(() => {
</template> </template>
</VHover> </VHover>
</template> </template>
<template v-if="matchedMenuItems.length > 0"> <template v-if="matchedMenuItems.length > 0">
<VDivider class="mx-4 mx-sm-6 my-2 search-divider" /> <VDivider class="mx-4 mx-sm-6 my-2 search-divider" />
<VListSubheader class="primary-text font-weight-medium text-uppercase py-2 px-4 px-sm-6"> <VListSubheader class="primary-text font-weight-medium text-uppercase py-2 px-4 px-sm-6">
<span class="category-title">功能菜单</span> <span class="category-title">功能菜单</span>
</VListSubheader> </VListSubheader>
<VHover v-for="menu in matchedMenuItems" :key="menu.title"> <VHover v-for="menu in matchedMenuItems" :key="menu.title">
<template #default="hover"> <template #default="hover">
<VListItem <VListItem
@@ -583,8 +552,8 @@ 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="menu.icon as string" :icon="menu.icon as string"
:color="hover.isHovering ? 'primary' : 'medium-emphasis'" :color="hover.isHovering ? 'primary' : 'medium-emphasis'"
size="small" size="small"
/> />
@@ -593,7 +562,7 @@ onMounted(() => {
<VListItemTitle class="text-subtitle-1 font-weight-medium"> <VListItemTitle class="text-subtitle-1 font-weight-medium">
{{ menu.title }} {{ menu.title }}
</VListItemTitle> </VListItemTitle>
<VListItemSubtitle v-if="menu.description" class="text-body-2 text-medium-emphasis mt-1"> <VListItemSubtitle v-if="menu.description" class="text-body-2 text-medium-emphasis mt-1">
{{ menu.description }} {{ menu.description }}
</VListItemSubtitle> </VListItemSubtitle>
<template #append> <template #append>
@@ -603,13 +572,13 @@ onMounted(() => {
</template> </template>
</VHover> </VHover>
</template> </template>
<template v-if="matchedPluginItems.length > 0"> <template v-if="matchedPluginItems.length > 0">
<VDivider class="mx-4 mx-sm-6 my-2 search-divider" /> <VDivider class="mx-4 mx-sm-6 my-2 search-divider" />
<VListSubheader class="primary-text font-weight-medium text-uppercase py-2 px-4 px-sm-6"> <VListSubheader class="primary-text font-weight-medium text-uppercase py-2 px-4 px-sm-6">
<span class="category-title">插件</span> <span class="category-title">插件</span>
</VListSubheader> </VListSubheader>
<VHover v-for="plugin in matchedPluginItems" :key="plugin.id"> <VHover v-for="plugin in matchedPluginItems" :key="plugin.id">
<template #default="hover"> <template #default="hover">
<VListItem <VListItem
@@ -622,18 +591,14 @@ 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">
{{ plugin.plugin_name }} {{ plugin.plugin_name }}
</VListItemTitle> </VListItemTitle>
<VListItemSubtitle class="text-body-2 text-medium-emphasis mt-1"> <VListItemSubtitle class="text-body-2 text-medium-emphasis mt-1">
{{ plugin.plugin_desc }} {{ plugin.plugin_desc }}
</VListItemSubtitle> </VListItemSubtitle>
<template #append> <template #append>
<VIcon v-if="hover.isHovering" icon="mdi-chevron-right" color="primary" /> <VIcon v-if="hover.isHovering" icon="mdi-chevron-right" color="primary" />
@@ -642,15 +607,15 @@ onMounted(() => {
</template> </template>
</VHover> </VHover>
</template> </template>
<!-- 将站点资源搜索移到最底部 --> <!-- 将站点资源搜索移到最底部 -->
<template v-if="searchWord"> <template v-if="searchWord">
<VDivider class="mx-4 mx-sm-6 my-2 search-divider" /> <VDivider class="mx-4 mx-sm-6 my-2 search-divider" />
<VListSubheader class="primary-text font-weight-medium text-uppercase py-2 px-4 px-sm-6"> <VListSubheader class="primary-text font-weight-medium text-uppercase py-2 px-4 px-sm-6">
<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">
@@ -663,20 +628,19 @@ onMounted(() => {
搜索 <span class="primary-text font-weight-medium">{{ searchWord }}</span> 相关资源 搜索 <span class="primary-text font-weight-medium">{{ searchWord }}</span> 相关资源
</div> </div>
</div> </div>
<VBtn <VBtn
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"
> >
搜索 搜索
</VBtn> </VBtn>
</div> </div>
<div class="d-flex align-center flex-wrap site-chips-container mt-1 py-2 px-2 px-sm-3"> <div class="d-flex align-center flex-wrap site-chips-container mt-1 py-2 px-2 px-sm-3">
<div class="d-flex align-center flex-wrap flex-grow-1"> <div class="d-flex align-center flex-wrap flex-grow-1">
<VChip <VChip
@@ -706,8 +670,8 @@ onMounted(() => {
+{{ selectedSites.length - 5 }} +{{ selectedSites.length - 5 }}
</VChip> </VChip>
</div> </div>
<VBtn <VBtn
size="small" size="small"
variant="tonal" variant="tonal"
color="primary" color="primary"
@click="openSiteDialog" @click="openSiteDialog"
@@ -722,7 +686,7 @@ onMounted(() => {
</VCard> </VCard>
</template> </template>
</VList> </VList>
<!-- 无搜索词时显示最近搜索和提示 --> <!-- 无搜索词时显示最近搜索和提示 -->
<div v-else class="recent-searches py-6 px-4 px-sm-6"> <div v-else class="recent-searches py-6 px-4 px-sm-6">
<div v-if="recentSearches.length > 0" class="mb-6"> <div v-if="recentSearches.length > 0" class="mb-6">
@@ -742,7 +706,7 @@ onMounted(() => {
</VChip> </VChip>
</div> </div>
</div> </div>
<div class="text-center mt-6 py-6 empty-search-state"> <div class="text-center mt-6 py-6 empty-search-state">
<div class="search-icon-wrapper mx-auto mb-4"> <div class="search-icon-wrapper mx-auto mb-4">
<VIcon icon="mdi-magnify" size="large" color="primary" /> <VIcon icon="mdi-magnify" size="large" color="primary" />
@@ -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,26 +893,31 @@ 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;
} }
.search-input { .search-input {
font-size: 14px; font-size: 14px;
} }
.close-btn { .close-btn {
right: 0.8rem; right: 0.8rem;
top: 0.8rem; top: 1rem;
width: 32px; width: 32px;
height: 32px; height: 32px;
} }
.site-chips-container { .site-chips-container {
padding: 6px 8px; padding: 6px 8px;
} }
.site-select-btn { .site-select-btn {
min-height: 28px; min-height: 28px;
font-size: 11px; font-size: 11px;

View File

@@ -0,0 +1,224 @@
<script setup lang="ts">
import type { Site, Plugin, Subscribe } from '@/api/types'
import { popScopeId, 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 || [])
watch(() => props.selected, value => {
if (selectedSites.value.length == 0 && value) {
selectedSites.value = value
}
})
// 全选/全不选按钮文字
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" 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>

View File

@@ -5,14 +5,10 @@ import { doneNProgress, startNProgress } from '@/api/nprogress'
import { numberValidator, requiredValidator } from '@/@validators' import { numberValidator, requiredValidator } from '@/@validators'
import api from '@/api' import api from '@/api'
import { useDisplay } from 'vuetify' import { useDisplay } from 'vuetify'
import { useConfirm } from 'vuetify-use-dialog'
// 显示器宽度 // 显示器宽度
const display = useDisplay() const display = useDisplay()
// 确认框
const createConfirm = useConfirm()
// 输入参数 // 输入参数
const props = defineProps({ const props = defineProps({
siteid: Number, siteid: Number,
@@ -108,25 +104,6 @@ async function addSite() {
doneNProgress() doneNProgress()
} }
// 调用API删除站点信息
async function deleteSiteInfo() {
const isConfirmed = await createConfirm({
title: '确认',
content: `是否确认删除站点?`,
})
if (!isConfirmed) return
try {
const result: { [key: string]: any } = await api.delete(`site/${siteForm.value?.id}`)
if (result.success) emit('remove')
else $toast.error(`${siteForm.value?.name} 删除失败:${result.message}`)
} catch (error) {
$toast.error(`${siteForm.value?.name} 删除失败!`)
console.error(error)
}
}
// 调用API更新站点信息 // 调用API更新站点信息
async function updateSiteInfo() { async function updateSiteInfo() {
startNProgress() startNProgress()
@@ -166,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"
@@ -338,9 +315,6 @@ onMounted(async () => {
</VForm> </VForm>
</VCardText> </VCardText>
<VCardActions class="pt-3"> <VCardActions class="pt-3">
<VBtn v-if="props.oper !== 'add'" color="error" @click="deleteSiteInfo" variant="outlined" class="me-3">
删除
</VBtn>
<VSpacer /> <VSpacer />
<VBtn <VBtn
v-if="props.oper === 'add'" v-if="props.oper === 'add'"

View File

@@ -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] }}

View File

@@ -5,7 +5,6 @@ import api from '@/api'
import type { DownloaderConf, FilterRuleGroup, Site, Subscribe, TransferDirectoryConf } from '@/api/types' import type { DownloaderConf, FilterRuleGroup, Site, Subscribe, TransferDirectoryConf } from '@/api/types'
import { useDisplay } from 'vuetify' import { useDisplay } from 'vuetify'
import { useConfirm } from 'vuetify-use-dialog' import { useConfirm } from 'vuetify-use-dialog'
import { VTextarea, VTextField } from 'vuetify/lib/components/index.mjs'
// 显示器宽度 // 显示器宽度
const display = useDisplay() const display = useDisplay()
@@ -53,6 +52,7 @@ const subscribeForm = ref<Subscribe>({
downloader: '', downloader: '',
date: '', date: '',
show_edit_dialog: false, show_edit_dialog: false,
episode_group: '',
}) })
// 提示框 // 提示框
@@ -61,6 +61,47 @@ const $toast = useToast()
// 下载器选项 // 下载器选项
const downloaderOptions = ref<{ title: string; value: string }[]>([]) const downloaderOptions = ref<{ title: string; value: string }[]>([])
// 所有剧集组
const episodeGroups = ref<{ [key: string]: any }[]>([])
// 剧集组选项
const episodeGroupOptions = computed(() => {
return (episodeGroups.value as { id: number; name: string; group_count: number; episode_count: number }[]).map(
item => {
return {
title: item.name,
subtitle: `${item.group_count} 季 • ${item.episode_count}`,
value: item.id,
}
},
)
})
// 生成1到100季的下拉框选项
const seasonItems = ref(
Array.from({ length: 101 }, (_, i) => i).map(item => ({
title: `${item}`,
value: item,
})),
)
// 剧集组选项属性
function episodeGroupItemProps(item: { title: string; subtitle: string }) {
return {
title: item.title,
subtitle: item.subtitle,
}
}
// 查询所有剧集组
async function getEpisodeGroups() {
try {
episodeGroups.value = await api.get(`media/groups/${subscribeForm.value.tmdbid}`)
} catch (error) {
console.error(error)
}
}
async function loadDownloaderSetting() { async function loadDownloaderSetting() {
try { try {
const downloaders: DownloaderConf[] = await api.get('download/clients') const downloaders: DownloaderConf[] = await api.get('download/clients')
@@ -178,6 +219,8 @@ async function getSubscribeInfo() {
subscribeForm.value = result subscribeForm.value = result
subscribeForm.value.best_version = subscribeForm.value.best_version === 1 subscribeForm.value.best_version = subscribeForm.value.best_version === 1
subscribeForm.value.search_imdbid = subscribeForm.value.search_imdbid === 1 subscribeForm.value.search_imdbid = subscribeForm.value.search_imdbid === 1
// 加载剧集组
if (subscribeForm.value.type == '电视剧') getEpisodeGroups()
} catch (e) { } catch (e) {
console.log(e) console.log(e)
} }
@@ -317,7 +360,7 @@ onMounted(() => {
</script> </script>
<template> <template>
<VDialog scrollable max-width="50rem" :fullscreen="!display.mdAndUp.value"> <VDialog scrollable max-width="45rem" :fullscreen="!display.mdAndUp.value">
<VCard <VCard
:title="`${ :title="`${
props.default props.default
@@ -480,7 +523,7 @@ onMounted(() => {
</VCol> </VCol>
</VRow> </VRow>
<VRow> <VRow>
<VCol cols="12" md="6"> <VCol cols="12">
<VSelect <VSelect
v-model="subscribeForm.filter_groups" v-model="subscribeForm.filter_groups"
:items="filterRuleGroupOptions" :items="filterRuleGroupOptions"
@@ -492,7 +535,26 @@ 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.episode_group"
:items="episodeGroupOptions"
:item-props="episodeGroupItemProps"
label="指定剧集组"
hint="按特定剧集组识别和刮削"
persistent-hint
/>
</VCol>
<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="自定义类别"

View File

@@ -0,0 +1,262 @@
<script lang="ts" setup>
import api from '@/api'
import { MediaInfo, MediaSeason, NotExistMediaInfo } from '@/api/types'
import { PropType } from 'vue'
import NoDataFound from '@/components/NoDataFound.vue'
// 定义事件
const emit = defineEmits(['subscribe', 'close'])
// 定义输入
const props = defineProps({
media: Object as PropType<MediaInfo>,
})
// 从 provide 中获取全局设置
const globalSettings: any = inject('globalSettings')
// 季详情
const seasonInfos = ref<MediaSeason[]>([])
// 选中的订阅季
const seasonsSelected = ref<MediaSeason[]>([])
// 各季缺失状态0-已入库 1-部分缺失 2-全部缺失,没有数据也是已入库
const seasonsNotExisted = ref<{ [key: number]: number }>({})
// 是否刷新过
const isRefreshed = ref(false)
// 所有剧集组
const episodeGroups = ref<{ [key: string]: any }[]>([])
// 当前选择剧集组
const episodeGroup = ref('')
// 剧集组选项属性
function episodeGroupItemProps(item: { title: string; subtitle: string }) {
return {
title: item.title,
subtitle: item.subtitle,
}
}
// 剧集组选项
const episodeGroupOptions = computed(() => {
let options = (episodeGroups.value as { id: string; name: string; group_count: number; episode_count: number }[]).map(
item => {
return {
title: item.name,
subtitle: `${item.group_count} 季 • ${item.episode_count}`,
value: item.id,
}
},
)
// 添加不使用选项
options.unshift({
title: '默认',
subtitle: `${seasonInfos.value.length}`,
value: '',
})
return options
})
// 获得mediaid
function getMediaId() {
if (props.media?.tmdb_id) return `tmdb:${props.media?.tmdb_id}`
else if (props.media?.douban_id) return `douban:${props.media?.douban_id}`
else if (props.media?.bangumi_id) return `bangumi:${props.media?.bangumi_id}`
else return `${props.media?.mediaid_prefix}:${props.media?.media_id}`
}
// 查询所有剧集组
async function getEpisodeGroups() {
try {
episodeGroups.value = await api.get(`media/groups/${props.media?.tmdb_id}`)
} catch (error) {
console.error(error)
}
}
// 查询TMDB的所有季信息
async function getMediaSeasons() {
try {
seasonInfos.value = await api.get('media/seasons', {
params: {
mediaid: getMediaId(),
title: props.media?.title,
year: props.media?.year,
season: props.media?.season,
},
})
isRefreshed.value = true
} catch (error) {
console.error(error)
}
}
// 查询剧集组的剧集
async function getGroupSeasons() {
if (!episodeGroup.value) return
isRefreshed.value = false
try {
seasonInfos.value = await api.get(`media/group/seasons/${episodeGroup.value}`)
} catch (error) {
console.error(error)
}
isRefreshed.value = true
}
// 检查所有季的缺失状态(数据库)
async function checkSeasonsNotExists() {
// 开始处理
try {
let tmpMedia = props.media ?? { episode_group: '' }
if (episodeGroup.value) tmpMedia.episode_group = episodeGroup.value
else tmpMedia.episode_group = ''
const result: NotExistMediaInfo[] = await api.post('mediaserver/notexists', tmpMedia)
if (result) {
result.forEach(item => {
// 0-已入库 1-部分缺失 2-全部缺失
let state = 0
if (item.episodes.length === 0) state = 2
else if (item.episodes.length < item.total_episode) state = 1
seasonsNotExisted.value[item.season] = state
})
}
} catch (error) {
console.error(error)
}
}
// 计算存在状态的颜色
function getExistColor(season: number) {
const state = seasonsNotExisted.value[season]
if (!state) return 'success'
if (state === 1) return 'warning'
else if (state === 2) return 'error'
else return 'success'
}
// 计算存在状态的文本
function getExistText(season: number) {
const state = seasonsNotExisted.value[season]
if (!state) return '已入库'
if (state === 1) return '部分缺失'
else if (state === 2) return '缺失'
else return '已入库'
}
// 拼装季图片地址
function getSeasonPoster(posterPath: string) {
if (!posterPath) return props.media?.poster_path
return `https://${globalSettings.TMDB_IMAGE_DOMAIN}/t/p/w500${posterPath}`
}
// 将yyyy-mm-dd转换为yyyy年mm月dd日
function formatAirDate(airDate: string) {
if (!airDate) return ''
const date = new Date(airDate.replaceAll(/-/g, '/'))
return `${date.getFullYear()}${date.getMonth() + 1}${date.getDate()}`
}
// 从yyyy-mm-dd中提取年份
function getYear(airDate: string) {
if (!airDate) return ''
const date = new Date(airDate.replaceAll(/-/g, '/'))
return date.getFullYear()
}
function subscribeSeasons() {
emit('subscribe', seasonsSelected.value, seasonsNotExisted.value, episodeGroup.value)
}
watchEffect(() => {
if (episodeGroup.value) getGroupSeasons()
else getMediaSeasons()
checkSeasonsNotExists()
})
onMounted(async () => {
getMediaSeasons()
getEpisodeGroups()
checkSeasonsNotExists()
})
</script>
<template>
<VBottomSheet inset scrollable>
<VCard class="rounded-t">
<DialogCloseBtn @click="emit('close')" />
<VCardItem>
<VCardTitle class="pe-10"> 订阅 - {{ props.media?.title }} </VCardTitle>
</VCardItem>
<VDivider />
<VCardText>
<VSelect
v-model="episodeGroup"
:items="episodeGroupOptions"
:item-props="episodeGroupItemProps"
label="选择剧集组"
persistent-hint
/>
<LoadingBanner v-if="!isRefreshed" class="mt-5" />
<div v-else-if="seasonInfos.length > 0">
<VList v-model:selected="seasonsSelected" lines="three" select-strategy="classic">
<VListItem v-for="(item, i) in seasonInfos" :key="i" :value="item">
<template #prepend>
<VImg
height="90"
width="60"
:src="getSeasonPoster(item.poster_path || '')"
aspect-ratio="2/3"
class="object-cover rounded shadow ring-gray-500 me-3"
cover
>
<template #placeholder>
<div class="w-full h-full">
<VSkeletonLoader class="object-cover aspect-w-2 aspect-h-3" />
</div>
</template>
</VImg>
</template>
<VListItemTitle> {{ item.season_number }} </VListItemTitle>
<VListItemSubtitle class="mt-1 me-2">
<VChip v-if="item.vote_average" color="primary" size="small" class="mb-1">
<VIcon icon="mdi-star" /> {{ item.vote_average }}
</VChip>
{{ getYear(item.air_date || '') }} {{ item.episode_count }}
</VListItemSubtitle>
<VListItemSubtitle>
{{ media?.title }} {{ item.season_number }} 季于 {{ formatAirDate(item.air_date || '') }} 首播
</VListItemSubtitle>
<VListItemSubtitle>
<VChip
v-if="seasonsNotExisted"
class="mt-2"
size="small"
:color="getExistColor(item.season_number || 0)"
>
{{ getExistText(item.season_number || 0) }}
</VChip>
</VListItemSubtitle>
<template #append="{ isSelected }">
<VListItemAction start>
<VSwitch :model-value="isSelected" />
</VListItemAction>
</template>
</VListItem>
</VList>
</div>
<NoDataFound v-else errorTitle="出错啦!" :errorDescription="`${props.media?.title} 未查询到季集信息`" />
</VCardText>
<div class="my-2 text-center">
<VBtn :disabled="seasonsSelected.length === 0" width="30%" @click="subscribeSeasons">
{{ seasonsSelected.length === 0 ? '请选择订阅季' : '提交订阅' }}
</VBtn>
</div>
</VCard>
</VBottomSheet>
</template>

View File

@@ -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: '', // 昵称字段
}) })
// 更新头像 // 更新头像
@@ -196,15 +196,15 @@ async function updateUser() {
} }
userForm.value.password = newPassword.value userForm.value.password = newPassword.value
} }
// 将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
userForm.value.name = currentUserName.value userForm.value.name = currentUserName.value
const oldAvatar = userForm.value.avatar const oldAvatar = userForm.value.avatar
@@ -213,10 +213,10 @@ 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)
if (result.success) { if (result.success) {
if (oldUserName !== currentUserName.value) { if (oldUserName !== currentUserName.value) {
$toast.success(`${oldUserName}】更名【${currentUserName.value}】, 更新成功!`) $toast.success(`${oldUserName}】更名【${currentUserName.value}】, 更新成功!`)
@@ -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"

View File

@@ -30,10 +30,19 @@ const inProps = defineProps({
}, },
sort: String, sort: String,
listStyle: 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() const createConfirm = useConfirm()
@@ -369,6 +378,11 @@ function formatTime(timestape: number) {
return new Date(timestape * 1000).toLocaleString() return new Date(timestape * 1000).toLocaleString()
} }
// 切换文件树显示
function switchFileTree(state: boolean) {
emit('switch-tree', state)
}
// 监听refreshPending变化 // 监听refreshPending变化
watch( watch(
() => inProps.refreshpending, () => inProps.refreshpending,
@@ -533,8 +547,12 @@ onMounted(() => {
</script> </script>
<template> <template>
<VCard class="d-flex flex-column w-full h-full"> <VCard class="d-flex flex-column w-full h-full rounded-t-0" :class="{ 'rounded-s-0': showTree }">
<VToolbar v-if="!loading" density="compact" flat color="gray"> <VToolbar v-if="!loading" density="compact" flat color="gray">
<IconBtn v-if="display.mdAndUp.value">
<VIcon v-if="showTree" icon="mdi-file-tree" @click="switchFileTree(false)" />
<VIcon v-else icon="mdi-file-tree-outline" @click="switchFileTree(true)" />
</IconBtn>
<VTextField <VTextField
v-if="!isFile" v-if="!isFile"
v-model="filter" v-model="filter"

View File

@@ -259,7 +259,7 @@ function getIndentLevel(path: string, ancestorPath: string) {
</script> </script>
<template> <template>
<VCard class="file-navigator" v-if="!isMobile"> <VCard class="file-navigator rounded-e-0 rounded-t-0" v-if="!isMobile">
<div class="tree-container"> <div class="tree-container">
<!-- 根目录项 --> <!-- 根目录项 -->
<div <div
@@ -387,41 +387,41 @@ function getIndentLevel(path: string, ancestorPath: string) {
<style lang="scss" scoped> <style lang="scss" scoped>
.file-navigator { .file-navigator {
width: 240px;
display: flex; display: flex;
flex-direction: column;
height: 100%;
overflow: hidden; overflow: hidden;
flex-direction: column;
flex-shrink: 0; flex-shrink: 0;
border-bottom-left-radius: 12px;
background: rgb(var(--v-table-header-background)); background: rgb(var(--v-table-header-background));
block-size: 100%;
border-end-start-radius: 12px;
inline-size: 240px;
} }
.navigator-header { .navigator-header {
padding: 12px 16px;
display: flex; display: flex;
align-items: center; align-items: center;
border-bottom: 1px solid rgba(0, 0, 0, 0.08); border-block-end: 1px solid rgba(0, 0, 0, 8%);
padding-block: 12px;
padding-inline: 16px;
} }
.tree-container { .tree-container {
overflow: hidden auto;
flex: 1; flex: 1;
overflow-y: auto;
overflow-x: hidden;
} }
.tree-item-container { .tree-item-container {
width: 100%; inline-size: 100%;
} }
.tree-item { .tree-item {
display: flex; display: flex;
box-sizing: border-box;
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
max-inline-size: 100%;
min-inline-size: 100%;
transition: background-color 0.2s ease; transition: background-color 0.2s ease;
min-width: 100%;
max-width: 100%;
box-sizing: border-box;
&:hover { &:hover {
background-color: rgba(var(--v-theme-primary), 0.05); background-color: rgba(var(--v-theme-primary), 0.05);
@@ -433,25 +433,27 @@ function getIndentLevel(path: string, ancestorPath: string) {
} }
.folder-toggle { .folder-toggle {
width: 16px;
height: 16px;
display: flex; display: flex;
flex-shrink: 0;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-right: 4px; block-size: 16px;
flex-shrink: 0; inline-size: 16px;
padding: 6px 0px 6px 12px; margin-inline-end: 4px;
padding-block: 6px;
padding-inline: 12px 0;
} }
.folder-content { .folder-content {
display: flex; display: flex;
align-items: center;
flex: 1;
min-width: 0;
overflow: hidden; overflow: hidden;
white-space: nowrap; flex: 1;
align-items: center;
min-inline-size: 0;
padding-block: 6px;
padding-inline: 8px 16px;
text-overflow: ellipsis; text-overflow: ellipsis;
padding: 6px 16px 6px 8px; white-space: nowrap;
} }
.root-item { .root-item {
@@ -459,25 +461,26 @@ function getIndentLevel(path: string, ancestorPath: string) {
} }
.folder-name { .folder-name {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 150px;
display: inline-block; display: inline-block;
overflow: hidden;
max-inline-size: 150px;
text-overflow: ellipsis;
white-space: nowrap;
} }
.subdirectory-container { .subdirectory-container {
width: 100%; inline-size: 100%;
} }
.tree-loading { .tree-loading {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 4px 16px;
color: rgba(var(--v-theme-on-surface), var(--v-high-emphasis-opacity)); color: rgba(var(--v-theme-on-surface), var(--v-high-emphasis-opacity));
padding-block: 4px;
padding-inline: 16px;
} }
.pl-8 { .pl-8 {
padding-left: 20px !important; padding-inline-start: 20px !important;
} }
</style> </style>

View File

@@ -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 {

View File

@@ -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>

View File

@@ -198,7 +198,7 @@ watch(filterParams, () => {
<div class="mr-5"> <div class="mr-5">
<VLabel>评分</VLabel> <VLabel>评分</VLabel>
</div> </div>
<VSlider v-model="filterParams.vote_average" thumb-label max="10" min="0" class="align-center" hide-details> <VSlider v-model="filterParams.vote_average" thumb-label max="10" min="0" :step="1" class="align-center" hide-details>
<template v-slot:append> <template v-slot:append>
<VTextField <VTextField
width="5rem" width="5rem"