|
@ -12,10 +12,11 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat |
|
|
const [strucData, setStrucData] = useState([]) //结构物数据 |
|
|
const [strucData, setStrucData] = useState([]) //结构物数据 |
|
|
|
|
|
|
|
|
const [projectId, setProjectId] = useState(); //项目id |
|
|
const [projectId, setProjectId] = useState(); //项目id |
|
|
const [structId, setStructId] = useState(); //结构物id |
|
|
const [structId, setStructId] = useState([]); //结构物id |
|
|
const [factorId, setFactorId] = useState([]); //监测因素id |
|
|
const [factorId, setFactorId] = useState([]); //监测因素id |
|
|
const [factorList, setFactorList] = useState([]); //监测因素 |
|
|
const [factorList, setFactorList] = useState([]); //监测因素 |
|
|
const [factorChech, setFactorChech] = useState([]); //选中的监测因素 |
|
|
const [structChech, setStructChech] = useState([]); //选中的结构物 |
|
|
|
|
|
const [factorChech, setFactorChech] = useState({}); //选中的结构物 |
|
|
const [activeKey, setActiveKey] = useState([]); // |
|
|
const [activeKey, setActiveKey] = useState([]); // |
|
|
const [correlationId, setCorrelationId] = useState([]); // |
|
|
const [correlationId, setCorrelationId] = useState([]); // |
|
|
|
|
|
|
|
@ -23,13 +24,18 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat |
|
|
useEffect(async () => { |
|
|
useEffect(async () => { |
|
|
if (eidtData?.id) { |
|
|
if (eidtData?.id) { |
|
|
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) || []) |
|
|
|
|
|
|
|
|
let data = await getData(eidtData?.projectId) |
|
|
let data = await getData(eidtData?.projectId) |
|
|
let Factor = data?.find(s => s.strucId == eidtData?.structId)?.factor || [] |
|
|
let struc = data?.filter(s => eidtData?.structId?.includes(s.strucId)) || [] |
|
|
setFactorList(Factor) |
|
|
|
|
|
setFactorChech(Factor?.filter(s => eidtData?.factors?.map(s => s.codeName)?.includes(s.proto))) |
|
|
setStructChech(struc) |
|
|
|
|
|
let Factor = {} |
|
|
|
|
|
struc?.forEach(d => { |
|
|
|
|
|
Factor[d.strucId] = d.factor?.filter(w => eidtData?.structList?.find(h => h.structId == d.strucId)?.factors?.map(g => g.codeName)?.includes(w.id)) |
|
|
|
|
|
}) |
|
|
|
|
|
setFactorChech(Factor) |
|
|
// setActiveKey(eidtData?.factors?.map(s => s.codeName) || []) |
|
|
// setActiveKey(eidtData?.factors?.map(s => s.codeName) || []) |
|
|
} |
|
|
} |
|
|
}, []) |
|
|
}, []) |
|
@ -48,76 +54,110 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat |
|
|
return ( |
|
|
return ( |
|
|
<> |
|
|
<> |
|
|
<Modal |
|
|
<Modal |
|
|
title={eidtData.id ? "编辑生成规制" : '新增生成规制'} |
|
|
title={eidtData.id ? "编辑报表生成规则" : '新增报表生成规则'} |
|
|
okText="确定" |
|
|
okText="确定" |
|
|
cancelText="取消" |
|
|
cancelText="取消" |
|
|
visible={visible} |
|
|
visible={visible} |
|
|
onOk={() => { |
|
|
onOk={() => { |
|
|
|
|
|
|
|
|
form.current.validate().then((v) => { |
|
|
form.current.validate().then((v) => { |
|
|
|
|
|
// console.log(11, v); |
|
|
let data = { |
|
|
let data = { |
|
|
id: eidtData?.id, |
|
|
id: eidtData?.id, |
|
|
reportName: v.reportName, |
|
|
reportName: v.reportName, //报表名称 |
|
|
projectId: v.projectId, |
|
|
projectId: v.projectId, //所属项目 |
|
|
projectName: v.projectName, |
|
|
projectName: v.projectName, //项目名称 |
|
|
reportType: v.reportType, |
|
|
reportType: v.reportType, //报表类型 |
|
|
reportPicPath: v.reportPicPath[0]?.response?.url, |
|
|
reportPicPath: v.reportPicPath && v.reportPicPath[0] && v.reportPicPath[0]?.response?.url || eidtData.reportPicPath, //首页图片 |
|
|
overview: v.overview[0]?.response?.url, |
|
|
framer: v.framer, //制定者 |
|
|
framer: v.framer, |
|
|
auditor: v.auditor, //审核者 |
|
|
auditor: v.auditor, |
|
|
ratifier: v.ratifier, //批准者 |
|
|
ratifier: v.ratifier, |
|
|
coverTime: v.coverTime && moment(v.coverTime), |
|
|
structId: v.structId, |
|
|
structId: v.structId, //结构物id |
|
|
projectOverview: v.projectOverview, |
|
|
structList: [] |
|
|
reportStartTime: moment(v.reportTime[0]).format('YYYY-MM-DD HH:mm:ss'), |
|
|
} |
|
|
reportEndTime: moment(v.reportTime[1]).format('YYYY-MM-DD HH:mm:ss'), |
|
|
|
|
|
time: eidtData?.time && moment(eidtData?.time).format('YYYY-MM-DD HH:mm:ss') || null, |
|
|
v.structId?.forEach(p => { |
|
|
factors: [] |
|
|
let structFind = eidtData?.structList?.find(d => d.structId == p) || {} |
|
|
|
|
|
let structData = { structId: p } |
|
|
|
|
|
let structNameIndex = p.toString().length || 0 |
|
|
|
|
|
|
|
|
|
|
|
for (let key in v) { |
|
|
|
|
|
if (key?.indexOf(p) != -1) { |
|
|
|
|
|
//结构物概况图片 |
|
|
|
|
|
if (key?.slice(structNameIndex) == 'overview') structData.overview = v[key] && v[key][0]?.response?.url || structFind.overview |
|
|
|
|
|
//结构物描述 |
|
|
|
|
|
if (key?.slice(structNameIndex) == 'projectOverview') structData.projectOverview = v[key] |
|
|
|
|
|
//结论 |
|
|
|
|
|
if (key?.slice(structNameIndex) == 'conclusion') structData.conclusion = v[key] |
|
|
|
|
|
//开始结束时间 |
|
|
|
|
|
if (key?.slice(structNameIndex) == 'reportTime') { |
|
|
|
|
|
structData.reportStartTime = v[key] && v[key][0] && moment(v[key][0]) |
|
|
|
|
|
structData.reportEndTime = v[key] && v[key][1] && moment(v[key][1]) |
|
|
} |
|
|
} |
|
|
|
|
|
//包含的监测因素 |
|
|
|
|
|
structData.factors = [] |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// debugger |
|
|
|
|
|
|
|
|
v.factorId?.forEach(d => { |
|
|
v[p + 'factorId']?.forEach(d => { |
|
|
let index = d.length |
|
|
let factorFind = structFind?.factors?.find(c => c.codeName == d) || {} |
|
|
|
|
|
let index = d.toString().length + structNameIndex + 5 |
|
|
let factorData = {} |
|
|
let factorData = {} |
|
|
for (let key in v) { |
|
|
for (let key in v) { |
|
|
factorData.codeName = d |
|
|
factorData.codeName = d |
|
|
factorData.tempName = factorData.tempName || [] |
|
|
factorData.tempName = factorData.tempName || [] |
|
|
if (key?.indexOf(d) != -1) { |
|
|
if (key?.indexOf(p + 'struc') != -1 && key?.indexOf('struc' + d) != -1) { |
|
|
|
|
|
//布点描述 |
|
|
if (key?.slice(index) == 'pointDescrip') factorData.pointDescrip = v[key] |
|
|
if (key?.slice(index) == 'pointDescrip') factorData.pointDescrip = v[key] |
|
|
if (key?.slice(index) == 'pointPicPath') factorData.pointPicPath = v[key] && v[key][0]?.response?.url |
|
|
//布点图片 |
|
|
|
|
|
if (key?.slice(index) == 'pointPicPath') factorData.pointPicPath = v[key] && v[key][0]?.response?.url || |
|
|
|
|
|
factorFind.pointPicPath |
|
|
|
|
|
//索力监测描述 |
|
|
if (key?.slice(index) == 'factorDescrip') factorData.factorDescrip = v[key] |
|
|
if (key?.slice(index) == 'factorDescrip') factorData.factorDescrip = v[key] |
|
|
if (key?.slice(index) == 'sensorNames') factorData.sensorNames = factorChech?.find(p => p.proto == d)?.sensor?.filter(f => v[key]?.includes(f.id))?.map(c => ({ id: c.id, name: c.name })) || [] |
|
|
//测点选择 |
|
|
|
|
|
if (key?.slice(index) == 'sensorNames') factorData.sensorNames = factorChech[p]?.find(p => p.id == d)?.sensor?.filter(f => v[key]?.includes(f.id))?.map(c => ({ id: c.id, name: c.name })) || [] |
|
|
|
|
|
//开始结束时间 |
|
|
if (key?.slice(index) == 'startEndTime') { |
|
|
if (key?.slice(index) == 'startEndTime') { |
|
|
factorData.startTime = v[key] && moment(v[key][0]).format('YYYY-MM-DD HH:mm:ss') |
|
|
factorData.startTime = v[key] && v[key][0] && moment(v[key][0]) |
|
|
factorData.endTime = v[key] && moment(v[key][1]).format('YYYY-MM-DD HH:mm:ss') |
|
|
factorData.endTime = v[key] && v[key][1] && moment(v[key][1]) |
|
|
} |
|
|
} |
|
|
|
|
|
//关联温度的测点 |
|
|
if (key?.slice(index) == 'tempName1') { |
|
|
if (key?.slice(index) == 'tempName1') { |
|
|
factorData.tempName?.push({ |
|
|
factorData.tempName?.push({ |
|
|
index: 1, |
|
|
index: 1, |
|
|
id: v[key], |
|
|
id: v[key], |
|
|
name: factorChech?.find(p => p.proto == d)?.sensor?.find(f => v[key] == f.id)?.name |
|
|
name: factorChech[p]?.find(p => p.id == d)?.sensor?.find(f => v[key] == f.id)?.name |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
//温度测点 |
|
|
if (key?.slice(index) == 'tempName2') { |
|
|
if (key?.slice(index) == 'tempName2') { |
|
|
factorData.tempName?.push({ |
|
|
factorData.tempName?.push({ |
|
|
index: 2, |
|
|
index: 2, |
|
|
id: v[key], |
|
|
id: v[key], |
|
|
name: factorChech?.find(p => p.proto == 1004)?.sensor?.find(f => v[key] == f.id)?.name |
|
|
name: factorChech[p]?.find(p => p.proto == 1004)?.sensor?.find(f => v[key] == f.id)?.name |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
if (key?.slice(index) == 'factorDescrip') factorData.factorDescrip = v[key] |
|
|
//数据初始时间 |
|
|
// if (key?.slice(index) == 'glStaName') factorData.glStaName = v[key] |
|
|
if (key?.slice(index) == 'initialTime') factorData.initialTime = v[key] && moment(v[key]) |
|
|
// if (key?.slice(index) == 'tempStaName') factorData.tempStaName = v[key] |
|
|
//关联开始结束时间 |
|
|
if (key?.slice(index) == 'initialTime') factorData.initialTime = v[key] && moment(v[key]).format('YYYY-MM-DD HH:mm:ss') |
|
|
|
|
|
if (key?.slice(index) == 'releTime') { |
|
|
if (key?.slice(index) == 'releTime') { |
|
|
factorData.releStartTime = v[key] && moment(v[key][0]).format('YYYY-MM-DD HH:mm:ss') |
|
|
factorData.releStartTime = v[key] && v[key][0] && moment(v[key][0]) |
|
|
factorData.releEndTime = v[key] && moment(v[key][1]).format('YYYY-MM-DD HH:mm:ss') |
|
|
factorData.releEndTime = v[key] && v[key][1] && moment(v[key][1]) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
factorData.glStaName = factorData?.tempName?.find(s => s.index == 1)?.name |
|
|
factorData.glStaName = 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 |
|
|
factorData.tempStaName = factorData?.tempName?.find(s => s.index == 2)?.name || factorData?.tempName?.find(s => s.index == 1)?.name |
|
|
data.factors?.push(factorData) |
|
|
structData.factors?.push(factorData) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
data.structList.push(structData) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// console.log(222, data); |
|
|
dispatch(service.postAutomaticReport(data)).then((res) => { |
|
|
dispatch(service.postAutomaticReport(data)).then((res) => { |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
|
close() |
|
|
close() |
|
@ -127,7 +167,7 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
}} |
|
|
}} |
|
|
width={700} |
|
|
width={770} |
|
|
onCancel={() => close()} |
|
|
onCancel={() => close()} |
|
|
> |
|
|
> |
|
|
<Form |
|
|
<Form |
|
@ -147,14 +187,14 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat |
|
|
onChange={v => { |
|
|
onChange={v => { |
|
|
setProjectId(v) |
|
|
setProjectId(v) |
|
|
getData(v) |
|
|
getData(v) |
|
|
form.current.setValue('structId', null) |
|
|
form.current.setValue('structId', []) |
|
|
setStructId("") |
|
|
setStructId([]) |
|
|
setFactorList([]) |
|
|
// setFactorList([]) |
|
|
form.current.setValue('factorId', []) |
|
|
// form.current.setValue('factorId', []) |
|
|
setFactorChech([]) |
|
|
setStructChech([]) |
|
|
}} > |
|
|
}} > |
|
|
{projectList?.map((item) => { |
|
|
{projectList?.map((item) => { |
|
|
return <Form.Select.Option value={item.id} label={item.name || item.pepProjectName}></Form.Select.Option> |
|
|
return <Form.Select.Option value={item.id} key={item.id} label={item.name || item.pepProjectName}></Form.Select.Option> |
|
|
|
|
|
|
|
|
})} |
|
|
})} |
|
|
</Form.Select> |
|
|
</Form.Select> |
|
@ -178,16 +218,7 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat |
|
|
文件上传 |
|
|
文件上传 |
|
|
</Button> |
|
|
</Button> |
|
|
</Form.Upload> |
|
|
</Form.Upload> |
|
|
<Form.Upload label="项目概况" field="overview" style={{ display: 'inline-block', }} |
|
|
|
|
|
initValue={eidtData?.overview && [{ url: `/_file-server/${eidtData?.overview?.slice(qiniuUrl.length + 1)}`, name: eidtData.overview?.split('/')?.pop(), status: 'success', preview: ['png', 'jpg', 'jpeg'].includes(eidtData.reportPicPath?.split('.')?.pop()?.replace('.', '')) }] || null} |
|
|
|
|
|
action={`${apiRoot}/attachments/p`} |
|
|
|
|
|
accept={'.txt, .doc, .docx, .xls, .xlsx, .pdf, .png, .jpg, .rar, .zip'} |
|
|
|
|
|
limit={1} maxSize={5120} |
|
|
|
|
|
> |
|
|
|
|
|
<Button icon={<IconUpload />} theme="light"> |
|
|
|
|
|
文件上传 |
|
|
|
|
|
</Button> |
|
|
|
|
|
</Form.Upload> |
|
|
|
|
|
<Form.Input field="framer" label='制定者' style={{ width: 300 }} placeholder="请输入制定者" showClear |
|
|
<Form.Input field="framer" label='制定者' style={{ width: 300 }} placeholder="请输入制定者" showClear |
|
|
initValue={eidtData?.framer || ""} |
|
|
initValue={eidtData?.framer || ""} |
|
|
rules={[{ required: true, message: "请输入制定者" }]} |
|
|
rules={[{ required: true, message: "请输入制定者" }]} |
|
@ -200,44 +231,73 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat |
|
|
initValue={eidtData?.ratifier || ""} |
|
|
initValue={eidtData?.ratifier || ""} |
|
|
rules={[{ required: true, message: "请输入批准者" }]} |
|
|
rules={[{ required: true, message: "请输入批准者" }]} |
|
|
/> |
|
|
/> |
|
|
|
|
|
<Form.DatePicker label="封面时间" field="coverTime" showClear style={{ width: 300 }} |
|
|
|
|
|
initValue={eidtData?.coverTime && moment(eidtData?.coverTime).format('YYYY-MM-DD') || ""} |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
<Form.Select label="结构物" field="structId" placeholder="请选择结构物" showClear style={{ width: 300 }} filter |
|
|
<Form.Select label="结构物" field="structId" placeholder="请选择结构物" showClear style={{ width: 300 }} filter |
|
|
rules={[{ required: true, message: "请选择结构物" }]} disabled={projectId ? false : true} |
|
|
rules={[{ required: true, message: "请选择结构物" }]} disabled={projectId ? false : true} |
|
|
initValue={eidtData?.structId || ""} |
|
|
initValue={eidtData?.structId || ""} multiple={true} |
|
|
onChange={v => { |
|
|
onChange={v => { |
|
|
setFactorList(strucData?.find(s => s.strucId == v)?.factor || []) |
|
|
// setFactorList(strucData?.find(s => v.includes(s.stdrucId)) || []) |
|
|
setStructId(v) |
|
|
setStructId(v) |
|
|
form.current.setValue('factorId', []) |
|
|
// form.current.setValue('factorId', []) |
|
|
setFactorChech([]) |
|
|
setStructChech(strucData?.filter(s => v.includes(s.strucId)) || []) |
|
|
}} > |
|
|
}} > |
|
|
{strucData?.map((item) => { |
|
|
{strucData?.map((item) => { |
|
|
return <Form.Select.Option value={item.strucId} label={item.strucName}></Form.Select.Option> |
|
|
return <Form.Select.Option value={item.strucId} key={item.strucId} label={item.strucName}></Form.Select.Option> |
|
|
|
|
|
|
|
|
})} |
|
|
})} |
|
|
</Form.Select> |
|
|
</Form.Select> |
|
|
|
|
|
|
|
|
<Form.TextArea field="projectOverview" label='报表描述' style={{ width: 420 }} autosize={{ minRows: 2, maxRows: 10 }} placeholder="请输入报表描述" showClear |
|
|
{/*所选结构物 */} |
|
|
initValue={eidtData?.projectOverview || ""} |
|
|
{structChech?.length > 0 ? <Collapse style={{ margin: '20px 0 20px 30px', width: '90%', background: '#b7c9e624' }} |
|
|
rules={[{ required: true, message: "请输入报表描述" }]} |
|
|
// activeKey={activeKey} |
|
|
|
|
|
keepDOM={true} |
|
|
|
|
|
onChange={v => { |
|
|
|
|
|
// setActiveKey(v) |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
{ |
|
|
|
|
|
structChech?.map(s => { |
|
|
|
|
|
let structFind = eidtData?.structList?.find(d => d.structId == s.strucId) || {} |
|
|
|
|
|
return <Collapse.Panel header={s.strucName} itemKey={`'${s.strucId}'`} key={s.strucId}> |
|
|
|
|
|
<div style={{ background: "#FFF" }}> |
|
|
|
|
|
<Form.Upload label="结构物概况图片" field={s.strucId + "overview"} style={{ display: 'inline-block', }} |
|
|
|
|
|
initValue={structFind?.overview && [{ url: `/_file-server/${structFind?.overview?.slice(qiniuUrl.length + 1)}`, name: structFind.overview?.split('/')?.pop(), status: 'success', preview: ['png', 'jpg', 'jpeg'].includes(structFind.overview?.split('.')?.pop()?.replace('.', '')) }] || null} |
|
|
|
|
|
action={`${apiRoot}/attachments/p`} |
|
|
|
|
|
accept={'.txt, .doc, .docx, .xls, .xlsx, .pdf, .png, .jpg, .rar, .zip'} |
|
|
|
|
|
limit={1} maxSize={5120} |
|
|
|
|
|
> |
|
|
|
|
|
<Button icon={<IconUpload />} theme="light"> |
|
|
|
|
|
文件上传 |
|
|
|
|
|
</Button> |
|
|
|
|
|
</Form.Upload> |
|
|
|
|
|
<Form.TextArea field={s.strucId + "projectOverview"} label='结构物描述' style={{ width: 390 }} autosize={{ minRows: 2, maxRows: 10 }} placeholder="请输入结构物描述" showClear |
|
|
|
|
|
initValue={structFind?.projectOverview || ""} |
|
|
|
|
|
rules={[{ required: true, message: "请输入结构物描述" }]} |
|
|
|
|
|
/> |
|
|
|
|
|
<Form.TextArea field={s.strucId + "conclusion"} label='结论' style={{ width: 390 }} autosize={{ minRows: 2, maxRows: 10 }} placeholder="请输入结论" showClear |
|
|
|
|
|
initValue={eidtData?.structList?.find(d => d.structId == s.strucId)?.conclusion || ""} |
|
|
|
|
|
// rules={[{ required: true, message: "请输入结论" }]} |
|
|
/> |
|
|
/> |
|
|
<Form.DatePicker field='reportTime' label='开始结束时间' type='dateTimeRange' showClear |
|
|
<Form.DatePicker field={s.strucId + 'reportTime'} label='开始结束时间' type='dateTimeRange' showClear |
|
|
initValue={eidtData?.reportStartTime && [moment(eidtData?.reportStartTime).format('YYYY-MM-DD HH:mm:ss'), moment(eidtData?.reportEndTime).format('YYYY-MM-DD HH:mm:ss')] || null} |
|
|
initValue={structFind?.reportStartTime && [moment(structFind?.reportStartTime).format('YYYY-MM-DD HH:mm:ss'), moment(structFind?.reportEndTime).format('YYYY-MM-DD HH:mm:ss')] || null} style={{ width: 390 }} |
|
|
rules={[{ required: true, message: "请选择开始结束时间" }]} |
|
|
rules={[{ required: true, message: "请选择开始结束时间" }]} |
|
|
/> |
|
|
/> |
|
|
<Form.Select label="包含的监测因素" field="factorId" placeholder="请选择监测因素" showClear style={{ width: 300 }} filter multiple={true} |
|
|
<Form.Select label="包含的监测因素" field={s.strucId + "factorId"} placeholder="请选择监测因素" showClear style={{ width: 300 }} filter multiple={true} |
|
|
initValue={eidtData?.factors?.map(s => s.codeName) || []} |
|
|
initValue={structFind?.factors?.map(s => s.codeName) || []} |
|
|
rules={[{ required: true, message: "请选择监测因素" }]} disabled={structId ? false : true} |
|
|
rules={[{ required: true, message: "请选择监测因素" }]} disabled={structId ? false : true} |
|
|
onChange={v => { |
|
|
onChange={v => { |
|
|
setFactorChech(factorList?.filter(s => v.includes(s.proto))) |
|
|
setFactorChech({ ...factorChech, [s.strucId]: s.factor?.filter(d => v.includes(d.id)) || [] }) |
|
|
// setActiveKey(v) |
|
|
// setActiveKey(v) |
|
|
}} > |
|
|
}} > |
|
|
{factorList?.map((item) => { |
|
|
{s.factor?.map((item) => { |
|
|
return <Form.Select.Option value={item.proto} label={item.name}></Form.Select.Option> |
|
|
return <Form.Select.Option value={item.id} key={item.id} label={item.name}></Form.Select.Option> |
|
|
})} |
|
|
})} |
|
|
|
|
|
|
|
|
</Form.Select> |
|
|
</Form.Select> |
|
|
|
|
|
{factorChech[s.strucId] ? <Collapse style={{ margin: '20px 0 20px 30px', width: '90%', background: '#b7c9e624' }} |
|
|
{factorChech?.length > 0 ? <Collapse style={{ margin: '20px 0 20px 30px', width: '90%', background: '#b7c9e624' }} |
|
|
|
|
|
// activeKey={activeKey} |
|
|
// activeKey={activeKey} |
|
|
keepDOM={true} |
|
|
keepDOM={true} |
|
|
onChange={v => { |
|
|
onChange={v => { |
|
@ -245,15 +305,16 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
{ |
|
|
{ |
|
|
factorChech?.map(s => { |
|
|
factorChech[s.strucId]?.map(p => { |
|
|
return <Collapse.Panel header={ s.name} itemKey={s.proto} key={s.proto}> |
|
|
let factorFind = structFind?.factors?.find(c => c.codeName == p.id) || {} |
|
|
|
|
|
return <Collapse.Panel header={p.name} itemKey={p.id} key={p.id}> |
|
|
<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.strucId + 'struc' + p.id + "pointDescrip"} label='布点描述' style={{ width: 340 }} autosize={{ minRows: 2, maxRows: 10 }} placeholder="请输入布点描述" showClear |
|
|
initValue={eidtData?.factors?.find(c => c.codeName == s.proto)?.pointDescrip || ""} |
|
|
initValue={factorFind?.pointDescrip || ""} |
|
|
rules={[{ required: true, message: "请输入布点描述" }]} |
|
|
rules={[{ required: true, message: "请输入布点描述" }]} |
|
|
/> |
|
|
/> |
|
|
<Form.Upload label="布点图片" field={s.proto + "pointPicPath"} style={{ display: 'inline-block', }} |
|
|
<Form.Upload label="布点图片" field={s.strucId + 'struc' + p.id + "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} |
|
|
initValue={factorFind?.pointPicPath && [{ url: `/_file-server/${factorFind?.pointPicPath?.slice(qiniuUrl.length + 1)}`, name: factorFind?.pointPicPath?.split('/')?.pop(), status: 'success', preview: ['png', 'jpg', 'jpeg'].includes(factorFind?.pointPicPath?.split('.')?.pop()?.replace('.', '')) }] || null} |
|
|
rules={[{ required: true, message: "请上传布点图片" }]} |
|
|
rules={[{ required: true, message: "请上传布点图片" }]} |
|
|
action={`${apiRoot}/attachments/p`} |
|
|
action={`${apiRoot}/attachments/p`} |
|
|
accept={'.png, .jpg, .jpeg'} |
|
|
accept={'.png, .jpg, .jpeg'} |
|
@ -265,66 +326,64 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat |
|
|
</Form.Upload> |
|
|
</Form.Upload> |
|
|
|
|
|
|
|
|
{s.proto == 2001 && |
|
|
{s.proto == 2001 && |
|
|
<Form.TextArea field={s.proto + "factorDescrip"} label='索力监测描述' style={{ width: 400 }} autosize={{ minRows: 2, maxRows: 10 }} placeholder="请输入布点描述" showClear |
|
|
<Form.TextArea field={s.strucId + 'struc' + p.id + "factorDescrip"} label='索力监测描述' style={{ width: 400 }} autosize={{ minRows: 2, maxRows: 10 }} placeholder="请输入布点描述" showClear |
|
|
initValue={eidtData?.factors?.find(c => c.codeName == s.proto)?.factorDescrip || ""} |
|
|
initValue={factorFind?.factorDescrip || ""} |
|
|
/> |
|
|
/> |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
<Form.Select label="测点选择" field={s.proto + "sensorNames"} multiple={true} placeholder="请选择测点选择" style={{ width: 300 }} showClear filter |
|
|
<Form.Select label="测点选择" field={s.strucId + 'struc' + p.id + "sensorNames"} multiple={true} placeholder="请选择测点选择" style={{ width: 300 }} showClear filter |
|
|
initValue={eidtData?.factors?.find(c => c.codeName == s.proto)?.sensorNames?.map(a => a.id) || []} |
|
|
initValue={factorFind?.sensorNames?.map(a => a.id) || []} |
|
|
rules={[{ required: true, message: "请选择测点选择" }]} |
|
|
rules={[{ required: true, message: "请选择测点选择" }]} |
|
|
> |
|
|
> |
|
|
{s.sensor?.map((item) => { |
|
|
{p.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> |
|
|
})} |
|
|
})} |
|
|
</Form.Select> |
|
|
</Form.Select> |
|
|
<Form.DatePicker field={s.proto + 'startEndTime'} label='开始结束时间' type='dateTimeRange' showClear style={{ width: 360 }} |
|
|
<Form.DatePicker field={s.strucId + 'struc' + p.id + 'startEndTime'} label='开始结束时间' type='dateTimeRange' showClear style={{ width: 360 }} |
|
|
initValue={eidtData?.factors?.find(c => c.codeName == s.proto)?.startTime && [moment(eidtData?.factors?.find(c => c.codeName == s.proto)?.startTime).format('YYYY-MM-DD HH:mm:ss'), moment(eidtData?.factors?.find(c => c.codeName == s.proto)?.endTime).format('YYYY-MM-DD HH:mm:ss')] || null} |
|
|
initValue={factorFind?.startTime && [moment(factorFind?.startTime).format('YYYY-MM-DD HH:mm:ss'), moment(factorFind?.endTime).format('YYYY-MM-DD HH:mm:ss')] || null} |
|
|
rules={[{ required: true, message: "请选择开始结束时间" }]} |
|
|
rules={[{ required: true, message: "请选择开始结束时间" }]} |
|
|
/> |
|
|
/> |
|
|
{ |
|
|
{ |
|
|
['2001', '4004', '4007', '4008'].includes(s.proto) && |
|
|
['2001', '4004', '4007', '4008'].includes(p.proto) && |
|
|
<Form.DatePicker field={s.proto + 'initialTime'} label='数据初始时间' type='dateTime' showClear |
|
|
<Form.DatePicker field={s.strucId + 'struc' + p.id + 'initialTime'} label='数据初始时间' type='dateTime' showClear |
|
|
rules={[{ required: true, message: "请选择数据初始时间" }]} |
|
|
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={factorFind?.initialTime && moment(factorFind?.initialTime).format('YYYY-MM-DD HH:mm:ss')} |
|
|
/> |
|
|
/> |
|
|
} |
|
|
} |
|
|
{ |
|
|
{ |
|
|
['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.strucId + 'struc' + p.id + "tempName1"} showClear placeholder="请选择关联的温度测点" style={{ width: 300 }} filter |
|
|
initValue={eidtData?.factors?.find(c => c.codeName == s.proto)?.tempName?.find(c => c.index == 1)?.id || ""} |
|
|
initValue={factorFind?.tempName?.find(c => c.index == 1)?.id || ""} |
|
|
onChange={v => { |
|
|
onChange={v => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
{s.sensor?.map((item) => { |
|
|
{p.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> |
|
|
|
|
|
|
|
|
})} |
|
|
})} |
|
|
</Form.Select> |
|
|
</Form.Select> |
|
|
<Form.Select label="温度测点" field={s.proto + "tempName2"} placeholder="请选择温度测点" style={{ width: 300 }} filter showClear |
|
|
<Form.Select label="温度测点" field={s.strucId + 'struc' + p.id + "tempName2"} placeholder="请选择温度测点" style={{ width: 300 }} filter showClear |
|
|
initValue={eidtData?.factors?.find(c => c.codeName == s.proto)?.tempName?.find(c => c.index == 2)?.id || ""} |
|
|
initValue={factorFind?.tempName?.find(c => c.index == 2)?.id || ""} |
|
|
> |
|
|
> |
|
|
{factorList?.find(d => d.proto == 1004 || d.proto == 1002)?.sensor?.map((item) => { |
|
|
{s.factors?.find(d => d.proto == 1004 || d.proto == 1002)?.sensor?.map((item) => { |
|
|
return <Form.Select.Option value={item.name} label={item.name}></Form.Select.Option> |
|
|
return <Form.Select.Option value={item.name} label={item.name}></Form.Select.Option> |
|
|
|
|
|
|
|
|
})} |
|
|
})} |
|
|
</Form.Select> |
|
|
</Form.Select> |
|
|
<Form.DatePicker field={s.proto + 'releTime'} label='关联开始结束时间' type='dateTimeRange' showClear style={{ width: 360 }} |
|
|
<Form.DatePicker field={s.strucId + 'struc' + p.id + '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} |
|
|
initValue={factorFind?.releStartTime && [moment(factorFind?.releStartTime).format('YYYY-MM-DD HH:mm:ss'), moment(factorFind?.releEndTime).format('YYYY-MM-DD HH:mm:ss')] || null} |
|
|
/> |
|
|
/> |
|
|
</> |
|
|
</> |
|
|
} |
|
|
} |
|
|
|
|
|
</div> |
|
|
{/* <Form.Input field={s.proto + "glStaName"} label='关联温度的测点名称' style={{ width: 300 }} placeholder="请输入关联温度的测点名称" showClear |
|
|
</Collapse.Panel> |
|
|
initValue={eidtData?.factors?.find(c => c.codeName == s.proto)?.glStaName || ""} |
|
|
}) |
|
|
/> |
|
|
} |
|
|
<Form.Input field={s.proto + "tempStaName"} label='关联温度名称' style={{ width: 300 }} placeholder="请输入关联温度名称" showClear |
|
|
|
|
|
initValue={eidtData?.factors?.find(c => c.codeName == s.proto)?.tempStaName || ""} |
|
|
|
|
|
/> */} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Collapse> : ""} |
|
|
</div> |
|
|
</div> |
|
|
</Collapse.Panel> |
|
|
</Collapse.Panel> |
|
|
}) |
|
|
}) |
|
@ -333,6 +392,7 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat |
|
|
|
|
|
|
|
|
</Collapse> : ""} |
|
|
</Collapse> : ""} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Form> |
|
|
</Form> |
|
|
</Modal > |
|
|
</Modal > |
|
|
</> |
|
|
</> |
|
|