|
@ -17,10 +17,12 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat |
|
|
const [factorList, setFactorList] = useState([]); //监测因素 |
|
|
const [factorList, setFactorList] = useState([]); //监测因素 |
|
|
const [factorChech, setFactorChech] = useState([]); //选中的监测因素 |
|
|
const [factorChech, setFactorChech] = useState([]); //选中的监测因素 |
|
|
const [activeKey, setActiveKey] = useState([]); // |
|
|
const [activeKey, setActiveKey] = useState([]); // |
|
|
|
|
|
const [correlationId, setCorrelationId] = useState([]); // |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(async () => { |
|
|
useEffect(async () => { |
|
|
if (eidtData?.id) { |
|
|
if (eidtData?.id) { |
|
|
|
|
|
console.log(eidtData); |
|
|
setProjectId(eidtData?.projectId) |
|
|
setProjectId(eidtData?.projectId) |
|
|
setStructId(eidtData?.structId) |
|
|
setStructId(eidtData?.structId) |
|
|
setFactorId(eidtData?.factors?.map(s => s.codeName) || []) |
|
|
setFactorId(eidtData?.factors?.map(s => s.codeName) || []) |
|
@ -68,7 +70,7 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat |
|
|
projectOverview: v.projectOverview, |
|
|
projectOverview: v.projectOverview, |
|
|
reportStartTime: moment(v.reportTime[0]).format('YYYY-MM-DD HH:mm:ss'), |
|
|
reportStartTime: moment(v.reportTime[0]).format('YYYY-MM-DD HH:mm:ss'), |
|
|
reportEndTime: moment(v.reportTime[1]).format('YYYY-MM-DD HH:mm:ss'), |
|
|
reportEndTime: moment(v.reportTime[1]).format('YYYY-MM-DD HH:mm:ss'), |
|
|
time: moment().format('YYYY-MM-DD HH:mm:ss'), |
|
|
time: eidtData?.time && moment(eidtData?.time).format('YYYY-MM-DD HH:mm:ss') || null, |
|
|
factors: [] |
|
|
factors: [] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -115,7 +117,6 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat |
|
|
factorData.tempStaName = factorData?.tempName?.find(s => s.index == 2)?.name || factorData?.tempName?.find(s => s.index == 1)?.name |
|
|
factorData.tempStaName = factorData?.tempName?.find(s => s.index == 2)?.name || factorData?.tempName?.find(s => s.index == 1)?.name |
|
|
data.factors?.push(factorData) |
|
|
data.factors?.push(factorData) |
|
|
}) |
|
|
}) |
|
|
console.log(111, data); |
|
|
|
|
|
|
|
|
|
|
|
dispatch(service.postAutomaticReport(data)).then((res) => { |
|
|
dispatch(service.postAutomaticReport(data)).then((res) => { |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
@ -138,7 +139,7 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat |
|
|
> |
|
|
> |
|
|
<Form.Input field="reportName" label='报表名称' style={{ width: 300 }} placeholder="请输入报表名称" showClear |
|
|
<Form.Input field="reportName" label='报表名称' style={{ width: 300 }} placeholder="请输入报表名称" showClear |
|
|
initValue={eidtData?.reportName || ""} |
|
|
initValue={eidtData?.reportName || ""} |
|
|
rules={[{ required: true, message: "请输入报表名称" }]} |
|
|
rules={[{ required: true, message: "请输入报表名称,15字以内", max: 15 }]} |
|
|
/> |
|
|
/> |
|
|
<Form.Select label="所属项目" field="projectId" placeholder="请选择项目" showClear style={{ width: 300 }} filter |
|
|
<Form.Select label="所属项目" field="projectId" placeholder="请选择项目" showClear style={{ width: 300 }} filter |
|
|
initValue={eidtData?.projectId || ""} |
|
|
initValue={eidtData?.projectId || ""} |
|
@ -159,7 +160,7 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat |
|
|
</Form.Select> |
|
|
</Form.Select> |
|
|
<Form.Input field="projectName" label='项目名称' style={{ width: 300 }} placeholder="请输入项目名称" showClear |
|
|
<Form.Input field="projectName" label='项目名称' style={{ width: 300 }} placeholder="请输入项目名称" showClear |
|
|
initValue={eidtData?.projectName || ""} |
|
|
initValue={eidtData?.projectName || ""} |
|
|
rules={[{ required: true, message: "请输入项目名称" }]} |
|
|
rules={[{ required: true, message: "请输入项目名称,15字以内", max: 15 }]} |
|
|
/> |
|
|
/> |
|
|
<Form.Select label="报表类型" field="reportType" placeholder="请选择报表类型" showClear style={{ width: 300 }} |
|
|
<Form.Select label="报表类型" field="reportType" placeholder="请选择报表类型" showClear style={{ width: 300 }} |
|
|
rules={[{ required: true, message: "请选择报表类型" }]} |
|
|
rules={[{ required: true, message: "请选择报表类型" }]} |
|
@ -235,7 +236,7 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat |
|
|
> |
|
|
> |
|
|
{ |
|
|
{ |
|
|
factorChech?.map(s => { |
|
|
factorChech?.map(s => { |
|
|
return <Collapse.Panel header={s.name} itemKey={s.proto}> |
|
|
return <Collapse.Panel header={s.proto + s.name} itemKey={s.proto} key={s.proto}> |
|
|
<div style={{ background: "#FFF" }}> |
|
|
<div style={{ background: "#FFF" }}> |
|
|
<Form.TextArea field={s.proto + "pointDescrip"} label='布点描述' style={{ width: 400 }} autosize={{ minRows: 2, maxRows: 10 }} placeholder="请输入布点描述" showClear |
|
|
<Form.TextArea field={s.proto + "pointDescrip"} label='布点描述' style={{ width: 400 }} autosize={{ minRows: 2, maxRows: 10 }} placeholder="请输入布点描述" showClear |
|
|
initValue={eidtData?.factors?.find(c => c.codeName == s.proto)?.pointDescrip || ""} |
|
|
initValue={eidtData?.factors?.find(c => c.codeName == s.proto)?.pointDescrip || ""} |
|
@ -274,6 +275,7 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat |
|
|
{ |
|
|
{ |
|
|
['2001', '4004', '4007', '4008'].includes(s.proto) && |
|
|
['2001', '4004', '4007', '4008'].includes(s.proto) && |
|
|
<Form.DatePicker field={s.proto + 'initialTime'} label='数据初始时间' type='dateTime' showClear |
|
|
<Form.DatePicker field={s.proto + 'initialTime'} label='数据初始时间' type='dateTime' showClear |
|
|
|
|
|
rules={[{ required: true, message: "请选择数据初始时间" }]} |
|
|
initValue={eidtData?.factors?.find(c => c.codeName == s.proto)?.initialTime && moment(eidtData?.factors?.find(c => c.codeName == s.proto)?.initialTime).format('YYYY-MM-DD HH:mm:ss')} |
|
|
initValue={eidtData?.factors?.find(c => c.codeName == s.proto)?.initialTime && moment(eidtData?.factors?.find(c => c.codeName == s.proto)?.initialTime).format('YYYY-MM-DD HH:mm:ss')} |
|
|
/> |
|
|
/> |
|
|
} |
|
|
} |
|
@ -281,6 +283,10 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat |
|
|
['4009', '3001', '4004', '4001', '4007'].includes(s.proto) && <> |
|
|
['4009', '3001', '4004', '4001', '4007'].includes(s.proto) && <> |
|
|
<Form.Select label="关联温度的测点" field={s.proto + "tempName1"} showClear placeholder="请选择关联的温度测点" style={{ width: 300 }} filter |
|
|
<Form.Select label="关联温度的测点" field={s.proto + "tempName1"} showClear placeholder="请选择关联的温度测点" style={{ width: 300 }} filter |
|
|
initValue={eidtData?.factors?.find(c => c.codeName == s.proto)?.tempName?.find(c => c.index == 1)?.id || ""} |
|
|
initValue={eidtData?.factors?.find(c => c.codeName == s.proto)?.tempName?.find(c => c.index == 1)?.id || ""} |
|
|
|
|
|
onChange={v => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}} |
|
|
> |
|
|
> |
|
|
{s.sensor?.map((item) => { |
|
|
{s.sensor?.map((item) => { |
|
|
return <Form.Select.Option value={item.id} label={item.name}></Form.Select.Option> |
|
|
return <Form.Select.Option value={item.id} label={item.name}></Form.Select.Option> |
|
@ -295,6 +301,9 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat |
|
|
|
|
|
|
|
|
})} |
|
|
})} |
|
|
</Form.Select> |
|
|
</Form.Select> |
|
|
|
|
|
<Form.DatePicker field={s.proto + 'releTime'} label='关联开始结束时间' type='dateTimeRange' showClear style={{ width: 360 }} |
|
|
|
|
|
initValue={eidtData?.factors?.find(c => c.codeName == s.proto)?.releStartTime && [moment(eidtData?.factors?.find(c => c.codeName == s.proto)?.releStartTime).format('YYYY-MM-DD HH:mm:ss'), moment(eidtData?.factors?.find(c => c.codeName == s.proto)?.releEndTime).format('YYYY-MM-DD HH:mm:ss')] || null} |
|
|
|
|
|
/> |
|
|
</> |
|
|
</> |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -304,9 +313,7 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat |
|
|
<Form.Input field={s.proto + "tempStaName"} label='关联温度名称' style={{ width: 300 }} placeholder="请输入关联温度名称" showClear |
|
|
<Form.Input field={s.proto + "tempStaName"} label='关联温度名称' style={{ width: 300 }} placeholder="请输入关联温度名称" showClear |
|
|
initValue={eidtData?.factors?.find(c => c.codeName == s.proto)?.tempStaName || ""} |
|
|
initValue={eidtData?.factors?.find(c => c.codeName == s.proto)?.tempStaName || ""} |
|
|
/> */} |
|
|
/> */} |
|
|
<Form.DatePicker field={s.proto + 'releTime'} label='关联开始结束时间' type='dateTimeRange' showClear style={{ width: 360 }} |
|
|
|
|
|
initValue={eidtData?.factors?.find(c => c.codeName == s.proto)?.releStartTime && [moment(eidtData?.factors?.find(c => c.codeName == s.proto)?.releStartTime).format('YYYY-MM-DD HH:mm:ss'), moment(eidtData?.factors?.find(c => c.codeName == s.proto)?.releEndTime).format('YYYY-MM-DD HH:mm:ss')] || null} |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</Collapse.Panel> |
|
|
</Collapse.Panel> |
|
|