diff --git a/src/@core/components/ThemeSwitcher.vue b/src/@core/components/ThemeSwitcher.vue index 8fe461d9..e8f3af18 100644 --- a/src/@core/components/ThemeSwitcher.vue +++ b/src/@core/components/ThemeSwitcher.vue @@ -114,10 +114,8 @@ function changeTheme(theme: string) { currentThemeName.value = nextTheme // 保存主题到服务端 try { - api.post('/user/config/theme', nextTheme, { - headers: { - 'Content-Type': 'text/plain', - }, + api.post('/user/config/Layout', { + theme: nextTheme }) } catch (e) { console.error('保存主题到服务端失败') diff --git a/src/api/types.ts b/src/api/types.ts index b44ebcf5..9e69d96a 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -65,6 +65,12 @@ export interface Subscribe { show_edit_dialog: boolean // 编辑框打开状态 page_open?: boolean + // 自定义识别词 + custom_words?: string + // 自定义媒体类别 + media_category?: string + // 过滤规则组 + filter_groups?: string[] } // 历史记录 diff --git a/src/components/cards/SubscribeCard.vue b/src/components/cards/SubscribeCard.vue index b31bd0f7..1a06c9a4 100644 --- a/src/components/cards/SubscribeCard.vue +++ b/src/components/cards/SubscribeCard.vue @@ -3,8 +3,7 @@ import { useToast } from 'vue-toast-notification' import { useConfirm } from 'vuetify-use-dialog' import SubscribeEditDialog from '../dialog/SubscribeEditDialog.vue' import SubscribeFilesDialog from '../dialog/SubscribeFilesDialog.vue' -import { formatDateDifference } from '@/@core/utils/formatters' -import { formatSeason } from '@/@core/utils/formatters' +import { formatDateDifference, formatSeason } from '@/@core/utils/formatters' import api from '@/api' import type { Subscribe } from '@/api/types' import router from '@/router' diff --git a/src/components/dialog/SubscribeEditDialog.vue b/src/components/dialog/SubscribeEditDialog.vue index 9303e01d..ea6396a5 100644 --- a/src/components/dialog/SubscribeEditDialog.vue +++ b/src/components/dialog/SubscribeEditDialog.vue @@ -2,9 +2,10 @@ import { useToast } from 'vue-toast-notification' import { numberValidator } from '@/@validators' import api from '@/api' -import type { Site, Subscribe, TransferDirectoryConf } from '@/api/types' +import type { FilterRuleGroup, Site, Subscribe, TransferDirectoryConf } from '@/api/types' import { useDisplay } from 'vuetify' import { useConfirm } from 'vuetify-use-dialog' +import { VTextarea, VTextField } from 'vuetify/lib/components/index.mjs' // 显示器宽度 const display = useDisplay() @@ -22,6 +23,8 @@ const props = defineProps({ // 定义触发的自定义事件 const emit = defineEmits(['remove', 'save', 'close']) +const activeTab = ref('basic') + // 站点数据列表 const siteList = ref([]) @@ -31,29 +34,22 @@ const downloadDirectories = ref([]) // 站点选择下载框 const selectSitesOptions = ref<{ [key: number]: string }[]>([]) +// 所有规则组列表 +const filterRuleGroups = ref([]) + // 订阅编辑表单 const subscribeForm = ref({ id: props.subid ?? 0, - keyword: '', - quality: '', - resolution: '', - effect: '', - include: '', - exclude: '', - total_episode: 0, - start_episode: 0, - best_version: 0, - search_imdbid: 0, - sites: [], - type: '', name: '', year: '', + type: '', tmdbid: 0, state: '', last_update: '', username: '', + sites: [], + best_version: undefined, current_priority: 0, - save_path: undefined, date: '', show_edit_dialog: false, }) @@ -61,6 +57,24 @@ const subscribeForm = ref({ // 提示框 const $toast = useToast() +// 加载规则组 +async function queryFilterRuleGroups() { + try { + const result: { [key: string]: any } = await api.get('system/setting/UserFilterRuleGroups') + filterRuleGroups.value = result.data?.value ?? [] + } catch (error) { + console.log(error) + } +} + +// 过滤规则组选择项 +const filterRuleGroupOptions = computed(() => { + return filterRuleGroups.value.map(item => ({ + title: item.name, + value: item.name, + })) +}) + // 调用API修改订阅 async function updateSubscribeInfo() { try { @@ -274,6 +288,7 @@ const effectOptions = ref([ ]) onMounted(() => { + queryFilterRuleGroups() loadDownloadDirectories() getSiteList() if (props.subid) getSubscribeInfo() @@ -291,134 +306,187 @@ onMounted(() => { }`" class="rounded-t" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + +
基础
+
+ +
进阶
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/src/pages/login.vue b/src/pages/login.vue index 1f2bceb5..61a30fa2 100644 --- a/src/pages/login.vue +++ b/src/pages/login.vue @@ -92,9 +92,9 @@ const fetchOTP = debounce(async () => { // 获取用户主题配置 async function fetchThemeConfig() { - const response = await api.get('/user/config/theme') + const response = await api.get('/user/config/Layout') if (response && response.data && response.data.value) { - return response.data.value + return response.data.value?.theme } return null }