|
|
@ -15,6 +15,7 @@ const MaintenanceSpotCheck = (props) => { |
|
|
|
const [vis, setVis] = useState(false)//模态框的显示与隐藏变量
|
|
|
|
const [count, setCount] = useState(0) |
|
|
|
const [page, setPage] = useState(1) |
|
|
|
const [innerPage, setInnerPage] = useState(1) |
|
|
|
const [depName, setDepName] = useState('') |
|
|
|
const [total, setTotal] = useState(0) |
|
|
|
const [previewId, setPreviewId] = useState(0) |
|
|
@ -26,6 +27,7 @@ const MaintenanceSpotCheck = (props) => { |
|
|
|
const [expandedRowKeys, setExpandedRowKeys] = useState([]); |
|
|
|
const [isAdjustment, setIsAdjustment] = useState(false); |
|
|
|
const [editData, setEditData] = useState({}); |
|
|
|
const [keyword, setKeyword] = useState(""); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -71,6 +73,7 @@ const MaintenanceSpotCheck = (props) => { |
|
|
|
dispatch(roadSpotList(data)).then(res => { |
|
|
|
if (res.success) { |
|
|
|
setReportData(res?.payload.data) |
|
|
|
setKeyword("") |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
@ -78,6 +81,7 @@ const MaintenanceSpotCheck = (props) => { |
|
|
|
const detailData = (data = {}) => { |
|
|
|
dispatch(roadSpotDetail(data)).then(res => { |
|
|
|
if (res.success) { |
|
|
|
setInnerPage(1) |
|
|
|
setDetailList(res?.payload.data) |
|
|
|
} |
|
|
|
}) |
|
|
@ -120,6 +124,7 @@ const MaintenanceSpotCheck = (props) => { |
|
|
|
setVis(true) |
|
|
|
}} type='primary' style={{ marginLeft: 10 }}> 新增 </Button> |
|
|
|
<div> |
|
|
|
|
|
|
|
<RangePicker value={dateRange[0] ? [moment(dateRange[0]), moment(dateRange[1])] : []} onChange={(date, dateString) => { |
|
|
|
setDateRange(dateString) |
|
|
|
}} style={{ marginRight: 20 }} /> |
|
|
@ -143,6 +148,7 @@ const MaintenanceSpotCheck = (props) => { |
|
|
|
expandedRowKeys: expandedRowKeys, // 控制哪些行展开,这里需要通过 state 管理
|
|
|
|
// defaultExpandedRowKeys: ['0'],
|
|
|
|
onExpand: (expanded, record) => { |
|
|
|
setKeyword("") |
|
|
|
if (expanded) { |
|
|
|
setExpandedRowKeys([record?.id]) |
|
|
|
detailData({ previewId: record?.id }) |
|
|
@ -152,11 +158,27 @@ const MaintenanceSpotCheck = (props) => { |
|
|
|
} |
|
|
|
}, |
|
|
|
expandedRowRender: (record) => ( |
|
|
|
<> |
|
|
|
<div style={{ textAlign: 'end' }}> |
|
|
|
<Input style={{ width: 160, marginRight: 16 }} onPressEnter={() => { |
|
|
|
detailData({ previewId: record?.id, keyword: keyword }) |
|
|
|
}} value={keyword} placeholder='道路名称关键字' onChange={(e) => { |
|
|
|
setKeyword(e.target.value) |
|
|
|
}} /> |
|
|
|
<Button style={{ marginRight: 20 }} onClick={() => { |
|
|
|
detailData({ previewId: record?.id, keyword: keyword }) |
|
|
|
}} > 查询 </Button> |
|
|
|
</div> |
|
|
|
< Table |
|
|
|
pagination={{ |
|
|
|
total: detailList?.length || 0, |
|
|
|
pageSize: 10, |
|
|
|
current: innerPage || 1, |
|
|
|
defaultPageSize: 10, |
|
|
|
showSizeChanger: false, |
|
|
|
onChange: (page, pageSize) => { |
|
|
|
setInnerPage(page) |
|
|
|
} |
|
|
|
}} |
|
|
|
loading={detailLoading} |
|
|
|
style={{ margin: 0 }} |
|
|
@ -190,6 +212,8 @@ const MaintenanceSpotCheck = (props) => { |
|
|
|
]} |
|
|
|
|
|
|
|
/> |
|
|
|
</> |
|
|
|
|
|
|
|
), |
|
|
|
}} |
|
|
|
pagination={{ |
|
|
|