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 /> d.structId == s.strucId)?.conclusion || ""} - // rules={[{ required: true, message: "请输入结论" }]} + // rules={[{ required: true, message: "请输入结论" }]} /> s.codeName) || []} rules={[{ required: true, message: "请选择监测因素" }]} disabled={structId ? false : true} onChange={v => { - setFactorChech({ ...factorChech, [s.strucId]: s.factor?.filter(d => v.includes(d.proto)) || [] }) + setFactorChech({ ...factorChech, [s.strucId]: s.factor?.filter(d => v.includes(d.id)) || [] }) // setActiveKey(v) }} > {s.factor?.map((item) => { - return + return })} @@ -305,14 +306,14 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat > { factorChech[s.strucId]?.map(p => { - let factorFind = structFind?.factors?.find(c => c.codeName == p.proto) || {} - return + let factorFind = structFind?.factors?.find(c => c.codeName == p.id) || {} + return
- - {s.proto == 2001 && - } - a.id) || []} rules={[{ required: true, message: "请选择测点选择" }]} > @@ -338,20 +339,20 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat return })} - { ['2001', '4004', '4007', '4008'].includes(p.proto) && - } { ['4009', '3001', '4004', '4001', '4007'].includes(s.proto) && <> - c.index == 1)?.id || ""} onChange={v => { @@ -363,7 +364,7 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat })} - c.index == 2)?.id || ""} > {s.factors?.find(d => d.proto == 1004 || d.proto == 1002)?.sensor?.map((item) => { @@ -371,7 +372,7 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat })} - diff --git a/web/client/src/sections/service/containers/automaticReport.jsx b/web/client/src/sections/service/containers/automaticReport.jsx index 67029df..11663e9 100644 --- a/web/client/src/sections/service/containers/automaticReport.jsx +++ b/web/client/src/sections/service/containers/automaticReport.jsx @@ -134,9 +134,9 @@ const AutomaticReport = ({ dispatch, actions, user, clientHeight, loading, gener 4007: 'QDQXJC', 1004: 'JGWDJC' } - row?.factors?.forEach(d => { - d.codeName = dataList[d.codeName] - }) + // row?.factors?.forEach(d => { + // d.codeName = dataList[d.codeName] + // }) dispatch(service.postGenerateReport({ ...row, structId: "" })).then((res) => { if (res.success) {