Browse Source

feat:fix bugs

master
zhaobing 9 months ago
parent
commit
3c55c15f14
  1. 2
      api/app/lib/controllers/bigScreen/error.js
  2. 10
      api/app/lib/controllers/bigScreen/run.js
  3. 3
      web-screen/client/src/sections/bigScreen/components/error/bottom.js
  4. 2
      web-screen/client/src/sections/bigScreen/components/error/top.js
  5. 1
      web-screen/client/src/sections/bigScreen/components/leader/index.js
  6. 31
      web-screen/client/src/sections/bigScreen/components/leader/left.js
  7. 7
      web-screen/client/src/sections/bigScreen/components/leader/right.js
  8. 3
      web-screen/client/src/sections/bigScreen/components/run/right.js
  9. 9
      web-screen/client/src/sections/bigScreen/components/style.less

2
api/app/lib/controllers/bigScreen/error.js

@ -47,7 +47,7 @@ async function countDayIssue(ctx, next) {
ORDER BY date; ORDER BY date;
`, { `, {
replacements: { replacements: {
projectId: projectId, projectId: projectId.split(',').map(Number),
}, },
type: sequelize.QueryTypes.SELECT, type: sequelize.QueryTypes.SELECT,
}) })

10
api/app/lib/controllers/bigScreen/run.js

