feat():完成洪水预警模块的开发
parent
71bca6f4b9
commit
f2adce43ff
|
|
@ -234,7 +234,7 @@ const apiurl = {
|
|||
page: service_fxdd + "/warningRule/page",
|
||||
edit: service_fxdd + '/warningRule/update',
|
||||
save: service_fxdd + '/warningRule/insert',
|
||||
del: service_fxdd + "/warningRule/del/",
|
||||
delete: service_fxdd + "/warningRule/del/",
|
||||
}
|
||||
},
|
||||
// 防汛准备
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
|||
const onfinish = (values) => {
|
||||
const userId = localStorage.getItem('userId')
|
||||
values.userId = userId
|
||||
values.createTime = values.createTime ? moment(values.createTime).format("YYYY-MM-DD 00:00:00") : undefined
|
||||
if (mode === 'edit') {
|
||||
onEdit(apiurl.sy.yjxxpz.edit, { ...record, ...values })
|
||||
}
|
||||
|
|
@ -77,61 +78,62 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
|||
</Col>
|
||||
</Row>
|
||||
<Row>
|
||||
<Col span={24}>
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
label="规则配置"
|
||||
required
|
||||
labelCol={{ span: 3 }}
|
||||
wrapperCol={{ span: 19 }}
|
||||
name="durationHours"
|
||||
rules={[{ required: true, message: '请选择对象' }]}
|
||||
>
|
||||
<Row gutter={16}>
|
||||
<Col span={8}>
|
||||
<Form.Item name="configTarget" rules={[{ required: true }]} noStyle>
|
||||
<NormalSelect
|
||||
allowClear
|
||||
style={{ width: '100%' }}
|
||||
disabled={mode === 'view'}
|
||||
placeholder="请选择对象"
|
||||
options={[
|
||||
{ label: '未来1h水库预报水位', value: 1 },
|
||||
{ label: '未来3h水库预报水位', value: 3 },
|
||||
{ label: '未来6h水库预报水位', value: 6 },
|
||||
{ label: '未来12h水库预报水位', value: 12 },
|
||||
{ label: '未来24h水库预报水位', value: 24 },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item name="configRelation" rules={[{ required: true }]} noStyle>
|
||||
<NormalSelect
|
||||
allowClear
|
||||
style={{ width: '100%' }}
|
||||
disabled={mode === 'view'}
|
||||
placeholder="请选择关系"
|
||||
options={[
|
||||
{ label: '>', value: '>' },
|
||||
{ label: '≥', value: '>=' },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item name="configThreshold" rules={[{ required: true }]} noStyle>
|
||||
<NormalSelect
|
||||
allowClear
|
||||
style={{ width: '100%' }}
|
||||
disabled={mode === 'view'}
|
||||
placeholder="请选择阈值"
|
||||
options={[
|
||||
{ label: '汛限水位(109.00m)', value: 5 },
|
||||
{ label: '设计洪水位(111.89m)', value: 10 },
|
||||
{ label: '校核洪水位(113.06m)', value: 20 },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
<NormalSelect
|
||||
allowClear
|
||||
style={{ width: '100%' }}
|
||||
disabled={mode === 'view'}
|
||||
placeholder="请选择对象"
|
||||
options={[
|
||||
{ label: '未来1h水库预报水位', value: 1 },
|
||||
{ label: '未来3h水库预报水位', value: 3 },
|
||||
{ label: '未来6h水库预报水位', value: 6 },
|
||||
{ label: '未来12h水库预报水位', value: 12 },
|
||||
{ label: '未来24h水库预报水位', value: 24 },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={4}>
|
||||
<Form.Item
|
||||
label=""
|
||||
name="operator"
|
||||
rules={[{ required: true, message: '请选择关系' }]}
|
||||
>
|
||||
<NormalSelect
|
||||
allowClear
|
||||
style={{ width: '100%' }}
|
||||
disabled={mode === 'view'}
|
||||
placeholder="请选择关系"
|
||||
options={[
|
||||
{ label: '>', value: '>' },
|
||||
{ label: '≥', value: '>=' },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item
|
||||
label=""
|
||||
name="type"
|
||||
rules={[{ required: true, message: '请选择阈值' }]}
|
||||
>
|
||||
<NormalSelect
|
||||
allowClear
|
||||
style={{ width: '100%' }}
|
||||
disabled={mode === 'view'}
|
||||
placeholder="请选择阈值"
|
||||
options={[
|
||||
{ label: '汛限水位(109.00m)', value: 0 },
|
||||
{ label: '设计洪水位(111.89m)', value: 1 },
|
||||
{ label: '校核洪水位(113.06m)', value: 2 },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@ const Page = () => {
|
|||
{ title: '预警时间', key: 'createTime', dataIndex: 'createTime', width: 140, align: "center", },
|
||||
{ title: '规则名称', key: 'ruleName', dataIndex: 'ruleName', width: 140, align: "center", },
|
||||
{ title: '预警等级', key: 'warningLevel', dataIndex: 'warningLevel', width: 100, align: "center", render: (v) => <span>{levelObj[v]}</span> },
|
||||
{ title: '预警信息', key: 'ruleInfo', dataIndex: 'ruleInfo', width: 300, align: "center", },
|
||||
{ title: '预警信息', key: 'ruleDesc', dataIndex: 'ruleDesc', width: 300, align: "center", },
|
||||
{
|
||||
title: '操作', key: 'operation', width: 100, fixed: 'right', align: 'center',
|
||||
render: (value, row, index) => (<CrudOpRender_text view={true} command={(cmd) => () => command(cmd)(row)} />)
|
||||
render: (value, row, index) => (<CrudOpRender_text edit={true} del={true} command={(cmd) => () => command(cmd)(row)} />)
|
||||
},
|
||||
];
|
||||
|
||||
|
|
@ -62,14 +62,12 @@ const Page = () => {
|
|||
refresh()
|
||||
}
|
||||
useEffect(() => {
|
||||
if (searchVal) {
|
||||
const params = {
|
||||
search: {
|
||||
...searchVal,
|
||||
}
|
||||
};
|
||||
search(params)
|
||||
}
|
||||
}, [searchVal])
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,66 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
|||
</Radio.Group>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
</Row>
|
||||
<Row>
|
||||
<Col span={24}>
|
||||
<Form.Item
|
||||
label="规则配置"
|
||||
required
|
||||
labelCol={{ span: 3 }}
|
||||
wrapperCol={{ span: 19 }}
|
||||
>
|
||||
<Row gutter={16}>
|
||||
<Col span={8}>
|
||||
<Form.Item name="durationHours" rules={[{ required: true }]} noStyle>
|
||||
<NormalSelect
|
||||
allowClear
|
||||
style={{ width: '100%' }}
|
||||
disabled={mode === 'view'}
|
||||
placeholder="请选择对象"
|
||||
options={[
|
||||
{ label: '未来1h水库预报水位', value: 1 },
|
||||
{ label: '未来3h水库预报水位', value: 3 },
|
||||
{ label: '未来6h水库预报水位', value: 6 },
|
||||
{ label: '未来12h水库预报水位', value: 12 },
|
||||
{ label: '未来24h水库预报水位', value: 24 },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item name="operator" rules={[{ required: true }]} noStyle>
|
||||
<NormalSelect
|
||||
allowClear
|
||||
style={{ width: '100%' }}
|
||||
disabled={mode === 'view'}
|
||||
placeholder="请选择关系"
|
||||
options={[
|
||||
{ label: '>', value: '>' },
|
||||
{ label: '≥', value: '>=' },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item name="type" rules={[{ required: true }]} noStyle>
|
||||
<NormalSelect
|
||||
allowClear
|
||||
style={{ width: '100%' }}
|
||||
disabled={mode === 'view'}
|
||||
placeholder="请选择阈值"
|
||||
options={[
|
||||
{ label: '汛限水位(109.00m)', value: 0 },
|
||||
{ label: '设计洪水位(111.89m)', value: 1 },
|
||||
{ label: '校核洪水位(113.06m)', value: 2 },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
{
|
||||
mode==='view'?null:(
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ const Page = () => {
|
|||
{ title: '预警时间', key: 'createTime', dataIndex: 'createTime', width: 140, align: "center", },
|
||||
{ title: '规则名称', key: 'ruleName', dataIndex: 'ruleName', width: 140, align: "center", },
|
||||
{ title: '预警等级', key: 'warningLevel', dataIndex: 'warningLevel', width: 100, align: "center", render: (v) => <span>{levelObj[v]}</span> },
|
||||
{ title: '预警信息', key: 'ruleInfo', dataIndex: 'ruleInfo', width: 300, align: "center", },
|
||||
{ title: '预警信息', key: 'ruleDesc', dataIndex: 'ruleDesc', width: 300, align: "center", },
|
||||
{
|
||||
title: '操作', key: 'operation', width: 100, fixed: 'right', align: 'center',
|
||||
render: (value, row, index) => (<CrudOpRender_text view={true} command={(cmd) => () => command(cmd)(row)} />)
|
||||
|
|
|
|||
|
|
@ -62,13 +62,6 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
|||
<Form.Item>
|
||||
<Button onClick={() => form.resetFields()}>重置</Button>
|
||||
</Form.Item>
|
||||
{
|
||||
(onSave && addBtn) ?
|
||||
<Form.Item>
|
||||
<Button onClick={onSave}>新增</Button>
|
||||
</Form.Item>
|
||||
:null
|
||||
}
|
||||
</Form>
|
||||
</div>
|
||||
</>
|
||||
|
|
|
|||
Loading…
Reference in New Issue