wuqun 2 years ago
parent
commit
586d63a667
  1. 4
      api/.vscode/launch.json
  2. 6
      api/app/lib/controllers/alarm/app.js
  3. 140
      api/app/lib/controllers/control/analysis.js
  4. 3
      api/app/lib/routes/control/index.js
  5. 511
      web/client/src/sections/control/containers/control.jsx
  6. 2
      web/client/src/sections/problem/components/sideSheet.jsx
  7. 2
      web/client/src/sections/problem/components/tableData.jsx

4
api/.vscode/launch.json

@ -16,9 +16,9 @@
"-p 4600",
"-f http://localhost:4600",
//
"-g postgres://postgres:123@10.8.30.32:5432/orational_service",
// "-g postgres://postgres:123@10.8.30.32:5432/orational_service",
//
//"-g postgres://FashionAdmin:123456@10.8.30.156:5432/POMS",
"-g postgres://FashionAdmin:123456@10.8.30.156:5432/POMS",
"-k node35:6667,node36:6667,node37:6667",
"--iotaProxy http://10.8.30.157:17007",
"--redisHost 10.8.30.112",

6
api/app/lib/controllers/alarm/app.js

@ -78,9 +78,9 @@ async function inspectionList(ctx) {
}
}]
}
if (timeStart && timeEnd) {
findOption.where.createTime = { $between: [moment(timeStart).format(), moment(timeEnd).format()] }
}
// if (timeStart && timeEnd) {
// findOption.where.createTime = { $between: [moment(timeStart).format(), moment(timeEnd).format()] }
// }
if (noted) {
if (noted == 'noted') {
findOption.where.notedTime = { $ne: null }

140
api/app/lib/controllers/control/analysis.js

@ -1,6 +1,7 @@
'use strict';
const moment = require('moment');
async function dataList (ctx) {
try {
const { models } = ctx.fs.dc;
@ -81,10 +82,149 @@ async function dataList (ctx) {
}
}
async function userlist (ctx) {
try {
const models = ctx.fs.dc.models;
const { clickHouse } = ctx.app.fs
const sequelize = ctx.fs.dc.orm;
const { pepId } = ctx.query
const excludeField = ['lastInTime', 'inTimes', 'onlineDuration', 'lastInAddress', 'deleted', 'updateTime']
let findOption = {
attributes: {
exclude: excludeField,
// include: [[sequelize.fn('array_length', sequelize.col('role')), 'roleCount']]
},
where: {
deleted: false,
$or: [{
$not: {
role: { $contained: ['SuperAdmin', 'admin'] }
}
},
sequelize.where(sequelize.fn('cardinality', sequelize.col('role')), 0)],
// $not: {
// role: { $contained: ['SuperAdmin', 'admin'] }
// }
},
order: [['updateTime', 'DESC']]
}
const userRes = await models.User.findAndCountAll(findOption)
const adminRes = await models.User.findAll({
where: {
role: { $contains: ['admin'] }
},
attributes: {
exclude: excludeField,
},
order: [['updateTime', 'DESC']]
})
let userIds = new Set()
let pomsProjectIds = new Set()
for (let u of userRes.rows.concat(adminRes)) {
userIds.add(u.pepUserId)
for (let pid of u.correlationProject) {
pomsProjectIds.add(pid)
}
}
// 查用户所属的项企pep的部门、人员信息
let userPepRes = userIds.size ?
await clickHouse.pepEmis.query(`
SELECT DISTINCT
user.id AS id, "user"."name" AS name, department.name AS depName, department.id AS depId
FROM department_user
LEFT JOIN user
ON department_user.user=user.id
LEFT JOIN department
ON department.id=department_user.department
WHERE
user.id IN (${[...userIds].join(',')})
AND department.delete=false`
).toPromise() :
[]
// 查用户绑定的当前系统的项目 id
let pomsProjectRes = await models.ProjectCorrelation.findAll({
where: {
id: { $in: [...pomsProjectIds] },
// del: false
}
})
// 获取响应的绑定的 项企项目的 id
let pepPojectIds = new Set()
for (let p of pomsProjectRes) {
if (p.pepProjectId) {
pepPojectIds.add(p.pepProjectId)
}
}
// 查对应的项企项目信息
let pepProjectRes = pepPojectIds.size ?
await clickHouse.projectManage.query(`
SELECT id, project_name, isdelete FROM t_pim_project WHERE id IN (${[...pepPojectIds]})
`).toPromise() :
[]
// 遍历用户并将查到的信息拼合
for (let u of userRes.rows.concat(adminRes)) {
// 用户信息
const corUsers = userPepRes.filter(up => up.id == u.pepUserId)
u.dataValues.name = corUsers.length ? corUsers[0].name : ''
u.dataValues.departments = corUsers.length ? corUsers.map(cu => {
return {
name: cu.depName,
id: cu.depId
}
}) : []
// pep项目信息
u.dataValues.correlationProject = u.dataValues.correlationProject.map(cpid => {
let returnData = {
id: cpid,
}
const corPomsProject = pomsProjectRes.find(ppr => ppr.id == cpid)
if (corPomsProject) {
returnData.name = corPomsProject.name
returnData.del = corPomsProject.del
if (corPomsProject.pepProjectId) {
returnData.pepProjectId = corPomsProject.pepProjectId
const corPepProject = pepProjectRes.find(ppr => ppr.id == corPomsProject.pepProjectId)
if (corPepProject) {
returnData.pepProjectName = corPepProject.project_name
returnData.pepIsdelete = corPepProject.isdelete
}
}
}
return returnData
})
}
let personnel = userRes.rows.filter(r => r.correlationProject.length > 0)
if (pepId) {
personnel = personnel.filter(r => r.dataValues.correlationProject.map(v => v.id).includes(Number(pepId)))
}
ctx.status = 200
ctx.body = {
personnel: personnel.map(v => v.dataValues.name)
}
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
}
}
}
module.exports = {
dataList,
userlist
};

3
api/app/lib/routes/control/index.js

@ -20,6 +20,9 @@ module.exports = function (app, router, opts) {
app.fs.api.logAttr['GET/analysis/dataList'] = { content: '查询数据告警产生,确认数量', visible: true };
router.get('/analysis/dataList', analysis.dataList);
app.fs.api.logAttr['GET/analysis/userlist'] = { content: '查询关联人员', visible: true };
router.get('/analysis/userlist', analysis.userlist);
//项目概览

511
web/client/src/sections/control/containers/control.jsx

@ -6,6 +6,7 @@ import '../style.less'
import PerfectScrollbar from "perfect-scrollbar";
import repairFQA from '../../means/containers/repairFQA';
import { Setup, OutHidden } from "$components";
import ReactECharts from 'echarts-for-react';
const { Meta } = Card;
let newScrollbar;
@ -18,7 +19,7 @@ let alarmScrollbar;
const Control = (props) => {
const { dispatch, actions, user, loading, socket ,pepProjectId} = props
const { dispatch, actions, user, loading, socket, pepProjectId } = props
const { control } = actions
const stationList = [
'url(/assets/images/console/lan_1.png)',
@ -42,17 +43,16 @@ const Control = (props) => {
const [compile, setCompile] = useState({}); //
const [toolShow, setToolShow] = useState([]); //
const [tableSetup, setTableSetup] = useState([]); //
const [exhibition, setExhibition] = useState({ workbench: [] }); //
const [workData, setWorkData] = useState({}); //
const [workData, setWorkData] = useState(); //
const exhibition = useRef({ workbench: [], statistical: [] }) //
const FormApi = useRef()
useEffect(() => {
consoleToollink()
//
let data = ['workbench']
let data = ['workbench', 'statistical', 'analyse']
data.map(v => {
localStorage.getItem(v) == null
? localStorage.setItem(v, JSON.stringify(show[v]))
@ -63,62 +63,84 @@ const Control = (props) => {
}, [])
useEffect(() => {
dispatch(control.geteteConsoleCount({pepProjectId:pepProjectId})).then(res => {
dispatch(control.geteteConsoleCount({ pepProjectId: pepProjectId })).then(res => {
if (res.success) setWorkData(res.payload.data)
})
}, [pepProjectId])
useEffect(() => {
newScrollbar = new PerfectScrollbar("#news", {
suppressScrollX: true,
});
const domProject = document.getElementById("news");
if (domProject && newScrollbar) {
newScrollbar.update();
if (domProject) {
newScrollbar = new PerfectScrollbar("#news", {
suppressScrollX: true,
});
if (domProject && newScrollbar) {
newScrollbar.update();
}
}
overviewScrollbar = new PerfectScrollbar("#overview", {
suppressScrollY: true,
});
const domProject1 = document.getElementById("overview");
if (domProject1 && overviewScrollbar) {
overviewScrollbar.update();
if (domProject1) {
overviewScrollbar = new PerfectScrollbar("#overview", {
suppressScrollY: true,
});
if (domProject1 && overviewScrollbar) {
overviewScrollbar.update();
}
}
memberScrollbar = new PerfectScrollbar("#member", {
suppressScrollX: true,
});
const domProject2 = document.getElementById("member");
if (domProject2 && memberScrollbar) {
memberScrollbar.update();
if (domProject2) {
memberScrollbar = new PerfectScrollbar("#member", {
suppressScrollX: true,
});
if (domProject2 && memberScrollbar) {
memberScrollbar.update();
}
}
equipmentScrollbar = new PerfectScrollbar("#equipment", {
suppressScrollX: true,
});
const domProject3 = document.getElementById("equipment");
if (domProject3 && equipmentScrollbar) {
equipmentScrollbar.update();
if (domProject3) {
equipmentScrollbar = new PerfectScrollbar("#equipment", {
suppressScrollX: true,
});
if (domProject3 && equipmentScrollbar) {
equipmentScrollbar.update();
}
}
webScrollbar = new PerfectScrollbar("#web", {
suppressScrollX: true,
});
const domProject4 = document.getElementById("web");
if (domProject4 && webScrollbar) {
webScrollbar.update();
if (domProject4) {
webScrollbar = new PerfectScrollbar("#web", {
suppressScrollX: true,
})
if (domProject4 && webScrollbar) {
webScrollbar.update();
}
}
problemsScrollbar = new PerfectScrollbar("#problems", {
suppressScrollX: true,
});
const domProject5 = document.getElementById("problems");
if (domProject5 && problemsScrollbar) {
problemsScrollbar.update();
if (domProject5) {
problemsScrollbar = new PerfectScrollbar("#problems", {
suppressScrollX: true,
});
if (domProject5 && problemsScrollbar) {
problemsScrollbar.update();
}
}
alarmScrollbar = new PerfectScrollbar("#alarm", {
suppressScrollY: true,
});
const domProject6 = document.getElementById("alarm");
if (domProject6 && alarmScrollbar) {
alarmScrollbar.update();
if (domProject6) {
alarmScrollbar = new PerfectScrollbar("#alarm", {
suppressScrollY: true,
});
if (domProject6 && alarmScrollbar) {
alarmScrollbar.update();
}
}
// ACTION
// dispatch(actions.example.getMembers(user.orgId))
})
@ -132,25 +154,37 @@ const Control = (props) => {
let Select = {
workbench: ['project', 'data', 'app', 'device'],
statistical: [],
analyse: [],
statistical: ['milestone', 'personnel', 'DeviceAccess', 'web', 'problem'],
analyse: ['dataInterrupt', 'dataAnomaly', 'strategyHit', 'videoException', 'appAbnormal', 'unitException', 'problemAnalysis'],
dynamic: [],
}
let show = {
workbench: ['project', 'data', 'app', 'device'],
statistical: [],
analyse: [],
statistical: ['milestone', 'personnel', 'DeviceAccess', 'web', 'problem'],
analyse: ['dataInterrupt', 'dataAnomaly', 'strategyHit', 'videoException', 'appAbnormal', 'unitException', 'problemAnalysis'],
dynamic: [],
}
let listAll = [
{ name: '关注的项目', sort: 1, key: 'project', data: workData?.projects, img: 'url(/assets/images/console/lan_1.png)' },
{ name: '数据告警', sort: 2, key: 'data', data: workData?.dataSurplus, img: 'url(/assets/images/console/lv_1.png)' },
{ name: '应用告警', sort: 2, key: 'app', data: workData?.appSurplus, img: 'url(/assets/images/console/hong_1.png)' },
{ name: '设备告警', sort: 2, key: 'device', data: workData?.toolSurplus, img: 'url(/assets/images/console/hong_1.png)' },
{ name: '关注的项目', sort: 1, key: 'project', data: workData?.projects || 0, img: 'url(/assets/images/console/lan_1.png)' },
{ name: '数据告警', sort: 2, key: 'data', data: workData?.dataSurplus || 0, img: 'url(/assets/images/console/lv_1.png)' },
{ name: '应用告警', sort: 2, key: 'app', data: workData?.appSurplus || 0, img: 'url(/assets/images/console/hong_1.png)' },
{ name: '设备告警', sort: 2, key: 'device', data: workData?.toolSurplus || 0, img: 'url(/assets/images/console/hong_1.png)' },
{ name: '项目里程碑', sort: 1, key: 'milestone', },
{ name: '相关成员', sort: 2, key: 'personnel', },
{ name: '平台设备接入', sort: 3, key: 'DeviceAccess', },
{ name: '关联web应用', sort: 4, key: 'web', },
{ name: '异常&问题', sort: 5, key: 'problem', },
{ name: '数据中断', sort: 5, key: 'dataInterrupt', },
{ name: '数据异常', sort: 5, key: 'dataAnomaly', },
{ name: '策略命中', sort: 5, key: 'strategyHit', },
{ name: '视频异常', sort: 5, key: 'videoException', },
{ name: '应用异常', sort: 5, key: 'appAbnormal', },
{ name: '设备异常', sort: 5, key: 'unitException', },
{ name: '问题处置效率分析', sort: 5, key: 'problemAnalysis', },
]
console.log(workData);
console.log(listAll);
useEffect(() => {
attribute('workbench')
@ -166,14 +200,14 @@ const Control = (props) => {
})
let TableDisplay = take?.map(v => listAll?.find(vv => v == vv.key))
TableDisplay.sort((a, b) => a.sort - b.sort)
setExhibition({ ...exhibition, [title]: TableDisplay })
exhibition.current = { ...exhibition.current, [title]: TableDisplay }
setTableSetup([{ list: data }])
}
return (
// 11 ? <img src="/assets/images/install/watting.png" alt="" style={{ width: 'calc(100% + 16px)', position: "relative", top: -12, left: -8, }} /> :
11 ? <img src="/assets/images/install/watting.png" alt="" style={{ width: 'calc(100% + 16px)', position: "relative", top: -12, left: -8, }} /> :
<>
<div style={{ padding: '0px 40px', width: '100%' }} className='console'>
{/* 头部 */}
@ -207,6 +241,7 @@ const Control = (props) => {
<img title='设置' src="/assets/images/problem/setup.png" style={{ width: 18, height: 18, cursor: "pointer" }} onClick={() => {
setSetup(true)
setTableType('workbench')
attribute('workbench')
}} />
</div>
</div>
@ -244,7 +279,7 @@ const Control = (props) => {
</div>
{/* 循环类型 */}
<div id='alarm' style={{ width: 'calc(100% - 200px)', position: 'relative', whiteSpace: 'nowrap', }}>
{exhibition['workbench']?.map((item, index) => {
{exhibition.current['workbench']?.map((item, index) => {
return (
<div key={item.name} style={{ background: item.img, backgroundSize: "100% 100%", display: "inline-block", width: 270, height: 135, marginRight: 26 }}>
<div style={{ margin: '35px 0px 0px 134px' }}>
@ -271,181 +306,195 @@ const Control = (props) => {
<div style={{ marginLeft: 6, fontSize: 12, color: '#969799', fontFamily: "DINExp", }}>STATISTICAL OVERVIEW</div>
</div>
<div style={{ marginRight: 25 }}>
<img title='设置' src="/assets/images/problem/setup.png" style={{ width: 18, height: 18, cursor: "pointer" }} onClick={() => setSetup(true)} />
<img title='设置' src="/assets/images/problem/setup.png" style={{ width: 18, height: 18, cursor: "pointer" }} onClick={() => {
setSetup(true)
setTableType('statistical')
attribute('statistical')
}} />
</div>
</div>
<div id='overview' style={{ position: 'relative' }}>
<div style={{ display: 'inline-flex', marginTop: 16 }}>
{/* 项目里程碑 */}
<div style={{ marginBottom: 30, width: 466, height: 221, border: '1px solid rgba(220,222,224,0.2)', boxShadow: '0px 2px 12px 1px #F2F3F5', borderRadius: 2 }}>
<div style={{ margin: '20px 0px 20px 24px', color: '#4A4A4A', fontSize: 16, fontWeight: 'bold' }}>
项目里程碑
</div>
<div style={{ display: 'flex', marginBottom: 20, marginLeft: 24 }}>
<div style={{ display: 'flex' }}>
<div style={{ fontSize: 14, color: '#969799', marginRight: 4 }}>
立项时间
</div>
<div style={{ fontSize: 14, color: '#4A4A4A', width: 104 }}>
2022-5-12
</div>
{exhibition.current?.statistical?.find(v => v.key == 'milestone') ?
<div style={{ marginBottom: 30, width: 466, height: 221, border: '1px solid rgba(220,222,224,0.2)', boxShadow: '0px 2px 12px 1px #F2F3F5', borderRadius: 2 }}>
<div style={{ margin: '20px 0px 20px 24px', color: '#4A4A4A', fontSize: 16, fontWeight: 'bold' }}>
项目里程碑
</div>
<div style={{ display: 'flex' }}>
<div style={{ fontSize: 14, color: '#969799', marginRight: 4 }}>
施工时间
<div style={{ display: 'flex', marginBottom: 20, marginLeft: 24 }}>
<div style={{ display: 'flex' }}>
<div style={{ fontSize: 14, color: '#969799', marginRight: 4 }}>
立项时间
</div>
<div style={{ fontSize: 14, color: '#4A4A4A', width: 104 }}>
2022-5-12
</div>
</div>
<div style={{ fontSize: 14, color: '#4A4A4A' }}>
2022-5-12至2022-12-12
<div style={{ display: 'flex' }}>
<div style={{ fontSize: 14, color: '#969799', marginRight: 4 }}>
施工时间
</div>
<div style={{ fontSize: 14, color: '#4A4A4A' }}>
2022-5-12至2022-12-12
</div>
</div>
</div>
</div>
<div style={{ display: 'flex', marginBottom: 24, marginLeft: 24 }}>
<div style={{ display: 'flex' }}>
<div style={{ fontSize: 14, color: '#969799', marginRight: 4 }}>
内验时间
<div style={{ display: 'flex', marginBottom: 24, marginLeft: 24 }}>
<div style={{ display: 'flex' }}>
<div style={{ fontSize: 14, color: '#969799', marginRight: 4 }}>
内验时间
</div>
<div style={{ fontSize: 14, color: '#4A4A4A', width: 104 }}>
2023-1-18
</div>
</div>
<div style={{ fontSize: 14, color: '#4A4A4A', width: 104 }}>
2023-1-18
<div style={{ display: 'flex' }}>
<div style={{ fontSize: 14, color: '#969799', marginRight: 4 }}>
外验时间
</div>
<div style={{ fontSize: 14, color: '#4A4A4A' }}>
2023-3-18
</div>
</div>
</div>
<div style={{ display: 'flex' }}>
<div style={{ display: 'flex', marginBottom: 17, marginLeft: 24 }}>
<div style={{ fontSize: 14, color: '#969799', marginRight: 4 }}>
外验时间
工程维保时间
</div>
<div style={{ fontSize: 14, color: '#4A4A4A' }}>
2023-3-18
2022-11-11
</div>
</div>
</div>
<div style={{ display: 'flex', marginBottom: 17, marginLeft: 24 }}>
<div style={{ fontSize: 14, color: '#969799', marginRight: 4 }}>
工程维保时间
</div>
<div style={{ fontSize: 14, color: '#4A4A4A' }}>
2022-11-11
</div>
</div>
<div style={{ display: 'flex', background: 'linear-gradient(252deg, #F9FBFF 0%, #DBE7FF 100%)', height: 38, justifyContent: 'space-between' }}>
<div style={{ display: 'flex', marginLeft: 24, alignItems: 'center' }}>
<div style={{ fontSize: 14, color: '#646566', marginRight: 4 }}>
售后维修时间
</div>
<div style={{ fontSize: 14, color: '#4A4A4A' }}>
2022-11-11至2023-12-14
<div style={{ display: 'flex', background: 'linear-gradient(252deg, #F9FBFF 0%, #DBE7FF 100%)', height: 38, justifyContent: 'space-between' }}>
<div style={{ display: 'flex', marginLeft: 24, alignItems: 'center' }}>
<div style={{ fontSize: 14, color: '#646566', marginRight: 4 }}>
售后维修时间
</div>
<div style={{ fontSize: 14, color: '#4A4A4A' }}>
2022-11-11至2023-12-14
</div>
</div>
<img src="/assets/images/console/onGoing.png" alt="进行中" />
</div>
<img src="/assets/images/console/onGoing.png" alt="进行中" />
</div>
</div>
: ""}
{/* 相关成员 */}
<div style={{ width: 360, height: 221, marginLeft: 20, paddingLeft: 24, border: '1px solid rgba(220,222,224,0.2)', boxShadow: '0px 2px 12px 1px #F2F3F5', borderRadius: 2 }}>
<div style={{ margin: '20px 0px 17px 0px', color: '#4A4A4A', fontSize: 16, fontWeight: 'bold' }}>
相关成员
</div>
<div id='member' style={{ position: 'relative', height: 161 }}>
{memberList.map((item, index) => {
return (
<div key={index + 'member'} style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 15 }}>
<div style={{ display: 'flex', alignItems: 'center' }}>
<div style={{ width: 18, height: 18 }}>
<img src="/assets/images/console/member.png" alt="成员" style={{ width: '100%', height: '100%' }} />
</div>
<div style={{ marginLeft: 8, fontSize: 14, color: '#4A4A4A' }}>
刘昊然
{exhibition.current?.statistical?.find(v => v.key == 'personnel') ?
<div style={{ width: 360, height: 221, marginLeft: 20, paddingLeft: 24, border: '1px solid rgba(220,222,224,0.2)', boxShadow: '0px 2px 12px 1px #F2F3F5', borderRadius: 2 }}>
<div style={{ margin: '20px 0px 17px 0px', color: '#4A4A4A', fontSize: 16, fontWeight: 'bold' }}>
相关成员
</div>
<div id='member' style={{ position: 'relative', height: 161 }}>
{memberList.map((item, index) => {
return (
<div key={index + 'member'} style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 15 }}>
<div style={{ display: 'flex', alignItems: 'center' }}>
<div style={{ width: 18, height: 18 }}>
<img src="/assets/images/console/member.png" alt="成员" style={{ width: '100%', height: '100%' }} />
</div>
<div style={{ marginLeft: 8, fontSize: 14, color: '#4A4A4A' }}>
刘昊然
</div>
<div style={{ fontSize: 12, color: '#969799' }}>
负责人
</div>
</div>
<div style={{ fontSize: 12, color: '#969799' }}>
负责人
<div style={{ color: '#969799', fontSize: 14, marginRight: 22 }}>
行业服务部
</div>
</div>
<div style={{ color: '#969799', fontSize: 14, marginRight: 22 }}>
行业服务部
</div>
</div>
)
})}
)
})}
</div>
</div>
</div>
: ""}
{/* 平台设备接入 */}
<div style={{ width: 360, height: 221, marginLeft: 20, paddingLeft: 24, border: '1px solid rgba(220,222,224,0.2)', boxShadow: '0px 2px 12px 1px #F2F3F5', borderRadius: 2 }}>
<div style={{ margin: '20px 0px 17px 0px', color: '#4A4A4A', fontSize: 16, fontWeight: 'bold', marginBottom: 16 }}>
平台设备接入
</div>
<div id='equipment' style={{ position: 'relative', height: 161 }}>
{
equipmentList.map((item, index) => {
return (
<div key={index + 'equipment'} style={{ marginBottom: 15, display: 'flex' }}>
<div style={{ color: '#969799', fontSize: 14, width: 167 }}>
5阶ZK1高清摄球机
</div>
<div style={{ color: '#4A4A4A', fontSize: 14, width: 81 }}>
视频
</div>
<div style={{ width: 18, height: 18, marginRight: 8 }}>
<img src="/assets/images/console/icon_online.png" alt="网络" style={{ width: '100%', height: '100%' }} />
{/* <img src="/assets/images/console/icon_offline.png" alt="网络" style={{ width: '100%', height: '100%' }} /> */}
</div>
<div style={{ color: '#0F7EFB', fontSize: 14 }}>
在线
</div>
{/* <div style={{color:'#969799',fontSize:14}}>
{exhibition.current?.statistical?.find(v => v.key == 'DeviceAccess') ?
<div style={{ width: 360, height: 221, marginLeft: 20, paddingLeft: 24, border: '1px solid rgba(220,222,224,0.2)', boxShadow: '0px 2px 12px 1px #F2F3F5', borderRadius: 2 }}>
<div style={{ margin: '20px 0px 17px 0px', color: '#4A4A4A', fontSize: 16, fontWeight: 'bold', marginBottom: 16 }}>
平台设备接入
</div>
<div id='equipment' style={{ position: 'relative', height: 161 }}>
{
equipmentList.map((item, index) => {
return (
<div key={index + 'equipment'} style={{ marginBottom: 15, display: 'flex' }}>
<div style={{ color: '#969799', fontSize: 14, width: 167 }}>
5阶ZK1高清摄球机
</div>
<div style={{ color: '#4A4A4A', fontSize: 14, width: 81 }}>
视频
</div>
<div style={{ width: 18, height: 18, marginRight: 8 }}>
<img src="/assets/images/console/icon_online.png" alt="网络" style={{ width: '100%', height: '100%' }} />
{/* <img src="/assets/images/console/icon_offline.png" alt="网络" style={{ width: '100%', height: '100%' }} /> */}
</div>
<div style={{ color: '#0F7EFB', fontSize: 14 }}>
在线
</div>
{/* <div style={{color:'#969799',fontSize:14}}>
掉线
</div> */}
</div>
)
})
}
</div>
)
})
}
</div>
</div>
</div>
: ""}
{/* 关联web应用 */}
<div style={{ width: 360, height: 221, marginLeft: 20, paddingLeft: 24, border: '1px solid rgba(220,222,224,0.2)', boxShadow: '0px 2px 12px 1px #F2F3F5', borderRadius: 2 }}>
<div style={{ margin: '20px 0px 17px 0px', color: '#4A4A4A', fontSize: 16, fontWeight: 'bold', marginBottom: 15 }}>
关联web应用
</div>
<div id='web' style={{ position: 'relative', height: 161 }}>
{
webList.map((item, index) => {
return (
<div key={index + 'web'} style={{ marginBottom: 15, display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<div style={{ display: 'flex' }}>
<div style={{ width: 18, height: 18, marginRight: 8 }}>
<img src="/assets/images/console/icon_webpage.png" alt="web应用" style={{ width: '100%', height: '100%' }} />
{exhibition.current?.statistical?.find(v => v.key == 'web') ?
<div style={{ width: 360, height: 221, marginLeft: 20, paddingLeft: 24, border: '1px solid rgba(220,222,224,0.2)', boxShadow: '0px 2px 12px 1px #F2F3F5', borderRadius: 2 }}>
<div style={{ margin: '20px 0px 17px 0px', color: '#4A4A4A', fontSize: 16, fontWeight: 'bold', marginBottom: 15 }}>
关联web应用
</div>
<div id='web' style={{ position: 'relative', height: 161 }}>
{
webList.map((item, index) => {
return (
<div key={index + 'web'} style={{ marginBottom: 15, display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<div style={{ display: 'flex' }}>
<div style={{ width: 18, height: 18, marginRight: 8 }}>
<img src="/assets/images/console/icon_webpage.png" alt="web应用" style={{ width: '100%', height: '100%' }} />
</div>
<div style={{ color: '#646566', fontSize: 14, borderBottom: '1px dotted #0F7EFB' }}>
superchangnan.anxiny
</div>
</div>
<div style={{ color: '#646566', fontSize: 14, borderBottom: '1px dotted #0F7EFB' }}>
superchangnan.anxiny
<div style={{ color: '#4A4A4A', fontSize: 14, marginRight: 40 }}>
第三方
</div>
</div>
<div style={{ color: '#4A4A4A', fontSize: 14, marginRight: 40 }}>
第三方
</div>
</div>
)
})
}
)
})
}
</div>
</div>
</div>
: ""}
{/* 异常&问题 */}
<div style={{ width: 399, height: 221, marginLeft: 20, marginRight: 20, paddingLeft: 24, border: '1px solid rgba(220,222,224,0.2)', boxShadow: '0px 2px 12px 1px #F2F3F5', borderRadius: 2 }}>
<div style={{ margin: '20px 0px 17px 0px', color: '#4A4A4A', fontSize: 16, fontWeight: 'bold' }}>
异常&问题
</div>
<div id='problems' style={{ position: 'relative', height: 161 }}>
{
problemsList.map((item, index) => {
return (
<div style={{ marginBottom: 15, paddingRight: 30, }}>
<div style={{ fontSize: 14, color: '#646566' }}>
告警源A数据信息中断诊断为 <span style={{ color: '#0F7EFB', borderBottom: '1px dotted #0F7EFB', cursor: "pointer" }}>服务异常请前往确认</span>
</div>
<div style={{ color: '#969799', fontSize: 12, marginRight: 40, marginTop: 4 }}>
2022-05-21 15:23:41
{exhibition.current?.statistical?.find(v => v.key == 'problem') ?
<div style={{ width: 399, height: 221, marginLeft: 20, marginRight: 20, paddingLeft: 24, border: '1px solid rgba(220,222,224,0.2)', boxShadow: '0px 2px 12px 1px #F2F3F5', borderRadius: 2 }}>
<div style={{ margin: '20px 0px 17px 0px', color: '#4A4A4A', fontSize: 16, fontWeight: 'bold' }}>
异常&问题
</div>
<div id='problems' style={{ position: 'relative', height: 161 }}>
{
problemsList.map((item, index) => {
return (
<div style={{ marginBottom: 15, paddingRight: 30, }}>
<div style={{ fontSize: 14, color: '#646566' }}>
告警源A数据信息中断诊断为 <span style={{ color: '#0F7EFB', borderBottom: '1px dotted #0F7EFB', cursor: "pointer" }}>服务异常请前往确认</span>
</div>
<div style={{ color: '#969799', fontSize: 12, marginRight: 40, marginTop: 4 }}>
2022-05-21 15:23:41
</div>
</div>
</div>
)
})
}
)
})
}
</div>
</div>
</div>
: ""}
</div>
</div>
</div>
@ -458,9 +507,85 @@ const Control = (props) => {
<div style={{ marginLeft: 6, fontSize: 12, color: '#969799', fontFamily: "DINExp", }}>BI ANAL YSIS MODEL</div>
</div>
<div style={{ marginRight: 25 }}>
<img title='设置' src="/assets/images/problem/setup.png" style={{ width: 18, height: 18, cursor: "pointer" }} onClick={() => setSetup(true)} />
<img title='设置' src="/assets/images/problem/setup.png" style={{ width: 18, height: 18, cursor: "pointer" }} onClick={() => {
setSetup(true)
setTableType('analyse')
attribute('analyse')
}} />
</div>
</div>
<div style={{ width: '100%', height: '100%' }}>
{exhibition.current?.analyse?.map((v, index) => {
console.log(exhibition.current?.analyse);
return <div id={'ReactECharts' + index} style={{ marginTop: 20, padding: 10, width: '50%', display: "inline-block" }}>
<ReactECharts
option={{
title: {
text: v.name,
},
grid: {
left: '5%',
// right: '4%',
// bottom: '3%',
// containLabel: true
},
dataZoom: [
{
show: true,
type: 'inside',
filterMode: 'none',
xAxisIndex: [0],
},
{
show: true,
type: 'inside',
filterMode: 'none',
yAxisIndex: [0],
}
],
tooltip: {
trigger: 'axis'
},
legend: {
data: ['次数'],
right: '10%',
},
xAxis: {
type: 'category',
name: "时间",
boundaryGap: false,
data: []
},
yAxis: {
type: 'value',
name: "次数",
},
series: [
{
data: [],
type: 'line',
name: '次数',
smooth: true,
areaStyle: {
color: '#0e9cff26',
},
markLine: {
data: [{ type: 'average', name: 'Avg' }]
}
}
]
}}
notMerge={true}
lazyUpdate={true}
theme={'ReactEChart' + index}
// onChartReady={this.onChartReadyCallback}
// onEvents={EventsDict}
// opts={}
/>
</div>
})}
</div>
</div>
</div>
{/* 右边 */}

2
web/client/src/sections/problem/components/sideSheet.jsx

@ -5,7 +5,7 @@ import copy from "copy-to-clipboard";
import moment from "moment";
import PerfectScrollbar from "perfect-scrollbar";
import ReactECharts from 'echarts-for-react';
import * as echarts from 'echarts';
let projectScrollbar;

2
web/client/src/sections/problem/components/tableData.jsx

@ -139,6 +139,8 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
}, [query, search, pepProjectId])
console.log(exhibition);
console.log(tableData);
return (
<>

Loading…
Cancel
Save