Browse Source

feat:fix bugs

dev
zhaobing’ 1 year ago
parent
commit
35754cd891
  1. 2
      api/app/lib/schedule/workOrder.js
  2. 10
      web/client/src/sections/projectGroup/containers/bigscreen.jsx

2
api/app/lib/schedule/workOrder.js

@ -3,7 +3,7 @@ const schedule = require('node-schedule');
const moment = require('moment') const moment = require('moment')
const request = require('superagent'); const request = require('superagent');
let isDev = true let isDev = false
module.exports = function (app, opts,ctx) { module.exports = function (app, opts,ctx) {
const workOrder = app.fs.scheduleInit( const workOrder = app.fs.scheduleInit(

10
web/client/src/sections/projectGroup/containers/bigscreen.jsx

@ -36,6 +36,7 @@ const Bigscreen = (props) => {
useEffect(() => { useEffect(() => {
let groupIdLocal = JSON.parse(localStorage.getItem('project_group'))?.find(v => user?.id == v.userId)?.projectGroupId let groupIdLocal = JSON.parse(localStorage.getItem('project_group'))?.find(v => user?.id == v.userId)?.projectGroupId
let search = restProps?.location?.search || ''; let search = restProps?.location?.search || '';
@ -154,7 +155,7 @@ const Bigscreen = (props) => {
}) })
dispatch(actions.projectGroup.getWorkOrdersRepairRank({projectIds:query})).then(res=>{ dispatch(actions.projectGroup.getWorkOrdersRepairRank({projectIds:query})).then(res=>{
if(res.success){ if(res.success){
setGroupProject(res.payload.data?.slice(0, 10).map(v => ({name:v.formname,duration:moment(v?.endTime).add(8, 'hours').diff(v?.startTime,'hours') })) || []) setGroupProject(res.payload.data?.slice(0, 10).map(v => ({name:v.formname,startTime:moment(v.startTime).add(8, 'hours').format('YYYY-MM-DD HH'),duration:moment(v?.endTime).add(8, 'hours').diff(v?.startTime,'hours') })) || [])
} }
}) })
@ -229,6 +230,7 @@ const Bigscreen = (props) => {
}, [proportion]); }, [proportion]);
return ( return (
<div className='project-group'> <div className='project-group'>
<Header match={match} history={history} {...props} groupDetail={groupDetail} /> <Header match={match} history={history} {...props} groupDetail={groupDetail} />
<Body> <Body>
<div style={{ width: "100%", height: '100%' }}> <div style={{ width: "100%", height: '100%' }}>
@ -326,7 +328,7 @@ const Bigscreen = (props) => {
<div style={{ textAlign: 'center', width: '25%', fontFamily: 'SourceHanSansCN-Regular', color: '#2C66F3', fontWeight: 400 }}> <div style={{ textAlign: 'center', width: '25%', fontFamily: 'SourceHanSansCN-Regular', color: '#2C66F3', fontWeight: 400 }}>
NO.{index + 1}</div> NO.{index + 1}</div>
<div title={c.fromname} style={{ textAlign: 'center', padding: '0 6px', width: '49%', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}> <div title={c.fromname} style={{ textAlign: 'center', padding: '0 6px', width: '49%', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
{c.name}</div> {c.name}({s.startTime})</div>
<div style={{ textAlign: 'center', width: '25%', fontFamily: 'SourceHanSansCN-Regular', fontWeight: 400 }}> <div style={{ textAlign: 'center', width: '25%', fontFamily: 'SourceHanSansCN-Regular', fontWeight: 400 }}>
{c.duration}h</div> {c.duration}h</div>
</div> : <></> </div> : <></>
@ -489,7 +491,7 @@ const Bigscreen = (props) => {
return <div style={{ display: "flex", background: index % 2 == 1 ? "#F6F9FF" : '', height: 40, alignItems: 'center' }}> return <div style={{ display: "flex", background: index % 2 == 1 ? "#F6F9FF" : '', height: 40, alignItems: 'center' }}>
<div style={{ textAlign: 'center', width: '33%', fontFamily: 'SourceHanSansCN-Regular', color: '#2C66F3', fontWeight: 400 }}>{c.name}</div> <div style={{ textAlign: 'center', width: '33%', fontFamily: 'SourceHanSansCN-Regular', color: '#2C66F3', fontWeight: 400 }}>{c.name}</div>
<div style={{ textAlign: 'center', width: '33%' }}>{title}</div> <div style={{ textAlign: 'center', width: '33%' }}>{title}</div>
<div style={{ textAlign: 'center', width: '33%', fontFamily: 'SourceHanSansCN-Regular', color: '#F33B3B', fontWeight: 400 }}>{c.offnum + '/' + c.totnum+`(${(c.offnum/c.totnum).toFixed(4)*100}%)`}</div> <div style={{ textAlign: 'center', width: '33%', fontFamily: 'SourceHanSansCN-Regular', color: '#F33B3B', fontWeight: 400 }}>{c.offnum + '/' + c.totnum+`(${((c.offnum/c.totnum)*100).toFixed(2)}%)`}</div>
</div> </div>
})}</> } containerStyle={{ position: "relative", height: "85%", }} })}</> } containerStyle={{ position: "relative", height: "85%", }}
divHeight={"100%"} divId={"interruptchart"}/> divHeight={"100%"} divId={"interruptchart"}/>
@ -504,11 +506,9 @@ const Bigscreen = (props) => {
</div > </div >
) )
} }
function mapStateToProps (state) { function mapStateToProps (state) {
const { auth, global, groupStatisticOnline,pomsProjectBasicAll } = state; const { auth, global, groupStatisticOnline,pomsProjectBasicAll } = state;
console.log('global1',global)
return { return {
user: auth.user, user: auth.user,
actions: global.actions, actions: global.actions,

Loading…
Cancel
Save