Browse Source

路政管理优化帮交

dev
liujiangyong 1 year ago
parent
commit
3e3ad5f00e
  1. 59
      web/client/src/sections/fillion/components/luzhengmodel.js
  2. 22
      web/client/src/sections/fillion/containers/luzheng.js

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

@ -5,23 +5,54 @@ import { unitList } from '../containers/assess'
import { getAssess, delAssess, editAssess } from '../actions/assess'; import { getAssess, delAssess, editAssess } from '../actions/assess';
import moment from 'moment'; import moment from 'moment';
import { getRoadadministration, addRoadadministration, delRoadadministration, modifyRoadadministration } from '../actions/luzheng'; import { getRoadadministration, addRoadadministration, delRoadadministration, modifyRoadadministration } from '../actions/luzheng';
// import Uploads from "../../../../components/Upload/index" // import Uploads from "../../../../components/Upload/index"
// import Uploads from '../../../components/Upload/index' // import Uploads from '../../../components/Upload/index'
import Uploads from './uploads' import Uploads from './uploads'
const { Option } = Select; const { Option } = Select;
const LuzhengModel = ({ editData, check, visible, onCancel, dispatch }) => { const LuzhengModel = ({ editData, check, visible, onCancel, dispatch }) => {
const [form] = Form.useForm(); const [form] = Form.useForm();
console.log(editData,'editData') // console.log(editData,'editData')
return ( return (
<Modal <Modal
title="路政信息" title="路政信息"
open={visible} open={visible}
visible={visible} visible={visible}
footer={check?null:undefined} cancelButtonProps={{
// cancelButtonProps={{ disabled: check,
// disabled: check, }}
// }} footer={!check ? [
<Button key="submit" type="primary" onClick={() => {
if (check) {
return onCancel()
}
form.validateFields().then(values => {
if (editData) {
dispatch(modifyRoadadministration(editData?.id, {
...values
})).then(res => {
if (res.success) {
onCancel()
}
})
} else {
dispatch(addRoadadministration({
...values,
})).then(res => {
if (res.success) {
onCancel()
}
})
}
})
}}>
确定
</Button>,
<Button onClick={onCancel}>
取消
</Button>
] : null}
onOk={() => { onOk={() => {
if (check) { if (check) {
return onCancel() return onCancel()
@ -66,13 +97,13 @@ const LuzhengModel = ({ editData, check, visible, onCancel, dispatch }) => {
}} }}
> >
<Form.Item name="enforcementdate" label="执法日期" rules={[{ required: true, message: '请填写' }]}> <Form.Item name="enforcementdate" label="执法日期" rules={[{ required: true, message: '请填写' }]}>
{/* <Select> {/* <Select>
{                         {
unitList.map(item => (                             unitList.map(item => (
<Option value={item} key={item} />                                 <Option value={item} key={item} />
))                             ))
}                         }
</Select> */}                     </Select> */}
<DatePicker /> <DatePicker />
</Form.Item> </Form.Item>

22
web/client/src/sections/fillion/containers/luzheng.js

@ -4,7 +4,7 @@ import { getAssess, delAssess, editAssess } from '../actions/assess';
import { getRoadadministration, addRoadadministration, delRoadadministration, modifyRoadadministration } from '../actions/luzheng'; import { getRoadadministration, addRoadadministration, delRoadadministration, modifyRoadadministration } from '../actions/luzheng';
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
import AssessModal from '../components/luzhengmodel'; import AssessModal from '../components/luzhengmodel';
import { Form, Space, DatePicker, Button, Select, Popconfirm ,Image} from 'antd' import { Form, Space, DatePicker, Button, Select, Popconfirm, Image, Tooltip } from 'antd'
import moment from 'moment'; import moment from 'moment';
import { values } from 'lodash'; import { values } from 'lodash';
@ -66,8 +66,10 @@ function Assess(props) {
<div style={{ marginBottom: '20px', display: 'flex', justifyContent: 'space-between' }}> <div style={{ marginBottom: '20px', display: 'flex', justifyContent: 'space-between' }}>
<Form layout="inline" onFinish={(v) => { <Form layout="inline" onFinish={(v) => {
setQuery({ ...query, page:1,unit: v.unit,startTime : v?.time && moment(v?.time[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss'), setQuery({
endTime : v?.time && moment(v?.time[1]).add(1, 'days').endOf('day').format('YYYY-MM-DD HH:mm:ss') }) ...query, page: 1, unit: v.unit, startTime: v?.time && moment(v?.time[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss'),
endTime: v?.time && moment(v?.time[1]).add(1, 'days').endOf('day').format('YYYY-MM-DD HH:mm:ss')
})
}}> }}>
@ -97,12 +99,22 @@ function Assess(props) {
{ {
title: '执法道路', title: '执法道路',
dataIndex: 'roadname', dataIndex: 'roadname',
key: 'roadname' key: 'roadname',
render: (t, r) => {
return <Tooltip title={r?.roadname}>
<span className='shenglve'>{r?.roadname && r?.roadname?.length > 20 ? r?.roadname?.substr(0, 20) + '...' : r?.roadname}</span>
</Tooltip>
}
}, },
{ {
title: '执法成果', title: '执法成果',
dataIndex: 'enforcementreslt', dataIndex: 'enforcementreslt',
key: 'enforcementreslt', key: 'enforcementreslt',
render: (t, r) => {
return <Tooltip title={r?.enforcementreslt}>
<span className='shenglve'>{r?.enforcementreslt && r?.enforcementreslt?.length > 20 ? r?.enforcementreslt?.substr(0, 20) + '...' : r?.enforcementreslt}</span>
</Tooltip>
}
}, },
{ {
title: '执法图片', title: '执法图片',
@ -149,7 +161,7 @@ function Assess(props) {
setLoading(false) setLoading(false)
if (res.success) { if (res.success) {
setQuery({ ...query, page: 1, pageSize: 10, limit: 10 }) setQuery({ ...query, page: 1, pageSize: 10, limit: 10 })
// getData(page) // getData(page)
} }
}) })
}} }}

Loading…
Cancel
Save