|
@@ -3,7 +3,7 @@ import { Button, DatePicker, Form, Input, InputNumber, message, Modal, Popconfir
|
|
|
import { RuleObject } from "antd/es/form"
|
|
|
import { StoreValue } from "antd/es/form/interface"
|
|
|
import React from "react"
|
|
|
-import { MonitorFieldEnum } from "./config"
|
|
|
+import { MonitorFieldEnum, WarningTypeEnum } from "./config"
|
|
|
import './index.less'
|
|
|
import PriceInput from "./priceInput"
|
|
|
|
|
@@ -72,13 +72,29 @@ const AddEdit: React.FC<Props> = (props) => {
|
|
|
}}
|
|
|
>
|
|
|
<div style={{ padding: '0 4px' }}>
|
|
|
+ <Form.Item name="ruleName" label={<strong>规则名称</strong>} rules={[{ required: true, message: '请输入规则名称' }]}>
|
|
|
+ <Input placeholder="规则名称" />
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item name="warningType" label={<strong>告警方式</strong>} rules={[{ required: true, message: '请选择通知频率' }]}>
|
|
|
+ <Select
|
|
|
+ mode="multiple"
|
|
|
+ showSearch
|
|
|
+ allowClear
|
|
|
+ placeholder="选择告警方式"
|
|
|
+ filterOption={(input, option) =>
|
|
|
+ ((option?.label ?? '') as any).toLowerCase().includes(input.toLowerCase())
|
|
|
+ }
|
|
|
+ >
|
|
|
+ {Object.keys(WarningTypeEnum).map((item, index) => <Select.Option value={item} key={index}>{WarningTypeEnum[item]}</Select.Option>)}
|
|
|
+ </Select>
|
|
|
+ </Form.Item>
|
|
|
<Form.Item name="ruleName" label={<strong>规则名称</strong>} rules={[{ required: true, message: '请输入规则名称' }]}>
|
|
|
<Input placeholder="规则名称" />
|
|
|
</Form.Item>
|
|
|
<Form.Item name="notifyFrequency" label={<strong>通知频率</strong>} rules={[{ required: true, message: '请选择通知频率' }]}>
|
|
|
- <InputNumber min={5} addonAfter="分钟"/>
|
|
|
+ <InputNumber min={5} addonAfter="分钟" />
|
|
|
</Form.Item>
|
|
|
- <Form.Item name="enable" label={<strong>Enable?</strong>} valuePropName="checked">
|
|
|
+ <Form.Item name="enable" label={<strong>Enable?</strong>} valuePropName="checked" rules={[{ required: true }]}>
|
|
|
<Switch />
|
|
|
</Form.Item>
|
|
|
</div>
|