From 9a4f8e746ceaf52d828d6d949871fea5d16846da Mon Sep 17 00:00:00 2001 From: CODE <1650192445@qq.com> Date: Thu, 14 Sep 2023 10:12:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BC=82=E5=B8=B8=E7=8E=87?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E9=85=8D=E7=BD=AE=E5=8D=95=E4=BD=8D=E4=B8=BA?= =?UTF-8?q?=E5=B0=8F=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/sections/service/components/pushModal.jsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/web/client/src/sections/service/components/pushModal.jsx b/web/client/src/sections/service/components/pushModal.jsx index ddf4862..9fc12c3 100644 --- a/web/client/src/sections/service/components/pushModal.jsx +++ b/web/client/src/sections/service/components/pushModal.jsx @@ -130,9 +130,16 @@ function pushModal (props) { function caution (tactics, interval, deviceProportion, data) { let regu = /^[0-9]*[1-9][0-9]*$/; let title = tactics == 'immediately' ? '即时' : tactics == 'continue' ? '持续时长' : '异常率' - if (!regu.test(interval) || (tactics == 'abnormal_rate' && interval > 720) || interval > 1440) { + let isAbnormal = tactics == 'abnormal_rate' + if (!regu.test(interval)) { Notification.error({ - content: title + (interval ? `推送时间不能大于${tactics == 'abnormal_rate' ? 720 : 1440}分钟` : '推送时间应为正整数'), + content: title + '推送时间应为正整数', + duration: 2, + }) + } + if (!regu.test(interval) || (isAbnormal && interval > 720) || interval > 1440) { + Notification.error({ + content: title + (interval ? `推送时间不能大于${isAbnormal ? 720 : 1440}${isAbnormal ? '小时' : '分钟'}` : '推送时间应为正整数'), duration: 2, }) return false