From 64042b51e96d0682b76c61c56e8702c3a4a497f6 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sun, 9 Mar 2025 18:52:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=80=9A=E5=92=8C=E5=8F=91=E9=80=81?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../setting/AccountSettingNotification.vue | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/src/views/setting/AccountSettingNotification.vue b/src/views/setting/AccountSettingNotification.vue index 6d15d101..409832d7 100644 --- a/src/views/setting/AccountSettingNotification.vue +++ b/src/views/setting/AccountSettingNotification.vue @@ -51,6 +51,12 @@ const notificationSwitchs = ref([ }, ]) +// 通知发送时间 +const notificationTime = ref({ + start: '00:00', + end: '23:59', +}) + // 重载系统生效配置 async function reloadSystem() { progressDialog.value = true @@ -94,6 +100,16 @@ async function loadNotificationSetting() { } } +// 调用API查询通知发送时间设置 +async function loadNotificationTime() { + try { + const result: { [key: string]: any } = await api.get('system/setting/NotificationSendTime') + notificationTime.value = result.data?.value ?? { start: '00:00', end: '23:59' } + } catch (error) { + console.log(error) + } +} + // 调用API保存通知设置 async function saveNotificationSetting() { try { @@ -107,6 +123,18 @@ async function saveNotificationSetting() { } } +// 调用API保存通知发送时间设置 +async function saveNotificationTime() { + try { + const result: { [key: string]: any } = await api.post('system/setting/NotificationSendTime', notificationTime.value) + if (result.success) { + $toast.success('通知发送时间保存成功') + } else $toast.error('通知发送时间保存失败!') + } catch (error) { + console.log(error) + } +} + // 通知渠道设置变化时赋值 function changNotificationSetting(notification: NotificationConf, name: string) { const index = notifications.value.findIndex(item => item.name === name) @@ -141,6 +169,7 @@ async function saveNotificationSwitchs() { onMounted(() => { loadNotificationSetting() loadNotificationSwitchs() + loadNotificationTime() }) @@ -246,6 +275,33 @@ onMounted(() => { + + + + + 通知发送时间 + 设定消息发送的时间范围。 + + + + + + + + + + + + + +
+ 保存 +
+
+
+
+
+