mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-10 17:42:50 +08:00
优化 MediaCard 和 SearchSiteDialog 组件,移除全选功能并调整已选择站点的逻辑
This commit is contained in:
@@ -88,15 +88,6 @@ const searchMenuShow = ref(false)
|
||||
// 选择站点对话框
|
||||
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() {
|
||||
try {
|
||||
@@ -113,7 +104,6 @@ async function querySites() {
|
||||
async function querySelectedSites() {
|
||||
try {
|
||||
const result: { [key: string]: any } = await api.get('system/setting/IndexerSites')
|
||||
|
||||
selectedSites.value = result.data?.value ?? []
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import type { Site, Plugin, Subscribe } from '@/api/types'
|
||||
import { PropType } from 'vue'
|
||||
import { popScopeId, PropType } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
sites: {
|
||||
@@ -23,6 +23,12 @@ const siteFilter = ref('')
|
||||
// 已选择站点
|
||||
const selectedSites = ref<any[]>(props.selected || [])
|
||||
|
||||
watchEffect(() => {
|
||||
if (!selectedSites.value && props.selected){
|
||||
selectedSites.value = props.selected
|
||||
}
|
||||
})
|
||||
|
||||
// 全选/全不选按钮文字
|
||||
const checkAllText = computed(() => {
|
||||
return selectedSites.value.length < props.sites?.length ? '选择全部' : '取消全选'
|
||||
|
||||
Reference in New Issue
Block a user