diff --git a/src/views/setting/AccountSettingRule.vue b/src/views/setting/AccountSettingRule.vue index f70bf8ce..ce571182 100644 --- a/src/views/setting/AccountSettingRule.vue +++ b/src/views/setting/AccountSettingRule.vue @@ -8,6 +8,7 @@ import { CustomRule, FilterRuleGroup } from '@/api/types' import CustomerRuleCard from '@/components/cards/CustomRuleCard.vue' import FilterRuleGroupCard from '@/components/cards/FilterRuleGroupCard.vue' import ImportCodeDialog from '@/components/dialog/ImportCodeDialog.vue' +import { VCard, VDialog } from 'vuetify/lib/components/index.mjs' // 自定义规则列表 const customRules = ref([]) @@ -27,6 +28,12 @@ const importCodeDialog = ref(false) // 导入代码类型 const importCodeType = ref('') +// 统一删除弹窗 +const deleteAllDateDialog = ref(false) + +// 统一删除弹窗的代码类型 +const deleteAllDateDialogType = ref('') + // 提示框 const $toast = useToast() @@ -271,6 +278,18 @@ function checkValueValidity(values: any, type: string): boolean { } } +// 清空规则(组) +function deleteAllRules(dateType: string) { + if (!dateType) return + if (dateType === 'custom') { + customRules.value = [] + } else if (dateType === 'group') { + filterRuleGroups.value = [] + } else { + console.error(`传入了不支持的类型!`) + } +} + // 规则变化时赋值 function onRuleChange(rule: CustomRule, id: string) { const index = customRules.value.findIndex(item => item.id === id) @@ -367,12 +386,15 @@ onMounted(() => { - + + + + @@ -415,12 +437,15 @@ onMounted(() => { - + + + +