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(() => { + + + + + 通知发送时间 + 设定消息发送的时间范围。 + + + + + + + + + + + + + +
+ 保存 +
+
+
+
+
+