Browse Source

(*)养护管理道路管理功能提交

dev
peng.peng 1 year ago
parent
commit
2b30a6e882
  1. 45
      web/client/src/sections/fillion/components/adjustment.js
  2. 201
      web/client/src/sections/fillion/components/transportationTable.js
  3. 118
      web/client/src/sections/fillion/containers/maintenanceSpotCheck-new.js
  4. 50
      web/client/src/sections/organization/components/depModal.js

45
web/client/src/sections/fillion/components/adjustment.js

@ -1,7 +1,7 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux'
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react'
import { Button, Modal, Form, Input, Divider, Spin, Select, DatePicker, Descriptions, Table } from 'antd' import { Button, Modal, Form, Input, Divider, Spin, Select, DatePicker, Descriptions, Table } from 'antd'
import { roadSpotChange } from '../actions/spotCheck'; import { roadSpotChange } from '../actions/spotCheck'
import { getRoadway } from "../actions/infor" import { getRoadway } from "../actions/infor"
import moment from 'moment' import moment from 'moment'
@ -21,14 +21,14 @@ const Adjustment = (props) => {
const [reportData, setReportData] = useState([]) const [reportData, setReportData] = useState([])
const [detailList, setDetailList] = useState([]) const [detailList, setDetailList] = useState([])
const [detailVisible, setDetailVisible] = useState(false) const [detailVisible, setDetailVisible] = useState(false)
const [dateRange, setDateRange] = useState([]); const [dateRange, setDateRange] = useState([])
const { RangePicker } = DatePicker const { RangePicker } = DatePicker
const [nameList, setNameList] = useState([]); const [nameList, setNameList] = useState([])
const [codeList, setCodeList] = useState([]); const [codeList, setCodeList] = useState([])
const [indexList, setIndexList] = useState([]); const [indexList, setIndexList] = useState([])
const [roadFind, setRoadFind] = useState({}); const [roadFind, setRoadFind] = useState({})
const [routeCodeDisabled, setRouteCodeDisabled] = useState(true); const [routeCodeDisabled, setRouteCodeDisabled] = useState(true)
const [sectionNoDisabled, setSectionNoDisabled] = useState(true); const [sectionNoDisabled, setSectionNoDisabled] = useState(true)
@ -52,7 +52,7 @@ const Adjustment = (props) => {
if (v.sectionNo && !index.includes(v.sectionNo)) { if (v.sectionNo && !index.includes(v.sectionNo)) {
index.push(v.sectionNo) index.push(v.sectionNo)
} }
}); })
setNameList(name) setNameList(name)
setCodeList(code) setCodeList(code)
setIndexList(index) setIndexList(index)
@ -80,10 +80,11 @@ const Adjustment = (props) => {
changeRoadId: data?.id changeRoadId: data?.id
})).then(res => { })).then(res => {
if (res.success) { if (res.success) {
console.log(res)
onCancel() onCancel()
onOk() onOk()
} }
}); })
}) })
@ -100,7 +101,7 @@ const Adjustment = (props) => {
if (v.routeName && !name.includes(v.routeName)) { if (v.routeName && !name.includes(v.routeName)) {
name.push(v.routeName) name.push(v.routeName)
} }
}); })
for (let d in changedValues) { for (let d in changedValues) {
if (d == 'routeName') { if (d == 'routeName') {
form.setFieldsValue({ form.setFieldsValue({
@ -111,7 +112,7 @@ const Adjustment = (props) => {
if (allValues?.routeName && allValues?.routeName == v.routeName && v.routeCode && !code.includes(v.routeCode)) { if (allValues?.routeName && allValues?.routeName == v.routeName && v.routeCode && !code.includes(v.routeCode)) {
code.push(v.routeCode) code.push(v.routeCode)
} }
}); })
setCodeList(code) setCodeList(code)
} }
@ -129,7 +130,7 @@ const Adjustment = (props) => {
if (!allValues?.routeCode && v.routeCode && !code.includes(v.routeCode)) { if (!allValues?.routeCode && v.routeCode && !code.includes(v.routeCode)) {
code.push(v.routeCode) code.push(v.routeCode)
} }
}); })
if (!allValues?.routeCode) { if (!allValues?.routeCode) {
setCodeList(code) setCodeList(code)
} }
@ -158,13 +159,13 @@ const Adjustment = (props) => {
if (allValues?.routeName && allValues?.routeCode && allValues?.sectionNo) { if (allValues?.routeName && allValues?.routeCode && allValues?.sectionNo) {
let find = road?.find(s => allValues?.routeName == s.routeName && allValues?.routeCode == s.routeCode && allValues?.sectionNo == s.sectionNo) let find = road?.find(s => allValues?.routeName == s.routeName && allValues?.routeCode == s.routeCode && allValues?.sectionNo == s.sectionNo)
form.setFieldsValue({ form.setFieldsValue({
'startingPlaceName': find?.startingPlaceName, 'startStation': find?.startStation,
'stopPlaceName': find?.stopPlaceName 'stopStation': find?.stopStation
}) })
} else { } else {
form.setFieldsValue({ form.setFieldsValue({
'startingPlaceName': null, 'startStation': null,
'stopPlaceName': null 'stopStation': null
}) })
} }
@ -194,10 +195,10 @@ const Adjustment = (props) => {
<Select style={{}} allowClear showSearch={true} disabled={sectionNoDisabled} placeholder="请选择路段序号" options={indexList?.map(v => ({ value: v, label: v })) || []} /> <Select style={{}} allowClear showSearch={true} disabled={sectionNoDisabled} placeholder="请选择路段序号" options={indexList?.map(v => ({ value: v, label: v })) || []} />
</Form.Item> </Form.Item>
<Form.Item label='起点地名' name='startingPlaceName'> <Form.Item label='起点桩号' name='startStation'>
<Input disabled /> <Input disabled />
</Form.Item> </Form.Item>
<Form.Item label='止点地名' name='stopPlaceName'> <Form.Item label='止点桩号' name='stopStation'>
<Input disabled /> <Input disabled />
</Form.Item> </Form.Item>
</Form> </Form>
@ -218,4 +219,4 @@ function mapStateToProps (state) {
road: road?.data || [], road: road?.data || [],
} }
} }
export default connect(mapStateToProps)(Adjustment); export default connect(mapStateToProps)(Adjustment)

201
web/client/src/sections/fillion/components/transportationTable.js

@ -1,23 +1,23 @@
import React, { useEffect, useState, useRef } from 'react'; import React, { useEffect, useState, useRef } from 'react'
import { connect } from 'react-redux'; import { connect } from 'react-redux'
import { Spin, Button, Popconfirm } from 'antd'; import { Spin, Button, Popconfirm } from 'antd'
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table'
import './protable.less' import './protable.less'
import moment from 'moment'; import moment from 'moment'
import { getRoadway, getProject, delRoadway, delProject, getVillageList } from "../actions/infor" import { getRoadway, getProject, delRoadway, delProject, getVillageList } from "../actions/infor"
import UserModal from './infor/details'; import UserModal from './infor/details'
import ProjectModal from './project/project'; import ProjectModal from './project/project'
const TransporTationTable = (props) => { const TransporTationTable = (props) => {
const { dispatch, user, depData, depMessage, depLoading, villageList } = props const { dispatch, user, depData, depMessage, depLoading, villageList } = props
const [rowSelected, setRowSelected] = useState([]) const [rowSelected, setRowSelected] = useState([])
const [sitename, setSitename] = useState()//名称 const [sitename, setSitename] = useState()//名称
const [counts, setCounts] = useState()//shuju const [counts, setCounts] = useState()//shuju
const [modalVisible, setModalVisible] = useState(false); const [modalVisible, setModalVisible] = useState(false)
const [modalVisibleyilan, setModalVisibleyilan] = useState(false); const [modalVisibleyilan, setModalVisibleyilan] = useState(false)
const [modalRecord, setModalRecord] = useState(); const [modalRecord, setModalRecord] = useState()
const [typecard, setTypecard] = useState(); const [typecard, setTypecard] = useState()
const [activeKey, setActiveKey] = useState('tab1'); const [activeKey, setActiveKey] = useState('tab1')
const [recortd, setRecortd] = useState() const [recortd, setRecortd] = useState()
const [whichofits, setWhichofits] = useState('县') const [whichofits, setWhichofits] = useState('县')
const [delet, setDelet] = useState() const [delet, setDelet] = useState()
@ -30,12 +30,12 @@ const TransporTationTable = (props) => {
useEffect(() => { ref.current.reload() }, [whichofits, delet]) useEffect(() => { ref.current.reload() }, [whichofits, delet])
//打开弹窗 //打开弹窗
const openModal = (type, record) => { const openModal = (type, record) => {
setModalVisible(true); setModalVisible(true)
// setModalType(type); // setModalType(type);
if (type == 'edit') { if (type == 'edit') {
setModalRecord(record); setModalRecord(record)
} else { } else {
setModalRecord(null); setModalRecord(null)
} }
} }
useEffect(() => { useEffect(() => {
@ -50,12 +50,12 @@ const TransporTationTable = (props) => {
// console.log('11111', depMessage) // console.log('11111', depMessage)
// }, [depMessage]) // }, [depMessage])
const yilanModal = (type, record) => { const yilanModal = (type, record) => {
setModalVisibleyilan(true); setModalVisibleyilan(true)
// setModalType(type); // setModalType(type);
if (type == 'edit') { if (type == 'edit') {
setModalRecord(record); setModalRecord(record)
} else { } else {
setModalRecord(null); setModalRecord(null)
} }
} }
//删除daolu //删除daolu
@ -78,6 +78,28 @@ const TransporTationTable = (props) => {
} }
const roadCode = [
{ title: "八一乡", value: "360121206000" },
{ title: "东新乡", value: "360121205000" },
{ title: "富山乡", value: "360121204000" },
{ title: "冈上镇", value: "360121107000" },
{ title: "广福镇", value: "360121108000" },
{ title: "黄马乡", value: "360121203000" },
{ title: "蒋巷镇", value: "360121105000" },
{ title: "金湖管理处", value: "330052" },
{ title: "泾口乡", value: "360121200000" },
{ title: "莲塘镇", value: "360121100000" },
{ title: "南新乡", value: "360121201000" },
{ title: "三江镇", value: "360121102000" },
{ title: "塔城乡", value: "360121202000" },
{ title: "塘南镇", value: "360121103000" },
{ title: "武阳镇", value: "360121106000" },
{ title: "向塘镇", value: "360121101000" },
{ title: "银三角管委会", value: "360121471000" },
{ title: "幽兰镇", value: "360121104000" },
]
useEffect(async () => { useEffect(async () => {
dispatch(getVillageList({})) dispatch(getVillageList({}))
@ -94,7 +116,7 @@ const TransporTationTable = (props) => {
query.level = '村' query.level = '村'
} }
const res = await dispatch(getRoadway(query)) const res = await dispatch(getRoadway(query))
const uniqueArray = [...new Set(res.payload.data?.map(item => item.routeName))]; const uniqueArray = [...new Set(res.payload.data?.map(item => item.routeName))]
setRoadData(uniqueArray) setRoadData(uniqueArray)
}, [whichofits]) }, [whichofits])
@ -150,13 +172,22 @@ const TransporTationTable = (props) => {
} }
}, },
{ {
title: '乡镇编码', title: '所属乡镇',
search: false, search: false,
dataIndex: 'time3', dataIndex: 'time9',
valueType: 'dateRange', valueType: 'dateRange',
width: 120,
width: 140,
render: (dom, record) => { render: (dom, record) => {
return record.townshipCode const targetValue = record.townshipCode ?? ''
const foundItem = roadCode.find(item => item.value === targetValue)
if (foundItem) {
return foundItem.title
} else {
return "--"
}
}, },
fieldProps: { fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode, getPopupContainer: (triggerNode) => triggerNode.parentNode,
@ -1203,6 +1234,45 @@ const TransporTationTable = (props) => {
getPopupContainer: (triggerNode) => triggerNode.parentNode, getPopupContainer: (triggerNode) => triggerNode.parentNode,
} }
}, },
{
title: '所属行政村',
search: false,
dataIndex: 'time9',
valueType: 'dateRange',
width: 140,
render: (dom, record) => {
return record.villageId
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
}
},
{
title: '是否隐藏字段',
search: false,
dataIndex: 'time9',
valueType: 'dateRange',
width: 140,
render: (dom, record) => {
console.log(record.spot)
if (record.spot) {
return "是"
} else {
return "否"
}
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
}
},
{ {
title: '操作', title: '操作',
dataIndex: 'creatTime', dataIndex: 'creatTime',
@ -1258,7 +1328,7 @@ const TransporTationTable = (props) => {
导入 导入
</Button> */} </Button> */}
</div> </div>
); )
}, },
}, },
], tab2: [ ], tab2: [
@ -1310,13 +1380,22 @@ const TransporTationTable = (props) => {
} }
}, },
{ {
title: '乡镇编码', title: '所属乡镇',
search: false, search: false,
dataIndex: 'time3', dataIndex: 'time9',
valueType: 'dateRange', valueType: 'dateRange',
width: 120,
width: 140,
render: (dom, record) => { render: (dom, record) => {
return record.townshipCode const targetValue = record.townshipCode ?? ''
const foundItem = roadCode.find(item => item.value === targetValue)
if (foundItem) {
return foundItem.title
} else {
return "--"
}
}, },
fieldProps: { fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode, getPopupContainer: (triggerNode) => triggerNode.parentNode,
@ -2363,6 +2442,22 @@ const TransporTationTable = (props) => {
getPopupContainer: (triggerNode) => triggerNode.parentNode, getPopupContainer: (triggerNode) => triggerNode.parentNode,
} }
}, },
{
title: '所属行政村',
search: false,
dataIndex: 'time9',
valueType: 'dateRange',
width: 140,
render: (dom, record) => {
return record.villageId
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
}
},
{ {
title: '操作', title: '操作',
dataIndex: 'creatTime', dataIndex: 'creatTime',
@ -2417,7 +2512,7 @@ const TransporTationTable = (props) => {
</div> </div>
); )
}, },
}, },
], tab3: [ ], tab3: [
@ -2483,16 +2578,25 @@ const TransporTationTable = (props) => {
} }
}, },
{ {
title: '乡镇编码', title: '所属乡镇',
search: false, search: false,
dataIndex: 'time3', dataIndex: 'time9',
valueType: 'dateRange', valueType: 'dateRange',
width: 120,
width: 140,
render: (dom, record) => { render: (dom, record) => {
return record.townshipCode const targetValue = record.townshipCode ?? ''
const foundItem = roadCode.find(item => item.value === targetValue)
if (foundItem) {
return foundItem.title
} else {
return "--"
}
}, },
fieldProps: { fieldProps: {
getPopupContainer: (c) => triggerNode.parentNode, getPopupContainer: (triggerNode) => triggerNode.parentNode,
} }
}, { }, {
title: '起点地名', title: '起点地名',
@ -3536,6 +3640,7 @@ const TransporTationTable = (props) => {
getPopupContainer: (triggerNode) => triggerNode.parentNode, getPopupContainer: (triggerNode) => triggerNode.parentNode,
} }
}, },
{ {
title: '操作', title: '操作',
dataIndex: 'creatTime', dataIndex: 'creatTime',
@ -3592,7 +3697,7 @@ const TransporTationTable = (props) => {
</div> </div>
); )
}, },
}, },
], tab4: [ ], tab4: [
@ -3778,7 +3883,7 @@ const TransporTationTable = (props) => {
</div> </div>
); )
}, },
}, },
] ]
@ -3836,7 +3941,7 @@ const TransporTationTable = (props) => {
}} }}
scroll={{ x: 800 }} scroll={{ x: 800 }}
options={false} options={false}
ref={c => { finishedProductTable = c; }} ref={c => { finishedProductTable = c }}
style={{ width: "100% ", overflow: "auto", height: '760px' }} style={{ width: "100% ", overflow: "auto", height: '760px' }}
rowKey='id' rowKey='id'
onReset={(v) => { onReset={(v) => {
@ -3845,7 +3950,7 @@ const TransporTationTable = (props) => {
rowSelection={{ rowSelection={{
selectedRowKeys: rowSelected, selectedRowKeys: rowSelected,
onChange: (selectedRowKeys) => { onChange: (selectedRowKeys) => {
setRowSelected(selectedRowKeys); setRowSelected(selectedRowKeys)
}, },
}} }}
columns={columns[activeKey]} columns={columns[activeKey]}
@ -3859,8 +3964,8 @@ const TransporTationTable = (props) => {
level: '县', level: '县',
road: sitename road: sitename
} }
setRowSelected([]); setRowSelected([])
const res = await dispatch(getRoadway(query)); const res = await dispatch(getRoadway(query))
setCounts(departmentInfo ? res.payload.data.filter((item) => { setCounts(departmentInfo ? res.payload.data.filter((item) => {
return item.townshipCode === departmentInfo.areaCode return item.townshipCode === departmentInfo.areaCode
@ -3875,8 +3980,8 @@ const TransporTationTable = (props) => {
level: '乡', level: '乡',
road: sitename road: sitename
} }
setRowSelected([]); setRowSelected([])
const res = await dispatch(getRoadway(query)); const res = await dispatch(getRoadway(query))
setCounts(departmentInfo ? res.payload.data.filter((item) => { setCounts(departmentInfo ? res.payload.data.filter((item) => {
return item.townshipCode === departmentInfo.areaCode return item.townshipCode === departmentInfo.areaCode
}) : res.payload.data) }) : res.payload.data)
@ -3889,7 +3994,7 @@ const TransporTationTable = (props) => {
level: '村', level: '村',
road: sitename road: sitename
} }
setRowSelected([]); setRowSelected([])
const res = await dispatch(getRoadway(query)) const res = await dispatch(getRoadway(query))
setCounts(departmentInfo ? res.payload.data.filter((item) => { setCounts(departmentInfo ? res.payload.data.filter((item) => {
return item.townshipCode === departmentInfo.areaCode return item.townshipCode === departmentInfo.areaCode
@ -3904,7 +4009,7 @@ const TransporTationTable = (props) => {
type: 'road', type: 'road',
entryName: sitename entryName: sitename
} }
setRowSelected([]); setRowSelected([])
const res = await dispatch(getProject(query)) const res = await dispatch(getProject(query))
console.log('56666666', res) console.log('56666666', res)
return { return {
@ -3964,7 +4069,7 @@ const data = [
{ name: "路线名称", type: 'routeName' }, { name: "路线名称", type: 'routeName' },
{ name: "路线代码", type: 'routeCode' }, { name: "路线代码", type: 'routeCode' },
{ name: "路段序号", type: 'sectionNo' }, { name: "路段序号", type: 'sectionNo' },
{ name: "乡镇编码", type: 'townshipCode' }, { name: "所属乡镇", type: 'townshipCode' },
{ name: "起点地名", type: 'startingPlaceName' }, { name: "起点地名", type: 'startingPlaceName' },
{ name: "起点桩号", type: 'startStation' }, { name: "起点桩号", type: 'startStation' },
{ name: "起点分界点类别", type: 'categoryOfStartingPointAndDividingPoint' }, { name: "起点分界点类别", type: 'categoryOfStartingPointAndDividingPoint' },
@ -4038,7 +4143,7 @@ const data = [
{ name: "面层厚度", type: 'surfaceThickness' }, { name: "面层厚度", type: 'surfaceThickness' },
] ]
function mapStateToProps (state) { function mapStateToProps (state) {
const { auth, depMessage, villageList } = state; const { auth, depMessage, villageList } = state
const pakData = (dep) => { const pakData = (dep) => {
return dep.map((d) => { return dep.map((d) => {
return { return {
@ -4056,6 +4161,6 @@ function mapStateToProps (state) {
depLoading: depMessage.isRequesting, depLoading: depMessage.isRequesting,
depData, depData,
villageList: villageList?.data || [] villageList: villageList?.data || []
}; }
} }
export default connect(mapStateToProps)(TransporTationTable); export default connect(mapStateToProps)(TransporTationTable)

118
web/client/src/sections/fillion/containers/maintenanceSpotCheck-new.js

@ -1,8 +1,9 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux'
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react'
import { Button, Modal, Form, Input, Divider, Spin, Select, DatePicker, Tooltip, Table } from 'antd' import { Button, Modal, Form, Input, Divider, Spin, Select, DatePicker, Tooltip, Table } from 'antd'
import { ExclamationCircleOutlined } from '@ant-design/icons'; import { ExclamationCircleOutlined } from '@ant-design/icons'
import { roadSpotList, roadSpotDetail, roadSpotPrepare, confirmRoadSpot, exportSpotRode } from '../actions/spotCheck'; import { getVillageList } from "../actions/infor"
import { roadSpotList, roadSpotDetail, roadSpotPrepare, confirmRoadSpot, exportSpotRode } from '../actions/spotCheck'
import moment from 'moment' import moment from 'moment'
import Adjustment from '../components/adjustment' import Adjustment from '../components/adjustment'
import '../components/maintenanceTable.less' import '../components/maintenanceTable.less'
@ -22,17 +23,53 @@ const MaintenanceSpotCheck = (props) => {
const [reportData, setReportData] = useState([]) const [reportData, setReportData] = useState([])
const [detailList, setDetailList] = useState([]) const [detailList, setDetailList] = useState([])
const [detailVisible, setDetailVisible] = useState(false) const [detailVisible, setDetailVisible] = useState(false)
const [dateRange, setDateRange] = useState([]); const [dateRange, setDateRange] = useState([])
const { RangePicker } = DatePicker const { RangePicker } = DatePicker
const [expandedRowKeys, setExpandedRowKeys] = useState([]); const [expandedRowKeys, setExpandedRowKeys] = useState([])
const [isAdjustment, setIsAdjustment] = useState(false); const [isAdjustment, setIsAdjustment] = useState(false)
const [editData, setEditData] = useState({}); const [editData, setEditData] = useState({})
const [keyword, setKeyword] = useState(""); const [keyword, setKeyword] = useState("")
const roadCode = [
{ title: "八一乡", value: "360121206000" },
{ title: "东新乡", value: "360121205000" },
{ title: "富山乡", value: "360121204000" },
{ title: "冈上镇", value: "360121107000" },
{ title: "广福镇", value: "360121108000" },
{ title: "黄马乡", value: "360121203000" },
{ title: "蒋巷镇", value: "360121105000" },
{ title: "金湖管理处", value: "330052" },
{ title: "泾口乡", value: "360121200000" },
{ title: "莲塘镇", value: "360121100000" },
{ title: "南新乡", value: "360121201000" },
{ title: "三江镇", value: "360121102000" },
{ title: "塔城乡", value: "360121202000" },
{ title: "塘南镇", value: "360121103000" },
{ title: "武阳镇", value: "360121106000" },
{ title: "向塘镇", value: "360121101000" },
{ title: "银三角管委会", value: "360121471000" },
{ title: "幽兰镇", value: "360121104000" },
]
const [village, setVillage] = useState()
useEffect(() => {
const fetchData = async () => {
try {
const res = await dispatch(getVillageList({}))
let data = res.payload.data
console.log(data)
data.map(s => {
setVillage(s)
})
} catch (error) {
console.error(error)
}
}
fetchData()
//里层列名 }, [dispatch])
// console.log(village)
const columns = [ const columns = [
{ {
title: '抽查日期', title: '抽查日期',
@ -46,19 +83,19 @@ const MaintenanceSpotCheck = (props) => {
dataIndex: 'countyPercentage', dataIndex: 'countyPercentage',
}, },
{ {
title: '抽查县道', title: '抽查县道(公里)',
key: 'spotCountyRoadCount', key: 'countryMil',
dataIndex: 'spotCountyRoadCount', dataIndex: 'countryMil',
}, },
{ {
title: '抽查乡道', title: '抽查乡道(公里)',
key: 'spotTownRoadCount', key: 'townMil',
dataIndex: 'spotTownRoadCount', dataIndex: 'townMil',
}, },
{ {
title: '抽查村道', title: '抽查村道(公里)',
key: 'spotVillageRoadCount', key: 'villageMil',
dataIndex: 'spotVillageRoadCount', dataIndex: 'villageMil',
}, },
{ {
title: '操作', title: '操作',
@ -103,9 +140,9 @@ const MaintenanceSpotCheck = (props) => {
const res = await dispatch(roadSpotPrepare({ countyPercentage: values.percentValue })) const res = await dispatch(roadSpotPrepare({ countyPercentage: values.percentValue }))
setPreviewId(res?.payload.data?.previewId) setPreviewId(res?.payload.data?.previewId)
form.setFieldsValue({ form.setFieldsValue({
'spotCountyRoadCount': res?.payload.data?.spotCountyRoadCount, 'countryMil': res?.payload.data?.countryMil,
'spotTownRoadCount': res?.payload.data?.spotTownRoadCount, 'townMil': res?.payload.data?.townMil,
'spotVillageRoadCount': res?.payload.data?.spotVillageRoadCount, 'villageMil': res?.payload.data?.villageMil,
}) })
} }
}) })
@ -186,14 +223,27 @@ const MaintenanceSpotCheck = (props) => {
columns={ columns={
[ [
{ {
title: '道路类型', key: 'level', dataIndex: 'level', render: (_, r) => r?.road?.level ? (r?.road?.level + '道') : '--' title: '所属乡镇', key: 'townshipCode', dataIndex: 'townshipCode', render: (_, r) => {
const targetValue = r?.road?.townshipCode ?? ''
const foundItem = roadCode.find(item => item.value === targetValue)
if (foundItem) {
return foundItem.title
} else {
return "--"
}
}
}, },
{ title: '所属行政村', key: 'villageId', dataIndex: 'villageId', render: (_, r) => r.road?.villageId === village.id ? village.name : '--' },
{ title: '道路名称', key: 'routeName', dataIndex: 'routeName', render: (_, r) => r.road?.routeName || '--' }, { title: '道路名称', key: 'routeName', dataIndex: 'routeName', render: (_, r) => r.road?.routeName || '--' },
{ title: '道路代码', key: 'routeCode', dataIndex: 'routeCode', render: (_, r) => r.road?.routeCode || '--' }, { title: '道路代码', key: 'routeCode', dataIndex: 'routeCode', render: (_, r) => r.road?.routeCode || '--' },
{ title: '路段序号', key: 'sectionNo', dataIndex: 'sectionNo', render: (_, r) => r.road?.sectionNo || '--' }, // { title: '路段序号', key: 'sectionNo', dataIndex: 'sectionNo', render: (_, r) => r.road?.sectionNo || '--' },
{ title: '起点地名', key: 'startingPlaceName', dataIndex: 'startingPlaceName', render: (_, r) => r.road?.startingPlaceName || '--' }, { title: '起点桩号', key: 'startStation', dataIndex: 'startStation', render: (_, r) => r.road?.startStation || '--' },
{ title: '止点地名', key: 'stopPlaceName', dataIndex: 'stopPlaceName', render: (_, r) => r.road?.stopPlaceName || '--' }, { title: '止点桩号', key: 'stopStation', dataIndex: 'stopStation', render: (_, r) => r.road?.stopStation || '--' },
{ title: '里程', key: 'chainageMileage', dataIndex: 'chainageMileage', render: (_, r) => r.road?.chainageMileage || '--' }, { title: '技术等级', key: 'technicalLevel', dataIndex: 'technicalLevel', render: (_, r) => r.road?.technicalLevel || '--' },
{ title: '路面类型', key: 'pavementType', dataIndex: 'pavementType', render: (_, r) => r.road?.pavementType || '--' },
{ title: '路面宽度', key: 'pavementWidth', dataIndex: 'pavementWidth', render: (_, r) => r.road?.pavementWidth || '--' },
{ title: '路基宽度', key: 'subgradeWidth', dataIndex: 'subgradeWidth', render: (_, r) => r.road?.subgradeWidth || '--' },
{ title: '桩号里程', key: 'chainageMileage', dataIndex: 'chainageMileage', render: (_, r) => r.road?.chainageMileage || '--' },
{ title: '养护次数(次)', key: 'maintenanceCount', dataIndex: 'maintenanceCount' }, { title: '养护次数(次)', key: 'maintenanceCount', dataIndex: 'maintenanceCount' },
{ {
title: '操作', title: '操作',
@ -243,7 +293,7 @@ const MaintenanceSpotCheck = (props) => {
form.resetFields() form.resetFields()
setVis(false) setVis(false)
} }
}); })
}) })
}}> }}>
<Form form={form}> <Form form={form}>
@ -269,13 +319,13 @@ const MaintenanceSpotCheck = (props) => {
}}> }}>
<Button style={{}} type='primary' onClick={extractHandler}>开始抽取</Button> <Button style={{}} type='primary' onClick={extractHandler}>开始抽取</Button>
</Form.Item> </Form.Item>
<Form.Item label='抽查县道(条)' name='spotCountyRoadCount'> <Form.Item label='抽查县道(公里)' name='countryMil'>
<Input disabled /> <Input disabled />
</Form.Item> </Form.Item>
<Form.Item label='抽查乡道(条)' name='spotTownRoadCount'> <Form.Item label='抽查乡道(公里)' name='townMil'>
<Input disabled /> <Input disabled />
</Form.Item> </Form.Item>
<Form.Item label='抽查村道(条)' name='spotVillageRoadCount'> <Form.Item label='抽查村道(公里)' name='villageMil'>
<Input disabled /> <Input disabled />
</Form.Item> </Form.Item>
</Form> </Form>
@ -313,4 +363,4 @@ function mapStateToProps (state) {
} }
} }
export default connect(mapStateToProps)(MaintenanceSpotCheck); export default connect(mapStateToProps)(MaintenanceSpotCheck)

50
web/client/src/sections/organization/components/depModal.js

@ -1,35 +1,31 @@
import React, { useRef, useState, useEffect } from 'react'; import React, { useRef, useState, useEffect } from 'react'
import { connect } from 'react-redux'; import { connect } from 'react-redux'
import { Spin, Card, Modal, TreeSelect } from 'antd'; import { Spin, Card, Modal, TreeSelect } from 'antd'
import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect } from '@ant-design/pro-form'; import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect } from '@ant-design/pro-form'
const DepModal = (props) => { const DepModal = (props) => {
const { visible, onVisibleChange, onConfirm, depModalType, depData, data } = props const { visible, onVisibleChange, onConfirm, depModalType, depData, data } = props
console.log('data', data) console.log('data', data)
const formRef = useRef(); const formRef = useRef()
const roadCode = [ const roadCode = [
{ title: "莲塘镇", value: "360121100000" }, { title: "八一乡", value: "360121206000" },
{ title: "向塘镇", value: "360121101000" }, { title: "东新乡", value: "360121205000" },
{ title: "三江镇", value: "360121102000" }, { title: "富山乡", value: "360121204000" },
{ title: "塘南镇", value: "360121103000" },
{ title: "幽兰镇", value: "360121104000" },
{ title: "蒋巷镇", value: "360121105000" },
{ title: "武阳镇", value: "360121106000" },
{ title: "冈上镇", value: "360121107000" }, { title: "冈上镇", value: "360121107000" },
{ title: "广福镇", value: "360121108000" }, { title: "广福镇", value: "360121108000" },
//{ title: "昌东镇", value: "360121191000" }, { title: "黄马乡", value: "360121203000" },
//{ title: "麻丘镇", value: "360121192000" }, { title: "蒋巷镇", value: "360121105000" },
{ title: "金湖管理处", value: "330052" },
{ title: "泾口乡", value: "360121200000" }, { title: "泾口乡", value: "360121200000" },
{ title: "莲塘镇", value: "360121100000" },
{ title: "南新乡", value: "360121201000" }, { title: "南新乡", value: "360121201000" },
{ title: "三江镇", value: "360121102000" },
{ title: "塔城乡", value: "360121202000" }, { title: "塔城乡", value: "360121202000" },
{ title: "黄马乡", value: "360121203000" }, { title: "塘南镇", value: "360121103000" },
{ title: "富山乡", value: "360121204000" }, { title: "武阳镇", value: "360121106000" },
//{ title: "东新乡", value: "360121205000" }, { title: "向塘镇", value: "360121101000" },
{ title: "八一乡", value: "360121206000" }, { title: "银三角管委会", value: "360121471000" },
//{ title: "小蓝经济开发区", value: "360121403000" }, { title: "幽兰镇", value: "360121104000" },
{ title: "银三角管理委员会", value: "360121471000" },
// { title: "五星垦殖场", value: "360121501000" },
// { title: "良种繁殖场", value: "360121572000" },
] ]
useEffect(() => { useEffect(() => {
//console.log('depData', depData) //console.log('depData', depData)
@ -46,7 +42,7 @@ const DepModal = (props) => {
} }
onConfirm(value) onConfirm(value)
} else { } else {
onConfirm(values); onConfirm(values)
} }
} }
@ -112,8 +108,8 @@ const DepModal = (props) => {
) )
} }
function mapStateToProps(state) { function mapStateToProps (state) {
const { depMessage } = state; const { depMessage } = state
const pakData = (dep) => { const pakData = (dep) => {
return dep.map((d) => { return dep.map((d) => {
@ -134,7 +130,7 @@ function mapStateToProps(state) {
return { return {
loading: depMessage.isRequesting, loading: depMessage.isRequesting,
depData, depData,
}; }
} }
export default connect(mapStateToProps)(DepModal); export default connect(mapStateToProps)(DepModal)
Loading…
Cancel
Save