fix(): 预警规则配置bug修复

master
李神峰 2025-01-08 17:20:49 +08:00
parent 99b0a5e9c0
commit f579043c5b
21 changed files with 270 additions and 242 deletions

View File

@ -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: {

View File

@ -19,6 +19,7 @@ const Page = () => {
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" },
@ -140,11 +135,11 @@ const Page = () => {
...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]
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,7 +158,7 @@ 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,
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;
@ -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}
@ -329,7 +349,21 @@ const Page = () => {
<Table.Summary.Cell index={4} align='center' colSpan={3}>{staData?.dayCount}</Table.Summary.Cell>
</Table.Summary.Row>
</Table.Summary>
: null
:
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
)
}}
/>

View File

@ -31,10 +31,10 @@ const ToolBar = ({ setSearchVal, onSave, storeData, exportFile1 }) => {
label: "日报表",
value: 0
},
// {
// label: "月报表",
// value: 1
// },
{
label: "月报表",
value: 2
},
{
label: "年报表",
value: 1
@ -50,22 +50,22 @@ 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(() => {
@ -105,13 +105,12 @@ const ToolBar = ({ setSearchVal, onSave, storeData, exportFile1 }) => {
<DatePicker
allowClear
style={{ width: "150px" }}
picker="year"/>
picker="month" />
}
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit">查询</Button>
</Form.Item>
<Form.Item>
<Button onClick={() => form.resetFields()}>重置</Button>
</Form.Item>

View File

@ -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%' }}>

View File

@ -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;
}
}

View File

@ -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]]} />

View File

@ -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} />)
}

View File

@ -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 />

View File

@ -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>

View File

@ -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'},
];

View File

@ -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 },
{

View File

@ -88,7 +88,7 @@ const Page = () => {
<BasicCrudModal
width={800}
ref={refModal}
title="断面管理"
title=""
component={ModalForm}
onCrudSuccess={successCallback}
/>

View File

@ -101,7 +101,7 @@ const Page = () => {
<BasicCrudModal
width={1000}
ref={refModal}
title="维护方案"
title="考核"
component={ModalForm}
onCrudSuccess={successCallback}
/>

View File

@ -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>

View File

@ -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>

View File

@ -74,15 +74,6 @@ const Page = () => {
console.log(error);
}
}
// useEffect(() => {
// if(searchVal){
// const params = {
// search: searchVal
// };
// search(params)
// }
// }, [searchVal])
useEffect(() => {
if (allOpen.num == 2) {
@ -127,7 +118,6 @@ useEffect(() => {
expandable={{
expandedRowKeys,
onExpandedRowsChange: (v, r) => {
console.log(v,r);
setExpandedRowKeys(v)
}
}}
@ -141,7 +131,6 @@ useEffect(() => {
title=""
component={ModalForm}
extraFun={getData}
// onCrudSuccess={() => { refresh({ addvcd: localStorage.getItem('ADCD6') }) }}
/>
</div>
</>

View File

@ -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,

View File

@ -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 />

View File

@ -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>

View File

@ -11,10 +11,6 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
label: "闸后流量",
value: 0,
},
{
label: "雨量",
value: 1,
},
{
label: "闸前水位",
value: 2,