fix(): 预警规则配置bug修复
parent
99b0a5e9c0
commit
f579043c5b
|
|
@ -84,7 +84,7 @@ const apiurl = {
|
|||
},
|
||||
syjc: {
|
||||
page: service_ykz + '/osmoticPressRReal/page',
|
||||
export: service_ykz + '/osmoticPressRReal/export',
|
||||
export: service_ykz + '/osmoticPressR/export',
|
||||
list:service_ykz + '/osmoticPressR/list'
|
||||
},
|
||||
cdgl: {
|
||||
|
|
@ -210,6 +210,8 @@ const apiurl = {
|
|||
jynbb: service_ykz + '/statistics/rjyNb',//降雨年报表上方表格
|
||||
jynbbExport:service_ykz + '/statistics/rjyNb/export',//降雨年报表下方总结栏
|
||||
jynbbSummary: service_ykz + '/statistics/rjyNb/stat',//降雨年报表导出
|
||||
swybb:service_ykz + '/statistics/yb',
|
||||
swybbExport:service_ykz + "/statistics/yb/export",//月报表导出
|
||||
}
|
||||
},
|
||||
systemM: {
|
||||
|
|
|
|||
|
|
@ -13,12 +13,13 @@ const Page = () => {
|
|||
0: '闸后流量',
|
||||
1: '雨量',
|
||||
2: '闸前水位',
|
||||
3:'闸后水位'
|
||||
3: '闸后水位'
|
||||
}
|
||||
|
||||
const bbType = {
|
||||
0: '日报表',
|
||||
1: '年报表',
|
||||
2:'月报表'
|
||||
}
|
||||
const [searchVal, setSearchVal] = useState(false)
|
||||
const [requsetUrlObj, setRequsetUrlObj] = useState({})
|
||||
|
|
@ -46,14 +47,8 @@ const Page = () => {
|
|||
];
|
||||
|
||||
const dayColumns = [
|
||||
{ title: '日期', key: 'date', dataIndex: 'date', width: 120, align: "center", fixed: "left" },
|
||||
...Array(30).fill(0).map((item, index) => ({
|
||||
title: `${index + 1}天`,
|
||||
key: `drpM${index + 1}`,
|
||||
dataIndex: `drpM${index + 1}`,
|
||||
width: 100,
|
||||
align: "center",
|
||||
}))
|
||||
{ title: '日期', key: 'date', dataIndex: 'date', width: 120, align: "center", render: (v, r, i) => <span>{v ? `${v}号`: ''}</span>},
|
||||
{title: '监测值', key: 'data', dataIndex: 'data', width: 120, align: "center",}
|
||||
];
|
||||
const yearColumns = [
|
||||
{ title: '日期', key: 'date', dataIndex: 'date', width: 120, align: "center", fixed: "left" },
|
||||
|
|
@ -80,9 +75,9 @@ const Page = () => {
|
|||
changeColumns.forEach((item, i) => {
|
||||
if (i > 0) {
|
||||
if (i < 17) {
|
||||
item.sorter = (a,b) => a[`drpH${i + 8}`] - b[`drpH${i + 8}`]
|
||||
item.sorter = (a, b) => a[`drpH${i + 8}`] - b[`drpH${i + 8}`]
|
||||
} else {
|
||||
item.sorter = (a,b) => a[`drpH${i - 16}`] - b[`drpH${i - 16}`]
|
||||
item.sorter = (a, b) => a[`drpH${i - 16}`] - b[`drpH${i - 16}`]
|
||||
}
|
||||
cols.push({
|
||||
...item,
|
||||
|
|
@ -118,33 +113,33 @@ const Page = () => {
|
|||
// 年报表总结栏
|
||||
const getStaData = async (params) => {
|
||||
let obj = {};
|
||||
try {
|
||||
try {
|
||||
const res = await httppost2(requsetUrlObjRef.current?.yearSummary, params)
|
||||
if (res.code == 200) {
|
||||
res.data.list?.forEach(item => {
|
||||
if (!obj[item.date]) {
|
||||
if (res.code == 200) {
|
||||
res.data.list?.forEach(item => {
|
||||
if (!obj[item.date]) {
|
||||
let arr = Object.keys(item)
|
||||
params.type == 1 ? arr.splice(0,1) :arr.splice(0,2)
|
||||
obj[item.date] = arr.map(o => ({[o]:item[o]}))
|
||||
}
|
||||
})
|
||||
setStaData({...res.data,list:obj})
|
||||
params.type == 1 ? arr.splice(0, 1) : arr.splice(0, 2)
|
||||
obj[item.date] = arr.map(o => ({ [o]: item[o] }))
|
||||
}
|
||||
})
|
||||
setStaData({ ...res.data, list: obj })
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 导出
|
||||
const exportExcel = () => {
|
||||
let params = {
|
||||
...searchVal,
|
||||
}
|
||||
const fileName =
|
||||
(searchVal?.type1 != 1 ?
|
||||
(searchVal?.type1 == 0 ?
|
||||
`${formatDate(searchVal?.dateRangeSo?.start)} - ${formatDate(searchVal?.dateRangeSo?.end)}` :
|
||||
searchVal.year) + projectType[searchVal.type] + bbType[searchVal.type1]
|
||||
httppost5(requsetUrlObjRef.current?.export, params).then(res => {
|
||||
|
||||
searchVal?.type1 == 1 ?formatDate(searchVal.year):
|
||||
formatDate(searchVal.yearMonth)) + projectType[searchVal.type] + bbType[searchVal.type1]
|
||||
httppost5(requsetUrlObjRef.current?.export, params).then(res => {
|
||||
exportFile(`${fileName}.xlsx`, res.data)
|
||||
})
|
||||
}
|
||||
|
|
@ -153,7 +148,7 @@ const Page = () => {
|
|||
let urlObj;
|
||||
let obj = {
|
||||
page: type == 0 ? apiurl.gcyx.tjbb.swrbb : apiurl.gcyx.tjbb.swnbb,
|
||||
export: type == 0 ? apiurl.gcyx.tjbb.swrbbExport : apiurl.gcyx.tjbb.swnbbExport,
|
||||
export: type == 0 ? apiurl.gcyx.tjbb.swrbbExport : type == 1 ?apiurl.gcyx.tjbb.swnbbExport: apiurl.gcyx.tjbb.swybbExport,
|
||||
yearSummary: type == 1 ? apiurl.gcyx.tjbb.swnbbSummary : ''
|
||||
}
|
||||
switch (name) {
|
||||
|
|
@ -163,8 +158,8 @@ const Page = () => {
|
|||
case 1:
|
||||
urlObj = {
|
||||
page: type == 0 ? apiurl.gcyx.tjbb.jyrbb : apiurl.gcyx.tjbb.jynbb,
|
||||
export: type == 0 ? apiurl.gcyx.tjbb.jyrbbExport : apiurl.gcyx.tjbb.jynbbExport,
|
||||
yearSummary:type == 1 ? apiurl.gcyx.tjbb.jynbbSummary : ''
|
||||
export: type == 0 ? apiurl.gcyx.tjbb.jyrbbExport :type == 1 ? apiurl.gcyx.tjbb.jynbbExport: apiurl.gcyx.tjbb.swybbExport,
|
||||
yearSummary: type == 1 ? apiurl.gcyx.tjbb.jynbbSummary : ''
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
|
|
@ -179,17 +174,32 @@ const Page = () => {
|
|||
return urlObj
|
||||
}
|
||||
|
||||
const [monthData, setMonthData] = useState([])
|
||||
const getMonthData = async (params) => {
|
||||
try {
|
||||
const res = await httppost2(apiurl.gcyx.tjbb.swybb, params)
|
||||
if (res.code == 200) {
|
||||
const silceData = res.data.slice(-3)
|
||||
setData(res.data.slice(0,-3))
|
||||
setMonthData(silceData)
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
const formatDate = (date1) => {
|
||||
const date = new Date(date1);
|
||||
const year = date.getFullYear();
|
||||
const month = date.getMonth() + 1;
|
||||
const day = date.getDate();
|
||||
|
||||
return year + '年' + month + '月' + day + '日';
|
||||
const res = searchVal.type1 == 0 ? year + '年' + month + '月' + day + '日' :
|
||||
searchVal.type1 == 1 ? year + '年' :
|
||||
year + '年' + month + '月'
|
||||
return res;
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (searchVal) {
|
||||
if (searchVal && searchVal.type1 != 1 && searchVal.type1 != 2) {
|
||||
const params = { ...searchVal }
|
||||
setRequsetUrlObj(getUrl(searchVal.type, searchVal.type1))
|
||||
requsetUrlObjRef.current = getUrl(searchVal.type, searchVal.type1)
|
||||
|
|
@ -198,6 +208,10 @@ const Page = () => {
|
|||
if (searchVal.type1 == 1) {
|
||||
getStaData(searchVal)
|
||||
}
|
||||
|
||||
if (searchVal.type1 == 2) {
|
||||
getMonthData(searchVal)
|
||||
}
|
||||
}, [searchVal])
|
||||
|
||||
|
||||
|
|
@ -215,11 +229,17 @@ const Page = () => {
|
|||
<Table
|
||||
title={() => (
|
||||
<>
|
||||
<h2 style={{ textAlign: "center" }}>{searchVal?.type1 != 1 ? `${formatDate(searchVal?.dateRangeSo?.start)} - ${formatDate(searchVal?.dateRangeSo?.end)}` : searchVal.year}{projectType[searchVal.type]}{bbType[searchVal.type1]}</h2>
|
||||
<h2 style={{ textAlign: "center" }}>
|
||||
{searchVal?.type1 == 0 ?
|
||||
`${formatDate(searchVal?.dateRangeSo?.start)} - ${formatDate(searchVal?.dateRangeSo?.end)}` :
|
||||
searchVal?.type1 == 1 ?
|
||||
formatDate(searchVal.year):formatDate(searchVal.yearMonth)
|
||||
}
|
||||
{projectType[searchVal.type]}{bbType[searchVal.type1]}</h2>
|
||||
<div style={{ textAlign: "right" }}>单位:{searchVal?.type != 1 ? 'm' : 'mm'}</div>
|
||||
</>
|
||||
)}
|
||||
columns={searchVal.type1 == 0 ? newTimeColumns : searchVal.type1 == 1 ? yearColumns : yearColumns}
|
||||
columns={searchVal.type1 == 0 ? newTimeColumns : searchVal.type1 == 1 ? yearColumns : dayColumns}
|
||||
rowKey="date"
|
||||
dataSource={data}
|
||||
pagination={false}
|
||||
|
|
@ -227,113 +247,127 @@ const Page = () => {
|
|||
summary={(pageData) => {
|
||||
return (
|
||||
searchVal.type1 == 1 ?
|
||||
searchVal.type != 1 ?
|
||||
<Table.Summary fixed>
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={100} align='center' className="xyt-custom-cell">
|
||||
<div className='table-summary-ceil'>
|
||||
<div className='summary-left'></div>
|
||||
<div className='summary-right'>平均</div>
|
||||
</div>
|
||||
</Table.Summary.Cell>
|
||||
{staData?.list?.["平均"]?.map((item, index) => (
|
||||
<Table.Summary.Cell index={index + 1} align='center'>{item[`drpM${index + 1}`]}</Table.Summary.Cell>
|
||||
)
|
||||
)}
|
||||
</Table.Summary.Row>
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={121} align='center' className="xyt-custom-cell">
|
||||
<div className='table-summary-ceil'>
|
||||
<div className='summary-left'></div>
|
||||
<div className='summary-right'>最高</div>
|
||||
</div>
|
||||
</Table.Summary.Cell>
|
||||
{staData?.list?.["最高"]?.map((item, index) => (
|
||||
<Table.Summary.Cell index={index + 1} align='center'>{item[`drpM${index + 1}`]}</Table.Summary.Cell>
|
||||
)
|
||||
)}
|
||||
</Table.Summary.Row>
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={46} align='center' className="xyt-custom-cell">
|
||||
<div className='table-summary-ceil'>
|
||||
<div className='summary-left'>月统计</div>
|
||||
<div className='summary-right'>最高日期</div>
|
||||
</div>
|
||||
</Table.Summary.Cell>
|
||||
{staData?.list?.["最高日期"]?.map((item, index) => (
|
||||
<Table.Summary.Cell index={index + 1} align='center'>{item[`drpM${index + 1}`]}</Table.Summary.Cell>
|
||||
)
|
||||
)}
|
||||
</Table.Summary.Row>
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={156} align='center' className="xyt-custom-cell">
|
||||
<div className='table-summary-ceil'>
|
||||
<div className='summary-left'></div>
|
||||
<div className='summary-right'>最低</div>
|
||||
</div>
|
||||
</Table.Summary.Cell>
|
||||
{staData?.list?.["最低"]?.map((item, index) => (
|
||||
<Table.Summary.Cell index={index + 1} align='center'>{item[`drpM${index + 1}`]}</Table.Summary.Cell>
|
||||
)
|
||||
)}
|
||||
</Table.Summary.Row>
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={155} align='center' className="xyt-custom-cell" >
|
||||
<div className='table-summary-ceil'>
|
||||
<div className='summary-left'></div>
|
||||
<div className='summary-right'>最低日期</div>
|
||||
</div>
|
||||
</Table.Summary.Cell>
|
||||
{staData?.list?.["最低日期"]?.map((item, index) => (
|
||||
<Table.Summary.Cell index={index + 1} align='center'>{item[`drpM${index + 1}`]}</Table.Summary.Cell>
|
||||
)
|
||||
)}
|
||||
</Table.Summary.Row>
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={200} align='center' >年统计</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={1} align='center' >最高水位</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={2} align='center' colSpan={3}>{staData?.max}</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={3} align='center'>最低水位</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={4} align='center' colSpan={3}>{staData?.min}</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={3} align='center'>平均水位</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={4} align='center' colSpan={3}>{staData?.avg}</Table.Summary.Cell>
|
||||
</Table.Summary.Row>
|
||||
</Table.Summary> :
|
||||
<Table.Summary fixed>
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={100} align='center' >月降雨量</Table.Summary.Cell>
|
||||
{staData?.list?.["月降雨量"]?.map((item, index) => (
|
||||
<Table.Summary.Cell index={index + 1} align='center'>{item[`drpM${index + 1}`]}</Table.Summary.Cell>
|
||||
)
|
||||
)}
|
||||
</Table.Summary.Row>
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={21} align='center' >降雨日数</Table.Summary.Cell>
|
||||
{staData?.list?.["降雨日数"]?.map((item, index) => (
|
||||
<Table.Summary.Cell index={index + 1} align='center'>{item[`drpM${index + 1}`]}</Table.Summary.Cell>
|
||||
)
|
||||
)}
|
||||
</Table.Summary.Row>
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={22} align='center' >最大日量</Table.Summary.Cell>
|
||||
{staData?.list?.["最大日量"]?.map((item, index) => (
|
||||
<Table.Summary.Cell index={index + 1} align='center'>{item[`drpM${index + 1}`]}</Table.Summary.Cell>
|
||||
)
|
||||
)}
|
||||
</Table.Summary.Row>
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={12} align='center' >年统计</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={1} align='center' colSpan={3}>降水量</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={2} align='center' colSpan={3}>{staData?.drpSum}</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={3} align='center' colSpan={3}>降雨日数</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={4} align='center' colSpan={3}>{staData?.dayCount}</Table.Summary.Cell>
|
||||
</Table.Summary.Row>
|
||||
</Table.Summary>
|
||||
: null
|
||||
searchVal.type != 1 ?
|
||||
<Table.Summary fixed>
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={100} align='center' className="xyt-custom-cell">
|
||||
<div className='table-summary-ceil'>
|
||||
<div className='summary-left'></div>
|
||||
<div className='summary-right'>平均</div>
|
||||
</div>
|
||||
</Table.Summary.Cell>
|
||||
{staData?.list?.["平均"]?.map((item, index) => (
|
||||
<Table.Summary.Cell index={index + 1} align='center'>{item[`drpM${index + 1}`]}</Table.Summary.Cell>
|
||||
)
|
||||
)}
|
||||
</Table.Summary.Row>
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={121} align='center' className="xyt-custom-cell">
|
||||
<div className='table-summary-ceil'>
|
||||
<div className='summary-left'></div>
|
||||
<div className='summary-right'>最高</div>
|
||||
</div>
|
||||
</Table.Summary.Cell>
|
||||
{staData?.list?.["最高"]?.map((item, index) => (
|
||||
<Table.Summary.Cell index={index + 1} align='center'>{item[`drpM${index + 1}`]}</Table.Summary.Cell>
|
||||
)
|
||||
)}
|
||||
</Table.Summary.Row>
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={46} align='center' className="xyt-custom-cell">
|
||||
<div className='table-summary-ceil'>
|
||||
<div className='summary-left'>月统计</div>
|
||||
<div className='summary-right'>最高日期</div>
|
||||
</div>
|
||||
</Table.Summary.Cell>
|
||||
{staData?.list?.["最高日期"]?.map((item, index) => (
|
||||
<Table.Summary.Cell index={index + 1} align='center'>{item[`drpM${index + 1}`]}</Table.Summary.Cell>
|
||||
)
|
||||
)}
|
||||
</Table.Summary.Row>
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={156} align='center' className="xyt-custom-cell">
|
||||
<div className='table-summary-ceil'>
|
||||
<div className='summary-left'></div>
|
||||
<div className='summary-right'>最低</div>
|
||||
</div>
|
||||
</Table.Summary.Cell>
|
||||
{staData?.list?.["最低"]?.map((item, index) => (
|
||||
<Table.Summary.Cell index={index + 1} align='center'>{item[`drpM${index + 1}`]}</Table.Summary.Cell>
|
||||
)
|
||||
)}
|
||||
</Table.Summary.Row>
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={155} align='center' className="xyt-custom-cell" >
|
||||
<div className='table-summary-ceil'>
|
||||
<div className='summary-left'></div>
|
||||
<div className='summary-right'>最低日期</div>
|
||||
</div>
|
||||
</Table.Summary.Cell>
|
||||
{staData?.list?.["最低日期"]?.map((item, index) => (
|
||||
<Table.Summary.Cell index={index + 1} align='center'>{item[`drpM${index + 1}`]}</Table.Summary.Cell>
|
||||
)
|
||||
)}
|
||||
</Table.Summary.Row>
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={200} align='center' >年统计</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={1} align='center' >最高水位</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={2} align='center' colSpan={3}>{staData?.max}</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={3} align='center'>最低水位</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={4} align='center' colSpan={3}>{staData?.min}</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={3} align='center'>平均水位</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={4} align='center' colSpan={3}>{staData?.avg}</Table.Summary.Cell>
|
||||
</Table.Summary.Row>
|
||||
</Table.Summary> :
|
||||
<Table.Summary fixed>
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={100} align='center' >月降雨量</Table.Summary.Cell>
|
||||
{staData?.list?.["月降雨量"]?.map((item, index) => (
|
||||
<Table.Summary.Cell index={index + 1} align='center'>{item[`drpM${index + 1}`]}</Table.Summary.Cell>
|
||||
)
|
||||
)}
|
||||
</Table.Summary.Row>
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={21} align='center' >降雨日数</Table.Summary.Cell>
|
||||
{staData?.list?.["降雨日数"]?.map((item, index) => (
|
||||
<Table.Summary.Cell index={index + 1} align='center'>{item[`drpM${index + 1}`]}</Table.Summary.Cell>
|
||||
)
|
||||
)}
|
||||
</Table.Summary.Row>
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={22} align='center' >最大日量</Table.Summary.Cell>
|
||||
{staData?.list?.["最大日量"]?.map((item, index) => (
|
||||
<Table.Summary.Cell index={index + 1} align='center'>{item[`drpM${index + 1}`]}</Table.Summary.Cell>
|
||||
)
|
||||
)}
|
||||
</Table.Summary.Row>
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={12} align='center' >年统计</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={1} align='center' colSpan={3}>降水量</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={2} align='center' colSpan={3}>{staData?.drpSum}</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={3} align='center' colSpan={3}>降雨日数</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={4} align='center' colSpan={3}>{staData?.dayCount}</Table.Summary.Cell>
|
||||
</Table.Summary.Row>
|
||||
</Table.Summary>
|
||||
:
|
||||
searchVal.type1 == 2 ?<Table.Summary fixed>
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={12} align='center' >月平均</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={12} align='center' >{monthData[0]?.data}</Table.Summary.Cell>
|
||||
</Table.Summary.Row>
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={12} align='center' >月最大</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={12} align='center' >{monthData[1]?.data}</Table.Summary.Cell>
|
||||
</Table.Summary.Row>
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={12} align='center' >月最小</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={12} align='center' >{monthData[2]?.data}</Table.Summary.Cell>
|
||||
</Table.Summary.Row>
|
||||
</Table.Summary>:null
|
||||
)
|
||||
}}
|
||||
/>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import React, { useEffect,useState } from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Form, Input, Button, DatePicker } from 'antd';
|
||||
import NormalSelect from '../../../../components/Form/NormalSelect';
|
||||
|
||||
import moment from 'moment';
|
||||
const { RangePicker } = DatePicker;
|
||||
const ToolBar = ({ setSearchVal, onSave, storeData, exportFile1 }) => {
|
||||
const start = moment().subtract(7,'days').format('YYYY-MM-DD 00:00:00')
|
||||
const start = moment().subtract(7, 'days').format('YYYY-MM-DD 00:00:00')
|
||||
const end = moment().format('YYYY-MM-DD 23:59:59')
|
||||
const types = [
|
||||
{
|
||||
|
|
@ -31,10 +31,10 @@ const ToolBar = ({ setSearchVal, onSave, storeData, exportFile1 }) => {
|
|||
label: "日报表",
|
||||
value: 0
|
||||
},
|
||||
// {
|
||||
// label: "月报表",
|
||||
// value: 1
|
||||
// },
|
||||
{
|
||||
label: "月报表",
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
label: "年报表",
|
||||
value: 1
|
||||
|
|
@ -50,34 +50,34 @@ const ToolBar = ({ setSearchVal, onSave, storeData, exportFile1 }) => {
|
|||
dateRangeSo = timeType == 0 ? {
|
||||
start: moment(values.tm[0]).format('YYYY-MM-DD HH:mm:ss'),
|
||||
end: moment(values.tm[1]).format('YYYY-MM-DD HH:mm:ss')
|
||||
} : {year: moment(values.tm).format('YYYY')}
|
||||
} : timeType == 1 ? { year: moment(values.tm).format('YYYY') }:{ yearMonth: moment(values.tm).format('YYYY-MM') }
|
||||
}
|
||||
delete values.tm
|
||||
const params = timeType == 0 ? dateRangeSo : undefined;
|
||||
setSearchVal({
|
||||
...values,
|
||||
dateRangeSo: params,
|
||||
year: timeType == 1 ? dateRangeSo.year : undefined
|
||||
year: timeType == 1 ? dateRangeSo.year : undefined,
|
||||
yearMonth:timeType == 2 ? dateRangeSo.yearMonth : undefined
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
const onValuesChange = (val) => {
|
||||
if ('type1' in val) {
|
||||
setTimeType(val.type1)
|
||||
val.type1 == 1 ? form.setFieldValue('tm', moment()) :
|
||||
form.setFieldValue('tm',[moment(start),moment(end)])
|
||||
val.type1 == 0 ? form.setFieldValue('tm', [moment(start), moment(end)]) : form.setFieldValue('tm', moment())
|
||||
}
|
||||
}
|
||||
useEffect(() => {
|
||||
form.setFieldValue('tm',[moment(start),moment(end)])
|
||||
form.setFieldValue('type1', 0)
|
||||
form.setFieldValue('type', 0)
|
||||
setSearchVal({type1:0,type:0,dateRangeSo:{start:start,end:end}})
|
||||
form.setFieldValue('tm', [moment(start), moment(end)])
|
||||
form.setFieldValue('type1', 0)
|
||||
form.setFieldValue('type', 0)
|
||||
setSearchVal({ type1: 0, type: 0, dateRangeSo: { start: start, end: end } })
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<>
|
||||
<div style={{display:'flex',justifyContent:'space-between'}}>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||
<Form
|
||||
form={form}
|
||||
className='toolbarBox'
|
||||
|
|
@ -86,37 +86,36 @@ const ToolBar = ({ setSearchVal, onSave, storeData, exportFile1 }) => {
|
|||
onValuesChange={onValuesChange}
|
||||
>
|
||||
<Form.Item label="统计项目" name="type">
|
||||
<NormalSelect allowClear style={{ width: '150px' }} options={types} />
|
||||
<NormalSelect allowClear style={{ width: '150px' }} options={types} />
|
||||
</Form.Item>
|
||||
<Form.Item label="统计维度" name="type1">
|
||||
<NormalSelect allowClear style={{ width: '150px' }} options={types1} />
|
||||
<NormalSelect allowClear style={{ width: '150px' }} options={types1} />
|
||||
</Form.Item>
|
||||
<Form.Item label="统计时间" name="tm">
|
||||
{timeType == 0 ?
|
||||
<RangePicker
|
||||
<RangePicker
|
||||
allowClear
|
||||
style={{ width: "330px" }}
|
||||
format="YYYY-MM-DD"
|
||||
/> : timeType == 1 ?
|
||||
<DatePicker
|
||||
allowClear
|
||||
style={{ width: "330px" }}
|
||||
format="YYYY-MM-DD"
|
||||
/>: timeType == 1 ?
|
||||
<DatePicker
|
||||
allowClear
|
||||
style={{ width: "150px" }}
|
||||
picker="year"/> :
|
||||
<DatePicker
|
||||
allowClear
|
||||
style={{ width: "150px" }}
|
||||
picker="year"/>
|
||||
style={{ width: "150px" }}
|
||||
picker="year" /> :
|
||||
<DatePicker
|
||||
allowClear
|
||||
style={{ width: "150px" }}
|
||||
picker="month" />
|
||||
}
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Form.Item>
|
||||
<Button type="primary" htmlType="submit">查询</Button>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item>
|
||||
<Button onClick={() => form.resetFields()}>重置</Button>
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button onClick={()=>exportFile1()}>导出</Button>
|
||||
<Button onClick={() => exportFile1()}>导出</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -248,20 +248,13 @@ export default function Home() {
|
|||
<div className='content-box'>
|
||||
<Zmjk />
|
||||
</div>
|
||||
<div style={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
width: 25,
|
||||
height: 50,
|
||||
backgroundColor: "#3b7cff",
|
||||
position: "fixed",
|
||||
top: "57%",
|
||||
left: !showTabLeft ? "20.7%" : 0,
|
||||
cursor: "pointer",
|
||||
}}
|
||||
onClick={() => setShowTabLeft(!showTabLeft)}
|
||||
><BarsOutlined style={{ color: "#fff" }} /></div>
|
||||
{showTabLeft &&
|
||||
<div
|
||||
style={{ left: 0 }}
|
||||
className='shouqi-icon'
|
||||
onClick={() => setShowTabLeft(false)}
|
||||
><BarsOutlined style={{ color: "#fff" }} />
|
||||
</div>}
|
||||
{!showTabLeft &&
|
||||
<div className='content-left'>
|
||||
{/* 工程简介 */}
|
||||
|
|
@ -275,6 +268,12 @@ export default function Home() {
|
|||
</div>
|
||||
{/* 运行监测数据 */}
|
||||
<div className='runWatch'>
|
||||
<div
|
||||
style={{ right: '-23px', top: '50%' }}
|
||||
className='shouqi-icon'
|
||||
onClick={() => setShowTabLeft(true)}
|
||||
><BarsOutlined style={{ color: "#fff" }} />
|
||||
</div>
|
||||
<div className='project-title'>运行监测数据</div>
|
||||
<div className='project-content'>
|
||||
{RealData.map((item, i) => (
|
||||
|
|
@ -326,22 +325,14 @@ export default function Home() {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>}
|
||||
<div style={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
width: 25,
|
||||
height: 50,
|
||||
backgroundColor: "#3b7cff",
|
||||
position: "fixed",
|
||||
top: "57%",
|
||||
right: !showTabRight ? "20.7%" : 0,
|
||||
cursor: "pointer",
|
||||
}}
|
||||
onClick={() => setShowTabRight(!showTabRight)}
|
||||
><BarsOutlined style={{ color: "#fff" }} /></div>
|
||||
{showTabRight &&
|
||||
<div
|
||||
style={{ right: 0, }}
|
||||
className='shouqi-icon'
|
||||
onClick={() => setShowTabRight(false)}
|
||||
>
|
||||
<BarsOutlined style={{ color: "#fff" }} /></div>}
|
||||
{
|
||||
!showTabRight &&
|
||||
<div className='content-right'>
|
||||
|
|
@ -375,6 +366,12 @@ export default function Home() {
|
|||
</div>
|
||||
{/* 报警信息 */}
|
||||
<div className='operate-log'>
|
||||
<div
|
||||
style={{ left: '-23px', top: '50%' }}
|
||||
className='shouqi-icon'
|
||||
onClick={() => setShowTabRight(true)}
|
||||
>
|
||||
<BarsOutlined style={{ color: "#fff" }} /></div>
|
||||
<div className='project-title'>报警信息</div>
|
||||
<div className='project-content'>
|
||||
<table style={{ width: '100%' }}>
|
||||
|
|
|
|||
|
|
@ -110,6 +110,7 @@
|
|||
}
|
||||
}
|
||||
.runWatch{
|
||||
position: relative;
|
||||
.run_list{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
|
@ -193,4 +194,16 @@
|
|||
width:100%;
|
||||
table-layout:fixed;
|
||||
}
|
||||
|
||||
.shouqi-icon{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 25px;
|
||||
height: 50px;
|
||||
background-color: #3b7cff;
|
||||
position: absolute;
|
||||
top: 57%;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
|
@ -13,7 +13,7 @@ const Sider: React.FC<{
|
|||
return (
|
||||
<Layer
|
||||
x={side === 'left' ? 0 : CanvasW}
|
||||
scaleX={side === 'left' ? 0.8 : -0.8}
|
||||
scaleX={side === 'left' ? 1 : -1}
|
||||
width={CanvasW * 0.5}
|
||||
>
|
||||
<ColorPolygon desc='水' fill="#458eab" pts={[[0, Horizontal], [0, CanvasH], [CanvasW * 0.7, CanvasH], [CanvasW * 0.7, Horizontal]]} />
|
||||
|
|
|
|||
|
|
@ -85,9 +85,10 @@ const Topper1: React.FC<{
|
|||
|
||||
return (
|
||||
<Layer>
|
||||
<Rect fill='#738b8b' x={pts.TopRectLB.x - 32 } y={pts.TopRectLB.y - TopRoomHeight} width={pts.TopRectRB.x - pts.TopRectLB.x + 63} height={TopRoomHeight} />
|
||||
{/* <Rect fill='#738b8b' x={pts.TopRectLB.x - 32 } y={pts.TopRectLB.y - TopRoomHeight} width={pts.TopRectRB.x - pts.TopRectLB.x + 63} height={TopRoomHeight} /> */}
|
||||
<Rect fill='#738b8b' x={pts.TopRectLB.x -5} y={pts.TopRectLB.y - TopRoomHeight} width={pts.TopRectRB.x - pts.TopRectLB.x + 10} height={TopRoomHeight} />
|
||||
<ColorPolygon fill='#4a5c5e' pts={[pts.TopRectLB, pts.RoomRBFar, mirror(pts.RoomRBFar), pts.TopRectRB]} />
|
||||
{
|
||||
{/* {
|
||||
pts.SepsLTLBRBRT.map((s, index) => {
|
||||
if (index == 0 || index == 1 || index == 7 || index == 8) {
|
||||
return (
|
||||
|
|
@ -96,7 +97,7 @@ const Topper1: React.FC<{
|
|||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
} */}
|
||||
{
|
||||
windows.w.map((o, index) => <Window1 rect={o} key={'w' + index} />)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ export type ControlPts = {
|
|||
export function contextCoordinates(unitWidth: number, hole: number): ControlPts {
|
||||
const C1 = { x: unitWidth * 0.6, y: GroundBase };
|
||||
const L1 = { x: unitWidth* 1, y: GroundBase };
|
||||
const B1 = { x: unitWidth, y: BottomBase }
|
||||
const B1 = { x: unitWidth , y: BottomBase }
|
||||
|
||||
const C2 = intersection(ViewCenter, C1, { x: 0, y: undefined });
|
||||
const L2 = intersection(ViewCenter, L1, { x: 0, y: undefined });
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
|||
<Col span={12}>
|
||||
<Form.Item
|
||||
label="阈值下限"
|
||||
name="upperLimit"
|
||||
name="lowerLimit"
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<InputNumber disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
|
||||
|
|
@ -96,7 +96,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
|||
<Col span={12}>
|
||||
<Form.Item
|
||||
label="阈值上限"
|
||||
name="lowerLimit"
|
||||
name="upperLimit"
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<InputNumber disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ const Page = () => {
|
|||
title: '监测类型', key: 'type', dataIndex: 'type', width: 150,
|
||||
render: (v) => <span>{types[v]}</span>
|
||||
},
|
||||
{ title: '阈值下限', key: 'upperLimit', dataIndex: 'upperLimit', width: 150},
|
||||
{ title: '阈值上限', key: 'lowerLimit ', dataIndex: 'lowerLimit', width: 150},
|
||||
{ title: '阈值下限', key: 'lowerLimit', dataIndex: 'lowerLimit', width: 150},
|
||||
{ title: '阈值上限', key: 'upperLimit ', dataIndex: 'upperLimit', width: 150},
|
||||
{
|
||||
title: '是否启用', key: 'status', dataIndex: 'status', width: 150,
|
||||
render: (v) => <span>{ v == 1 ? '否': v==0?'是':''}</span>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ const Tabledata = ({tableData}) => {
|
|||
{ title: '水位(mm)', key: 'value', dataIndex: 'value'},
|
||||
{ title: '水压(KPa)', key: 'press', dataIndex: 'press'},
|
||||
{ title: '水位高程(m)', key: 'waterEle', dataIndex: 'waterEle'},
|
||||
{ title: '温度(°℃)', key: 'temp', dataIndex: 'temp'},
|
||||
{ title: '温度(℃)', key: 'temp', dataIndex: 'temp'},
|
||||
{ title: '模数(F)', key: 'modulus', dataIndex: 'modulus'},
|
||||
{title: '监测时间', key: 'tm', dataIndex: 'tm'},
|
||||
];
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ const Page = () => {
|
|||
{ title: '水位(mm)', key: 'value', dataIndex: 'value', width: 150 },
|
||||
{ title: '水压(KPa)', key: 'press', dataIndex: 'press', width: 150 },
|
||||
{ title: '水位高程(m)', key: 'waterEle', dataIndex: 'waterEle', width: 150 },
|
||||
{ title: '温度(°℃)', key: 'temp', dataIndex: 'temp', width: 150 },
|
||||
{ title: '温度(℃)', key: 'temp', dataIndex: 'temp', width: 150 },
|
||||
{ title: '模数(F)', key: 'modulus', dataIndex: 'modulus', width: 150 },
|
||||
{ title: '测点位置', key: 'location', dataIndex: 'location', width: 150,ellipse:true },
|
||||
{
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ const Page = () => {
|
|||
<BasicCrudModal
|
||||
width={800}
|
||||
ref={refModal}
|
||||
title="断面管理"
|
||||
title=""
|
||||
component={ModalForm}
|
||||
onCrudSuccess={successCallback}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ const Page = () => {
|
|||
<BasicCrudModal
|
||||
width={1000}
|
||||
ref={refModal}
|
||||
title="维护方案"
|
||||
title="考核"
|
||||
component={ModalForm}
|
||||
onCrudSuccess={successCallback}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ const ToolBar = ({ setSearchVal, onSave, onChecked }) => {
|
|||
<Button type="primary" htmlType="submit">查询</Button>
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button type="primary" onClick={onSave}>新增</Button>
|
||||
<Button onClick={onSave}>新增</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -111,6 +111,7 @@ const ModalForm = ({ mode, record, onUerEdit, onSave, close }) => {
|
|||
<Form.Item
|
||||
label="上级目录"
|
||||
name="menuId"
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<TreeSelect
|
||||
disabled={mode === 'view'}
|
||||
|
|
@ -128,6 +129,7 @@ const ModalForm = ({ mode, record, onUerEdit, onSave, close }) => {
|
|||
<Form.Item
|
||||
label="地址"
|
||||
name="path"
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
|
||||
</Form.Item>
|
||||
|
|
|
|||
|
|
@ -74,15 +74,6 @@ const Page = () => {
|
|||
console.log(error);
|
||||
}
|
||||
}
|
||||
// useEffect(() => {
|
||||
// if(searchVal){
|
||||
// const params = {
|
||||
// search: searchVal
|
||||
// };
|
||||
// search(params)
|
||||
// }
|
||||
// }, [searchVal])
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (allOpen.num == 2) {
|
||||
|
|
@ -126,8 +117,7 @@ useEffect(() => {
|
|||
scroll={{ x: width, y: "calc( 100vh - 400px )" }}
|
||||
expandable={{
|
||||
expandedRowKeys,
|
||||
onExpandedRowsChange: (v, r) => {
|
||||
console.log(v,r);
|
||||
onExpandedRowsChange: (v, r) => {
|
||||
setExpandedRowKeys(v)
|
||||
}
|
||||
}}
|
||||
|
|
@ -141,7 +131,6 @@ useEffect(() => {
|
|||
title=""
|
||||
component={ModalForm}
|
||||
extraFun={getData}
|
||||
// onCrudSuccess={() => { refresh({ addvcd: localStorage.getItem('ADCD6') }) }}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ const Page = () => {
|
|||
{ title: '阈值上限', key: 'upperLimit', dataIndex: 'upperLimit', width: 150},
|
||||
{
|
||||
title: '状态', key: 'status', dataIndex: 'status', width: 150,
|
||||
render: (v) => <span>{types[v]}</span>
|
||||
render: (v) => <span>{types1[v]}</span>
|
||||
},
|
||||
{
|
||||
title: '报警时间', key: 'warnTime', dataIndex: 'warnTime', width: 140,
|
||||
|
|
|
|||
|
|
@ -15,10 +15,6 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
|||
label: "闸后流量",
|
||||
value: 0,
|
||||
},
|
||||
{
|
||||
label: "雨量",
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: "闸前水位",
|
||||
value:2,
|
||||
|
|
@ -61,7 +57,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
|||
<Col span={12}>
|
||||
<Form.Item
|
||||
label="阈值下限"
|
||||
name="upperLimit"
|
||||
name="lowerLimit"
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<InputNumber disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
||||
|
|
@ -73,7 +69,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
|||
<Col span={12}>
|
||||
<Form.Item
|
||||
label="阈值上限"
|
||||
name="lowerLimit"
|
||||
name="upperLimit"
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<InputNumber disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
|||
const Page = () => {
|
||||
const types = {
|
||||
0: "闸后流量",
|
||||
1: '雨量',
|
||||
2: "闸前水位",
|
||||
3:'闸后水位'
|
||||
}
|
||||
|
|
@ -26,8 +25,8 @@ const Page = () => {
|
|||
title: '监测点', key: 'type', dataIndex: 'type', width: 150,
|
||||
render: (v) => <span>{types[v]}</span>
|
||||
},
|
||||
{ title: '阈值下限', key: 'upperLimit', dataIndex: 'upperLimit', width: 150},
|
||||
{ title: '阈值上限', key: 'lowerLimit ', dataIndex: 'lowerLimit', width: 150},
|
||||
{ title: '阈值下限', key: 'lowerLimit', dataIndex: 'lowerLimit', width: 150},
|
||||
{ title: '阈值上限', key: 'upperLimit ', dataIndex: 'upperLimit', width: 150},
|
||||
{
|
||||
title: '是否启用', key: 'status', dataIndex: 'status', width: 150,
|
||||
render: (v) => <span>{ v == 1 ? '否': v==0?'是':''}</span>
|
||||
|
|
|
|||
|
|
@ -11,10 +11,6 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
|||
label: "闸后流量",
|
||||
value: 0,
|
||||
},
|
||||
{
|
||||
label: "雨量",
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: "闸前水位",
|
||||
value: 2,
|
||||
|
|
|
|||
Loading…
Reference in New Issue