@ -59,15 +59,19 @@ async function getDeployPoints(ctx) {
try { try {
const { pictureId } = ctx.query; const { pictureId } = ctx.query;
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const heatmap = await models.ProjectGraph.findOne({ where: { id: { $in: pictureId.split(',') } } }) const heatmap = await models.ProjectGraph.findOne({ where: { projectId: { $in: pictureId.split(',') } } })
if (heatmap) { if (heatmap) {
const {dataValues:c}=heatmap
const id=c.id
rslt = await models.ProjectPointsDeploy.findAll({ rslt = await models.ProjectPointsDeploy.findAll({
where: { graphId: { $in: pictureId.split(',') } } where: { graphId: id }
}) })
ctx.status = 200; ctx.status = 200;
ctx.body = rslt; ctx.body = rslt;
} else { } else {
throw new Error('pictureId not found'); ctx.body=[]
ctx.status = 200;
} }
} catch (err) { } catch (err) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${err}`); ctx.fs.logger.error(`path: ${ctx.path}, error: ${err}`);

3
web-screen/client/src/sections/bigScreen/components/error/bottom.js

@ -30,9 +30,10 @@ const Bottom = props => {
}, []) }, [])
const queryData = () => { const queryData = () => {
const structArr = JSON.parse(sessionStorage.getItem('user')).monitorObject
dispatch(bigScreen.getRecords(`patrolRecord/all/${times[0]}/${times[1]}/true/null`)).then(res => { dispatch(bigScreen.getRecords(`patrolRecord/all/${times[0]}/${times[1]}/true/null`)).then(res => {
if (res.success) { if (res.success) {
settableList(name != null ? res.payload.data settableList(name != null ? res.payload.data.filter(item=>structArr.some(i=>i===item.projectId))
?.filter(v => (v.points.itemData.name.indexOf(name) != -1 || v.points.project.name.indexOf(name) != -1)) ?.filter(v => (v.points.itemData.name.indexOf(name) != -1 || v.points.project.name.indexOf(name) != -1))
.filter(x => curState == '全部' || curState == renderOptionText(x?.patrolRecordIssueHandles[0]?.state)) .filter(x => curState == '全部' || curState == renderOptionText(x?.patrolRecordIssueHandles[0]?.state))
.map(v => ({ ...v, key: v.id })) : res.payload.data?.map(v => ({ ...v, key: v.id }))) .map(v => ({ ...v, key: v.id })) : res.payload.data?.map(v => ({ ...v, key: v.id })))

2
web-screen/client/src/sections/bigScreen/components/error/top.js

@ -35,7 +35,7 @@ const Top = props => {
// top: '5%', // top: '5%',
// left: 'right' // left: 'right'
// }, // },
color:['#7FFFFC','#F5C24A', , 'red'], color:['#7FFFFC','#F5C24A', 'red'],
graphic: [{ graphic: [{
type: 'text', type: 'text',

1
web-screen/client/src/sections/bigScreen/components/leader/index.js

@ -30,7 +30,6 @@ const Leader = (props) => {
const structArr = JSON.parse(sessionStorage.getItem('user')).monitorObject const structArr = JSON.parse(sessionStorage.getItem('user')).monitorObject
dispatch(bigScreen.getCenterData({projectId:structArr.toString()})).then(res=>{ dispatch(bigScreen.getCenterData({projectId:structArr.toString()})).then(res=>{
if(res.success){ if(res.success){
console.log('res.payload.data',res.payload.data)
setCenterData(res.payload.data) setCenterData(res.payload.data)
} }
}) })

31
web-screen/client/src/sections/bigScreen/components/leader/left.js

@ -109,22 +109,31 @@ const Left = props => {
// {id:1,issueHandleCount:11,patrolRecordCount:7}, // {id:1,issueHandleCount:11,patrolRecordCount:7},
// {id:1,issueHandleCount:19,patrolRecordCount:9}] // {id:1,issueHandleCount:19,patrolRecordCount:9}]
const data=res.payload.data const data=res.payload.data
if(data.length>2){ if(data.length>4){
let problemstop = 0 let problemstop = 0
let problemsId = document.getElementById('left1'); let problemsId = document.getElementById('left1');
if (problems) clearInterval(problems) if (problems) clearInterval(problems)
if (problemsId) { if (problemsId) {
function problemstart () { let problems;
let problemstop = 0;
function problemstart() {
problems = setInterval(() => { problems = setInterval(() => {
problemstop += 5 problemstop += 5;
problemsId.scrollTop = problemstop problemsId.scrollTop = problemstop;
if (problemsId.scrollTop >= problemsId.scrollHeight / 2) problemstop = 0, problemsId.scrollTop = problemstop if (problemsId.scrollTop >= (problemsId.scrollHeight - 90) / 2) {
problemstop = 0;
problemsId.scrollTop = problemstop;
}
}, 500); }, 500);
problemsId.onmouseover = () => clearInterval(problems)
} problemsId.onmouseover = () => clearInterval(problems);
problemsId.onmouseout = () => problemstart() }
setTimeout(problemstart(), 1000);
} problemsId.onmouseout = () => problemstart();
setTimeout(problemstart, 1000);
}
} }
if(data.length>10){ if(data.length>10){
setRank(data.slice(0,10)) setRank(data.slice(0,10))
@ -445,7 +454,7 @@ const Left = props => {
<div className='index1'> <div className='index1'>
<div>{index+1}</div> <div>{index+1}</div>
</div> </div>
<div className='name1'>{item.name}</div> <div className='name1' title={item.name}>{item.name}</div>
<div className='num1'>{item.patrolRecordCount}</div> <div className='num1'>{item.patrolRecordCount}</div>
<div className='quests1' style={{ ...normalFontColor }}> <div className='quests1' style={{ ...normalFontColor }}>
{item.issueHandleCount} {item.issueHandleCount}

7
web-screen/client/src/sections/bigScreen/components/leader/right.js

@ -98,7 +98,7 @@ const Right = props => {
//[{},{},{},{},{},{},{},{},{}] || //[{},{},{},{},{},{},{},{},{}] ||
const data = res.payload.data const data = res.payload.data
setRankData(data) setRankData(data)
if(data.length>2){ if(data.length>4){
let problemstop = 0 let problemstop = 0
let problemsId = document.getElementById('right3'); let problemsId = document.getElementById('right3');
if (rank) clearInterval(rank) if (rank) clearInterval(rank)
@ -107,7 +107,7 @@ const Right = props => {
rank = setInterval(() => { rank = setInterval(() => {
problemstop += 5 problemstop += 5
problemsId.scrollTop = problemstop problemsId.scrollTop = problemstop
if (problemsId.scrollTop >= problemsId.scrollHeight / 2) problemstop = 0, problemsId.scrollTop = problemstop if (problemsId.scrollTop >= (problemsId.scrollHeight-90) / 2) problemstop = 0, problemsId.scrollTop = problemstop
}, 500); }, 500);
problemsId.onmouseover = () => clearInterval(rank) problemsId.onmouseover = () => clearInterval(rank)
} }
@ -118,7 +118,6 @@ const Right = props => {
} }
}) })
} }
console.log('rank', rankData)
const selectTime = time => { const selectTime = time => {
if (time === 'threeMonths') { if (time === 'threeMonths') {
setPeriod('threeMonths') setPeriod('threeMonths')
@ -291,7 +290,7 @@ const Right = props => {
<div className='index'> <div className='index'>
<div>{index + 1}</div> <div>{index + 1}</div>
</div> </div>
<div className='name'>{item.name}</div> <div className='name' title={item.name}>{item.name}</div>
<div className='quests' style={{ ...normalFontColor }}> <div className='quests' style={{ ...normalFontColor }}>
{item.count} {item.count}
</div> </div>

3
web-screen/client/src/sections/bigScreen/components/run/right.js

@ -270,7 +270,6 @@ const Right = (props) => {
return <> return <>
<div> <div>
{/* 右边的抬头 */} {/* 右边的抬头 */}
@ -315,7 +314,7 @@ const Right = (props) => {
{graph?.length ? graph.map(item => (item?.projectGraphs.length ? {graph?.length ? graph.map(item => (item?.projectGraphs.length ?
<div style={{ <div style={{
width: '88.6594rem', height: '33.5rem', objectFit: 'cover', position: 'relative', width: '88.6594rem', height: '33.5rem', objectFit: 'cover', position: 'relative',
background: `url('https://inspection.anxinyun.cn/_file-server/${item?.projectGraphs[0]?.graph}') no-repeat`, background: `url('/_file-server/${item?.projectGraphs[0]?.graph}') no-repeat`,
backgroundSize: '100% 100%' backgroundSize: '100% 100%'
}} > }} >
{ {

9
web-screen/client/src/sections/bigScreen/components/style.less

@ -115,6 +115,10 @@
color: #CCE6FF; color: #CCE6FF;
letter-spacing: .0181rem; letter-spacing: .0181rem;
text-align: center; text-align: center;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
overflow: hidden;
} }
.quests { .quests {
@ -194,6 +198,11 @@
color: #CCE6FF; color: #CCE6FF;
letter-spacing: .0181rem; letter-spacing: .0181rem;
text-align: center; text-align: center;
text-align: center;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
overflow: hidden;
} }
.num1 { .num1 {

Loading…
Cancel
Save