From 4ca4bfff0c1bb4507feb41c87eab25abf3b8e381 Mon Sep 17 00:00:00 2001 From: zjlnb666 <14659021+zhangjianlong666@user.noreply.gitee.com> Date: Fri, 17 Oct 2025 14:33:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A1=E6=A3=80=E4=BB=BB=E5=8A=A1=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B911?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/inspectiontasks/InspectionTasks.js | 5 + .../Inspectiontaskplan/InspectionTaskPlan.js | 225 +++++++++++++++++- .../InspectionTaskPlan.less | 16 +- 3 files changed, 235 insertions(+), 11 deletions(-) diff --git a/src/pages/inspectiontasks/InspectionTasks.js b/src/pages/inspectiontasks/InspectionTasks.js index e8a6dd1..3b9e57a 100644 --- a/src/pages/inspectiontasks/InspectionTasks.js +++ b/src/pages/inspectiontasks/InspectionTasks.js @@ -42,6 +42,11 @@ const InspectionTasks = () => { }, Pagination:{ colorPrimary:'#39c574', + }, + Tree:{ + colorPrimary:'#006665', + lineColor:'#006665', + checkboxBorderColor:'#006665' } }, }; diff --git a/src/pages/inspectiontasks/components/Inspectiontaskplan/InspectionTaskPlan.js b/src/pages/inspectiontasks/components/Inspectiontaskplan/InspectionTaskPlan.js index b954d49..2f96ecc 100644 --- a/src/pages/inspectiontasks/components/Inspectiontaskplan/InspectionTaskPlan.js +++ b/src/pages/inspectiontasks/components/Inspectiontaskplan/InspectionTaskPlan.js @@ -478,6 +478,170 @@ const GroupTable=()=>{ /> ) } +const TimeTable=()=>{ + //状态管理 + const [dataSource,setDataSource]=useState([]) //表格数据 + const [loading,setLoading]=useState(false) //加载状态 + const [total,setTotal]=useState(0) + const [currentPage,setCurrentPage]=useState(1) + const [pageSize,setPageSize]=useState(10) + const [selectedRowKeys,setSelectedRowKeys]=useState([])//选中行的id + const columns=[ + { + title: '序号', + dataIndex: 'index', + key: 'index', + width: 60, + align:'center', + render: (text, record, index) => (index + 1) + (currentPage - 1) * pageSize + }, + { + title: '线路ID', + dataIndex: 'id', + key: 'id', + align:'center', + }, + { + title: '线路名称', + dataIndex: 'name', + key: 'name', + align:'center', + }, + { + title: '所属班次', + dataIndex: 'shifts', + key: 'shifts', + align:'center', + }, + { + title: '所属专业', + dataIndex: 'affiliation', + key: 'affiliation', + align:'center', + }, + { + title: '涉及区域', + dataIndex: 'position', + key: 'position', + align:'center', + }, + { + title: '设备数量', + dataIndex: 'deviceNum', + key: 'deviceNum', + align:'center', + }, + { + title: '巡视项数量', + dataIndex: 'lookNum', + key: 'lookNum', + align:'center', + + }, + { + title: '状态', + dataIndex: 'status', + key: 'status', + align:'center', + render: (status) => ( + + ) + }, + { + title: '操作', + key: 'action', + align:'center', + render: (_, record) => ( + + handleView(record)} style={{ color: '#2C9E9D' }}> + 查看详情 + + + ), + }, + ] + // 选择框配置 + // const rowSelection = { + // selectedRowKeys, + // onChange: (newSelectedRowKeys) => { + // setSelectedRowKeys(newSelectedRowKeys); + // }, + // }; + const fetchTableData=()=>{ + try{ + setLoading(true) + const mockData=[ + { + key: '1', + id: 'GH001', + name: '白班电气巡检线 1', + shifts: '白班', + affiliation: '电气专业', + position: '发电机、中水处区', + deviceNum: '22', + lookNum: 3, + status: 'true', + }, + { + key: '2', + id: 'GH001', + name: '白班电气巡检线 1', + shifts: '白班', + affiliation: '电气专业', + position: '发电机、中水处区', + deviceNum: '22', + lookNum: 3, + status: 'true', + }, + + + ] + setDataSource(mockData) + setTotal(85) + + }catch(error){ + console.error(error) + }finally{ + setLoading(false) + } + } + // 初始加载和分页变化时重新获取数据 + useEffect(() => { + fetchTableData(); + }, [currentPage, pageSize]); + // 处理查看详情 + const handleView = (record) => { + // 预留查看详情逻辑 + console.log('查看详情:', record); + }; + + // 处理编辑 + const handleEdit = (record) => { + // 预留编辑逻辑 + console.log('编辑:', record); + }; + + // 处理删除 + const handleDelete = (record) => { + // 预留删除逻辑 + console.log('删除:', record); + }; + return( + + ) +} // 分页组件 const TablePagination = ({ currentPage, pageSize, total, onPageChange, onPageSizeChange }) => { return ( @@ -679,6 +843,21 @@ const TimeMange=()=>{ ) } const PatrolRouteQuery=()=>{ + const [currentPage, setCurrentPage] = useState(1); + const [pageSize, setPageSize] = useState(10); + const [total, setTotal] = useState(85); // 总条数,实际项目中从接口获取 + + // 处理页码变化 + const handlePageChange = (page, pageSize) => { + setCurrentPage(page); + setPageSize(pageSize); + }; + + // 处理每页条数变化 + const handlePageSizeChange = (current, size) => { + setPageSize(size); + setCurrentPage(1); // 重置到第一页 + }; const treeData=[ { title:'班次', @@ -708,24 +887,50 @@ const PatrolRouteQuery=()=>{ {title:'除盐水区域', key:'除盐水区域',}, ] }, - - ] return(
-
+ + + +
+ + +
+ + + + - - + + + + + + + + + - 1 ) diff --git a/src/pages/inspectiontasks/components/Inspectiontaskplan/InspectionTaskPlan.less b/src/pages/inspectiontasks/components/Inspectiontaskplan/InspectionTaskPlan.less index 98545af..aa0e300 100644 --- a/src/pages/inspectiontasks/components/Inspectiontaskplan/InspectionTaskPlan.less +++ b/src/pages/inspectiontasks/components/Inspectiontaskplan/InspectionTaskPlan.less @@ -131,4 +131,18 @@ width: 100%; height: 631px; } - +.tree{ + background-color: #E7F2ED; + :global(.ant-tree-switcher-leaf-line::after){ + border-bottom:1px solid #006665; + } + :global(.ant-tree-switcher-leaf-line::before){ + border-inline-end:1px solid #006665; + } + :global(.ant-tree-checkbox-inner){ + border:1px solid #006665 !important; + } + :global(.ant-tree-indent-unit::before){ + border-inline-end:none !important; + } +}