Compare commits

..

No commits in common. "280ea1adb59e426592a0459634bb637f5a141768" and "5957c16915042988ec5b3d48af45ce427342b31a" have entirely different histories.

163 changed files with 1600 additions and 7493 deletions

BIN
build.rar Normal file

Binary file not shown.

View File

@ -44,7 +44,6 @@
"react-audio-player": "^0.17.0", "react-audio-player": "^0.17.0",
"react-cookies": "^0.1.1", "react-cookies": "^0.1.1",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-draggable": "^4.4.6",
"react-konva": "^18.2.3", "react-konva": "^18.2.3",
"react-org-tree": "^1.0.1", "react-org-tree": "^1.0.1",
"react-pdf": "^7.3.3", "react-pdf": "^7.3.3",
@ -54,7 +53,6 @@
"react-router-dom": "^6.3.0", "react-router-dom": "^6.3.0",
"react-scripts": "5.0.1", "react-scripts": "5.0.1",
"react-window": "^1.8.10", "react-window": "^1.8.10",
"react-zoom-pan-pinch": "^3.7.0",
"redux": "^4.2.0", "redux": "^4.2.0",
"typescript": "^4.7.4" "typescript": "^4.7.4"
}, },

Binary file not shown.

Before

Width:  |  Height:  |  Size: 487 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 261 B

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 482 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 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,36 +38,26 @@ const HeaderUser: React.FC<{
} }
const onFinish = async (val: any) => { const onFinish = async(val:any)=>{
const path = `${apiurl.systemM.userM.updatePassword}?oldPassword=${val.oldPassword}&newPassword=${val.newPassword}`; if(val.newSecretKey!==val.secondSecretKey){
createCrudService(path).userEdit().then((result) => { message.error('确认密码错误')
if (result?.code === 200) { return
message.success('修改成功,即将重新登录') }
setOpen(false) const params = {
oldSecretKey:encryptData(val.oldSecretKey),
newSecretKey:encryptData(val.newSecretKey),
secondSecretKey:encryptData(val.secondSecretKey),
userId: localStorage.getItem('userId')
}
const res = await httppost2(apiurl.setPassword,params)
if(res.code===200){
message.success('修改成功')
setTimeout(() => { setTimeout(() => {
logout() logout()
}, 1500); }, 1500);
}else{
message.error(res.description)
} }
})
// if(val.newSecretKey!==val.secondSecretKey){
// message.error('确认密码错误')
// return
// }
// const params = {
// oldSecretKey:encryptData(val.oldSecretKey),
// newSecretKey:encryptData(val.newSecretKey),
// 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)
// }
} }
@ -100,7 +90,7 @@ const HeaderUser: React.FC<{
</div>:null </div>:null
} }
<Modal destroyOnClose title="修改密码" open={open} onOk={()=>setOpen(false)} onCancel={()=>setOpen(false)} footer={null}> <Modal title="修改密码" open={open} onOk={()=>setOpen(false)} onCancel={()=>setOpen(false)} footer={null}>
<Form <Form
name="basic" name="basic"
labelCol={{span: 5}} labelCol={{span: 5}}
@ -111,23 +101,23 @@ const HeaderUser: React.FC<{
> >
<Form.Item <Form.Item
label="原密码" label="原密码"
name="oldPassword" name="oldSecretKey"
rules={[{required: true}]}> rules={[{required: true}]}>
<Input.Password /> <Input.Password />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="新密码" label="新密码"
name="newPassword" name="newSecretKey"
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,xyt_httpput} from "../../utils/request"; import {httppost2, download, httpPostFile, httpget, httpget2,httpget6} from "../../utils/request";
import apiurl from "../../service/apiurl"; import apiurl from "../../service/apiurl";
import {config} from "../../config"; import {config} from "../../config";
@ -156,10 +156,6 @@ 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) || {};
@ -250,7 +246,6 @@ 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

