合并qzc代码

qzc-dev-demo
秦子超 2025-03-28 17:32:50 +08:00
commit 2519ae0dd1
48 changed files with 2434 additions and 1230 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

View File

@ -9,7 +9,7 @@ import {divIcon} from "leaflet";
import { httppost2 } from '../../utils/request'; import { httppost2 } from '../../utils/request';
import apiurl from '../../service/apiurl'; import apiurl from '../../service/apiurl';
import CryptoJS from 'crypto-js'; import CryptoJS from 'crypto-js';
import { createCrudService } from '../../components/crud/_';
const { SubMenu } = Menu; const { SubMenu } = Menu;
const HeaderUser: React.FC<{ const HeaderUser: React.FC<{
@ -38,26 +38,36 @@ const HeaderUser: React.FC<{
} }
const onFinish = async(val:any)=>{ const onFinish = async (val: any) => {
if(val.newSecretKey!==val.secondSecretKey){ const path = `${apiurl.systemM.userM.updatePassword}?oldPassword=${val.oldPassword}&newPassword=${val.newPassword}`;
message.error('确认密码错误') createCrudService(path).userEdit().then((result) => {
return if (result?.code === 200) {
} message.success('修改成功,即将重新登录')
const params = { setOpen(false)
oldSecretKey:encryptData(val.oldSecretKey), setTimeout(() => {
newSecretKey:encryptData(val.newSecretKey), logout()
secondSecretKey:encryptData(val.secondSecretKey), }, 1500);
userId: localStorage.getItem('userId') }
} })
const res = await httppost2(apiurl.setPassword,params) // if(val.newSecretKey!==val.secondSecretKey){
if(res.code===200){ // message.error('确认密码错误')
message.success('修改成功') // return
setTimeout(() => { // }
logout() // const params = {
}, 1500); // oldSecretKey:encryptData(val.oldSecretKey),
}else{ // newSecretKey:encryptData(val.newSecretKey),
message.error(res.description) // secondSecretKey:encryptData(val.secondSecretKey),
} // userId: localStorage.getItem('userId')
// }
// const res = await httppost2(apiurl.setPassword,params)
// if(res.code===200){
// message.success('修改成功')
// setTimeout(() => {
// logout()
// }, 1500);
// }else{
// message.error(res.description)
// }
} }
@ -90,7 +100,7 @@ const HeaderUser: React.FC<{
</div>:null </div>:null
} }
<Modal title="修改密码" open={open} onOk={()=>setOpen(false)} onCancel={()=>setOpen(false)} footer={null}> <Modal destroyOnClose title="修改密码" open={open} onOk={()=>setOpen(false)} onCancel={()=>setOpen(false)} footer={null}>
<Form <Form
name="basic" name="basic"
labelCol={{span: 5}} labelCol={{span: 5}}
@ -101,23 +111,23 @@ const HeaderUser: React.FC<{
> >
<Form.Item <Form.Item
label="原密码" label="原密码"
name="oldSecretKey" name="oldPassword"
rules={[{required: true}]}> rules={[{required: true}]}>
<Input.Password /> <Input.Password />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="新密码" label="新密码"
name="newSecretKey" name="newPassword"
rules={[{required: true}]}> rules={[{required: true}]}>
<Input.Password /> <Input.Password />
</Form.Item> </Form.Item>
<Form.Item {/* <Form.Item
label="确认密码" label="确认密码"
name="secondSecretKey" name="secondSecretKey"
rules={[{required: true}]}> rules={[{required: true}]}>
<Input.Password /> <Input.Password />
</Form.Item> </Form.Item> */}
<Form.Item <Form.Item
wrapperCol={{ wrapperCol={{

View File

@ -62,7 +62,7 @@ const TopMenu: React.FC<{
const menuClicked = (id: any) => { const menuClicked = (id: any) => {
const menuItem:any = menu.find(m => m.id == id); const menuItem:any = menu.find(m => m.id == id);
if (menuItem.title === "雨水工灾情") { if (menuItem.title === "雨水工灾情") {
getReadStatus() // getReadStatus()
} }
const url = getMenuUrl(menuItem); const url = getMenuUrl(menuItem);
@ -74,17 +74,17 @@ const TopMenu: React.FC<{
* @description * @description
* *
*/ */
const getReadStatus = () => { // const getReadStatus = () => {
createCrudService(apiurl.ssyq.status).delGet().then((res) => { // createCrudService(apiurl.ssyq.status).delGet().then((res) => {
if (res.code === 200) { // if (res.code === 200) {
dispatch.runtime.setIsReadObject(res.data) // dispatch.runtime.setIsReadObject(res.data)
} // }
}) // })
} // }
useEffect(() => { // useEffect(() => {
getReadStatus() // getReadStatus()
}, []) // }, [])
return ( return (
<div className='app-top-menu'> <div className='app-top-menu'>

View File

@ -1,4 +1,4 @@
import {httppost2, download, httpPostFile, httpget, httpget2,httpget6} from "../../utils/request"; import {httppost2, download, httpPostFile, httpget, httpget2,httpget6,xyt_httpput} from "../../utils/request";
import apiurl from "../../service/apiurl"; import apiurl from "../../service/apiurl";
import {config} from "../../config"; import {config} from "../../config";
@ -156,6 +156,10 @@ export function createCrudService(urlSet) {
const resData = await httppost2(urlSet, params) || {}; const resData = await httppost2(urlSet, params) || {};
return resData; return resData;
} }
const userEdit = async (params) => {
const resData = await xyt_httpput(urlSet, params) || {};
return resData;
}
const edit1 = async (params) => { const edit1 = async (params) => {
const resData = await httppost2(urlSet, params) || {}; const resData = await httppost2(urlSet, params) || {};
@ -246,6 +250,7 @@ export function createCrudService(urlSet) {
todo: todo, todo: todo,
save: save, save: save,
edit: edit, edit: edit,
userEdit,
edit1: edit1, edit1: edit1,
del: del, del: del,
insert:insert, insert:insert,

View File

@ -350,7 +350,7 @@ export async function loadMenu(): Promise<MenuItem[]> {
{ {
id: id(), title: '白蚁防治', redirect: '/mgr/sg/byfz/bypc', id: id(), title: '白蚁防治', redirect: '/mgr/sg/byfz/bypc',
children: [ 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' }, { id: id(), title: '防治宣传', path: '/mgr/sg/byfz/byxc' },
] ]
}, },
@ -360,9 +360,9 @@ export async function loadMenu(): Promise<MenuItem[]> {
{ {
id: id(), title: '维修养护', path: '/mgr/sg/wxyh', id: id(), title: '维修养护', path: '/mgr/sg/wxyh',
}, },
{ // {
id: id(), title: '库容管理', path: '/mgr/sg/krgl', // id: id(), title: '库容管理', path: '/mgr/sg/krgl',
}, // },
{ {
id: id(), title: '值班管理', redirect: '/mgr/sg/zbgl/zbb', id: id(), title: '值班管理', redirect: '/mgr/sg/zbgl/zbb',
children: [ children: [

View File

@ -1,5 +1,4 @@
import { config } from '../config' import { config } from '../config'
import Zfzl from '../views/gxsl/zfzl'
const pubapi_old = 'https://owrsvr.cloudowr.cn/svr' const pubapi_old = 'https://owrsvr.cloudowr.cn/svr'
const pubapi = 'https://owrsvr.cloudowr.cn/pubapi' const pubapi = 'https://owrsvr.cloudowr.cn/pubapi'
@ -8,7 +7,11 @@ const service_fxdd = '/gunshiApp/tsg'
const service_xyt = '/gunshiApp/tsg'//登陆先用小玉潭 const service_xyt = '/gunshiApp/tsg'//登陆先用小玉潭
const service_shzh = '/shzh' const service_shzh = '/shzh'
const apiurl = { const apiurl = {
systemM: {
userM: {
updatePassword:service_xyt + '/system/user/profile/updatePwd'
}
},
krline: { krline: {
list: service_fxdd + "/stZvarlB/list", list: service_fxdd + "/stZvarlB/list",
save: service_fxdd + "/stZvarlB/insert", save: service_fxdd + "/stZvarlB/insert",
@ -354,7 +357,9 @@ const apiurl = {
}, },
byfz: { byfz: {
bypc: { bypc: {
page: service_fxdd + "/termite/survey/page", // page: service_fxdd + "/termite/survey/page",
page: service_fxdd + "/termite/survey/pageDetail",
count:service_fxdd + "/termite/survey/count",
save: service_fxdd + "/termite/survey/insert", save: service_fxdd + "/termite/survey/insert",
edit: service_fxdd + "/termite/survey/update", edit: service_fxdd + "/termite/survey/update",
delete: service_fxdd + "/termite/survey/del", delete: service_fxdd + "/termite/survey/del",
@ -984,6 +989,10 @@ const apiurl = {
update: service_fxdd + "/attResBase/update", update: service_fxdd + "/attResBase/update",
getFile:service_fxdd + "/attResBase/file/get" getFile:service_fxdd + "/attResBase/file/get"
}, },
buildInfo: {
detail: service_fxdd + "/attResBuilding/info",
update: service_fxdd + "/attResBuilding/update",
},
kr: { kr: {
list: service_fxdd + "/stZvarlB/list", list: service_fxdd + "/stZvarlB/list",
save: service_fxdd + "/stZvarlB/insert", save: service_fxdd + "/stZvarlB/insert",

View File

@ -10,6 +10,7 @@ module.exports = function (app) {
// target: 'http://36.139.207.50:18083/',//移动云 // target: 'http://36.139.207.50:18083/',//移动云
// target: 'http://192.168.66.49:24105/',//移动云 // target: 'http://192.168.66.49:24105/',//移动云
// target: 'http://192.168.66.32:24105/',//ls // target: 'http://192.168.66.32:24105/',//ls
// target: 'http://192.168.66.32:24105/', //ls
changeOrigin: true, changeOrigin: true,
}) })
); );

View File

@ -53,7 +53,19 @@ async function send(url, options) {
return {}; return {};
} }
export function xyt_httpput(url, data = {}) {
const options = {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'adcd': localStorage.getItem('ADCD6'),
"authorization":"Bearer" + ' ' + localStorage.getItem('access_token')
},
body: JSON.stringify(data),
};
return send(url, options);
}
export function httpget(url, data = {}) { export function httpget(url, data = {}) {
const params = []; const params = [];
for (const k in data) { for (const k in data) {

View File

@ -30,7 +30,7 @@ export default function drpOption({ data, wrz, grz }) {
// 显示图例 // 显示图例
show: true, show: true,
// 图例的位置 // 图例的位置
data: ['警戒水位', '危险水位', "降雨量", "水位", "转换流量"], data: ['警戒水位', '保证水位', "降雨量", "水位", "转换流量"],
}, },
xAxis: [ xAxis: [
{ {
@ -165,7 +165,7 @@ export default function drpOption({ data, wrz, grz }) {
{ {
xAxisIndex: 1, xAxisIndex: 1,
yAxisIndex: 1, yAxisIndex: 1,
name: '危险水位', name: '保证水位',
type: 'line', type: 'line',
color: "#D9001B", color: "#D9001B",
lineStyle: { lineStyle: {

View File

@ -1,5 +1,5 @@
import React, { useState, useEffect,useMemo,useRef } from 'react' import React, { useState, useEffect, useMemo, useRef } from 'react'
import { Table, Card,Button,message,Popconfirm } from 'antd'; import { Table, Card, Button, message, Popconfirm,Spin } from 'antd';
import ToolBar from './toolbar'; import ToolBar from './toolbar';
import { useSelector } from 'react-redux'; import { useSelector } from 'react-redux';
import ReactEcharts from 'echarts-for-react'; import ReactEcharts from 'echarts-for-react';
@ -12,26 +12,34 @@ import jrxOption from "./jrxOptions"
import { Rnd } from "react-rnd" import { Rnd } from "react-rnd"
export default function Xmzlmb() { export default function Xmzlmb() {
const typeName = {
'大坝B0+130': '1',
'大坝B0+132': '2',
'大坝B0+250': '3',
'大坝B0+252': '4',
'大坝B0+370': '5',
'大坝B0+372': '6',
}
const role = useSelector(state => state.auth.role); const role = useSelector(state => state.auth.role);
const [code, setCode] = useState([]) const [code, setCode] = useState([])
const [searchVal, setSearchVal] = useState({}) const [searchVal, setSearchVal] = useState({})
const [dataSources, setDateSources] = useState([]) const [dataSources, setDateSources] = useState([])
const [table2Data, setTable2Data] = useState([])
const [dmList, setDmList] = useState([]) const [dmList, setDmList] = useState([])
const [trData, setTrData] = useState([]) const [trData, setTrData] = useState([])
const [swiper, setSwiper] = useState(false) const [swiper, setSwiper] = useState(false)
const [timer, setTimer] = useState(100); // 定时器 const [timer, setTimer] = useState(100); // 定时器
const [dbType, setDbType] = useState('1') const [dbType, setDbType] = useState('1');
const [dbType1, setDbType1] = useState('1');
const [loading, setLoading] = useState(false);
const echartsRef = useRef(null) const echartsRef = useRef(null)
const jrxOptions = useMemo(() => { const jrxOptions = useMemo(() => {
if (dataSources && dbType) { if (dataSources && dbType && dbType1) {
return jrxOption(dataSources[0],dbType) return jrxOption(dataSources[0], dbType,dbType1)
} else { } else {
return dataSources[0]; return dataSources[0];
} }
}, [dataSources,dbType]) }, [dataSources, dbType,dbType1])
const columns = [ const columns = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" }, { title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" },
{ title: '时间', key: 'tm', dataIndex: 'tm', width: 150, align: "center" }, { title: '时间', key: 'tm', dataIndex: 'tm', width: 150, align: "center" },
@ -40,56 +48,60 @@ export default function Xmzlmb() {
const zcColumns = [ const zcColumns = [
{ {
title: '结果分析', key: 'status', dataIndex: 'status', width: 150, align: "center", title: '结果分析', key: 'status', dataIndex: 'status', width: 150, align: "center",
render: (rec, record) => <span style={!rec ? {color:"red"}:{}}>{rec == 1 ? "正常" : rec == 0 ? "异常" : ''}</span> render: (rec, record) => <span style={!rec ? { color: "red" } : {}}>{rec == 1 ? "正常" : rec == 0 ? "异常" : ''}</span>
}, },
]; ];
const columns1 = useMemo(() => { const columns1 = useMemo(() => {
if (trData.length > 0) { if (trData.length > 0) {
let newCol = trData.map(s => ({ let newCol = trData.map(s => ({
title: `${s}(m)`, title: `${s}(m)`,
key: s, key: s,
dataIndex: s, dataIndex: s,
width: 150, width: 150,
align: "center", align: "center",
render: (rec, record) => <span>{rec || "-"}</span> render: (rec, record) => <span>{rec || "-"}</span>
})) }))
return [...columns,...newCol,...zcColumns]; return [...columns, ...newCol, ...zcColumns];
} }
},[trData]) }, [trData])
const width = useMemo(() => columns1?.reduce((total, cur) => total + (cur.width), 0), [columns1]); const width = useMemo(() => columns1?.reduce((total, cur) => total + (cur.width), 0), [columns1]);
// 单图多线以及数据表的数据 // 单图多线以及数据表的数据
const getTableData = async(params) => { const getTableData = async (params) => {
setLoading(true);
try { try {
const res = await httppost2(apiurl.gcaqjc.gcaqfx.jrx.page, params) const res = await httppost2(apiurl.gcaqjc.gcaqfx.jrx.page, params)
let newArr = []; let newArr = [];
let newData = res.data.map((s, i) => { let newData = res.data.map((s, i) => {
newArr.push(s.list.map(c => ({ newArr.push(s.list.map(c => ({
[c.stationCode]: c.value || '-', [c.stationCode]: c.value || '-',
tm: c.tm, tm: c.tm,
}))) })))
return { return {
tm: s.tm, tm: s.tm,
rz: s.rz, rz: s.rz,
status: s.status || '', status: s.status || '',
inx:i+1 inx: i + 1
} }
}) })
let filterData = newArr.filter(s => s.length > 0).flat() let filterData = newArr.filter(s => s.length > 0).flat()
let result = newData.map(s => { let result = newData.map(s => {
let tm1 = s.tm; let tm1 = s.tm;
let r = filterData.filter(t => { let r = filterData.filter(t => {
return t.tm == tm1 return t.tm == tm1
}) })
let obj = {}; let obj = {};
r.forEach(s1 => { r.forEach(s1 => {
obj = {...s1,...obj} obj = { ...s1, ...obj }
}) })
return { return {
...s, ...s,
...obj, ...obj,
} }
}) })
if (result.length > 0) {
setLoading(false)
}
// let res1 = result.map(item => ({...item,rz:(item.rz - 100).toFixed(2)})) //为了测试 最后需要删除 // let res1 = result.map(item => ({...item,rz:(item.rz - 100).toFixed(2)})) //为了测试 最后需要删除
setDateSources(result) setDateSources(result)
} catch (error) { } catch (error) {
@ -97,25 +109,17 @@ export default function Xmzlmb() {
} }
} }
// 多图单线数据
const getTable2Data = async (params) => {
try {
const res = await httppost2(apiurl.gcaqjc.sjtjcx.czcx.list1, params)
setTable2Data(res.data)
} catch (error) {
console.log(error);
}
}
const exportExcel = () => { const exportExcel = () => {
let params = { let params = {
...searchVal, ...searchVal,
profileName: dmList.find(s => s.id == code).projNm, profileName: dmList.find(s => s.id == code).projNm,
stationCodes: trData, stationCodes: trData,
id:1 id: 1
} }
httppost5(apiurl.gcaqjc.gcaqfx.jrx.export, params).then(res => { httppost5(apiurl.gcaqjc.gcaqfx.jrx.export, params).then(res => {
exportFile(`浸润线.xlsx`,res.data) exportFile(`浸润线.xlsx`, res.data)
}) })
} }
const getDmList = async () => { const getDmList = async () => {
@ -127,11 +131,11 @@ export default function Xmzlmb() {
} }
} }
const getDmTree = async() => { const getDmTree = async () => {
try { try {
const res = await httppost2(apiurl.gcaqjc.sjtjcx.czcx.tree) const res = await httppost2(apiurl.gcaqjc.sjtjcx.czcx.tree)
let filterData = res.data.filter(s => s.profileCode == code) let filterData = res.data.filter(s => s.profileCode == code)
setTrData(filterData[0].children) setTrData(filterData[0]?.children)
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
@ -139,7 +143,7 @@ export default function Xmzlmb() {
const InitialScroll = (data) => { const InitialScroll = (data) => {
let index = 0; let index = 0;
const v = document.getElementsByClassName("ant-table-body")[0]; const v = document.getElementsByClassName("ant-table-body")[0];
if (data.length >= Number(1)) { if (data.length >= Number(1)) {
// 只有当大于10条数据的时候 才会看起滚动 // 只有当大于10条数据的时候 才会看起滚动
@ -149,9 +153,9 @@ export default function Xmzlmb() {
Math.ceil(v.scrollTop) >= parseFloat((v.scrollHeight - v.clientHeight).toString()) Math.ceil(v.scrollTop) >= parseFloat((v.scrollHeight - v.clientHeight).toString())
) { ) {
v.scrollTop = 0; v.scrollTop = 0;
// setTimeout(() => { v.scrollTop = 0 }, 1000) // setTimeout(() => { v.scrollTop = 0 }, 1000)
} }
echartsRef.current.getEchartsInstance().setOption(jrxOption(dataSources[index % dataSources.length],dbType)) echartsRef.current.getEchartsInstance().setOption(jrxOption(dataSources[index % dataSources.length], dbType,dbType1))
index++; index++;
}, Number(1000)); }, Number(1000));
setTimer(time); // 定时器保存变量 利于停止 setTimer(time); // 定时器保存变量 利于停止
@ -161,24 +165,7 @@ export default function Xmzlmb() {
const [scale, setScale] = useState(1) const [scale, setScale] = useState(1)
const scaleRef = useRef(null) const scaleRef = useRef(null)
scaleRef.current = scale; scaleRef.current = scale;
// 放大
const zoomIn = () => {
const img = document.getElementById("img");
scaleRef.current += 0.05
// setScale(scaleRef.current)
img.style.transform = `scale(${scaleRef.current})`;
}
// 缩小
const zoomOut = () => {
console.log(scaleRef);
const img = document.getElementById("img");
if (scaleRef.current > 1) {
scaleRef.current -= 0.05
// setScale(scaleRef.current)
}
img.style.transform = `scale(${scaleRef.current})`;
}
useEffect(() => { useEffect(() => {
if (trData.length > 0 && searchVal) { if (trData.length > 0 && searchVal) {
let params = { let params = {
@ -186,30 +173,33 @@ export default function Xmzlmb() {
...searchVal ...searchVal
} }
getTableData(params) getTableData(params)
getTable2Data(params)
} }
}, [trData, searchVal]); }, [trData, searchVal]);
useEffect(() => { useEffect(() => {
if (code) { if (code.length) {
getDmTree() getDmTree()
} }
if (timer) { if (timer) {
clearInterval(timer) clearInterval(timer)
} }
if (dmList.length > 0 && code) { if (dmList.length > 0 && code.length) {
let name = dmList.find(s => s.id == code)?.projNm let name = dmList.find(s => s.id == code)?.projNm
let type = name == "大坝B0+060" ? "1" : let type = (name == "大坝B0+130" || name == "大坝B0+132") ? "1" :
name == "大坝B0+090" ? "2" : (name == "大坝B0+250" || name == "大坝B0+252") ? "2" :
name == "大坝B0+120" ? "2" : '' (name == "大坝B0+370" || name == "大坝B0+372") ? "3" : '';
let type1 = typeName[name];
setDbType(type) setDbType(type)
setDbType1(type1)
} }
}, [code]) }, [code, dmList])
useEffect(() => { useEffect(() => {
getDmList() getDmList()
}, []) }, [])
useEffect(() => { useEffect(() => {
if (swiper && dataSources.length > 0) { if (swiper && dataSources.length > 0) {
InitialScroll(dataSources) InitialScroll(dataSources)
@ -220,12 +210,11 @@ export default function Xmzlmb() {
clearInterval(timer); // 停止定时器 clearInterval(timer); // 停止定时器
} }
}, [swiper, dataSources]) }, [swiper, dataSources])
useEffect(() => {
useEffect(()=>{
let scale = 1 let scale = 1
const img = document.getElementById("img"); const img = document.getElementById("img");
if (!img) return;
const fun = (e) => { const fun = (e) => {
console.log(1111)
// 大于0:滚轮向上滚动 小于0:滚轮向下滚动 // 大于0:滚轮向上滚动 小于0:滚轮向下滚动
if (e.wheelDelta > 0) { if (e.wheelDelta > 0) {
scale += 0.05; scale += 0.05;
@ -241,93 +230,78 @@ export default function Xmzlmb() {
img.style.transform = `scale(${scale})`; img.style.transform = `scale(${scale})`;
} }
} }
} }
img.addEventListener("wheel",fun) img.addEventListener("wheel",fun)
return ()=>{ return ()=>{
img.removeEventListener("wheel",fun) img.removeEventListener("wheel",fun)
} }
},[]) },[loading])
return ( return (
<div className='content-box' style={{ backgroundColor: '#fff', height: '100%',display:'flex',padding:'10px' }}> <div className='content-box' style={{ backgroundColor: '#fff', height: '100%', display: 'flex', padding: '10px' }}>
<div className='lf adcdTreeSelectorBox' style={{height:'calc(100vh - 110px)',width:'260px'}}> <div className='lf adcdTreeSelectorBox' style={{ height: 'calc(100vh - 110px)', width: '260px' }}>
<ListSelect <ListSelect
setAdcd={setCode} setAdcd={setCode}
listData={dmList} listData={dmList}
/> />
</div> </div>
<div className='AdcdTreeTableBox' style={{width:'calc(100vw - 625px)'}}> <div className='AdcdTreeTableBox' style={{ width: 'calc(100vw - 625px)' }}>
<Card <Card
className='nonebox' className='nonebox'
// onMouseOver={() => { // onMouseOver={() => {
// clearInterval(timer) // clearInterval(timer)
// }} // }}
> >
<ToolBar <ToolBar
setSearchVal={setSearchVal} setSearchVal={setSearchVal}
exportFile={exportExcel} exportFile={exportExcel}
setSwiper={setSwiper} setSwiper={setSwiper}
role={role} role={role}
/> />
</Card> </Card>
<div className="ant-card-body" style={{ padding: "20px 0 0 0",overflow:"hidden" }}> {
!loading ? <div className="ant-card-body" style={{ padding: "20px 0 0 0", overflow: "hidden" }}>
<div className='body-top' style={{ height: 380, width: "100%", marginTop: 10 }} >
<Rnd <div style={{ height: 420, width: "100%",overflow:'hidden',position:'relative' }} >
default={{ <Rnd
default={{
x: 0, x: 0,
y: 0, y: 0,
width: '68%', width: 1305,
height: 380 height: 380
}} }}
// style={{position:"relative"}} >
<div id="img">
> <div style={{ textAlign: "center", marginBottom: 10, fontSize: 20 }}>断面名称:{dmList.find(s => s.id == code)?.projNm}</div>
<div id="img"> <ReactEcharts
<div style={{ textAlign: "center", marginBottom: 10,fontSize:20 }}>断面名称:{ dmList.find(s => s.id == code)?.projNm}</div> option={jrxOptions}
{/* <div style={{ position: "absolute", top: -38, right: 131,cursor:"pointer",fontWeight:700 }}> style={{ width: "100%", height: 380 }}
<div notMerge={true}
style={{ padding: "0px 8px", border: "1px solid #dfdfdf", textAlign: "center" }}
title='放大'
onClick={zoomIn}
>
+
</div>
<div
style={{ padding: "0px 8px", border: "1px solid #dfdfdf", marginTop: 5, textAlign: "center" }}
title='缩小'
onClick={zoomOut}
>
-
</div>
</div> */}
<ReactEcharts
option={jrxOptions}
style={{ width: "100%", height: 380 }}
notMerge={true}
ref={echartsRef} ref={echartsRef}
/>
/> </div>
</div> </Rnd>
</Rnd> </div>
</div> <div className='body-top' style={{ marginTop: 30 }}>
<div className='body-top' style={{marginTop:60}}> <Table
<Table columns={columns1}
columns={columns1} key="inx"
key="inx" dataSource={dataSources}
dataSource={dataSources} pagination={false}
pagination={false} scroll={{ x: width, y: 250, scrollToFirstRowOnChange: true }}
scroll={{ x: width, y: 250, scrollToFirstRowOnChange: true }} onRow={record => {
onRow={record => { return {
return { onClick: () => { echartsRef.current.getEchartsInstance().setOption(jrxOption(record, dbType,dbType1)) }
onClick:() => {echartsRef.current.getEchartsInstance().setOption(jrxOption(record,dbType))} }
} }}
}}
/> />
</div> </div>
</div> </div> :
</div> <Spin size='large' style={{width:'100%',margin:'300px auto'}}></Spin>
</div> }
)
</div>
</div>
)
} }

View File

@ -1,312 +1,268 @@
export default function jrxOptions(data = {}, type = "1") { export default function jrxOptions(data = {}, type = "1",typeName='1') {
// const yMin = type == "1" ? 147 : type == "2" ? 146 : 146; // debugger
// const yMax = type == "1" ? 209 : type == "2" ? 210 : 210; const yMin = type == "3" ? 70 : type == "2" ? 67 :
const yMin = type == "1" ? 70 : type == "2" ? 70 : 70; type == '1' ? 59 : 70;
const yMax = type == "1" ? 154 : type == "2" ? 150 : 150; const yMax = type == "3" ? 129 : type == "2" ? 117
const type1 = ["SY05", "SY06", "SY07", "SY08"] : type == "1" ? 118 : 150;
const type2 = ["SY09","SY10","SY11","SY12"] const type1 = ["SY01", "SY04", "SY07", "SY16"];
const alltype = type == "1" ? type1 : type == "2" ? type2 : type2; const type2 = ["SY10", "SY13"];
const type3 = ["SY02", "SY05", "SY08", "SY17"];
// 字体颜色 const type4 = ["SY11", "SY14"];
const textColor = '#666' const type5 = ["SY03", "SY06", "SY09"];
const imageUrl060 = `${process.env.PUBLIC_URL}/assets/images/060.png ` const type6 = ["SY12", "SY15"];
const imageUrl090 = `${process.env.PUBLIC_URL}/assets/images/090.png ` const alltype = typeName == "1" ? type1 :
const imageUrl = type == "1" ? imageUrl060 : typeName == "2" ? type2 :
type == "2" ? imageUrl090 : imageUrl090; typeName == "3" ? type3 :
const rule = `${process.env.PUBLIC_URL}/assets/images/ruler.png ` typeName == "4" ? type4 :
// const xValue = type == "1" ? (((data?.rz - 169) + 0.75 * 14) / 0.75): typeName == "5" ? type5 :
// type == "2" ? (((data?.rz - 169) + 0.85 * 14) / 0.85) : (((data?.rz - 169) + 0.85 * 14) / 0.85) typeName == "6" ? type6 :[]
;
const xValue = type == "1" ? (((data?.rz - 99) + 1.1 * 13) / 1.1):
type == "2" ? (((data?.rz - 99) + 1 * 14) / 1) : (((data?.rz - 99) + 1 * 14) / 1) // 字体颜色
const textColor = '#666'
const imageUrl370 = `${process.env.PUBLIC_URL}/assets/images/zb370.png `
const imageUrl250 = `${process.env.PUBLIC_URL}/assets/images/zb250.png `
const imageUrl130 = `${process.env.PUBLIC_URL}/assets/images/zb130.png `
const imageUrl = type == "1" ? imageUrl130 :
type == "2" ? imageUrl250 :
type == "3" ? imageUrl370 : imageUrl370
;
const rule = `${process.env.PUBLIC_URL}/assets/images/ruler.png `
// rz 是最上面那条线 rz1是那条贴近坝面的线 xValue求解的是最上面那条线的末尾横坐标
const xValue = type == "3" ? (((data?.rz - 86) + 0.6 * 5) / 0.6) :
type == "2" ? (((data?.rz - 87) + 0.63 * 7) / 0.63) :
type == "1" ? (((data?.rz - 88) + 0.7 * 10) / 0.7) :
(((data?.rz - 99) + 1 * 14) / 1)
const rz = data?.rz ? const rz = data?.rz ?
[[xValue, data?.rz], [0, data?.rz], ] : [[xValue, data?.rz], [0, data?.rz],] :
[] []
const rz1 = data?.rz ? const rz1 = data?.rz ?
type == "1" ? type == "3" ?
[[0, 99], [13, 99], [xValue, data?.rz]]: [[0, 86], [5, 86], [xValue, data?.rz]] :
type == "2" ? type == "2" ?
[[0, 99], [14, 99], [xValue, data?.rz]] [[0, 87], [7, 87], [xValue, data?.rz]]
: [[0, 99], [14, 99], [xValue, data?.rz]] :
: type == "1" ?
[[0, 88], [10, 88], [xValue, data?.rz]]
:
[[0, 99], [14, 99], [xValue, data?.rz]]
:
[] []
// gz1、gz2、gz3、gz4分别为渗压管
const gz1 = data[alltype[0]] ? const gz1 = data[alltype[0]] ?
type == "1" ? [[51.6, 85], [51.6, data[alltype[0]]]] : type == "3" ? [[47, 101], [47, data[alltype[0]]]] :
type == "2" ? [[47.5, 85], [47.5, data[alltype[0]]]] : type == "2" ? [[45.5, 98], [45.5, data[alltype[0]]]] :
type == "1" ? [[44, 83], [44, data[alltype[0]]]] :
[[47.5, 158], [85, data[alltype[0]]]] [[47.5, 158], [85, data[alltype[0]]]]
: []; : [];
// const gz1 = [[51.6, 85],[51.6, 91]];
// const gz2 = [[53.6, 85], [53.6, 94]];
// const gz3 = [[72.5, 90], [72.5, 95]];
// const gz4 = [[84.5, 96], [84.5, 99]];
const gz2 = data[alltype[1]] ? const gz2 = data[alltype[1]] ?
type == "1" ? [[53.6, 85], [53.6, data[alltype[1]]]] : type == "3" ? [[51, 101], [51, data[alltype[1]]]] :
type == "2" ? [[49.5, 85], [49.5, data[alltype[1]]]] : type == "2" ? [[50, 98], [50, data[alltype[1]]]] :
[[53.6, 158], [53.6, data[alltype[1]]]] : type == "1" ? [[51.5, 82], [51.5, data[alltype[1]]]] :
[[53.6, 158], [53.6, data[alltype[1]]]] :
[]; [];
const gz3 = data[alltype[2]] ? const gz3 = data[alltype[2]] ?
type == "1" ? [[72.5, 90], [72.5, data[alltype[2]]]] : type == "3" ? [[58.5, 95], [58.5, data[alltype[2]]]] :
type == "2" ? [[66.5, 90], [66.5, data[alltype[2]]]] : type == "2" ? [[58, 92], [58, data[alltype[2]]]] :
type == "1" ? [[58, 81], [58, data[alltype[2]]]] :
[[73, 161], [73, data[alltype[2]]]] : []; [[73, 161], [73, data[alltype[2]]]] : [];
const gz4 = data[alltype[3]] ? const gz4 = data[alltype[3]] ?
type == "1" ? [[84.5, 96], [84.5, data[alltype[3]]]] : type == "3" ? [] :
type == "2" ? [[77, 96], [77, data[alltype[3]]]] : type == "2" ? [[77, 82], [77, data[alltype[3]]]] :
type == "1" ? [[79, 78], [79, data[alltype[3]]]] :
[[85, 166], [85, data[alltype[3]]]] : []; [[85, 166], [85, data[alltype[3]]]] : [];
// 将渗压管连起来的线
const line = data?.rz ? const line = data?.rz ?
type == "1" ? type == "3" ?
[ [
[xValue, data?.rz], [xValue, data?.rz],
[51.6, data[alltype[0]]], [47, data[alltype[0]]],
[53.6, data[alltype[1]]], [51, data[alltype[1]]],
[72.5, data[alltype[2]]], [58.5, data[alltype[2]]],
[84.5, data[alltype[3]]]
] : ] :
type == "2" ? type == "2" ?
[ [
[xValue, data?.rz], [xValue, data?.rz],
[47.5, data[alltype[0]]], [45.5, data[alltype[0]]],
[49.5, data[alltype[1]]], [50, data[alltype[1]]],
[66.5, data[alltype[2]]], [58, data[alltype[2]]],
[77, data[alltype[3]]] [77, data[alltype[3]]]
] : ] :
type == "1"?
[
[xValue, data?.rz],
[44, data[alltype[0]]],
[51.5, data[alltype[1]]],
[58, data[alltype[2]]],
[79, data[alltype[3]]]
]:
[ [
[xValue, data?.rz], [xValue, data?.rz],
[51.6, data[alltype[0]]], [51.6, data[alltype[0]]],
[53.6, data[alltype[1]]], [53.6, data[alltype[1]]],
[73, data[alltype[2]]], [73, data[alltype[2]]],
[85, data[alltype[3]]] [85, data[alltype[3]]]
] ]
: [] : []
return { return {
toolbox: { toolbox: {
show: true, show: true,
feature: { feature: {
saveAsImage: { saveAsImage: {
show: true, show: true,
excludeComponents: ['toolbox'], excludeComponents: ['toolbox'],
pixelRatio: 2, pixelRatio: 2,
name:"测值图" name: "测值图"
}, },
}, },
right: "10%", right: "10%",
top:"4%" top: "4%"
}, },
// title: { // title: {
// show: true, // show: true,
// text: "断面名称", // text: "断面名称",
// left: 'center', // left: 'center',
// bottom: '-5%', // bottom: '-5%',
// // textStyle: { // // textStyle: {
// }, // },
graphic: [ graphic: [
{ {
type: 'image', type: 'image',
// id: 'background', // id: 'background',
left: 'center', left: 'center',
// top: '11%', // top: '11%',
top: 0, top: 0,
bottom:0, bottom: 0,
z: 1,
bounding: 'all',
style: {
image: imageUrl,
width: 1100,
height: 380
}
},
{
type: 'image',
// id: 'background',
left: '7%',
bottom:"5%",
z: 1, z: 1,
bounding: 'all', bounding: 'all',
style: { style: {
image: rule, image: imageUrl,
width: 10, width: 1100,
height: 450 height: 380
} }
} },
{
type: 'image',
// id: 'background',
left: '7%',
bottom: "5%",
z: 1,
bounding: 'all',
style: {
image: rule,
width: 10,
height: 450
}
}
], ],
grid: { grid: {
// top: '10%', // top: '10%',
// left: '2%', // left: '2%',
// right: '5%', // right: '5%',
// bottom: '10%', // bottom: '10%',
// containLabel: true // containLabel: true
top: '0%', top: '0%',
left: '2%', left: '2%',
right: '5%', right: '5%',
bottom: '0%', bottom: '0%',
containLabel: true containLabel: true
},
xAxis: {
min: 0,
max:100,
axisLabel: {
show:false,
// 坐标轴字体颜色
color: textColor,
fontSize: 18
}, },
axisLine: { xAxis: {
show:false, min: 0,
lineStyle: { max: 100,
color: textColor axisLabel: {
} show: false,
}, // 坐标轴字体颜色
axisTick: { color: textColor,
// y轴刻度线 fontSize: 18
show: false
},
splitLine: {
// 网格
show: false
},
boundaryGap: false
},
yAxis: {
type: 'value',
min: yMin,
max: yMax,
interval:5,
// data:[155,160,180,190,210],
nameTextStyle: {
color: '#333',
fontSize: 18,
padding: [0, 0, 0, 80]
},
axisLabel: {
// 坐标轴字体颜色
color: textColor,
fontSize: 18,
formatter: function (value, index,i) {
if (index === 0 || value === yMax) {
return ''; // 隐藏第一个刻度和最后一个刻度
} else {
return value; // 显示其他刻度
}
}
},
axisLine: {
show: false
},
axisTick: {
// y轴刻度线
show: false
},
splitLine: {
// 网格
show: false,
lineStyle: {
color: '#CCCCCC',
type: 'dashed'
}
}
},
series: [
// 和大坝坡面重合的线 斜率为0.75
{
type: 'line',
symbol: 'none',
symbolSize: 10,
z: 1,
itemStyle: {
color: '#fff'
}, },
lineStyle: { axisLine: {
color: '#fff' show: false,
}, lineStyle: {
areaStyle: { color: textColor
origin: "end",
color: 'rgba(0, 128, 255, 0.3)' // 设置区域填充颜色
},
data:[...rz,...rz1]
},
{
type: 'line',
symbol: 'none',
symbolSize: 10,
z: 1,
itemStyle: {
color: '#5487FF'
},
lineStyle: {
color: '#5487FF'
},
markPoint: {
data: [{ type: 'max',x:"20%", coord: [xValue, data?.rz] }],
symbol: 'pin',
symbolSize: [30, 10],
itemStyle: {
color: '#fff', // 标注点颜色
borderColor: '#ffa500', // 标注点边框颜色
borderWidth: 0 // 标注点边框宽度
},
label: {
show: data?.rz ? true : false, // 是否显示标签
formatter: "库水位" +data?.rz + "m", // 标签格式
color: '#5487FF', // 标签文字颜色
fontSize: 12, // 标签文字大小
} }
},
data:rz
},
{
type: 'line',
symbol: 'none',
symbolSize: 10,
z: 1,
itemStyle: {
color: '#5487FF'
}, },
lineStyle: { axisTick: {
color: '#5487FF' // y轴刻度线
show: false
}, },
data:rz1 splitLine: {
}, // 网格
// 管位 show: false
{ },
type: 'line', boundaryGap: false
symbol: 'none', },
symbolSize: 10, yAxis: {
z: 1, type: 'value',
itemStyle: { min:yMin,
color: '#5487FF' max: yMax,
}, interval: 5,
lineStyle: { // data:[155,160,180,190,210],
color: '#5487FF', nameTextStyle: {
width:6 color: '#333',
}, fontSize: 18,
data: gz1 padding: [0, 0, 0, 80]
}, },
{ axisLabel: {
type: 'line', // 坐标轴字体颜色
symbol: 'none', color: textColor,
symbolSize: 10, fontSize: 18,
z: 1, formatter: function (value, index, i) {
itemStyle: { if (index === 0 || value === yMax) {
color: '#5487FF' return ''; // 隐藏第一个刻度和最后一个刻度
}, } else {
lineStyle: { return value; // 显示其他刻度
color: '#5487FF', }
width:6 }
}, },
data: gz2 axisLine: {
}, show: false
{ },
axisTick: {
// y轴刻度线
show: false
},
splitLine: {
// 网格
show: true,
lineStyle: {
color: '#CCCCCC',
type: 'dashed'
}
}
},
series: [
// 和大坝坡面重合的线 斜率为0.75
{
type: 'line',
symbol: 'none',
symbolSize: 10,
z: 1,
itemStyle: {
color: '#fff'
},
lineStyle: {
color: '#fff'
},
areaStyle: {
origin: "end",
color: 'rgba(0, 128, 255, 0.3)' // 设置区域填充颜色
},
data: [...rz, ...rz1]
},
{
type: 'line', type: 'line',
symbol: 'none', symbol: 'none',
symbolSize: 10, symbolSize: 10,
@ -315,12 +271,84 @@ return {
color: '#5487FF' color: '#5487FF'
}, },
lineStyle: { lineStyle: {
color: '#5487FF', color: '#5487FF'
width:6 },
markPoint: {
data: [{ type: 'max', x: "20%", coord: [xValue, data?.rz] }],
symbol: 'pin',
symbolSize: [30, 10],
itemStyle: {
color: '#fff', // 标注点颜色
borderColor: '#ffa500', // 标注点边框颜色
borderWidth: 0 // 标注点边框宽度
},
label: {
show: data?.rz ? true : false, // 是否显示标签
formatter: "库水位" + data?.rz + "m", // 标签格式
color: '#5487FF', // 标签文字颜色
fontSize: 12, // 标签文字大小
}
},
data: rz
},
{
type: 'line',
symbol: 'none',
symbolSize: 10,
z: 1,
itemStyle: {
color: '#5487FF'
},
lineStyle: {
color: '#5487FF'
},
data: rz1
},
// 管位
{
type: 'line',
symbol: 'none',
symbolSize: 10,
z: 1,
itemStyle: {
color: '#5487FF'
},
lineStyle: {
color: '#5487FF',
width: 6
},
data: gz1
},
{
type: 'line',
symbol: 'none',
symbolSize: 10,
z: 1,
itemStyle: {
color: '#5487FF'
},
lineStyle: {
color: '#5487FF',
width: 6
},
data: gz2
},
{
type: 'line',
symbol: 'none',
symbolSize: 10,
z: 1,
itemStyle: {
color: '#5487FF'
},
lineStyle: {
color: '#5487FF',
width: 6
}, },
data: gz3 data: gz3
}, },
{ {
type: 'line', type: 'line',
symbol: 'none', symbol: 'none',
symbolSize: 10, symbolSize: 10,
@ -329,13 +357,13 @@ return {
color: '#5487FF' color: '#5487FF'
}, },
lineStyle: { lineStyle: {
color: '#5487FF', color: '#5487FF',
width:6 width: 6
}, },
data: gz4 data: gz4
}, },
// 管位连接线 // 管位连接线
{ {
type: 'line', type: 'line',
symbol: 'none', symbol: 'none',
symbolSize: 10, symbolSize: 10,
@ -344,11 +372,11 @@ return {
color: '#5487FF' color: '#5487FF'
}, },
lineStyle: { lineStyle: {
color: '#5487FF', color: '#5487FF',
}, },
data: line data: line
}, },
] ]
}; };
} }

View File

@ -1,6 +1,6 @@
import React, { Fragment, useRef, useMemo,useEffect,useState } from 'react'; import React, { Fragment, useRef, useMemo,useEffect,useState } from 'react';
import BasicCrudModal from '../../../../components/crud/BasicCrudModal'; 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 {FileWordOutlined,FilePdfOutlined,FileZipOutlined,FileExcelOutlined } from '@ant-design/icons';
import { useSelector } from 'react-redux'; import { useSelector } from 'react-redux';
import ToolBar from './toolbar'; import ToolBar from './toolbar';
@ -8,14 +8,22 @@ import ModalForm from './form';
import apiurl from '../../../../service/apiurl'; import apiurl from '../../../../service/apiurl';
import usePageTable from '../../../../components/crud/usePageTable2'; import usePageTable from '../../../../components/crud/usePageTable2';
import { createCrudService } from '../../../../components/crud/_'; import { createCrudService } from '../../../../components/crud/_';
import { httppost2 } from '../../../../utils/request';
import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender'; import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
import './index.less';
const url = "http://223.75.53.141:9102/test.by-lyf.tmp" const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const Page = () => { const Page = () => {
const role = useSelector(state => state.auth.role); const role = useSelector(state => state.auth.role);
const editBtn = role?.rule?.find(item => item.menuName == "编辑") || true; const editBtn = role?.rule?.find(item => item.menuName == "编辑") || true;
const viewBtn = 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 = { const surveyType = {
1: "日常检查排查", 1: "日常检查排查",
2: "定期普查", 2: "定期普查",
@ -33,40 +41,81 @@ const Page = () => {
} }
const refModal = useRef(); const refModal = useRef();
const [searchVal, setSearchVal] = useState({}) const [searchVal, setSearchVal] = useState({})
const columns = [ const [count, setCount] = useState({})
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" }, // const columns = [
{title: '填报日期', key: 'reportDate', dataIndex: 'reportDate', width: 140,}, // { 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) => <span>{value ? surveyType[value] : ''}</span> // title: '普查类型', key: 'surveyType', dataIndex: 'surveyType', width: 200,
}, // render: (value) => <span>{value ? surveyType[value] : ''}</span>
{ // },
title: '普查方式', key: 'surveyWay', dataIndex: 'surveyWay', width: 200, // {
render: (value) => <span>{value ? surveyWay[value] : ''}</span> // title: '普查方式', key: 'surveyWay', dataIndex: 'surveyWay', width: 200,
// render: (value) => <span>{value ? surveyWay[value] : ''}</span>
// },
// {
// title: '危害情况', key: 'isHarm', dataIndex: 'isHarm', width: 200,
// render: (value, row) =>(
// <span style={row.harmNum > 0 ? { color: "red" } : {}}>{isHarm[row.harmNum > 0 ? 1 : 0]}</span>)
// },
// {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) => (
// <CrudOpRender_text
// edit={editBtn ? true : false}
// del={delBtn ? true : false}
// view={viewBtn ? true : false}
// command={(cmd) => () => command(cmd)(row)} />)
// },
// ];
const columns = [
{
title: '监测时间',
dataIndex: 'reportDate',
key: 'reportDate',
width: 180,
align:'center'
}, },
{ {
title: '危害情况', key: 'isHarm', dataIndex: 'isHarm', width: 200, title: '测点编号',
render: (value, row) =>( dataIndex: 'pileNumber',
<span style={row.harmNum > 0 ? { color: "red" } : {}}>{isHarm[row.harmNum > 0 ? 1 : 0]}</span>) key: 'pileNumber',
width: 120,
align:'center'
}, },
{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', title: '有无白蚁',
render: (value, row, index) => ( dataIndex: 'isHarm',
<CrudOpRender_text align:'center',
edit={editBtn ? true : false} key: 'isHarm',
del={delBtn ? true : false} width: 100,
view={viewBtn ? true : false} render:(text, record) => {
command={(cmd) => () => command(cmd)(row)} />) // 如果 isHarm 为 null 或 undefined显示无
}, if (text == null) {
return <Tag color="#04d919" style={{borderRadius: '50%', padding: '4px 8px'}}></Tag>;
}
// 如果 isHandle 为 null 或 undefined当作 false 处理
const isHandle = record.isHandle ?? false;
return (
<Tag
color={text ? (isHandle ? '#04d919' : '#d9001b') : '#04d919'}
style={{borderRadius: '50%', padding: '4px 8px'}}
>
{text ? (isHandle ? '无' : '有') : '无'}
</Tag>
);
}
}
]; ];
const width = useMemo(() => columns.reduce((total, cur) => total + (cur.width), 0), [columns]); const width = useMemo(() => columns.reduce((total, cur) => total + (cur.width), 0), [columns]);
const command = (type) => (params) => { const command = (type) => (params) => {
if (type === 'save') { if (type === 'save') {
refModal.current.showSave(); refModal.current.showSave();
@ -88,7 +137,27 @@ const Page = () => {
*/ */
const successCallback = () => { const successCallback = () => {
refresh() refresh()
} }
// 获取白蚁统计数量
const getCount = async () => {
const params = {
pageSo: {
pageNumber: 1,
pageSize: 99999,
}
}
try {
const res = await httppost2(apiurl.rcgl.byfz.bypc.count, params);
setCount(res.data);
} catch (error) {
console.log(error);
}
}
useEffect(() => {
getCount();
}, [])
useEffect(() => { useEffect(() => {
if (searchVal) { if (searchVal) {
const params = { const params = {
@ -104,12 +173,50 @@ const Page = () => {
return ( return (
<> <>
<div className='content-root clearFloat xybm' style={{paddingRight:"0",paddingBottom:"0"}}> <div className='content-root clearFloat xybm' style={{paddingRight:"0",paddingBottom:"0"}}>
<div className='lf CrudAdcdTreeTableBox' style={{width:"100%",overflowY:"auto"}}> <div className='lf CrudAdcdTreeTableBox' style={{ width: "100%" }}>
<Row gutter={16} className='statsRow'>
<Col span={6}>
<div className='statItem'>
<div className='valueWrapper'>
<span className='number' style={{ color: '#722ed1' }}>{count.totalPoint}</span>
<span className="unit"></span>
</div>
<span className='label'>总监测点数</span>
</div>
</Col>
<Col span={6}>
<div className='statItem'>
<div className='valueWrapper'>
<span className='number' style={{ color: '#f5222d' }}>{count.hasAnt}</span>
<span className="unit"></span>
</div>
<span className='label'>有白蚁</span>
</div>
</Col>
<Col span={6}>
<div className='statItem'>
<div className='valueWrapper'>
<span className='number' style={{ color: '#52c41a' }}>{count.notAnt}</span>
<span className="unit"></span>
</div>
<span className='label'>无白蚁</span>
</div>
</Col>
<Col span={6}>
<div className='statItem'>
<div className='valueWrapper'>
<span className='number' style={{ color: '#8c8c8c' }}>{count.noData}</span>
<span className="unit"></span>
</div>
<span className='label'>无数据</span>
</div>
</Col>
</Row>
<Card className='nonebox'> <Card className='nonebox'>
<ToolBar <ToolBar
setSearchVal={setSearchVal} setSearchVal={setSearchVal}
onSave={command('save')} // onSave={command('save')}
role={role} // role={role}
/> />
</Card> </Card>
<div className="ant-card-body" style={{ padding: "20px 0 0 0" }}> <div className="ant-card-body" style={{ padding: "20px 0 0 0" }}>

View File

@ -1,30 +1,33 @@
.basic-info{ .statsRow {
position: relative; display: flex;
font-size: 16px; justify-content: space-between;
margin-bottom: 20px; margin-bottom: 24px;
padding:5px 25px; padding: 16px;
border-bottom: 1px solid #eee;
&::before{ .statItem {
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{
display: flex; display: flex;
// align-items: center; flex-direction: column;
column-gap: 20px; text-align: center;
.item-right{ align-items: center;
flex:1 .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;
}
}
} }

View File

@ -5,17 +5,17 @@ import moment from 'moment';
import NormalSelect from '../../../../components/Form/NormalSelect'; import NormalSelect from '../../../../components/Form/NormalSelect';
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => { const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
const addBtn = 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 searchBtn = role?.rule?.find(item => item.menuName == "查询")|| true;
const [form] = Form.useForm(); const [form] = Form.useForm();
const onFinish = (values) => { const onFinish = (values) => {
let dateSo; let dateSo;
if (values.year) { if (values.year) {
dateSo = moment(values.year).format('YYYY') dateSo = moment(values.year).format('YYYY-MM-DD')
} }
delete values.year delete values.year
setSearchVal({...values, year:Number(dateSo)}); setSearchVal({...values, searchDate:dateSo});
} }
// useEffect(() => { // useEffect(() => {
@ -31,29 +31,27 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
<> <>
<div style={{display:'flex',justifyContent:'space-between'}}> <div style={{display:'flex',justifyContent:'space-between'}}>
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}> <Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
<Form.Item label="年份" name="year"> <Form.Item label="监测日期" name="year">
<DatePicker <DatePicker
allowClear allowClear
style={{ width: "150px" }} style={{ width: "240px" }}
picker="year"
/> />
</Form.Item> </Form.Item>
<Form.Item label="危害情况" name="isHarm"> <Form.Item label="测点编号" name="pileNumber">
<Input
allowClear
style={{ width: "240px" }}
/>
</Form.Item>
{/* <Form.Item label="" name="isHarm">
<NormalSelect <NormalSelect
allowClear allowClear
style={{ width: '150px' }} style={{ width: '150px' }}
options={[{ label: "无危害 ", value: 0 },{ label: "有危害 ", value: 1 }]} /> options={[{ label: "无危害 ", value: 0 },{ label: "有危害 ", value: 1 }]} />
</Form.Item> </Form.Item> */}
{searchBtn ? <Form.Item> <Form.Item>
<Button type="primary" htmlType="submit">查询</Button> <Button type="primary" htmlType="submit">查询</Button>
</Form.Item> : null } </Form.Item>
{
(onSave && addBtn) ?
<Form.Item>
<Button onClick={onSave}>新增</Button>
</Form.Item>
:null
}
</Form> </Form>
</div> </div>
</> </>

View File

@ -425,7 +425,7 @@ console.log(record);
<Col span={24}> <Col span={24}>
<Form.Item <Form.Item
label="处理描述" label="处理描述"
name="itemProblemDesc" name="handleDesc"
labelCol={{ span: 3 }} labelCol={{ span: 3 }}
wrapperCol={{ span: 19 }} wrapperCol={{ span: 19 }}
> >

View File

@ -20,9 +20,9 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
const [itemParams, setItemParams] = useState([]) const [itemParams, setItemParams] = useState([])
const [list, setList] = useState([]) const [list, setList] = useState([])
const taskTypes = [ const taskTypes = [
{label:"日常巡查",value:0}, {label:"日常巡查",value:1},
{label:"特别检查",value:1}, {label:"特别检查",value:2},
{label:"汛前巡检",value:2}, {label:"汛前巡检",value:3},
] ]
const [form] = Form.useForm(); const [form] = Form.useForm();

View File

@ -268,7 +268,7 @@ console.log(record);
> >
<Row gutter={[16]}> <Row gutter={[16]}>
{ {
handleImgfileList.length > 0 && handleImgfileList.map(file => { handleImgfileList?.length > 0 && handleImgfileList.map(file => {
return ( return (
<Col span={12}> <Col span={12}>
<div className={mode == "view" ? 'file-item view-file' : 'file-item'} > <div className={mode == "view" ? 'file-item view-file' : 'file-item'} >
@ -295,7 +295,7 @@ console.log(record);
> >
<Row gutter={[16]}> <Row gutter={[16]}>
{ {
handleVideoFileList.length > 0 && handleVideoFileList.map(file => { handleVideoFileList?.length > 0 && handleVideoFileList.map(file => {
return ( return (
<Col span={12}> <Col span={12}>
<div className={mode == "view" ? 'file-item view-file' : 'file-item'} > <div className={mode == "view" ? 'file-item view-file' : 'file-item'} >

View File

@ -74,6 +74,9 @@ const AdcdTreeSelector: React.FC<IProps> = ({ onSelectFun, setAdcd, showCheckbox
setTreeData(adcdTreedata); setTreeData(adcdTreedata);
setLoading(false); setLoading(false);
setOrderMax(Math.max(...adcdTreedata.map((item:any) => item?.orderIndex))) setOrderMax(Math.max(...adcdTreedata.map((item:any) => item?.orderIndex)))
} else {
setLoading(false);
setTreeData([]);
} }
}; };
// @ts-ignore // @ts-ignore

View File

@ -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) => <span>{i + 1}</span>
},
{
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 (
<div>
<Card className='nonebox'>
<ModalToolBar
setSearchVal={setSearchVal}
exportFile={exportExcel}
/>
</Card>
<div className="ant-card-body" style={{ padding: "20px 0 0 0" }}>
<Table columns={columns} rowKey="inx" dataSource={[]} />
</div>
</div>
)
}

View File

@ -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 (
<>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish} onValuesChange={onValuesChange}>
<Form.Item label="闸门名称" name="maintainType">
<NormalSelect allowClear style={{ width: '150px' }} options={types} />
</Form.Item>
<Form.Item label="日期范围" name="tm">
<RangePicker
allowClear
style={{ width: "220px" }}
format="YYYY-MM-DD"
/>
</Form.Item>
<Form.Item label="常用时段" name="ranger">
<NormalSelect
allowClear
style={{ width: "100px" }}
options={optionsType}
/>
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit">查询</Button>
</Form.Item>
<Form.Item>
<Button onClick={() => form.resetFields()}>重置</Button>
</Form.Item>
<Form.Item>
<Button onClick={() => exportFile()}>导出</Button>
</Form.Item>
</Form>
</div>
</>
);
}
export default ToolBar;

View File

@ -1,5 +1,6 @@
import React, { useEffect, useMemo, useState } from 'react' 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 { Stage } from 'react-konva';
import Sider from './Sider'; import Sider from './Sider';
import Topper1 from './Topper1'; import Topper1 from './Topper1';
@ -11,11 +12,12 @@ import HFivePlayer from '../../../components/video1Plary'
import './index.less'; import './index.less';
import { httpget, httpget2, httppost2 } from '../../../utils/request'; import { httpget, httpget2, httppost2 } from '../../../utils/request';
import apiurl from '../../../service/apiurl'; import apiurl from '../../../service/apiurl';
import ModalContent from './ModalContent';
const url = "http://223.75.53.141:9102/test.by-lyf.tmp" const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const CanvasW = 1080 const CanvasW = 1080
const CanvasH = 640 const CanvasH = 640
// const waterRatio = 0 // const waterRatio = 0
const zmobj ={ const zmobj = {
"hpCode": "HP0074208040002120", "hpCode": "HP0074208040002120",
"stcd": "4265630075", "stcd": "4265630075",
"ctrlType": "PLC", "ctrlType": "PLC",
@ -44,84 +46,11 @@ const zmobj ={
"lgtd": 112.242945, "lgtd": 112.242945,
"lttd": 30.848166, "lttd": 30.848166,
"runtime": [ "runtime": [
null, 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,
{
"stcd": "4265630075", "stcd": "4265630075",
"gateNumber": 1, "gateNumber": 1,
"realAperture": 976, "realAperture": 376,
"setAperture": 0, "setAperture": 0,
"sensorLever": null, "sensorLever": null,
"altitudeLever": null, "altitudeLever": null,
@ -132,9 +61,10 @@ const runtime = [
"errorSignal": 0, "errorSignal": 0,
"openedSignal": 0, "openedSignal": 0,
"closedSignal": 0, "closedSignal": 0,
"tm": "2024-09-25 20:03:31" "tm": "2024-09-25 20:03:26",
}, "_online": true
{ },
{
"stcd": "4265630075", "stcd": "4265630075",
"gateNumber": 2, "gateNumber": 2,
"realAperture": 388, "realAperture": 388,
@ -148,9 +78,10 @@ const runtime = [
"errorSignal": 0, "errorSignal": 0,
"openedSignal": 0, "openedSignal": 0,
"closedSignal": 0, "closedSignal": 0,
"tm": "2024-09-25 20:03:31" "tm": "2024-09-25 20:03:26",
}, "_online": true
{ },
{
"stcd": "4265630075", "stcd": "4265630075",
"gateNumber": 3, "gateNumber": 3,
"realAperture": 394, "realAperture": 394,
@ -164,24 +95,154 @@ const runtime = [
"errorSignal": 0, "errorSignal": 0,
"openedSignal": 0, "openedSignal": 0,
"closedSignal": 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 = { const myType = {
// 闸前水位站 2闸后水位站 3流量站 // 闸前水位站 2闸后水位站 3流量站
'1':'闸前水位/水深(m)', '1': '闸前水位/水深(m)',
'2':'闸后水位/水深(m)', '2': '闸后水位/水深(m)',
'3':'流量 (m³/s)', '3': '流量 (m³/s)',
} }
const Page = () => { const Page = () => {
const [itemIndex,setItemIndex] = useState(null)
const [waterRatio,setWaterRatio] = useState(0) const jcColumns = [
const [data,setData] = useState({}) {
const [list, setList ] = useState([]) title: '项目',
const [damList, setDamList ] = useState([]) key: 'project',
const [videoList, setVideoList ] = useState([]) 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 [videoArr, setvideoArr] = useState({})
const [open, setOpen] = useState(false) const [open, setOpen] = useState(false)
@ -191,42 +252,42 @@ const Page = () => {
const pts = contextCoordinates(xunit, hole); const pts = contextCoordinates(xunit, hole);
const eqpnoList = useMemo(() => damList ? new Array(damList.length).fill(0).map((o, index) => index) : [], [damList]); const eqpnoList = useMemo(() => damList ? new Array(damList.length).fill(0).map((o, index) => index) : [], [damList]);
useEffect(()=>{ useEffect(() => {
getList() getList()
},[]) }, [])
const getList = async()=>{ const getList = async () => {
const {code, data} = await httppost2(apiurl.zmjk.getList) const { code, data } = await httppost2(apiurl.zmjk.getList)
if(code!==200){ if (code !== 200) {
return return
} }
const obj = data[0]||{} const obj = data[0] || {}
getInformation(obj.gateCode) getInformation(obj.gateCode)
getDamData(obj.stcd) getDamData(obj.stcd)
getVideo(obj.gateCode) getVideo(obj.gateCode)
setData(obj) setData(obj)
} }
const getInformation = async(gateCode)=>{ const getInformation = async (gateCode) => {
const {code, data} = await httpget2(apiurl.zmjk.getInformation,{gateCode}) const { code, data } = await httpget2(apiurl.zmjk.getInformation, { gateCode })
if(code!==200){ if (code !== 200) {
return return
} }
data.map((item)=>{ data.map((item) => {
if(item.type===2){ if (item.type === 2) {
setWaterRatio(item.value/5||0) setWaterRatio(item.value / 5 || 0)
} }
}) })
setList(data) setList(data)
} }
const getDamData = async(stcd)=>{ const getDamData = async (stcd) => {
const {code, data} = await httpget2(apiurl.zmjk.getDamData,{stcd}) const { code, data } = await httpget2(apiurl.zmjk.getDamData, { stcd })
if(code!==200){ if (code !== 200) {
return return
} }
const list = [] const list = []
data.map((item)=>{ data.map((item) => {
list.push({ list.push({
...item ...item
}) })
@ -234,38 +295,71 @@ const Page = () => {
setDamList(list) setDamList(list)
} }
const getVideo = async(valveCode)=>{ const getVideo = async (valveCode) => {
const {code, data} = await httppost2(apiurl.zmjk.getVideo,{valveCode}) const { code, data } = await httppost2(apiurl.zmjk.getVideo, { valveCode })
if(code!==200){ if (code !== 200) {
return return
} }
setVideoList(data) setVideoList(data)
getVideoSrc(data[0]?.indexCode)
} }
const getVideoSrc = async (current) => { const getVideoSrc = async (current) => {
const res = await httpget2(`${apiurl.gsxl.zfzl.videosrc}${current}`)//32023a7f27d8448fa10511f24e96acff const res = await httpget2(`${apiurl.gsxl.zfzl.videosrc}${current}`)//32023a7f27d8448fa10511f24e96acff
if (res.code == 200 && res.data?.length !== 0) { if (res.code == 200 && res.data?.length !== 0) {
setvideoArr({src:res.data}) setvideoArr({ src: res.data })
}else{ } else {
setvideoArr({}) setvideoArr({})
} }
} }
const getNum = (a,b)=>{ const getNum = (a, b) => {
const aa = Number(a||0) const aa = Number(a || 0)
const bb = Number(b||0) const bb = Number(b || 0)
const num = Number(aa-bb).toFixed(3) const num = Number(aa - bb).toFixed(3)
return num return num
} }
return ( return (
<> <>
<div className='content-root clearFloat xybm sg_zmjk' style={{paddingRight:"0",paddingBottom:"0"}}> <div className='content-root clearFloat xybm sg_zmjk' style={{ paddingRight: "0", paddingBottom: "0" }}>
<div className='lf CrudAdcdTreeTableBox' style={{width:"100%",overflowY:"auto"}}> <div className='lf CrudAdcdTreeTableBox' style={{ width: "100%" }}>
{/* <Card className='nonebox'> {/* <Card className='nonebox'>
</Card> */} </Card> */}
<div className="ant-card-body" style={{ padding: "20px 0 0 0" }}> <div className="ant-card-body" style={{ padding: "20px 0 0 0" }}>
<dvi className="sg_zmjk_left"> <div className="sg_zmjk_left">
<div className='sg_zmjk_left_title'>
<Divider type="vertical" style={{ width: 5, background: '#259def', height: 20 }} />
闸阀监控
</div>
<div className='sz_left_up_table'>
<Table
columns={zfColumns}
rowKey={(record) => record.id}
dataSource={[]}
pagination={false}
/>
</div>
<div className='sg_zmjk_left_title' style={{ marginTop: 175,display:'flex',justifyContent:'space-between' }}>
<div><Divider type="vertical" style={{ width: 5, background: '#259def', height: 20 }} />
最近操作记录</div>
<div onClick={() => setOpen(true)}>
<div style={{display:'flex',columnGap:10,cursor:'pointer',fontSize:14,color:'#000',fontWeight:400}}>
<span>查看更多信息</span>
<DoubleRightOutlined />
</div>
</div>
</div>
<div className='sz_left_up_table'>
<Table
columns={jlColumns}
rowKey={(record) => record.id}
dataSource={[]}
pagination={false}
/>
</div>
</div>
{/* <div className="sg_zmjk_left">
<Stage width={1080} height={640}> <Stage width={1080} height={640}>
<Sider pts={pts} side="left" /> <Sider pts={pts} side="left" />
<Sider pts={pts} side="right" /> <Sider pts={pts} side="right" />
@ -302,12 +396,14 @@ const Page = () => {
} }
<div key="sider2" style={{ flexGrow: 1, width: 100 }}></div> <div key="sider2" style={{ flexGrow: 1, width: 100 }}></div>
</div> </div>
</dvi> </div> */}
<dvi className="sg_zmjk_right"> <div className="sg_zmjk_right">
<div className='sg_zmjk_right_video'> <div className='sg_zmjk_right_video'>
<div className='sg_zmjk_right_video_title'>视频监控</div> <div className='sg_zmjk_right_video_title'>
<Divider type="vertical" style={{ width: 5, background: '#259def', height: 20 }} />
监控视频</div>
<div className='sg_zmjk_right_video_content'> <div className='sg_zmjk_right_video_content'>
<div className='sg_zmjk_right_video_content_left'> {/* <div className='sg_zmjk_right_video_content_left'>
{ {
videoList.map((item,index)=>( videoList.map((item,index)=>(
<div className={index===itemIndex?'sg_zmjk_right_video_content_left_item itemChecked':'sg_zmjk_right_video_content_left_item'} onClick={()=>{setItemIndex(index);getVideoSrc(item.indexCode)}}> <div className={index===itemIndex?'sg_zmjk_right_video_content_left_item itemChecked':'sg_zmjk_right_video_content_left_item'} onClick={()=>{setItemIndex(index);getVideoSrc(item.indexCode)}}>
@ -315,20 +411,20 @@ const Page = () => {
</div> </div>
)) ))
} }
</div> </div> */}
<div className='sg_zmjk_right_video_content_right'> <div className='sg_zmjk_right_video_content_right'>
{ {
videoArr?.src && videoArr?.src &&
<div <div
className="content-video" className="content-video"
style={{ width: '100%', height: '100%',cursor: "pointer" }} style={{ width: '100%', height: '100%', cursor: "pointer" }}
onClick={() => { onClick={() => {
// if (controlerParams.type == 1) { // if (controlerParams.type == 1) {
// setVideoOpen(true) // setVideoOpen(true)
// setIsShow(!isShow) // setIsShow(!isShow)
// } // }
}} }}
> >
<HFivePlayer size={1} wsUrl={videoArr} playerID={'111'} /> <HFivePlayer size={1} wsUrl={videoArr} playerID={'111'} />
{/* <div style={{textAlign:"right"}}>注:单击视频显示/隐藏云台</div> */} {/* <div style={{textAlign:"right"}}>注:单击视频显示/隐藏云台</div> */}
</div> </div>
@ -337,9 +433,17 @@ const Page = () => {
</div> </div>
</div> </div>
<div className='sg_zmjk_right_information'> <div className='sg_zmjk_right_information'>
<div className='sg_zmjk_right_information_title'>监测数据</div> <div className='sg_zmjk_right_information_title'>
<div style={{height:'144px',overflowY:'auto',padding:'20px'}}> <Divider type="vertical" style={{ width: 5, background: '#259def', height: 20 }} />
{ 监测数据</div>
<div style={{ width: '100%', marginTop: 10 }}>
<Table
columns={jcColumns}
rowKey={(record) => record.id}
dataSource={[]}
pagination={false}
/>
{/* {
list?.map((item)=>{ list?.map((item)=>{
if(item.type===1){ if(item.type===1){
return ( return (
@ -367,45 +471,46 @@ const Page = () => {
) )
} }
}) })
} } */}
</div> </div>
</div> </div>
<div className='sg_zmjk_right_more' onClick={()=>setOpen(true)}>查看更多信息</div> {/* <div className='sg_zmjk_right_more' onClick={() => setOpen(true)}>查看更多信息</div> */}
</dvi> </div>
</div> </div>
</div> </div>
</div> </div>
<Modal <Modal
open={open} open={open}
width={1000} width={1100}
title="" title="闸门操作记录"
footer={null} footer={null}
onCancel={() => { onCancel={() => {
setOpen(false) setOpen(false)
}} }}
> >
<div style={{height:'600px'}}> <div style={{ height: '600px' }}>
<Tabs> <ModalContent/>
{/* <Tabs>
<Tabs.TabPane tab="基本信息" key="item-1"> <Tabs.TabPane tab="基本信息" key="item-1">
<Descriptions bordered size="small" column={3} > <Descriptions bordered size="small" column={3} >
<Descriptions.Item label="启闭设备类型" style={{ width: '16.5%' }}>{{1:'卷扬式',2:'螺杆式',3:'凹轮式',4:'涡轮式',5:'丝杆式'}?.[data?.hdgrTp]||'-'}</Descriptions.Item> <Descriptions.Item label="启闭设备类型" style={{ width: '16.5%' }}>{{ 1: '卷扬式', 2: '螺杆式', 3: '凹轮式', 4: '涡轮式', 5: '丝杆式' }?.[data?.hdgrTp] || '-'}</Descriptions.Item>
<Descriptions.Item label="动力类型" style={{ width: '16.5%' }}>{{1:'手动',2:'电动',3:'手电两用'}?.[data?.pwrTp]||'-'}</Descriptions.Item> <Descriptions.Item label="动力类型" style={{ width: '16.5%' }}>{{ 1: '手动', 2: '电动', 3: '手电两用' }?.[data?.pwrTp] || '-'}</Descriptions.Item>
<Descriptions.Item label="水闸类型" style={{ width: '16.5%' }}>{{1:'分(泄)洪闸',2:'节制闸',3:'排(退)水闸',4:'引(进)水闸',5:'挡潮闸',6:'船闸',9:'其他'}?.[data?.wagaType]||'-'}</Descriptions.Item> <Descriptions.Item label="水闸类型" style={{ width: '16.5%' }}>{{ 1: '分(泄)洪闸', 2: '节制闸', 3: '排(退)水闸', 4: '引(进)水闸', 5: '挡潮闸', 6: '船闸', 9: '其他' }?.[data?.wagaType] || '-'}</Descriptions.Item>
<Descriptions.Item label="进口高程">{data?.inEle||'-'} m</Descriptions.Item> <Descriptions.Item label="进口高程">{data?.inEle || '-'} m</Descriptions.Item>
<Descriptions.Item label="出口高程">{data?.outEle||'-'} m</Descriptions.Item> <Descriptions.Item label="出口高程">{data?.outEle || '-'} m</Descriptions.Item>
<Descriptions.Item label="闸门孔数">{data?.gaorNum||'-'} </Descriptions.Item> <Descriptions.Item label="闸门孔数">{data?.gaorNum || '-'} </Descriptions.Item>
<Descriptions.Item label="设计流量">{data?.dsfl||'-'} /s</Descriptions.Item> <Descriptions.Item label="设计流量">{data?.dsfl || '-'} /s</Descriptions.Item>
<Descriptions.Item label="实达流量">{data?.stfl||'-'} /s</Descriptions.Item> <Descriptions.Item label="实达流量">{data?.stfl || '-'} /s</Descriptions.Item>
<Descriptions.Item label="闸门尺寸">{data?.gateSize||'-'} m*m</Descriptions.Item> <Descriptions.Item label="闸门尺寸">{data?.gateSize || '-'} m*m</Descriptions.Item>
<Descriptions.Item label="工程等级">{{1:'',2:'Ⅱ',3:'Ⅲ',4:'Ⅳ',5:''}?.[data?.engGrad]||'-'}</Descriptions.Item> <Descriptions.Item label="工程等级">{{ 1: '', 2: 'Ⅱ', 3: 'Ⅲ', 4: 'Ⅳ', 5: '' }?.[data?.engGrad] || '-'}</Descriptions.Item>
<Descriptions.Item label="运行状况">{{1:'在用良好',2:'在用故障',3:'停用'}?.[data?.runStat]||'-'}</Descriptions.Item> <Descriptions.Item label="运行状况">{{ 1: '在用良好', 2: '在用故障', 3: '停用' }?.[data?.runStat] || '-'}</Descriptions.Item>
<Descriptions.Item label="建成时间">{data?.compDate||'-'}</Descriptions.Item> <Descriptions.Item label="建成时间">{data?.compDate || '-'}</Descriptions.Item>
</Descriptions> </Descriptions>
</Tabs.TabPane> </Tabs.TabPane>
<Tabs.TabPane tab="工程图片" key="item-2"> <Tabs.TabPane tab="工程图片" key="item-2">
<Image width={800} src={url + data?.files?.filePath} alt='' /> <Image width={800} src={url + data?.files?.filePath} alt='' />
</Tabs.TabPane> </Tabs.TabPane>
</Tabs> </Tabs> */}
</div> </div>
</Modal> </Modal>
</> </>

View File

@ -2,12 +2,24 @@
.ant-card-body{ .ant-card-body{
display: flex; display: flex;
height: 100%; height: 100%;
column-gap: 20px;
.sg_zmjk_left{ .sg_zmjk_left{
top: 30px; // top: 30px;
position: relative; position: relative;
width: 1080px; width: 930px;
height: 640px; // height: 640px;
transform: scale(0.9,1); .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{ .sg_zmjk_right{
@ -19,16 +31,18 @@
.sg_zmjk_right_video{ .sg_zmjk_right_video{
height: 400px; height: 400px;
margin: 30px 20px 30px -30px; // margin: 30px 20px 30px -30px;
border-radius: 5px; border-radius: 5px;
border: 1px solid #bbb; // border: 1px solid #bbb;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.sg_zmjk_right_video_title{ .sg_zmjk_right_video_title{
height: 35px; height: 35px;
line-height: 35px; line-height: 35px;
padding-left: 10px; // padding-left: 10px;
border-bottom: 1px solid #bbb; border-bottom: 1px solid #bbb;
font-weight: 600;
font-size: 18px;
} }
.sg_zmjk_right_video_content{ .sg_zmjk_right_video_content{
flex: 1; flex: 1;
@ -57,7 +71,7 @@
} }
} }
.sg_zmjk_right_video_content_right{ .sg_zmjk_right_video_content_right{
flex: 1; width: 100%;
height: 100%; height: 100%;
padding: 10px; padding: 10px;
} }
@ -65,14 +79,16 @@
} }
.sg_zmjk_right_information{ .sg_zmjk_right_information{
height: 180px; height: 180px;
margin: -10px 20px 30px -30px; // margin: -10px 20px 30px -30px;
border-radius: 5px; border-radius: 5px;
border: 1px solid #bbb; // border: 1px solid #bbb;
.sg_zmjk_right_information_title{ .sg_zmjk_right_information_title{
height: 35px; height: 35px;
line-height: 35px; line-height: 35px;
padding-left: 10px; // padding-left: 10px;
border-bottom: 1px solid #bbb; border-bottom: 1px solid #bbb;
font-weight: 600;
font-size: 18px;
} }
.sg_zmjk_right_information_content{ .sg_zmjk_right_information_content{
display: flex; display: flex;
@ -83,10 +99,7 @@
} }
} }
} }
.sg_zmjk_right_more{
margin: -10px 20px 30px -30px;
cursor: pointer;
}
} }
} }
} }

View File

@ -0,0 +1,496 @@
import React, { useState, useEffect } from 'react'
import { Row, Col, Form, Input, Divider, DatePicker, Button, Upload, message, Modal } from "antd"
import { formItemLayout } from '../../../../../components/crud/FormLayoutProps'
import { httpget2, httppost2 } from '../../../../../utils/request';
import apiurl from '../../../../../service/apiurl';
import './index.less'
export default function BuildInfo() {
const [form] = Form.useForm();
const [skdisabled, setSkDisabled] = useState(true)
const [data, setData] = useState()
const getData = async () => {
try {
const res = await httpget2(apiurl.dataResourcesCenter.projectAndWater.buildInfo.detail)
if (res.code == 200) {
form.setFieldsValue(res.data)
setData(res.data)
}
} catch (error) {
console.log(error);
}
}
const onFinish = async () => {
try {
const values = form.getFieldsValue();
const params = {
...data,
...values,
}
const res = await httppost2(apiurl.dataResourcesCenter.projectAndWater.buildInfo.update, params)
if (res.code == 200) {
message.success("修改成功")
setSkDisabled(true)
getData()
}
} catch (error) {
console.log(error);
}
}
useEffect(() => {
getData()
}, [])
return (
<div className='basic-info-content'>
<Form
form={form}
{...formItemLayout}
>
<div style={{ width: '100%', background: '#e7f4ff', padding: 8, marginBottom: 10, display: 'flex', alignItems: 'center' }}>
<Divider type="vertical" style={{ width: 5, background: '#259def', height: 18 }} />
<span style={{ fontWeight: 600 }}>主坝</span>
</div>
<Row>
<Col span={8}>
<Form.Item
label="坝型"
name="mainType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="坝顶高程(m)"
name="mainCrestElevation"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="坝顶长度(m)"
name="mainCrestLength"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="坝顶宽度(m)"
name="mainCrestWidth"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col><Col span={8}>
<Form.Item
label="最大坝高(m)"
name="mainMaxHeight"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
</Row>
<div style={{ width: '100%', background: '#e7f4ff', padding: 8, marginBottom: 10, display: 'flex', alignItems: 'center' }}>
<Divider type="vertical" style={{ width: 5, background: '#259def', height: 18 }} />
<span style={{ fontWeight: 600 }}>副坝</span>
</div>
<Row>
<Col span={8}>
<Form.Item
label="坝型"
name="auxType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="坝顶高程(m)"
name="auxCrestElevation"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="坝顶长度(m)"
name="auxCrestLength"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="坝顶宽度(m)"
name="auxCrestWidth"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col><Col span={8}>
<Form.Item
label="最大坝高(m)"
name="auxMaxHeight"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
</Row>
<div style={{ width: '100%', background: '#e7f4ff', padding: 8, marginBottom: 10, display: 'flex', alignItems: 'center' }}>
<Divider type="vertical" style={{ width: 5, background: '#259def', height: 18 }} />
<span style={{ fontWeight: 600 }}>溢洪道</span>
</div>
<Row>
<Col span={8}>
<Form.Item
label="型式"
name="spillwayType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="堰顶型式"
name="spillwayCrestType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="地基特性"
name="spillwayFoundation"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="溢流堰顶高程(m)"
name="spillwayCrestElevation"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="溢流堰净宽(m)"
name="spillwayNetWidth"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="消能型式"
name="spillwayEnergyDissipation"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col> <Col span={8}>
<Form.Item
label="校核洪水下泄流量(m³/s)"
name="spillwayCheckFloodDischarge"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col> <Col span={8}>
<Form.Item
label="设计洪水下泄流量(m³/s)"
name="spillwayDesignFloodDischarge"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col> <Col span={8}>
<Form.Item
label="消能防冲下泄流量(m³/s)"
name="spillwayScouringDischarge"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
</Row>
<div style={{ width: '100%', background: '#e7f4ff', padding: 8, marginBottom: 10, display: 'flex', alignItems: 'center' }}>
<Divider type="vertical" style={{ width: 5, background: '#259def', height: 18 }} />
<span style={{ fontWeight: 600 }}>灌溉发电洞</span>
</div>
<Row>
<Col span={8}>
<Form.Item
label="型式"
name="irrigationType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="衬砌型式"
name="irrigationLiningType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="地基特性"
name="irrigationFoundation"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="进口底板高程(m)"
name="irrigationInletElevation"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="断面尺寸(m)"
name="irrigationCrossSection"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="洞长(m)"
name="irrigationLength"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col> <Col span={8}>
<Form.Item
label="设计流量(m³/s)"
name="irrigationDesignFlow"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col> <Col span={8}>
<Form.Item
label="进口闸门型式"
name="irrigationGateType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col> <Col span={8}>
<Form.Item
label="进口启闭机型式"
name="irrigationHoistType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
</Row>
<div style={{ width: '100%', background: '#e7f4ff', padding: 8, marginBottom: 10, display: 'flex', alignItems: 'center' }}>
<Divider type="vertical" style={{ width: 5, background: '#259def', height: 18 }} />
<span style={{ fontWeight: 600 }}>放空洞</span>
</div>
<Row>
<Col span={8}>
<Form.Item
label="型式"
name="emptyingType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="衬砌型式"
name="emptyingLiningType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="地基特性"
name="emptyingFoundation"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="进口底板高程(m)"
name="emptyingInletElevation"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="断面尺寸(m)"
name="emptyingCrossSection"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="洞长(m)"
name="emptyingLength"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col> <Col span={8}>
<Form.Item
label="设计流量(m³/s)"
name="emptyingDesignFlow"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col> <Col span={8}>
<Form.Item
label="进口闸门型式"
name="emptyingGateType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col> <Col span={8}>
<Form.Item
label="进口启闭机型式"
name="emptyingHoistType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
</Row>
<div style={{ width: '100%', background: '#e7f4ff', padding: 8, marginBottom: 10, display: 'flex', alignItems: 'center' }}>
<Divider type="vertical" style={{ width: 5, background: '#259def', height: 18 }} />
<span style={{ fontWeight: 600 }}>拦洪坝</span>
</div>
<Row>
<Col span={8}>
<Form.Item
label="坝型"
name="floodControlType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="坝顶高程(m)"
name="floodControlCrestElevation"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="坝顶长度(m)"
name="floodControlCrestLength"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="坝顶宽度(m)"
name="floodControlCrestWidth"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col><Col span={8}>
<Form.Item
label="最大坝高(m)"
name="floodControlMaxHeight"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
</Row>
<div style={{ width: '100%', background: '#e7f4ff', padding: 8, marginBottom: 10, display: 'flex', alignItems: 'center' }}>
<Divider type="vertical" style={{ width: 5, background: '#259def', height: 18 }} />
<span style={{ fontWeight: 600 }}>防汛道路</span>
</div>
<Row>
<Col span={8}>
<Form.Item
label="防汛路长度(m)"
name="roadLength"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="路面宽度(m)"
name="roadWidth"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
</Row>
<Row style={{ marginTop: 80 }}>
<Col span={24}>
<Form.Item
wrapperCol={{ span: 14, offset: 10 }}
>
{
skdisabled ? <Button type="primary" onClick={() => setSkDisabled(false)}>编辑</Button> :
<div style={{ display: 'flex', columnGap: 20 }}>
<Button onClick={() => setSkDisabled(true)}>取消</Button>
<Button type="primary" onClick={() => { onFinish() }}>保存</Button>
</div>
}
</Form.Item>
</Col>
</Row>
</Form>
</div>
)
}

View File

@ -0,0 +1,39 @@
.basic-info-container {
background: #fff;
.ant-descriptions {
.ant-descriptions-header {
margin-bottom: 16px;
padding: 8px;
border-left: 4px solid #1890ff;
background-color: #e7f4ff;
.ant-descriptions-title {
font-size: 16px;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
}
}
.ant-descriptions-view {
border: 1px solid #f0f0f0;
.ant-descriptions-item {
padding: 12px 24px;
.ant-descriptions-item-label {
width: 160px;
background: #fafafa;
color: rgba(0, 0, 0, 0.85);
font-weight: normal;
}
.ant-descriptions-item-content {
color: rgba(0, 0, 0, 0.65);
}
}
}
}
.ant-descriptions + .ant-descriptions {
margin-top: 24px;
}
}

View File

@ -0,0 +1,52 @@
const descriptionsConfig = [
{
title: '主坝',
column: 3,
items: [
{
label: '坝型',
key: 'bx'
},
{
label: '坝顶高程',
key: 'gc'
},
{
label: '统一社会信用代码',
key: 'creditCode2'
}
// ... 其他基础信息项
]
},
{
title: '许可信息',
column: 2,
items: [
{
label: '取水证号',
key: 'licenseNo'
},
{
label: '取水项目名称',
key: 'projectName'
}
// ... 其他许可信息项
]
}
// ... 可以添加更多描述组
];
const dataconfig = {
unitName: 'XX市老城区龙泉供水有限责任公司',
creditCode: '915107242056002w',
creditCode2: '91510724205600',
licenseNo: 'B510705G2021-1061',
projectName: 'XX市老城区龙泉供水有限责任公司',
projectName2: 'XX市老城区龙泉供水',
approvalOrg: 'XXXX省水利厅',
waterType: '地下水',
waterType2: '地下水',
waterPurpose: '制水供水',
yearAmount: '699',
yearAmount2: '699'
};
export {descriptionsConfig,dataconfig} ;

View File

@ -7,6 +7,7 @@ import apiurl from '../../../../service/apiurl';
import { httpget2, httppost2 } from '../../../../utils/request'; import { httpget2, httppost2 } from '../../../../utils/request';
import XlLine from './xlLine' import XlLine from './xlLine'
import "./index.less" import "./index.less"
import BuildInfo from './buildInfo'
export default function ShuikuBasicInfo() { export default function ShuikuBasicInfo() {
const [tabVal, setTabVal] = useState('1') const [tabVal, setTabVal] = useState('1')
const [data,setData] =useState('') const [data,setData] =useState('')
@ -36,6 +37,10 @@ export default function ShuikuBasicInfo() {
className={tabVal === '2' ? 'fxdd_hsybjs_toolbar_item hsybjs_checked' : 'fxdd_hsybjs_toolbar_item'} className={tabVal === '2' ? 'fxdd_hsybjs_toolbar_item hsybjs_checked' : 'fxdd_hsybjs_toolbar_item'}
onClick={() => setTabVal('2')}>主要特征参数 onClick={() => setTabVal('2')}>主要特征参数
</div> </div>
<div
className={tabVal === '5' ? 'fxdd_hsybjs_toolbar_item hsybjs_checked' : 'fxdd_hsybjs_toolbar_item'}
onClick={() => setTabVal('5')}>主要建筑物信息
</div>
<div <div
className={tabVal === '3' ? 'fxdd_hsybjs_toolbar_item hsybjs_checked' : 'fxdd_hsybjs_toolbar_item'} className={tabVal === '3' ? 'fxdd_hsybjs_toolbar_item hsybjs_checked' : 'fxdd_hsybjs_toolbar_item'}
onClick={() => setTabVal('3')}>水库库容曲线 onClick={() => setTabVal('3')}>水库库容曲线
@ -44,10 +49,10 @@ export default function ShuikuBasicInfo() {
className={tabVal === '4' ? 'fxdd_hsybjs_toolbar_item hsybjs_checked' : 'fxdd_hsybjs_toolbar_item'} className={tabVal === '4' ? 'fxdd_hsybjs_toolbar_item hsybjs_checked' : 'fxdd_hsybjs_toolbar_item'}
onClick={() => setTabVal('4')}>水库泄流曲线 onClick={() => setTabVal('4')}>水库泄流曲线
</div> </div>
<div {/* <div
className={tabVal === '5' ? 'fxdd_hsybjs_toolbar_item hsybjs_checked' : 'fxdd_hsybjs_toolbar_item'} className={tabVal === '5' ? 'fxdd_hsybjs_toolbar_item hsybjs_checked' : 'fxdd_hsybjs_toolbar_item'}
onClick={() => setTabVal('5')}>月生态流量 onClick={() => setTabVal('5')}>月生态流量
</div> </div> */}
</div> </div>
<div <div
className='shuiku-content' className='shuiku-content'
@ -57,8 +62,8 @@ export default function ShuikuBasicInfo() {
{tabVal === "2" ? <TzParams /> : null} {tabVal === "2" ? <TzParams /> : null}
{tabVal === "3" ? <KrLine dataInfo={data}/> : null} {tabVal === "3" ? <KrLine dataInfo={data}/> : null}
{tabVal === "4" ? <XlLine /> : null} {tabVal === "4" ? <XlLine /> : null}
{tabVal === "5" ? <MonthLl dataInfo={data}/> : null} {/* {tabVal === "5" ? <MonthLl dataInfo={data}/> : null} */}
{tabVal === "5" ? <BuildInfo /> : null}
</div> </div>
</div> </div>
) )

View File

@ -1,6 +1,6 @@
import React,{useState,useEffect} from 'react' import React, { useState, useEffect } from 'react'
import { Row, Col, Form, Input, DatePicker, Button,Upload,message,Modal } from "antd" import { Row, Col, Form, Input, DatePicker, Button, Upload, message, Modal } from "antd"
import {PaperClipOutlined,DeleteOutlined} from '@ant-design/icons'; import { PaperClipOutlined, DeleteOutlined } from '@ant-design/icons';
import NormalSelect from '../../../../../components/Form/NormalSelect'; import NormalSelect from '../../../../../components/Form/NormalSelect';
import { formItemLayout } from '../../../../../components/crud/FormLayoutProps' import { formItemLayout } from '../../../../../components/crud/FormLayoutProps'
import apiurl from '../../../../../service/apiurl'; import apiurl from '../../../../../service/apiurl';
@ -8,451 +8,481 @@ import { httpget2, httppost2 } from '../../../../../utils/request';
import moment from 'moment' import moment from 'moment'
import "./index.less" import "./index.less"
export default function ProjectBasciInfo() { export default function ProjectBasciInfo() {
const [form] = Form.useForm(); const [form] = Form.useForm();
const [data, setData] = useState() const [data, setData] = useState()
const [fileList, setFileList] = useState([]) //上传文件列表 const [fileList, setFileList] = useState([]) //上传文件列表
const [fileIds, setFileIds] = useState([]) const [fileIds, setFileIds] = useState([])
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false)
const [iframeId, setIframeId] = useState('') const [iframeId, setIframeId] = useState('')
const [perviewOpen, setPerviewOpen] = useState(false) const [perviewOpen, setPerviewOpen] = useState(false)
const [skdisabled, setSkDisabled] = useState(true) const [skdisabled, setSkDisabled] = useState(true)
const optionsLevel = [ const optionsLevel = [
{ {
label: "大 (1)型", label: "大 (1)型",
value:"1" value: "1"
}, },
{ {
label: "大 (2)型", label: "大 (2)型",
value:"2" value: "2"
}, },
{ {
label: "中型", label: "中型",
value:"3" value: "3"
}, },
{ {
label: "小 (1)型", label: "小 (1)型",
value:"4" value: "4"
}, },
{ {
label: "小 (2)型", label: "小 (2)型",
value:"5" value: "5"
}, },
{ {
label: "其他", label: "其他",
value:"9" 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 beforeUpload = (file) => { const getData = async () => {
const isPdf = file.type === 'application/pdf' try {
if (!isPdf) {
message.error("请上传pdf文件")
}
return isPdf
}
const fileChange = (info) => { const res = await httppost2(apiurl.dataResourcesCenter.projectAndWater.shuikuBasicinfo.detail)
// debugger;
if (info.file.status === "done") { if (res.code == 200) {
setLoading(false); form.setFieldsValue(res.data[0])
setData(res.data[0])
} if (res.data[0].files.length > 0) {
if (info.file.status === "uploading") { getFileInfo(res.data[0]?.files[0]?.fileId)
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)
} }
} }
} catch (error) {
const deleteFile = (fileId) => { console.log(error);
let filterFile = fileList.filter(item => item.response?.data?.fileId !== fileId);
setFileList(filterFile)
} }
}
const onFinish = async () => { const beforeUpload = (file) => {
try { const isPdf = file.type === 'application/pdf'
let oldFiles = fileList.map(item => ({ fileId: item.response?.data?.fileId })) if (!isPdf) {
const values = form.getFieldsValue(); message.error("请上传pdf文件")
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);
}
} }
return isPdf
}
const getFileInfo = async(id) => { const fileChange = (info) => {
try { let newFileList = [...info.fileList];
const res = await httpget2(`${apiurl.dataResourcesCenter.projectAndWater.shuikuBasicinfo.getFile}/${id}`) newFileList = newFileList.slice(-1);
let obj ={ // 处理文件状态
name: res.data.fileName, newFileList = newFileList.map(file => {
response: { if (file.response) {
data: { return {
filePath: res.data.filePath, ...file,
fileId:res.data.fileId status: 'done', // 确保状态正确
} url: file.response.url,
}, fileId: file.response.data?.fileId
} };
setFileList([obj]) }
} catch (error) { return file;
console.log(error); });
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() 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 ( return (
<div className='basic-info-content'> <div className='basic-info-content'>
<Form <Form
form={form} form={form}
{...formItemLayout} {...formItemLayout}
onFinish={onFinish} onFinish={onFinish}
> >
<Row> <Row>
<Col span={8}> <Col span={8}>
<Form.Item <Form.Item
label="水库名称" label="水库名称"
name="resName" name="resName"
rules={[{ required: true }]} rules={[{ required: true }]}
> >
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} /> <Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={8}> <Col span={8}>
<Form.Item <Form.Item
label="水库代码" label="水库代码"
name="resCode" name="resCode"
rules={[{ required: true }]} rules={[{ required: true }]}
> >
<Input allowClear style={{width:'300px'}} disabled/> <Input allowClear style={{ width: '300px' }} disabled />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={8}> <Col span={8}>
<Form.Item <Form.Item
label="注册登记号" label="注册登记号"
name="regSn" name="regSn"
> >
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/> <Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item> </Form.Item>
</Col> </Col>
</Row> </Row>
<Row> <Row>
<Col span={8}> <Col span={8}>
<Form.Item <Form.Item
label="注册登记时间" label="注册登记时间"
name="regTime" name="regTime"
getValueFromEvent={(e, dateString) => moment(dateString).format('YYYY-MM-DD HH:mm:ss')} getValueFromEvent={(e, dateString) => moment(dateString).format('YYYY-MM-DD HH:mm:ss')}
getValueProps={value => ({ getValueProps={value => ({
value: value ? moment(value) : undefined value: value ? moment(value) : undefined
})} })}
> >
<DatePicker allowClear style={{width:'300px'}} disabled={skdisabled}/> <DatePicker allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={8}> <Col span={8}>
<Form.Item <Form.Item
label="工程位置" label="工程位置"
name="resLoc" name="resLoc"
> >
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/> <Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={8}> <Col span={8}>
<Form.Item <Form.Item
label="所在河流(水系)名称" label="所在河流(水系)名称"
name="basName" name="basName"
> >
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/> <Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item> </Form.Item>
</Col> </Col>
</Row> </Row>
<Row> <Row>
<Col span={8}> <Col span={8}>
<Form.Item <Form.Item
label="水库规模" label="水库规模"
name="engScal" name="engScal"
rules={[{ required: true }]} rules={[{ required: true }]}
> >
<NormalSelect <NormalSelect
style={{ width: '300px' }} style={{ width: '300px' }}
allowClear allowClear
options={optionsLevel} options={optionsLevel}
disabled={skdisabled} disabled={skdisabled}
/> />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={8}> <Col span={8}>
<Form.Item <Form.Item
label="主要功能" label="主要功能"
name="rsvFunction" name="rsvFunction"
> >
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/> <Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={8}> <Col span={8}>
<Form.Item <Form.Item
label="经度" label="经度"
name="lgtd" name="lgtd"
rules={[{ required: true }]} rules={[{ required: true }]}
> >
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/> <Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item> </Form.Item>
</Col> </Col>
</Row> </Row>
<Row> <Row>
<Col span={8}> <Col span={8}>
<Form.Item <Form.Item
label="纬度" label="纬度"
name="lttd" name="lttd"
rules={[{ required: true }]} rules={[{ required: true }]}
> >
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/> <Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={8}> <Col span={8}>
<Form.Item <Form.Item
label="设计灌溉面积(亩)" label="设计灌溉面积(亩)"
name="designIrrArea" name="designIrrArea"
> >
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/> <Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={8}> <Col span={8}>
<Form.Item <Form.Item
label="实际灌溉面积(亩)" label="实际灌溉面积(亩)"
name="actualIrrArea" name="actualIrrArea"
> >
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/> <Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item> </Form.Item>
</Col> </Col>
</Row> </Row>
<Row> <Row>
<Col span={8}> <Col span={8}>
<Form.Item <Form.Item
label="受益人口(人)" label="受益人口(人)"
name="feedPop" name="feedPop"
> >
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/> <Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={8}> <Col span={8}>
<Form.Item <Form.Item
label="开工日期" label="开工日期"
name="startDate" name="startDate"
getValueFromEvent={(e, dateString) => moment(dateString).format('YYYY-MM-DD HH:mm:ss')} getValueFromEvent={(e, dateString) => moment(dateString).format('YYYY-MM-DD HH:mm:ss')}
getValueProps={value => ({ getValueProps={value => ({
value: value ? moment(value) : undefined value: value ? moment(value) : undefined
})} })}
> >
<DatePicker allowClear style={{ width: '300px' }} disabled={skdisabled}/> <DatePicker allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={8}> <Col span={8}>
<Form.Item <Form.Item
label="竣工日期" label="竣工日期"
name="compDate" name="compDate"
getValueFromEvent={(e, dateString) => moment(dateString).format('YYYY-MM-DD HH:mm:ss')} getValueFromEvent={(e, dateString) => moment(dateString).format('YYYY-MM-DD HH:mm:ss')}
getValueProps={value => ({ getValueProps={value => ({
value: value ? moment(value) : undefined value: value ? moment(value) : undefined
})} })}
> >
<DatePicker allowClear style={{ width: '300px' }} disabled={skdisabled}/> <DatePicker allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item> </Form.Item>
</Col> </Col>
</Row> </Row>
<Row> <Row>
<Col span={8}> <Col span={8}>
<Form.Item <Form.Item
label="是否病险" label="是否病险"
name="isDanger" name="isDanger"
> >
<NormalSelect <NormalSelect
style={{ width: '300px' }} style={{ width: '300px' }}
allowClear allowClear
options={[ options={[
{ {
label: '否', label: '否',
value:0, value: 0,
}, },
{ {
label: '是', label: '是',
value:1, value: 1,
}, },
]} ]}
disabled={skdisabled} disabled={skdisabled}
/> />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={8}> <Col span={8}>
<Form.Item <Form.Item
label="是否有闸控制" label="是否有闸控制"
name="spillwayGate" name="spillwayGate"
> >
<NormalSelect <NormalSelect
style={{ width: '300px' }} style={{ width: '300px' }}
allowClear allowClear
options={[ options={[
{ {
label: '否', label: '否',
value:"0", value: "0",
}, },
{ {
label: '是', label: '是',
value:"1", value: "1",
}, },
]} ]}
disabled={skdisabled} disabled={skdisabled}
/> />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={8}> <Col span={8}>
<Form.Item <Form.Item
label="工程特性表" label="工程特性表"
name="" name=""
rules={[{ required: true }]} rules={[{ required: true }]}
> >
<Upload <Upload
name='file' name='file'
action="/gunshiApp/tsg/attResBase/file/upload/singleSimple" action="/gunshiApp/tsg/attResBase/file/upload/singleSimple"
onChange={fileChange} onChange={fileChange}
fileList={fileList} fileList={fileList}
maxCount={1} maxCount={1}
disabled={loading} disabled={loading}
beforeUpload={beforeUpload} beforeUpload={beforeUpload}
itemRender={(origin,file) => { showUploadList={false}
return ( >
<div style={{display:"flex",alignItems:"center",columnGap:10}}> {fileList.map(file => (
<PaperClipOutlined /> <div key={file.uid} style={{ display: "flex", alignItems: "center", columnGap: 10 }}>
<span <PaperClipOutlined />
style={{ cursor: "pointer" }} <span
onClick={() => { setPerviewOpen(true); setIframeId(file.response?.data?.fileId)}} style={{ cursor: "pointer" }}
> onClick={(e) => {
{file?.name}</span> e.stopPropagation(); // 阻止触发上传
{skdisabled ? null : if (file.response?.data?.fileId) {
<DeleteOutlined setPerviewOpen(true);
style={{ marginLeft: 20, cursor: "pointer" }} setIframeId(file.response.data.fileId);
onClick={() => deleteFile(file.response?.data?.fileId)} }
/> }}
} >
</div> {file.name}
) </span>
}} {!skdisabled && (
> <DeleteOutlined
{skdisabled ? null : style={{ marginLeft: 20, cursor: "pointer" }}
<div style={{display:"flex",alignItems:"center",columnGap:10,color:"#4f85ec",cursor:skdisabled?"not-allowed":"pointer"}}> onClick={(e) => {
<PaperClipOutlined /> e.stopPropagation(); // 阻止触发上传
<a style={{cursor:"pointer"}}>上传PDF文件</a> deleteFile(file.response?.data?.fileId);
</div> }}
} />
</Upload> )}
</Form.Item> </div>
</Col> ))}
</Row> {!skdisabled && fileList.length === 0 && (
<Row> <div style={{
<Col span={24}> display: "flex",
<Form.Item alignItems: "center",
label="供水效益" columnGap: 10,
name="benefit" color: "#4f85ec",
labelCol={{ span: 2, offset: 0 }} cursor: "pointer"
wrapperCol={{span:21,offset:0}} }}>
> <PaperClipOutlined />
<Input allowClear disabled={skdisabled}/> <a>上传PDF文件</a>
</Form.Item> </div>
</Col> )}
</Row> </Upload>
<Row> </Form.Item>
<Col span={24}> </Col>
<Form.Item </Row>
label="工程概况" <Row>
name="projOverview" <Col span={24}>
labelCol={{ span: 2, offset: 0 }} <Form.Item
wrapperCol={{span:21,offset:0}} label="供水效益"
> name="benefit"
<Input.TextArea allowClear style={{width:'100%',minHeight:'100px'}} disabled={skdisabled}/> labelCol={{ span: 2, offset: 0 }}
</Form.Item> wrapperCol={{ span: 21, offset: 0 }}
</Col> >
</Row> <Input allowClear disabled={skdisabled} />
<Row style={{marginTop:80}}> </Form.Item>
<Col span={24}> </Col>
<Form.Item </Row>
wrapperCol={{span:14,offset:10}} <Row>
> <Col span={24}>
{ <Form.Item
skdisabled ? <Button type="primary" onClick={() => setSkDisabled(false)}>编辑</Button> : label="工程概况"
<div style={{ display: 'flex', columnGap: 20 }}> name="projOverview"
<Button onClick={() => setSkDisabled(true)}>取消</Button> labelCol={{ span: 2, offset: 0 }}
<Button type="primary" onClick={() => { onFinish() }}>保存</Button> wrapperCol={{ span: 21, offset: 0 }}
</div> >
} <Input.TextArea allowClear style={{ width: '100%', minHeight: '100px' }} disabled={skdisabled} />
</Form.Item>
</Form.Item> </Col>
</Col> </Row>
</Row> <Row style={{ marginTop: 80 }}>
</Form> <Col span={24}>
<Form.Item
<Modal wrapperCol={{ span: 14, offset: 10 }}
>
{
skdisabled ? <Button type="primary" onClick={() => setSkDisabled(false)}>编辑</Button> :
<div style={{ display: 'flex', columnGap: 20 }}>
<Button onClick={() => setSkDisabled(true)}>取消</Button>
<Button type="primary" onClick={() => { onFinish() }}>保存</Button>
</div>
}
</Form.Item>
</Col>
</Row>
</Form>
<Modal
open={perviewOpen} open={perviewOpen}
width={1000} width={1000}
title="" title=""
footer={null} footer={null}
style={{marginTop:"-5%"}} style={{ marginTop: "-5%" }}
onCancel={() => { onCancel={() => {
setPerviewOpen(false) setPerviewOpen(false)
}} }}
> >
<iframe <iframe
style={{ style={{
height: '80vh', height: '80vh',
width: '100%', width: '100%',
border: 0, border: 0,
marginTop: 20, marginTop: 20,
}} }}
src={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/tsg/attResBase/file/download/${iframeId}`)}`} src={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/tsg/attResBase/file/download/${iframeId}`)}`}
/> />
</Modal> </Modal>
</div> </div>

View File

@ -27,7 +27,7 @@ const ToolBar = ({ setSearchVal, onExport, storeData, role }) => {
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}> <Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
<Form.Item label="类型" name="types"> <Form.Item label="类型" name="types">
<Select options={[ <Select options={[
{value:1,label:'大事记'}, {value:2,label:'调度指令'}, {value:3,label:'维修养护'},{value:4,label:'安全鉴定'}, {value:5,label:"除险加固"}, {value:6,label:'白蚁普查'} {value:1,label:'大事记'}, {value:2,label:'调度指令'}, {value:3,label:'维修养护'},{value:4,label:'安全鉴定'}, {value:5,label:"除险加固"}, {value:6,label:'白蚁监测'}
]} allowClear mode='multiple' maxTagCount='responsive' style={{ width: "200px" }}/> ]} allowClear mode='multiple' maxTagCount='responsive' style={{ width: "200px" }}/>
</Form.Item> </Form.Item>
<Form.Item label="发生日期" name="tm"> <Form.Item label="发生日期" name="tm">

View File

@ -182,21 +182,21 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
<Col span={12}> <Col span={12}>
<Form.Item <Form.Item
label="施行日期" label="施行日期"
name="announcementDate" name="implementationDate"
getValueFromEvent={(e, dateString) => dateString} getValueFromEvent={(e, dateString) => dateString}
getValueProps={(value) => ({ value: value ? moment(value) : undefined })} getValueProps={(value) => ({ value: value ? moment(value) : undefined })}
> >
<DatePicker disabled={mode === 'view'} format={'YYYY-MM-DD HH:mm:ss'} style={{ width: '100%' }} allowClear /> <DatePicker disabled={mode === 'view'} format={'YYYY-MM-DD'} style={{ width: '100%' }} allowClear />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={12}> <Col span={12}>
<Form.Item <Form.Item
label="公布日期" label="公布日期"
name="implementationDate" name="announcementDate"
getValueFromEvent={(e, dateString) => dateString} getValueFromEvent={(e, dateString) => dateString}
getValueProps={(value) => ({ value: value ? moment(value) : undefined })} getValueProps={(value) => ({ value: value ? moment(value) : undefined })}
> >
<DatePicker disabled={mode === 'view'} format={'YYYY-MM-DD HH:mm:ss'} style={{ width: '100%' }} allowClear /> <DatePicker disabled={mode === 'view'} format={'YYYY-MM-DD'} style={{ width: '100%' }} allowClear />
</Form.Item> </Form.Item>
</Col> </Col>
</Row> </Row>

View File

@ -44,16 +44,16 @@ const Page = () => {
}, },
{ {
title: '公布日期', key: 'announcementDate', dataIndex: 'announcementDate', title: '公布日期', key: 'announcementDate', dataIndex: 'announcementDate',
render: (value) => <span>{dayjs(value).format('YYYY-MM-DD')}</span>, render: (value) => <span>{value ? dayjs(value).format('YYYY-MM-DD'):''}</span>,
}, },
{ {
title: '施行日期', key: 'implementationDate', dataIndex: 'implementationDate' title: '施行日期', key: 'implementationDate', dataIndex: 'implementationDate'
}, },
{ {
title: '上传时间', key: 'uploadDate', dataIndex: 'uploadDate' title: '上传时间', key: 'createTime', dataIndex: 'createTime'
}, },
{ {
title: '附件', key: 'files', dataIndex: 'files',render:(v,r)=><a onClick={()=>download(v[0].fileId,v[0]?.fileName)}><PaperClipOutlined />{v[0]?.fileName}</a> title: '附件', key: 'files', dataIndex: 'files', render: (v, r) => <a onClick={() => download(v[0].fileId, v[0]?.fileName)}>{ v[0]?.fileName ?<PaperClipOutlined />:''}{v[0]?.fileName}</a>
}, },
{ {
title: '操作', key: 'operation', title: '操作', key: 'operation',

View File

@ -18,12 +18,12 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
if (values.implementationDate) { if (values.implementationDate) {
// 施行日期 // 施行日期
values.stmIm= values.implementationDate[0].format('YYYY-MM-DD HH:mm:ss') values.stmIm= values.implementationDate[0].format('YYYY-MM-DD HH:mm:ss')
values.etmIm= values.implementationDate[0].format('YYYY-MM-DD HH:mm:ss') values.etmIm= values.implementationDate[1].format('YYYY-MM-DD HH:mm:ss')
} }
if (values.uploadTime) { if (values.uploadTime) {
// 上传日期 // 上传日期
values.stmUd= values.uploadTime[0].format('YYYY-MM-DD HH:mm:ss') values.stmUd= values.uploadTime[0].format('YYYY-MM-DD HH:mm:ss')
values.etmUd= values.uploadTime[0].format('YYYY-MM-DD HH:mm:ss') values.etmUd= values.uploadTime[1].format('YYYY-MM-DD HH:mm:ss')
} }
delete values.announcementDate delete values.announcementDate

View File

@ -280,7 +280,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
labelCol={{ span: 3 }} labelCol={{ span: 3 }}
wrapperCol={{ span: 19 }} wrapperCol={{ span: 19 }}
> >
<InputNumber min={0} disabled={mode==='view'} style={{width:'100%'}} allowClear /> <Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item> </Form.Item>
</Col> </Col>
</Row> </Row>

View File

@ -30,7 +30,8 @@ const Page = () => {
},{ },{
label: "政治学习教育", label: "政治学习教育",
value:4 value:4
},{ },
{
label: "其他", label: "其他",
value:5 value:5
}, },
@ -51,7 +52,7 @@ const Page = () => {
{ title: '主办单位', key: 'unit', dataIndex: 'unit', width: 150 }, { title: '主办单位', key: 'unit', dataIndex: 'unit', width: 150 },
{ {
title: '培训分类', key: 'type', dataIndex: 'type', width: 150, title: '培训分类', key: 'type', dataIndex: 'type', width: 150,
render: (v) => <span>{types[v]?.label}</span> render: (v) => <span>{types[v - 1]?.label}</span>
}, },
{ {
title: '培训内容', key: 'content', dataIndex: 'content', width: 200,ellipsis: true title: '培训内容', key: 'content', dataIndex: 'content', width: 200,ellipsis: true

View File

@ -181,7 +181,7 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
<p className="ant-upload-drag-icon"> <p className="ant-upload-drag-icon">
<InboxOutlined /> <InboxOutlined />
</p> </p>
<p className="ant-upload-text">点击或将文件拖拽到这里上传 支持扩展名jpegpng</p> <p className="ant-upload-text">点击或将文件拖拽到这里上传</p>
</Dragger>} </Dragger>}
<div className='flex'> <div className='flex'>
{fileListHj?.[item1.key]?.map((item) => { {fileListHj?.[item1.key]?.map((item) => {

View File

@ -145,7 +145,7 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
<p className="ant-upload-drag-icon"> <p className="ant-upload-drag-icon">
<InboxOutlined /> <InboxOutlined />
</p> </p>
<p className="ant-upload-text">点击或将文件拖拽到这里上传 支持扩展名jpegpng</p> <p className="ant-upload-text">点击或将文件拖拽到这里上传</p>
</Dragger>} </Dragger>}
<div className='flex'> <div className='flex'>
{fileListHj?.[item1.key]?.map((item) => { {fileListHj?.[item1.key]?.map((item) => {

View File

@ -11,14 +11,14 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
const [showGj, setShowGj] = useState(false) const [showGj, setShowGj] = useState(false)
const onFinish = (values) => { const onFinish = (values) => {
let dateSo; let dateSo;
if (values.tm) { if (values.createTime) {
dateSo = { dateSo = {
start: moment(values.tm[0]).format('YYYY-MM-DD HH:mm:ss'), stm: moment(values.createTime[0]).format('YYYY-MM-DD'),
end: moment(values.tm[1]).format('YYYY-MM-DD HH:mm:ss') etm: moment(values.createTime[1]).format('YYYY-MM-DD')
} }
} }
delete values.tm delete values.createTime
setSearchVal({ ...values, dateSo }); setSearchVal({ ...values, ...dateSo });
} }
const opntios = [ const opntios = [

View File

@ -41,7 +41,7 @@ const Page = ({ treeSelect }) => {
<div className={styles.listborder} style={{ padding: '0 10px', marginBottom: 5 }}>{data?.status?'启用':'禁用'}</div> <div className={styles.listborder} style={{ padding: '0 10px', marginBottom: 5 }}>{data?.status?'启用':'禁用'}</div>
<div className={styles.contentBor} style={{ padding: '0 10px', marginBottom: 5, height: '35%' }}> <div className={styles.contentBor} style={{ padding: '0 10px', marginBottom: 5, height: '35%' }}>
<div className={styles.listborder} style={{ padding: '0 10px', height: '30%' }}>法律依据</div> <div className={styles.listborder} style={{ padding: '0 10px', height: '30%' }}>法律依据</div>
{data?.legalName ?? '无内容请添加'} {data?.legalContent ?? '无内容请添加'}
</div> </div>
<div style={{ display: 'flex', height: '33%' }}> <div style={{ display: 'flex', height: '33%' }}>

View File

@ -131,6 +131,16 @@ const Page = ({ setTreeSelect }) => {
return res return res
} }
} }
const getFirstLeafKey =(treeData) =>{
if (!treeData || !treeData.length) return null;
let node = treeData[0];
while (node.children && node.children.length > 0) {
node = node.children[0];
}
return {id:node.id,name:node.legalName};
}
useEffect(() => { useEffect(() => {
httpget(apiurl.szzf.clyj.tree).then(res => { httpget(apiurl.szzf.clyj.tree).then(res => {
setData(res.data) setData(res.data)
@ -145,11 +155,13 @@ const Page = ({ setTreeSelect }) => {
// setSelect([res.data[0].id]) // setSelect([res.data[0].id])
// getFirstChild(res.data) // getFirstChild(res.data)
setSelect([getFirstChild(res.data).id]); // setSelect([getFirstChild(res.data).id]);
setSelect([getFirstLeafKey(res.data)?.id])
setExpandedKeys([getFirstLeafKey(res.data)?.id])
setTreeSelect( setTreeSelect(
[{ [{
key: getFirstChild(res.data).id, key: getFirstLeafKey(res.data)?.id,
name: getFirstChild(res.data).legalName, name: getFirstLeafKey(res.data)?.name,
}] }]

View File

@ -156,6 +156,16 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
}, [type, formJsonData, isModalOpen]) }, [type, formJsonData, isModalOpen])
const disableParentNodes =(treeData) => {
return treeData.map(node => {
const newNode = { ...node };
if (node.children && node.children.length > 0) {
newNode.disabled = true;
newNode.children = disableParentNodes(node.children);
}
return newNode;
});
}
return ( return (
@ -172,7 +182,7 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
labelCol={item.labelCol} labelCol={item.labelCol}
rules={[{ required: item.required, message: '请输入' + item.label }]} rules={[{ required: item.required, message: '请输入' + item.label }]}
> >
<Input disabled={type == 'view' || item.disabled} placeholder={item.placeholder} addonAfter={item.addonAfter}/> <Input disabled={type == 'view' || item.disabled} placeholder={item.placeholder} />
</Form.Item>} </Form.Item>}
{item.type == "title" && {item.type == "title" &&
<Form.Item <Form.Item
@ -253,7 +263,7 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }} dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
allowClear allowClear
fieldNames={item.fieldNames} fieldNames={item.fieldNames}
treeData={item.treeData} treeData={disableParentNodes(item.treeData)}
treeCheckable={item.multiple} treeCheckable={item.multiple}
disabled={type == 'view'} disabled={type == 'view'}
/> />

View File

@ -111,7 +111,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
fileId: o.fileId fileId: o.fileId
} }
}, },
})) }))
setFileList(imgFile) setFileList(imgFile)
} }
}, [record, mode]) }, [record, mode])
@ -194,7 +194,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
<Col span={12}> <Col span={12}>
<div className="file-item" style={{ width: "75%",marginTop:5 }}> <div className="file-item" style={{ width: "75%",marginTop:5 }}>
<div className='file-description'> <div className='file-description'>
{file.name.indexOf('.docx') > -1 ? {file.name.indexOf('.doc') > -1 ?
<div <div
onClick={() => { download(file.response?.data?.fileId) }} onClick={() => { download(file.response?.data?.fileId) }}
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}
@ -220,7 +220,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
<FileZipOutlined style={{ fontSize: 40 }} /> <FileZipOutlined style={{ fontSize: 40 }} />
</div> </div>
: :
file.name.indexOf('.xlsx') > -1 ? file.name.indexOf('.xls') > -1 ?
<div <div
onClick={() => { download(file.response?.data?.fileId) }} onClick={() => { download(file.response?.data?.fileId) }}
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}

View File

@ -33,13 +33,13 @@ const Page = () => {
}, },
{ {
title: '发布日期', key: 'releaseDate', dataIndex: 'releaseDate', title: '发布日期', key: 'releaseDate', dataIndex: 'releaseDate',
render: (value) => <span>{dayjs(value).format('YYYY-MM-DD')}</span>, render: (value) => <span>{value ? dayjs(value).format('YYYY-MM-DD') : ''}</span>,
}, },
{ {
title: '发布单位', key: 'fillUnit', dataIndex: 'fillUnit' title: '发布单位', key: 'fillUnit', dataIndex: 'fillUnit'
}, },
{ {
title: '上传时间', key: 'uploadDate', dataIndex: 'uploadDate' title: '上传时间', key: 'minUpTime', dataIndex: 'minUpTime'
}, },
{ {
title: '附件', key: 'files', dataIndex: 'files', render:(v,r)=><a onClick={()=>download(v[0].fileId,v[0]?.fileName)}><PaperClipOutlined />{v[0]?.fileName}</a> title: '附件', key: 'files', dataIndex: 'files', render:(v,r)=><a onClick={()=>download(v[0].fileId,v[0]?.fileName)}><PaperClipOutlined />{v[0]?.fileName}</a>

View File

@ -5,7 +5,110 @@ import { httpget2, httppost2,xyt_httpget2 } from '../../../utils/request';
import apiurl from '../../../service/apiurl'; import apiurl from '../../../service/apiurl';
import "./index.less" import "./index.less"
export default function Zzjgck() { export default function Zzjgck() {
const demoList = [
{
title: '中共红安县檀树岗水库支部委员会',
key: 100,
parentId: 0,
children: [
{
title: "第一党小组委员会",
parentId: 100,
key: 101,
children: [
{
title: "周志才",
parentId: 101,
key: 103,
},
{
title: "刘立新",
parentId: 101,
key: 104,
},
{
title: "陈辉来",
parentId: 101,
key: 105,
},
{
title: "王胜娣",
parentId: 101,
key: 106,
},
{
title: "高服气",
parentId: 101,
key: 107,
},
{
title: "李帅华",
parentId: 101,
key: 108,
},
{
title: "潘宏祥",
parentId: 101,
key: 109,
},
{
title: "耿协成",
parentId: 101,
key: 110,
}
]
},
{
title: "第二党小组委员会",
parentId: 100,
key: 102,
children: [
{
title: "吴吉琛",
parentId: 102,
key: 111,
},
{
title: "吴胜林",
parentId: 102,
key: 112,
},
{
title: "刘义华",
parentId: 102,
key: 113,
},
{
title: "陈斌",
parentId: 102,
key: 113,
},
{
title: "董希贵",
parentId: 102,
key: 114,
},
{
title: "吴昌元",
parentId: 102,
key: 115,
},
{
title: "石守银",
parentId: 102,
key: 116,
},
{
title: "高粱",
parentId: 102,
key: 117,
}
]
}
]
}
]
const [deptList, setDeptList] = useState([]) const [deptList, setDeptList] = useState([])
@ -56,17 +159,17 @@ export default function Zzjgck() {
// 演示用 // 演示用
const nameObj = { // const nameObj = {
"刘测": "高伟", // "刘测": "高伟",
"若依": "刘立新", // "若依": "刘立新",
"张雨齐": "彭双林", // "张雨齐": "彭双林",
"杜飞": "王忠明", // "杜飞": "王忠明",
"李斯": "刘艳华", // "李斯": "刘艳华",
"李峰": "吴吉琛", // "李峰": "吴吉琛",
"刘玉": "赵国栋", // "刘玉": "赵国栋",
"李星雨": "李星雨", // "李星雨": "李星雨",
} // }
const handleTreeList = (dept, user) => { const handleTreeList = (dept, user) => {
const deptArr = dept.map(item => { const deptArr = dept.map(item => {
return { return {
@ -77,7 +180,7 @@ export default function Zzjgck() {
children: user.filter(u => u.deptId == item.deptId).map(u => ({ children: user.filter(u => u.deptId == item.deptId).map(u => ({
...u, ...u,
value: u.userId, value: u.userId,
title: nameObj[u.nickName], title: u.nickName,
})) }))
} }
}) })
@ -93,11 +196,13 @@ export default function Zzjgck() {
}, [deptUserList, deptList]) }, [deptUserList, deptList])
const jgOptions = useMemo(() => { const jgOptions = useMemo(() => {
if (treeList.length > 0) { return jgOption(demoList)
return jgOption(treeList); // if (treeList.length > 0) {
} else {
return {} // return jgOption(treeList);
} // } else {
// return {}
// }
}, [treeList]) }, [treeList])
useEffect(() => { useEffect(() => {

View File

@ -12,7 +12,7 @@ export default function jgOption(data1) {
top: '10%', top: '10%',
left: '10%', left: '10%',
bottom: '20%', bottom: '20%',
right: '30%', right: '30%',
avoidLabelOverlap: true,//防止标签重叠 avoidLabelOverlap: true,//防止标签重叠
roam: true, //移动+缩放 'scale' 或 'zoom':只能够缩放。 'move' 或 'pan':只能够平移。 roam: true, //移动+缩放 'scale' 或 'zoom':只能够缩放。 'move' 或 'pan':只能够平移。
scaleLimit:{ //缩放比例 scaleLimit:{ //缩放比例
@ -100,7 +100,7 @@ export default function jgOption(data1) {
fontSize: 18, fontSize: 18,
color: '#000', color: '#000',
align: 'center', align: 'center',
padding: [10, 10], padding: [5, 10],
backgroundColor: { backgroundColor: {
image: three, image: three,
repeat: "norepeat", repeat: "norepeat",

View File

@ -86,8 +86,6 @@ const Page = () => {
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.ddjl.page).find_noCode); const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.ddjl.page).find_noCode);
console.log(tableProps);
/** /**
* @description 处理成功的回调 * @description 处理成功的回调
*/ */
@ -109,7 +107,7 @@ const Page = () => {
"pageSize": 10, "pageSize": 10,
"pageNumber": 1 "pageNumber": 1
}, },
"dateSo": { "dateTimeSo": {
"start": moment().format('YYYY-01-01 00:00:00'), "start": moment().format('YYYY-01-01 00:00:00'),
"end": moment().format('YYYY-MM-DD HH:mm:ss') "end": moment().format('YYYY-MM-DD HH:mm:ss')
} }

View File

@ -21,24 +21,24 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role, setIsChecked, setDelVa
} }
const onFinish = (values) => { const onFinish = (values) => {
let dateSo; let dateTimeSo;
if (values.tm) { if (values.tm) {
dateSo = { dateTimeSo = {
start: moment(values.tm[0]).format('YYYY-MM-DD 00:00:00'), start: moment(values.tm[0]).format('YYYY-MM-DD 00:00:00'),
end: moment(values.tm[1]).format('YYYY-MM-DD 00:00:00') end: moment(values.tm[1]).format('YYYY-MM-DD 00:00:00')
} }
} }
delete values.tm delete values.tm
setSearchVal({...values, dateSo}); setSearchVal({...values, dateTimeSo});
} }
useEffect(() => { useEffect(() => {
let dateSo = { let dateTimeSo = {
start: moment().format('YYYY-01-01 00:00:00'), start: moment().format('YYYY-01-01 00:00:00'),
end: moment().format('YYYY-MM-DD 00:00:00') end: moment().format('YYYY-MM-DD 00:00:00')
} }
form.setFieldValue("tm", [moment(dateSo.start), moment(dateSo.end)]) form.setFieldValue("tm", [moment(dateTimeSo.start), moment(dateTimeSo.end)])
setSearchVal({ dateSo }) setSearchVal({ dateTimeSo })
}, []) }, [])
return ( return (

View File

@ -97,11 +97,16 @@ const ModalForm = ({ mode, record,onEdit,onSave,onCrudSuccess }) => {
try { try {
const result = await httpget2(apiurl.rcgl.zbgl.zbrz.rotaUser, {rotaDate: moment(date).format('YYYY-MM-DD')}); const result = await httpget2(apiurl.rcgl.zbgl.zbrz.rotaUser, {rotaDate: moment(date).format('YYYY-MM-DD')});
if (result.code == 200 && mode == "save") { if (result.code == 200 && mode == "save") {
const dept = result.data.find(item => item.rotaType == 2).userId; if (result.data.length > 0) {
const lead = result.data.find(item => item.rotaType == 1).userId; const dept = result.data.find(item => item.rotaType == 2).userId;
form.setFieldValue("dutyUserId",dept) const lead = result.data.find(item => item.rotaType == 1).userId;
form.setFieldValue("leaderUserId",lead) form.setFieldValue("dutyUserId",dept)
} form.setFieldValue("leaderUserId",lead)
} else {
form.setFieldValue("dutyUserId",'')
form.setFieldValue("leaderUserId",'')
}
}
} catch (error) { } catch (error) {
console.log(error); console.log(error);