Browse Source

添加action

dev
dengyinhuan 1 year ago
parent
commit
dd9f66544a
  1. 4
      web/client/src/sections/fillion/actions/index.js
  2. 94
      web/client/src/sections/fillion/components/luzhengmodel.js

4
web/client/src/sections/fillion/actions/index.js

@ -6,11 +6,13 @@ import * as file from './file'
import * as assess from './assess' import * as assess from './assess'
import * as allDepUsers from './allDepUsers' import * as allDepUsers from './allDepUsers'
import * as getReportSpotPrepare from './extract' import * as getReportSpotPrepare from './extract'
import * as luzheng from './luzheng'
export default { export default {
...infor, ...infor,
...patrol, ...patrol,
...file, ...file,
...assess, ...assess,
...allDepUsers, ...allDepUsers,
...getReportSpotPrepare ...getReportSpotPrepare,
...luzheng
} }

94
web/client/src/sections/fillion/components/luzhengmodel.js

@ -0,0 +1,94 @@
import React, { useState, useEffect } from 'react';
import { connect } from 'react-redux';
import { Form, Input, Select, DatePicker, InputNumber, Button, Modal } from 'antd';
import { unitList } from '../containers/assess'
import { getAssess, delAssess, editAssess } from '../actions/assess';
import moment from 'moment';
import { getRoadadministration,addRoadadministration,delRoadadministration,modifyRoadadministration } from '../actions/luzheng';
import Uploads from "../../../../components/Upload/index"
const { Option } = Select;
const AssessModal = ({ editData, check, visible, onCancel, dispatch }) => {
const [form] = Form.useForm();
return (
<Modal
title="路政信息"
open={visible}
visible={visible}
cancelButtonProps={{
disabled: check,
}}
onOk={() => {
if (check) {
return onCancel()
}
form.validateFields().then(values => {
dispatch(editAssess({
...values,
month: moment(values.month).format('YYYY-MM-DD'),
assessId: editData ? editData.id : undefined
})).then(res => {
if (res.success) {
onCancel()
}
})
})
}}
onCancel={() => {
onCancel()
}}
>
<Form
form={form}
initialValues={editData ? {
...editData,
month: moment(editData.month),
} : {}}
disabled={check}
labelCol={{
span: 6,
}}
wrapperCol={{
span: 18,
}}
>
<Form.Item name="enforcementdate" label="执法日期" rules={[{ required: true, message: '请填写' }]}>
{/* <Select>
{
unitList.map(item => (
<Option value={item} key={item} />
))
}
</Select> */}
<DatePicker/>
</Form.Item>
<Form.Item name="roadname" label="执法道路" rules={[{ required: true, message: '请填写' }]}>
<Input/>
</Form.Item>
<Form.Item name="enforcementreslt" label="执法成果" rules={[{ required: true, message: '请填写' }]}>
<Input/>
</Form.Item>
<Form.Item name="picfile" label="执法图片">
<Uploads
maxFilesNum={1}
fileTypes={['mp4']}
maxFileSize={200}
/>
</Form.Item>
</Form>
</Modal>
);
};
function mapStateToProps (state) {
const { auth, assess } = state
return {
user: auth.user,
assess: assess.data || []
}
}
export default connect(mapStateToProps)(AssessModal);
Loading…
Cancel
Save