Browse Source

报表时间格式修改

dev
wenlele 1 year ago
parent
commit
34403da99c
  1. 16
      web/client/src/sections/service/components/automatic-Modal.jsx
  2. 2
      web/client/src/sections/service/containers/automaticReport.jsx

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

@ -72,7 +72,7 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat
framer: v.framer, // framer: v.framer, //
auditor: v.auditor, // auditor: v.auditor, //
ratifier: v.ratifier, // ratifier: v.ratifier, //
coverTime: v.coverTime && moment(v.coverTime).format('YYYY-MM-DD'), coverTime: v.coverTime && moment(v.coverTime),
structId: v.structId, //id structId: v.structId, //id
structList: [] structList: []
} }
@ -92,8 +92,8 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat
if (key?.slice(structNameIndex) == 'conclusion') structData.conclusion = v[key] if (key?.slice(structNameIndex) == 'conclusion') structData.conclusion = v[key]
// //
if (key?.slice(structNameIndex) == 'reportTime') { if (key?.slice(structNameIndex) == 'reportTime') {
structData.reportStartTime = v[key] && v[key][0] && moment(v[key][0]).format('YYYY-MM-DD HH:mm:ss') structData.reportStartTime = v[key] && v[key][0] && moment(v[key][0])
structData.reportEndTime = v[key] && v[key][1] && moment(v[key][1]).format('YYYY-MM-DD HH:mm:ss') structData.reportEndTime = v[key] && v[key][1] && moment(v[key][1])
} }
// //
structData.factors = [] structData.factors = []
@ -121,8 +121,8 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat
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) == '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] && v[key][0] && 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] && v[key][1] && 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') {
@ -141,11 +141,11 @@ const AutomaticModal = ({ actions, dispatch, apiRoot, qiniuUrl, visible, eidtDat
}) })
} }
// //
if (key?.slice(index) == 'initialTime') factorData.initialTime = v[key] && moment(v[key]).format('YYYY-MM-DD HH:mm:ss') if (key?.slice(index) == 'initialTime') factorData.initialTime = v[key] && moment(v[key])
// //
if (key?.slice(index) == 'releTime') { if (key?.slice(index) == 'releTime') {
factorData.releStartTime = v[key] && v[key][0] && 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] && v[key][1] && moment(v[key][1]).format('YYYY-MM-DD HH:mm:ss') factorData.releEndTime = v[key] && v[key][1] && moment(v[key][1])
} }
} }
} }

2
web/client/src/sections/service/containers/automaticReport.jsx

@ -137,7 +137,7 @@ const AutomaticReport = ({ dispatch, actions, user, clientHeight, loading, gener
// row?.factors?.forEach(d => { // row?.factors?.forEach(d => {
// d.codeName = dataList[d.codeName] // d.codeName = dataList[d.codeName]
// }) // })
// console.log(1212, row);
dispatch(service.postGenerateReport({ ...row, structId: "" })).then((res) => { dispatch(service.postGenerateReport({ ...row, structId: "" })).then((res) => {
if (res.success) { if (res.success) {
setQuery({ limit: 10, page: 0 }) setQuery({ limit: 10, page: 0 })

Loading…
Cancel
Save