mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-21 08:10:16 +08:00
feat: 添加完成事件触发
为CustomRuleCard、FilterRuleGroupCard、NotificationChannelCard和AccountSettingDirectory组件添加done事件触发,以便在完成相关操作后通知其他组件。
This commit is contained in:
@@ -21,7 +21,7 @@ const props = defineProps({
|
||||
const $toast = useToast()
|
||||
|
||||
// 定义触发的自定义事件
|
||||
const emit = defineEmits(['close', 'change'])
|
||||
const emit = defineEmits(['close', 'change', 'done'])
|
||||
|
||||
// 规则详情弹窗
|
||||
const ruleInfoDialog = ref(false)
|
||||
@@ -61,18 +61,18 @@ function saveRuleInfo() {
|
||||
if (ruleId.value && !ruleName.value) {
|
||||
$toast.error('规则名称不能为空')
|
||||
}
|
||||
if (!ruleId.value && !ruleName.value){
|
||||
if (!ruleId.value && !ruleName.value) {
|
||||
$toast.error('规则ID和规则名称不能为空')
|
||||
}
|
||||
return
|
||||
}
|
||||
// ID已存在
|
||||
if (ruleId.value !== props.rule.id && props.rules.find((rule) => rule.id === ruleId.value)) {
|
||||
if (ruleId.value !== props.rule.id && props.rules.find(rule => rule.id === ruleId.value)) {
|
||||
$toast.error(`规则ID【${ruleId.value}】已存在,请替换`)
|
||||
return
|
||||
}
|
||||
// 规则名称已存在
|
||||
if (ruleName.value !== props.rule.name && props.rules.find((rule) => rule.name === ruleName.value)) {
|
||||
if (ruleName.value !== props.rule.name && props.rules.find(rule => rule.name === ruleName.value)) {
|
||||
$toast.error(`规则名称【${ruleName.value}】已存在,请替换`)
|
||||
return
|
||||
}
|
||||
@@ -81,6 +81,7 @@ function saveRuleInfo() {
|
||||
ruleInfo.value.id = ruleId.value
|
||||
ruleInfo.value.name = ruleName.value
|
||||
emit('change', ruleInfo.value)
|
||||
emit('done')
|
||||
}
|
||||
|
||||
// 按钮点击
|
||||
|
||||
@@ -40,7 +40,7 @@ interface FilterCard {
|
||||
const $toast = useToast()
|
||||
|
||||
// 定义触发的自定义事件
|
||||
const emit = defineEmits(['close', 'change'])
|
||||
const emit = defineEmits(['close', 'change', 'done'])
|
||||
|
||||
// 规则详情弹窗
|
||||
const groupInfoDialog = ref(false)
|
||||
@@ -198,6 +198,7 @@ function savegroupInfo() {
|
||||
.map(card => card.rules.join('&'))
|
||||
.join('>')
|
||||
emit('change', groupInfo.value)
|
||||
emit('done')
|
||||
}
|
||||
|
||||
// 按钮点击
|
||||
|
||||
@@ -16,7 +16,7 @@ const props = defineProps({
|
||||
})
|
||||
|
||||
// 定义触发的自定义事件
|
||||
const emit = defineEmits(['close', 'change'])
|
||||
const emit = defineEmits(['close', 'change', 'done'])
|
||||
|
||||
// 通知详情弹窗
|
||||
const notificationInfoDialog = ref(false)
|
||||
@@ -66,6 +66,7 @@ function saveNotificationInfo() {
|
||||
notificationInfoDialog.value = false
|
||||
notificationInfo.value.name = notificationName.value
|
||||
emit('change', notificationInfo.value)
|
||||
emit('done')
|
||||
}
|
||||
|
||||
// 根据存储类型选择图标
|
||||
|
||||
Reference in New Issue
Block a user