peng.peng
1 year ago
10 changed files with 189 additions and 308 deletions
@ -1,15 +0,0 @@ |
|||
'use strict'; |
|||
|
|||
import { basicAction } from '@peace/utils' |
|||
import { ApiTable } from '$utils' |
|||
|
|||
// export function getMembers(orgId) {
|
|||
// return dispatch => basicAction({
|
|||
// type: 'get',
|
|||
// dispatch: dispatch,
|
|||
// actionType: 'GET_MEMBERS',
|
|||
// url: `${ApiTable.getEnterprisesMembers.replace('{enterpriseId}', orgId)}`,
|
|||
// msg: { error: '获取用户列表失败' },
|
|||
// reducer: { name: 'members' }
|
|||
// });
|
|||
// }
|
@ -0,0 +1,42 @@ |
|||
'use strict'; |
|||
|
|||
import { basicAction } from '@peace/utils' |
|||
import { ApiTable } from '$utils' |
|||
|
|||
export function getFireAlarmList(query) { |
|||
return dispatch => basicAction({ |
|||
type: 'get', |
|||
dispatch: dispatch, |
|||
query: query || {}, |
|||
actionType: 'GET_FIRE_ALARM', |
|||
url: `${ApiTable.getFireAlarmList}`, |
|||
msg: { error: '获取消防告警列表失败' }, |
|||
reducer: { name: 'riskReport' } |
|||
}); |
|||
} |
|||
|
|||
export function addFireAlarm(params) { |
|||
return (dispatch) => basicAction({ |
|||
type: 'post', |
|||
data: params, |
|||
dispatch, |
|||
actionType: 'ADD_RIST_REPORT', |
|||
url: ApiTable.getFireAlarmList, |
|||
msg: { |
|||
option: '新增消防告警', |
|||
}, |
|||
}); |
|||
} |
|||
|
|||
export function modifyFireAlarm(id, params) { |
|||
return (dispatch) => basicAction({ |
|||
type: 'put', |
|||
data: params, |
|||
dispatch, |
|||
actionType: 'MODIFY_FIRE_ALARM', |
|||
url: ApiTable.modifyFireAlarm.replace('{id}', id), |
|||
msg: { |
|||
option: '编辑消防告警', |
|||
}, |
|||
}); |
|||
} |
@ -1,6 +1,6 @@ |
|||
'use strict'; |
|||
|
|||
import * as example from './example' |
|||
import * as example from './fire' |
|||
|
|||
export default { |
|||
...example, |
|||
|
@ -0,0 +1,91 @@ |
|||
import React, { useEffect, useState } from 'react'; |
|||
import { connect } from 'react-redux'; |
|||
import { Row, Col, Modal, Form, Input, Select, DatePicker } from 'antd'; |
|||
const { Opiton } = Select; |
|||
function FireAddForm(props) { |
|||
const { visible } = props; |
|||
const layout = { |
|||
labelCol: { span: 8 }, |
|||
wrapperCol: { span: 12 }, |
|||
}; |
|||
|
|||
const [form] = Form.useForm(); |
|||
const renderInfowindow = () => { |
|||
return <div className='report_container'> |
|||
<div className='gis_exit' onClick={() => { setVisible(false) }} /> |
|||
<Form |
|||
form={form} |
|||
{...layout} |
|||
name="control-hooks" |
|||
style={{ maxWidth: 600 }} |
|||
> |
|||
<Form.Item name="createTime" label="时间" rules={[{ required: true, message: '请选择时间!' }]} > |
|||
<DatePicker showTime placeholder="请选择事件时间" /> |
|||
</Form.Item> |
|||
<Form.Item onFocus={() => { |
|||
setLocationVisible(true) |
|||
}} |
|||
name="地点" label="地点" > |
|||
{/* <Select placeholder="请选择事件地点" > </Select> */} |
|||
<div |
|||
onClick={() => { setLocationVisible(true) }} |
|||
style={{ color: 'rgba(89, 153, 200, 1)', paddingLeft: 12 }}>请选择事件地点</div> |
|||
</Form.Item> |
|||
<Form.Item name="场所" label="场所1" rules={[{ required: true, message: '请选择场所!' }]}> |
|||
<Select placeholder="请选择场所"> |
|||
<Option value="民用建筑">民用建筑</Option> |
|||
<Option value="工业建筑">工业建筑</Option> |
|||
<Option value="森林">森林</Option> |
|||
<Option value="地下建筑">地下建筑</Option> |
|||
<Option value="水上">水上</Option> |
|||
</Select> |
|||
</Form.Item> |
|||
<Form.Item name="燃烧物质" label="燃烧物质" rules={[{ required: true, message: '请选择燃烧物质!' }]}> |
|||
<Select placeholder="请选择事件燃烧物质" > |
|||
<Option value="固体物质火灾">固体物质火灾</Option> |
|||
<Option value="液体或可熔物质火灾">液体或可熔物质火灾</Option> |
|||
<Option value="气体火灾">气体火灾</Option> |
|||
<Option value="金属火灾">金属火灾</Option> |
|||
<Option value="带电火灾">带电火灾</Option> |
|||
<Option value="烹饪物火灾">烹饪物火灾</Option> |
|||
</Select> |
|||
</Form.Item> |
|||
<Form.Item name="危险等级" label="危险等级" rules={[{ required: true, message: '请选择危险等级!' }]} > |
|||
<Select placeholder="请选择事件危险等级" > |
|||
<Option value="绿">绿</Option> |
|||
<Option value="蓝">蓝</Option> |
|||
<Option value="黄">黄</Option> |
|||
<Option value="橙">橙</Option> |
|||
<Option value="红">红</Option> |
|||
</Select> |
|||
</Form.Item> |
|||
|
|||
<div className='flex-row flex-content-around'> |
|||
<div className='cancel_button' onClick={() => { props.onCancel() }}>取消</div> |
|||
<div onClick={() => { form?.submit() }} className='report_button'>上报</div> |
|||
</div> |
|||
</Form> |
|||
</div > |
|||
} |
|||
|
|||
return ( |
|||
<> |
|||
{/* 新增告警 */} |
|||
<Modal |
|||
maskClosable={false} |
|||
wrapClassName="custom-modal" |
|||
visible={visible} |
|||
closable={false} |
|||
width="360px" |
|||
centered |
|||
footer={null} |
|||
bodyStyle={{}} |
|||
destroyOnClose |
|||
> |
|||
{renderInfowindow()} |
|||
</Modal> |
|||
</> |
|||
); |
|||
} |
|||
|
|||
export default connect()(FireAddForm); |
Loading…
Reference in new issue