diff --git a/api/app/lib/controllers/bigScreen/error.js b/api/app/lib/controllers/bigScreen/error.js index b5fb6cf..56dfa4b 100644 --- a/api/app/lib/controllers/bigScreen/error.js +++ b/api/app/lib/controllers/bigScreen/error.js @@ -47,7 +47,7 @@ async function countDayIssue(ctx, next) { ORDER BY date; `, { replacements: { - projectId: projectId, + projectId: projectId.split(',').map(Number), }, type: sequelize.QueryTypes.SELECT, }) diff --git a/api/app/lib/controllers/bigScreen/run.js b/api/app/lib/controllers/bigScreen/run.js index d5ce01f..758caac 100644 --- a/api/app/lib/controllers/bigScreen/run.js +++ b/api/app/lib/controllers/bigScreen/run.js @@ -59,15 +59,19 @@ async function getDeployPoints(ctx) { try { const { pictureId } = ctx.query; 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) { + const {dataValues:c}=heatmap + const id=c.id rslt = await models.ProjectPointsDeploy.findAll({ - where: { graphId: { $in: pictureId.split(',') } } + where: { graphId: id } }) ctx.status = 200; ctx.body = rslt; } else { - throw new Error('pictureId not found'); + ctx.body=[] + ctx.status = 200; + } } catch (err) { ctx.fs.logger.error(`path: ${ctx.path}, error: ${err}`); diff --git a/web-screen/client/src/sections/bigScreen/components/error/bottom.js b/web-screen/client/src/sections/bigScreen/components/error/bottom.js index 9499545..b3cf8b3 100644 --- a/web-screen/client/src/sections/bigScreen/components/error/bottom.js +++ b/web-screen/client/src/sections/bigScreen/components/error/bottom.js @@ -30,9 +30,10 @@ const Bottom = props => { }, []) const queryData = () => { + const structArr = JSON.parse(sessionStorage.getItem('user')).monitorObject dispatch(bigScreen.getRecords(`patrolRecord/all/${times[0]}/${times[1]}/true/null`)).then(res => { 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(x => curState == '全部' || curState == renderOptionText(x?.patrolRecordIssueHandles[0]?.state)) .map(v => ({ ...v, key: v.id })) : res.payload.data?.map(v => ({ ...v, key: v.id }))) diff --git a/web-screen/client/src/sections/bigScreen/components/error/top.js b/web-screen/client/src/sections/bigScreen/components/error/top.js index 0c25c4d..ed38254 100644 --- a/web-screen/client/src/sections/bigScreen/components/error/top.js +++ b/web-screen/client/src/sections/bigScreen/components/error/top.js @@ -35,7 +35,7 @@ const Top = props => { // top: '5%', // left: 'right' // }, - color:['#7FFFFC','#F5C24A', , 'red'], + color:['#7FFFFC','#F5C24A', 'red'], graphic: [{ type: 'text', diff --git a/web-screen/client/src/sections/bigScreen/components/leader/index.js b/web-screen/client/src/sections/bigScreen/components/leader/index.js index 4b0a922..31fc364 100644 --- a/web-screen/client/src/sections/bigScreen/components/leader/index.js +++ b/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 dispatch(bigScreen.getCenterData({projectId:structArr.toString()})).then(res=>{ if(res.success){ - console.log('res.payload.data',res.payload.data) setCenterData(res.payload.data) } }) diff --git a/web-screen/client/src/sections/bigScreen/components/leader/left.js b/web-screen/client/src/sections/bigScreen/components/leader/left.js index 1188302..3f5acdd 100644 --- a/web-screen/client/src/sections/bigScreen/components/leader/left.js +++ b/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:19,patrolRecordCount:9}] const data=res.payload.data - if(data.length>2){ + if(data.length>4){ let problemstop = 0 let problemsId = document.getElementById('left1'); if (problems) clearInterval(problems) if (problemsId) { - function problemstart () { + let problems; + let problemstop = 0; + + function problemstart() { problems = setInterval(() => { - problemstop += 5 - problemsId.scrollTop = problemstop - if (problemsId.scrollTop >= problemsId.scrollHeight / 2) problemstop = 0, problemsId.scrollTop = problemstop + problemstop += 5; + problemsId.scrollTop = problemstop; + if (problemsId.scrollTop >= (problemsId.scrollHeight - 90) / 2) { + problemstop = 0; + problemsId.scrollTop = problemstop; + } }, 500); - problemsId.onmouseover = () => clearInterval(problems) - } - problemsId.onmouseout = () => problemstart() - setTimeout(problemstart(), 1000); - } + + problemsId.onmouseover = () => clearInterval(problems); + } + + problemsId.onmouseout = () => problemstart(); + + setTimeout(problemstart, 1000); + } } if(data.length>10){ setRank(data.slice(0,10)) @@ -445,7 +454,7 @@ const Left = props => {
{index+1}
-
{item.name}
+
{item.name}
{item.patrolRecordCount}
{item.issueHandleCount} diff --git a/web-screen/client/src/sections/bigScreen/components/leader/right.js b/web-screen/client/src/sections/bigScreen/components/leader/right.js index de29782..bbff8bd 100644 --- a/web-screen/client/src/sections/bigScreen/components/leader/right.js +++ b/web-screen/client/src/sections/bigScreen/components/leader/right.js @@ -98,7 +98,7 @@ const Right = props => { //[{},{},{},{},{},{},{},{},{}] || const data = res.payload.data setRankData(data) - if(data.length>2){ + if(data.length>4){ let problemstop = 0 let problemsId = document.getElementById('right3'); if (rank) clearInterval(rank) @@ -107,7 +107,7 @@ const Right = props => { rank = setInterval(() => { problemstop += 5 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); problemsId.onmouseover = () => clearInterval(rank) } @@ -118,7 +118,6 @@ const Right = props => { } }) } - console.log('rank', rankData) const selectTime = time => { if (time === 'threeMonths') { setPeriod('threeMonths') @@ -291,7 +290,7 @@ const Right = props => {
{index + 1}
-
{item.name}
+
{item.name}
{item.count}
diff --git a/web-screen/client/src/sections/bigScreen/components/run/right.js b/web-screen/client/src/sections/bigScreen/components/run/right.js index 7cc11d4..0f5c4a8 100644 --- a/web-screen/client/src/sections/bigScreen/components/run/right.js +++ b/web-screen/client/src/sections/bigScreen/components/run/right.js @@ -270,7 +270,6 @@ const Right = (props) => { - return <>
{/* 右边的抬头 */} @@ -315,7 +314,7 @@ const Right = (props) => { {graph?.length ? graph.map(item => (item?.projectGraphs.length ?
{ diff --git a/web-screen/client/src/sections/bigScreen/components/style.less b/web-screen/client/src/sections/bigScreen/components/style.less index 6a66a2b..2f14f99 100644 --- a/web-screen/client/src/sections/bigScreen/components/style.less +++ b/web-screen/client/src/sections/bigScreen/components/style.less @@ -115,6 +115,10 @@ color: #CCE6FF; letter-spacing: .0181rem; text-align: center; + white-space: nowrap; + text-overflow: ellipsis; + -o-text-overflow: ellipsis; + overflow: hidden; } .quests { @@ -194,6 +198,11 @@ color: #CCE6FF; letter-spacing: .0181rem; text-align: center; + text-align: center; + white-space: nowrap; + text-overflow: ellipsis; + -o-text-overflow: ellipsis; + overflow: hidden; } .num1 {