This commit is contained in:
jxxghp
2023-09-23 08:32:24 +08:00
parent b72ad1d78d
commit cfa75b7643
+11 -11
View File
@@ -15,7 +15,7 @@ const TorrentPriorityItems = [
] ]
// 包含与排除规则 // 包含与排除规则
const defaultIncludeExcludeFilter = ref({ const defaultFilterRules = ref({
include: '', include: '',
exclude: '', exclude: '',
}) })
@@ -35,13 +35,13 @@ async function queryTorrentPriority() {
} }
// 查询包含与排除规则 // 查询包含与排除规则
async function queryIncludeExcludeFilter() { async function queryDefaultFilter() {
try { try {
const result: { [key: string]: any } = await api.get( const result: { [key: string]: any } = await api.get(
'system/setting/DefaultIncludeExcludeFilter', 'system/setting/DefaultFilterRules',
) )
if (result.data?.value) if (result.data?.value)
defaultIncludeExcludeFilter.value = result.data?.value defaultFilterRules.value = result.data?.value
} }
catch (error) { catch (error) {
console.log(error) console.log(error)
@@ -68,11 +68,11 @@ async function saveTorrentPriority() {
} }
// 保存包含与排除规则 // 保存包含与排除规则
async function saveIncludeExcludeFilter() { async function saveDefaultFilter() {
try { try {
const result: { [key: string]: any } = await api.post( const result: { [key: string]: any } = await api.post(
'system/setting/DefaultIncludeExcludeFilter', 'system/setting/DefaultFilterRules',
defaultIncludeExcludeFilter.value, defaultFilterRules.value,
) )
if (result.success) if (result.success)
$toast.success('默认包含/排除规则保存成功') $toast.success('默认包含/排除规则保存成功')
@@ -86,7 +86,7 @@ async function saveIncludeExcludeFilter() {
onMounted(() => { onMounted(() => {
queryTorrentPriority() queryTorrentPriority()
queryIncludeExcludeFilter() queryDefaultFilter()
}) })
</script> </script>
@@ -127,14 +127,14 @@ onMounted(() => {
<VRow> <VRow>
<VCol cols="12" md="6"> <VCol cols="12" md="6">
<VTextField <VTextField
v-model="defaultIncludeExcludeFilter.include" v-model="defaultFilterRules.include"
type="text" type="text"
label="包含(关键字、正则式)" label="包含(关键字、正则式)"
/> />
</VCol> </VCol>
<VCol cols="12" md="6"> <VCol cols="12" md="6">
<VTextField <VTextField
v-model="defaultIncludeExcludeFilter.exclude" v-model="defaultFilterRules.exclude"
type="text" type="text"
label="排除(关键字、正则式)" label="排除(关键字、正则式)"
/> />
@@ -145,7 +145,7 @@ onMounted(() => {
<VCardItem> <VCardItem>
<VBtn <VBtn
type="submit" type="submit"
@click="saveIncludeExcludeFilter" @click="saveDefaultFilter"
> >
保存 保存
</VBtn> </VBtn>