From 738fe32ee452c397b6cbfac2e62ac389533133e2 Mon Sep 17 00:00:00 2001 From: qzc Date: Fri, 13 Mar 2026 14:45:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/data/json/sdz.json | 210 ++++++++++++ src/components/Form/FileUpload/fileView.js | 105 ++++++ src/components/Form/FileUpload/index.js | 90 +++++ src/components/Form/FileUpload/pdfView.js | 45 +++ src/components/ant_override.less | 8 + src/service/apiurl.js | 38 ++- src/service/station.js | 106 ++---- src/views/Home/MapCtrl/Markers/SLLayer.js | 2 - src/views/Home/MapCtrl/Markers/SYLayer.js | 2 - src/views/Home/MapCtrl/Markers/WYLayer.js | 2 - src/views/Home/MapCtrl/Pops/AnZhiDian.js | 7 +- src/views/Home/MapCtrl/Pops/QSYDW.js | 7 +- .../Home/MapCtrl/Pops/ShenLiu/drpOption.js | 9 +- .../Home/MapCtrl/Pops/WeiYi/drpOption.js | 1 + src/views/Home/MapCtrl/Pops/Wxq.js | 21 +- src/views/Home/MapCtrl/Pops/YHJMH.js | 7 +- src/views/Home/MapCtrl/Pops/index.less | 21 +- .../components/AllWeatherControl/index.js | 18 +- .../components/MonitoringElements/index.js | 15 +- src/views/Home/mapToolBox/globalSearch.js | 99 +++--- src/views/Home/mapToolBox/index.less | 6 +- src/views/sz/ddfa/form.js | 149 ++++++++ src/views/sz/ddfa/index.js | 93 +++++ src/views/sz/ddfa/index.less | 8 + src/views/sz/ddfa/toolbar.js | 67 ++++ .../sz/khzbgl/AdcdTreeSelector/index.less | 47 +++ .../sz/khzbgl/AdcdTreeSelector/index.tsx | 318 ++++++++++++++++++ src/views/sz/khzbgl/form.js | 136 ++++++++ src/views/sz/khzbgl/index.js | 112 ++++++ src/views/sz/khzbgl/index.less | 8 + src/views/sz/khzbgl/toolbar.js | 54 +++ src/views/sz/ywgz/form.js | 147 ++++++++ src/views/sz/ywgz/index.js | 93 +++++ src/views/sz/ywgz/index.less | 8 + src/views/sz/ywgz/toolbar.js | 67 ++++ 35 files changed, 1970 insertions(+), 156 deletions(-) create mode 100644 public/data/json/sdz.json create mode 100644 src/components/Form/FileUpload/fileView.js create mode 100644 src/components/Form/FileUpload/index.js create mode 100644 src/components/Form/FileUpload/pdfView.js create mode 100644 src/views/sz/ddfa/form.js create mode 100644 src/views/sz/ddfa/index.js create mode 100644 src/views/sz/ddfa/index.less create mode 100644 src/views/sz/ddfa/toolbar.js create mode 100644 src/views/sz/khzbgl/AdcdTreeSelector/index.less create mode 100644 src/views/sz/khzbgl/AdcdTreeSelector/index.tsx create mode 100644 src/views/sz/khzbgl/form.js create mode 100644 src/views/sz/khzbgl/index.js create mode 100644 src/views/sz/khzbgl/index.less create mode 100644 src/views/sz/khzbgl/toolbar.js create mode 100644 src/views/sz/ywgz/form.js create mode 100644 src/views/sz/ywgz/index.js create mode 100644 src/views/sz/ywgz/index.less create mode 100644 src/views/sz/ywgz/toolbar.js diff --git a/public/data/json/sdz.json b/public/data/json/sdz.json new file mode 100644 index 0000000..d307a88 --- /dev/null +++ b/public/data/json/sdz.json @@ -0,0 +1,210 @@ +[ + { + "stnm": "易家井电站", + "stcd": "sdz1", + "lgtd": null, + "lttd": null, + "行政主管单位": "赤壁市水利局", + "工程类别": "小(2)型", + "运营单位": null, + "行政区划": "湖北省赤壁市官塘驿镇", + "总装机容量": 0.02, + "建成年份": 1979, + "工程概况": "引水式发电,装机1台", + "开发方式": "引水", + "多年平均发电量": 0.497, + "工程状态": "已建", + "开工时间": null, + "正常蓄水位库容": null, + "生态流量": null, + "所在水系": null, + "所在干流": null, + "所在支流": null, + "所有制情况": null, + "厂房地点": null, + "坝址": null, + "工程图片": null + }, + { + "stnm": "海源电站", + "stcd": "sdz2", + "lgtd": null, + "lttd": null, + "行政主管单位": "赤壁市水利局", + "工程类别": "小(2)型", + "运营单位": null, + "行政区划": null, + "总装机容量": 0.158, + "建成年份": 1979, + "工程概况": "引水式发电,装机4台", + "开发方式": "引水", + "多年平均发电量": 3.4, + "工程状态": "已建", + "开工时间": null, + "正常蓄水位库容": null, + "生态流量": null, + "所在水系": null, + "所在干流": null, + "所在支流": null, + "所有制情况": null, + "厂房地点": null, + "坝址": null, + "工程图片": null + }, + { + "stnm": "大泉洞电站", + "stcd": "sdz3", + "lgtd": 114.162123, + "lttd": 29.678901, + "行政主管单位": "赤壁市水利局", + "工程类别": "小(2)型", + "运营单位": "赤壁水建山水资源有限公司", + "行政区划": "湖北省赤壁市官塘驿镇", + "总装机容量": 0.04, + "建成年份": 1981, + "工程概况": "引水式发电,装机2台", + "开发方式": "引水", + "多年平均发电量": 1.35, + "工程状态": "已建", + "开工时间": null, + "正常蓄水位库容": null, + "生态流量": null, + "所在水系": null, + "所在干流": null, + "所在支流": null, + "所有制情况": null, + "厂房地点": null, + "坝址": null, + "工程图片": null + }, + { + "stnm": "双石电站", + "stcd": "sdz4", + "lgtd": null, + "lttd": null, + "行政主管单位": "赤壁市水利局", + "工程类别": "小(2)型", + "运营单位": null, + "行政区划": "湖北省赤壁市官塘驿镇", + "总装机容量": 0.1, + "建成年份": 1978, + "工程概况": "装机2台", + "开发方式": "坝后", + "多年平均发电量": 2.056, + "工程状态": "已建", + "开工时间": null, + "正常蓄水位库容": null, + "生态流量": null, + "所在水系": null, + "所在干流": null, + "所在支流": null, + "所有制情况": null, + "厂房地点": null, + "坝址": null, + "工程图片": null + }, + { + "stnm": "宝剑电站", + "stcd": "sdz5", + "lgtd": null, + "lttd": null, + "行政主管单位": "赤壁市水利局", + "工程类别": "小(2)型", + "运营单位": null, + "行政区划": "湖北省赤壁市官塘驿镇", + "总装机容量": 0.02, + "建成年份": 1975, + "工程概况": "引水式发电,装机2台", + "开发方式": "引水", + "多年平均发电量": 0.444, + "工程状态": "已建", + "开工时间": null, + "正常蓄水位库容": null, + "生态流量": null, + "所在水系": null, + "所在干流": null, + "所在支流": null, + "所有制情况": null, + "厂房地点": null, + "坝址": null, + "工程图片": null + }, + { + "stnm": "黄沙电站", + "stcd": "sdz6", + "lgtd": null, + "lttd": null, + "行政主管单位": "赤壁市水利局", + "工程类别": "小(2)型", + "运营单位": null, + "行政区划": "湖北省赤壁市官塘驿镇", + "总装机容量": 0.052, + "建成年份": 1978, + "工程概况": "装机2台", + "开发方式": "坝后", + "多年平均发电量": 1.134, + "工程状态": "已建", + "开工时间": null, + "正常蓄水位库容": null, + "生态流量": null, + "所在水系": null, + "所在干流": null, + "所在支流": null, + "所有制情况": null, + "厂房地点": null, + "坝址": null, + "工程图片": null + }, + { + "stnm": "峰口电站", + "stcd": "sdz7", + "lgtd": null, + "lttd": null, + "行政主管单位": "赤壁市水利局", + "工程类别": "小(2)型", + "运营单位": null, + "行政区划": "湖北省赤壁市官塘驿镇", + "总装机容量": 0.01, + "建成年份": 1975, + "工程概况": "引水式发电,装机2台", + "开发方式": "引水", + "多年平均发电量": 0.318, + "工程状态": "已建", + "开工时间": null, + "正常蓄水位库容": null, + "生态流量": null, + "所在水系": null, + "所在干流": null, + "所在支流": null, + "所有制情况": null, + "厂房地点": null, + "坝址": null, + "工程图片": null + }, + { + "stnm": "矮岭电站", + "stcd": "sdz8", + "lgtd": null, + "lttd": null, + "行政主管单位": "赤壁市水利局", + "工程类别": "小(2)型", + "运营单位": null, + "行政区划": "湖北省赤壁市官塘驿镇", + "总装机容量": 0.01, + "建成年份": 1978, + "工程概况": "引水式发电,装机1台", + "开发方式": "引水", + "多年平均发电量": 0.178, + "工程状态": "已建", + "开工时间": null, + "正常蓄水位库容": null, + "生态流量": null, + "所在水系": null, + "所在干流": null, + "所在支流": null, + "所有制情况": null, + "厂房地点": null, + "坝址": null, + "工程图片": null + } + ] \ No newline at end of file diff --git a/src/components/Form/FileUpload/fileView.js b/src/components/Form/FileUpload/fileView.js new file mode 100644 index 0000000..660f709 --- /dev/null +++ b/src/components/Form/FileUpload/fileView.js @@ -0,0 +1,105 @@ +import React, { useState, useEffect, useRef } from 'react' +import { Form, Button, Input, Row, Upload, Col, Table, DatePicker, InputNumber, message, Image, Modal, Typography, Select } from 'antd'; +import { DeleteOutlined, FileWordOutlined, FilePdfOutlined, FileZipOutlined, FileExcelOutlined } from '@ant-design/icons'; +import moment from 'moment' +import apiurl from '../../../service/apiurl'; +import PdfView from './pdfView'; +// import './index.less' +const baseFileView = "http://223.75.53.141:9100/gs-ss" +const FileView = ({mode, fileList, setFileList,downloadUrl}) => { + const childRef = useRef(null); + + + const download = (params) => { + let downloadLink = document.createElement("a"); + downloadLink.href = process.env.REACT_APP_API_URL+downloadUrl+params + downloadLink.download = `${params.fileName}`; + downloadLink.style.display = "none"; + // 将链接添加到页面中 + document.body.appendChild(downloadLink); + // 模拟点击事件,开始下载 + downloadLink.click(); + } + + const deleteFile = (fileId) => { + let filterFile = fileList.filter(item => item.response?.data?.fileId !== fileId); + setFileList(filterFile) + } + + const viewPdf = (params) => { + if (childRef.current) { + childRef.current.callChildMethod(params); + } + } + + return ( + <> + + { + fileList.map(file=>( + +
+
+ { + (()=>{ + if(file.name.indexOf('.doc') > -1){ + return ( +
{ download(file.response?.data?.fileId) }} + style={{ cursor: 'pointer' }} + > + +
+ ) + }else if(file.name.indexOf('.pdf') > -1){ + return ( +
{ viewPdf(file.response?.data?.fileId) }} + style={{ cursor: 'pointer' }} + > + +
+ ) + }else if(file.name.indexOf('.zip') > -1){ + return ( +
{ download(file.response?.data?.fileId) }} + style={{ cursor: 'pointer' }} + > + +
+ ) + }else if(file.name.indexOf('.xls') > -1){ + return ( +
{ download(file.response?.data?.fileId) }} + style={{ cursor: 'pointer' }} + > + +
+ ) + }else{ + return ( + + ) + } + })() + } + {file.name} +
+
{ + deleteFile(file.response?.data?.fileId) + }}> + +
+
+ + )) + } +
+ + + ) +} + +export default FileView diff --git a/src/components/Form/FileUpload/index.js b/src/components/Form/FileUpload/index.js new file mode 100644 index 0000000..70ddfd2 --- /dev/null +++ b/src/components/Form/FileUpload/index.js @@ -0,0 +1,90 @@ +import React, { useState, useEffect } from 'react' +import { Form, Button, Input, Row, Upload, Col, Table, DatePicker, InputNumber, message, Image, Modal, Typography, Select } from 'antd'; +import { DeleteOutlined, FileWordOutlined, FilePdfOutlined, FileZipOutlined, FileExcelOutlined } from '@ant-design/icons'; +import moment from 'moment' +import FileView from './fileView'; +// import './index.less' + +const { RangePicker } = DatePicker +const { Dragger } = Upload; + +const FileUpload = ({mode, fileNum=1, value=[], onChange,uploadUrl,onLoadingChange,downloadUrl}) => { + const [fileList, setFileList] = useState([]) //上传文件列表 + const [loading, setLoading] = useState(false) + console.log(1111111,fileList); + + + const fileChange = (info) => { + if (info.file.status === "done") { + setLoading(false); + if(onLoadingChange) onLoadingChange(false); + } + + if (info.file.status === "uploading") { + setLoading(true); + if(onLoadingChange) onLoadingChange(true); + } + if (info.file.status === "error") { + message.error("文件上传失败") + setLoading(false); + if(onLoadingChange) onLoadingChange(false); + } + setFileList(info.fileList) + } + + useEffect(() => { + if (mode != 'save' ) { + const imgFile = value?.map(o => ({ + name: o.fileName, + response: { + data: { + filePath: o.filePath, + fileId: o.fileId + } + }, + })) + setFileList(imgFile) + } + }, []) + + useEffect(()=>{ + if(onChange && fileList){ + // let oldFiles = fileList.map(item => (item.response?.data.fileId)) + // onChange(oldFiles.join(',')) + let oldFiles = fileList.map(item => ({ + fileId: item.response?.data?.fileId, + filePath: item.response?.data?.filePath, + fileName:item.response?.data?.fileName + })) + onChange(oldFiles) + + } + },[fileList]) + + + return ( + <> + { + mode!=='view' && + { console.log(info.dataTransfer.files); }} + fileList={fileList} + disabled={loading} + maxCount={fileNum} + // onSuccess={handleSuccess} + > +

点击或拖拽文件到此区域上传

+

+ 支持扩展名:.doc .docx .xls .pdf .jpg .png .ppt +

+
+ } + + + ) +} + +export default FileUpload diff --git a/src/components/Form/FileUpload/pdfView.js b/src/components/Form/FileUpload/pdfView.js new file mode 100644 index 0000000..641d4b7 --- /dev/null +++ b/src/components/Form/FileUpload/pdfView.js @@ -0,0 +1,45 @@ +import React, { useState, useEffect, forwardRef, useImperativeHandle } from 'react' +import { Modal } from 'antd'; +const PdfView = forwardRef((props,ref) => { + const [pdfViewOPen, setPdfViewOPen] = useState(false) + const [iframeSrc, setIframeSrc] = useState('') + + useImperativeHandle(ref, () => ({ + callChildMethod: showPdf + })); + + const showPdf = (url) => { + setIframeSrc(url) + setPdfViewOPen(true) + }; + + + + return ( + <> + { + setPdfViewOPen(false) + setIframeSrc('') + }} + > +