2024-09-20 15:02:50 +08:00
|
|
|
import React, { Fragment, useRef, useMemo,useEffect,useState } from 'react';
|
|
|
|
|
import { Table, Modal, message } from 'antd';
|
|
|
|
|
import {useDispatch, useSelector} from "react-redux";
|
|
|
|
|
import usePageTable from '../../../components/crud/usePageTable2'
|
|
|
|
|
import { createCrudService } from '../../../components/crud/_';
|
|
|
|
|
import { httppost2 } from '../../../utils/request';
|
|
|
|
|
import apiurl from '../../../service/apiurl';
|
|
|
|
|
import SetDrpStation from '../setMapStation/drp.js'
|
|
|
|
|
import moment from 'moment';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Page = () => {
|
|
|
|
|
const [ tableData, setTableData ] = useState([])
|
|
|
|
|
const dispatch = useDispatch();
|
|
|
|
|
const columns = [
|
|
|
|
|
{ title: '名称', key: 'name', dataIndex: 'name',align: "center", ellipsis: true },
|
|
|
|
|
{ title: '行政区划', key: 'adnm', dataIndex: 'adnm',align: "center" },
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
// useEffect(()=>{
|
|
|
|
|
// dispatch.map.setLayerVisible({ YHJMHLayer: true })
|
|
|
|
|
// return ()=>{
|
|
|
|
|
// dispatch.map.setLayerVisible({ YHJMHLayer: false })
|
|
|
|
|
// }
|
|
|
|
|
// },[])
|
|
|
|
|
|
|
|
|
|
useEffect(()=>{
|
|
|
|
|
(async()=>{
|
|
|
|
|
const { code, data} = await httppost2(apiurl.home.getyhjmh)
|
|
|
|
|
if(code!==200){
|
|
|
|
|
return
|
|
|
|
|
}
|
2024-10-23 16:54:07 +08:00
|
|
|
// const list = data.filter(o=>o.adcd.indexOf('421181113')===0)
|
|
|
|
|
setTableData(data)
|
2024-09-20 15:02:50 +08:00
|
|
|
})()
|
|
|
|
|
},[])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<div className="home_yuqing">
|
|
|
|
|
<div className="ant-card-body" style={{padding:"10px"}}>
|
|
|
|
|
<Table rowKey="adcd"
|
|
|
|
|
sticky
|
|
|
|
|
columns={columns}
|
|
|
|
|
pagination={false}
|
|
|
|
|
dataSource={tableData}
|
|
|
|
|
scroll={{ y: "400px"}}
|
|
|
|
|
onRow={
|
|
|
|
|
(row)=>({
|
|
|
|
|
onClick:()=>{
|
|
|
|
|
dispatch.runtime.setCameraTarget({
|
|
|
|
|
center: [row.lgtd, row.lttd],
|
|
|
|
|
zoom: 18,
|
|
|
|
|
pitch: 60
|
|
|
|
|
})
|
|
|
|
|
dispatch.runtime.setFeaturePop({
|
|
|
|
|
id: row.avrcd,
|
|
|
|
|
data:{...row},
|
|
|
|
|
type: 'yanhejuminhu',
|
|
|
|
|
lgtd: row.lgtd,
|
|
|
|
|
lttd: row.lttd,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default Page
|