fix 订阅时编辑规则移到默认订阅规则页面

This commit is contained in:
thsrite
2024-04-20 18:48:02 +08:00
parent 555a00b731
commit 3d551ac45b
3 changed files with 35 additions and 30 deletions

View File

@@ -43,7 +43,8 @@ const subscribeForm = ref<Subscribe>({
username: '',
current_priority: 0,
save_path: '',
date: ''
date: '',
show_edit_dialog: false
})
// 提示框
@@ -413,6 +414,16 @@ onMounted(() => {
hint="开启后将使用 ImdbID 搜索资源,搜索结果更精确,但不是所有站点都支持"
/>
</VCol>
<VCol
cols="12"
md="4"
>
<VSwitch
v-model="subscribeForm.show_edit_dialog"
label="订阅时编辑更多规则"
hint="开启后将在添加订阅后弹出编辑订阅的对话框,方便用户编辑订阅规则"
/>
</VCol>
</VRow>
</VForm>
</VCardText>

View File

@@ -46,10 +46,8 @@ const seasonsSubscribed = ref<{ [key: number]: boolean }>({})
// 订阅编号
const subscribeId = ref<number>()
// 订阅规则
const subscribeRules = ref({
show_edit_dialog: false,
})
// 是否显示编辑订阅弹窗
const showEditDialog = ref(false)
// 获得mediaid
function getMediaId() {
@@ -230,7 +228,7 @@ async function addSubscribe(season = 0) {
)
// 显示编辑弹窗
if (result.success && subscribeRules.value.show_edit_dialog) {
if (result.success && showEditDialog.value) {
subscribeId.value = result.data.id
subscribeEditDialog.value = true
}
@@ -290,20 +288,6 @@ async function removeSubscribe(season: number) {
doneNProgress()
}
// 查询订阅弹窗规则
async function querySubscribeRules() {
try {
const result: { [key: string]: any } = await api.get(
'system/setting/DefaultFilterRules',
)
if (result.data?.value)
subscribeRules.value = result.data?.value
}
catch (error) {
console.log(error)
}
}
// 订阅按钮响应
function handleSubscribe(season = 0) {
if (isSubscribed.value)
@@ -450,9 +434,27 @@ async function handlePlay() {
}
}
async function queryDefaultSubscribeConfig() {
try {
let subscribe_config_url = ''
if (mediaProps.type === '电影')
subscribe_config_url = 'system/setting/DefaultMovieSubscribeConfig'
else
subscribe_config_url = 'system/setting/DefaultTvSubscribeConfig'
const result: { [key: string]: any } = await api.get(subscribe_config_url)
if (result.data.value && result.data.value.show_edit_dialog)
showEditDialog.value = true
}
catch (error) {
console.log(error)
}
}
onBeforeMount(() => {
getMediaDetail()
querySubscribeRules()
queryDefaultSubscribeConfig()
})
</script>

View File

@@ -41,8 +41,7 @@ const defaultFilterRules = ref({
exclude: '',
movie_size: '',
tv_size: '',
min_seeders: 0,
show_edit_dialog: false,
min_seeders: 0
})
// 订阅模式选择项
@@ -622,13 +621,6 @@ onMounted(() => {
hint="小于该值的资源将被过滤掉0表示不过滤"
/>
</VCol>
<VCol cols="12" md="6">
<VSwitch
v-model="defaultFilterRules.show_edit_dialog"
label="订阅时编辑更多规则"
hint="开启后,添加订阅时将自动弹出订阅编辑框,要设置更多订阅选项"
/>
</VCol>
</VRow>
</VForm>
</VCardText>