From c664b4aab49fe6798f5a4443192d9458219188fa Mon Sep 17 00:00:00 2001 From: MaxShen <997186306@qq.com> Date: Thu, 20 Mar 2025 21:16:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E9=98=85=E6=94=B9=E4=B8=BA=E5=A4=9A?= =?UTF-8?q?=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Jyh/Version/Detail/SubscriptionModal.vue | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/views/Jyh/Version/Detail/SubscriptionModal.vue b/src/views/Jyh/Version/Detail/SubscriptionModal.vue index 43c90c3..c54ef85 100644 --- a/src/views/Jyh/Version/Detail/SubscriptionModal.vue +++ b/src/views/Jyh/Version/Detail/SubscriptionModal.vue @@ -4,11 +4,7 @@
- - 短信 - 邮件 - 站内通知 - +
@@ -23,25 +19,29 @@ import { subscribeSoftware } from '@/api/jyh'; import { computed, ref } from 'vue'; import { Message } from 'vue-devui'; - +const subscribeTypeOptions = [ + { name: '短信', value: 'mobileSwitch', id: 1 }, + { name: '邮件', value: 'emailSwitch', id: 2 }, + { name: '站内通知', value: 'webSwitch', id: 3 }, +]; const props = defineProps(['softwareData']); const emit = defineEmits(['close']); const formRef = ref(null); const formData = ref({ - subscribeType: '', + subscribeType: [], }); const rules = { subscribeType: [{ required: true, message: '请选择', trigger: 'change' }], }; const sendSubscribe = async () => { + let alertType = {}; + formData.value.subscribeType.forEach(item => { + alertType[item.value] = true; + }) const data = await subscribeSoftware({ softwareId: props.softwareData.id, status: '1', - alertType: { - mobileSwitch: formData.value.subscribeType === '0', - emailSwitch: formData.value.subscribeType === '1', - webSwitch: formData.value.subscribeType === '2', - } + alertType, }).catch(err => { Message({ message: err.error,