diff --git a/web/client/src/sections/service/components/automatic-Modal.jsx b/web/client/src/sections/service/components/automatic-Modal.jsx index 66e1273..47e8365 100644 --- a/web/client/src/sections/service/components/automatic-Modal.jsx +++ b/web/client/src/sections/service/components/automatic-Modal.jsx @@ -33,7 +33,7 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat 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.proto)) + 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) || []) @@ -61,7 +61,7 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat onOk={() => { form.current.validate().then((v) => { - console.log(11, v); + // console.log(11, v); let data = { id: eidtData?.id, reportName: v.reportName, //报表名称 @@ -81,7 +81,7 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat 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) { //结构物概况图片 @@ -104,7 +104,7 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat v[p + 'factorId']?.forEach(d => { let factorFind = structFind?.factors?.find(c => c.codeName == d) || {} - let index = d.length + structNameIndex + 5 + let index = d.toString().length + structNameIndex + 5 let factorData = {} for (let key in v) { factorData.codeName = d @@ -118,7 +118,7 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat //索力监测描述 if (key?.slice(index) == 'factorDescrip') factorData.factorDescrip = v[key] //测点选择 - if (key?.slice(index) == 'sensorNames') factorData.sensorNames = factorChech[p]?.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') { factorData.startTime = v[key] && v[key][0] && moment(v[key][0]).format('YYYY-MM-DD HH:mm:ss') @@ -129,7 +129,7 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat factorData.tempName?.push({ index: 1, id: v[key], - name: factorChech[p]?.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 }) } //温度测点 @@ -157,6 +157,7 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat data.structList.push(structData) }) + // console.log(222, data); dispatch(service.postAutomaticReport(data)).then((res) => { if (res.success) { close() @@ -278,7 +279,7 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat />