|
|
@ -1,23 +1,23 @@ |
|
|
|
import React, { useEffect, useState, useRef } from 'react'; |
|
|
|
import { connect } from 'react-redux'; |
|
|
|
import { Spin, Button, Popconfirm } from 'antd'; |
|
|
|
import ProTable from '@ant-design/pro-table'; |
|
|
|
import React, { useEffect, useState, useRef } from 'react' |
|
|
|
import { connect } from 'react-redux' |
|
|
|
import { Spin, Button, Popconfirm } from 'antd' |
|
|
|
import ProTable from '@ant-design/pro-table' |
|
|
|
import './protable.less' |
|
|
|
import moment from 'moment'; |
|
|
|
import moment from 'moment' |
|
|
|
import { getRoadway, getProject, delRoadway, delProject, getVillageList } from "../actions/infor" |
|
|
|
import UserModal from './infor/details'; |
|
|
|
import ProjectModal from './project/project'; |
|
|
|
import UserModal from './infor/details' |
|
|
|
import ProjectModal from './project/project' |
|
|
|
|
|
|
|
const TransporTationTable = (props) => { |
|
|
|
const { dispatch, user, depData, depMessage, depLoading, villageList } = props |
|
|
|
const [rowSelected, setRowSelected] = useState([]) |
|
|
|
const [sitename, setSitename] = useState()//名称
|
|
|
|
const [counts, setCounts] = useState()//shuju
|
|
|
|
const [modalVisible, setModalVisible] = useState(false); |
|
|
|
const [modalVisibleyilan, setModalVisibleyilan] = useState(false); |
|
|
|
const [modalRecord, setModalRecord] = useState(); |
|
|
|
const [typecard, setTypecard] = useState(); |
|
|
|
const [activeKey, setActiveKey] = useState('tab1'); |
|
|
|
const [modalVisible, setModalVisible] = useState(false) |
|
|
|
const [modalVisibleyilan, setModalVisibleyilan] = useState(false) |
|
|
|
const [modalRecord, setModalRecord] = useState() |
|
|
|
const [typecard, setTypecard] = useState() |
|
|
|
const [activeKey, setActiveKey] = useState('tab1') |
|
|
|
const [recortd, setRecortd] = useState() |
|
|
|
const [whichofits, setWhichofits] = useState('县') |
|
|
|
const [delet, setDelet] = useState() |
|
|
@ -30,12 +30,12 @@ const TransporTationTable = (props) => { |
|
|
|
useEffect(() => { ref.current.reload() }, [whichofits, delet]) |
|
|
|
//打开弹窗
|
|
|
|
const openModal = (type, record) => { |
|
|
|
setModalVisible(true); |
|
|
|
setModalVisible(true) |
|
|
|
// setModalType(type);
|
|
|
|
if (type == 'edit') { |
|
|
|
setModalRecord(record); |
|
|
|
setModalRecord(record) |
|
|
|
} else { |
|
|
|
setModalRecord(null); |
|
|
|
setModalRecord(null) |
|
|
|
} |
|
|
|
} |
|
|
|
useEffect(() => { |
|
|
@ -50,12 +50,12 @@ const TransporTationTable = (props) => { |
|
|
|
// console.log('11111', depMessage)
|
|
|
|
// }, [depMessage])
|
|
|
|
const yilanModal = (type, record) => { |
|
|
|
setModalVisibleyilan(true); |
|
|
|
setModalVisibleyilan(true) |
|
|
|
// setModalType(type);
|
|
|
|
if (type == 'edit') { |
|
|
|
setModalRecord(record); |
|
|
|
setModalRecord(record) |
|
|
|
} else { |
|
|
|
setModalRecord(null); |
|
|
|
setModalRecord(null) |
|
|
|
} |
|
|
|
} |
|
|
|
//删除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 () => { |
|
|
|
dispatch(getVillageList({})) |
|
|
@ -94,7 +116,7 @@ const TransporTationTable = (props) => { |
|
|
|
query.level = '村' |
|
|
|
} |
|
|
|
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) |
|
|
|
}, [whichofits]) |
|
|
|
|
|
|
@ -150,13 +172,22 @@ const TransporTationTable = (props) => { |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '乡镇编码', |
|
|
|
title: '所属乡镇', |
|
|
|
search: false, |
|
|
|
dataIndex: 'time3', |
|
|
|
dataIndex: 'time9', |
|
|
|
valueType: 'dateRange', |
|
|
|
width: 120, |
|
|
|
|
|
|
|
|
|
|
|
width: 140, |
|
|
|
|
|
|
|
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: { |
|
|
|
getPopupContainer: (triggerNode) => triggerNode.parentNode, |
|
|
@ -1203,6 +1234,45 @@ const TransporTationTable = (props) => { |
|
|
|
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: '操作', |
|
|
|
dataIndex: 'creatTime', |
|
|
@ -1258,7 +1328,7 @@ const TransporTationTable = (props) => { |
|
|
|
导入 |
|
|
|
</Button> */} |
|
|
|
</div> |
|
|
|
); |
|
|
|
) |
|
|
|
}, |
|
|
|
}, |
|
|
|
], tab2: [ |
|
|
@ -1310,13 +1380,22 @@ const TransporTationTable = (props) => { |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '乡镇编码', |
|
|
|
title: '所属乡镇', |
|
|
|
search: false, |
|
|
|
dataIndex: 'time3', |
|
|
|
dataIndex: 'time9', |
|
|
|
valueType: 'dateRange', |
|
|
|
width: 120, |
|
|
|
|
|
|
|
|
|
|
|
width: 140, |
|
|
|
|
|
|
|
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: { |
|
|
|
getPopupContainer: (triggerNode) => triggerNode.parentNode, |
|
|
@ -2363,6 +2442,22 @@ const TransporTationTable = (props) => { |
|
|
|
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: '操作', |
|
|
|
dataIndex: 'creatTime', |
|
|
@ -2417,7 +2512,7 @@ const TransporTationTable = (props) => { |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
); |
|
|
|
) |
|
|
|
}, |
|
|
|
}, |
|
|
|
], tab3: [ |
|
|
@ -2483,16 +2578,25 @@ const TransporTationTable = (props) => { |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '乡镇编码', |
|
|
|
title: '所属乡镇', |
|
|
|
search: false, |
|
|
|
dataIndex: 'time3', |
|
|
|
dataIndex: 'time9', |
|
|
|
valueType: 'dateRange', |
|
|
|
width: 120, |
|
|
|
|
|
|
|
|
|
|
|
width: 140, |
|
|
|
|
|
|
|
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: { |
|
|
|
getPopupContainer: (c) => triggerNode.parentNode, |
|
|
|
getPopupContainer: (triggerNode) => triggerNode.parentNode, |
|
|
|
} |
|
|
|
}, { |
|
|
|
title: '起点地名', |
|
|
@ -3536,6 +3640,7 @@ const TransporTationTable = (props) => { |
|
|
|
getPopupContainer: (triggerNode) => triggerNode.parentNode, |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
title: '操作', |
|
|
|
dataIndex: 'creatTime', |
|
|
@ -3592,7 +3697,7 @@ const TransporTationTable = (props) => { |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
); |
|
|
|
) |
|
|
|
}, |
|
|
|
}, |
|
|
|
], tab4: [ |
|
|
@ -3778,7 +3883,7 @@ const TransporTationTable = (props) => { |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
); |
|
|
|
) |
|
|
|
}, |
|
|
|
}, |
|
|
|
] |
|
|
@ -3836,7 +3941,7 @@ const TransporTationTable = (props) => { |
|
|
|
}} |
|
|
|
scroll={{ x: 800 }} |
|
|
|
options={false} |
|
|
|
ref={c => { finishedProductTable = c; }} |
|
|
|
ref={c => { finishedProductTable = c }} |
|
|
|
style={{ width: "100% ", overflow: "auto", height: '760px' }} |
|
|
|
rowKey='id' |
|
|
|
onReset={(v) => { |
|
|
@ -3845,7 +3950,7 @@ const TransporTationTable = (props) => { |
|
|
|
rowSelection={{ |
|
|
|
selectedRowKeys: rowSelected, |
|
|
|
onChange: (selectedRowKeys) => { |
|
|
|
setRowSelected(selectedRowKeys); |
|
|
|
setRowSelected(selectedRowKeys) |
|
|
|
}, |
|
|
|
}} |
|
|
|
columns={columns[activeKey]} |
|
|
@ -3859,8 +3964,8 @@ const TransporTationTable = (props) => { |
|
|
|
level: '县', |
|
|
|
road: sitename |
|
|
|
} |
|
|
|
setRowSelected([]); |
|
|
|
const res = await dispatch(getRoadway(query)); |
|
|
|
setRowSelected([]) |
|
|
|
const res = await dispatch(getRoadway(query)) |
|
|
|
|
|
|
|
setCounts(departmentInfo ? res.payload.data.filter((item) => { |
|
|
|
return item.townshipCode === departmentInfo.areaCode |
|
|
@ -3875,8 +3980,8 @@ const TransporTationTable = (props) => { |
|
|
|
level: '乡', |
|
|
|
road: sitename |
|
|
|
} |
|
|
|
setRowSelected([]); |
|
|
|
const res = await dispatch(getRoadway(query)); |
|
|
|
setRowSelected([]) |
|
|
|
const res = await dispatch(getRoadway(query)) |
|
|
|
setCounts(departmentInfo ? res.payload.data.filter((item) => { |
|
|
|
return item.townshipCode === departmentInfo.areaCode |
|
|
|
}) : res.payload.data) |
|
|
@ -3889,7 +3994,7 @@ const TransporTationTable = (props) => { |
|
|
|
level: '村', |
|
|
|
road: sitename |
|
|
|
} |
|
|
|
setRowSelected([]); |
|
|
|
setRowSelected([]) |
|
|
|
const res = await dispatch(getRoadway(query)) |
|
|
|
setCounts(departmentInfo ? res.payload.data.filter((item) => { |
|
|
|
return item.townshipCode === departmentInfo.areaCode |
|
|
@ -3904,7 +4009,7 @@ const TransporTationTable = (props) => { |
|
|
|
type: 'road', |
|
|
|
entryName: sitename |
|
|
|
} |
|
|
|
setRowSelected([]); |
|
|
|
setRowSelected([]) |
|
|
|
const res = await dispatch(getProject(query)) |
|
|
|
console.log('56666666', res) |
|
|
|
return { |
|
|
@ -3964,7 +4069,7 @@ const data = [ |
|
|
|
{ name: "路线名称", type: 'routeName' }, |
|
|
|
{ name: "路线代码", type: 'routeCode' }, |
|
|
|
{ name: "路段序号", type: 'sectionNo' }, |
|
|
|
{ name: "乡镇编码", type: 'townshipCode' }, |
|
|
|
{ name: "所属乡镇", type: 'townshipCode' }, |
|
|
|
{ name: "起点地名", type: 'startingPlaceName' }, |
|
|
|
{ name: "起点桩号", type: 'startStation' }, |
|
|
|
{ name: "起点分界点类别", type: 'categoryOfStartingPointAndDividingPoint' }, |
|
|
@ -4038,7 +4143,7 @@ const data = [ |
|
|
|
{ name: "面层厚度", type: 'surfaceThickness' }, |
|
|
|
] |
|
|
|
function mapStateToProps (state) { |
|
|
|
const { auth, depMessage, villageList } = state; |
|
|
|
const { auth, depMessage, villageList } = state |
|
|
|
const pakData = (dep) => { |
|
|
|
return dep.map((d) => { |
|
|
|
return { |
|
|
@ -4056,6 +4161,6 @@ function mapStateToProps (state) { |
|
|
|
depLoading: depMessage.isRequesting, |
|
|
|
depData, |
|
|
|
villageList: villageList?.data || [] |
|
|
|
}; |
|
|
|
} |
|
|
|
export default connect(mapStateToProps)(TransporTationTable); |
|
|
|
} |
|
|
|
export default connect(mapStateToProps)(TransporTationTable) |