import React, { useMemo, useState } from 'react'; import useRequest from '../../../../utils/useRequest'; import { useDispatch, useSelector } from 'react-redux'; import PanelBox from '../../components/PanelBox'; import Table from '@material-ui/core/Table'; import TableContainer from '@material-ui/core/TableContainer'; import TableBody from '@material-ui/core/TableBody'; import TableHead from '@material-ui/core/TableHead'; import TableRow from '@material-ui/core/TableRow'; import DpTableCell from '../../../../layouts/mui/DpTableCell'; import DpTableRow from '../../../../layouts/mui/DpTableRow'; import clsx from 'clsx'; import { renderDrp } from '../../../../utils/renutils'; import XcCard from './xcCard' import config from '../../../../config'; const data = [ { "guid": "42118120003", "code": "1", "name": "浮桥河水库-汛前检查", "resRegCode": "42000020030-A4", "adName": "白果镇", "engScal": "大(2)型", "place": "湖北省-黄冈市-麻城市-白果镇", "lgtd": "114.88169", "lttd": "31.171967", 'username': '熊杰', taskType: '日常巡查', tm: '2025-06-02 00:08:00', status: '进行中' }, { "guid": "42118120003", "code": "", "name": "浮桥河水库-特别巡查", "resRegCode": "42000020030-A4", "adName": "白果镇", "engScal": "大(2)型", "place": "湖北省-黄冈市-麻城市-白果镇", "lgtd": "115.068090", "lttd": "31.026170", 'username': '白斌', taskType: '汛前巡查', tm: '2025-06-02 00:09:00', status: '已完成' }, { "guid": "42118120003", "code": "", "name": "浮桥河水库-日常管理", "resRegCode": "42000020030-A4", "adName": "白果镇", "engScal": "大(2)型", "place": "湖北省-黄冈市-麻城市-白果镇", "lgtd": "115.120278", "lttd": "31.183611", 'username': '周真', taskType: '特别巡查', tm: '2025-06-02 00:10:00', status: '未完成' }, { "guid": "42118120003", "code": "", "name": "浮桥河水库-汛前检查", "resRegCode": "42000020030-A4", "adName": "白果镇", "engScal": "大(2)型", "place": "湖北省-黄冈市-麻城市-白果镇", "lgtd": "115.057222", "lttd": "31.110833", 'username': '陈发', taskType: '特别巡查', tm: '2025-06-02 00:10:00', status: '未完成' }, ] function DrpReal({ style }) { const [tab, setTab] = useState('1') const dispatch = useDispatch(); const flyTo = () => { dispatch?.runtime.setInfoDlg({ layerId: 'XunchachaoshiLayer', properties: {} }) } const setSkLayer1 = ()=>{ const map = window.__mapref; const layer = map.getLayer('临时线') if(layer){ map.removeLayer('临时线'); map.removeSource('临时线'); } map.addLayer({ 'id': '临时线', 'type': 'line', 'source': { 'type': 'geojson', 'data': `${window.location.origin}/data3/line2.geojson` }, 'layout': { 'line-join': 'round' }, 'paint': { 'line-color': 'red', 'line-width': 10 // [ // 'case', // ['==', ['get', 'LEVEL'], 1], 2.2, // ['==', ['get', 'LEVEL'], 2], 2.2, // ['==', ['get', 'LEVEL'], 3], 2.2, // ['==', ['get', 'LEVEL'], 4], 1.6, // ['==', ['get', 'LEVEL'], 5], 1.3, // 10 // ] }, 'visibility': 'visible', }); } const jumpTo = (record) => { const { lgtd, lttd } = record; const lgtdNum = Number(lgtd); const lttdNum = Number(lttd) if (record.code == 1) { setSkLayer1() if (lgtdNum && lttdNum) { dispatch.runtime.setCameraTarget({ center: [lgtdNum, lttdNum], zoom: 17, pitch: config.poiPitch, }); } } } return ( setTab('1')}>本月 setTab('2')}>本年 } >
巡查任务
任务标题 任务类型 巡查人 巡查时间 状态 {data.map((row, index) => ( jumpTo(row)} >
{row.name}
{row.taskType} {row.username}
{row.tm}
{row.status}
))}
数据统计
) } export default DrpReal;