import React, {useState} from "react"; import {Badge, Col, ConfigProvider, message, Modal, Row, Table, Timeline,} from "antd" export default function getGisSbleData(props: { height: string }) { // 添加图片预览相关状态 const [previewImage, setPreviewImage] = useState(null); const [previewVisible, setPreviewVisible] = useState(false); // 设备列表状态 const [TodoWorkOrder, setTodoWorkOrder] = useState(false) const [TodoWorkOrderDevice, setTodoWorkOrderDevice] = useState(null) // 添加工单表格数据和列定义 const todoWorkOrders = [ { id: '1', // 添加唯一 id 作为 rowKey equipmentId: 'WO202309001', EventLevel: 'high', EventClassification: '污水井盖', Region: '区域一', ReportPerson: '张三', CurrentLink: '维护中', EventDescription: '井盖出现裂痕,需要维修', PictureBeforeDisposal: 'sunhuaiManhole.png', deviceName: '井盖一', createTime: '2023-09-15 08:30:00', status: 'pending', type: '故障维修', }, { id: '2', // 添加唯一 id 作为 rowKey equipmentId: 'WO202309002', EventLevel: 'low', EventClassification: '污水井盖', Region: '区域一', ReportPerson: '张三', CurrentLink: '维护中', EventDescription: '井盖出现裂痕,需要维修', PictureBeforeDisposal: 'sunhuaiManhole.png', deviceName: '井盖二', createTime: '2023-09-15 08:30:00', status: 'pending', type: '故障维修', }, { id: '3', // 添加唯一 id 作为 rowKey equipmentId: 'WO202309003', EventLevel: 'low', EventClassification: '污水井盖', Region: '区域一', ReportPerson: '张三', CurrentLink: '维护中', EventDescription: '井盖出现裂痕,需要维修', PictureBeforeDisposal: 'sunhuaiManhole.png', deviceName: '井盖三', createTime: '2023-09-15 08:30:00', status: 'pending', type: '故障维修', }, { id: '4', // 添加唯一 id 作为 rowKey equipmentId: 'WO202309004', EventLevel: 'low', EventClassification: '污水井盖', Region: '区域一', ReportPerson: '张三', CurrentLink: '维护中', EventDescription: '井盖出现裂痕,需要维修', PictureBeforeDisposal: 'sunhuaiManhole.png', deviceName: '井盖四', createTime: '2023-09-15 08:30:00', status: 'pending', type: '故障维修', }, { id: '5', // 添加唯一 id 作为 rowKey equipmentId: 'WO202309005', EventLevel: 'medium', EventClassification: '污水井盖', Region: '区域一', ReportPerson: '张三', CurrentLink: '维护中', EventDescription: '井盖出现裂痕,需要维修', PictureBeforeDisposal: 'sunhuaiManhole.png', deviceName: '井盖五', createTime: '2023-09-15 08:30:00', status: 'pending', type: '故障维修', }, { id: '6', // 添加唯一 id 作为 rowKey equipmentId: 'WO202309006', EventLevel: 'medium', EventClassification: '污水井盖', Region: '区域一', ReportPerson: '张三', CurrentLink: '维护中', EventDescription: '井盖出现裂痕,需要维修', PictureBeforeDisposal: 'sunhuaiManhole.png', deviceName: '井盖六', createTime: '2023-09-15 08:30:00', status: 'pending', type: '故障维修', } ]; const workOrderColumns = [ { title: '工单编号', dataIndex: 'equipmentId', key: 'equipmentId', width: '20%', ellipsis: true, // 添加省略号属性 render: (text) => {text} }, { title: '工单类型', dataIndex: 'type', key: 'type', width: '18%', ellipsis: true, // 添加省略号属性 render: (text) => {text} }, { title: '设备名称', dataIndex: 'deviceName', key: 'deviceName', width: '18%', ellipsis: true, // 添加省略号属性 render: (text) => {text} }, { title: '优先级', dataIndex: 'EventLevel', key: 'EventLevel', width: '14%', render: (priority) => { const colorMap = { high: '#f5222d', medium: '#faad14', low: '#52c41a' }; const textMap = { high: '高', medium: '中', low: '低' }; return ( {textMap[priority]} }/> ); } }, ]; // 添加工单行点击处理函数 - 修改为打开设备详情弹窗 const handleWorkOrderRowClick = (record) => { // 根据工单中的设备名称查找对应的设备信息 const device = todoWorkOrders.find(device => device.deviceName === record.deviceName); if (device) { // 设置选中设备并打开弹窗 setTodoWorkOrderDevice(device); setTodoWorkOrder(true); } else { message.warning(`未找到设备: ${record.deviceName}`); } }; return (
'bg-[#3a3899]'} // 添加固定表头配置 scroll={{x: 200, y: 180}} // 添加行点击事件 onRow={(record) => ({ onClick: () => handleWorkOrderRowClick(record), style: { cursor: 'pointer', // 鼠标悬停显示手型 } })} /> {/*待办工单详情*/} setTodoWorkOrder(false)} // footer={null} width={1000} className="custom-modal" style={{ textAlign: 'center' }} > {TodoWorkOrderDevice && (
设备名称: {TodoWorkOrderDevice.deviceName}
设备类型: {TodoWorkOrderDevice.EventClassification}
事件类型: {TodoWorkOrderDevice.type}
事件描述: {TodoWorkOrderDevice.EventDescription}
所属区域: {TodoWorkOrderDevice.Region}
当前环节: {TodoWorkOrderDevice.CurrentLink}
优先级: { TodoWorkOrderDevice.EventLevel === "high" ? "高优先级" : TodoWorkOrderDevice.EventLevel === "medium" ? "中优先级" : "低优先级" } } />
上报人: {TodoWorkOrderDevice.ReportPerson}
上报时间: {TodoWorkOrderDevice.createTime}
{/**/}
现场图片: 现场图片 { setPreviewImage(TodoWorkOrderDevice.PictureBeforeDisposal); setPreviewVisible(true); }} />
工单处理流程

【指挥协调上报】

办理时间: 2025-03-17 09:03:16

处置单位: 数字化城市管理指挥中心

经办人员: 张三

办理意见:

), }, { color: 'green', children: (

【指挥协调待受理】

办理时间: 2025-03-17 09:15:19

处置单位: 数字化城市管理指挥中心

经办人员: 受理员

办理意见:

), }, { children: (

【指挥协调案件立案】

办理时间: 2025-03-17 09:03:16

处置单位: 数字化城市管理指挥中心

经办人员: 值班长

办理意见:

), }, { color: 'gray', children: (

【指挥协调待派遣】

办理时间: 2025-03-17 09:03:16

处置单位: 数字化城市管理指挥中心

经办人员: 派遣员

办理意见: 派遣给:'二二路灯管理所,时限:4小时

), }, { color: 'gray', children: (

【指挥协调处理】

办理时间: 2025-03-17 09:03:16

处置单位: 数字化城市管理指挥中心

经办人员: 张三

办理意见:

), }, { color: '#00CCFF', children: 工单结束, }, ]} />
)} {/* 添加图片预览弹窗 */} setPreviewVisible(false)} maskClosable={true} width="800px" height="500px" bodyStyle={{padding: 0}} closable={true} zIndex={10000} > {previewImage && ( 预览图片 )} {/* 添加全局样式覆盖表头背景色 */} ) }