feat(): 闸门监控开发
parent
b54341ea7a
commit
1e9febbb45
|
|
@ -451,6 +451,10 @@ 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",
|
||||||
|
|
|
||||||
|
|
@ -232,7 +232,7 @@ export default function jrxOptions(data = {}, type = "1",typeName='1') {
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
// 网格
|
// 网格
|
||||||
show: true,
|
show: false,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: '#CCCCCC',
|
color: '#CCCCCC',
|
||||||
type: 'dashed'
|
type: 'dashed'
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,8 @@ const Page = () => {
|
||||||
pageSo: {
|
pageSo: {
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 99999,
|
pageSize: 99999,
|
||||||
}
|
},
|
||||||
|
searchDate:searchVal?.searchDate
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const res = await httppost2(apiurl.rcgl.byfz.bypc.count, params);
|
const res = await httppost2(apiurl.rcgl.byfz.bypc.count, params);
|
||||||
|
|
@ -157,7 +158,7 @@ const Page = () => {
|
||||||
}
|
}
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getCount();
|
getCount();
|
||||||
}, [])
|
}, [searchVal])
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (searchVal) {
|
if (searchVal) {
|
||||||
const params = {
|
const params = {
|
||||||
|
|
|
||||||
|
|
@ -4,61 +4,78 @@ import ModalToolBar from './ModalToolBar';
|
||||||
import { httppost5 } from '../../../utils/request';
|
import { httppost5 } from '../../../utils/request';
|
||||||
import { exportFile } from '../../../utils/tools';
|
import { exportFile } from '../../../utils/tools';
|
||||||
import apiurl from '../../../service/apiurl';
|
import apiurl from '../../../service/apiurl';
|
||||||
export default function ModalContent() {
|
import usePageTable from '../../../components/crud/usePageTable2';
|
||||||
|
import { createCrudService } from '../../../components/crud/_';
|
||||||
|
export default function ModalContent({zfjkData}) {
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
key: 'inx',
|
key: 'inx',
|
||||||
|
dataIndex:'inx',
|
||||||
width: 80,
|
width: 80,
|
||||||
render: (r, i) => <span>{i + 1}</span>
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '闸门名称',
|
title: '闸阀名称',
|
||||||
key: 'project',
|
key: 'valveName',
|
||||||
|
dataIndex:'valveName',
|
||||||
width: 150,
|
width: 150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作内容',
|
title: '操作内容',
|
||||||
key: 'project',
|
dataIndex:'opContent',
|
||||||
|
key: 'opContent',
|
||||||
width: 150,
|
width: 150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作结果',
|
title: '操作结果',
|
||||||
key: 'project',
|
dataIndex:'status',
|
||||||
|
key: 'status',
|
||||||
width: 150,
|
width: 150,
|
||||||
}
|
},
|
||||||
,
|
|
||||||
{
|
{
|
||||||
title: '操作时间',
|
title: '操作时间',
|
||||||
key: 'project',
|
dataIndex:'tm',
|
||||||
|
key: 'tm',
|
||||||
width: 150,
|
width: 150,
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
const [searchVal, setSearchVal] = useState(false)
|
const [searchVal, setSearchVal] = useState(false)
|
||||||
|
// 闸阀弹框更多数据
|
||||||
|
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.gsxl.zfzl.historypage).find_noCode);
|
||||||
const exportExcel = () => {
|
const exportExcel = () => {
|
||||||
let params = {
|
let params = {
|
||||||
...searchVal,
|
...searchVal,
|
||||||
// pageSo: {
|
pageSo: {
|
||||||
// pageNumber: tableProps.pagination.current,
|
pageNumber: tableProps.pagination.current,
|
||||||
// pageSize:tableProps.pagination.pageSize
|
pageSize:tableProps.pagination.pageSize
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
httppost5(apiurl.gcaqjc.sjtjcx.ndsytjb.export, params).then(res => {
|
httppost5(apiurl.gsxl.zfzl.historyPageExport, params).then(res => {
|
||||||
exportFile(`闸门操作记录.xlsx`,res.data)
|
exportFile(`闸门操作记录.xlsx`,res.data)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
useEffect(() => {
|
||||||
|
if (searchVal) {
|
||||||
|
const params = {
|
||||||
|
search: {
|
||||||
|
...searchVal,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
search(params)
|
||||||
|
}
|
||||||
|
}, [searchVal])
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Card className='nonebox'>
|
<Card className='nonebox'>
|
||||||
<ModalToolBar
|
<ModalToolBar
|
||||||
setSearchVal={setSearchVal}
|
setSearchVal={setSearchVal}
|
||||||
exportFile={exportExcel}
|
exportFile={exportExcel}
|
||||||
|
list={zfjkData}
|
||||||
/>
|
/>
|
||||||
</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 columns={columns} rowKey="inx" dataSource={[]} />
|
<Table columns={columns} rowKey="inx" {...tableProps} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { Form, Input, Button, DatePicker } from 'antd';
|
||||||
import moment from 'moment';
|
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, exportFile }) => {
|
const ToolBar = ({ setSearchVal, exportFile,list }) => {
|
||||||
const optionsType = [
|
const optionsType = [
|
||||||
{
|
{
|
||||||
label: "今日",
|
label: "今日",
|
||||||
|
|
@ -44,7 +44,7 @@ const ToolBar = ({ setSearchVal, exportFile }) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete values.tm
|
delete values.tm
|
||||||
setSearchVal({ ...values, dateTimeSo });
|
setSearchVal({ ...values, dateTimeRangeSo:dateTimeSo });
|
||||||
}
|
}
|
||||||
|
|
||||||
const onValuesChange = (e) => {
|
const onValuesChange = (e) => {
|
||||||
|
|
@ -70,20 +70,28 @@ const ToolBar = ({ setSearchVal, exportFile }) => {
|
||||||
|
|
||||||
}
|
}
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let dateTimeSo = {
|
if (list.length > 0) {
|
||||||
start: moment().subtract(1, "years").format('YYYY-MM-DD 00:00:00'),
|
let dateTimeSo = {
|
||||||
end: moment().format('YYYY-MM-DD 00:00:00')
|
start: moment().subtract(7, "days").format('YYYY-MM-DD 00:00:00'),
|
||||||
|
end: moment().format('YYYY-MM-DD 00:00:00')
|
||||||
|
}
|
||||||
|
form.setFieldValue("tm", [moment(dateTimeSo.start), moment(dateTimeSo.end)])
|
||||||
|
form.setFieldValue("valveCode", list[0]?.valveCode)
|
||||||
|
setSearchVal({dateTimeRangeSo:dateTimeSo, valveCode:list[0]?.valveCode})
|
||||||
}
|
}
|
||||||
form.setFieldValue("tm", [moment(dateTimeSo.start), moment(dateTimeSo.end)])
|
}, [list])
|
||||||
setSearchVal({ dateTimeSo })
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||||
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish} onValuesChange={onValuesChange}>
|
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish} onValuesChange={onValuesChange}>
|
||||||
<Form.Item label="闸门名称" name="maintainType">
|
<Form.Item label="闸门名称" name="valveCode">
|
||||||
<NormalSelect allowClear style={{ width: '150px' }} options={types} />
|
<NormalSelect
|
||||||
|
style={{ width: '150px' }}
|
||||||
|
options={list}
|
||||||
|
allowClear={false}
|
||||||
|
fieldNames={{label: 'valveName',value: 'valveCode'}}
|
||||||
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="日期范围" name="tm">
|
<Form.Item label="日期范围" name="tm">
|
||||||
<RangePicker
|
<RangePicker
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import './index.less';
|
||||||
import { httpget, httpget2, httppost2 } from '../../../utils/request';
|
import { httpget, httpget2, httppost2 } from '../../../utils/request';
|
||||||
import apiurl from '../../../service/apiurl';
|
import apiurl from '../../../service/apiurl';
|
||||||
import ModalContent from './ModalContent';
|
import ModalContent from './ModalContent';
|
||||||
|
|
||||||
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
||||||
const CanvasW = 1080
|
const CanvasW = 1080
|
||||||
const CanvasH = 640
|
const CanvasH = 640
|
||||||
|
|
@ -182,17 +183,20 @@ const Page = () => {
|
||||||
const jcColumns = [
|
const jcColumns = [
|
||||||
{
|
{
|
||||||
title: '项目',
|
title: '项目',
|
||||||
key: 'project',
|
key: 'name',
|
||||||
|
dataIndex:'name',
|
||||||
width: 150,
|
width: 150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '实时数据',
|
title: '实时数据',
|
||||||
key: 'project',
|
key: 'realData',
|
||||||
|
dataIndex:'realData',
|
||||||
width: 150,
|
width: 150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '数据采集时间',
|
title: '数据采集时间',
|
||||||
key: 'project',
|
dataIndex:'tm',
|
||||||
|
key: 'tm',
|
||||||
width: 150,
|
width: 150,
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
@ -200,17 +204,20 @@ const Page = () => {
|
||||||
const zfColumns = [
|
const zfColumns = [
|
||||||
{
|
{
|
||||||
title: '闸阀名称',
|
title: '闸阀名称',
|
||||||
key: 'project',
|
key: 'valveName',
|
||||||
|
dataIndex:'valveName',
|
||||||
width: 150,
|
width: 150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '当前开关状态',
|
title: '当前开关状态',
|
||||||
key: 'project',
|
key: 'status',
|
||||||
|
dataIndex:'status',
|
||||||
width: 150,
|
width: 150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '数据采集时间',
|
title: '数据采集时间',
|
||||||
key: 'project',
|
dataIndex:'tm',
|
||||||
|
key: 'tm',
|
||||||
width: 150,
|
width: 150,
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
@ -218,22 +225,26 @@ const Page = () => {
|
||||||
const jlColumns = [
|
const jlColumns = [
|
||||||
{
|
{
|
||||||
title: '闸阀名称',
|
title: '闸阀名称',
|
||||||
key: 'project',
|
key: 'valveName',
|
||||||
|
dataIndex:'valveName',
|
||||||
width: 150,
|
width: 150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作内容',
|
title: '操作内容',
|
||||||
key: 'project',
|
dataIndex:'opContent',
|
||||||
|
key: 'opContent',
|
||||||
width: 150,
|
width: 150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作结果',
|
title: '操作结果',
|
||||||
key: 'project',
|
dataIndex:'status',
|
||||||
|
key: 'status',
|
||||||
width: 150,
|
width: 150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作时间',
|
title: '操作时间',
|
||||||
key: 'project',
|
dataIndex:'tm',
|
||||||
|
key: 'tm',
|
||||||
width: 150,
|
width: 150,
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
@ -252,9 +263,9 @@ const Page = () => {
|
||||||
const pts = contextCoordinates(xunit, hole);
|
const pts = contextCoordinates(xunit, hole);
|
||||||
const eqpnoList = useMemo(() => damList ? new Array(damList.length).fill(0).map((o, index) => index) : [], [damList]);
|
const eqpnoList = useMemo(() => damList ? new Array(damList.length).fill(0).map((o, index) => index) : [], [damList]);
|
||||||
|
|
||||||
useEffect(() => {
|
// useEffect(() => {
|
||||||
getList()
|
// getList()
|
||||||
}, [])
|
// }, [])
|
||||||
|
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
const { code, data } = await httppost2(apiurl.zmjk.getList)
|
const { code, data } = await httppost2(apiurl.zmjk.getList)
|
||||||
|
|
@ -262,8 +273,8 @@ const Page = () => {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const obj = data[0] || {}
|
const obj = data[0] || {}
|
||||||
getInformation(obj.gateCode)
|
// getInformation(obj.gateCode)
|
||||||
getDamData(obj.stcd)
|
// getDamData(obj.stcd)
|
||||||
getVideo(obj.gateCode)
|
getVideo(obj.gateCode)
|
||||||
setData(obj)
|
setData(obj)
|
||||||
}
|
}
|
||||||
|
|
@ -320,6 +331,95 @@ const Page = () => {
|
||||||
return num
|
return num
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 闸阀监控列表数据
|
||||||
|
const [zfjkData, setzfjkData] = useState([])
|
||||||
|
const getZfjkData = async () => {
|
||||||
|
try {
|
||||||
|
const res = await httppost2(apiurl.gsxl.zfzl.list)
|
||||||
|
if (res.code == 200) {
|
||||||
|
setzfjkData(res.data)
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 闸阀历史操作
|
||||||
|
const [zfjkHistoryListData, setzfjkHistoryListData] = useState([])
|
||||||
|
const getZfjkHistoryData = async () => {
|
||||||
|
try {
|
||||||
|
const res = await httppost2(apiurl.gsxl.zfzl.historyList)
|
||||||
|
if (res.code == 200) {
|
||||||
|
setzfjkHistoryListData(res.data)
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const swList = [
|
||||||
|
{
|
||||||
|
name: "库水位(m)",
|
||||||
|
realData:'',
|
||||||
|
tm:''
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "今日雨量(mm)",
|
||||||
|
realData:'',
|
||||||
|
tm:''
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "灌溉发电流量(m³/s)",
|
||||||
|
realData:'',
|
||||||
|
tm:''
|
||||||
|
}
|
||||||
|
]
|
||||||
|
// 闸阀历史操作
|
||||||
|
const [zfjkSwData, setzfjkSwData] = useState([])
|
||||||
|
const getZfjkSwData = async () => {
|
||||||
|
try {
|
||||||
|
const res = await httppost2(apiurl.gsxl.zfzl.swInfo)
|
||||||
|
if (res.code == 200) {
|
||||||
|
const {
|
||||||
|
rz,
|
||||||
|
todayRainNum,
|
||||||
|
outPowerNum,
|
||||||
|
todayRainNumTm,
|
||||||
|
outPowerNumTm,
|
||||||
|
tm
|
||||||
|
} = res.data;
|
||||||
|
const newArr = swList.map(item => {
|
||||||
|
if (item.name == '库水位(m)') {
|
||||||
|
item.realData = rz;
|
||||||
|
item.tm = tm;
|
||||||
|
} else if (item.name == '今日雨量(mm)') {
|
||||||
|
item.realData = todayRainNum;
|
||||||
|
item.tm = todayRainNumTm;
|
||||||
|
} else {
|
||||||
|
item.realData = outPowerNum;
|
||||||
|
item.tm = outPowerNumTm;
|
||||||
|
}
|
||||||
|
return item;
|
||||||
|
})
|
||||||
|
setzfjkSwData(newArr)
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getZfjkData()
|
||||||
|
getZfjkHistoryData()
|
||||||
|
getZfjkSwData()
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className='content-root clearFloat xybm sg_zmjk' style={{ paddingRight: "0", paddingBottom: "0" }}>
|
<div className='content-root clearFloat xybm sg_zmjk' style={{ paddingRight: "0", paddingBottom: "0" }}>
|
||||||
|
|
@ -335,12 +435,12 @@ const Page = () => {
|
||||||
<div className='sz_left_up_table'>
|
<div className='sz_left_up_table'>
|
||||||
<Table
|
<Table
|
||||||
columns={zfColumns}
|
columns={zfColumns}
|
||||||
rowKey={(record) => record.id}
|
rowKey={(record) => record.tm}
|
||||||
dataSource={[]}
|
dataSource={zfjkData}
|
||||||
pagination={false}
|
pagination={false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className='sg_zmjk_left_title' style={{ marginTop: 175,display:'flex',justifyContent:'space-between' }}>
|
<div className='sg_zmjk_left_title' style={{ marginTop: 150,display:'flex',justifyContent:'space-between' }}>
|
||||||
<div><Divider type="vertical" style={{ width: 5, background: '#259def', height: 20 }} />
|
<div><Divider type="vertical" style={{ width: 5, background: '#259def', height: 20 }} />
|
||||||
最近操作记录</div>
|
最近操作记录</div>
|
||||||
<div onClick={() => setOpen(true)}>
|
<div onClick={() => setOpen(true)}>
|
||||||
|
|
@ -353,8 +453,8 @@ const Page = () => {
|
||||||
<div className='sz_left_up_table'>
|
<div className='sz_left_up_table'>
|
||||||
<Table
|
<Table
|
||||||
columns={jlColumns}
|
columns={jlColumns}
|
||||||
rowKey={(record) => record.id}
|
rowKey={(record) => record.tm}
|
||||||
dataSource={[]}
|
dataSource={zfjkHistoryListData}
|
||||||
pagination={false}
|
pagination={false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -439,8 +539,8 @@ const Page = () => {
|
||||||
<div style={{ width: '100%', marginTop: 10 }}>
|
<div style={{ width: '100%', marginTop: 10 }}>
|
||||||
<Table
|
<Table
|
||||||
columns={jcColumns}
|
columns={jcColumns}
|
||||||
rowKey={(record) => record.id}
|
rowKey={(record) => record.tm}
|
||||||
dataSource={[]}
|
dataSource={zfjkSwData}
|
||||||
pagination={false}
|
pagination={false}
|
||||||
/>
|
/>
|
||||||
{/* {
|
{/* {
|
||||||
|
|
@ -484,12 +584,13 @@ const Page = () => {
|
||||||
width={1100}
|
width={1100}
|
||||||
title="闸门操作记录"
|
title="闸门操作记录"
|
||||||
footer={null}
|
footer={null}
|
||||||
|
destroyOnClose
|
||||||
onCancel={() => {
|
onCancel={() => {
|
||||||
setOpen(false)
|
setOpen(false)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div style={{ height: '600px' }}>
|
<div style={{ height: '600px' }}>
|
||||||
<ModalContent/>
|
<ModalContent zfjkData={zfjkData} />
|
||||||
{/* <Tabs>
|
{/* <Tabs>
|
||||||
<Tabs.TabPane tab="基本信息" key="item-1">
|
<Tabs.TabPane tab="基本信息" key="item-1">
|
||||||
<Descriptions bordered size="small" column={3} >
|
<Descriptions bordered size="small" column={3} >
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue