| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071 |
- import React, {useMemo, useState} from "react";
- import {Badge, Button, Col, ConfigProvider, Modal, Row, Select, Table,} from "antd"
- export default function getGisSbleData(props: { height: string }) {
- // 添加设备类型筛选状态
- const [typeFilter, setTypeFilter] = useState('all');
- // 添加导航按钮状态管理
- const [activeNavButton, setActiveNavButton] = useState("realtime");
- // 设备列表状态
- const [GISdeviceModalVisible, setGISDeviceModalVisible] = useState(false)
- const [GISselectedDevice, setGISSelectedDevice] = useState(null)
- // 添加图片预览相关状态
- const [previewImage, setPreviewImage] = useState<string | null>(null);
- const [previewVisible, setPreviewVisible] = useState(false);
- //gis设备列表
- const EquipmentListData = {
- columns: [
- {
- title: () => (
- <div style={{
- textAlign: 'center',
- // color: 'white',
- // padding: '8px' // 保持内边距一致
- }}>
- 设备名称
- </div>
- ),
- dataIndex: "name",
- width: 100,
- ellipsis: true,
- render: (text, record) => ( // 添加record参数获取行数据
- <div
- style={{
- // backgroundColor: '#e8e8e8',
- textAlign: 'center',
- cursor: 'pointer', // 显示手型光标
- color: 'white', // 单元格字体颜色
- fontWeight: 'bold'
- // transition: 'background-color 0.2s' // 过渡效果
- }}
- onClick={() => {
- // 设置选中设备并打开弹窗
- setGISSelectedDevice(record);
- setGISDeviceModalVisible(true);
- }}
- onMouseOver={(e) => {
- e.currentTarget.style.backgroundColor = '#3b2e50'; // 鼠标悬停效果
- }}
- onMouseOut={(e) => {
- e.currentTarget.style.backgroundColor = 'transparent'; // 恢复原背景色
- }}
- >
- {text}
- </div>
- ),
- },
- {
- title: () => (
- <div style={{
- // padding: '8px',
- textAlign: 'center',
- // color: 'white' // 统一文字颜色
- }}>
- <div>设备类型</div>
- {/* 添加下拉筛选器 */}
- <Select
- defaultValue="all"
- style={{width: 100}}
- onChange={(value) => setTypeFilter(value)}
- size="small"
- >
- <Select.Option value="all">全部</Select.Option>
- <Select.Option value="电用井盖">电用井盖</Select.Option>
- <Select.Option value="供水井盖">供水井盖</Select.Option>
- <Select.Option value="通信井盖">通信井盖</Select.Option>
- <Select.Option value="燃气井盖">燃气井盖</Select.Option>
- <Select.Option value="污水井盖">污水井盖</Select.Option>
- <Select.Option value="雨水井盖">雨水井盖</Select.Option>
- <Select.Option value="路灯井盖">路灯井盖</Select.Option>
- <Select.Option value="网络井盖">网络井盖</Select.Option>
- <Select.Option value="电缆井盖">电缆井盖</Select.Option>
- <Select.Option value="园林井盖">园林井盖</Select.Option>
- <Select.Option value="化粪池井盖">化粪池井盖</Select.Option>
- </Select>
- </div>
- ),
- dataIndex: "type",
- width: 150,
- ellipsis: true,
- render: (text, record) => ( // 添加record参数获取行数据
- <div
- style={{
- // padding: '8px 0',
- textAlign: 'center',
- cursor: 'pointer',
- color: 'white', // 单元格字体颜色
- fontWeight: 'bold'
- // transition: 'background-color 0.2s'
- }}
- onClick={() => {
- // 设置选中设备并打开弹窗
- setGISSelectedDevice(record);
- setGISDeviceModalVisible(true);
- }}
- onMouseOver={(e) => {
- e.currentTarget.style.backgroundColor = '#3b2e50';
- }}
- onMouseOut={(e) => {
- e.currentTarget.style.backgroundColor = 'transparent';
- }}
- >
- {text}
- </div>
- ),
- },
- {
- title: () => ( // 将标题改为函数组件,自定义表头样式
- <div style={{
- // padding: '8px',
- textAlign: 'center',
- // color: 'white' // 统一文字颜色
- }}>
- 设备电量
- </div>
- ),
- dataIndex: "electricity",
- width: 100,
- render: (text) => {
- // 根据电量值设置背景色和文字色
- const bgColor = text < '30' ? '#fff1f0' : // 低电量:浅红背景
- text < '50' ? '#fffbe6' : // 中电量:浅黄背景
- '#f6ffed'; // 高电量:浅绿背景
- const textColor = text < '30' ? '#f5222d' : // 低电量:红色文字
- text < '50' ? '#faad14' : // 中电量:橙色文字
- '#52c41a'; // 高电量:绿色文字
- return (
- <div style={{
- backgroundColor: bgColor, // 单元格背景色
- color: textColor, // 文字颜色(确保与背景对比度)
- fontWeight: 'bold',
- textAlign: 'center', // 文字居中
- borderRadius: '4px' // 圆角边框(可选)
- }}>
- {text}%
- </div>
- );
- },
- }
- ],
- data: [{
- id: '1',
- name: '井盖一',
- type: '电用井盖',
- electricity: '80',
- facilityCode: '5001110103009062',
- region: '东三路米香街道',
- regionGrade: '暂无',
- locationDescription: '东三路A地铁口向西方向300米',
- competentDepartment: '东三路社区服务中心',
- ownershipUnit: 'A市住房和城乡建设委员会',
- maintenanceUnit: 'A市住房和城乡建设委员会',
- nameOfPersonInCharge: '张三',
- PhoneOfPersonInCharge: '15399665548',
- status: '1',
- manholeType: '1',
- manholeCover: '暂无',
- manholeShape: '圆形',
- constructionTime: '2025-09-15 20:57:42',
- longitude: '110.22252454',
- latitude: '27.1148554',
- manholeImage: 'manholeimg.png',
- QRCode: '/QRCode.jpg',
- }, {
- id: '2',
- name: '井盖二',
- type: '供水井盖',
- electricity: '80',
- facilityCode: '5001110103009062',
- region: '东三路米香街道',
- regionGrade: '暂无',
- locationDescription: '东三路A地铁口向西方向300米',
- competentDepartment: '东三路社区服务中心',
- ownershipUnit: 'A市住房和城乡建设委员会',
- maintenanceUnit: 'A市住房和城乡建设委员会',
- nameOfPersonInCharge: '张三',
- PhoneOfPersonInCharge: '15399665548',
- status: '0',
- manholeType: '1',
- manholeCover: '暂无',
- manholeShape: '圆形',
- constructionTime: '2025-09-15 20:57:42',
- longitude: '110.22252454',
- latitude: '27.1148554',
- manholeImage: 'manholeimg.png',
- QRCode: '/QRCode.jpg',
- }, {
- id: '3',
- name: '井盖三',
- type: '通信井盖',
- electricity: '80',
- facilityCode: '5001110103009062',
- region: '东三路米香街道',
- regionGrade: '暂无',
- locationDescription: '东三路A地铁口向西方向300米',
- competentDepartment: '东三路社区服务中心',
- ownershipUnit: 'A市住房和城乡建设委员会',
- maintenanceUnit: 'A市住房和城乡建设委员会',
- nameOfPersonInCharge: '张三',
- PhoneOfPersonInCharge: '15399665548',
- status: '1',
- manholeType: '1',
- manholeCover: '暂无',
- manholeShape: '圆形',
- constructionTime: '2025-09-15 20:57:42',
- longitude: '110.22252454',
- latitude: '27.1148554',
- manholeImage: 'manholeimg.png',
- QRCode: '/QRCode.jpg',
- }, {
- id: '4',
- name: '井盖四',
- type: '污水井盖',
- electricity: '80',
- facilityCode: '5001110103009062',
- region: '东三路米香街道',
- regionGrade: '暂无',
- locationDescription: '东三路A地铁口向西方向300米',
- competentDepartment: '东三路社区服务中心',
- ownershipUnit: 'A市住房和城乡建设委员会',
- maintenanceUnit: 'A市住房和城乡建设委员会',
- nameOfPersonInCharge: '张三',
- PhoneOfPersonInCharge: '15399665548',
- status: '1',
- manholeType: '1',
- manholeCover: '暂无',
- manholeShape: '圆形',
- constructionTime: '2025-09-15 20:57:42',
- longitude: '110.22252454',
- latitude: '27.1148554',
- manholeImage: 'manholeimg.png',
- QRCode: '/QRCode.jpg',
- }, {
- id: '5',
- name: '井盖五',
- type: '污水井盖',
- electricity: '80',
- facilityCode: '5001110103009062',
- region: '东三路米香街道',
- regionGrade: '暂无',
- locationDescription: '东三路A地铁口向西方向300米',
- competentDepartment: '东三路社区服务中心',
- ownershipUnit: 'A市住房和城乡建设委员会',
- maintenanceUnit: 'A市住房和城乡建设委员会',
- nameOfPersonInCharge: '张三',
- PhoneOfPersonInCharge: '15399665548',
- status: '1',
- manholeType: '1',
- manholeCover: '暂无',
- manholeShape: '圆形',
- constructionTime: '2025-09-15 20:57:42',
- longitude: '110.22252454',
- latitude: '27.1148554',
- manholeImage: 'manholeimg.png',
- QRCode: '/QRCode.jpg',
- }, {
- id: '6',
- name: '井盖六',
- type: '污水井盖',
- electricity: '80',
- facilityCode: '5001110103009062',
- region: '东三路米香街道',
- regionGrade: '暂无',
- locationDescription: '东三路A地铁口向西方向300米',
- competentDepartment: '东三路社区服务中心',
- ownershipUnit: 'A市住房和城乡建设委员会',
- maintenanceUnit: 'A市住房和城乡建设委员会',
- nameOfPersonInCharge: '张三',
- PhoneOfPersonInCharge: '15399665548',
- status: '1',
- manholeType: '1',
- manholeCover: '暂无',
- manholeShape: '圆形',
- constructionTime: '2025-09-15 20:57:42',
- longitude: '110.22252454',
- latitude: '27.1148554',
- manholeImage: 'manholeimg.png',
- QRCode: '/QRCode.jpg',
- }, {
- id: '7',
- name: '井盖七',
- type: '通信井盖',
- electricity: '80',
- facilityCode: '5001110103009062',
- region: '东三路米香街道',
- regionGrade: '暂无',
- locationDescription: '东三路A地铁口向西方向300米',
- competentDepartment: '东三路社区服务中心',
- ownershipUnit: 'A市住房和城乡建设委员会',
- maintenanceUnit: 'A市住房和城乡建设委员会',
- nameOfPersonInCharge: '张三',
- PhoneOfPersonInCharge: '15399665548',
- status: '1',
- manholeType: '1',
- manholeCover: '暂无',
- manholeShape: '圆形',
- constructionTime: '2025-09-15 20:57:42',
- longitude: '110.22252454',
- latitude: '27.1148554',
- manholeImage: 'manholeimg.png',
- QRCode: '/QRCode.jpg',
- }, , {
- id: '8',
- name: '井盖八',
- type: '通信井盖',
- electricity: '80',
- facilityCode: '5001110103009062',
- region: '东三路米香街道',
- regionGrade: '暂无',
- locationDescription: '东三路A地铁口向西方向300米',
- competentDepartment: '东三路社区服务中心',
- ownershipUnit: 'A市住房和城乡建设委员会',
- maintenanceUnit: 'A市住房和城乡建设委员会',
- nameOfPersonInCharge: '张三',
- PhoneOfPersonInCharge: '15399665548',
- status: '1',
- manholeType: '1',
- manholeCover: '暂无',
- manholeShape: '圆形',
- constructionTime: '2025-09-15 20:57:42',
- longitude: '110.22252454',
- latitude: '27.1148554',
- manholeImage: 'manholeimg.png',
- QRCode: '/QRCode.jpg',
- }, {
- id: '9',
- name: '井盖九',
- type: '通信井盖',
- electricity: '80',
- facilityCode: '5001110103009062',
- region: '东三路米香街道',
- regionGrade: '暂无',
- locationDescription: '东三路A地铁口向西方向300米',
- competentDepartment: '东三路社区服务中心',
- ownershipUnit: 'A市住房和城乡建设委员会',
- maintenanceUnit: 'A市住房和城乡建设委员会',
- nameOfPersonInCharge: '张三',
- PhoneOfPersonInCharge: '15399665548',
- status: '1',
- manholeType: '1',
- manholeCover: '暂无',
- manholeShape: '圆形',
- constructionTime: '2025-09-15 20:57:42',
- longitude: '110.22252454',
- latitude: '27.1148554',
- manholeImage: 'manholeimg.png',
- QRCode: '/QRCode.jpg',
- }, {
- id: '10',
- name: '井盖十',
- type: '通信井盖',
- electricity: '80',
- facilityCode: '5001110103009062',
- region: '东三路米香街道',
- regionGrade: '暂无',
- locationDescription: '东三路A地铁口向西方向300米',
- competentDepartment: '东三路社区服务中心',
- ownershipUnit: 'A市住房和城乡建设委员会',
- maintenanceUnit: 'A市住房和城乡建设委员会',
- nameOfPersonInCharge: '张三',
- PhoneOfPersonInCharge: '15399665548',
- status: '1',
- manholeType: '1',
- manholeCover: '暂无',
- manholeShape: '圆形',
- constructionTime: '2025-09-15 20:57:42',
- longitude: '110.22252454',
- latitude: '27.1148554',
- manholeImage: 'manholeimg.png',
- QRCode: '/QRCode.jpg',
- }, {
- id: '11',
- name: '井盖十一',
- type: '通信井盖',
- electricity: '80',
- facilityCode: '5001110103009062',
- region: '东三路米香街道',
- regionGrade: '暂无',
- locationDescription: '东三路A地铁口向西方向300米',
- competentDepartment: '东三路社区服务中心',
- ownershipUnit: 'A市住房和城乡建设委员会',
- maintenanceUnit: 'A市住房和城乡建设委员会',
- nameOfPersonInCharge: '张三',
- PhoneOfPersonInCharge: '15399665548',
- status: '1',
- manholeType: '1',
- manholeCover: '暂无',
- manholeShape: '圆形',
- constructionTime: '2025-09-15 20:57:42',
- longitude: '110.22252454',
- latitude: '27.1148554',
- manholeImage: 'manholeimg.png',
- QRCode: '/QRCode.jpg',
- }, {
- id: '12',
- name: '井盖十二',
- type: '通信井盖',
- electricity: '80',
- facilityCode: '5001110103009062',
- region: '东三路米香街道',
- regionGrade: '暂无',
- locationDescription: '东三路A地铁口向西方向300米',
- competentDepartment: '东三路社区服务中心',
- ownershipUnit: 'A市住房和城乡建设委员会',
- maintenanceUnit: 'A市住房和城乡建设委员会',
- nameOfPersonInCharge: '张三',
- PhoneOfPersonInCharge: '15399665548',
- status: '1',
- manholeType: '1',
- manholeCover: '暂无',
- manholeShape: '圆形',
- constructionTime: '2025-09-15 20:57:42',
- longitude: '110.22252454',
- latitude: '27.1148554',
- manholeImage: 'manholeimg.png',
- QRCode: '/QRCode.jpg',
- }],
- }
- // 使用 useMemo 动态计算筛选数据,依赖 typeFilter 和 EquipmentListData.data
- const filteredData = useMemo(() => {
- return typeFilter === 'all'
- ? EquipmentListData.data
- : EquipmentListData.data.filter(item => item.type === typeFilter);
- }, [typeFilter, EquipmentListData.data]); // 当筛选条件或原始数据变化时重新计算
- const popUpdata = {
- columns: [
- {
- title: () => (
- <div style={{
- textAlign: 'center',
- // color: 'white',
- // padding: '8px' // 保持内边距一致
- }}>
- 设备ID
- </div>
- ),
- dataIndex: "codeID",
- width: 150,
- ellipsis: true,
- render: (text, record) => ( // 添加record参数获取行数据
- <div
- style={{
- // backgroundColor: '#e8e8e8',
- textAlign: 'center',
- cursor: 'pointer', // 显示手型光标
- color: 'white', // 单元格字体颜色
- fontWeight: 'bold'
- // transition: 'background-color 0.2s' // 过渡效果
- }}
- >
- {text}
- </div>
- ),
- },
- {
- title: () => (
- <div style={{
- textAlign: 'center',
- // color: 'white',
- // padding: '8px' // 保持内边距一致
- }}>
- 检测时间
- </div>
- ),
- dataIndex: "date",
- ellipsis: true,
- render: (text, record) => ( // 添加record参数获取行数据
- <div
- style={{
- // backgroundColor: '#e8e8e8',
- textAlign: 'center',
- cursor: 'pointer', // 显示手型光标
- color: 'white', // 单元格字体颜色
- fontWeight: 'bold'
- // transition: 'background-color 0.2s' // 过渡效果
- }}
- >
- {text}
- </div>
- ),
- },
- {
- title: () => (
- <div style={{
- textAlign: 'center',
- // color: 'white',
- // padding: '8px' // 保持内边距一致
- }}>
- 温度(℃)
- </div>
- ),
- dataIndex: "temperature",
- ellipsis: true,
- render: (text, record) => ( // 添加record参数获取行数据
- <div
- style={{
- // backgroundColor: '#e8e8e8',
- textAlign: 'center',
- cursor: 'pointer', // 显示手型光标
- color: 'white', // 单元格字体颜色
- fontWeight: 'bold'
- // transition: 'background-color 0.2s' // 过渡效果
- }}
- >
- {text}
- </div>
- ),
- },
- {
- title: () => (
- <div style={{
- textAlign: 'center',
- // color: 'white',
- // padding: '8px' // 保持内边距一致
- }}>
- 角度(°)
- </div>
- ),
- dataIndex: "angle",
- ellipsis: true,
- render: (text, record) => ( // 添加record参数获取行数据
- <div
- style={{
- // backgroundColor: '#e8e8e8',
- textAlign: 'center',
- cursor: 'pointer', // 显示手型光标
- color: 'white', // 单元格字体颜色
- fontWeight: 'bold'
- // transition: 'background-color 0.2s' // 过渡效果
- }}
- >
- {text}
- </div>
- ),
- }, {
- title: () => (
- <div style={{
- textAlign: 'center',
- // color: 'white',
- // padding: '8px' // 保持内边距一致
- }}>
- 电压(V)
- </div>
- ),
- dataIndex: "voltage",
- ellipsis: true,
- render: (text, record) => ( // 添加record参数获取行数据
- <div
- style={{
- // backgroundColor: '#e8e8e8',
- textAlign: 'center',
- cursor: 'pointer', // 显示手型光标
- color: 'white', // 单元格字体颜色
- fontWeight: 'bold'
- // transition: 'background-color 0.2s' // 过渡效果
- }}
- >
- {text}
- </div>
- ),
- }
- ],
- data: [{
- id: '1', // 添加唯一 id 作为 rowKey
- date: '2016-05-02',
- codeID: '5001110103009062',
- temperature: '29',
- angle: '4',
- voltage: '3.6'
- }, {
- id: '1', // 添加唯一 id 作为 rowKey
- date: '2016-05-02',
- codeID: '5001110103009062',
- temperature: '29',
- angle: '4',
- voltage: '3.6'
- }, {
- id: '1', // 添加唯一 id 作为 rowKey
- date: '2016-05-02',
- codeID: '5001110103009062',
- temperature: '29',
- angle: '4',
- voltage: '3.6'
- }, {
- id: '1', // 添加唯一 id 作为 rowKey
- date: '2016-05-02',
- codeID: '5001110103009062',
- temperature: '29',
- angle: '4',
- voltage: '3.6'
- }, {
- id: '1', // 添加唯一 id 作为 rowKey
- date: '2016-05-02',
- codeID: '5001110103009062',
- temperature: '29',
- angle: '4',
- voltage: '3.6'
- }, {
- id: '1', // 添加唯一 id 作为 rowKey
- date: '2016-05-02',
- codeID: '5001110103009062',
- temperature: '29',
- angle: '4',
- voltage: '3.6'
- }, {
- id: '1', // 添加唯一 id 作为 rowKey
- date: '2016-05-02',
- codeID: '5001110103009062',
- temperature: '29',
- angle: '4',
- voltage: '3.6'
- }, {
- id: '1', // 添加唯一 id 作为 rowKey
- date: '2016-05-02',
- codeID: '5001110103009062',
- temperature: '29',
- angle: '4',
- voltage: '3.6'
- }, {
- id: '1', // 添加唯一 id 作为 rowKey
- date: '2016-05-02',
- codeID: '5001110103009062',
- temperature: '29',
- angle: '4',
- voltage: '3.6'
- }, {
- id: '1', // 添加唯一 id 作为 rowKey
- date: '2016-05-02',
- codeID: '5001110103009062',
- temperature: '29',
- angle: '4',
- voltage: '3.6'
- }, {
- id: '1', // 添加唯一 id 作为 rowKey
- date: '2016-05-02',
- codeID: '5001110103009062',
- temperature: '29',
- angle: '4',
- voltage: '3.6'
- }, {
- id: '1', // 添加唯一 id 作为 rowKey
- date: '2016-05-02',
- codeID: '5001110103009062',
- temperature: '29',
- angle: '4',
- voltage: '3.6'
- }, {
- id: '1', // 添加唯一 id 作为 rowKey
- date: '2016-05-02',
- codeID: '5001110103009062',
- temperature: '29',
- angle: '4',
- voltage: '3.6'
- }, {
- id: '1', // 添加唯一 id 作为 rowKey
- date: '2016-05-02',
- codeID: '5001110103009062',
- temperature: '29',
- angle: '4',
- voltage: '3.6'
- },]
- }
- return (
- <ConfigProvider
- theme={{
- components: {
- Table: {
- headerBorderRadius: 0,
- },
- },
- }}
- >
- <div style={{height: props.height}}>
- <Table
- className="custom-table"
- style={{
- width: '100%',
- height: '100%',
- // 可选:设置表格背景透明,避免覆盖容器背景
- backgroundColor: 'transparent'
- }}
- rowClassName={(record, index) => {
- // return 'bg-[#3a3899]';
- }}
- columns={EquipmentListData.columns}
- dataSource={filteredData}
- pagination={false}
- rowKey="id"
- size="small"
- scroll={{x: 200, y: 420}}
- />
- {/* GIS设备详情弹窗 */}
- <Modal
- title="GIS设备详情"
- open={GISdeviceModalVisible}
- onCancel={() => setGISDeviceModalVisible(false)}
- // footer={null}
- width={1200}
- className="custom-modal"
- style={{
- textAlign: 'center'
- }}
- >
- {GISselectedDevice && (
- <div className="space-y-4" style={{
- display: 'flex',
- justifyContent: 'space-between'
- }}>
- <div style={{
- width: '50%',
- }}>
- <div className="space-y-4" style={{textAlign: 'left'}}>
- <Row gutter={16}>
- <Col span={12}>
- <div>
- <strong style={{
- color: '#B0E0E6'
- }}>设备名称:</strong> {GISselectedDevice.name}
- </div>
- </Col>
- <Col span={12}>
- <div>
- <strong style={{
- color: '#B0E0E6'
- }}>设备类型:</strong> {GISselectedDevice.type}
- </div>
- </Col>
- </Row>
- <Row gutter={16}>
- <Col span={12}>
- <div>
- <strong style={{
- color: '#B0E0E6'
- }}>设备电量:</strong> {GISselectedDevice.electricity}%
- </div>
- </Col>
- <Col span={12}>
- <div>
- <strong style={{
- color: '#B0E0E6'
- }}>设备编号:</strong>{GISselectedDevice.facilityCode}
- </div>
- </Col>
- </Row>
- <Row gutter={16}>
- <Col span={12}>
- <div>
- <strong style={{
- color: '#B0E0E6'
- }}>所属区域:</strong> {GISselectedDevice.region}
- </div>
- </Col>
- <Col span={12}>
- <div>
- <strong style={{
- color: '#B0E0E6'
- }}>道路等级:</strong> {GISselectedDevice.regionGrade}
- </div>
- </Col>
- </Row>
- <Row gutter={16}>
- <Col span={12}>
- <div>
- <strong style={{
- color: '#B0E0E6'
- }}>位置描述:</strong> {GISselectedDevice.locationDescription}
- </div>
- </Col>
- <Col span={12}>
- <div>
- <strong style={{
- color: '#B0E0E6'
- }}>主管部门:</strong> {GISselectedDevice.competentDepartment}
- </div>
- </Col>
- </Row>
- <Row gutter={16}>
- <Col span={12}>
- <div>
- <strong style={{
- color: '#B0E0E6'
- }}>权属单位:</strong> {GISselectedDevice.ownershipUnit}
- </div>
- </Col>
- <Col span={12}>
- <div>
- <strong style={{
- color: '#B0E0E6'
- }}>养护单位:</strong> {GISselectedDevice.maintenanceUnit}
- </div>
- </Col>
- </Row>
- <Row gutter={16}>
- <Col span={12}>
- <div>
- <strong style={{
- color: '#B0E0E6'
- }}>负责人姓名:</strong> {GISselectedDevice.nameOfPersonInCharge}
- </div>
- </Col>
- <Col span={12}>
- <div>
- <strong style={{
- color: '#B0E0E6'
- }}>负责人电话:</strong> {GISselectedDevice.PhoneOfPersonInCharge}
- </div>
- </Col>
- </Row>
- <Row gutter={16}>
- <Col span={12}>
- <div>
- <strong style={{
- color: '#B0E0E6'
- }}>设施状态:</strong>
- <Badge
- style={{
- marginLeft: '10px'
- }}
- status={GISselectedDevice.status === "1" ? "success" : "error"}
- text={
- <span style={{
- color: GISselectedDevice.status === "1" ? "#52c41a" : "#f5222d"
- }}>
- {GISselectedDevice.status === "1" ? "正常" : "异常"}
- </span>
- }
- />
- </div>
- </Col>
- <Col span={12}>
- <div>
- <strong style={{
- color: '#B0E0E6'
- }}>是否智能井盖:</strong>
- <Badge
- style={{
- color: 'white'
- }}
- status={GISselectedDevice.manholeType === "0" ? "1" : "2"}
- text={GISselectedDevice.manholeType === "1" ? "是" : "否"}
- />
- </div>
- </Col>
- </Row>
- <Row gutter={16}>
- <Col span={12}>
- <div>
- <strong style={{
- color: '#B0E0E6'
- }}>井盖材质:</strong> {GISselectedDevice.manholeCover}
- </div>
- </Col>
- <Col span={12}>
- <div>
- <strong style={{
- color: '#B0E0E6'
- }}>井身形状:</strong> {GISselectedDevice.manholeShape}
- </div>
- </Col>
- </Row>
- <Row gutter={16}>
- <Col span={12}>
- <div>
- <strong style={{
- color: '#B0E0E6'
- }}>建设时问:</strong> {GISselectedDevice.constructionTime}
- </div>
- </Col>
- <Col span={12}>
- <div>
- <strong style={{
- color: '#B0E0E6'
- }}>经纬度:</strong> {GISselectedDevice.longitude}°N, {GISselectedDevice.latitude}°E
- </div>
- </Col>
- </Row>
- <Row gutter={16}>
- <Col span={12}>
- <div>
- <strong style={{
- color: '#B0E0E6'
- }}>井盖图片:</strong>
- <img
- src={GISselectedDevice.manholeImage}
- alt="井盖图片"
- style={{width: '60%', marginTop: '10px', cursor: 'pointer'}}
- onClick={() => {
- setPreviewImage(GISselectedDevice.manholeImage);
- setPreviewVisible(true);
- }}
- />
- </div>
- </Col>
- <Col span={12}>
- <div>
- <strong style={{
- color: '#B0E0E6'
- }}>二维码:</strong>
- {/* 二维码图片也添加点击放大功能 */}
- <img
- src={GISselectedDevice.QRCode}
- alt="二维码"
- style={{width: '60%', marginTop: '10px', cursor: 'pointer'}}
- onClick={() => {
- setPreviewImage(GISselectedDevice.QRCode);
- setPreviewVisible(true);
- }}
- />
- </div>
- </Col>
- </Row>
- </div>
- </div>
- {/*GIS井盖详情第二模块*/}
- {/*GIS井盖详情第二模块 - 修改为按钮式导航*/}
- <div style={{width: '50%'}}>
- {/* 按钮式导航 */}
- <div style={{marginBottom: '16px', textAlign: 'left'}}>
- <Button.Group>
- <Button
- type={activeNavButton === "realtime" ? "primary" : "default"}
- onClick={() => setActiveNavButton("realtime")}
- style={{minWidth: '120px'}}
- >
- 实时监测
- </Button>
- <Button
- type={activeNavButton === "history" ? "primary" : "default"}
- onClick={() => setActiveNavButton("history")}
- style={{minWidth: '120px'}}
- >
- 历史事件
- </Button>
- <Button
- type={activeNavButton === "inspection" ? "primary" : "default"}
- onClick={() => setActiveNavButton("inspection")}
- style={{minWidth: '120px'}}
- >
- 日常巡查
- </Button>
- </Button.Group>
- <div style={{
- marginTop: '10px',
- color: '#EEE',
- fontSize: '14px'
- }}>近15日数据
- </div>
- </div>
- {/* 内容区域 */}
- <div style={{
- padding: '20px',
- border: '1px solid #e8e8e8',
- borderRadius: '4px',
- height: '500px'
- }}>
- {activeNavButton === "realtime" && (
- <div>
- <Table
- className="RTM-Gis-table"
- style={{
- width: '100%',
- height: '100%',
- // 可选:设置表格背景透明,避免覆盖容器背景
- backgroundColor: 'transparent'
- }}
- columns={popUpdata.columns}
- dataSource={popUpdata.data}
- // pagination={false}
- rowKey="id"
- size="small"
- />
- </div>
- )}
- {activeNavButton === "history" && (
- <div>历史事件记录展示区域</div>
- )}
- {activeNavButton === "inspection" && (
- <div>日常巡查信息展示区域</div>
- )}
- </div>
- </div>
- </div>
- )}
- </Modal>
- {/* 添加图片预览弹窗 */}
- <Modal
- visible={previewVisible}
- footer={null}
- onCancel={() => setPreviewVisible(false)}
- maskClosable={true}
- width="800px"
- height="500px"
- bodyStyle={{padding: 0}}
- closable={true}
- zIndex={10000}
- >
- {previewImage && (
- <img
- src={previewImage}
- alt="预览图片"
- style={{
- width: '700px',
- // maxWidth: '90vw',
- // maxHeight: '90vh',
- display: 'block',
- margin: '0 auto'
- }}
- />
- )}
- </Modal>
- {/* 添加全局样式覆盖表头背景色 */}
- <style jsx global>{`
- .custom-table .ant-table-thead > tr > th,
- .custom-table .ant-table-thead > tr > td {
- background-color: rgba(58, 56, 153, 1) !important; /* 目标背景色 */
- color: white !important; /* 表头文字颜色 */
- border: none !important; /* 移除边框 */
- }
- .ant-table-wrapper .ant-table-tbody >tr >th, .ant-table-wrapper .ant-table-tbody >tr >td {
- background-color: rgba(58, 56, 153, 1) !important; /* 目标背景色 */
- color: white !important; /* 表头文字颜色 */
- border: none !important; /* 移除边框 */
- }
- /* 修改Modal背景色和添加渐变边框 */
- .custom-modal .ant-modal-content {
- background-color: rgba(58, 56, 153, 1) !important; /* 主背景色 */
- color: white; /* 文字颜色 */
- /* 添加由外向内的径向渐变边框 */
- border: 2px solid transparent;
- border-radius: 8px;
- background-clip: padding-box, border-box;
- background-origin: padding-box, border-box;
- background-image:
- linear-gradient( rgba(58, 56, 153, 1), rgba(58, 56, 153, 1)), /* 背景色 */
- radial-gradient(circle at center, #ff6b6b, #4ecdc4); /* 由外向内的径向渐变边框 */
- }
- /* 可选:修改Modal标题栏样式 */
- .custom-modal .ant-modal-header {
- background-color: rgba(58, 56, 153, 1) !important;
- border-bottom: none; /* 移除底部边框 */
- }
-
- .custom-modal .ant-modal-title{
- color:white !important;
- border-bottom:1px solid white;
- }
- `}</style>
- </div>
- </ConfigProvider>
- )
- }
|