@ -85,14 +85,14 @@ function usePageTable<T>(
setState(s => ({ ...s, loading: true })); setState(s => ({ ...s, loading: true }));
const pageParams = { const pageParams = {
pageNumber: opt?.pageNumber ?? state.pageNumber, pageNumber: opt?.pageNumber ?? state.pageNumber,
pageSize: opt?.pageSize ?? state.pageSize, pageSize: opt?.pageSize ?? 10,
sortField: opt?.sortField ?? state.sortField, sortField: opt?.sortField ?? state.sortField,
sortOrder: opt?.sortOrder ?? state.sortOrder, sortOrder: opt?.sortOrder ?? state.sortOrder,
search: opt?.search ?? state.search, search: opt?.search ?? state.search,
}; };
const { search, ...params } = pageParams; const { search, ...params } = pageParams;
// console.log('search',search); // console.log('search',search);
console.log('pageParams',pageParams); // console.log('params',params);
service({ ...search, ...params }).then((data) => { service({ ...search, ...params }).then((data) => {
if (!abort.current) { if (!abort.current) {
@ -169,7 +169,7 @@ function usePageTable<T>(
current: state.pageNumber, current: state.pageNumber,
total: state.total, total: state.total,
pageSizeOptions: ['10', '15', '20', '50', '100'], pageSizeOptions: ['10', '15', '20', '50', '100'],
hideOnSinglePage: false, hideOnSinglePage: true,
position: ['bottomRight'], position: ['bottomRight'],
}, },
loading: state.loading, loading: state.loading,

View File

@ -192,9 +192,9 @@ export async function loadMenu(): Promise<MenuItem[]> {
const id = idgen() const id = idgen()
return [ return [
{ id: id(), title: '水库一张图', path: '/mgr/home', icon: 'yzt' }, { id: id(), title: '水库一张图', path: '/mgr/home', icon: 'jbqk' },
{ {
id: id(), title: '四全', redirect: '/mgr/sq/qfg/zcdjxx', icon: 'sz', id: id(), title: '四全', redirect: '/mgr/sq/qfg/zcdjxx', icon: 'fxzb',
children: [ children: [
{ {
id: id(), title: '全覆盖', redirect: '/mgr/sq/qfg/zcdjxx', id: id(), title: '全覆盖', redirect: '/mgr/sq/qfg/zcdjxx',
@ -216,9 +216,7 @@ export async function loadMenu(): Promise<MenuItem[]> {
{ id: id(), title: '水库水情', path: '/mgr/sq/qth/sksq'}, { id: id(), title: '水库水情', path: '/mgr/sq/qth/sksq'},
{ id: id(), title: '河道水情', path: '/mgr/sq/qth/hdsq'}, { id: id(), title: '河道水情', path: '/mgr/sq/qth/hdsq'},
{ id: id(), title: '实时雨情', path: '/mgr/sq/qth/ssyq'}, { id: id(), title: '实时雨情', path: '/mgr/sq/qth/ssyq'},
{ id: id(), title: '土壤墒情', path: '/mgr/sq/qth/trsq'}, { id: id(), title: '大坝安全监测', path: '/mgr/sq/qth/dbaqjc'},
{ id: id(), title: '水库溢洪', path: '/mgr/sq/qth/skyh'},
// { id: id(), title: '大坝安全监测', path: '/mgr/sq/qth/dbaqjc'},
{ id: id(), title: '视频监控', path: '/mgr/sq/qth/spjk'}, { id: id(), title: '视频监控', path: '/mgr/sq/qth/spjk'},
] ]
}, },
@ -232,7 +230,7 @@ export async function loadMenu(): Promise<MenuItem[]> {
] ]
}, },
{ {
id: id(), title: '四制', redirect: '/mgr/sz/gltx/zzjgck', icon: 'sz', id: id(), title: '四制', redirect: '/mgr/sz/gltx/zzjgck', icon: 'jbqk',
children: [ children: [
{ {
id: id(), title: '管理体系', redirect: '/mgr/sz/gltx/zzjgck', id: id(), title: '管理体系', redirect: '/mgr/sz/gltx/zzjgck',
@ -299,7 +297,7 @@ export async function loadMenu(): Promise<MenuItem[]> {
] ]
}, },
{ {
id: id(), title: '四预', redirect: '/mgr/sy/fhxzfx', icon: 'sz', id: id(), title: '四预', redirect: '/mgr/sy/fhxzfx', icon: 'fxzb',
children: [ children: [
{ id: id(), title: '防洪形势', path: '/mgr/sy/fhxzfx' }, { id: id(), title: '防洪形势', path: '/mgr/sy/fhxzfx' },
{ id: id(), title: '天气预报', path: '/mgr/sy/tqyb' }, { id: id(), title: '天气预报', path: '/mgr/sy/tqyb' },
@ -326,7 +324,7 @@ export async function loadMenu(): Promise<MenuItem[]> {
], ],
}, },
{ {
id: id(), title: '四管', redirect: '/mgr/sg/xcxj/xcrw', icon: 'sz', id: id(), title: '四管', redirect: '/mgr/sg/xcxj/xcrw', icon: 'fxzb',
children: [ children: [
{ {
id: id(), title: '巡查巡检', redirect: '/mgr/sg/xcxj/xcrw', id: id(), title: '巡查巡检', redirect: '/mgr/sg/xcxj/xcrw',
@ -350,7 +348,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 +358,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: [
@ -389,7 +387,7 @@ export async function loadMenu(): Promise<MenuItem[]> {
], ],
}, },
{ {
id: id(), title: '工程安全监测', redirect: '/mgr/gcaqjc/gcaqyj/bzt', icon: 'xtgl', id: id(), title: '工程安全监测', redirect: '/mgr/gcaqjc/gcaqyj/bzt', icon: 'fxzb',
children: [ children: [
{ {
id: id(), title: '布置图', path: '/mgr/gcaqjc/gcaqyj/bzt', id: id(), title: '布置图', path: '/mgr/gcaqjc/gcaqyj/bzt',
@ -414,16 +412,14 @@ export async function loadMenu(): Promise<MenuItem[]> {
{ id: id(), title: '渗压监测', path: '/mgr/gcaqjc/sjtjcx/syjx' }, { id: id(), title: '渗压监测', path: '/mgr/gcaqjc/sjtjcx/syjx' },
{ id: id(), title: '渗流监测 ', path: '/mgr/gcaqjc/sjtjcx/sljx' }, { id: id(), title: '渗流监测 ', path: '/mgr/gcaqjc/sjtjcx/sljx' },
{ id: id(), title: '位移监测 ', path: '/mgr/gcaqjc/sjtjcx/wyjx' }, { id: id(), title: '位移监测 ', path: '/mgr/gcaqjc/sjtjcx/wyjx' },
{ id: id(), title: '人工监测数据录入 ', path: '/mgr/gcaqjc/sjtjcx/sjlr' },
{ id: id(), title: '年度渗压统计表', path: '/mgr/gcaqjc/sjtjcx/ndsytjb' }, { id: id(), title: '年度渗压统计表', path: '/mgr/gcaqjc/sjtjcx/ndsytjb' },
{ id: id(), title: '年度渗流统计表', path: '/mgr/gcaqjc/sjtjcx/ndsltjb' }, { id: id(), title: '年度渗流统计表', path: '/mgr/gcaqjc/sjtjcx/ndsltjb' },
{ id: id(), title: '年度位移统计表', path: '/mgr/gcaqjc/sjtjcx/ndwytjb' },
] ]
}, },
], ],
}, },
{ {
id: id(), title: '水资源调度', redirect: '/mgr/szydd/gsnlfx', icon: 'aqjc', id: id(), title: '水资源调度', redirect: '/mgr/szydd/gsnlfx', icon: 'fxzb',
children: [ children: [
{ {
id: id(), title: '供水能力分析', path: '/mgr/szydd/gsnlfx', id: id(), title: '供水能力分析', path: '/mgr/szydd/gsnlfx',

View File

@ -1,4 +1,5 @@
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'
@ -7,11 +8,7 @@ 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",
@ -96,7 +93,6 @@ const apiurl = {
azd: service_fxdd + '/shpPlacement/getDetailsAndAddvcdDataList',//安置点 azd: service_fxdd + '/shpPlacement/getDetailsAndAddvcdDataList',//安置点
getqsydw: service_fxdd + '/iaCBsnssinfo/getDetailsAndAddvcdDataList',//企事业单位list getqsydw: service_fxdd + '/iaCBsnssinfo/getDetailsAndAddvcdDataList',//企事业单位list
getyhjmh: service_fxdd + '/iaCFlrvvlg/getDetailsAndAddvcdDataList',//沿河居民户list getyhjmh: service_fxdd + '/iaCFlrvvlg/getDetailsAndAddvcdDataList',//沿河居民户list
turangshangqing: '',
wxqdetail: service_fxdd + '/iaCDanad/detail', wxqdetail: service_fxdd + '/iaCDanad/detail',
@ -233,21 +229,6 @@ const apiurl = {
page: service_fxdd + "/osmoticShiftR/year/stat", page: service_fxdd + "/osmoticShiftR/year/stat",
export: service_fxdd + "/osmoticShiftR/year/stat/export", export: service_fxdd + "/osmoticShiftR/year/stat/export",
list1:service_fxdd + "/osmoticShiftR/year/stat/value" list1:service_fxdd + "/osmoticShiftR/year/stat/value"
},
//人工监测数据录入
sjlr:{
syjc:{
save: service_fxdd + "/osmoticPressR/insert",
edit: service_fxdd + "/osmoticPressR/update",
page: service_fxdd + "/osmoticPressR/page",
del: service_fxdd + "/osmoticPressR/del/",
},
wyjc:{
save: service_fxdd + "/osmoticShiftR/insert",
edit: service_fxdd + "/osmoticShiftR/update",
page: service_fxdd + "/osmoticShiftR/page",
del: service_fxdd + "/osmoticShiftR/del/",
}
} }
}, },
// 工程安全分析 // 工程安全分析
@ -307,8 +288,7 @@ const apiurl = {
delete: service_fxdd + "/assessTemplate/del", delete: service_fxdd + "/assessTemplate/del",
choose: service_fxdd + "/assessIndicator/choose", choose: service_fxdd + "/assessIndicator/choose",
info: service_fxdd + "/assessTemplate/queryIndicators", info: service_fxdd + "/assessTemplate/queryIndicators",
detail: service_fxdd + "/assessTemplate/detail", detail:service_fxdd + "/assessTemplate/detail"
stop:service_fxdd + "/assessTemplate/startStop"
} }
}, },
btbb: { btbb: {
@ -357,9 +337,7 @@ 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",
@ -467,10 +445,6 @@ const apiurl = {
}, },
zfzl: { zfzl: {
list: service_fxdd + "/gateValveReal/list", list: service_fxdd + "/gateValveReal/list",
historypage: service_fxdd + '/gateValveReal/log/page',
historyList: service_fxdd + '/gateValveReal/log/loglist',
historyPageExport: service_fxdd + '/gateValveReal/log/exp',
swInfo:service_fxdd + '/reservoir/water/waterInfo',
krlist: service_fxdd + "/reservoir/water/data", krlist: service_fxdd + "/reservoir/water/data",
info: service_fxdd + "/attGateValve/detail", info: service_fxdd + "/attGateValve/detail",
kgpage: service_fxdd + "/gateValveR/page", kgpage: service_fxdd + "/gateValveR/page",
@ -993,10 +967,6 @@ 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

@ -8,9 +8,6 @@ module.exports = function (app) {
target: 'http://local.gunshiiot.com:18083/',//测试 target: 'http://local.gunshiiot.com:18083/',//测试
// target: 'http://192.168.66.199:24105/',//正式 // target: 'http://192.168.66.199:24105/',//正式
// 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.32:24105/',//ls
// target: 'http://192.168.66.32:24105/', //ls
changeOrigin: true, changeOrigin: true,
}) })
); );

View File

@ -53,19 +53,7 @@ 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

@ -633,73 +633,4 @@ export const myFiltrate = (data,params)=>{
}else{ }else{
return Math.ceil(s) return Math.ceil(s)
} }
}
export const convertQuarterToDate = (quarterStr) => {
if (!quarterStr) {
return null
} }
// 将字符串按"-"分割成数组
const [year, quarter] = quarterStr.split("-")
// 判断季度并计算月份和日期
switch (quarter) {
case "Q1":
return {
startDate:`${year}-01-01`,
endDate:`${year}-03-31`
}
case "Q2":
return {
startDate:`${year}-04-01`,
endDate:`${year}-06-30`
}
case "Q3":
return {
startDate:`${year}-07-01`,
endDate:`${year}-09-30`
}
case "Q4":
return {
startDate:`${year}-10-01`,
endDate:`${year}-12-31`
}
default:
return null
}
}
export const getCurrentQuarter = (data) => {
const currentMonth = data ? moment(data).month() : moment().month(); // 获取当前月份注意月份是从0开始的
const currentYear = data ? moment(data).year() : moment().year(); // 获取当前年份
if (currentMonth >= 0 && currentMonth <= 2) {
return {
name: `${currentYear}年第1季度考核`,
value: 1
};
} else if (currentMonth >= 3 && currentMonth <= 5) {
return {
name: `${currentYear}年第2季度考核`,
value: 2
};
} else if (currentMonth >= 6 && currentMonth <= 8) {
return {
name: `${currentYear}年第3季度考核`,
value: 3
};
} else {
return {
name: `${currentYear}年第4季度考核`,
value: 4
};
}
};
export const getQuarterStartEndDates = (quarter, year) => {
const quarterStartMonth = (quarter - 1) * 3; // 计算季度起始月份
const quarterStartDate = moment({ year, month: quarterStartMonth }).startOf('month');
const quarterEndDate = quarterStartDate.clone().endOf('quarter');
return { startDate: quarterStartDate.format('YYYY-MM-DD'), endDate: quarterEndDate.format('YYYY-MM-DD') };
};

View File

@ -25,14 +25,13 @@ import Csgl from './fxzb/csgl'
import Qxdw_Gc from './fxzb/qxdw/gc/index.js' import Qxdw_Gc from './fxzb/qxdw/gc/index.js'
import Qxwl_Gc from './fxzb/qxwl/gc' import Qxwl_Gc from './fxzb/qxwl/gc'
// 工程安全监测 // 工程安全监测
import Bzt from './gcaqjc/bzt2' import Bzt from './gcaqjc/bzt'
import Yhyj from "./gcaqjc/gcaqyj/yhyj" import Yhyj from "./gcaqjc/gcaqyj/yhyj"
import Yjgzpz from "./gcaqjc/gcaqyj/yjgzpz" import Yjgzpz from "./gcaqjc/gcaqyj/yjgzpz"
import Sljc from "./gcaqjc/sjtjcx/sljc" import Sljc from "./gcaqjc/sjtjcx/sljc"
import Syjc from "./gcaqjc/sjtjcx/syjc" import Syjc from "./gcaqjc/sjtjcx/syjc"
import Wyjc from "./gcaqjc/sjtjcx/wyjc" import Wyjc from "./gcaqjc/sjtjcx/wyjc"
import Czcx from "./gcaqjc/sjtjcx/czcx" import Czcx from "./gcaqjc/sjtjcx/czcx"
import Sjlr from "./gcaqjc/sjtjcx/sjlr"
import Ndsytjb from "./gcaqjc/sjtjcx/ndsytjb" import Ndsytjb from "./gcaqjc/sjtjcx/ndsytjb"
import Ndsltjb from "./gcaqjc/sjtjcx/ndsltjb" import Ndsltjb from "./gcaqjc/sjtjcx/ndsltjb"
import Ndwytjb from "./gcaqjc/sjtjcx/ndwytjb" import Ndwytjb from "./gcaqjc/sjtjcx/ndwytjb"
@ -93,8 +92,6 @@ import Gcdsj from './sq/qzq/gcdsj'
import Sksq from './sq/qth/sksq' import Sksq from './sq/qth/sksq'
import Hdsq from './sq/qth/hdsq' import Hdsq from './sq/qth/hdsq'
import Ssyq from './sq/qth/ssyq' import Ssyq from './sq/qth/ssyq'
import Trsq from './sq/qth/trsq'
import Skyh from './sq/qth/skyh'
import Qzqda from './sq/qzq/qzqda' import Qzqda from './sq/qzq/qzqda'
// import Zcdjxx from './sq/qys/' // import Zcdjxx from './sq/qys/'
// import Zcdjxx from './sq/qfg/zcdjxx' // import Zcdjxx from './sq/qfg/zcdjxx'
@ -174,8 +171,6 @@ const AppRouters: React.FC = () => {
{ path: 'sq/qth/sksq', element: <Sksq /> }, { path: 'sq/qth/sksq', element: <Sksq /> },
{ path: 'sq/qth/hdsq', element: <Hdsq /> }, { path: 'sq/qth/hdsq', element: <Hdsq /> },
{ path: 'sq/qth/ssyq', element: <Ssyq /> }, { path: 'sq/qth/ssyq', element: <Ssyq /> },
{ path: 'sq/qth/trsq', element: <Trsq /> },
{ path: 'sq/qth/skyh', element: <Skyh /> },
// 预警 // 预警
{ path: 'gcaqjc/gcaqyj/bzt', element: <Bzt isHome={false}/> }, { path: 'gcaqjc/gcaqyj/bzt', element: <Bzt isHome={false}/> },
@ -187,7 +182,6 @@ const AppRouters: React.FC = () => {
{ path: 'gcaqjc/sjtjcx/sljx', element: <Sljc /> }, { path: 'gcaqjc/sjtjcx/sljx', element: <Sljc /> },
{ path: 'gcaqjc/sjtjcx/wyjx', element: <Wyjc /> }, { path: 'gcaqjc/sjtjcx/wyjx', element: <Wyjc /> },
{ path: 'gcaqjc/sjtjcx/czcx', element: <Czcx /> }, { path: 'gcaqjc/sjtjcx/czcx', element: <Czcx /> },
{ path: 'gcaqjc/sjtjcx/sjlr', element: <Sjlr /> },
{ path: 'gcaqjc/sjtjcx/ndsytjb', element: <Ndsytjb /> }, { path: 'gcaqjc/sjtjcx/ndsytjb', element: <Ndsytjb /> },
{ path: 'gcaqjc/sjtjcx/ndsltjb', element: <Ndsltjb /> }, { path: 'gcaqjc/sjtjcx/ndsltjb', element: <Ndsltjb /> },
{ path: 'gcaqjc/sjtjcx/ndwytjb', element: <Ndwytjb /> }, { path: 'gcaqjc/sjtjcx/ndwytjb', element: <Ndwytjb /> },

View File

@ -18,6 +18,7 @@ export default class PicStLayer extends BaseLayer {
onAdd() { onAdd() {
PicStMapDataPromise().then((data) => { PicStMapDataPromise().then((data) => {
this._dispatch.runtime.setMarkers({ this._dispatch.runtime.setMarkers({
[this.getLayerName()]: data || [] [this.getLayerName()]: data || []
}); });

View File

@ -2,75 +2,6 @@ import { SkRealPromiseWX } from "../../../../models/_/real";
import BaseLayer from "../baselayer"; import BaseLayer from "../baselayer";
import ShuikuMarker from "./ShuikuMarker"; import ShuikuMarker from "./ShuikuMarker";
const sj = {
"stcd": "61610701",
"stnm": "檀树岗2",
"rvnm": "檀树岗河",
"hnnm": "长江中游下段北岸",
"bsnm": "长江",
"lgtd": "114.744317000",
"lttd": "31.505000000",
"stlc": "黄冈市红安县七里镇檀树岗村",
"alt": null,
"mdbz": null,
"mdpr": null,
"dtmnm": "吴淞",
"dtmel": null,
"dtpr": "0.000",
"sttp": "RR",
"dfrtms": null,
"fritm": null,
"frgrd": "3",
"esstym": "197103",
"bgfrym": "197103",
"edfrym": null,
"atcunit": "黄冈市水利和湖泊局",
"admauth": "黄冈水文",
"locality": "湖北水文",
"stbk": null,
"stazt": null,
"dstrvm": null,
"drna": "78",
"phcd": "TSG",
"usfl": "1",
"comments": "中小河流改造",
"moditime": "2022-02-23 00:00:00",
"remGd": null,
"ogid": null,
"vlfl": null,
"atid": null,
"sdfl": null,
"rma": null,
"mdps": null,
"mddt": null,
"stindex": null,
"starea": null,
"stlevel": null,
"code": null,
"ispbj": null,
"issxst": null,
"stpq": null,
"sthday": null,
"source": "SW",
"importancy": 0,
"clgtd": "114.744317000",
"clttd": "31.505000000",
"elev": null,
"crucial": 0,
"buildYear": null,
"adcd": null,
"lyid": null,
"resCode": "42120250085",
"rvCode": null,
"status": 1,
"agreement": null,
"simCard": null,
"bdCard": null,
"v": 104.1
}
export default class ShuiKuLayer extends BaseLayer { export default class ShuiKuLayer extends BaseLayer {
static LayerName = 'ShuiKuLayer'; static LayerName = 'ShuiKuLayer';
@ -94,7 +25,7 @@ export default class ShuiKuLayer extends BaseLayer {
// } // }
// }); // });
// } // }
const list = [...data,sj].map((i)=>{ const list = data.map((i)=>{
return { return {
id : i.stcd, id : i.stcd,
name: i.stnm, name: i.stnm,

View File

@ -1,69 +0,0 @@
// import clone from "clone";
import { PicStMapDataPromise } from "../../../../models/_/real";
import apiurl from "../../../../service/apiurl";
import { httppost2 } from "../../../../utils/request";
import BaseLayer from "../baselayer";
import TuRangMarker from "./TuRangMarker";
export default class TuRangLayer extends BaseLayer {
static LayerName = 'TuRangLayer';
constructor(props) {
super(props);
this.highlights = {};
}
getLayerName() {
return TuRangLayer.LayerName;
}
async onAdd() {
// const res = await httppost2(apiurl.home.turangshangqing)
const list = [
{
id:'1',
stcd: '10001',
stnm: '水田站',
wd: '53',
tm: '2025-03-19 15:00:00',
lgtd: "114.7684000",
lttd: "31.4941000"
},
{
id:'2',
stcd: '10002',
stnm: '旱田站',
wd: '21',
tm: '2025-03-19 15:00:00',
lgtd: "114.7984000",
lttd: "31.4941000"
},
]
this._dispatch.runtime.setMarkers({
[this.getLayerName()]: list || []
});
}
setSetting(setting) {
const highlights = setting?.highlight?.TuRangLayer;
if (highlights !== this._setting?.highlight?.TuRangLayer) {
const setting = {};
if (highlights) {
for (const h of highlights) {
setting[h] = true
}
}
this._dispatch.map.setMarkerSetting({
[this.getLayerName()]: setting,
});
}
this._setting = setting;
}
getComponentCls() {
return TuRangMarker;
}
}

File diff suppressed because one or more lines are too long

View File

@ -46,9 +46,9 @@ const ToolBar = ({search, defaultParams}) => {
<Form.Item> <Form.Item>
<Button type="primary" htmlType="submit">查询</Button> <Button type="primary" htmlType="submit">查询</Button>
</Form.Item> </Form.Item>
{/* <Form.Item> <Form.Item>
<Button htmlType="submit">导出</Button> <Button htmlType="submit">导出</Button>
</Form.Item> */} </Form.Item>
</Form> </Form>
</> </>
); );

View File

@ -88,17 +88,12 @@ function ShuikuPop({ id, data, dispatch }) {
<Tabs.TabPane tab="数据查询" key="2"> <Tabs.TabPane tab="数据查询" key="2">
<Sksjcx record={data}/> <Sksjcx record={data}/>
</Tabs.TabPane> </Tabs.TabPane>
{
data.id!=="61610701"?
<>
<Tabs.TabPane tab="图像监测" key="3"> <Tabs.TabPane tab="图像监测" key="3">
<Txjc record={data}/> <Txjc record={data}/>
</Tabs.TabPane> </Tabs.TabPane>
<Tabs.TabPane tab="视频监测" key="4"> <Tabs.TabPane tab="视频监测" key="4">
<Spjc record={data}/> <Spjc record={data}/>
</Tabs.TabPane> </Tabs.TabPane>
</>:null
}
</Tabs> </Tabs>
</div> </div>
</div> </div>

View File

@ -1,27 +0,0 @@
import {Table} from 'antd';
import React, {useEffect, useState} from 'react';
import moment from 'moment'
const Tabledata = ({tableData}) => {
const columns = [
{ title: '序号', key: '', dataIndex: '', align: 'center',width:'40px',render:(a,b,c)=>c+1},
{ title: '数据时间', key: 'tm', dataIndex: 'tm', align: 'center',width:'200px',render: (rec) => <span>{rec ?? "-"}</span> },
{ title: '温度', key: '', dataIndex: '', align: 'center',render: (rec) => <span>{rec ?? "-"}</span> },
];
return (
<>
<Table rowKey="adcd"
sticky
columns={columns}
pagination={false}
dataSource={tableData}
scroll={{ y: "420px"}}
/>
</>
)
}
export default Tabledata

View File

@ -1,173 +0,0 @@
export default function drpOption(data,yjData) {
console.log("data",data);
// const maxVal = 0//Math.max(...data.map(obj => obj.drp))
// const max1 = Math.max(...[...data.map(obj => obj.value),...yjData?.map(obj => obj.value)])
// const min1 = Math.min(...[...data.map(obj => obj.value),...yjData?.map(obj => obj.value)])
// const max2 = Math.max(...data.map(obj => obj.rz))
// const min2 = Math.min(...data.map(obj => obj.rz))
// const yj = yjData?.map((item,index)=>{
// return {
// yAxisIndex: 0,
// name: item.yjName,
// type: 'line',
// color: item.color,
// lineStyle: {
// type: "dashed",
// width: 1,
// },
// data: data.map(o => item.value),
// symbol: 'none', // 设置标记点为'none',即去掉圆点
// smooth: 0.5
// }
// })
return {
tooltip: {
trigger: 'axis',
},
grid: [
{
top: "12%",
left: "10%",
right: "8%",
width: '80%',
height: '75%'
},
],
legend: {
top:'3%',
// 显示图例
show: true,
// 图例的位置
data: ["流量"],
},
xAxis: [
{
type: 'category',
data: data.map(o => o.tm),
inverse: false,
splitLine: {
show: false
},
axisLabel: {
padding: [0, 0, 100, 0],
color: '#333',
fontSize: 12,
formatter: val => val.slice(0,10)
},
axisLine: {
lineStyle: {
color: '#d9d9d9',
width: 1,
}
},
axisTick: {
show: false,
},
}
],
yAxis: [
{
// gridIndex: 1,
type: 'value',
position: 'left',
name: "流量(L/s)",
nameTextStyle: {
padding: [0, 0, 10, 10],
color:'#333333',
fontSize: 14
},
splitLine: {
show: true,
lineStyle: {
color: '#bfbfbf',
width: 0.5,
type: 'dotted'
}
},
axisLabel: {
color: '#333',
fontSize: 12,
},
axisLine: {
show: false
// lineStyle: {
// color: '#8c8c8c',
// width: 1,
// }
},
axisTick: {
show: false,
},
// min: Math.floor(min1*0.8),
// max: Math.ceil(max1*1.2),
},
// {
// // gridIndex: 1,
// type: 'value',
// position: 'right',
// name: "库水位(m)",
// nameTextStyle: {
// padding: [0, 0, 10, 10],
// color:'#333333',
// fontSize: 14
// },
// splitLine: {
// show: false,
// lineStyle: {
// color: '#07a6ff',
// width: 0.25,
// type: 'dotted'
// }
// },
// axisLabel: {
// color: '#333',
// fontSize: 12,
// },
// axisLine: {
// show: false
// // lineStyle: {
// // color: '#8c8c8c',
// // width: 1,
// // }
// },
// axisTick: {
// show: false,
// },
// min: Math.floor(min2*0.8),
// max: Math.ceil(max2*1.2),
// }
],
series: [
{
// xAxisIndex: 1,
// yAxisIndex: 0,
name: '流量',
type: 'line',
color: "#d6eaec",
lineStyle: {
// type: "dashed"
},
data: data.map(o => o.value),
symbol: 'none', // 设置标记点为'none',即去掉圆点
smooth: 0.5
},
// ...yj
// {
// // xAxisIndex: 1,
// yAxisIndex: 1,
// name: '库水位',
// type: 'line',
// color: "#60a0f8",
// lineStyle: {
// // type: "dashed"
// },
// data: data.map(o => o.rz),
// symbol: 'none', // 设置标记点为'none',即去掉圆点
// smooth: 0.5
// },
]
};
}

View File

@ -1,76 +0,0 @@
import React, { useEffect, useState, useMemo } from 'react';
import { Descriptions, Form, Button, Input, DatePicker } from 'antd';
import {CloseOutlined} from '@ant-design/icons';
import ReactEcharts from 'echarts-for-react';
import { httppost2 } from '../../../../../utils/request';
import apiurl from '../../../../../service/apiurl';
import moment from "moment"
import ToolBar from './toolbar';
import TableData from './TableData'
import drpOption from './drpOption';
function ShenLiu({ id, data, dispatch, onCancel }) {
console.log(data);
const [ tableData, setTableData ] = useState([])
const option = useMemo(() => drpOption(tableData), [tableData])
const width = 780;
const closePop = () => {
if(onCancel){
onCancel()
}
dispatch.runtime.closeFeaturePop(id);
};
const getData = async(tms,stcd)=>{
// const params = {
// type: 2,
// dateTimeRangeSo: {
// start: moment(tms[0]).format('YYYY-MM-DD HH:mm:ss'),
// end: moment(tms[1]).format('YYYY-MM-DD HH:mm:ss'),
// },
// stcd
// }
// const { code, data} = await httppost2(apiurl.home.syslList,params)
// if(code!==200){
// return
// }
setTableData([])
}
useEffect(()=>{
getData([moment().add(-1,'months'),moment()],data.stcd)
},[])
return (
<>
<div className="normalModalStyle homeModal1">
<div className="normalModalStyle_title">
<div className="normalModalStyle_title_icon"></div>
{data.stnm}
<div className="normalModalStyle_title_cancel">
<CloseOutlined onClick={closePop} style={{color:"#333"}}/>
</div>
</div>
<div style={{padding:'0 20px'}}>
<ToolBar search={(tms)=>getData(tms,data.stationCode)}/>
</div>
<div className='homeModal1_content'>
<div className='homeModal1_content_lf'>
<TableData tableData={tableData}/>
</div>
<div className='homeModal1_content_rf'>
{
tableData.length>0?
<ReactEcharts option={option} style={{width: "100%", height: '100%'}}/>
:<div style={{textAlign: "center", margin: "10%"}}><img src={`${process.env.PUBLIC_URL}/assets/noData.png`} alt=""/></div>
}
</div>
</div>
</div>
</>
)
}
export default React.memo(ShenLiu);

View File

@ -1,57 +0,0 @@
import { Form, message, Button, DatePicker } from 'antd';
import NormalSelect from '../../../../../components/Form/NormalSelect'
import moment from "moment"
const { RangePicker } = DatePicker;
const cysd = [
{ label:'今日',value:'今日',tms:[moment().format('YYYY-MM-DD 00:00:00'),moment().format('YYYY-MM-DD HH:mm:ss')]},
{ label:'近一周',value:'近一周',tms:[moment().add(-7,'days').format('YYYY-MM-DD HH:mm:ss'),moment().format('YYYY-MM-DD HH:mm:ss')]},
{ label:'近一月',value:'近一月',tms:[moment().add(-1,'months').format('YYYY-MM-DD HH:mm:ss'),moment().format('YYYY-MM-DD HH:mm:ss')]},
{ label:'近三月',value:'近三月',tms:[moment().add(-3,'months').format('YYYY-MM-DD HH:mm:ss'),moment().format('YYYY-MM-DD HH:mm:ss')]},
{ label:'近一年',value:'近一年',tms:[moment().add(-1,'years').format('YYYY-MM-DD HH:mm:ss'),moment().format('YYYY-MM-DD HH:mm:ss')]},
]
const ToolBar = ({search, defaultParams}) => {
const [form] = Form.useForm();
const onFinish = (val)=>{
search(val.tms)
}
return (
<>
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
<Form.Item label="时间段" name="tms">
<RangePicker
allowClear={false}
defaultValue={[moment().add(-1,'months'),moment()]}
onChange={(e)=>{
form.setFieldValue('cysd',null)
}}
style={{ width: "380px" }}
format="YYYY-MM-DD HH:mm:ss"
/>
</Form.Item>
<Form.Item
label="常用时段"
name='cysd'
>
<NormalSelect options={cysd} style={{ width: '180px' }} onChange={(e,data)=>{
if(e==='今天08:00~当前时间'&& moment().format('HH')<8){
return message.error('请在08:00后选择')
}
form.setFieldValue('tms',[moment(data.tms[0]),moment(data.tms[1])])
}}/>
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit">查询</Button>
</Form.Item>
{/* <Form.Item>
<Button htmlType="submit">导出</Button>
</Form.Item> */}
</Form>
</>
);
}
export default ToolBar;

View File

@ -41,7 +41,6 @@ import ShenLiu from './ShenLiu/index.js';
import WeiYi from './WeiYi/index.js'; import WeiYi from './WeiYi/index.js';
import XunJian from './XunJian.js' import XunJian from './XunJian.js'
import DaiChuLi from './DaiChuLi.js' import DaiChuLi from './DaiChuLi.js'
import TuRang from './TuRang'
import YinShuiGongCheng from './YinShuiGongCheng';//这个先不搞 import YinShuiGongCheng from './YinShuiGongCheng';//这个先不搞
@ -89,12 +88,6 @@ function FeaturePops({ mapobj }) {
<PciStPop id={id} data={data} dispatch={dispatch} record={data}/> <PciStPop id={id} data={data} dispatch={dispatch} record={data}/>
</Modal> </Modal>
) )
}else if (type === 'turangshangqing') {
return (
<Modal width={1050} bodyStyle={{padding:0}} title={null} closable={false} footer={null} open={true} onCancel={()=>dispatch.runtime.closeFeaturePop(id)} destroyOnClose={true}>
<TuRang id={id} data={data} dispatch={dispatch} record={data}/>
</Modal>
)
}else if (type === 'hdsw') { }else if (type === 'hdsw') {
// Comp = HdswPop; // Comp = HdswPop;
return ( return (

View File

@ -34,8 +34,8 @@ function DrpSearch({record}) {
} else { } else {
setParams({ setParams({
...params, ...params,
startTime: e[0].format("YYYY-MM-DD HH:mm"), stm: e[0].format("YYYY-MM-DD HH:mm"),
endTime: e[1].format("YYYY-MM-DD HH:mm"), etm: e[1].format("YYYY-MM-DD HH:mm"),
tm:e, tm:e,
}) })

View File

@ -7,7 +7,7 @@ import './index.less'
import MyImg from './myImg.js' import MyImg from './myImg.js'
import { httpget,httppost } from '../../../../../utils/request'; import { httpget,httppost } from '../../../../../utils/request';
import apiurl from '../../../../../service/apiurl'; import apiurl from '../../../../../service/apiurl';
import { Image,Divider } from 'antd'; import { Image } from 'antd';
function Skssjc({data}) { function Skssjc({data}) {
@ -45,33 +45,26 @@ function Skssjc({data}) {
</div> </div>
<div className="infoItem"> <div className="infoItem">
<div className="row-key">校验洪水位:</div> <div className="row-key">设计洪水位:</div>
<div className="row-value">{data?.calFloodLev ? data?.calFloodLev.toFixed(2) : '-'}</div> <div className="row-value">{data.desFloodLev ? data.desFloodLev.toFixed(2):'-'}</div>
<Divider type="vertical" style={{height:25,background:"#000",width:2,margin:"0 30px"}}/>
<div className="row-value" style={{width:"20%"}}>{(data.calFloodLev && data?.rz) ? (data?.rz - data.calFloodLev).toFixed(2):'-'}</div>
<div className="row-unit">m</div> <div className="row-unit">m</div>
</div> </div>
<div className="infoItem"> <div className="infoItem">
<div className="row-key">设计洪水位:</div> <div className="row-key">正常蓄水位:</div>
<div className="row-value">{data?.desFloodLev ? data?.desFloodLev.toFixed(2):'-'}</div> <div className="row-value">{data.normWatLev ? data.normWatLev.toFixed(2):'-'}</div>
<Divider type="vertical" style={{height:25,background:"#000",width:2,margin:"0 30px"}}/>
<div className="row-value" style={{width:"20%"}}>{(data.desFloodLev && data?.rz) ? (data?.rz - data.desFloodLev).toFixed(2):'-'}</div>
<div className="row-unit">m</div> <div className="row-unit">m</div>
</div> </div>
<div className="infoItem"> <div className="infoItem">
<div className="row-key">汛限水位:</div> <div className="row-key">汛限水位:</div>
<div className="row-value">{data.flLowLimLev ? data.flLowLimLev.toFixed(2):'-'}</div> <div className="row-value">{data.flLowLimLev ? data.flLowLimLev.toFixed(2):'-'}</div>
<Divider type="vertical" style={{height:25,background:"#000",width:2,margin:"0 30px"}}/>
<div className="row-value" style={{width:"20%"}}>{(data.flLowLimLev && data?.rz) ? (data?.rz - data.flLowLimLev).toFixed(2):'-'}</div>
<div className="row-unit">m</div> <div className="row-unit">m</div>
</div> </div>
<div className="infoItem"> <div className="infoItem">
<div className="row-key">死水位:</div> <div className="row-key">死水位:</div>
<div className="row-value">{data.deadLev ? data.deadLev.toFixed(2):'-'}</div> <div className="row-value">{data.deadLev ? data.deadLev.toFixed(2):'-'}</div>
<Divider type="vertical" style={{height:25,background:"#000",width:2,margin:"0 30px"}}/>
<div className="row-value" style={{width:"20%"}}>{(data.deadLev && data?.rz) ? (data?.rz - data.deadLev).toFixed(2):'-'}</div>
<div className="row-unit">m</div> <div className="row-unit">m</div>
</div> </div>
<div className="infoItem"> <div className="infoItem">

View File

@ -1,11 +1,12 @@
export default function drpOption({ data, wrz, grz }) { export default function drpOption({ data, wrz, grz }) {
console.log("data",wrz, grz); console.log("data",wrz, grz);
const maxVal = Math.max(...data.map(obj => obj.drp)) const maxVal = Math.max(...data.map(obj => obj.drp))
const maxSw = Math.ceil(Math.max(...data.map(obj => obj.z))) const maxSw = Math.max(...data.map(obj => obj.z))
const minSw = Math.floor(Math.min(...data.map(obj => obj.z))) const minSw = Math.min(...data.map(obj => obj.z))
const maxLl = Math.max(...data.map(obj => obj.tq)) const maxLl = Math.max(...data.map(obj => obj.tq))
const minLl = Math.min(...data.map(obj => obj.tq)) const minLl = Math.min(...data.map(obj => obj.tq))
return { return {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
@ -30,7 +31,7 @@ export default function drpOption({ data, wrz, grz }) {
// 显示图例 // 显示图例
show: true, show: true,
// 图例的位置 // 图例的位置
data: ['警戒水位', '保证水位', "降雨量", "水位", "转换流量"], data: ['警戒水位', '危险水位', "降雨量", "水位", "转换流量"],
}, },
xAxis: [ xAxis: [
{ {
@ -165,7 +166,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

@ -2,7 +2,6 @@ import AdcdLayer from "./Markers/AdcdLayer";
import AdcdAllLayer from "./Markers/AdcdAllLayer"; import AdcdAllLayer from "./Markers/AdcdAllLayer";
import FzdxLayer from "./Markers/FzdxLayer"; import FzdxLayer from "./Markers/FzdxLayer";
import PicStLayer from "./Markers/PicStLayer"; import PicStLayer from "./Markers/PicStLayer";
import TuRangLayer from "./Markers/TuRangLayer"
import HdswLayer from "./Markers/HdswLayer"; import HdswLayer from "./Markers/HdswLayer";
import XjHdswLayer from "./Markers/XjHdswLayer"; import XjHdswLayer from "./Markers/XjHdswLayer";
import XxjyswzLayer from "./Markers/XxjyswzLayer"; import XxjyswzLayer from "./Markers/XxjyswzLayer";
@ -91,7 +90,6 @@ export default class LayerMgr {
HeLiuZhuJiLayer, HeLiuZhuJiLayer,
// FzdxLayer, // FzdxLayer,
PicStLayer, PicStLayer,
TuRangLayer,
// XjHdswLayer, // XjHdswLayer,
// SmallSkRiskLayer, RhbjqLayer, XjRealDrpLayer, WarnLayer, ForecastLayer, RadarLayer, XxjyswzLayer // SmallSkRiskLayer, RhbjqLayer, XjRealDrpLayer, WarnLayer, ForecastLayer, RadarLayer, XxjyswzLayer
]; ];

View File

@ -12,7 +12,7 @@ export default function TuLi() {
return ( return (
<div className='homePage_tuli'> <div className='homePage_tuli'>
<div className='homePage_tuli_title'>图例</div> <div className='homePage_tuli_title'>雨量</div>
<div className='homePage_tuli_row'> <div className='homePage_tuli_row'>
<div className='homePage_tuli_row_text1' style={{width:'40%',marginTop:'-2px'}}> <div className='homePage_tuli_row_text1' style={{width:'40%',marginTop:'-2px'}}>
<img width={20} height={20} src={`${process.env.PUBLIC_URL}/assets/xyt/fxdd/dm.png`} alt="" /> <img width={20} height={20} src={`${process.env.PUBLIC_URL}/assets/xyt/fxdd/dm.png`} alt="" />

View File

@ -6,7 +6,6 @@ import './index.less'
import Yujing from './item_yujing/index.js' import Yujing from './item_yujing/index.js'
import Yuqing from './item_yuqing' import Yuqing from './item_yuqing'
import ShuiKu from './item_shuiku' import ShuiKu from './item_shuiku'
import TuRangShangQing from './item_turangshangqing'
import GongShui from './item_gongshui' import GongShui from './item_gongshui'
import GongCheng from './item_gongcheng' import GongCheng from './item_gongcheng'
import JianCe from './item_jiance' import JianCe from './item_jiance'
@ -23,7 +22,7 @@ import AnZhiDian from './item_anzhidian'
import QSYDW from './item_qishiyedanwei' import QSYDW from './item_qishiyedanwei'
import YHJMH from './item_yanhejuminhu' import YHJMH from './item_yanhejuminhu'
import SetWxqStation from '../setMapStation/wxq' import SetWxqStation from '../setMapStation/wxq'
import Bzt from '../../gcaqjc/bzt2' import Bzt from '../../gcaqjc/bzt'
import Tuli from '../TuLi/Tuli.js' import Tuli from '../TuLi/Tuli.js'
import Tuli2 from '../TuLi/Tuli2.js'; import Tuli2 from '../TuLi/Tuli2.js';
@ -42,13 +41,17 @@ const items = [
{ key:'1', label:'综合监视', children:[ { key:'1', label:'综合监视', children:[
{ key:'11', label:'预警', labelRight:'预警', icon:'yujing' }, { key:'11', label:'预警', labelRight:'预警', icon:'yujing' },
{ key:'12', label:'雨情', labelRight:'统计', icon:'yuqing' }, { key:'12', label:'雨情', labelRight:'统计', icon:'yuqing' },
{ key:'13', label:'水库水情', labelRight:'实时水情', icon:'shuikushuiqing' }, { key:'13', label:'水情', labelRight:'实时水情', icon:'shuikushuiqing' },
{ key:'19', label:'土壤墒情', labelRight:'土壤墒情', icon:'turangshangqing' },
{ key:'15', label:'工程安全', labelRight:'工程安全监测', icon:'gongchenganquan' }, { key:'15', label:'工程安全', labelRight:'工程安全监测', icon:'gongchenganquan' },
{ key:'16', label:'监测设备状态', labelRight:'监测设备运行', icon:'jianceshebeizhuangtai' }, { key:'16', label:'监测设备状态', labelRight:'监测设备运行', icon:'jianceshebeizhuangtai' },
// { key:'17', label:'水质', labelRight:'水质', icon:'shuizhi' }, { key:'17', label:'水质', labelRight:'水质', icon:'shuizhi' },
{ key:'18', label:'视频点', labelRight:'视频点', icon:'shipindian' }, { key:'18', label:'视频点', labelRight:'视频点', icon:'shipindian' },
] }, ] },
// { key:'2', label:'水库工程', children:[
// { key:'21', label:'水库', labelRight:'基本信息', icon:'shuiku' },
// { key:'22', label:'大坝', labelRight:'基本信息', icon:'daba' },
// { key:'23', label:'溢洪道', labelRight:'基本信息', icon:'yihongdao' },
// ] },
{ key:'2', label:'巡查巡检', children:[ { key:'2', label:'巡查巡检', children:[
{ key:'21', label:'巡查巡检', labelRight:'工程巡检', icon:'jianceshebeizhuangtai' }, { key:'21', label:'巡查巡检', labelRight:'工程巡检', icon:'jianceshebeizhuangtai' },
// { key:'22', label:'大坝', labelRight:'基本信息', icon:'daba' }, // { key:'22', label:'大坝', labelRight:'基本信息', icon:'daba' },
@ -63,11 +66,6 @@ const items = [
{ key:'4', label:'水资源调度', children:[ { key:'4', label:'水资源调度', children:[
{ key:'41', label:'供水', labelRight:'今日供水实况', icon:'gongshui' }, { key:'41', label:'供水', labelRight:'今日供水实况', icon:'gongshui' },
] }, ] },
{ key:'5', label:'水库工程', children:[
{ key:'51', label:'水库', labelRight:'基本信息', icon:'shuiku' },
{ key:'52', label:'大坝', labelRight:'基本信息', icon:'daba' },
{ key:'53', label:'溢洪道', labelRight:'基本信息', icon:'yihongdao' },
] },
] ]
@ -141,8 +139,6 @@ const HomePage = ({showPanels}) => {
setCheckedObj({ key:'31', label:'危险区', labelRight:'危险区列表', icon:'weixianqu' }) setCheckedObj({ key:'31', label:'危险区', labelRight:'危险区列表', icon:'weixianqu' })
}else if(a==='4'){ }else if(a==='4'){
setCheckedObj({ key:'41', label:'供水', labelRight:'今日供水实况', icon:'gongshui' }) setCheckedObj({ key:'41', label:'供水', labelRight:'今日供水实况', icon:'gongshui' })
}else if(a==='5'){
setCheckedObj({ key:'51', label:'水库', labelRight:'基本信息', icon:'shuiku' })
}else{ }else{
} }
}} expandIconPosition="end" accordion={true} bordered={false}> }} expandIconPosition="end" accordion={true} bordered={false}>
@ -204,12 +200,11 @@ const HomePage = ({showPanels}) => {
} }
{ checkedObj.label === '预警' ? <><Yujing mySetTms={setTms}/><Yuqing mySetTms={setTms} show={false}/></>:null } { checkedObj.label === '预警' ? <><Yujing mySetTms={setTms}/><Yuqing mySetTms={setTms} show={false}/></>:null }
{ checkedObj.label === '雨情' ? <Yuqing mySetTms={setTms} show={showTable}/>:null } { checkedObj.label === '雨情' ? <Yuqing mySetTms={setTms} show={showTable}/>:null }
{ checkedObj.label === '水库水情' ? <ShuiKu/>:null } { checkedObj.label === '水情' ? <ShuiKu/>:null }
{ checkedObj.label === '土壤墒情' ? <TuRangShangQing/>:null }
{ checkedObj.label === '供水' ? <GongShui/>:null } { checkedObj.label === '供水' ? <GongShui/>:null }
{ checkedObj.label === '工程安全' ? <GongCheng/>:null } { checkedObj.label === '工程安全' ? <GongCheng/>:null }
{ checkedObj.label === '监测设备状态' ? <JianCe/>:null } { checkedObj.label === '监测设备状态' ? <JianCe/>:null }
{/* { checkedObj.label === '水质' ? <ShuiZhi/>:null } */} { checkedObj.label === '水质' ? <ShuiZhi/>:null }
{ checkedObj.label === '视频点' ? <ShiPinDian/>:null } { checkedObj.label === '视频点' ? <ShiPinDian/>:null }
{ checkedObj.label === '巡查巡检' ? <XunChaXunJian/>:null } { checkedObj.label === '巡查巡检' ? <XunChaXunJian/>:null }
@ -236,7 +231,7 @@ const HomePage = ({showPanels}) => {
<div className='homePage_leftBottomBox'> <div className='homePage_leftBottomBox'>
{ checkedObj.label==='雨情'?<Tuli/>:null } { checkedObj.label==='雨情'?<Tuli/>:null }
{ checkedObj.label==='水库水情'?<Tuli2/>:null } { checkedObj.label==='水情'?<Tuli2/>:null }
{ checkedObj.label==='供水'?<Tuli3/>:null } { checkedObj.label==='供水'?<Tuli3/>:null }
{ (checkedObj.label==='水库'||checkedObj.label==='大坝'||checkedObj.label==='溢洪道'||checkedObj.label==='视频点')?<Tuli4/>:null } { (checkedObj.label==='水库'||checkedObj.label==='大坝'||checkedObj.label==='溢洪道'||checkedObj.label==='视频点')?<Tuli4/>:null }
{ (checkedObj.label==='危险区'||checkedObj.label==='安置点'||checkedObj.label==='企事业单位'||checkedObj.label==='沿河居民户')?<Tuli5/>:null } { (checkedObj.label==='危险区'||checkedObj.label==='安置点'||checkedObj.label==='企事业单位'||checkedObj.label==='沿河居民户')?<Tuli5/>:null }

View File

@ -80,7 +80,7 @@ const Page = () => {
<div>蓄水日期:</div> <div>蓄水日期:</div>
<div>{tableData?.storageDate?.slice(0,10)}</div> <div>{tableData?.storageDate?.slice(0,10)}</div>
</dit> </dit>
{/* <dit className='home_shuizhi_item2'> <dit className='home_shuizhi_item2'>
<div>图片资料</div> <div>图片资料</div>
<div></div> <div></div>
</dit> </dit>
@ -118,12 +118,12 @@ const Page = () => {
} }
}} }}
/> />
</div> */} </div>
{/* */} {/* */}
{/* <dit className='home_shuizhi_item2'> <dit className='home_shuizhi_item2'>
<div>视频资料:</div> <div>视频资料:</div>
<div></div> <div></div>
</dit> */} </dit>
</div> </div>
</> </>
) )

View File

@ -98,7 +98,7 @@ const Page = () => {
<div>工程特性表:</div> <div>工程特性表:</div>
<div style={{color:'#007AFDB3',cursor:'pointer'}} onClick={()=>setOpen(true)}>工程特性表详情</div> <div style={{color:'#007AFDB3',cursor:'pointer'}} onClick={()=>setOpen(true)}>工程特性表详情</div>
</dit> </dit>
{/* <div style={{width:'100%',color:'#007AFDB3',fontWeight:500,cursor:'pointer',marginTop:'10px',textAlign:'center'}}>更多详情</div> */} <div style={{width:'100%',color:'#007AFDB3',fontWeight:500,cursor:'pointer',marginTop:'10px',textAlign:'center'}}>更多详情</div>
</div> </div>

View File

@ -43,7 +43,7 @@ const Page = () => {
<div className="home_gongshui_item"> <div className="home_gongshui_item">
<div className="home_gongshui_item_title"> <div className="home_gongshui_item_title">
<img width={50} src={`${process.env.PUBLIC_URL}/assets/xyt/homeImg/gongshui2.png`} alt=""/> <img width={50} src={`${process.env.PUBLIC_URL}/assets/xyt/homeImg/gongshui2.png`} alt=""/>
灌溉用水 灌溉发电
</div> </div>
<div className="home_gongshui_item_text" style={{display:'flex',flexDirection:'column'}}> <div className="home_gongshui_item_text" style={{display:'flex',flexDirection:'column'}}>
<div style={{display:'flex'}}> <div style={{display:'flex'}}>

View File

@ -4,79 +4,10 @@ import {reservoirlist, reswarn} from "../../../service/sssq"
import { SkRealPromiseWX } from "../../../models/_/real"; import { SkRealPromiseWX } from "../../../models/_/real";
import genDamImage from '../../../components/DamGraph/DamImage' import genDamImage from '../../../components/DamGraph/DamImage'
import MyImg from './myImg' import MyImg from './myImg'
import Ykqk from './item_shuiku/yhqk'
const sj = {
"stcd": "61610701",
"stnm": "檀树岗2",
"rvnm": "檀树岗河",
"hnnm": "长江中游下段北岸",
"bsnm": "长江",
"lgtd": "114.744317000",
"lttd": "31.505000000",
"stlc": "黄冈市红安县七里镇檀树岗村",
"alt": null,
"mdbz": null,
"mdpr": null,
"dtmnm": "吴淞",
"dtmel": null,
"dtpr": "0.000",
"sttp": "RR",
"dfrtms": null,
"fritm": null,
"frgrd": "3",
"esstym": "197103",
"bgfrym": "197103",
"edfrym": null,
"atcunit": "黄冈市水利和湖泊局",
"admauth": "黄冈水文",
"locality": "湖北水文",
"stbk": null,
"stazt": null,
"dstrvm": null,
"drna": "78",
"phcd": "TSG",
"usfl": "1",
"comments": "中小河流改造",
"moditime": "2022-02-23 00:00:00",
"remGd": null,
"ogid": null,
"vlfl": null,
"atid": null,
"sdfl": null,
"rma": null,
"mdps": null,
"mddt": null,
"stindex": null,
"starea": null,
"stlevel": null,
"code": null,
"ispbj": null,
"issxst": null,
"stpq": null,
"sthday": null,
"source": "SW",
"importancy": 0,
"clgtd": "114.744317000",
"clttd": "31.505000000",
"elev": null,
"crucial": 0,
"buildYear": null,
"adcd": null,
"lyid": null,
"resCode": "42120250085",
"rvCode": null,
"status": 1,
"agreement": null,
"simCard": null,
"bdCard": null,
"v": 104.1
}
const Page = () => { const Page = () => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const [ checked, setChecked ] = useState(0)
const [data,setData] = useState([]) const [data,setData] = useState([])
console.log('aaa',data); console.log('aaa',data);
useEffect(()=>{ useEffect(()=>{
@ -90,21 +21,21 @@ const Page = () => {
},[]) },[])
const getData = async (params) => { const getData = async (params) => {
const data1 = await reservoirlist(params) setData(await reservoirlist(params))
const data2 = [...data1,sj]
setData(data2)
} }
const getShuiKu = ()=>{ const getShuiKu = ()=>{
SkRealPromiseWX.get().then((res) => { SkRealPromiseWX.get().then((res) => {
const list = [...res,sj].map((i)=>{ const list = res.map((i)=>{
return { return {
id : i.stcd, id : i.stcd,
name: i.stnm, name: i.stnm,
...i ...i
} }
}) })
const data = list[checked] const data = list[0]
dispatch.runtime.setFeaturePop({ dispatch.runtime.setFeaturePop({
id: data.id, id: data.id,
type: 'shuiku', type: 'shuiku',
@ -117,34 +48,19 @@ const Page = () => {
} }
return ( return (
<> <>
<div className="home_yuqing"> <div>
<div className="home_yuqing_header" style={{marginBottom:'10px'}}>
{
data.map((item,index)=>
<div style={{width:'50%'}}><div style={{width:'90%'}} className={checked===index?'home_yuqing_header_item avtive':'home_yuqing_header_item'} onClick={()=>setChecked(index)}>{item.stnm}</div></div>
)
}
</div>
{ {
data ? ( data ? (
<MyImg record={{...data[checked]}}/> <MyImg record={{...data[0]}}/>
) : ( ) : (
<div className="noPic">暂无数据</div> <div className="noPic">暂无数据</div>
) )
} }
<div style={{position:'absolute',right:'14px',top:'15px',color:'#409EFF',cursor:'pointer',fontWeight:'500'}} onClick={getShuiKu}>详情</div> <div style={{position:'absolute',right:'14px',top:'15px',color:'#409EFF',cursor:'pointer',fontWeight:'500'}} onClick={getShuiKu}>详情</div>
</div> </div>
<div className='homePage_head2' style={{marginTop:'10px'}}>
<div className='homePage_head2_Bg'>
<img src={`${process.env.PUBLIC_URL}/assets/xyt/homeImg/titleBg2.png`} width="14" height="14" alt="" style={{margin:'0 10px'}} />
溢洪情况
</div>
</div>
<Ykqk/>
</> </>
) )
} }

View File

@ -1,106 +0,0 @@
import echarts from 'echarts/lib/echarts';
export default function drpOption({data}) {
let arr =[]
data.forEach(item=>{
arr.push([item.w,item.rz])
})
return {
title: {
// text: "库容曲线图",
left: "40%",
},
legend: {
top:'3%',
// 显示图例
show: false,
// 图例的位置
data: ["溢洪流量"],
},
tooltip: {
trigger: 'axis',
},
grid: [
{
top: "20%",
left: "10%",
right: "5%",
bottom: "10%"
},
],
xAxis: [
{
// name: "流量m³/s",
nameGap: 0,
type: 'category',
data: data.map(o => o.bgtm),
splitLine: {
show: false
},
axisLabel: {
color: '#8c8c8c',
fontSize: 12,
formatter: val => val.slice(11,16)
},
axisLine: {
lineStyle: {
color: '#8c8c8c',
width: 0.5,
}
},
axisTick: {
show: false,
},
}
],
yAxis: [
{
type: 'value',
name: "流量m³/s",
nameTextStyle: {
padding: [0, 0, 5, -10],
color:'#8c8c8c',
fontSize: 12
},
splitLine: {
show: true,
lineStyle: {
color: '#cacaca',
width: 1,
type: 'dotted'
}
},
axisLabel: {
color: '#8c8c8c',
fontSize: 12,
formatter: val => val
},
axisLine: {
show: false
},
axisTick: {
show: false,
},
}
],
series: [
{
type: 'line',
name: '溢洪流量',
color: "#7699f3",
data: data.map(o => o.q),
// symbol: 'none' // 设置标记点为'none',即去掉圆点
symbolSize:8,
areaStyle: {
// 开启阴影
shadowColor: 'rgba(0, 0, 0, 0.1)', // 阴影颜色
shadowBlur: 10, // 阴影的模糊大小
shadowOffsetX: 5, // 阴影水平方向上的偏移
shadowOffsetY: 5, // 阴影垂直方向上的偏移
opacity: 0.5 // 区域颜色的透明度
},
},
]
};
}

View File

@ -1,49 +0,0 @@
import { useEffect, useState, useMemo } from "react"
import {useDispatch, useSelector} from "react-redux";
import {Descriptions} from "antd";
import ReactEcharts from 'echarts-for-react';
import drpOption from './drpOption'
import { httppost2 } from "../../../../utils/request";
import apiurl from "../../../../service/apiurl";
const Page = () => {
const [data,setData] = useState([])
const option = useMemo(() => {
return drpOption({data});
}, [data])
useEffect(()=>{
(async()=>{
const {data,code} = await httppost2(apiurl.dataResourcesCenter.projectAndWater.xl.list,{stcd:'61610700'})
if(code!==200){
return
}
setData(data)
})()
},[])
return (
<>
<div style={{width:'100%',height:'240px'}}>
<ReactEcharts
option={option}
style={{width: "100%", height: '100%'}}
/>
</div>
<div style={{padding:'15px 0px 10px 15px'}}>
<Descriptions column={2}>
<Descriptions.Item labelStyle={{color:"#8c8c8c"}} label="实时水位">{103.89}m</Descriptions.Item>
<Descriptions.Item labelStyle={{color:"#70B603"}} label="转换溢洪流量">{0.20}/s</Descriptions.Item>
<Descriptions.Item labelStyle={{color:"#8c8c8c"}} label="近24h溢洪量">{8.67}万m³</Descriptions.Item>
<Descriptions.Item labelStyle={{color:"#8c8c8c"}} label="采集时间">{'06-24 09:30'}</Descriptions.Item>
</Descriptions>
</div>
</>
)
}
export default Page

View File

@ -1,95 +0,0 @@
import { useEffect, useState } from "react"
import {useDispatch, useSelector} from "react-redux";
import { Table, Modal, message } from 'antd';
import { httppost2 } from '../../../utils/request';
import apiurl from '../../../service/apiurl';
const Page = () => {
const dispatch = useDispatch();
const [ tableData, setTableData ] = useState([])//在线
const columns = [
{ title: '站点', key: 'stnm', dataIndex: 'stnm',align: "center",width:80, ellipsis: true, },
{ title: '温度', key: 'wd', dataIndex: 'wd',align: "center",width:80, ellipsis: true, },
{ title: '监测时间', key: 'tm', dataIndex: 'tm',align: "center",width: 150, ellipsis: true },
];
useEffect(()=>{
dispatch.map.setLayerVisible({ TuRangLayer: true })
getData()
return ()=>{
dispatch.map.setLayerVisible({ TuRangLayer: false })
}
},[])
const getData = async()=>{
// const { code, data} = await httppost2(apiurl.home.turangshangqing)
// if(code!==200){
// return
// }
const list = [
{
id:'1',
stcd: '10001',
stnm: '水田站',
wd: '53',
tm: '2025-03-19 15:00:00',
lgtd: "114.7684000",
lttd: "31.4941000"
},
{
id:'2',
stcd: '10002',
stnm: '旱田站',
wd: '21',
tm: '2025-03-19 15:00:00',
lgtd: "114.7984000",
lttd: "31.4941000"
},
]
setTableData(list)
}
return (
<>
<div className="home_yuqing">
<div className="ant-card-body" style={{padding:"10px"}}>
<Table rowKey="stationCode"
sticky
columns={columns}
pagination={false}
dataSource={tableData}
scroll={{ y: "300px"}}
onRow={
(row)=>({
onClick:()=>{
// dispatch.runtime.setCameraTarget({
// center: [row.lgtd, row.lttd],
// zoom: 13,
// pitch: 60
// })
dispatch.runtime.setFeaturePop({
id: row.id,
data:{...row},
type: 'turangshangqing',
lgtd: row.lgtd,
lttd: row.lttd,
})
}
})
}
/>
</div>
</div>
</>
)
}
export default Page

View File

@ -25,7 +25,7 @@ const MyImg = ({ record }) => {
return ( return (
<div style={{ <div style={{
flexGrow: 1, flexGrow: 1,
height: '300px', height: '33vh',
overflow: 'hidden', overflow: 'hidden',
position: 'relative', position: 'relative',
backgroundColor: "#eff3f6", backgroundColor: "#eff3f6",

View File

@ -57,8 +57,6 @@ const Page = () => {
const params = { const params = {
search: { search: {
...searchVal, ...searchVal,
'orderField':'id',
'isAsc':true
} }
}; };
search(params) search(params)
@ -79,7 +77,7 @@ const Page = () => {
ref={refModal} ref={refModal}
title="" title=""
component={ModalForm} component={ModalForm}
onCrudSuccess={()=>refresh({search:{'orderField':'id','isAsc':true}})} onCrudSuccess={refresh}
/> />
<BasicCrudModal <BasicCrudModal
width={1000} width={1000}
@ -87,7 +85,7 @@ const Page = () => {
ref={refModal2} ref={refModal2}
title="" title=""
component={ModalForm2} component={ModalForm2}
onCrudSuccess={()=>refresh({search:{'orderField':'id','isAsc':true}})} onCrudSuccess={refresh}
/> />
<BasicCrudModal <BasicCrudModal
width={1500} width={1500}
@ -95,7 +93,7 @@ const Page = () => {
ref={refModal3} ref={refModal3}
title="" title=""
component={ModalForm3} component={ModalForm3}
onCrudSuccess={()=>refresh({search:{'orderField':'id','isAsc':true}})} onCrudSuccess={refresh}
/> />
</div> </div>
</> </>

View File

@ -121,7 +121,6 @@ const ModalForm = ({ mode, record,onEdit,onSave,onCrudSuccess }) => {
<Input <Input
style={{ width: '100%' }} style={{ width: '100%' }}
allowClear allowClear
disabled={mode==='view'}
/> />
</Form.Item> </Form.Item>
</Col> </Col>
@ -138,7 +137,6 @@ const ModalForm = ({ mode, record,onEdit,onSave,onCrudSuccess }) => {
<Input <Input
style={{ width: '100%' }} style={{ width: '100%' }}
allowClear allowClear
disabled={mode==='view'}
/> />
</Form.Item> </Form.Item>
</Col> </Col>
@ -152,7 +150,7 @@ const ModalForm = ({ mode, record,onEdit,onSave,onCrudSuccess }) => {
})} })}
rules={[{ required: true }]} rules={[{ required: true }]}
> >
<DatePicker allowClear style={{width:'280px'}} disabled={mode==='view'}/> <DatePicker allowClear style={{width:'280px'}} />
</Form.Item> </Form.Item>
</Col> </Col>
</Row> </Row>
@ -166,7 +164,6 @@ const ModalForm = ({ mode, record,onEdit,onSave,onCrudSuccess }) => {
<Input <Input
style={{ width: '100%' }} style={{ width: '100%' }}
allowClear allowClear
disabled={mode==='view'}
/> />
</Form.Item> </Form.Item>
</Col> </Col>
@ -180,7 +177,7 @@ const ModalForm = ({ mode, record,onEdit,onSave,onCrudSuccess }) => {
})} })}
rules={[{ required: true }]} rules={[{ required: true }]}
> >
<DatePicker allowClear style={{width:'280px'}} disabled={mode==='view'}/> <DatePicker allowClear style={{width:'280px'}} />
</Form.Item> </Form.Item>
</Col> </Col>
</Row> </Row>
@ -215,7 +212,7 @@ const ModalForm = ({ mode, record,onEdit,onSave,onCrudSuccess }) => {
</Col> </Col>
</Row> </Row>
<Row gutter={[16]} style={{margin:"-25px 0 0 14px"}}> <Row gutter={[16]}>
{ {
loading ? <span>文件正在上传中请等待</span> : loading ? <span>文件正在上传中请等待</span> :
fileList.length > 0 && fileList.map(file => { fileList.length > 0 && fileList.map(file => {

View File

@ -121,7 +121,6 @@ const ModalForm = ({ mode, record,onEdit,onSave,onCrudSuccess }) => {
<Input <Input
style={{ width: '100%' }} style={{ width: '100%' }}
allowClear allowClear
disabled={mode==='view'}
/> />
</Form.Item> </Form.Item>
</Col> </Col>
@ -138,7 +137,6 @@ const ModalForm = ({ mode, record,onEdit,onSave,onCrudSuccess }) => {
<Input <Input
style={{ width: '100%' }} style={{ width: '100%' }}
allowClear allowClear
disabled={mode==='view'}
/> />
</Form.Item> </Form.Item>
</Col> </Col>
@ -152,7 +150,7 @@ const ModalForm = ({ mode, record,onEdit,onSave,onCrudSuccess }) => {
})} })}
rules={[{ required: true }]} rules={[{ required: true }]}
> >
<DatePicker allowClear style={{width:'280px'}} disabled={mode==='view'}/> <DatePicker allowClear style={{width:'280px'}} />
</Form.Item> </Form.Item>
</Col> </Col>
</Row> </Row>
@ -166,7 +164,6 @@ const ModalForm = ({ mode, record,onEdit,onSave,onCrudSuccess }) => {
<Input <Input
style={{ width: '100%' }} style={{ width: '100%' }}
allowClear allowClear
disabled={mode==='view'}
/> />
</Form.Item> </Form.Item>
</Col> </Col>
@ -180,7 +177,7 @@ const ModalForm = ({ mode, record,onEdit,onSave,onCrudSuccess }) => {
})} })}
rules={[{ required: true }]} rules={[{ required: true }]}
> >
<DatePicker allowClear style={{width:'280px'}} disabled={mode==='view'}/> <DatePicker allowClear style={{width:'280px'}} />
</Form.Item> </Form.Item>
</Col> </Col>
</Row> </Row>
@ -215,7 +212,7 @@ const ModalForm = ({ mode, record,onEdit,onSave,onCrudSuccess }) => {
</Col> </Col>
</Row> </Row>
<Row gutter={[16]} style={{margin:"-25px 0 0 14px"}}> <Row gutter={[16]}>
{ {
loading ? <span>文件正在上传中请等待</span> : loading ? <span>文件正在上传中请等待</span> :
fileList.length > 0 && fileList.map(file => { fileList.length > 0 && fileList.map(file => {

View File

@ -14,9 +14,6 @@ const ModalForm = ({ mode, record,onEdit,onSave,close }) => {
const [checked, setChecked] = useState(true) const [checked, setChecked] = useState(true)
const onFinish = async(values) => { const onFinish = async(values) => {
const userId = localStorage.getItem("userId");
const userName = localStorage.getItem("userName");
const params = { const params = {
...values, ...values,
forecastTm: record.tms.forecastTime, forecastTm: record.tms.forecastTime,
@ -27,7 +24,6 @@ const ModalForm = ({ mode, record,onEdit,onSave,close }) => {
forecastWarm: record.tms.forecastWarm, forecastWarm: record.tms.forecastWarm,
type: record.tms.type, type: record.tms.type,
voList:record.data, voList:record.data,
userId:userId+'_'+userName
} }
if (mode === 'save') { if (mode === 'save') {

View File

@ -25,13 +25,9 @@ const ModalForm = ({ mode, record,onEdit,onSave,onSimilarSave }) => {
console.log(checked); console.log(checked);
const onFinish = (values) => { const onFinish = (values) => {
const userId = localStorage.getItem("userId");
const userName = localStorage.getItem("userName");
const params = { const params = {
...values, ...values,
status:checked?'0':'1', status:checked?'0':'1'
userId:userId+'_'+userName
} }
console.log(params); console.log(params);

View File

@ -36,8 +36,8 @@ const Page = () => {
checked={v==='0'?true:false} checked={v==='0'?true:false}
/> />
}, },
{ title: '创建日期', key: 'updateTm', dataIndex: 'updateTm', width: 140,align:"center", }, { title: '创建日期', key: 'stationCode', dataIndex: 'stationCode', width: 140,align:"center", },
{ title: '创建人', key: 'userId', dataIndex: 'userId', width: 140,align:"center",render:(v)=>v?.split('_')?.[1] }, { title: '创建人', key: 'stationCode', dataIndex: 'stationCode', width: 140,align:"center", },
{ {
title: '操作', key: 'operation', width: 240, fixed: 'right',align: 'center', title: '操作', key: 'operation', width: 240, fixed: 'right',align: 'center',
render: (value, row, index) => (<CrudOpRender_text edit={true} del={true} command={(cmd) => () => command(cmd)(row)} />) render: (value, row, index) => (<CrudOpRender_text edit={true} del={true} command={(cmd) => () => command(cmd)(row)} />)
@ -66,8 +66,6 @@ const Page = () => {
const params = { const params = {
search: { search: {
...searchVal, ...searchVal,
"orderField":"chtm",
"isAsc":false
} }
}; };
search(params) search(params)
@ -84,7 +82,7 @@ const Page = () => {
message.error('修改失败') message.error('修改失败')
return return
} }
refresh({search:{'orderField':'chtm','isAsc':false}}) refresh()
message.success('修改成功') message.success('修改成功')
} }
@ -110,7 +108,7 @@ const Page = () => {
ref={refModal} ref={refModal}
title="" title=""
component={ModalForm} component={ModalForm}
onCrudSuccess={()=>refresh({search:{'orderField':'chtm','isAsc':false}})} onCrudSuccess={refresh}
/> />
</div> </div>
</> </>

View File

@ -242,7 +242,7 @@ const ModalForm = ({ mode, record,onEdit,onSave,onSimilarSave }) => {
</Col> </Col>
<Col span={12}> <Col span={12}>
<Form.Item <Form.Item
label="仓库地点" label="存放地点"
name="storeLocation" name="storeLocation"
> >
<Input type='text' disabled={mode==='view'} style={{width:'100%'}} allowClear /> <Input type='text' disabled={mode==='view'} style={{width:'100%'}} allowClear />
@ -271,7 +271,7 @@ const ModalForm = ({ mode, record,onEdit,onSave,onSimilarSave }) => {
<Row> <Row>
<Col span={24}> <Col span={24}>
<Form.Item <Form.Item
label="附件" label={mode !== "view" ? "附件" : ''}
name="fieldId" name="fieldId"
labelCol={{ span: 3 }} labelCol={{ span: 3 }}
wrapperCol={{ span: 19 }} wrapperCol={{ span: 19 }}

View File

@ -102,8 +102,7 @@ const Page = () => {
record.unit === 8 ? "箱" : record.unit === 8 ? "箱" :
record.unit === 9 ? "卷" : record.unit === 9 ? "卷" :
record.unit === 10 ? "立方米" : record.unit === 10 ? "立方米" :
record.unit === 11 ? "平方米" : "平方米"
""
}</span> }</span>
}, },
{ title: '库存数量', key: 'storeQuantity', dataIndex: 'storeQuantity', width: 150, ellipsis: true }, { title: '库存数量', key: 'storeQuantity', dataIndex: 'storeQuantity', width: 150, ellipsis: true },
@ -133,7 +132,7 @@ const Page = () => {
{ title: '联系电话', key: 'phone', dataIndex: 'phone', width: 150, ellipsis: true }, { title: '联系电话', key: 'phone', dataIndex: 'phone', width: 150, ellipsis: true },
{ {
title: '操作', key: 'operation', width: 240, fixed: 'right',align: 'center', title: '操作', key: 'operation', width: 240, fixed: 'right',align: 'center',
render: (value, row, index) => (<CrudOpRender_text edit={editBtn ? true : false} view={true} del={delBtn ? true : false} similarAdd={copyBtn ? true : false} command={(cmd) => () => command(cmd)(row)} />) render: (value, row, index) => (<CrudOpRender_text edit={editBtn ? true : false} del={delBtn ? true : false} similarAdd={copyBtn ? true : false} command={(cmd) => () => command(cmd)(row)} />)
}, },
]; ];

View File

@ -7,7 +7,7 @@ import drpOption from './drpOption';
import moment from 'moment'; import moment from 'moment';
import './index.less' import './index.less'
import ModalForm1 from './table1' import ModalForm1 from './table1'
import { httpget2, httppost2 } from '../../../../utils/request'; import { httppost2 } from '../../../../utils/request';
import apiurl from '../../../../service/apiurl'; import apiurl from '../../../../service/apiurl';
const Page = ({projectId,onCancel}) => { const Page = ({projectId,onCancel}) => {
@ -31,7 +31,7 @@ const Page = ({projectId,onCancel}) => {
useEffect(()=>{ useEffect(()=>{
(async()=>{ (async()=>{
const {code , data} = await httpget2(apiurl.fxdd_xyt.hsyb.ybfagl.getData+'?projectId='+projectId) const {code , data} = await httppost2(apiurl.fxdd_xyt.hsyb.ybfagl.getData+'?projectId='+projectId)
if(code!==200){ if(code!==200){
return return
} }

View File

@ -26,7 +26,7 @@ const ToolBar = ({ setSearchVal,jh}) => {
<Form.Item label="告警内容" name="warnContent"> <Form.Item label="告警内容" name="warnContent">
<Input allowClear style={{width:'180px'}}/> <Input allowClear style={{width:'180px'}}/>
</Form.Item> </Form.Item>
<Form.Item label="播报时间" name="tm"> <Form.Item label="告警时间" name="tm">
<RangePicker <RangePicker
allowClear allowClear
showTime showTime

View File

@ -142,7 +142,7 @@ export default function Page({isHome}) {
</div> </div>
) )
} }
{/* { {
slList.map((item)=> slList.map((item)=>
<div className={'gcaqjc_bzt_sl_'+item.stationCode} onClick={()=>{ <div className={'gcaqjc_bzt_sl_'+item.stationCode} onClick={()=>{
setOpenSl(true) setOpenSl(true)
@ -152,7 +152,7 @@ export default function Page({isHome}) {
<img width={20} style={{marginTop:'-4px'}} src={`${process.env.PUBLIC_URL}/assets/xyt/fxdd/${item.status===1?'sl2.png':'sl.png'}`} alt="" id="img" draggable="false" /> <img width={20} style={{marginTop:'-4px'}} src={`${process.env.PUBLIC_URL}/assets/xyt/fxdd/${item.status===1?'sl2.png':'sl.png'}`} alt="" id="img" draggable="false" />
</div> </div>
) )
} */} }
{ {
wyList.map((item)=> wyList.map((item)=>
<div className={'gcaqjc_bzt_wy_'+item.stationCode} onClick={()=>{ <div className={'gcaqjc_bzt_wy_'+item.stationCode} onClick={()=>{

View File

@ -1,283 +0,0 @@
import React, { useState, useEffect,useMemo,useRef } from 'react'
import { Table, Tabs,Modal,message,Tooltip } from 'antd';
import { useDispatch, useSelector } from 'react-redux'
import { TransformWrapper, TransformComponent } from "react-zoom-pan-pinch";
import Draggable from 'react-draggable';
import { httpget, httpget2, httppost2 } from '../../../utils/request';
import apiurl from '../../../service/apiurl';
import ShenYa from '../../Home/MapCtrl/Pops/ShenYa/index';
import ShenLiu from '../../Home/MapCtrl/Pops/ShenLiu/index.js';
import WeiYi from '../../Home/MapCtrl/Pops/WeiYi/index.js';
import DuanMian from '../../Home/MapCtrl/Pops/DuanMian/index.js';
import TuLi from '../../Home/TuLi/Tuli6.js';
import './index.less'
export default function Page({isHome}) {
const dispatch = useDispatch();
const [shouqi,setShouQi] = useState(false)
const [syList,setSyList] = useState([])
const [slList,setSlList] = useState([])
const [wyList,setWyList] = useState([])
const [dmList,setDmList] = useState([])
const [openSy, setOpenSy] = useState(false)
const [openSl, setOpenSl] = useState(false)
const [openWy, setOpenWy] = useState(false)
const [openDm, setOpenDm] = useState(false)
const [modalData, setModalData] = useState({})
const columnsSy = [
{ title: '监测点', key: 'stationCode', dataIndex: 'stationCode',align: "center", ellipsis: true },
{ title: '所属断面', key: 'profileName', dataIndex: 'profileName',width: 110,align: "center", ellipsis: true },
{ title: '监测时间', key: 'tm', dataIndex: 'tm',align: "center",width: 110, ellipsis: true, render:(v,row)=><div style={{color:row.flag===1?'red':'#3B4859'}}>{v?.slice(5,16)}</div> },
{ title: '管水位(m)', key: 'value', dataIndex: 'value',align: "center", ellipsis: true, render:(v,row)=><div style={{color:row.status===1?'red':'#3B4859'}}>{v}</div> },
]
const columnsSl = [
{ title: '监测点', key: 'stationCode', dataIndex: 'stationCode',align: "center", ellipsis: true },
{ title: '监测时间', key: 'tm', dataIndex: 'tm',align: "center",width: 150, ellipsis: true, render:(v,row)=><div style={{color:row.flag===1?'red':'#3B4859'}}>{v?.slice(5,16)}</div> },
{ title: '渗流量(L/s)', key: 'value', dataIndex: 'value',align: "center", ellipsis: true, render:(v,row)=><div style={{color:row.status===1?'red':'#3B4859'}}>{v}</div> },
]
const columnsWy = [
{ title: '监测点', key: 'stationCode', dataIndex: 'stationCode',align: "center",width: 80, ellipsis: true },
{ title: '监测时间', key: 'tm', dataIndex: 'tm',align: "center",width: 80, ellipsis: true, render:(v,row)=><div style={{color:row.flag===1?'red':'#3B4859'}}><div>{v?.slice(5,10)}</div><div>{v?.slice(11,16)}</div></div> },
{ title: <div><div>X方向</div><div>(mm)</div></div>, key: 'x', dataIndex: 'x',align: "center", ellipsis: true, render:(v,row)=><div style={{color:row.xstatus===1?'red':'#3B4859'}}>{v}</div> },
{ title: <div><div>Y方向</div><div>(mm)</div></div>, key: 'y', dataIndex: 'y',align: "center", ellipsis: true, render:(v,row)=><div style={{color:row.ystatus===1?'red':'#3B4859'}}>{v}</div> },
{ title: <div><div>H方向</div><div>(mm)</div></div>, key: 'h', dataIndex: 'h',align: "center", ellipsis: true, render:(v,row)=><div style={{color:row.hstatus===1?'red':'#3B4859'}}>{v}</div> },
]
useEffect(()=>{
getSyData()
getSlData()
getWyData()
getDmData()
},[])
const getSyData = async()=>{
const {code, data} = await httpget2(apiurl.home.sy)
const list = []
const c = ['01','04','07','16','10','13','02','05','08','17','11','14','03','06','09','12','15','24','26','28','25','27','29','18','19','20','21','22','23']
.map((i)=>{
list.push({
"stationCode": "SY"+i,
"profileName": "B0+250",
"tm": "2024-10-10 08:00:00",
"value": 195.3,
"flag": 1,
"status": 0
})
})
if(code!==200){
return
}
setSyList(list)
}
const getSlData = async()=>{
const {code, data} = await httpget2(apiurl.home.sl)
if(code!==200){
return
}
const list = [{
"stationCode": "SL01",
"profileName": null,
"tm": "2024-10-27 08:00:00",
"value": 1.18,
"flag": 1,
"status": 0
}]
setSlList(list)
}
const getWyData = async()=>{
const {code, data} = await httpget2(apiurl.home.wy)
if(code!==200){
return
}
const list = []
for(let a=1; a<33; a++){
list.push({
"stationCode": "WY"+(a<10?('0'+a):a),
"tm": "2024-10-15 08:00:00",
"flag": 1,
"x": -0.09,
"y": 0.1,
"h": 0.12,
"xstatus": 0,
"ystatus": 0,
"hstatus": 0
})
}
for(let b=1; b<37; b++){
list.push({
"stationCode": "ZY"+(b<10?('0'+b):b),
"tm": "2024-10-15 08:00:00",
"flag": 1,
"x": -0.09,
"y": 0.1,
"h": 0.12,
"xstatus": 0,
"ystatus": 0,
"hstatus": 0
})
}
setWyList(list)
}
const getDmData = async()=>{
const {code, data} = await httppost2(apiurl.home.dmList)
if(code!==200){
return
}
console.log('断面',data)
setDmList(data)
}
return (
<div className='gcaqjc_bzt'>
<TransformWrapper
limitToBounds={false}
initialScale={1}
initialPositionX={isHome?-220:-450}
initialPositionY={isHome?10:20}
maxScale={100}
minScale={0.5}
>
<TransformComponent>
<div style={{width:'calc( 100vw - 320px)',height:'calc( 100vh - 85px)',position:'relative'}}>
<img width={1500} src={`${process.env.PUBLIC_URL}/assets/xyt/fxdd/bzt6.svg`} alt="" id="img" draggable="false" />
{
syList.map((item)=>
<div className={'gcaqjc_bzt_sy_'+item.stationCode} onClick={()=>{
setOpenSy(true)
setModalData(item)
}}>
<span>{item.stationCode}</span>
<img width={10} height={10} style={{marginTop:'-4px'}} src={`${process.env.PUBLIC_URL}/assets/xyt/fxdd/${item.status===1?'sy2.png':'sy.png'}`} alt="" id="img" draggable="false" />
</div>
)
}
{/* {
slList.map((item)=>
<div className={'gcaqjc_bzt_sl_'+item.stationCode} onClick={()=>{
setOpenSl(true)
setModalData(item)
}}>
<span>{item.stationCode}</span>
<img width={10} height={10} style={{marginTop:'-4px'}} src={`${process.env.PUBLIC_URL}/assets/xyt/fxdd/${item.status===1?'sl2.png':'sl.png'}`} alt="" id="img" draggable="false" />
</div>
)
} */}
{
wyList.map((item)=>
<div
className={'gcaqjc_bzt_wy_'+item.stationCode}
onClick={()=>{
setOpenWy(true)
setModalData(item)
}}
>
<span>{item.stationCode}</span>
<img width={10} height={10} style={{marginTop:'-4px'}} src={`${process.env.PUBLIC_URL}/assets/xyt/fxdd/${(item.xstatus===1||item.ystatus===1||item.hstatus===1)?'wy2.png':'wy.png'}`} alt="" id="img" draggable="false" />
</div>
)
}
</div>
</TransformComponent>
</TransformWrapper>
{
!isHome?
<div className='gcaqjc_bzt_rightBox' style={{right:shouqi?'-404px':'4px'}}>
<Tabs defaultActiveKey="1" style={{padding:'0 5px 5px 5px'}} centered>
<Tabs.TabPane tab={<div style={{fontSize:'16px',fontWeight:500,padding:'0 15px'}}>渗压监测</div>} key="1">
<div className='gcaqjc_bzt_rightBox_table'>
<Table rowKey="stationCode"
sticky
columns={columnsSy}
pagination={false}
dataSource={syList}
scroll={{ y: "650px"}}
onRow={
(data)=>({
onClick:()=>{
setOpenSy(true)
setModalData(data)
}
})
}
/>
</div>
</Tabs.TabPane>
<Tabs.TabPane tab={<div style={{fontSize:'16px',fontWeight:500,padding:'0 15px'}}>渗流监测</div>} key="2">
<div className='gcaqjc_bzt_rightBox_table'>
<Table rowKey="stationCode"
sticky
columns={columnsSl}
pagination={false}
dataSource={slList}
scroll={{ y: "650px"}}
onRow={
(data)=>({
onClick:()=>{
setOpenSl(true)
setModalData(data)
}
})
}
/>
</div>
</Tabs.TabPane>
<Tabs.TabPane tab={<div style={{fontSize:'16px',fontWeight:500,padding:'0 15px'}}>位移监测</div>} key="3">
<div className='gcaqjc_bzt_rightBox_table'>
<Table rowKey="stationCode"
sticky
columns={columnsWy}
pagination={false}
dataSource={wyList}
scroll={{ y: "650px"}}
onRow={
(data)=>({
onClick:()=>{
setOpenWy(true)
setModalData(data)
}
})
}
/>
</div>
</Tabs.TabPane>
</Tabs>
<div className='gcaqjc_bzt_rightBox_Btn'>
<img src={`${process.env.PUBLIC_URL}/assets/xyt/fxdd/shouqi.png`} alt="" onClick={()=>setShouQi(!shouqi)}/>
</div>
</div>:null
}
{/* <div style={{position:'absolute',left:'30px',top:'calc( 100vh - 300px )'}}>
<TuLi/>
</div> */}
<Modal width={1000} wrapClassName='home_modal' bodyStyle={{padding:0}} title={null} closable={false} footer={null} open={openSy} onCancel={()=>setOpenSy(false)} destroyOnClose={true}>
<ShenYa id={modalData.stationCode} data={modalData} dispatch={dispatch} record={modalData} onCancel={()=>setOpenSy(false)}/>
</Modal>
<Modal width={1000} wrapClassName='home_modal' bodyStyle={{padding:0}} title={null} closable={false} footer={null} open={openSl} onCancel={()=>setOpenSl(false)} destroyOnClose={true}>
<ShenLiu id={modalData.stationCode} data={modalData} dispatch={dispatch} record={modalData} onCancel={()=>setOpenSl(false)}/>
</Modal>
<Modal width={1000} wrapClassName='home_modal' bodyStyle={{padding:0}} title={null} closable={false} footer={null} open={openWy} onCancel={()=>setOpenWy(false)} destroyOnClose={true}>
<WeiYi id={modalData.stationCode} data={modalData} dispatch={dispatch} record={modalData} onCancel={()=>setOpenWy(false)}/>
</Modal>
<Modal width={1000} wrapClassName='home_modal' bodyStyle={{padding:0}} title={null} closable={false} footer={null} open={openDm} onCancel={()=>setOpenDm(false)} destroyOnClose={true}>
<DuanMian id={modalData.profileCode} data={modalData} dispatch={dispatch} record={modalData} onCancel={()=>setOpenDm(false)}/>
</Modal>
</div>
)
}

View File

@ -1,674 +0,0 @@
.gcaqjc_bzt{
width: 100%;
height: 100%;
background-color: #ffffff;
overflow: hidden;
position: relative;
.gcaqjc_bzt_wrapperClass{
width: '100%';
}
.imgBox {
position: relative;
width: 1200px;
height: 800px;
border: 2px solid red;
overflow: hidden;
}
.imgBox img {
position: absolute;
width: 100%;
height: 100%;
cursor: pointer;
}
.gcaqjc_bzt_rightBox{
width: 400px;
background: #f5f7fa;
position: absolute;
right: 4px;
top: 30px;
border-radius: 5px;
border: 1px solid #eee;
.ant-tabs-nav{
margin-bottom: 5px;
}
.gcaqjc_bzt_rightBox_table{
width: 100%;
min-height: 750px;
background: #ffffff;
border: 1px solid #eee;
.ant-table-thead{
th{
height: 40px !important;
background-color: #e2edfd !important;
}
}
.ant-table-tbody{
.ant-table-measure-row{
td{
padding: 0 !important;
}
}
tr:nth-child(odd) {
td{
background-color: #f5f8fe !important;
}
}
}
}
}
.gcaqjc_bzt_rightBox_Btn{
position: absolute;
left: -25px;
top: 45%;
cursor: pointer;
}
[class*="gcaqjc_bzt_sy"]{
position: absolute;
display: flex;
flex-direction: column;
align-items: center;
font-size: 10px;
color: #00c188;
cursor: pointer;
left: 0;
top: 0;
span{
transform: scaleX(0.8);
letter-spacing: -0.8px;
font-weight: 700;
font-size: 6px;
margin-bottom: 1px;
text-shadow:
0.3px 0.3px 0.3px white, /* 白色内描边 */
-0.3px -0.3px 0.3px white, /* 白色内描边 */
0px 0px 1px white; /* 黑色外描边 */
}
img{
transform: scale(0.8);
}
}
[class*="gcaqjc_bzt_sl"]{
position: absolute;
display: flex;
flex-direction: column;
align-items: center;
font-size: 10px;
color: #00c188;
cursor: pointer;
left: 0;
top: 0;
span{
transform: scaleX(0.8);
letter-spacing: -0.8px;
font-weight: 700;
font-size: 6px;
margin-bottom: 1px;
text-shadow:
0.3px 0.3px 0.3px white, /* 白色内描边 */
-0.3px -0.3px 0.3px white, /* 白色内描边 */
0px 0px 1px white; /* 黑色外描边 */
}
img{
transform: scale(0.8);
}
}
[class*="gcaqjc_bzt_wy"]{
position: absolute;
display: flex;
flex-direction: column;
align-items: center;
color: #00c188;
cursor: pointer;
left: 0;
top: 0;
span{
transform: scaleX(0.8);
letter-spacing: -0.8px;
font-weight: 700;
font-size: 6px;
margin-bottom: 1px;
text-shadow:
0.3px 0.3px 0.3px white, /* 白色内描边 */
-0.3px -0.3px 0.3px white, /* 白色内描边 */
0px 0px 1px white; /* 黑色外描边 */
}
img{
transform: scale(0.8);
}
}
[class*="gcaqjc_bzt_dm"]{
position: absolute;
display: flex;
flex-direction: column;
align-items: center;
color: #00c188;
font-size: 10px;
cursor: pointer;
left: 0;
top: 0;
}
.gcaqjc_bzt_sy_SY01{
left: 971px;
top: 883px;
}
.gcaqjc_bzt_sy_SY02{
left: 986px;
top: 663px;
}
.gcaqjc_bzt_sy_SY03{
left: 973.5px;
top: 432px;
}
.gcaqjc_bzt_sy_SY04{
left: 994px;
top: 884px;
}
.gcaqjc_bzt_sy_SY05{
left: 1006px;
top: 663px;
}
.gcaqjc_bzt_sy_SY06{
left: 998px;
top: 430px;
}
.gcaqjc_bzt_sy_SY07{
left: 1034px;
top: 886px;
}
.gcaqjc_bzt_sy_SY08{
left: 1051px;
top: 668px;
}
.gcaqjc_bzt_sy_SY09{
left: 1037px;
top: 441px;
}
.gcaqjc_bzt_sy_SY10{
left: 994px;
top: 872px;
}
.gcaqjc_bzt_sy_SY11{
left: 1007px;
top: 650px;
}
.gcaqjc_bzt_sy_SY12{
left: 998px;
top: 442px;
}
.gcaqjc_bzt_sy_SY13{
left: 1035px;
top: 874px;
}
.gcaqjc_bzt_sy_SY14{
left: 1052px;
top: 656px;
}
.gcaqjc_bzt_sy_SY15{
left: 1037px;
top: 429px;
}
.gcaqjc_bzt_sy_SY16{
left: 1109px;
top: 884px;
}
.gcaqjc_bzt_sy_SY17{
left: 1126px;
top: 668px;
}
.gcaqjc_bzt_sy_SY18{
left: 645px;
top: 1230px;
}
.gcaqjc_bzt_sy_SY19{
left: 632px;
top: 1234px;
}
.gcaqjc_bzt_sy_SY20{
left: 677px;
top: 1316px;
}
.gcaqjc_bzt_sy_SY21{
left: 665px;
top: 1320px;
}
.gcaqjc_bzt_sy_SY22{
left: 710px;
top: 1401px;
}
.gcaqjc_bzt_sy_SY23{
left: 697px;
top: 1406px;
}
.gcaqjc_bzt_sy_SY24{
left: 51px;
top: 1478px;
}
.gcaqjc_bzt_sy_SY25{
left: 18px;
top: 1469px;
}
.gcaqjc_bzt_sy_SY26{
left: 46px;
top: 1491px;
}
.gcaqjc_bzt_sy_SY27{
left: 14px;
top: 1481px;
}
.gcaqjc_bzt_sy_SY28{
left: 37px;
top: 1500px;
}
.gcaqjc_bzt_sy_SY29{
left: 5px;
top: 1490px;
}
.gcaqjc_bzt_wy_WY01{
left: 961px;
top: 1003px;
}
.gcaqjc_bzt_wy_WY02{
left: 971px;
top: 872px;
}
.gcaqjc_bzt_wy_WY03{
left: 979px;
top: 764px;
}
.gcaqjc_bzt_wy_WY04{
left: 986px;
top: 650px;
}
.gcaqjc_bzt_wy_WY05{
left: 981px;
top: 547px;
}
.gcaqjc_bzt_wy_WY06{
left: 973px;
top: 443px;
}
.gcaqjc_bzt_wy_WY07{
left: 965px;
top: 327px;
}
.gcaqjc_bzt_wy_WY08{
left: 974px;
top: 1004px;
}
.gcaqjc_bzt_wy_WY09{
left: 983px;
top: 876px;
}
.gcaqjc_bzt_wy_WY10{
left: 992px;
top: 766px;
}
.gcaqjc_bzt_wy_WY11{
left: 996px;
top: 656px;
}
.gcaqjc_bzt_wy_WY12{
left: 993px;
top: 546px;
}
.gcaqjc_bzt_wy_WY13{
left: 986px;
top: 436px;
}
.gcaqjc_bzt_wy_WY14{
left: 978px;
top: 325.5px;
}
.gcaqjc_bzt_wy_WY15{
left: 1031px;
top: 1009px;
}
.gcaqjc_bzt_wy_WY16{
left: 1045px;
top: 879px;
}
.gcaqjc_bzt_wy_WY17{
left: 1049px;
top: 771px;
}
.gcaqjc_bzt_wy_WY18{
left: 1061px;
top: 663px;
}
.gcaqjc_bzt_wy_WY19{
left: 1050px;
top: 543px;
}
.gcaqjc_bzt_wy_WY20{
left: 1045px;
top: 434px;
}
.gcaqjc_bzt_wy_WY21{
left: 1037px;
top: 322px;
}
.gcaqjc_bzt_wy_WY22{
left: 1070px;
top: 1012px;
}
.gcaqjc_bzt_wy_WY23{
left: 1079px;
top: 882px;
}
.gcaqjc_bzt_wy_WY24{
left: 1088px;
top: 774px;
}
.gcaqjc_bzt_wy_WY25{
left: 1091px;
top: 666px;
}
.gcaqjc_bzt_wy_WY26{
left: 1088px;
top: 542px;
}
.gcaqjc_bzt_wy_WY27{
left: 1081px;
top: 432.5px;
}
.gcaqjc_bzt_wy_WY28{
left: 1040px;
top: 20px;
}
.gcaqjc_bzt_wy_WY29{
left: 974px;
top: 95px;
}
.gcaqjc_bzt_wy_WY30{
left: 1057px;
top: 34px;
}
.gcaqjc_bzt_wy_WY31{
left: 991px;
top: 111px;
}
.gcaqjc_bzt_wy_WY32{
left: 660px;
top: 1266px;
}
.gcaqjc_bzt_wy_ZY01{
left: 55px;
top: 1465px;
}
.gcaqjc_bzt_wy_ZY02{
left: 23px;
top: 1455px;
}
.gcaqjc_bzt_wy_ZY03{
left: 48px;
top: 1503px;
}
.gcaqjc_bzt_wy_ZY04{
left: 16px;
top: 1493px;
}
.gcaqjc_bzt_wy_ZY05{
left: 1080px;
top: 67px;
}
.gcaqjc_bzt_wy_ZY06{
left: 1104px;
top: 98px;
}
.gcaqjc_bzt_wy_ZY07{
left: 1128px;
top: 129px;
}
.gcaqjc_bzt_wy_ZY08{
left: 1151px;
top: 158px;
}
.gcaqjc_bzt_wy_ZY09{
left: 1176px;
top: 185px;
}
.gcaqjc_bzt_wy_ZY10{
left: 1203px;
top: 208px;
}
.gcaqjc_bzt_wy_ZY11{
left: 1233px;
top: 234px;
}
.gcaqjc_bzt_wy_ZY12{
left: 1259px;
top: 255px;
}
.gcaqjc_bzt_wy_ZY13{
left: 1288px;
top: 281px;
}
.gcaqjc_bzt_wy_ZY14{
left: 1314px;
top: 304px;
}
.gcaqjc_bzt_wy_ZY15{
left: 1344px;
top: 328px;
}
.gcaqjc_bzt_wy_ZY16{
left: 1026px;
top: 133px;
}
.gcaqjc_bzt_wy_ZY17{
left: 1058px;
top: 153px;
}
.gcaqjc_bzt_wy_ZY18{
left: 1092px;
top: 172px;
}
.gcaqjc_bzt_wy_ZY19{
left: 1124px;
top: 192px;
}
.gcaqjc_bzt_wy_ZY20{
left: 1152px;
top: 213px;
}
.gcaqjc_bzt_wy_ZY21{
left: 1181px;
top: 234px;
}
.gcaqjc_bzt_wy_ZY22{
left: 1210px;
top: 259px;
}
.gcaqjc_bzt_wy_ZY23{
left: 1237px;
top: 283px;
}
.gcaqjc_bzt_wy_ZY24{
left: 1266px;
top: 308px;
}
.gcaqjc_bzt_wy_ZY25{
left: 1292px;
top: 330px;
}
.gcaqjc_bzt_wy_ZY26{
left: 1320px;
top: 354px;
}
.gcaqjc_bzt_wy_ZY27{
left: 1213px;
top: 198px;
}
.gcaqjc_bzt_wy_ZY28{
left: 1242px;
top: 224px;
}
.gcaqjc_bzt_wy_ZY29{
left: 1268px;
top: 245px;
}
.gcaqjc_bzt_wy_ZY30{
left: 1297px;
top: 271px;
}
.gcaqjc_bzt_wy_ZY31{
left: 1324px;
top: 293px;
}
.gcaqjc_bzt_wy_ZY32{
left: 1251px;
top: 213px;
}
.gcaqjc_bzt_wy_ZY33{
left: 1277px;
top: 234px;
}
.gcaqjc_bzt_wy_ZY34{
left: 1307px;
top: 259px;
}
.gcaqjc_bzt_wy_ZY35{
left: 1261px;
top: 202px;
}
.gcaqjc_bzt_wy_ZY36{
left: 1289px;
top: 219px;
}
// .gcaqjc_bzt_sl_SL01{
// left: 479px;
// top: 594px;
// }
// .gcaqjc_bzt_sl_SL02{
// left: 679px;
// top: 594px;
// }
// .gcaqjc_bzt_wy_WY-G100{
// left: 394px;
// top: 376px;
// }
// .gcaqjc_bzt_wy_WY-G101{
// left: 594px;
// top: 376px;
// }
// .gcaqjc_bzt_dm_DM0234205820000010{
// left: 655px;
// top: 379px;
// }
// .gcaqjc_bzt_dm_DM0234205820000011{
// left: 555px;
// top: 379px;
// }
// .gcaqjc_bzt_dm_DM0234205820000012{
// left: 455px;
// top: 379px;
// }
// .gcaqjc_bzt_dm_DM0234205820000013{
// left: 1003px;
// top: 379px;
// }
// .gcaqjc_bzt_dm_DM0234205820000014{
// left: 42px;
// top: 379px;
// }
}

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,Spin } from 'antd'; import { Table, Card,Button,message,Popconfirm } 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,33 +12,25 @@ 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 && dbType1) { if (dataSources && dbType) {
return jrxOption(dataSources[0], dbType,dbType1) return jrxOption(dataSources[0],dbType)
} else { } else {
return dataSources[0]; return dataSources[0];
} }
}, [dataSources, dbType,dbType1]) }, [dataSources,dbType])
const columns = [ const columns = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" }, { title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" },
@ -48,7 +40,7 @@ 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(() => {
@ -61,13 +53,12 @@ export default function Xmzlmb() {
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 = [];
@ -81,7 +72,7 @@ export default function Xmzlmb() {
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()
@ -92,16 +83,13 @@ export default function Xmzlmb() {
}) })
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) {
@ -109,16 +97,24 @@ 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)
}) })
} }
@ -131,11 +127,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);
} }
@ -155,7 +151,7 @@ export default function Xmzlmb() {
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,dbType1)) echartsRef.current.getEchartsInstance().setOption(jrxOption(dataSources[index % dataSources.length],dbType))
index++; index++;
}, Number(1000)); }, Number(1000));
setTimer(time); // 定时器保存变量 利于停止 setTimer(time); // 定时器保存变量 利于停止
@ -165,7 +161,24 @@ 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 = {
@ -173,29 +186,26 @@ export default function Xmzlmb() {
...searchVal ...searchVal
} }
getTableData(params) getTableData(params)
getTable2Data(params)
} }
}, [trData, searchVal]); }, [trData, searchVal]);
useEffect(() => { useEffect(() => {
if (code.length) { if (code) {
getDmTree() getDmTree()
} }
if (timer) { if (timer) {
clearInterval(timer) clearInterval(timer)
} }
if (dmList.length > 0 && code.length) { if (dmList.length > 0 && code) {
let name = dmList.find(s => s.id == code)?.projNm let name = dmList.find(s => s.id == code)?.projNm
let type = (name == "大坝B0+130" || name == "大坝B0+132") ? "1" : let type = name == "大坝B0+060" ? "1" :
(name == "大坝B0+250" || name == "大坝B0+252") ? "2" : name == "大坝B0+090" ? "2" :
(name == "大坝B0+370" || name == "大坝B0+372") ? "3" : ''; name == "大坝B0+120" ? "2" : ''
let type1 = typeName[name];
setDbType(type) setDbType(type)
setDbType1(type1)
} }
}, [code, dmList]) }, [code])
useEffect(() => { useEffect(() => {
getDmList() getDmList()
}, []) }, [])
@ -210,11 +220,12 @@ 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;
@ -236,17 +247,17 @@ export default function Xmzlmb() {
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={() => {
@ -260,30 +271,48 @@ return (
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 style={{ height: 420, width: "100%",overflow:'hidden',position:'relative' }} > <div className='body-top' style={{ height: 380, width: "100%", marginTop: 10 }} >
<Rnd <Rnd
default={{ default={{
x: 0, x: 0,
y: 0, y: 0,
width: 1305, width: '68%',
height: 380 height: 380
}} }}
// style={{position:"relative"}}
> >
<div id="img"> <div id="img">
<div style={{ textAlign: "center", marginBottom: 10, fontSize: 20 }}>断面名称:{dmList.find(s => s.id == code)?.projNm}</div> <div style={{ textAlign: "center", marginBottom: 10,fontSize:20 }}>断面名称:{ dmList.find(s => s.id == code)?.projNm}</div>
{/* <div style={{ position: "absolute", top: -38, right: 131,cursor:"pointer",fontWeight:700 }}>
<div
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 <ReactEcharts
option={jrxOptions} option={jrxOptions}
style={{ width: "100%", height: 380 }} style={{ width: "100%", height: 380 }}
notMerge={true} 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"
@ -292,16 +321,13 @@ return (
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> :
<Spin size='large' style={{width:'100%',margin:'300px auto'}}></Spin>
}
</div> </div>
</div> </div>
) </div>
)
} }

View File

@ -1,109 +1,81 @@
export default function jrxOptions(data = {}, type = "1",typeName='1') { export default function jrxOptions(data = {}, type = "1") {
// debugger // const yMin = type == "1" ? 147 : type == "2" ? 146 : 146;
const yMin = type == "3" ? 70 : type == "2" ? 67 : // const yMax = type == "1" ? 209 : type == "2" ? 210 : 210;
type == '1' ? 59 : 70; const yMin = type == "1" ? 70 : type == "2" ? 70 : 70;
const yMax = type == "3" ? 129 : type == "2" ? 117 const yMax = type == "1" ? 154 : type == "2" ? 150 : 150;
: type == "1" ? 118 : 150; const type1 = ["SY05", "SY06", "SY07", "SY08"]
const type1 = ["SY01", "SY04", "SY07", "SY16"]; const type2 = ["SY09","SY10","SY11","SY12"]
const type2 = ["SY10", "SY13"]; const alltype = type == "1" ? type1 : type == "2" ? type2 : type2;
const type3 = ["SY02", "SY05", "SY08", "SY17"];
const type4 = ["SY11", "SY14"];
const type5 = ["SY03", "SY06", "SY09"];
const type6 = ["SY12", "SY15"];
const alltype = typeName == "1" ? type1 :
typeName == "2" ? type2 :
typeName == "3" ? type3 :
typeName == "4" ? type4 :
typeName == "5" ? type5 :
typeName == "6" ? type6 :[]
;
// 字体颜色 // 字体颜色
const textColor = '#666' const textColor = '#666'
const imageUrl370 = `${process.env.PUBLIC_URL}/assets/images/zb370.png ` const imageUrl060 = `${process.env.PUBLIC_URL}/assets/images/060.png `
const imageUrl250 = `${process.env.PUBLIC_URL}/assets/images/zb250.png ` const imageUrl090 = `${process.env.PUBLIC_URL}/assets/images/090.png `
const imageUrl130 = `${process.env.PUBLIC_URL}/assets/images/zb130.png ` const imageUrl = type == "1" ? imageUrl060 :
const imageUrl = type == "1" ? imageUrl130 : type == "2" ? imageUrl090 : imageUrl090;
type == "2" ? imageUrl250 :
type == "3" ? imageUrl370 : imageUrl370
;
const rule = `${process.env.PUBLIC_URL}/assets/images/ruler.png ` const rule = `${process.env.PUBLIC_URL}/assets/images/ruler.png `
// const xValue = type == "1" ? (((data?.rz - 169) + 0.75 * 14) / 0.75):
// type == "2" ? (((data?.rz - 169) + 0.85 * 14) / 0.85) : (((data?.rz - 169) + 0.85 * 14) / 0.85)
// rz 是最上面那条线 rz1是那条贴近坝面的线 xValue求解的是最上面那条线的末尾横坐标 const xValue = type == "1" ? (((data?.rz - 99) + 1.1 * 13) / 1.1):
const xValue = type == "3" ? (((data?.rz - 86) + 0.6 * 5) / 0.6) : type == "2" ? (((data?.rz - 99) + 1 * 14) / 1) : (((data?.rz - 99) + 1 * 14) / 1)
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 == "3" ?
[[0, 86], [5, 86], [xValue, data?.rz]] :
type == "2" ?
[[0, 87], [7, 87], [xValue, data?.rz]]
:
type == "1" ? type == "1" ?
[[0, 88], [10, 88], [xValue, data?.rz]] [[0, 99], [13, 99], [xValue, data?.rz]]:
: type == "2" ?
[[0, 99], [14, 99], [xValue, data?.rz]] [[0, 99], [14, 99], [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 == "3" ? [[47, 101], [47, data[alltype[0]]]] : type == "1" ? [[51.6, 85], [51.6, data[alltype[0]]]] :
type == "2" ? [[45.5, 98], [45.5, data[alltype[0]]]] : type == "2" ? [[47.5, 85], [47.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 == "3" ? [[51, 101], [51, data[alltype[1]]]] : type == "1" ? [[53.6, 85], [53.6, data[alltype[1]]]] :
type == "2" ? [[50, 98], [50, data[alltype[1]]]] : type == "2" ? [[49.5, 85], [49.5, data[alltype[1]]]] :
type == "1" ? [[51.5, 82], [51.5, data[alltype[1]]]] :
[[53.6, 158], [53.6, data[alltype[1]]]] : [[53.6, 158], [53.6, data[alltype[1]]]] :
[]; [];
const gz3 = data[alltype[2]] ? const gz3 = data[alltype[2]] ?
type == "3" ? [[58.5, 95], [58.5, data[alltype[2]]]] : type == "1" ? [[72.5, 90], [72.5, data[alltype[2]]]] :
type == "2" ? [[58, 92], [58, data[alltype[2]]]] : type == "2" ? [[66.5, 90], [66.5, 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 == "3" ? [] : type == "1" ? [[84.5, 96], [84.5, data[alltype[3]]]] :
type == "2" ? [[77, 82], [77, data[alltype[3]]]] : type == "2" ? [[77, 96], [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 == "3" ? type == "1" ?
[ [
[xValue, data?.rz], [xValue, data?.rz],
[47, data[alltype[0]]], [51.6, data[alltype[0]]],
[51, data[alltype[1]]], [53.6, data[alltype[1]]],
[58.5, data[alltype[2]]], [72.5, data[alltype[2]]],
[84.5, data[alltype[3]]]
] : ] :
type == "2" ? type == "2" ?
[ [
[xValue, data?.rz], [xValue, data?.rz],
[45.5, data[alltype[0]]], [47.5, data[alltype[0]]],
[50, data[alltype[1]]], [49.5, data[alltype[1]]],
[58, data[alltype[2]]], [66.5, 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]]],
@ -112,7 +84,7 @@ export default function jrxOptions(data = {}, type = "1",typeName='1') {
[85, data[alltype[3]]] [85, data[alltype[3]]]
] ]
: [] : []
return { return {
toolbox: { toolbox: {
show: true, show: true,
feature: { feature: {
@ -120,11 +92,11 @@ export default function jrxOptions(data = {}, type = "1",typeName='1') {
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,
@ -140,7 +112,7 @@ export default function jrxOptions(data = {}, type = "1",typeName='1') {
left: 'center', left: 'center',
// top: '11%', // top: '11%',
top: 0, top: 0,
bottom: 0, bottom:0,
z: 1, z: 1,
bounding: 'all', bounding: 'all',
style: { style: {
@ -153,7 +125,7 @@ export default function jrxOptions(data = {}, type = "1",typeName='1') {
type: 'image', type: 'image',
// id: 'background', // id: 'background',
left: '7%', left: '7%',
bottom: "5%", bottom:"5%",
z: 1, z: 1,
bounding: 'all', bounding: 'all',
style: { style: {
@ -177,15 +149,15 @@ export default function jrxOptions(data = {}, type = "1",typeName='1') {
}, },
xAxis: { xAxis: {
min: 0, min: 0,
max: 100, max:100,
axisLabel: { axisLabel: {
show: false, show:false,
// 坐标轴字体颜色 // 坐标轴字体颜色
color: textColor, color: textColor,
fontSize: 18 fontSize: 18
}, },
axisLine: { axisLine: {
show: false, show:false,
lineStyle: { lineStyle: {
color: textColor color: textColor
} }
@ -202,9 +174,9 @@ export default function jrxOptions(data = {}, type = "1",typeName='1') {
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
min:yMin, min: yMin,
max: yMax, max: yMax,
interval: 5, interval:5,
// data:[155,160,180,190,210], // data:[155,160,180,190,210],
nameTextStyle: { nameTextStyle: {
color: '#333', color: '#333',
@ -215,7 +187,7 @@ export default function jrxOptions(data = {}, type = "1",typeName='1') {
// 坐标轴字体颜色 // 坐标轴字体颜色
color: textColor, color: textColor,
fontSize: 18, fontSize: 18,
formatter: function (value, index, i) { formatter: function (value, index,i) {
if (index === 0 || value === yMax) { if (index === 0 || value === yMax) {
return ''; // 隐藏第一个刻度和最后一个刻度 return ''; // 隐藏第一个刻度和最后一个刻度
} else { } else {
@ -258,7 +230,7 @@ export default function jrxOptions(data = {}, type = "1",typeName='1') {
origin: "end", origin: "end",
color: 'rgba(0, 128, 255, 0.3)' // 设置区域填充颜色 color: 'rgba(0, 128, 255, 0.3)' // 设置区域填充颜色
}, },
data: [...rz, ...rz1] data:[...rz,...rz1]
}, },
{ {
@ -274,7 +246,7 @@ export default function jrxOptions(data = {}, type = "1",typeName='1') {
color: '#5487FF' color: '#5487FF'
}, },
markPoint: { markPoint: {
data: [{ type: 'max', x: "20%", coord: [xValue, data?.rz] }], data: [{ type: 'max',x:"20%", coord: [xValue, data?.rz] }],
symbol: 'pin', symbol: 'pin',
symbolSize: [30, 10], symbolSize: [30, 10],
itemStyle: { itemStyle: {
@ -284,12 +256,12 @@ export default function jrxOptions(data = {}, type = "1",typeName='1') {
}, },
label: { label: {
show: data?.rz ? true : false, // 是否显示标签 show: data?.rz ? true : false, // 是否显示标签
formatter: "库水位" + data?.rz + "m", // 标签格式 formatter: "库水位" +data?.rz + "m", // 标签格式
color: '#5487FF', // 标签文字颜色 color: '#5487FF', // 标签文字颜色
fontSize: 12, // 标签文字大小 fontSize: 12, // 标签文字大小
} }
}, },
data: rz data:rz
}, },
{ {
@ -303,7 +275,7 @@ export default function jrxOptions(data = {}, type = "1",typeName='1') {
lineStyle: { lineStyle: {
color: '#5487FF' color: '#5487FF'
}, },
data: rz1 data:rz1
}, },
// 管位 // 管位
{ {
@ -316,7 +288,7 @@ export default function jrxOptions(data = {}, type = "1",typeName='1') {
}, },
lineStyle: { lineStyle: {
color: '#5487FF', color: '#5487FF',
width: 6 width:6
}, },
data: gz1 data: gz1
}, },
@ -330,7 +302,7 @@ export default function jrxOptions(data = {}, type = "1",typeName='1') {
}, },
lineStyle: { lineStyle: {
color: '#5487FF', color: '#5487FF',
width: 6 width:6
}, },
data: gz2 data: gz2
}, },
@ -344,7 +316,7 @@ export default function jrxOptions(data = {}, type = "1",typeName='1') {
}, },
lineStyle: { lineStyle: {
color: '#5487FF', color: '#5487FF',
width: 6 width:6
}, },
data: gz3 data: gz3
}, },
@ -358,7 +330,7 @@ export default function jrxOptions(data = {}, type = "1",typeName='1') {
}, },
lineStyle: { lineStyle: {
color: '#5487FF', color: '#5487FF',
width: 6 width:6
}, },
data: gz4 data: gz4
}, },
@ -377,6 +349,6 @@ export default function jrxOptions(data = {}, type = "1",typeName='1') {
data: line data: line
}, },
] ]
}; };
} }

View File

@ -5,7 +5,7 @@ export default function dtOption(doubleData) {
const maxRz = Math.ceil(Math.max(...doubleData?.detailVos?.map(o => o.rz))) const maxRz = Math.ceil(Math.max(...doubleData?.detailVos?.map(o => o.rz)))
const minRz = Math.floor(Math.min(...doubleData?.detailVos?.map(o => o.rz))) const minRz = Math.floor(Math.min(...doubleData?.detailVos?.map(o => o.rz)))
const maxcy = Math.ceil(Math.max(...doubleData?.detailVos?.map(o => o.value))) const maxcy = Math.ceil(Math.max(...doubleData?.detailVos?.map(o => o.value)))
const mincy = Math.floor(Math.min(...doubleData?.detailVos?.map(o => o.value))) const mincy = Math.floor(Math.max(...doubleData?.detailVos?.map(o => o.value)))
console.log(maxRz,minRz,maxcy,mincy); console.log(maxRz,minRz,maxcy,mincy);
// 字体颜色 // 字体颜色
const textColor = '#666' const textColor = '#666'

View File

@ -143,7 +143,7 @@ const Page = () => {
} }
getTable2Data(params) getTable2Data(params)
} }
}, [trData,searchVal]) }, [trData])
useEffect(() => { useEffect(() => {
getDmTree() getDmTree()

View File

@ -147,7 +147,7 @@ const Page = () => {
} }
getTable2Data(params) getTable2Data(params)
} }
}, [trData,searchVal]) }, [trData])
return ( return (

View File

@ -6,7 +6,6 @@ import apiurl from '../../../../service/apiurl';
import { exportFile } from '../../../../utils/tools.js'; import { exportFile } from '../../../../utils/tools.js';
import { httppost2,httppost5 } from '../../../../utils/request'; import { httppost2,httppost5 } from '../../../../utils/request';
import "./index.less" import "./index.less"
import MyTable from './table'
const Page = () => { const Page = () => {
const role = useSelector(state => state.auth.role); const role = useSelector(state => state.auth.role);
@ -17,10 +16,10 @@ const Page = () => {
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false)
const wyList = ["X","Y","H"] const wyList = ["X","Y","H"]
const columns1 = [ const columns1 = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 150, align:"center"}, { title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
]; ];
const columns2 = [ const columns2 = [
{ title: '监测日期', key: 'tm', dataIndex: 'tm', width: 250, align:"center" }, { title: '监测日期', key: 'tm', dataIndex: 'tm', width: 150, align:"center" },
]; ];
@ -96,10 +95,9 @@ const Page = () => {
const width = useMemo(() => { const width = useMemo(() => {
if (newCols?.length > 0) { if (newCols?.length > 0) {
return newCols?.reduce((total, cur) => total + (cur.width), 0) return newCols?.reduce((total, cur) => total + (cur.width), 0)
} }
}, [newCols]); }, [newCols]);
console.log('width',width);
const exportExcel = () => { const exportExcel = () => {
let params = { let params = {
...searchVal, ...searchVal,
@ -114,17 +112,7 @@ const Page = () => {
const getTable2Data = async (params) => { const getTable2Data = async (params) => {
try { try {
const res = await httppost2(apiurl.gcaqjc.sjtjcx.ndwytjb.list1, params) const res = await httppost2(apiurl.gcaqjc.sjtjcx.ndwytjb.list1, params)
const list = [] setTable2Data(res.data)
for(let i=0; i<24*3; i++){
list.push({
maxValue:'',
maxTm:'',
minValue:'',
minTm:'',
diff:'',
})
}
setTable2Data(list)
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
@ -166,7 +154,7 @@ const Page = () => {
/> />
</Card> </Card>
<div className="ant-card-body" style={{ padding: "20px 0 0 0" }}> <div className="ant-card-body" style={{ padding: "20px 0 0 0" }}>
{/* <Table <Table
columns={newCols} columns={newCols}
rowKey="inx" rowKey="inx"
loading={loading} loading={loading}
@ -209,17 +197,7 @@ const Page = () => {
</Table.Summary> </Table.Summary>
) )
}} }}
/> */} />
{
(newCols?.length>0 && width!==undefined)?
<MyTable
columns={newCols}
dataSource={dataSource}
width={width}
loading={loading}
table2Data={table2Data}
/>:null
}
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,158 +0,0 @@
import { Table } from 'antd';
import classNames from 'classnames';
import ResizeObserver from 'rc-resize-observer';
import React, { useEffect, useRef, useState } from 'react';
import { VariableSizeGrid as Grid } from 'react-window';
const VirtualTable = (props) => {
const { columns, scroll, table2Data } = props;
const [tableWidth, setTableWidth] = useState(0);
const widthColumnCount = columns.filter(({ width }) => !width).length;
const mergedColumns = columns.map((column) => {
if (column.width) {
return column;
}
return {
...column,
width: Math.floor(tableWidth / widthColumnCount),
};
});
const gridRef = useRef();
const [connectObject] = useState(() => {
const obj = {};
Object.defineProperty(obj, 'scrollLeft', {
get: () => {
if (gridRef.current) {
return gridRef.current?.state?.scrollLeft;
}
return null;
},
set: (scrollLeft) => {
if (gridRef.current) {
gridRef.current.scrollTo({
scrollLeft,
});
}
},
});
return obj;
});
const resetVirtualGrid = () => {
gridRef.current?.resetAfterIndices({
columnIndex: 0,
shouldForceUpdate: true,
});
};
useEffect(() => resetVirtualGrid, [tableWidth]);
const renderVirtualList = (rawData, { scrollbarSize, ref, onScroll }) => {
ref.current = connectObject;
const totalHeight = rawData.length * 54;
return (
<Grid
ref={gridRef}
className="virtual-grid"
columnCount={mergedColumns.length}
columnWidth={(index) => {
const { width } = mergedColumns[index];
let myWidth = width
if(mergedColumns[index]?.children?.length>0){
myWidth = width*(mergedColumns[index]?.children?.length)
}
return totalHeight > scroll.y && index === mergedColumns.length - 1
? myWidth - scrollbarSize - 1
: myWidth;
}}
height={scroll.y}
rowCount={rawData.length}
rowHeight={() => 54}
width={tableWidth}
onScroll={({ scrollLeft }) => {
onScroll({
scrollLeft,
});
}}
>
{({ columnIndex, rowIndex, style }) => {
return (
<div
className={classNames('virtual-table-cell', {
'virtual-table-cell-last': columnIndex === mergedColumns.length - 1,
})}
style={{...style,textAlign:'center'}}
>
{rawData[rowIndex][mergedColumns[columnIndex].dataIndex]}
</div>
)
}}
</Grid>
);
};
return (
<ResizeObserver
onResize={({ width }) => {
setTableWidth(width);
}}
>
<Table
{...props}
className="virtual-table"
columns={mergedColumns}
pagination={false}
components={{
body: renderVirtualList,
}}
summary={(pageData) => {
return(
<Table.Summary fixed>
<Table.Summary.Row>
<Table.Summary.Cell index={0} align='center' ></Table.Summary.Cell>
<Table.Summary.Cell index={1} align='center'>最大值</Table.Summary.Cell>
{table2Data?.length > 0 && table2Data.map((item,i) =>
<Table.Summary.Cell index={i +1} align='center'>{item?.maxValue ?? "-"}</Table.Summary.Cell>)}
</Table.Summary.Row>
<Table.Summary.Row>
<Table.Summary.Cell index={0} align='center' ></Table.Summary.Cell>
<Table.Summary.Cell index={1} align='center'>日期</Table.Summary.Cell>
{table2Data?.length > 0 && table2Data.map((item,i) =>
<Table.Summary.Cell index={i +1} align='center'>{item?.maxTm?? "-"}</Table.Summary.Cell>)}
</Table.Summary.Row>
<Table.Summary.Row >
<Table.Summary.Cell index={0} align='center' className='total-col'>全年度特征值统计</Table.Summary.Cell>
<Table.Summary.Cell index={1} align='center'>最小值</Table.Summary.Cell>
{table2Data?.length > 0 && table2Data.map((item,i) =>
<Table.Summary.Cell index={i +1} align='center'>{item?.minValue ?? "-"}</Table.Summary.Cell>)}
</Table.Summary.Row>
<Table.Summary.Row>
<Table.Summary.Cell index={0} align='center' ></Table.Summary.Cell>
<Table.Summary.Cell index={1} align='center'>日期</Table.Summary.Cell>
{table2Data?.length > 0 && table2Data.map((item,i) =>
<Table.Summary.Cell index={i +1} align='center'>{item?.minTm?? "-"}</Table.Summary.Cell>)}
</Table.Summary.Row>
<Table.Summary.Row>
<Table.Summary.Cell index={0} align='center' ></Table.Summary.Cell>
<Table.Summary.Cell index={1} align='center'>年变幅</Table.Summary.Cell>
{table2Data?.length > 0 && table2Data.map((item,i) =>
<Table.Summary.Cell index={i +1} align='center'>{item?.diff?? "-"}</Table.Summary.Cell>)}
</Table.Summary.Row>
</Table.Summary>
)
}}
/>
</ResizeObserver>
);
};
const App = ({columns,dataSource,width,loading,table2Data}) => (
<VirtualTable
columns={columns}
dataSource={dataSource}
rowKey="inx"
loading={loading}
table2Data={table2Data}
pagination={false}
scroll={{
y: 450,
x: 8000,
}}
/>
);
export default App;

View File

@ -1,25 +0,0 @@
import React, { Fragment, useRef, useMemo,useEffect,useState } from 'react';
import { Table, Card,Modal,Form,Input,Button,Row,Col,Tabs } from 'antd';
import SyPage from './sy'
import WyPage from './wy'
const Page = () => {
const [tab,setTab] = useState('1')
return (
<>
<div className='content-root clearFloat xybm' style={{paddingRight:"0",paddingBottom:"0",paddingTop:'0'}}>
<Tabs onChange={(e)=>setTab(e)}>
<Tabs.TabPane tab='渗压监测' key='1'>
</Tabs.TabPane>
<Tabs.TabPane tab='位移监测' key='2'>
</Tabs.TabPane>
</Tabs>
{ tab==='1'?<SyPage/>:null }
{ tab==='2'?<WyPage/>:null }
</div>
</>
);
}
export default Page;

View File

@ -1,173 +0,0 @@
import React,{useEffect,useState,useMemo} from 'react';
import { Form, Button, Input, Row, Col, DatePicker, Upload,message,Image,Modal,Radio, InputNumber } from 'antd';
import { formItemLayout, btnItemLayout } from '../../../../../components/crud/FormLayoutProps';
import apiurl from '../../../../../service/apiurl';
import NormalSelect from '../../../../../components/Form/NormalSelect';
import { httppost2 } from '../../../../../utils/request';
import moment from 'moment';
const ModalForm = ({ mode, record,onEdit,onSave,onSimilarSave }) => {
console.log("record",record);
const [form] = Form.useForm();
const [dmList, setDmList] = useState([])
const [codeList, setCodeList] = useState([])
const [dmCode,setDmCode] = useState('')
const onFinish = (values) => {
if (mode === 'edit') {
onEdit(apiurl.gcaqjc.sjtjcx.sjlr.syjc.edit,{...record,...values})
}
if (mode === 'save') {
onSave(apiurl.gcaqjc.sjtjcx.sjlr.syjc.save,values)
}
}
const getDmList = async () => {
try {
const res = await httppost2(apiurl.gcaqjc.sjtjcx.sycx.list)
setDmList(res.data.map(s=>({label:s.profileName,value:s.profileCode})));
} catch (error) {
console.log(error);
}
}
const getStationCode = async () => {
try {
const res = await httppost2(apiurl.gcaqjc.gcaqyj.yjgzpz.list)
setCodeList(res.data.map(s=>({label:s.stationCode,value:s.stationCode,profileCode:s.profileCode})));
} catch (error) {
console.log(error);
}
}
useEffect(()=>{
getDmList()
getStationCode()
}, [])
return (
<>
<Form
form={form}
{...formItemLayout}
onFinish={onFinish}
initialValues={record}
>
<Row>
<Col span={12}>
<Form.Item
label="监测时间"
name="tm"
getValueFromEvent={(e,dateString) => dateString}
getValueProps={(value) => ({ value: value ? moment(value) : undefined })}
rules={[{required: true}]}
>
<DatePicker disabled={mode==='view'||mode==='edit'} format={'YYYY-MM-DD HH:mm:ss'} style={{width:'100%'}} allowClear showTime />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="监测断面"
name="profileCode"
rules={[{ required: true }]}
>
<NormalSelect
disabled={mode==='view'||mode==='edit'}
allowClear
style={{ width: "100%" }}
options={dmList}
onChange={(v)=>{
form.setFieldValue('stationCode',null)
setDmCode(v)
}}
/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="测点编号"
rules={[{ required: true }]}
name="stationCode"
>
<NormalSelect
disabled={mode==='view'||mode==='edit'}
allowClear
style={{ width: "100%" }}
options={codeList.filter(o=>dmCode?o.profileCode===dmCode:true)}
/>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="通道号"
rules={[{ required: true }]}
name="chan"
>
<InputNumber disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="测压管水位(m)"
name="value"
>
<InputNumber disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="渗压(KPa)"
name="press"
>
<InputNumber disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="振弦(Hz)"
name="vib"
>
<InputNumber disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="温度(℃)"
name="temp"
>
<InputNumber disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
</Row>
{
mode==='view'?null:(
<>
<Form.Item {...btnItemLayout}>
<Button type="primary" htmlType="submit">
{mode === 'save' ? '保存' :
mode === "similarSave" ? "保存" :
'修改'}
</Button>
</Form.Item>
</>
)
}
</Form>
</>
);
}
export default ModalForm;

View File

@ -1,94 +0,0 @@
import React, { Fragment, useRef, useMemo,useEffect,useState } from 'react';
import BasicCrudModal from '../../../../../components/crud/BasicCrudModal';
import { Table, Card,Modal,Form,Input,Button,Row,Col,message } from 'antd';
import ModalForm from './form';
import ToolBar from './toolbar';
import { useSelector } from 'react-redux';
import apiurl from '../../../../../service/apiurl';
import usePageTable from '../../../../../components/crud/usePageTable2';
import { createCrudService } from '../../../../../components/crud/_';
import {CrudOpRender_text} from '../../../../../components/crud/CrudOpRender';
import "./index.less"
const Page = () => {
const role = useSelector(state => state.auth.role);
const editBtn = role?.rule?.find(item => item.menuName == "编辑")||true;
const viewBtn = role?.rule?.find(item => item.menuName == "查看")||true;
const delBtn = role?.rule?.find(item => item.menuName == "删除")||true;
const refModal = useRef();
const [searchVal, setSearchVal] = useState(false)
const columns = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
{ title: '监测时间', key: 'tm', dataIndex: 'tm', align:"center", },
{ title: '监测断面', key: 'profileName', dataIndex: 'profileName', align:"center", },
{ title: '测点编号', key: 'stationCode', dataIndex: 'stationCode', align:"center", },
{ title: '测压管水位(m)', key: 'value', dataIndex: 'value', align:"center", },
{ title: '渗压(KPa)', key: 'press', dataIndex: 'press', align:"center", },
{ title: '振弦(Hz)', key: 'vib', dataIndex: 'vib', align:"center", },
{ title: '温度(℃)', key: 'temp', dataIndex: 'temp', align:"center", },
{
title: '操作', key: 'operation', width: 240, 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 width = useMemo(() => columns.reduce((total, cur) => total + (cur.width), 0), [columns]);
const command = (type) => (params) => {
if (type === 'save') {
refModal.current.showSave();
} else if (type === 'edit') {
refModal.current.showEdit({ ...params });
} else if (type === 'view') {
refModal.current.showView(params);
} else if (type === 'del') {
const url = apiurl.gcaqjc.sjtjcx.sjlr.syjc.del + params.stationCode+'/'+params.tm
refModal.current.onDeleteGet(url);
}
}
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.gcaqjc.sjtjcx.sjlr.syjc.page).find_noCode);
useEffect(()=>{
const params = {
search: {
...searchVal,
}
};
search(params)
}, [searchVal])
return (
<>
<div className='lf CrudAdcdTreeTableBox' style={{ width: "100%" }}>
<Card className='nonebox'>
<ToolBar
setSearchVal={setSearchVal}
onSave={command('save')}
role={role}
/>
</Card>
<div className="ant-card-body" style={{padding:"20px 0 0 0"}}>
<Table columns={columns} rowKey="inx" {...tableProps} scroll={{ x: width , y: "calc( 100vh - 400px )"}}/>
</div>
</div>
<BasicCrudModal
width={1000}
ref={refModal}
title="渗压监测记录"
component={ModalForm}
onCrudSuccess={refresh}
/>
</>
);
}
export default Page;

View File

@ -1,29 +0,0 @@
.basic-info{
position: relative;
font-size: 16px;
margin-bottom: 20px;
padding:5px 25px;
border-bottom: 1px solid #eee;
&::before{
position: absolute;
top:8px;
left:0;
content: "";
display: block;
width: 5px;
height: 20px;
background-color: #0079fe;
}
}
.first-card,.second-card{
color: #fff;
padding:15px 120px;
border-radius: 10px;
}
.first-card{
background-color: #e9df1e;
}
.second-card{
background-color: #d62f28;
}

View File

@ -1,159 +0,0 @@
import React, { useEffect,useState } from 'react';
import { Form, Input, Button, DatePicker } from 'antd';
import { getDictService } from '../../../../../service/SelectValue'
import AdcdFuzzyTreeSelect from '../../../../../components/Form/AdcdFuzzyTreeSelect';
import NormalSelect from '../../../../../components/Form/NormalSelect';
import { config } from '../../../../../config';
import moment from 'moment';
import { httppost2 } from '../../../../../utils/request';
import apiurl from '../../../../../service/apiurl';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
const addBtn = role?.rule?.find(item => item.menuName == "新增")||true;
const optionsType = [
{
label: "今日",
value:1
},
{
label: "近一周",
value:2
},
{
label:"近一月",
value:3
},
{
label:"近三月",
value:4
},
{
label:"近一年",
value:5
},
]
const [form] = Form.useForm();
const [dmList, setDmList] = useState([])
const [codeList, setCodeList] = useState([])
const [dmCode,setDmCode] = useState('')
const getDmList = async () => {
try {
const res = await httppost2(apiurl.gcaqjc.sjtjcx.sycx.list)
setDmList(res.data.map(s=>({label:s.profileName,value:s.profileCode})));
} catch (error) {
console.log(error);
}
}
const getStationCode = async () => {
try {
const res = await httppost2(apiurl.gcaqjc.gcaqyj.yjgzpz.list)
setCodeList(res.data.map(s=>({label:s.stationCode,value:s.stationCode,profileCode:s.profileCode})));
} catch (error) {
console.log(error);
}
}
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;
}
}
const onFinish = (values) => {
let dateSo;
if (values.tm) {
dateSo = {
start: moment(values.tm[0]).format('YYYY-MM-DD HH:mm:ss'),
end: moment(values.tm[1]).format('YYYY-MM-DD HH:mm:ss')
}
}
delete values.tm
setSearchVal({...values, dateTimeRangeSo:dateSo});
}
useEffect(() => {
getDmList()
getStationCode()
}, [])
return (
<>
<div style={{display:'flex',justifyContent:'space-between'}}>
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish} onValuesChange={onValuesChange}>
<Form.Item label="监测时间" name="tm">
<RangePicker
allowClear
style={{ width: "350px" }}
format="YYYY-MM-DD HH:mm:ss"
onChange={(v)=>{
form.setFieldValue('ranger',null)
}}
/>
</Form.Item>
<Form.Item label="常用时段" name="ranger">
<NormalSelect
allowClear
style={{ width: "150px" }}
options={optionsType}
/>
</Form.Item>
<Form.Item label="监测断面" name="profileCode">
<NormalSelect
allowClear
style={{ width: "150px" }}
options={dmList}
onChange={(v)=>{
form.setFieldValue('stationCode',null)
setDmCode(v)
}}
/>
</Form.Item>
<Form.Item label="测点编号" name="stationCode">
<NormalSelect
allowClear
style={{ width: "150px" }}
options={codeList.filter(o=>dmCode?o.profileCode===dmCode:true)}
/>
</Form.Item>
{searchBtn ?
<Form.Item>
<Button type="primary" htmlType="submit">查询</Button>
</Form.Item>
:null }
<Form.Item>
<Button onClick={() => form.resetFields()}>重置</Button>
</Form.Item>
{
(onSave && addBtn) ?
<Form.Item>
<Button onClick={onSave}>新增</Button>
</Form.Item>
:null
}
</Form>
</div>
</>
);
}
export default ToolBar;

View File

@ -1,119 +0,0 @@
import React,{useEffect,useState,useMemo} from 'react';
import { Form, Button, Input, Row, Col, DatePicker, Upload,message,Image,Modal,Radio } from 'antd';
import { formItemLayout, btnItemLayout } from '../../../../../components/crud/FormLayoutProps';
import apiurl from '../../../../../service/apiurl';
import NormalSelect from '../../../../../components/Form/NormalSelect';
import { httppost2 } from '../../../../../utils/request';
import moment from 'moment';
const ModalForm = ({ mode, record,onEdit,onSave,onSimilarSave }) => {
console.log("record",record);
const [form] = Form.useForm();
const [dmList, setDmList] = useState([])
const [codeList, setCodeList] = useState([])
const [dmCode,setDmCode] = useState('')
const onFinish = (values) => {
debugger
if (mode === 'edit') {
onEdit(apiurl.gcaqjc.sjtjcx.sjlr.wyjc.edit,{...record,...values})
}
if (mode === 'save') {
onSave(apiurl.gcaqjc.sjtjcx.sjlr.wyjc.save,values)
}
}
const getDmList = async () => {
try {
const res = await httppost2(apiurl.gcaqjc.sjtjcx.sycx.list)
setDmList(res.data.map(s=>({label:s.profileName,value:s.profileCode})));
} catch (error) {
console.log(error);
}
}
const getStationCode = async () => {
try {
const res = await httppost2(apiurl.gcaqjc.sjtjcx.wycx.list)
setCodeList(res.data.map(s=>({label:s.stationCode,value:s.stationCode,profileCode:s.profileCode})));
} catch (error) {
console.log(error);
}
}
useEffect(()=>{
getDmList()
getStationCode()
}, [])
return (
<>
<Form
form={form}
{...formItemLayout}
onFinish={onFinish}
initialValues={record}
>
<Form.Item
label="监测时间"
name="tm"
getValueFromEvent={(e,dateString) => dateString}
getValueProps={(value) => ({ value: value ? moment(value) : undefined })}
rules={[{required: true}]}
>
<DatePicker disabled={mode==='view'||mode==='edit'} format={'YYYY-MM-DD HH:mm:ss'} style={{width:'100%'}} allowClear showTime />
</Form.Item>
<Form.Item
label="测点编号"
rules={[{ required: true }]}
name="stationCode"
>
<NormalSelect
disabled={mode==='view'||mode==='edit'}
allowClear
style={{ width: "100%" }}
options={codeList}
/>
</Form.Item>
<Form.Item
label="X方向表面位移(mm)"
name="x"
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
<Form.Item
label="Y方向表面位移(mm)"
name="y"
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
<Form.Item
label="H方向表面位移(mm)"
name="h"
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
{
mode==='view'?null:(
<>
<Form.Item {...btnItemLayout}>
<Button type="primary" htmlType="submit">
{mode === 'save' ? '保存' :
mode === "similarSave" ? "保存" :
'修改'}
</Button>
</Form.Item>
</>
)
}
</Form>
</>
);
}
export default ModalForm;

View File

@ -1,92 +0,0 @@
import React, { Fragment, useRef, useMemo,useEffect,useState } from 'react';
import BasicCrudModal from '../../../../../components/crud/BasicCrudModal';
import { Table, Card,Modal,Form,Input,Button,Row,Col,message } from 'antd';
import ModalForm from './form';
import ToolBar from './toolbar';
import { useSelector } from 'react-redux';
import apiurl from '../../../../../service/apiurl';
import usePageTable from '../../../../../components/crud/usePageTable2';
import { createCrudService } from '../../../../../components/crud/_';
import {CrudOpRender_text} from '../../../../../components/crud/CrudOpRender';
import "./index.less"
const Page = () => {
const role = useSelector(state => state.auth.role);
const editBtn = role?.rule?.find(item => item.menuName == "编辑")||true;
const viewBtn = role?.rule?.find(item => item.menuName == "查看")||true;
const delBtn = role?.rule?.find(item => item.menuName == "删除")||true;
const refModal = useRef();
const [searchVal, setSearchVal] = useState(false)
const columns = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
{ title: '监测时间', key: 'tm', dataIndex: 'tm', align:"center", },
{ title: '测点编号', key: 'stationCode', dataIndex: 'stationCode', align:"center", },
{ title: 'X方向表面位移(mm)', key: 'x', dataIndex: 'x', align:"center", },
{ title: 'Y方向表面位移(mm)', key: 'y', dataIndex: 'y', align:"center", },
{ title: 'H方向表面位移(mm)', key: 'h', dataIndex: 'h', align:"center", },
{
title: '操作', key: 'operation', width: 240, 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 width = useMemo(() => columns.reduce((total, cur) => total + (cur.width), 0), [columns]);
const command = (type) => (params) => {
if (type === 'save') {
refModal.current.showSave();
} else if (type === 'edit') {
refModal.current.showEdit({ ...params });
} else if (type === 'view') {
refModal.current.showView(params);
} else if (type === 'del') {
const url = apiurl.gcaqjc.sjtjcx.sjlr.wyjc.del + params.stationCode+'/'+params.tm
refModal.current.onDeleteGet(url);
}
}
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.gcaqjc.sjtjcx.sjlr.wyjc.page).find_noCode);
useEffect(()=>{
const params = {
search: {
...searchVal,
}
};
search(params)
}, [searchVal])
return (
<>
<div className='lf CrudAdcdTreeTableBox' style={{ width: "100%" }}>
<Card className='nonebox'>
<ToolBar
setSearchVal={setSearchVal}
onSave={command('save')}
role={role}
/>
</Card>
<div className="ant-card-body" style={{padding:"20px 0 0 0"}}>
<Table columns={columns} rowKey="inx" {...tableProps} scroll={{ x: width , y: "calc( 100vh - 400px )"}}/>
</div>
</div>
<BasicCrudModal
width={1000}
ref={refModal}
title="渗压监测记录"
component={ModalForm}
onCrudSuccess={refresh}
/>
</>
);
}
export default Page;

View File

@ -1,29 +0,0 @@
.basic-info{
position: relative;
font-size: 16px;
margin-bottom: 20px;
padding:5px 25px;
border-bottom: 1px solid #eee;
&::before{
position: absolute;
top:8px;
left:0;
content: "";
display: block;
width: 5px;
height: 20px;
background-color: #0079fe;
}
}
.first-card,.second-card{
color: #fff;
padding:15px 120px;
border-radius: 10px;
}
.first-card{
background-color: #e9df1e;
}
.second-card{
background-color: #d62f28;
}

View File

@ -1,148 +0,0 @@
import React, { useEffect,useState } from 'react';
import { Form, Input, Button, DatePicker } from 'antd';
import { getDictService } from '../../../../../service/SelectValue'
import AdcdFuzzyTreeSelect from '../../../../../components/Form/AdcdFuzzyTreeSelect';
import NormalSelect from '../../../../../components/Form/NormalSelect';
import { config } from '../../../../../config';
import moment from 'moment';
import { httppost2 } from '../../../../../utils/request';
import apiurl from '../../../../../service/apiurl';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
const addBtn = role?.rule?.find(item => item.menuName == "新增")||true;
const optionsType = [
{
label: "今日",
value:1
},
{
label: "近一周",
value:2
},
{
label:"近一月",
value:3
},
{
label:"近三月",
value:4
},
{
label:"近一年",
value:5
},
]
const [form] = Form.useForm();
const [dmList, setDmList] = useState([])
const [codeList, setCodeList] = useState([])
const [dmCode,setDmCode] = useState('')
const getDmList = async () => {
try {
const res = await httppost2(apiurl.gcaqjc.sjtjcx.sycx.list)
setDmList(res.data.map(s=>({label:s.profileName,value:s.profileCode})));
} catch (error) {
console.log(error);
}
}
const getStationCode = async () => {
try {
const res = await httppost2(apiurl.gcaqjc.sjtjcx.wycx.list)
setCodeList(res.data.map(s=>({label:s.stationCode,value:s.stationCode})));
} catch (error) {
console.log(error);
}
}
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;
}
}
const onFinish = (values) => {
let dateSo;
if (values.tm) {
dateSo = {
start: moment(values.tm[0]).format('YYYY-MM-DD HH:mm:ss'),
end: moment(values.tm[1]).format('YYYY-MM-DD HH:mm:ss')
}
}
delete values.tm
setSearchVal({...values, dateTimeRangeSo:dateSo});
}
useEffect(() => {
getDmList()
getStationCode()
}, [])
return (
<>
<div style={{display:'flex',justifyContent:'space-between'}}>
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish} onValuesChange={onValuesChange}>
<Form.Item label="监测时间" name="tm">
<RangePicker
allowClear
style={{ width: "350px" }}
format="YYYY-MM-DD HH:mm:ss"
onChange={(v)=>{
form.setFieldValue('ranger',null)
}}
/>
</Form.Item>
<Form.Item label="常用时段" name="ranger">
<NormalSelect
allowClear
style={{ width: "150px" }}
options={optionsType}
/>
</Form.Item>
<Form.Item label="测点编号" name="stationCode">
<NormalSelect
allowClear
style={{ width: "150px" }}
options={codeList}
/>
</Form.Item>
{searchBtn ?
<Form.Item>
<Button type="primary" htmlType="submit">查询</Button>
</Form.Item>
:null }
<Form.Item>
<Button onClick={() => form.resetFields()}>重置</Button>
</Form.Item>
{
(onSave && addBtn) ?
<Form.Item>
<Button onClick={onSave}>新增</Button>
</Form.Item>
:null
}
</Form>
</div>
</>
);
}
export default ToolBar;

View File

@ -78,9 +78,6 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
allowClear allowClear
style={{ width: "350px" }} style={{ width: "350px" }}
format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss"
onChange={(v)=>{
form.setFieldValue('ranger',null)
}}
/> />
</Form.Item> </Form.Item>
<Form.Item label="常用时段" name="ranger"> <Form.Item label="常用时段" name="ranger">

View File

@ -35,8 +35,6 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
const [form] = Form.useForm(); const [form] = Form.useForm();
const [dmList, setDmList] = useState([]) const [dmList, setDmList] = useState([])
const [codeList, setCodeList] = useState([]) const [codeList, setCodeList] = useState([])
const [dmCode,setDmCode] = useState('')
const getDmList = async () => { const getDmList = async () => {
try { try {
@ -50,7 +48,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
const getStationCode = async () => { const getStationCode = async () => {
try { try {
const res = await httppost2(apiurl.gcaqjc.gcaqyj.yjgzpz.list) const res = await httppost2(apiurl.gcaqjc.gcaqyj.yjgzpz.list)
setCodeList(res.data.map(s=>({label:s.stationCode,value:s.stationCode,profileCode:s.profileCode}))); setCodeList(res.data.map(s=>({label:s.stationCode,value:s.stationCode})));
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
@ -104,9 +102,6 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
allowClear allowClear
style={{ width: "350px" }} style={{ width: "350px" }}
format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss"
onChange={(v)=>{
form.setFieldValue('ranger',null)
}}
/> />
</Form.Item> </Form.Item>
<Form.Item label="常用时段" name="ranger"> <Form.Item label="常用时段" name="ranger">
@ -121,17 +116,13 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
allowClear allowClear
style={{ width: "150px" }} style={{ width: "150px" }}
options={dmList} options={dmList}
onChange={(v)=>{
form.setFieldValue('stationCode',null)
setDmCode(v)
}}
/> />
</Form.Item> </Form.Item>
<Form.Item label="测点编号" name="stationCode"> <Form.Item label="测点编号" name="stationCode">
<NormalSelect <NormalSelect
allowClear allowClear
style={{ width: "150px" }} style={{ width: "150px" }}
options={codeList.filter(o=>dmCode?o.profileCode===dmCode:true)} options={codeList}
/> />
</Form.Item> </Form.Item>
{searchBtn ? <Form.Item> {searchBtn ? <Form.Item>

View File

@ -93,9 +93,6 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
allowClear allowClear
style={{ width: "350px" }} style={{ width: "350px" }}
format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss"
onChange={(v)=>{
form.setFieldValue('ranger',null)
}}
/> />
</Form.Item> </Form.Item>
<Form.Item label="常用时段" name="ranger"> <Form.Item label="常用时段" name="ranger">

View File

@ -70,7 +70,7 @@ export default function Gsnlfx() {
} }
const providerWater = useMemo(() => { const providerWater = useMemo(() => {
if (tableData[0]?.nowCap && tableData[0]?.deadCap) { if (tableData[0]?.nowCap && tableData[0]?.deadCap) {
let num = (tableData[0]?.nowCap - tableData[0]?.deadCap).toFixed(2) let num = ((tableData[0]?.nowCap - tableData[0]?.deadCap) / 10000).toFixed(2)
return num return num
} else { } else {
return "--" return "--"
@ -87,7 +87,7 @@ export default function Gsnlfx() {
const res = await httpget2(apiurl.gsxl.gsWater, values) const res = await httpget2(apiurl.gsxl.gsWater, values)
if (res.code == 200) { if (res.code == 200) {
setLslOpen(false); setLslOpen(false);
setlslData(res.data.toFixed(2)) setlslData((res.data / 10000).toFixed(2))
getWaterTimeData(values) getWaterTimeData(values)
} }
} catch (error) { } catch (error) {

View File

@ -125,7 +125,7 @@ export default function drpOption (data) {
], ],
series: [ series: [
{ {
name: '灌溉用水', name: '发电灌溉',
type: 'line', type: 'line',
symbol: 'none', symbol: 'none',
smooth: true, smooth: true,

View File

@ -18,7 +18,7 @@ const Page = () => {
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" }, { title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
{ title: '时间', key: 'tm', dataIndex: 'tm', width: 200, ellipsis: true, align:"center" }, { title: '时间', key: 'tm', dataIndex: 'tm', width: 200, ellipsis: true, align:"center" },
{ {
title: '灌溉用水', title: '发电灌溉',
align: "center", align: "center",
children: [ children: [
{ {
@ -62,7 +62,7 @@ const Page = () => {
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" }, { title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
{ title: '时间', key: 'tm', dataIndex: 'tm', width: 100, ellipsis: true, align:"center" }, { title: '时间', key: 'tm', dataIndex: 'tm', width: 100, ellipsis: true, align:"center" },
{ {
title: '灌溉用水', title: '发电灌溉',
align: "center", align: "center",
children: [ children: [
{ {
@ -266,7 +266,7 @@ const Page = () => {
<div style={{flex:1}}> <div style={{flex:1}}>
<div style={{color:"#ffa87c",display:"flex",columnGap:20}}> <div style={{color:"#ffa87c",display:"flex",columnGap:20}}>
<div className='des-title'> <div className='des-title'>
<div>灌溉用水总合计(万m³)</div> <div>发电灌溉总合计(万m³)</div>
<div style={{margin:"10px 0"}}>水厂取水总合计(万m³)</div> <div style={{margin:"10px 0"}}>水厂取水总合计(万m³)</div>
<div>供水总合计(万m³)</div> <div>供水总合计(万m³)</div>
</div> </div>

View File

@ -3,7 +3,7 @@ let title = "总计";
let color = ["#73a0fa", "#52c1f5"]; let color = ["#73a0fa", "#52c1f5"];
let echartData = [ let echartData = [
{ {
name: "灌溉用水", name: "发电灌溉",
value: parseFloat(obj?.shgs?.toFixed(2)) value: parseFloat(obj?.shgs?.toFixed(2))
}, },
{ {

View File

@ -22,7 +22,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
useEffect(() => { useEffect(() => {
let dateSo = { let dateSo = {
start: moment().startOf("year").format('YYYY-MM-DD 00:00:00'), start: moment().subtract(1,"years").format('YYYY-MM-DD 00:00:00'),
end: moment().format('YYYY-MM-DD 23:59:59') end: moment().format('YYYY-MM-DD 23:59:59')
} }
form.setFieldValue("tm", [moment(dateSo.start), moment(dateSo.end)]) form.setFieldValue("tm", [moment(dateSo.start), moment(dateSo.end)])

View File

@ -69,7 +69,7 @@ const Page = () => {
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.rcgl.aqgl.aqjdtz.page).find_noCode1); const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.rcgl.aqgl.aqjdtz.page).find_noCode);
/** /**
* @description 处理成功的回调 * @description 处理成功的回调

View File

@ -79,7 +79,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
const onfinish = (values) => { const onfinish = (values) => {
values.accidentDate = values.accidentDate?moment(values.accidentDate).format("YYYY-MM-DD HH:mm:00"):'' values.accidentDate = values.accidentDate?moment(values.accidentDate).format("YYYY-MM-DD 00:00:00"):''
values.closeCaseDate = values.closeCaseDate?moment(values.closeCaseDate).format("YYYY-MM-DD 00:00:00"):'' values.closeCaseDate = values.closeCaseDate?moment(values.closeCaseDate).format("YYYY-MM-DD 00:00:00"):''
let oldFiles = fileList.map(item => ({fileId:item.response?.data?.fileId}) ) let oldFiles = fileList.map(item => ({fileId:item.response?.data?.fileId}) )
let oldFiles1 = imgfileList.map(item => ({fileId:item.response?.data?.fileId}) ) let oldFiles1 = imgfileList.map(item => ({fileId:item.response?.data?.fileId}) )
@ -197,7 +197,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
}, },
]} ]}
> >
<DatePicker disabled={mode==='view'} format={'YYYY-MM-DD HH:mm'} style={{width:'100%'}} allowClear showTime /> <DatePicker disabled={mode==='view'} format={'YYYY-MM-DD'} style={{width:'100%'}} allowClear />
</Form.Item> </Form.Item>
</Col> </Col>
</Row> </Row>

View File

@ -22,7 +22,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
useEffect(() => { useEffect(() => {
let dateSo = { let dateSo = {
start: moment().startOf("year").format('YYYY-MM-DD 00:00:00'), start: moment().subtract(1,"years").format('YYYY-MM-DD 00:00:00'),
end: moment().format('YYYY-MM-DD 23:59:59') end: moment().format('YYYY-MM-DD 23:59:59')
} }
form.setFieldValue("tm", [moment(dateSo.start), moment(dateSo.end)]) form.setFieldValue("tm", [moment(dateSo.start), moment(dateSo.end)])

View File

@ -71,11 +71,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
const onfinish = (values) => { const onfinish = (values) => {
const userId = localStorage.getItem('userId') values.eventsDate = values.eventsDate?moment(values.eventsDate).format("YYYY-MM-DD 00:00:00"):''
const userName = localStorage.getItem('userName')
values.reportUserId = userId;
values.reportUserName = userName;
values.eventsDate = values.eventsDate ? moment(values.eventsDate).format("YYYY-MM-DD 00:00:00") : ''
let oldFiles = fileList.map(item => ({fileId:item.response?.data?.fileId}) ) let oldFiles = fileList.map(item => ({fileId:item.response?.data?.fileId}) )
if (mode === 'edit') { if (mode === 'edit') {
values.files = oldFiles; values.files = oldFiles;

View File

@ -22,7 +22,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
useEffect(() => { useEffect(() => {
let dateSo = { let dateSo = {
start: moment().startOf("year").format('YYYY-MM-DD 00:00:00'), start: moment().subtract(1,"years").format('YYYY-MM-DD 00:00:00'),
end: moment().format('YYYY-MM-DD 23:59:59') end: moment().format('YYYY-MM-DD 23:59:59')
} }
form.setFieldValue("tm", [moment(dateSo.start), moment(dateSo.end)]) form.setFieldValue("tm", [moment(dateSo.start), moment(dateSo.end)])

View File

@ -68,7 +68,7 @@ const Page = () => {
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.rcgl.aqgl.cxjgtz.page).find_noCode1); const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.rcgl.aqgl.cxjgtz.page).find_noCode);
/** /**
* @description 处理成功的回调 * @description 处理成功的回调

View File

@ -122,7 +122,7 @@ const getResultList = async() => {
if (mode === 'edit') { if (mode === 'edit') {
values.files = oldFiles; values.files = oldFiles;
values.id = record.id; values.id = record.id;
onEdit(apiurl.rcgl.aqgl.fxgkqd.edit,{...record,...values}); onEdit(apiurl.rcgl.aqgl.fxgkqd.edit,values)
} }
if (mode === 'save') { if (mode === 'save') {
values.files = oldFiles values.files = oldFiles

View File

@ -10,7 +10,7 @@ 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 {CrudOpRender_text} from '../../../../components/crud/CrudOpRender'; import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
import moment from 'moment';
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);
@ -50,10 +50,7 @@ const Page = () => {
render: (value) => <span>{value ? value.map(item => item.dictNm).join():''}</span> render: (value) => <span>{value ? value.map(item => item.dictNm).join():''}</span>
}, },
{title: '主要防范措施', key: 'preventMeasure', dataIndex: 'preventMeasure', width: 300,ellipsis: true,align: 'center',}, {title: '主要防范措施', key: 'preventMeasure', dataIndex: 'preventMeasure', width: 300,ellipsis: true,align: 'center',},
{ {title: '创建日期', key: 'createDate', dataIndex: 'createDate', width: 200,align: 'center',},
title: '创建日期', key: 'createDate', dataIndex: 'createDate', width: 200, align: 'center',
render: (v) => <span>{v ? moment(v).format("YYYY-MM-DD"): ''}</span>
},
{ {
title: '操作', key: 'operation', width: 200, fixed: 'right',align: 'center', title: '操作', key: 'operation', width: 200, fixed: 'right',align: 'center',
render: (value, row, index) => ( render: (value, row, index) => (

View File

@ -157,12 +157,10 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
}, [record, mode]) }, [record, mode])
useEffect(() => { useEffect(() => {
if (mode == 'save') {
const name = localStorage.getItem('userName') const name = localStorage.getItem('userName')
form.setFieldValue("reportUserName", name) form.setFieldValue("reportUserName", name)
form.setFieldValue("reportDate", moment()) form.setFieldValue("reportDate", moment())
} }, [])
}, [mode])
useEffect(() => { useEffect(() => {
// 判断是新增还是编辑 // 判断是新增还是编辑

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,Tag } from 'antd'; import { Table, Card, Modal, Form, Input, Button, Row,Col, Timeline, message, Tabs,Image } 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,22 +8,14 @@ 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: "定期普查",
@ -41,79 +33,38 @@ const Page = () => {
} }
const refModal = useRef(); const refModal = useRef();
const [searchVal, setSearchVal] = useState({}) const [searchVal, setSearchVal] = useState({})
const [count, setCount] = useState({})
// const columns = [
// { title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" },
// {title: '填报日期', key: 'reportDate', dataIndex: 'reportDate', width: 140,},
// {
// title: '普查类型', key: 'surveyType', dataIndex: 'surveyType', width: 200,
// render: (value) => <span>{value ? surveyType[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 = [ const columns = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" },
{title: '填报日期', key: 'reportDate', dataIndex: 'reportDate', width: 140,},
{ {
title: '监测时间', title: '普查类型', key: 'surveyType', dataIndex: 'surveyType', width: 200,
dataIndex: 'reportDate', render: (value) => <span>{value ? surveyType[value] : ''}</span>
key: 'reportDate',
width: 180,
align:'center'
}, },
{ {
title: '测点编号', title: '普查方式', key: 'surveyWay', dataIndex: 'surveyWay', width: 200,
dataIndex: 'pileNumber', render: (value) => <span>{value ? surveyWay[value] : ''}</span>
key: 'pileNumber',
width: 120,
align:'center'
}, },
{ {
title: '有无白蚁', title: '危害情况', key: 'isHarm', dataIndex: 'isHarm', width: 200,
dataIndex: 'isHarm', render: (value, row) =>(
align:'center', <span style={row.harmNum > 0 ? { color: "red" } : {}}>{isHarm[row.harmNum > 0 ? 1 : 0]}</span>)
key: 'isHarm', },
width: 100, {title: '白蚁危害处数', key: 'harmNum', dataIndex: 'harmNum', width: 100},
render:(text, record) => { {title: '已处置处数', key: 'handleNum', dataIndex: 'handleNum', width: 100},
// 如果 isHarm 为 null 或 undefined显示无 {title: '上报人', key: 'reportUserName', dataIndex: 'reportUserName', width: 100},
if (text == null) { {
return <Tag color="#04d919" style={{borderRadius: '50%', padding: '4px 8px'}}></Tag>; title: '操作', key: 'operation', width: 200, fixed: 'right',align: 'center',
} render: (value, row, index) => (
<CrudOpRender_text
// 如果 isHandle 为 null 或 undefined当作 false 处理 edit={editBtn ? true : false}
const isHandle = record.isHandle ?? false; del={delBtn ? true : false}
view={viewBtn ? true : false}
return ( command={(cmd) => () => command(cmd)(row)} />)
<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) => {
@ -137,28 +88,7 @@ const Page = () => {
*/ */
const successCallback = () => { const successCallback = () => {
refresh() refresh()
} }
// 获取白蚁统计数量
const getCount = async () => {
const params = {
pageSo: {
pageNumber: 1,
pageSize: 99999,
},
searchDate:searchVal?.searchDate
}
try {
const res = await httppost2(apiurl.rcgl.byfz.bypc.count, params);
setCount(res.data);
} catch (error) {
console.log(error);
}
}
useEffect(() => {
getCount();
}, [searchVal])
useEffect(() => { useEffect(() => {
if (searchVal) { if (searchVal) {
const params = { const params = {
@ -174,50 +104,12 @@ 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%" }}> <div className='lf CrudAdcdTreeTableBox' style={{width:"100%",overflowY:"auto"}}>
<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,33 +1,30 @@
.statsRow { .basic-info{
display: flex; position: relative;
justify-content: space-between;
margin-bottom: 24px;
padding: 16px;
.statItem {
display: flex;
flex-direction: column;
text-align: center;
align-items: center;
.unit {
font-size: 14px;
margin-right: 8px;
color: rgba(0, 0, 0, 0.65);
}
.valueWrapper {
display: flex;
align-items: baseline;
}
.number {
display: block;
font-size: 32px;
font-weight: 600;
}
.label {
color: rgba(0, 0, 0, 0.65);
font-size: 16px; font-size: 16px;
margin-bottom: 20px;
padding:5px 25px;
border-bottom: 1px solid #eee;
&::before{
position: absolute;
top:8px;
left:0;
content: "";
display: block;
width: 5px;
height: 20px;
background-color: #0079fe;
}
}
.time-line{
width: 50%;
margin-left: 6%;
margin-top: 1%;
.time-line-item{
display: flex;
// align-items: center;
column-gap: 20px;
.item-right{
flex:1
} }
} }
} }

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-MM-DD') dateSo = moment(values.year).format('YYYY')
} }
delete values.year delete values.year
setSearchVal({...values, searchDate:dateSo}); setSearchVal({...values, year:Number(dateSo)});
} }
// useEffect(() => { // useEffect(() => {
@ -31,27 +31,29 @@ 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: "240px" }} style={{ width: "150px" }}
picker="year"
/> />
</Form.Item> </Form.Item>
<Form.Item label="测点编号" name="pileNumber"> <Form.Item label="危害情况" name="isHarm">
<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>
<Button type="primary" htmlType="submit">查询</Button>
</Form.Item> </Form.Item>
{searchBtn ? <Form.Item>
<Button type="primary" htmlType="submit">查询</Button>
</Form.Item> : null }
{
(onSave && addBtn) ?
<Form.Item>
<Button onClick={onSave}>新增</Button>
</Form.Item>
:null
}
</Form> </Form>
</div> </div>
</> </>

View File

@ -42,7 +42,7 @@ export default function Zbform({onSubmit,selectKeys}) {
align: "center", align: "center",
}, },
] ]
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.rcgl.jdkh.khmbgl.choose).find_noCode,{pageSize:9999}); const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.rcgl.jdkh.khmbgl.choose).find_noCode);
const [tableData, setTableData] = useState([]) const [tableData, setTableData] = useState([])
const [selectedRowKeys1, setselectedRowKeys1] = useState([]) const [selectedRowKeys1, setselectedRowKeys1] = useState([])
const [zbTable, setZbtable] = useState({}) const [zbTable, setZbtable] = useState({})

View File

@ -100,9 +100,6 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
setSelectKeys(newData.map(item => item.id)) setSelectKeys(newData.map(item => item.id))
let total = newData.reduce((total,cur) => total + Number(cur.standardScore),0) let total = newData.reduce((total,cur) => total + Number(cur.standardScore),0)
setStandardScore(total) setStandardScore(total)
form.setFieldValue("excellentScore",(total * 0.92).toFixed(2))
form.setFieldValue("goodScore",(total * 0.85).toFixed(2))
form.setFieldValue("passScore",(total * 0.70).toFixed(2))
}; };
@ -139,7 +136,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
setZbOpen(false) setZbOpen(false)
// 重新对数据做处理 // 重新对数据做处理
data.data.forEach(item => { data.data.forEach(item => {
if (item?.rowSpan) delete item.rowSpan; if (item.rowSpan) delete item.rowSpan;
}) })
const result = handleData(data.data, "name") const result = handleData(data.data, "name")
let total = data.data.reduce((total,cur) => total + Number(cur.standardScore),0) let total = data.data.reduce((total,cur) => total + Number(cur.standardScore),0)

View File

@ -31,7 +31,7 @@ const Page = () => {
checkedChildren="启用" checkedChildren="启用"
unCheckedChildren="禁用" unCheckedChildren="禁用"
checked={v == 0 ? true : false} onChange={(e) => { checked={v == 0 ? true : false} onChange={(e) => {
onEdit(apiurl.rcgl.jdkh.khmbgl.stop,{id:r.id, status:e ? 0 : 1}) onEdit(apiurl.rcgl.jdkh.khmbgl.edit,{...r, status:e ? 0 : 1})
}} /> }} />
}, },
{title: '创建日期', key: 'createTime', dataIndex: 'createTime', width: 200,align: "center"}, {title: '创建日期', key: 'createTime', dataIndex: 'createTime', width: 200,align: "center"},

View File

@ -68,7 +68,7 @@ const EditableRow = ({ index, ...props }) => {
}} }}
name={dataIndex} name={dataIndex}
> >
<InputNumber min={0} max={record?.standardScore} controls={false} ref={inputRef} onPressEnter={save} onBlur={save} /> <InputNumber min={0} max={record?.standardScore} ref={inputRef} onPressEnter={save} onBlur={save} />
</Form.Item> </Form.Item>
</Form> </Form>
@ -356,12 +356,6 @@ const EditableRow = ({ index, ...props }) => {
// 确认完成 // 确认完成
const confirm = async () => { const confirm = async () => {
const ratings = tableData.some(item => item.standardScore > item.assessScore && !item.problemDesc)
debugger
if (ratings) {
message.error("存在未填报整改要求问题")
return
}
const params = { const params = {
taskId: record.id, taskId: record.id,
score, score,
@ -380,7 +374,7 @@ const EditableRow = ({ index, ...props }) => {
})) }))
} }
if(tableData.length>0){ if(tableData.length>0){
let flag = true //fasle有评分的 let flag = true //fasle有评分的
params.ratings?.map((item)=>{ params.ratings?.map((item)=>{
if(item.assessScore==null){ if(item.assessScore==null){
flag = false flag = false
@ -423,6 +417,7 @@ const EditableRow = ({ index, ...props }) => {
getZbTableData(Item?.id,2) getZbTableData(Item?.id,2)
} }
} else { } else {
// debugger
const newData = tabs == 2 ? tableData.filter(item => item.standardScore > item.indicatorScore) : const newData = tabs == 2 ? tableData.filter(item => item.standardScore > item.indicatorScore) :
tableData.filter(item => item.standardScore > item.assessScore) tableData.filter(item => item.standardScore > item.assessScore)
newData.forEach(item => { newData.forEach(item => {
@ -442,9 +437,10 @@ const EditableRow = ({ index, ...props }) => {
const [zgItem, setZgItem] = useState("") const [zgItem, setZgItem] = useState("")
const zgCallback = (e) => { const zgCallback = (e) => {
setZgOpen(true) setZgOpen(true)
setZgItem(e) setZgItem(e)
console.log("ee",e);
} }
const imgbeforeUpload = (file) => { const imgbeforeUpload = (file) => {
@ -482,7 +478,6 @@ const EditableRow = ({ index, ...props }) => {
} }
// 整改数据 // 整改数据
const onfinish = (values) => { const onfinish = (values) => {
let files = imgfileList.map(item => ({ fileId: item.response?.data?.fileId })) let files = imgfileList.map(item => ({ fileId: item.response?.data?.fileId }))
values.files = files; values.files = files;
values.isNeedRectify = 1; values.isNeedRectify = 1;
@ -561,8 +556,7 @@ const EditableRow = ({ index, ...props }) => {
{clickItem ? <div style={{backgroundColor:"#f2f2f2",marginTop:20,padding:10}}> {clickItem ? <div style={{backgroundColor:"#f2f2f2",marginTop:20,padding:10}}>
{clickItem?.indicatorRatings?.map(item => ( {clickItem?.indicatorRatings?.map(item => (
<div key={item.id}> <div key={item.id}>
<div>{clickItem?.indicatorName}</div> <div>{item?.ratingDesc}</div>
<div>{item?.ratingDesc}{item?.standardScore}</div>
</div> </div>
))} ))}
</div> : null} </div> : null}

Some files were not shown because too many files have changed in this diff Show More