From 79f445e7cd9fcf2493cc36a79ba1a689b06062fe Mon Sep 17 00:00:00 2001 From: dengyinhuan Date: Fri, 24 Feb 2023 16:44:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=95=B0=E6=8D=AE=E8=81=9A?= =?UTF-8?q?=E9=9B=86=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sections/fillion/components/datajuji.js | 157 ++++++++++++++++++ .../sections/fillion/components/inforTable.js | 20 ++- 2 files changed, 176 insertions(+), 1 deletion(-) create mode 100644 web/client/src/sections/fillion/components/datajuji.js diff --git a/web/client/src/sections/fillion/components/datajuji.js b/web/client/src/sections/fillion/components/datajuji.js new file mode 100644 index 00000000..f66aa3e3 --- /dev/null +++ b/web/client/src/sections/fillion/components/datajuji.js @@ -0,0 +1,157 @@ +import React, { useEffect, useState } from 'react'; +import { Modal, Form, Input, Select, DatePicker, AutoComplete, Col, Button,Row } from 'antd'; + +import { MinusCircleOutlined, PlusOutlined,PlusCircleOutlined } from '@ant-design/icons'; +const Search = Input.Search +const { TextArea } = Input; +import moment from 'moment'; + +const EditGuanlang = (props) => { + const { visible, onCancel, editData, handleSaveScore, readOnly, companys, searchCompany, applyState } = props; + const [form] = Form.useForm(); + const [replyFiles, setReplyFiles] = useState([]); + const [companyOpts, setCompanyOpts] = useState([]); + const [stationItem, setStationItem] = useState(null); + const [deviceList, setDeviceList] = useState([]); + + useEffect(() => { + if (!visible) { + form.resetFields() + } + }, [visible]) + + useEffect(() => { + if (editData) { + let revertData = Object.assign({}, editData); + Object.keys(editData).forEach(key => { + if (key == 'accidentTime') { + revertData[key] = editData[key] && moment(editData[key]); + } + if (key == 'images') { + // const list = (editData[key] || '').split(',') || [] + if (editData[key]) { + + revertData[key] = JSON.parse(editData[key]); + } + } + }); + form.setFieldsValue({ ...revertData }); + } + }, [editData]) + + useEffect(() => { + if (companys && companys.length) { + let list = []; + companys.forEach(item => { + list.push({ label: item.company, value: item.company }) + }) + setCompanyOpts(list); + } + }, [companys]) + + useEffect(() => { + if (editData && companys && companys.length) { + handleSelectCompany(null, { value: editData.companyName }) + let list = ((editData || {}).accidentStations || []).map(item => item.stationId) + form.setFieldsValue({ stations: list }) + } + }, [companys, editData]) + + + const handleSave = () => { + const data = form.getFieldsValue(true); + console.log(data,'data') + handleSaveScore(); + } + + const onFileUploaded = (fileList) => { + setReplyFiles(fileList); + } + + const handleSelectCompany = (v, opt) => { + const { value } = opt; + const target = companys.filter(c => c.company == value); + setDeviceList(target[0]?.deviceInfos || []); + + } + const data1 = [ + {label:'2021年12月',value:'2021年12月'}, + {label:'2021年11月',value:'2021年11月'}, + {label:'2021年10月',value:'2021年10月'}, + {label:'2021年9月',value:'2021年9月'}, + {label:'2021年8月',value:'2021年8月'}, + {label:'2021年7月',value:'2021年7月'}, + {label:'2021年6月',value:'2021年6月'}, + {label:'2021年5月',value:'2021年5月'}, + {label:'2021年4月',value:'2021年4月'}, + {label:'2021年3月',value:'2021年3月'}, + {label:'2021年2月',value:'2021年2月'}, + {label:'2021年1月',value:'2021年1月'}] +const data2 = [ + {label:'噪声传感器',value:'噪声传感器'}, + {label:'导轮式固定测斜仪',value:'导轮式固定测斜仪'}, + {label:'闭合式磁通量传感器',value:'闭合式磁通量传感器'}, + {label:'扬尘监测系统',value:'扬尘监测系统'}, + {label:'空气质量监测系统',value:'空气质量监测系统'}, + {label:'车辆动态称重系统',value:'车辆动态称重系统'}, + {label:'多通道振动采集仪',value:'多通道振动采集仪'}, + {label:'应急照明控制器',value:'应急照明控制器'}, + {label:'钢筋计',value:'钢筋计'}, + {label:'风速风向仪',value:'风速风向仪'}, + {label:'静力水准仪',value:'静力水准仪'}, + {label:'表面式应变计',value:'表面式应变计'}] + return ( + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ *汇集历史数据,接入物联网监测数据,实现大数据的接入解算。 +
+ ) +} + + +export default EditGuanlang; diff --git a/web/client/src/sections/fillion/components/inforTable.js b/web/client/src/sections/fillion/components/inforTable.js index 91779539..6befa473 100644 --- a/web/client/src/sections/fillion/components/inforTable.js +++ b/web/client/src/sections/fillion/components/inforTable.js @@ -6,7 +6,7 @@ import './protable.less' import moment from 'moment'; import { getPurchase, delPurchase } from "../actions/infor" import UserModal from './infor/details'; - +import Datajuji from './datajuji' const InForTable = (props) => { const { dispatch, user, depData, depMessage, depLoading } = props const [rowSelected, setRowSelected] = useState([]) @@ -23,6 +23,7 @@ const InForTable = (props) => { const [overrunRateUpper, setOverrunRateUpper] = useState()//超限率上限 const [overrunRateFloor, setOverrunRateFloor] = useState()//超限率下限 const [testTime, setTestTime] = useState()//超限率下限 + const [datajuji , setdatajuji] = useState() //数据聚集弹窗 const ref = useRef() useEffect(() => { ref.current.reload() }, [monitor, delet]) //打开弹窗 @@ -381,6 +382,13 @@ const InForTable = (props) => { > 新增 + + {/*