|
|
@ -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 |
|
|
|