diff --git a/src/models/auth/_.ts b/src/models/auth/_.ts index f5ca0bbfb..b955863d4 100644 --- a/src/models/auth/_.ts +++ b/src/models/auth/_.ts @@ -348,7 +348,7 @@ export async function loadMenu(): Promise { { id: id(), title: '白蚁防治', redirect: '/mgr/sg/byfz/bypc', children: [ - { id: id(), title: '白蚁普查', path: '/mgr/sg/byfz/bypc' }, + { id: id(), title: '白蚁监测', path: '/mgr/sg/byfz/bypc' }, { id: id(), title: '防治宣传', path: '/mgr/sg/byfz/byxc' }, ] }, diff --git a/src/views/rcgl/byfz/bypc/index.js b/src/views/rcgl/byfz/bypc/index.js index 41e0d6977..f8893b4c2 100644 --- a/src/views/rcgl/byfz/bypc/index.js +++ b/src/views/rcgl/byfz/bypc/index.js @@ -1,6 +1,6 @@ import React, { Fragment, useRef, useMemo,useEffect,useState } from 'react'; import BasicCrudModal from '../../../../components/crud/BasicCrudModal'; -import { Table, Card, Modal, Form, Input, Button, Row,Col, Timeline, message, Tabs,Image } from 'antd'; +import { Table, Card, Modal, Form, Input, Button, Row,Col, Timeline, message, Tabs,Image,Tag } from 'antd'; import {FileWordOutlined,FilePdfOutlined,FileZipOutlined,FileExcelOutlined } from '@ant-design/icons'; import { useSelector } from 'react-redux'; import ToolBar from './toolbar'; @@ -9,13 +9,20 @@ import apiurl from '../../../../service/apiurl'; import usePageTable from '../../../../components/crud/usePageTable2'; import { createCrudService } from '../../../../components/crud/_'; import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender'; - +import './index.less'; const url = "http://223.75.53.141:9102/test.by-lyf.tmp" const Page = () => { const role = useSelector(state => state.auth.role); const editBtn = role?.rule?.find(item => item.menuName == "编辑") || true; const viewBtn = role?.rule?.find(item => item.menuName == "查看")|| true; - const delBtn = role?.rule?.find(item => item.menuName == "删除")|| true; + const delBtn = role?.rule?.find(item => item.menuName == "删除") || true; + + const [stats, setStats] = useState({ + total: 400, + withMosquito: 14, + withoutMosquito: 382, + noData: 4 + }); const surveyType = { 1: "日常检查排查", 2: "定期普查", @@ -33,38 +40,62 @@ const Page = () => { } const refModal = useRef(); const [searchVal, setSearchVal] = useState({}) - const columns = [ - { title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" }, - {title: '填报日期', key: 'reportDate', dataIndex: 'reportDate', width: 140,}, - { - title: '普查类型', key: 'surveyType', dataIndex: 'surveyType', width: 200, - render: (value) => {value ? surveyType[value] : ''} - }, - { - title: '普查方式', key: 'surveyWay', dataIndex: 'surveyWay', width: 200, - render: (value) => {value ? surveyWay[value] : ''} + // const columns = [ + // { title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" }, + // {title: '填报日期', key: 'reportDate', dataIndex: 'reportDate', width: 140,}, + // { + // title: '普查类型', key: 'surveyType', dataIndex: 'surveyType', width: 200, + // render: (value) => {value ? surveyType[value] : ''} + // }, + // { + // title: '普查方式', key: 'surveyWay', dataIndex: 'surveyWay', width: 200, + // render: (value) => {value ? surveyWay[value] : ''} - }, - { - title: '危害情况', key: 'isHarm', dataIndex: 'isHarm', width: 200, - render: (value, row) =>( - 0 ? { color: "red" } : {}}>{isHarm[row.harmNum > 0 ? 1 : 0]}) - }, - {title: '白蚁危害处数', key: 'harmNum', dataIndex: 'harmNum', width: 100}, - {title: '已处置处数', key: 'handleNum', dataIndex: 'handleNum', width: 100}, - {title: '上报人', key: 'reportUserName', dataIndex: 'reportUserName', width: 100}, - { - title: '操作', key: 'operation', width: 200, fixed: 'right',align: 'center', - render: (value, row, index) => ( - () => command(cmd)(row)} />) - }, - ]; + // }, + // { + // title: '危害情况', key: 'isHarm', dataIndex: 'isHarm', width: 200, + // render: (value, row) =>( + // 0 ? { color: "red" } : {}}>{isHarm[row.harmNum > 0 ? 1 : 0]}) + // }, + // {title: '白蚁危害处数', key: 'harmNum', dataIndex: 'harmNum', width: 100}, + // {title: '已处置处数', key: 'handleNum', dataIndex: 'handleNum', width: 100}, + // {title: '上报人', key: 'reportUserName', dataIndex: 'reportUserName', width: 100}, + // { + // title: '操作', key: 'operation', width: 200, fixed: 'right',align: 'center', + // render: (value, row, index) => ( + // () => command(cmd)(row)} />) + // }, + // ]; - + const columns = [ + { + title: '监测时间', + dataIndex: 'time', + key: 'time', + width: 180 + }, + { + title: '测点编号', + dataIndex: 'code', + key: 'code', + width: 120 + }, + { + title: '有无白蚁', + dataIndex: 'hasMosquito', + key: 'hasMosquito', + width: 100, + render: (text) => ( + + {text ? '有' : '无'} + + ) + } + ]; const width = useMemo(() => columns.reduce((total, cur) => total + (cur.width), 0), [columns]); const command = (type) => (params) => { @@ -104,12 +135,50 @@ const Page = () => { return ( <>
-
+
+ + +
+
+ {stats.total} + +
+ 总监测点数 +
+ + +
+
+ {stats.withMosquito} + +
+ 有白蚁 +
+ + +
+
+ {stats.withoutMosquito} + +
+ 无白蚁 +
+ + +
+
+ {stats.noData} + +
+ 无数据 +
+ +
diff --git a/src/views/rcgl/byfz/bypc/index.less b/src/views/rcgl/byfz/bypc/index.less index e0bd72879..1c3be22ef 100644 --- a/src/views/rcgl/byfz/bypc/index.less +++ b/src/views/rcgl/byfz/bypc/index.less @@ -1,30 +1,33 @@ -.basic-info{ - position: relative; - font-size: 16px; - margin-bottom: 20px; - padding:5px 25px; - border-bottom: 1px solid #eee; - &::before{ - position: absolute; - top:8px; - left:0; - content: ""; - display: block; - width: 5px; - height: 20px; - background-color: #0079fe; - } -} -.time-line{ - width: 50%; - margin-left: 6%; - margin-top: 1%; - .time-line-item{ +.statsRow { + display: flex; + justify-content: space-between; + margin-bottom: 24px; + padding: 16px; + + .statItem { display: flex; - // align-items: center; - column-gap: 20px; - .item-right{ - flex:1 - } - } + flex-direction: column; + text-align: center; + align-items: center; + .unit { + font-size: 14px; + margin-right: 8px; + color: rgba(0, 0, 0, 0.65); + } + .valueWrapper { + display: flex; + align-items: baseline; + } + .number { + display: block; + font-size: 32px; + font-weight: 600; + + } + + .label { + color: rgba(0, 0, 0, 0.65); + font-size: 16px; + } + } } \ No newline at end of file diff --git a/src/views/rcgl/byfz/bypc/toolbar.js b/src/views/rcgl/byfz/bypc/toolbar.js index 320c1e47f..94f298666 100644 --- a/src/views/rcgl/byfz/bypc/toolbar.js +++ b/src/views/rcgl/byfz/bypc/toolbar.js @@ -5,8 +5,8 @@ import moment from 'moment'; import NormalSelect from '../../../../components/Form/NormalSelect'; const { RangePicker } = DatePicker; const ToolBar = ({ setSearchVal, onSave, storeData, role }) => { - const addBtn = role?.rule?.find(item => item.menuName == "新增")|| true; - const searchBtn = role?.rule?.find(item => item.menuName == "查询")|| true; + // const addBtn = role?.rule?.find(item => item.menuName == "新增")|| true; + // const searchBtn = role?.rule?.find(item => item.menuName == "查询")|| true; const [form] = Form.useForm(); const onFinish = (values) => { @@ -31,29 +31,27 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => { <>
- + - + + + + {/* - - {searchBtn ? + */} + - : null } - { - (onSave && addBtn) ? - - - - :null - } +
diff --git a/src/views/rcgl/zmjk/ModalContent.js b/src/views/rcgl/zmjk/ModalContent.js new file mode 100644 index 000000000..b9ee4b935 --- /dev/null +++ b/src/views/rcgl/zmjk/ModalContent.js @@ -0,0 +1,65 @@ +import React,{useState,useEffect} from 'react' +import {Card,Table} from 'antd' +import ModalToolBar from './ModalToolBar'; +import { httppost5 } from '../../../utils/request'; +import { exportFile } from '../../../utils/tools'; +import apiurl from '../../../service/apiurl'; +export default function ModalContent() { + const columns = [ + { + title: '序号', + key: 'inx', + width: 80, + render: (r, i) => {i + 1} + }, + { + title: '闸门名称', + key: 'project', + width: 150, + }, + { + title: '操作内容', + key: 'project', + width: 150, + }, + { + title: '操作结果', + key: 'project', + width: 150, + } + , + { + title: '操作时间', + key: 'project', + width: 150, + } + ] + const [searchVal, setSearchVal] = useState(false) + + const exportExcel = () => { + let params = { + ...searchVal, + // pageSo: { + // pageNumber: tableProps.pagination.current, + // pageSize:tableProps.pagination.pageSize + // } + } + httppost5(apiurl.gcaqjc.sjtjcx.ndsytjb.export, params).then(res => { + exportFile(`闸门操作记录.xlsx`,res.data) + }) + } + return ( +
+ + + + +
+ + + + ) +} diff --git a/src/views/rcgl/zmjk/ModalToolBar.js b/src/views/rcgl/zmjk/ModalToolBar.js new file mode 100644 index 000000000..69d405e47 --- /dev/null +++ b/src/views/rcgl/zmjk/ModalToolBar.js @@ -0,0 +1,118 @@ +import React, { useEffect, useState } from 'react'; +import { Form, Input, Button, DatePicker } from 'antd'; + +import moment from 'moment'; +import NormalSelect from '../../../components/Form/NormalSelect'; +const { RangePicker } = DatePicker; +const ToolBar = ({ setSearchVal, exportFile }) => { + const optionsType = [ + { + label: "今日", + value: 1 + }, + { + label: "近一周", + value: 2 + }, + { + label: "近一月", + value: 3 + }, + { + label: "近三月", + value: 4 + }, + { + label: "近一年", + value: 5 + }, + ] + const types = [ + { label: "主坝", value: 1 }, + { label: "副坝", value: 2 }, + { label: "灌溉发电洞", value: 3 }, + + ] + const [form] = Form.useForm(); + + const onFinish = (values) => { + let dateTimeSo; + if (values.tm) { + dateTimeSo = { + start: moment(values.tm[0]).format('YYYY-MM-DD 00:00:00'), + end: moment(values.tm[1]).format('YYYY-MM-DD 00:00:00') + } + } + delete values.tm + setSearchVal({ ...values, dateTimeSo }); + } + + const onValuesChange = (e) => { + switch (e.ranger) { + case 1: + form.setFieldValue("tm",[moment().startOf("day"),moment()]) + break; + case 2: + form.setFieldValue("tm",[moment().subtract(7, 'days'),moment()]) + break; + case 3: + form.setFieldValue("tm",[moment().subtract(1, 'months'),moment()]) + break; + case 4: + form.setFieldValue("tm",[moment().subtract(3, 'months'),moment()]) + break; + case 5: + form.setFieldValue("tm",[moment().subtract(1, 'years'),moment()]) + break; + default: + break; + } + + } + useEffect(() => { + let dateTimeSo = { + start: moment().subtract(1, "years").format('YYYY-MM-DD 00:00:00'), + end: moment().format('YYYY-MM-DD 00:00:00') + } + form.setFieldValue("tm", [moment(dateTimeSo.start), moment(dateTimeSo.end)]) + setSearchVal({ dateTimeSo }) + }, []) + + return ( + <> +
+
+ + + + + + + + + + + + + + + + + + + + +
+ + ); +} + +export default ToolBar; \ No newline at end of file diff --git a/src/views/rcgl/zmjk/index.js b/src/views/rcgl/zmjk/index.js index b61dbb66f..8de4d3acc 100644 --- a/src/views/rcgl/zmjk/index.js +++ b/src/views/rcgl/zmjk/index.js @@ -1,5 +1,6 @@ import React, { useEffect, useMemo, useState } from 'react' -import { Modal, Tabs, Descriptions, Image } from 'antd'; +import { Modal, Tabs, Descriptions, Image, Divider, Table } from 'antd'; +import {DoubleRightOutlined} from '@ant-design/icons' import { Stage } from 'react-konva'; import Sider from './Sider'; import Topper1 from './Topper1'; @@ -11,11 +12,12 @@ import HFivePlayer from '../../../components/video1Plary' import './index.less'; import { httpget, httpget2, httppost2 } from '../../../utils/request'; import apiurl from '../../../service/apiurl'; +import ModalContent from './ModalContent'; const url = "http://223.75.53.141:9102/test.by-lyf.tmp" const CanvasW = 1080 const CanvasH = 640 // const waterRatio = 0 -const zmobj ={ +const zmobj = { "hpCode": "HP0074208040002120", "stcd": "4265630075", "ctrlType": "PLC", @@ -44,84 +46,11 @@ const zmobj ={ "lgtd": 112.242945, "lttd": 30.848166, "runtime": [ - null, - { - "stcd": "4265630075", - "gateNumber": 1, - "realAperture": 376, - "setAperture": 0, - "sensorLever": null, - "altitudeLever": null, - "remoteSignal": 0, - "powerSignal": 0, - "openingSignal": 0, - "closeingSignal": 0, - "errorSignal": 0, - "openedSignal": 0, - "closedSignal": 0, - "tm": "2024-09-25 20:03:26", - "_online": true - }, - { - "stcd": "4265630075", - "gateNumber": 2, - "realAperture": 388, - "setAperture": 0, - "sensorLever": null, - "altitudeLever": null, - "remoteSignal": 0, - "powerSignal": 0, - "openingSignal": 0, - "closeingSignal": 0, - "errorSignal": 0, - "openedSignal": 0, - "closedSignal": 0, - "tm": "2024-09-25 20:03:26", - "_online": true - }, - { - "stcd": "4265630075", - "gateNumber": 3, - "realAperture": 394, - "setAperture": 0, - "sensorLever": null, - "altitudeLever": null, - "remoteSignal": 0, - "powerSignal": null, - "openingSignal": 0, - "closeingSignal": 0, - "errorSignal": 0, - "openedSignal": 0, - "closedSignal": 0, - "tm": "2024-09-25 20:03:26", - "_online": true - } - ], - "real": { - "stcd": "4265630075", - "stationName": "五岭包节制闸", - "z1": null, - "zz1": null, - "z1tm": null, - "z2": null, - "zz2": null, - "z2tm": null, - "hq": null, - "hqtm": null, - "demtl": null - }, - "cctvs": [], - "_idx": 88, - "_fav": false, - "_sort": 10086 -} - -const runtime = [ - null, - { + null, + { "stcd": "4265630075", "gateNumber": 1, - "realAperture": 976, + "realAperture": 376, "setAperture": 0, "sensorLever": null, "altitudeLever": null, @@ -132,9 +61,10 @@ const runtime = [ "errorSignal": 0, "openedSignal": 0, "closedSignal": 0, - "tm": "2024-09-25 20:03:31" - }, - { + "tm": "2024-09-25 20:03:26", + "_online": true + }, + { "stcd": "4265630075", "gateNumber": 2, "realAperture": 388, @@ -148,9 +78,10 @@ const runtime = [ "errorSignal": 0, "openedSignal": 0, "closedSignal": 0, - "tm": "2024-09-25 20:03:31" - }, - { + "tm": "2024-09-25 20:03:26", + "_online": true + }, + { "stcd": "4265630075", "gateNumber": 3, "realAperture": 394, @@ -164,24 +95,154 @@ const runtime = [ "errorSignal": 0, "openedSignal": 0, "closedSignal": 0, - "tm": "2024-09-25 20:03:31" + "tm": "2024-09-25 20:03:26", + "_online": true + } + ], + "real": { + "stcd": "4265630075", + "stationName": "五岭包节制闸", + "z1": null, + "zz1": null, + "z1tm": null, + "z2": null, + "zz2": null, + "z2tm": null, + "hq": null, + "hqtm": null, + "demtl": null + }, + "cctvs": [], + "_idx": 88, + "_fav": false, + "_sort": 10086 +} + +const runtime = [ + null, + { + "stcd": "4265630075", + "gateNumber": 1, + "realAperture": 976, + "setAperture": 0, + "sensorLever": null, + "altitudeLever": null, + "remoteSignal": 0, + "powerSignal": 0, + "openingSignal": 0, + "closeingSignal": 0, + "errorSignal": 0, + "openedSignal": 0, + "closedSignal": 0, + "tm": "2024-09-25 20:03:31" + }, + { + "stcd": "4265630075", + "gateNumber": 2, + "realAperture": 388, + "setAperture": 0, + "sensorLever": null, + "altitudeLever": null, + "remoteSignal": 0, + "powerSignal": 0, + "openingSignal": 0, + "closeingSignal": 0, + "errorSignal": 0, + "openedSignal": 0, + "closedSignal": 0, + "tm": "2024-09-25 20:03:31" + }, + { + "stcd": "4265630075", + "gateNumber": 3, + "realAperture": 394, + "setAperture": 0, + "sensorLever": null, + "altitudeLever": null, + "remoteSignal": 0, + "powerSignal": null, + "openingSignal": 0, + "closeingSignal": 0, + "errorSignal": 0, + "openedSignal": 0, + "closedSignal": 0, + "tm": "2024-09-25 20:03:31" } ] const myType = { // 闸前水位站 2闸后水位站 3流量站 - '1':'闸前水位/水深(m)', - '2':'闸后水位/水深(m)', - '3':'流量 (m³/s)', + '1': '闸前水位/水深(m)', + '2': '闸后水位/水深(m)', + '3': '流量 (m³/s)', } const Page = () => { - const [itemIndex,setItemIndex] = useState(null) - const [waterRatio,setWaterRatio] = useState(0) - const [data,setData] = useState({}) - const [list, setList ] = useState([]) - const [damList, setDamList ] = useState([]) - const [videoList, setVideoList ] = useState([]) + + const jcColumns = [ + { + title: '项目', + key: 'project', + width: 150, + }, + { + title: '实时数据', + key: 'project', + width: 150, + }, + { + title: '数据采集时间', + key: 'project', + width: 150, + } + ] + + const zfColumns = [ + { + title: '闸阀名称', + key: 'project', + width: 150, + }, + { + title: '当前开关状态', + key: 'project', + width: 150, + }, + { + title: '数据采集时间', + key: 'project', + width: 150, + } + ] + + const jlColumns = [ + { + title: '闸阀名称', + key: 'project', + width: 150, + }, + { + title: '操作内容', + key: 'project', + width: 150, + }, + { + title: '操作结果', + key: 'project', + width: 150, + }, + { + title: '操作时间', + key: 'project', + width: 150, + } + ] + const [itemIndex, setItemIndex] = useState(null) + const [waterRatio, setWaterRatio] = useState(0) + const [data, setData] = useState({}) + const [list, setList] = useState([]) + const [damList, setDamList] = useState([]) + const [videoList, setVideoList] = useState([]) const [videoArr, setvideoArr] = useState({}) const [open, setOpen] = useState(false) @@ -191,42 +252,42 @@ const Page = () => { const pts = contextCoordinates(xunit, hole); const eqpnoList = useMemo(() => damList ? new Array(damList.length).fill(0).map((o, index) => index) : [], [damList]); - useEffect(()=>{ + useEffect(() => { getList() - },[]) + }, []) - const getList = async()=>{ - const {code, data} = await httppost2(apiurl.zmjk.getList) - if(code!==200){ + const getList = async () => { + const { code, data } = await httppost2(apiurl.zmjk.getList) + if (code !== 200) { return } - const obj = data[0]||{} + const obj = data[0] || {} getInformation(obj.gateCode) getDamData(obj.stcd) getVideo(obj.gateCode) setData(obj) } - const getInformation = async(gateCode)=>{ - const {code, data} = await httpget2(apiurl.zmjk.getInformation,{gateCode}) - if(code!==200){ + const getInformation = async (gateCode) => { + const { code, data } = await httpget2(apiurl.zmjk.getInformation, { gateCode }) + if (code !== 200) { return } - data.map((item)=>{ - if(item.type===2){ - setWaterRatio(item.value/5||0) + data.map((item) => { + if (item.type === 2) { + setWaterRatio(item.value / 5 || 0) } }) setList(data) } - const getDamData = async(stcd)=>{ - const {code, data} = await httpget2(apiurl.zmjk.getDamData,{stcd}) - if(code!==200){ + const getDamData = async (stcd) => { + const { code, data } = await httpget2(apiurl.zmjk.getDamData, { stcd }) + if (code !== 200) { return } - const list = [] - data.map((item)=>{ + const list = [] + data.map((item) => { list.push({ ...item }) @@ -234,38 +295,71 @@ const Page = () => { setDamList(list) } - const getVideo = async(valveCode)=>{ - const {code, data} = await httppost2(apiurl.zmjk.getVideo,{valveCode}) - if(code!==200){ + const getVideo = async (valveCode) => { + const { code, data } = await httppost2(apiurl.zmjk.getVideo, { valveCode }) + if (code !== 200) { return } setVideoList(data) + getVideoSrc(data[0]?.indexCode) } const getVideoSrc = async (current) => { const res = await httpget2(`${apiurl.gsxl.zfzl.videosrc}${current}`)//32023a7f27d8448fa10511f24e96acff if (res.code == 200 && res.data?.length !== 0) { - setvideoArr({src:res.data}) - }else{ + setvideoArr({ src: res.data }) + } else { setvideoArr({}) } } - const getNum = (a,b)=>{ - const aa = Number(a||0) - const bb = Number(b||0) - const num = Number(aa-bb).toFixed(3) + const getNum = (a, b) => { + const aa = Number(a || 0) + const bb = Number(b || 0) + const num = Number(aa - bb).toFixed(3) return num } return ( <> -
-
+
+
{/* */}
- +
+
+ + 闸阀监控 +
+
+
record.id} + dataSource={[]} + pagination={false} + /> + +
+
+ 最近操作记录
+
setOpen(true)}> +
+ 查看更多信息 + +
+
+
+
+
record.id} + dataSource={[]} + pagination={false} + /> + + + {/*
@@ -302,12 +396,14 @@ const Page = () => { }
- - + */} +
-
视频监控
+
+ + 监控视频
-
+ {/*
{ videoList.map((item,index)=>(
{setItemIndex(index);getVideoSrc(item.indexCode)}}> @@ -315,20 +411,20 @@ const Page = () => {
)) } -
+
*/}
{ - videoArr?.src && + videoArr?.src &&
{ - // if (controlerParams.type == 1) { - // setVideoOpen(true) - // setIsShow(!isShow) - // } - }} - > + className="content-video" + style={{ width: '100%', height: '100%', cursor: "pointer" }} + onClick={() => { + // if (controlerParams.type == 1) { + // setVideoOpen(true) + // setIsShow(!isShow) + // } + }} + > {/*
注:单击视频显示/隐藏云台
*/}
@@ -337,9 +433,17 @@ const Page = () => {
-
监测数据
-
- { +
+ + 监测数据
+
+
record.id} + dataSource={[]} + pagination={false} + /> + {/* { list?.map((item)=>{ if(item.type===1){ return ( @@ -367,45 +471,46 @@ const Page = () => { ) } }) - } + } */} -
setOpen(true)}>查看更多信息
- + {/*
setOpen(true)}>查看更多信息
*/} + { setOpen(false) }} > -
- +
+ + {/* - {{1:'卷扬式',2:'螺杆式',3:'凹轮式',4:'涡轮式',5:'丝杆式'}?.[data?.hdgrTp]||'-'} - {{1:'手动',2:'电动',3:'手电两用'}?.[data?.pwrTp]||'-'} - {{1:'分(泄)洪闸',2:'节制闸',3:'排(退)水闸',4:'引(进)水闸',5:'挡潮闸',6:'船闸',9:'其他'}?.[data?.wagaType]||'-'} - {data?.inEle||'-'} m - {data?.outEle||'-'} m - {data?.gaorNum||'-'} 孔 - {data?.dsfl||'-'} m³/s - {data?.stfl||'-'} m³/s - {data?.gateSize||'-'} m*m - {{1:'Ⅰ',2:'Ⅱ',3:'Ⅲ',4:'Ⅳ',5:'Ⅴ'}?.[data?.engGrad]||'-'} - {{1:'在用良好',2:'在用故障',3:'停用'}?.[data?.runStat]||'-'} - {data?.compDate||'-'} + {{ 1: '卷扬式', 2: '螺杆式', 3: '凹轮式', 4: '涡轮式', 5: '丝杆式' }?.[data?.hdgrTp] || '-'} + {{ 1: '手动', 2: '电动', 3: '手电两用' }?.[data?.pwrTp] || '-'} + {{ 1: '分(泄)洪闸', 2: '节制闸', 3: '排(退)水闸', 4: '引(进)水闸', 5: '挡潮闸', 6: '船闸', 9: '其他' }?.[data?.wagaType] || '-'} + {data?.inEle || '-'} m + {data?.outEle || '-'} m + {data?.gaorNum || '-'} 孔 + {data?.dsfl || '-'} m³/s + {data?.stfl || '-'} m³/s + {data?.gateSize || '-'} m*m + {{ 1: 'Ⅰ', 2: 'Ⅱ', 3: 'Ⅲ', 4: 'Ⅳ', 5: 'Ⅴ' }?.[data?.engGrad] || '-'} + {{ 1: '在用良好', 2: '在用故障', 3: '停用' }?.[data?.runStat] || '-'} + {data?.compDate || '-'} - + */}
diff --git a/src/views/rcgl/zmjk/index.less b/src/views/rcgl/zmjk/index.less index b97ba316a..3cc8c83cf 100644 --- a/src/views/rcgl/zmjk/index.less +++ b/src/views/rcgl/zmjk/index.less @@ -2,12 +2,24 @@ .ant-card-body{ display: flex; height: 100%; + column-gap: 20px; .sg_zmjk_left{ - top: 30px; + // top: 30px; position: relative; - width: 1080px; - height: 640px; - transform: scale(0.9,1); + width: 930px; + // height: 640px; + .sg_zmjk_left_title{ + height: 35px; + line-height: 35px; + border-bottom: 1px solid #bbb; + font-weight: 600; + font-size: 18px; + } + .sz_left_up_table{ + margin-top: 10px; + // height: 355px; + } + } .sg_zmjk_right{ @@ -19,16 +31,18 @@ .sg_zmjk_right_video{ height: 400px; - margin: 30px 20px 30px -30px; + // margin: 30px 20px 30px -30px; border-radius: 5px; - border: 1px solid #bbb; + // border: 1px solid #bbb; display: flex; flex-direction: column; .sg_zmjk_right_video_title{ height: 35px; line-height: 35px; - padding-left: 10px; + // padding-left: 10px; border-bottom: 1px solid #bbb; + font-weight: 600; + font-size: 18px; } .sg_zmjk_right_video_content{ flex: 1; @@ -57,7 +71,7 @@ } } .sg_zmjk_right_video_content_right{ - flex: 1; + width: 100%; height: 100%; padding: 10px; } @@ -65,14 +79,16 @@ } .sg_zmjk_right_information{ height: 180px; - margin: -10px 20px 30px -30px; + // margin: -10px 20px 30px -30px; border-radius: 5px; - border: 1px solid #bbb; + // border: 1px solid #bbb; .sg_zmjk_right_information_title{ height: 35px; line-height: 35px; - padding-left: 10px; + // padding-left: 10px; border-bottom: 1px solid #bbb; + font-weight: 600; + font-size: 18px; } .sg_zmjk_right_information_content{ display: flex; @@ -83,10 +99,7 @@ } } } - .sg_zmjk_right_more{ - margin: -10px 20px 30px -30px; - cursor: pointer; - } + } } } \ No newline at end of file diff --git a/src/views/sq/qys/gcys/buildInfo/index.js b/src/views/sq/qys/gcys/buildInfo/index.js index e9919b00b..56ee758b7 100644 --- a/src/views/sq/qys/gcys/buildInfo/index.js +++ b/src/views/sq/qys/gcys/buildInfo/index.js @@ -23,7 +23,7 @@ export default function BuildInfo() { @@ -32,7 +32,7 @@ export default function BuildInfo() { @@ -41,7 +41,7 @@ export default function BuildInfo() { @@ -50,7 +50,7 @@ export default function BuildInfo() { @@ -58,7 +58,7 @@ export default function BuildInfo() { @@ -73,7 +73,7 @@ export default function BuildInfo() { @@ -82,7 +82,7 @@ export default function BuildInfo() { @@ -91,7 +91,7 @@ export default function BuildInfo() { @@ -100,7 +100,7 @@ export default function BuildInfo() { @@ -108,7 +108,7 @@ export default function BuildInfo() { @@ -123,7 +123,7 @@ export default function BuildInfo() { @@ -132,7 +132,7 @@ export default function BuildInfo() { @@ -141,7 +141,7 @@ export default function BuildInfo() { @@ -150,7 +150,7 @@ export default function BuildInfo() { @@ -159,7 +159,7 @@ export default function BuildInfo() { @@ -168,7 +168,7 @@ export default function BuildInfo() { @@ -176,7 +176,7 @@ export default function BuildInfo() { @@ -184,7 +184,7 @@ export default function BuildInfo() { @@ -192,7 +192,7 @@ export default function BuildInfo() { @@ -207,7 +207,7 @@ export default function BuildInfo() { @@ -216,7 +216,7 @@ export default function BuildInfo() { @@ -225,7 +225,7 @@ export default function BuildInfo() { @@ -234,7 +234,7 @@ export default function BuildInfo() { @@ -243,7 +243,7 @@ export default function BuildInfo() { @@ -252,7 +252,7 @@ export default function BuildInfo() { @@ -260,7 +260,7 @@ export default function BuildInfo() { @@ -268,7 +268,7 @@ export default function BuildInfo() { @@ -276,7 +276,7 @@ export default function BuildInfo() { @@ -291,7 +291,7 @@ export default function BuildInfo() { @@ -300,7 +300,7 @@ export default function BuildInfo() { @@ -309,7 +309,7 @@ export default function BuildInfo() { @@ -318,7 +318,7 @@ export default function BuildInfo() { @@ -327,7 +327,7 @@ export default function BuildInfo() { @@ -336,7 +336,7 @@ export default function BuildInfo() { @@ -344,7 +344,7 @@ export default function BuildInfo() { @@ -352,7 +352,7 @@ export default function BuildInfo() { @@ -360,7 +360,7 @@ export default function BuildInfo() { @@ -375,7 +375,7 @@ export default function BuildInfo() { @@ -384,7 +384,7 @@ export default function BuildInfo() { @@ -393,7 +393,7 @@ export default function BuildInfo() { @@ -402,7 +402,7 @@ export default function BuildInfo() { @@ -410,7 +410,7 @@ export default function BuildInfo() { @@ -425,7 +425,7 @@ export default function BuildInfo() { @@ -434,7 +434,7 @@ export default function BuildInfo() { diff --git a/src/views/sq/qys/gcys/projectBasicInfo/index.js b/src/views/sq/qys/gcys/projectBasicInfo/index.js index e41a5d5ed..25dba9862 100644 --- a/src/views/sq/qys/gcys/projectBasicInfo/index.js +++ b/src/views/sq/qys/gcys/projectBasicInfo/index.js @@ -1,6 +1,6 @@ -import React,{useState,useEffect} from 'react' -import { Row, Col, Form, Input, DatePicker, Button,Upload,message,Modal } from "antd" -import {PaperClipOutlined,DeleteOutlined} from '@ant-design/icons'; +import React, { useState, useEffect } from 'react' +import { Row, Col, Form, Input, DatePicker, Button, Upload, message, Modal } from "antd" +import { PaperClipOutlined, DeleteOutlined } from '@ant-design/icons'; import NormalSelect from '../../../../../components/Form/NormalSelect'; import { formItemLayout } from '../../../../../components/crud/FormLayoutProps' import apiurl from '../../../../../service/apiurl'; @@ -8,451 +8,481 @@ import { httpget2, httppost2 } from '../../../../../utils/request'; import moment from 'moment' import "./index.less" export default function ProjectBasciInfo() { - const [form] = Form.useForm(); - const [data, setData] = useState() - const [fileList, setFileList] = useState([]) //上传文件列表 - const [fileIds, setFileIds] = useState([]) - const [loading, setLoading] = useState(false) - const [iframeId, setIframeId] = useState('') - const [perviewOpen, setPerviewOpen] = useState(false) - const [skdisabled, setSkDisabled] = useState(true) - const optionsLevel = [ - { - label: "大 (1)型", - value:"1" - }, - { - label: "大 (2)型", - value:"2" - }, - { - label: "中型", - value:"3" - }, - { - label: "小 (1)型", - value:"4" - }, - { - label: "小 (2)型", - value:"5" - }, - { - label: "其他", - value:"9" - } - ] - - const getData = async () => { - try { - - const res = await httppost2(apiurl.dataResourcesCenter.projectAndWater.shuikuBasicinfo.detail) - // debugger; - if (res.code == 200) { - form.setFieldsValue(res.data[0]) - setData(res.data[0]) - if (res.data[0].files.length > 0) { - getFileInfo(res.data[0]?.files[0]?.fileId) - } - } - } catch (error) { - console.log(error); - } + const [form] = Form.useForm(); + const [data, setData] = useState() + const [fileList, setFileList] = useState([]) //上传文件列表 + const [fileIds, setFileIds] = useState([]) + const [loading, setLoading] = useState(false) + const [iframeId, setIframeId] = useState('') + const [perviewOpen, setPerviewOpen] = useState(false) + const [skdisabled, setSkDisabled] = useState(true) + const optionsLevel = [ + { + label: "大 (1)型", + value: "1" + }, + { + label: "大 (2)型", + value: "2" + }, + { + label: "中型", + value: "3" + }, + { + label: "小 (1)型", + value: "4" + }, + { + label: "小 (2)型", + value: "5" + }, + { + label: "其他", + value: "9" } + ] - const beforeUpload = (file) => { - const isPdf = file.type === 'application/pdf' - if (!isPdf) { - message.error("请上传pdf文件") - } - return isPdf - } + const getData = async () => { + try { - const fileChange = (info) => { - - if (info.file.status === "done") { - setLoading(false); - - } - if (info.file.status === "uploading") { - setLoading(true); - - } - if (info.file.status === "error") { - message.error("文件上传失败") - setLoading(false); - - } - if (info?.file.type === "application/pdf") { - let fileIds = info.fileList.map(file => { - return file.response?.data?.fileId - }) - setFileIds(fileIds) - setFileList(info.fileList) - + const res = await httppost2(apiurl.dataResourcesCenter.projectAndWater.shuikuBasicinfo.detail) + // debugger; + if (res.code == 200) { + form.setFieldsValue(res.data[0]) + setData(res.data[0]) + if (res.data[0].files.length > 0) { + getFileInfo(res.data[0]?.files[0]?.fileId) } } - - const deleteFile = (fileId) => { - let filterFile = fileList.filter(item => item.response?.data?.fileId !== fileId); - setFileList(filterFile) + } catch (error) { + console.log(error); } + } - const onFinish = async () => { - try { - let oldFiles = fileList.map(item => ({ fileId: item.response?.data?.fileId })) - const values = form.getFieldsValue(); - const params = { - ...data, - ...values, - files:oldFiles - } - const res = await httppost2(apiurl.dataResourcesCenter.projectAndWater.shuikuBasicinfo.update,params) - if (res.code == 200) { - message.success("修改成功") - setSkDisabled(true) - getData() - } - } catch (error) { - console.log(error); - - } - + const beforeUpload = (file) => { + const isPdf = file.type === 'application/pdf' + if (!isPdf) { + message.error("请上传pdf文件") } + return isPdf + } - const getFileInfo = async(id) => { - try { - const res = await httpget2(`${apiurl.dataResourcesCenter.projectAndWater.shuikuBasicinfo.getFile}/${id}`) - let obj ={ - name: res.data.fileName, - response: { - data: { - filePath: res.data.filePath, - fileId:res.data.fileId - } - }, - } - setFileList([obj]) - } catch (error) { - console.log(error); - - } + const fileChange = (info) => { + let newFileList = [...info.fileList]; + newFileList = newFileList.slice(-1); + // 处理文件状态 + newFileList = newFileList.map(file => { + if (file.response) { + return { + ...file, + status: 'done', // 确保状态正确 + url: file.response.url, + fileId: file.response.data?.fileId + }; + } + return file; + }); + if (info.file.status === "done") { + setLoading(false); + message.success(`${info.file.name} 上传成功`); } - useEffect(() => { + if (info.file.status === "uploading") { + setLoading(true); + + } + if (info.file.status === "error") { + message.error("文件上传失败") + setLoading(false); + + } + if (info?.file.type === "application/pdf") { + let fileIds = info.fileList.map(file => { + return file.response?.data?.fileId + }) + setFileIds(fileIds) + setFileList(newFileList) + + } + } + + const deleteFile = (fileId) => { + let filterFile = fileList.filter(item => item.response?.data?.fileId !== fileId); + setFileList(filterFile) + } + + const onFinish = async () => { + try { + let oldFiles = fileList.map(item => ({ fileId: item.response?.data?.fileId })) + const values = form.getFieldsValue(); + const params = { + ...data, + ...values, + files: oldFiles + } + const res = await httppost2(apiurl.dataResourcesCenter.projectAndWater.shuikuBasicinfo.update, params) + if (res.code == 200) { + message.success("修改成功") + setSkDisabled(true) getData() - }, []) - + } + } catch (error) { + console.log(error); + + } + + } + + const getFileInfo = async (id) => { + try { + const res = await httpget2(`${apiurl.dataResourcesCenter.projectAndWater.shuikuBasicinfo.getFile}/${id}`) + let obj = { + name: res.data.fileName, + response: { + data: { + filePath: res.data.filePath, + fileId: res.data.fileId + } + }, + } + setFileList([obj]) + } catch (error) { + console.log(error); + + } + } + console.log('f', fileList); + + useEffect(() => { + getData() + }, []) + return (
-
- -
- - - - - - - - - - - - - - - - - - moment(dateString).format('YYYY-MM-DD HH:mm:ss')} - getValueProps={value => ({ - value: value ? moment(value) : undefined - })} - > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - moment(dateString).format('YYYY-MM-DD HH:mm:ss')} - getValueProps={value => ({ - value: value ? moment(value) : undefined - })} - > - - - - - moment(dateString).format('YYYY-MM-DD HH:mm:ss')} - getValueProps={value => ({ - value: value ? moment(value) : undefined - })} - > - - - - - - - - - - - - - - - - - - { - return ( -
- - { setPerviewOpen(true); setIframeId(file.response?.data?.fileId)}} - > - {file?.name} - {skdisabled ? null : - deleteFile(file.response?.data?.fileId)} - /> - } -
- ) - }} - > - {skdisabled ? null : - - } -
-
- - - - - - - - - - - - - - - - - - - - { - skdisabled ? : -
- - -
- } - -
- - - - - + + + + + + + + + + + + + + + + + + + + moment(dateString).format('YYYY-MM-DD HH:mm:ss')} + getValueProps={value => ({ + value: value ? moment(value) : undefined + })} + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + moment(dateString).format('YYYY-MM-DD HH:mm:ss')} + getValueProps={value => ({ + value: value ? moment(value) : undefined + })} + > + + + + + moment(dateString).format('YYYY-MM-DD HH:mm:ss')} + getValueProps={value => ({ + value: value ? moment(value) : undefined + })} + > + + + + + + + + + + + + + + + + + + + {fileList.map(file => ( +
+ + { + e.stopPropagation(); // 阻止触发上传 + if (file.response?.data?.fileId) { + setPerviewOpen(true); + setIframeId(file.response.data.fileId); + } + }} + > + {file.name} + + {!skdisabled && ( + { + e.stopPropagation(); // 阻止触发上传 + deleteFile(file.response?.data?.fileId); + }} + /> + )} +
+ ))} + {!skdisabled && fileList.length === 0 && ( + + )} +
+
+ + + + + + + + + + + + + + + + + + + + { + skdisabled ? : +
+ + +
+ } + +
+ + + + + { setPerviewOpen(false) }} > -