diff --git a/api/app/lib/controllers/project/group.js b/api/app/lib/controllers/project/group.js
index f47cd73..0aba3b9 100644
--- a/api/app/lib/controllers/project/group.js
+++ b/api/app/lib/controllers/project/group.js
@@ -107,13 +107,15 @@ async function groupStatistic (ctx) {
try {
const { models } = ctx.fs.dc;
const { userId } = ctx.fs.api
+ const { pomsU } = ctx.query
const { clickHouse } = ctx.app.fs
const { utils: { judgeSuper, anxinStrucIdRange } } = ctx.app.fs
const sequelize = ctx.fs.dc.orm
+ let userId_ = pomsU || userId
const progectGroupList = await models.ProjectGroup.findAll({
where: {
- pomsUserId: userId
+ pomsUserId: userId_
}
})
diff --git a/api/app/lib/utils/push.js b/api/app/lib/utils/push.js
index a0cf5ed..6053a06 100644
--- a/api/app/lib/utils/push.js
+++ b/api/app/lib/utils/push.js
@@ -29,21 +29,23 @@ module.exports = function (app, opts) {
}
}
- const pushByEmail = async ({ email = [], title, text = '', html = '', attachments = undefined, } = {}) => {
+ let senderIndex = 0
+ const pushByEmail = async ({ email = [], title, text = '', html = '', attachments = undefined, } = {}) => {
try {
+ let useSender = opts.email.sender[senderIndex++ % opts.email.sender.length]
let transporter = nodemailer.createTransport({
host: opts.email.host,
port: opts.email.port,
secure: true,
auth: {
- user: opts.email.sender.address,
- pass: opts.email.sender.password,
+ user: useSender.address,
+ pass: useSender.password,
}
});
// send mail with defined transport object
await transporter.sendMail({
- from: `${opts.email.sender.name}<${opts.email.sender.address}>`, // sender address
+ from: `${useSender.name}<${useSender.address}>`, // sender address
to: email.join(','), // list of receivers 逗号分隔字符串
subject: title, // Subject line
text: text, // plain text body
diff --git a/web/client/src/layout/components/header/index.jsx b/web/client/src/layout/components/header/index.jsx
index 261490c..ac19ac5 100644
--- a/web/client/src/layout/components/header/index.jsx
+++ b/web/client/src/layout/components/header/index.jsx
@@ -109,10 +109,12 @@ const Header = (props) => {
style={{ display: "inline-block", width: 200, height: 40, marginLeft: -24, cursor: 'pointer' }}
onClick={() => {
let projectGroup = JSON.parse(localStorage.getItem('project_group'))
- if (projectGroup && projectGroup?.find(v => v.userId == user?.id)) {
- window.open('/projectGroup/bigscreen', '_blank')
+ let url = `/projectGroup/bigscreen?pomsU=${user?.id}`
+ let curPG = projectGroup && projectGroup?.find(v => v.userId == user?.id)
+ if (curPG) {
+ window.open(`/projectGroup/bigscreen?pomsPG=${curPG.projectGroupId}&pomsU=${user?.id}`, '_blank')
} else {
- window.open('/projectGroup/statistic', '_blank')
+ window.open(`/projectGroup/statistic?pomsU=${user?.id}`, '_blank')
}
}}
/>
@@ -372,7 +374,6 @@ const Header = (props) => {
{/* collapseButton collapseText */}
-
>
}
diff --git a/web/client/src/layout/containers/layout/index.jsx b/web/client/src/layout/containers/layout/index.jsx
index 65275ee..a3237b8 100644
--- a/web/client/src/layout/containers/layout/index.jsx
+++ b/web/client/src/layout/containers/layout/index.jsx
@@ -170,7 +170,9 @@ const LayoutContainer = props => {
useEffect(() => {
NProgress.done();
if ((!user || !user.authorized)) {
- history.push('/signin');
+ if (!location.pathname.includes('projectGroup')) {
+ history.push('/signin');
+ }
}
if (msg) {
if (msg.done) {
diff --git a/web/client/src/layout/index.jsx b/web/client/src/layout/index.jsx
index c045f7f..457ac34 100644
--- a/web/client/src/layout/index.jsx
+++ b/web/client/src/layout/index.jsx
@@ -144,7 +144,7 @@ const Root = props => {
setOuterRoutes(outerRoutes.map(route => (
返回后台
diff --git a/web/client/src/sections/projectGroup/containers/bigscreen.jsx b/web/client/src/sections/projectGroup/containers/bigscreen.jsx
index 9d928cd..273d386 100644
--- a/web/client/src/sections/projectGroup/containers/bigscreen.jsx
+++ b/web/client/src/sections/projectGroup/containers/bigscreen.jsx
@@ -1,6 +1,7 @@
import React, { useEffect, useRef, useState } from 'react';
import { Skeleton, Button, Pagination, Select, Popconfirm, Table, Tooltip } from '@douyinfe/semi-ui';
import { connect } from 'react-redux';
+import { push } from 'react-router-redux';
import Header from '../components/header';
import Body from '../components/body'
import Card from '../components/card'
@@ -13,7 +14,8 @@ import AutoRollComponent from '../components/AutoRollComponent'
let interrupt
let repair
let overviewScrollbar;
-const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, groupStatisticOnline }) => {
+const Bigscreen = (props) => {
+ const { dispatch, actions, user, match, history, clientHeight, groupStatisticOnline, ...restProps } = props
const [InterruptRank, setInterruptRank] = useState([])
const [online, setOnline] = useState([])
@@ -30,27 +32,37 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou
const [xData, setXData] = useState([])//横坐标
const self = useRef({ myChart: null });
+ // const [queryUserId, setQueryUserId] = useState('')
useEffect(() => {
- let groupId = JSON.parse(localStorage.getItem('project_group'))?.find(v => user?.id == v.userId)?.projectGroupId
- statisticOnline(groupId)
+
+ let groupIdLocal = JSON.parse(localStorage.getItem('project_group'))?.find(v => user?.id == v.userId)?.projectGroupId
+
+ let search = restProps?.location?.search || '';
+ let params = new URLSearchParams(search);
+ // let userId = params.get('pomsU')
+ let groupId = params.get('pomsPG')
+
+ // setQueryUserId(userId)
+
+ let groupId_ = groupId || groupIdLocal
+
+ statisticOnline(groupId_)
//计算当前时间,定时更新
- timeRequest(groupId)
- dispatch(actions.projectGroup.groupStatisticAlarm({ groupId })).then(res => {
+ timeRequest(groupId_)
+ dispatch(actions.projectGroup.groupStatisticAlarm({ groupId: groupId_ })).then(res => {
if (res.success) {
setMockData(res.payload.data)
}
})
-
- dispatch(actions.projectGroup.groupProject({ groupId })).then(res => {
+ dispatch(actions.projectGroup.groupProject({ groupId: groupId_ })).then(res => {
if (res.success) {
setGroupProject(res.payload.data?.map(v => ({ ...v, value: (Math.random() * 20).toFixed(0) })) || [])
setProportion([...res.payload.data?.slice(0, 3)?.map(v => ({ name: v.name || v.pepProjectName, value: (Math.random() * 20).toFixed(0) })), { value: 20, name: '其它' }])
}
})
-
const interruptDom = document.getElementById("interrupt");
if (interruptDom) {
interrupt = new PerfectScrollbar("#interrupt", {
@@ -65,6 +77,7 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou
}
}, [])
+
useEffect(() => {
const overview = document.getElementById("alarmRank");
if (overview) {
@@ -108,7 +121,7 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou
const newArray = mockData.slice(0, 20)
setAlarmData(newArray)
- }else{
+ } else {
setAlarmData(mockData)
}
}, [mockData])
@@ -182,7 +195,7 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou
return (