Browse Source

关联温度的测点修改

dev
wenlele 2 years ago
parent
commit
64448358b9
  1. 19
      web/client/src/sections/service/components/automatic-Modal.jsx

19
web/client/src/sections/service/components/automatic-Modal.jsx

@ -29,7 +29,7 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat
let Factor = data?.find(s => s.strucId == eidtData?.structId)?.factor || []
setFactorList(Factor)
setFactorChech(Factor?.filter(s => eidtData?.factors?.map(s => s.codeName)?.includes(s.proto)))
setActiveKey(eidtData?.factors?.map(s => s.codeName) || [])
// setActiveKey(eidtData?.factors?.map(s => s.codeName) || [])
}
}, [])
@ -218,7 +218,7 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat
rules={[{ required: true, message: "请选择监测因素" }]} disabled={structId ? false : true}
onChange={v => {
setFactorChech(factorList?.filter(s => v.includes(s.proto)))
setActiveKey(v)
// setActiveKey(v)
}} >
{factorList?.map((item) => {
return <Form.Select.Option value={item.proto} label={item.name}></Form.Select.Option>
@ -227,7 +227,8 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat
</Form.Select>
{factorChech?.length > 0 ? <Collapse style={{ margin: '20px 0 20px 30px', width: '90%', background: '#b7c9e624' }}
activeKey={activeKey}
// activeKey={activeKey}
keepDOM={true}
onChange={v => {
// setActiveKey(v)
}}
@ -242,7 +243,7 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat
/>
<Form.Upload label="布点图片" field={s.proto + "pointPicPath"} style={{ display: 'inline-block', }}
initValue={eidtData?.factors?.find(c => c.codeName == s.proto)?.pointPicPath && [{ url: `/_file-server/${eidtData?.factors?.find(c => c.codeName == s.proto)?.pointPicPath?.slice(qiniuUrl.length + 1)}`, name: eidtData?.factors?.find(c => c.codeName == s.proto)?.pointPicPath?.split('/')?.pop(), status: 'success', preview: ['png', 'jpg', 'jpeg'].includes(eidtData?.factors?.find(c => c.codeName == s.proto)?.pointPicPath?.split('.')?.pop()?.replace('.', '')) }] || null}
rules={[{ required: true, message: "请上传布点图片" }]}
rules={[{ required: true, message: "请上传布点图片" }]}
action={`${apiRoot}/attachments/p`}
accept={'.png, .jpg, .jpeg'}
limit={1} maxSize={5120}
@ -276,7 +277,8 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat
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')}
/>
}
{
['4009', '3001', '4004', '4001', '4007'].includes(s.proto) && <>
<Form.Select label="关联温度的测点" field={s.proto + "tempName1"} placeholder="请选择关联的温度测点" style={{ width: 300 }} filter
initValue={eidtData?.factors?.find(c => c.codeName == s.proto)?.tempName?.find(c => c.index == 1)?.id || ""}
>
@ -285,14 +287,17 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat
})}
</Form.Select>
<Form.Select label="温度测点" field={s.proto + "tempName2"} placeholder="请选择温度测点" style={{ width: 300 }} filter
<Form.Select label="温度测点" field={s.proto + "tempName2"} placeholder="请选择温度测点" style={{ width: 300 }} filter showClear
initValue={eidtData?.factors?.find(c => c.codeName == s.proto)?.tempName?.find(c => c.index == 2)?.id || ""}
>
{factorList?.find(d => s.proto == 1004)?.sensor?.map((item) => {
{factorList?.find(d => d.proto == 1004 || d.proto == 1002)?.sensor?.map((item) => {
return <Form.Select.Option value={item.name} label={item.name}></Form.Select.Option>
})}
</Form.Select>
</>
}
{/* <Form.Input field={s.proto + "glStaName"} label='' style={{ width: 300 }} placeholder="" showClear
initValue={eidtData?.factors?.find(c => c.codeName == s.proto)?.glStaName || ""}
/>

Loading…
Cancel
Save