巴林闲侠 2 years ago
parent
commit
b7635ec451
  1. BIN
      web/client/assets/images/background/console.png
  2. BIN
      web/client/assets/images/favicon.ico
  3. BIN
      web/client/assets/images/problem/link.png
  4. 3
      web/client/index.ejs
  5. 2
      web/client/index.html
  6. 5
      web/client/src/app.jsx
  7. 229
      web/client/src/layout/components/header/index.jsx
  8. 2
      web/client/src/sections/analysis/containers/operationData.jsx
  9. 2
      web/client/src/sections/analysis/containers/problemData.jsx
  10. 2
      web/client/src/sections/analysis/containers/workorderData.jsx
  11. 6
      web/client/src/sections/analysis/nav-item.jsx
  12. 2
      web/client/src/sections/console/containers/console.jsx
  13. 64
      web/client/src/sections/data/containers/dataAssociation.jsx
  14. 2
      web/client/src/sections/data/containers/dataComparison.jsx
  15. 2
      web/client/src/sections/data/containers/dataQuery.jsx
  16. 2
      web/client/src/sections/data/containers/notebook.jsx
  17. 4
      web/client/src/sections/data/nav-item.jsx
  18. 2
      web/client/src/sections/facility/actions/index.js
  19. 6
      web/client/src/sections/facility/containers/index.js
  20. 34
      web/client/src/sections/facility/containers/rest.jsx
  21. 34
      web/client/src/sections/facility/containers/server.jsx
  22. 34
      web/client/src/sections/facility/containers/setControl.jsx
  23. 15
      web/client/src/sections/facility/index.js
  24. 37
      web/client/src/sections/facility/nav-item.jsx
  25. 5
      web/client/src/sections/facility/reducers/index.js
  26. 42
      web/client/src/sections/facility/routes.js
  27. 7
      web/client/src/sections/facility/style.less
  28. 5
      web/client/src/sections/install/containers/index.js
  29. 34
      web/client/src/sections/install/containers/set.jsx
  30. 34
      web/client/src/sections/install/containers/setup.jsx
  31. 72
      web/client/src/sections/install/nav-item.jsx
  32. 85
      web/client/src/sections/install/routes.js
  33. 24
      web/client/src/sections/problem/actions/problem.jsx
  34. 3
      web/client/src/sections/problem/components/inspection.jsx
  35. 62
      web/client/src/sections/problem/components/tableData.jsx
  36. 35
      web/client/src/sections/problem/containers/dataAlarm.jsx
  37. 10
      web/client/src/sections/problem/nav-item.jsx
  38. 6
      web/client/src/utils/webapi.js

BIN
web/client/assets/images/background/console.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

BIN
web/client/assets/images/favicon.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 KiB

After

Width:  |  Height:  |  Size: 66 KiB

BIN
web/client/assets/images/problem/link.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

3
web/client/index.ejs

@ -12,8 +12,7 @@
<script>LA.init({ id: "Jo4eTlZVqgx3uwqm", ck: "Jo4eTlZVqgx3uwqm" })</script> <script>LA.init({ id: "Jo4eTlZVqgx3uwqm", ck: "Jo4eTlZVqgx3uwqm" })</script>
<script src="/assets/js/jessibuca/jessibuca.js"></script> <script src="/assets/js/jessibuca/jessibuca.js"></script>
<script <script src="https://lf1-cdn-tos.bytegoofy.com/obj/iconpark/icons_19077_10.1efd80a22a5e53e48737fd5ab150ffd2.es5.js"></script>
src="https://lf1-cdn-tos.bytegoofy.com/obj/iconpark/icons_19077_5.1f8a6b254697a8ad1c955f3a19fc4dd6.es5.js"></script>
</head> </head>
<body> <body>

2
web/client/index.html

@ -10,7 +10,7 @@
<script charset="UTF-8" id="LA_COLLECT" src="//sdk.51.la/js-sdk-pro.min.js"></script> <script charset="UTF-8" id="LA_COLLECT" src="//sdk.51.la/js-sdk-pro.min.js"></script>
<script>LA.init({id: "Jo4eTlZVqgx3uwqm",ck: "Jo4eTlZVqgx3uwqm"})</script> <script>LA.init({id: "Jo4eTlZVqgx3uwqm",ck: "Jo4eTlZVqgx3uwqm"})</script>
<script src="https://lf1-cdn-tos.bytegoofy.com/obj/iconpark/icons_19077_2.0d80cfd24d6fc34a25b3bf70bb2dbcfb.es5.js"></script> <script src="https://lf1-cdn-tos.bytegoofy.com/obj/iconpark/icons_19077_10.1efd80a22a5e53e48737fd5ab150ffd2.es5.js"></script>
</head> </head>
<body> <body>

5
web/client/src/app.jsx

@ -9,6 +9,7 @@ import Install from './sections/install';
import Problem from './sections/problem'; import Problem from './sections/problem';
import NoMatch from './sections/noMatch'; import NoMatch from './sections/noMatch';
import Console from './sections/console'; import Console from './sections/console';
import Facility from './sections/facility';
import Data from './sections/data'; import Data from './sections/data';
const App = props => { const App = props => {
@ -35,8 +36,8 @@ const App = props => {
<Layout <Layout
title={projectName} title={projectName}
sections={[//Example, sections={[//Example,
Analysis,Install,Data,Problem, Analysis, Install, Data, Problem,
Auth, NoMatch,Console Auth, NoMatch, Console
]} ]}
/> />
) )

229
web/client/src/layout/components/header/index.jsx

@ -1,125 +1,138 @@
"use strict"; "use strict";
import React from "react"; import React from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Nav, Avatar, Dropdown } from "@douyinfe/semi-ui"; import { SplitButtonGroup, Dropdown, Button, Nav, Avatar } from '@douyinfe/semi-ui';
import { IconTreeTriangleDown } from '@douyinfe/semi-icons';
import "./index.less"; import "./index.less";
const Header = (props) => { const Header = (props) => {
const { dispatch, history, user, actions, socket, headerItems, tochange } = props; const { dispatch, history, user, actions, socket, headerItems, tochange } = props;
return ( return (
<> <>
<div id="top-slider"> <div id="top-slider">
<Nav <Nav
mode={"horizontal"} mode={"horizontal"}
onClick={({ itemKey }) => { onClick={({ itemKey }) => {
if (itemKey == "logout") { if (itemKey == "logout") {
dispatch(actions.auth.logout(user)); dispatch(actions.auth.logout(user));
if (socket) { if (socket) {
socket.disconnect(); socket.disconnect();
} }
history.push(`/signin`); history.push(`/signin`);
}
}}
style={{
height: 48,
minWidth: 520,
background: '#1D2343',
backgroundSize: "100% 100%",
color: "white",
}}
header={{
logo: (
<img
src="/assets/images/install/long_logo.png"
style={{ display: "inline-block", width: 200, height: 40, marginLeft: -24 }}
/>
),
text: (
<>
<SplitButtonGroup style={{ marginLeft: 10 }} aria-label="项目操作按钮组">
<Button theme="solid" type="primary" style={{ width: 52, height: 24, background: '#005ABD' }}>全局</Button>
<Dropdown onVisibleChange={(v) => { }} menu={{}} trigger="click" position="bottomRight">
<Button style={{ width: 16, height: 24, background: '#005ABD' }} theme="solid" type="primary" icon={<IconTreeTriangleDown />}></Button>
</Dropdown>
</SplitButtonGroup>
</>
),
}}
footer={
<>
{headerItems.map((item, index) => {
if (item.hasOwnProperty('items')) {
return (
<Nav.Sub
key={index + 'a'}
itemKey={item.itemKey}
text={item.text}
dropdownStyle={{ color: '#F2F3F5' }}
>
{item.hasOwnProperty('items') && item.items.map((ite, idx) => (
<Nav.Item key={idx + 'd'} itemKey={ite.itemKey} text={ite.text} onClick={() => { tochange(ite); }} />
))}
</Nav.Sub>
)
}
else {
return (
<>
<img src="/assets/images/background/console.png" style={{ width: 24, marginRight: 10 }} />
<Nav.Item key={index + 'a'} itemKey={item.itemKey} text={item.text} onClick={() => { tochange(item) }} />
</>
)
}
})}
<Nav.Sub
itemKey={"user"}
text={
<div
style={{
marginLeft: -8,
display: "inline-block",
color: "white",
}}
>
<Avatar size="extra-small" color="light-blue" style={{ marginRight: 4 }}>
{user?.name?.substr(0, 1)}
</Avatar>
<div style={{
display: "inline-block", position: "relative",
top: 10,
left: 4,
marginRight: 4,
}}
>
</div>
</div>
} }
}} >
style={{ <div style={{ width: 200, padding: 16, background: '#c7bebeeb' }}>
height: 48, <div style={{ display: "flex" }}>
minWidth: 520, <Avatar size="default" color="light-blue" style={{ marginRight: 4 }}>
background: '#1D2343', {user?.name?.substr(0, 1)}
backgroundSize: "100% 100%", </Avatar>
color: "white", <div style={{ fontSize: 12 }}>
}} {user.name}
header={{ <div title={user?.department?.map(v => v.name + '、')} style={{ width: 100, overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' }}>{user?.department?.map(v => v.name + '、')}</div>
logo: ( </div>
<img </div>
src="/assets/images/install/long_logo.png" <div>用户中心</div>
style={{ display: "inline-block", width: 200, height: 40 }} <div>安全认证</div>
/> </div>
), <Nav.Item itemKey={"logout"} text={"退出"} style={{ textAlign: "center" }} />
// text: (
// <div style={{ fontFamily: "YouSheBiaoTiHei", color: '#FFFFFF' }}></div>
// ),
}}
footer={
<>
{headerItems.map((item, index) => {
if (item.hasOwnProperty('items')) {
return (
<Nav.Sub
key={index + 'a'}
itemKey={item.itemKey}
text={item.text}
dropdownStyle={{ color: '#F2F3F5' }}
>
{item.hasOwnProperty('items') && item.items.map((ite, idx) => (
<Nav.Item key={idx + 'd'} itemKey={ite.itemKey} text={ite.text} onClick={() => { tochange(ite); }} />
))}
</Nav.Sub>
)
}
else {
return (
<Nav.Item key={index + 'a'} itemKey={item.itemKey} text={item.text} onClick={() => { tochange(item) }} />
)
}
})}
<Nav.Sub
itemKey={"user"}
text={
<div
style={{
marginLeft: -8,
display: "inline-block",
color: "white",
}}
>
<Avatar size="extra-small" color="light-blue" style={{ marginRight: 4 }}>
{user?.name?.substr(0, 1)}
</Avatar>
<div style={{
display: "inline-block", position: "relative",
top: 10,
left: 4,
marginRight: 4,
}}
>
</div>
</div>
}
>
<div style={{ width: 200, padding: 16, background: '#c7bebeeb' }}>
<div style={{ display: "flex" }}>
<Avatar size="default" color="light-blue" style={{ marginRight: 4 }}>
{user?.name?.substr(0, 1)}
</Avatar>
<div style={{ fontSize: 12 }}>
{user.name}
<div title={user?.department?.map(v => v.name + '、')} style={{ width: 100, overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' }}>{user?.department?.map(v => v.name + '、')}</div>
</div>
</div>
<div>用户中心</div>
<div>安全认证</div>
</div>
<Nav.Item itemKey={"logout"} text={"退出"} style={{ textAlign: "center" }} />
{/* collapseButton collapseText */} {/* collapseButton collapseText */}
</Nav.Sub> </Nav.Sub>
</> </>
} }
/> />
</div> </div>
</> </>
); );
}; };
function mapStateToProps (state) { function mapStateToProps (state) {
const { global, auth, webSocket } = state; const { global, auth, webSocket } = state;
return { return {
actions: global.actions, actions: global.actions,
user: auth.user, user: auth.user,
socket: webSocket.socket, socket: webSocket.socket,
}; };
} }
export default connect(mapStateToProps)(Header); export default connect(mapStateToProps)(Header);

2
web/client/src/sections/analysis/containers/operationData.jsx

@ -29,7 +29,7 @@ const Console = (props) => {
return ( return (
<> <>
<div> <div>
<img src="/assets/images/install/watting.png" alt="" style={{ height: '100%', width: '100%', }} /> <img src="/assets/images/install/watting.png" alt="" style={{ width: 'calc(100% + 16px)', position: "relative",top: -12, left: -8, }} />
</div> </div>
</> </>
) )

2
web/client/src/sections/analysis/containers/problemData.jsx

@ -29,7 +29,7 @@ const Console = (props) => {
return ( return (
<> <>
<div> <div>
<img src="/assets/images/install/watting.png" alt="" style={{ height: '100%', width: '100%', }} /> <img src="/assets/images/install/watting.png" alt="" style={{ width: 'calc(100% + 16px)', position: "relative",top: -12, left: -8,}} />
</div> </div>
</> </>
) )

2
web/client/src/sections/analysis/containers/workorderData.jsx

@ -29,7 +29,7 @@ const Console = (props) => {
return ( return (
<> <>
<div> <div>
<img src="/assets/images/install/watting.png" alt="" style={{ height: '100%', width: '100%', }} /> <img src="/assets/images/install/watting.png" alt="" style={{ width: 'calc(100% + 16px)', position: "relative",top: -12, left: -8, }} />
</div> </div>
</> </>
) )

6
web/client/src/sections/analysis/nav-item.jsx

@ -12,7 +12,7 @@ export function getNavItem (user, dispatch) {
{ {
itemKey: 'problemAnalysis', itemKey: 'problemAnalysis',
text: '问题分析', text: '问题分析',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="jq"></iconpark-icon>, icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconfxwenti"></iconpark-icon>,
to: '/analysis/problemAnalysis/problemData', to: '/analysis/problemAnalysis/problemData',
items: [{ items: [{
itemKey: 'problemData', to: '/analysis/problemAnalysis/problemData', text: '问题数据' itemKey: 'problemData', to: '/analysis/problemAnalysis/problemData', text: '问题数据'
@ -20,7 +20,7 @@ export function getNavItem (user, dispatch) {
}, { }, {
itemKey: 'operationAnalysis', itemKey: 'operationAnalysis',
text: '运维分析', text: '运维分析',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="ys"></iconpark-icon>, icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconfxyunwei"></iconpark-icon>,
to: '/analysis/operationAnalysis/operationData', to: '/analysis/operationAnalysis/operationData',
items: [{ items: [{
itemKey: 'operationData', to: '/analysis/operationAnalysis/operationData', text: '运维数据' itemKey: 'operationData', to: '/analysis/operationAnalysis/operationData', text: '运维数据'
@ -28,7 +28,7 @@ export function getNavItem (user, dispatch) {
},{ },{
itemKey: 'workorderAnalysis', itemKey: 'workorderAnalysis',
text: '工单分析', text: '工单分析',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="ys"></iconpark-icon>, icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconfxgongdan"></iconpark-icon>,
to: '/analysis/workorderAnalysis/workorderData', to: '/analysis/workorderAnalysis/workorderData',
items: [{ items: [{
itemKey: 'workorderData', to: '/analysis/workorderAnalysis/workorderData', text: '工单数据' itemKey: 'workorderData', to: '/analysis/workorderAnalysis/workorderData', text: '工单数据'

2
web/client/src/sections/console/containers/console.jsx

@ -29,7 +29,7 @@ const Console = (props) => {
return ( return (
<> <>
<div> <div>
<img src="/assets/images/install/watting.png" alt="" style={{ height: '100%', width: '100%', }} /> <img src="/assets/images/install/watting.png" alt="" style={{ width: 'calc(100% + 16px)', position: "relative",top: -12, left: -8, }} />
</div> </div>
</> </>
) )

64
web/client/src/sections/data/containers/dataAssociation.jsx

@ -5,45 +5,45 @@ import '../style.less'
const { Meta } = Card; const { Meta } = Card;
const Console = (props) => { const Console = (props) => {
const { dispatch, actions, user, loading, socket } = props const { dispatch, actions, user, loading, socket } = props
useEffect(() => { useEffect(() => {
// ACTION // ACTION
// dispatch(actions.example.getMembers(user.orgId)) // dispatch(actions.example.getMembers(user.orgId))
}, []) }, [])
// websocket 使 // websocket 使
// useEffect(() => { // useEffect(() => {
// console.log(socket) // console.log(socket)
// if (socket) { // if (socket) {
// socket.on('TEST', function (msg) { // socket.on('TEST', function (msg) {
// console.info(msg); // console.info(msg);
// }); // });
// return () => { // return () => {
// socket.off("TEST"); // socket.off("TEST");
// } // }
// } // }
// }, [socket]) // }, [socket])
return ( return (
<> <>
<div> <img src="/assets/images/install/watting.png" alt="" style={{
<img src="/assets/images/install/watting.png" alt="" style={{ height: '100%', width: '100%', }} /> width: 'calc(100% + 16px)', position: "relative",top: -12, left: -8,
</div> }} />
</> </>
) )
} }
function mapStateToProps (state) { function mapStateToProps (state) {
const { auth, global, members, webSocket } = state; const { auth, global, members, webSocket } = state;
return { return {
// loading: members.isRequesting, // loading: members.isRequesting,
// user: auth.user, // user: auth.user,
// actions: global.actions, // actions: global.actions,
// members: members.data, // members: members.data,
// socket: webSocket.socket // socket: webSocket.socket
}; };
} }
export default connect(mapStateToProps)(Console); export default connect(mapStateToProps)(Console);

2
web/client/src/sections/data/containers/dataComparison.jsx

@ -29,7 +29,7 @@ const Console = (props) => {
return ( return (
<> <>
<div> <div>
<img src="/assets/images/install/watting.png" alt="" style={{ height: '100%', width: '100%', }} /> <img src="/assets/images/install/watting.png" alt="" style={{ width: 'calc(100% + 16px)', position: "relative",top: -12, left: -8,}} />
</div> </div>
</> </>
) )

2
web/client/src/sections/data/containers/dataQuery.jsx

@ -29,7 +29,7 @@ const Console = (props) => {
return ( return (
<> <>
<div> <div>
<img src="/assets/images/install/watting.png" alt="" style={{ height: '100%', width: '100%', }} /> <img src="/assets/images/install/watting.png" alt="" style={{ width: 'calc(100% + 16px)', position: "relative",top: -12, left: -8, }} />
</div> </div>
</> </>
) )

2
web/client/src/sections/data/containers/notebook.jsx

@ -29,7 +29,7 @@ const Console = (props) => {
return ( return (
<> <>
<div> <div>
<img src="/assets/images/install/watting.png" alt="" style={{ height: '100%', width: '100%', }} /> <img src="/assets/images/install/watting.png" alt="" style={{ width: 'calc(100% + 16px)', position: "relative",top: -12, left: -8,}} />
</div> </div>
</> </>
) )

4
web/client/src/sections/data/nav-item.jsx

@ -12,7 +12,7 @@ export function getNavItem (user, dispatch) {
{ {
itemKey: 'dataMonitoring', itemKey: 'dataMonitoring',
text: '数据监控', text: '数据监控',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="jq"></iconpark-icon>, icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconsjjiankong"></iconpark-icon>,
to: '/data/dataMonitoring/dataQuery', to: '/data/dataMonitoring/dataQuery',
items: [{ items: [{
itemKey: 'dataQuery', to: '/data/dataMonitoring/dataQuery', text: '数据查询' itemKey: 'dataQuery', to: '/data/dataMonitoring/dataQuery', text: '数据查询'
@ -20,7 +20,7 @@ export function getNavItem (user, dispatch) {
}, { }, {
itemKey: 'dataAnalysis', itemKey: 'dataAnalysis',
text: '数据分析', text: '数据分析',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="ys"></iconpark-icon>, icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconsjfenxi"></iconpark-icon>,
to: '/data/dataAnalysis/dataComparison', to: '/data/dataAnalysis/dataComparison',
items: [{ items: [{
itemKey: 'dataComparison', to: '/data/dataAnalysis/dataComparison', text: '数据对比' itemKey: 'dataComparison', to: '/data/dataAnalysis/dataComparison', text: '数据对比'

2
web/client/src/sections/facility/actions/index.js

@ -0,0 +1,2 @@
'use strict';

6
web/client/src/sections/facility/containers/index.js

@ -0,0 +1,6 @@
'use strict';
import SetControl from './setControl';
import Server from './server';
import Rest from './rest';
export { SetControl,Server,Rest};

34
web/client/src/sections/facility/containers/rest.jsx

@ -0,0 +1,34 @@
import React, { useEffect } from 'react';
import { connect } from 'react-redux';
const Rest = (props) => {
const { dispatch, actions, user, loading, socket } = props
useEffect(() => {
}, [])
return (
<>
<div>
<img src="/assets/images/install/watting.png" alt="" style={{ width: 'calc(100% + 16px)', position: "relative", top: -12, left: -8, }} />
</div>
</>
)
}
function mapStateToProps (state) {
const { auth, global, members, webSocket } = state;
return {
// loading: members.isRequesting,
// user: auth.user,
// actions: global.actions,
// members: members.data,
// socket: webSocket.socket
};
}
export default connect(mapStateToProps)(Rest);

34
web/client/src/sections/facility/containers/server.jsx

@ -0,0 +1,34 @@
import React, { useEffect } from 'react';
import { connect } from 'react-redux';
const Server = (props) => {
const { dispatch, actions, user, loading, socket } = props
useEffect(() => {
}, [])
return (
<>
<div>
<img src="/assets/images/install/watting.png" alt="" style={{ width: 'calc(100% + 16px)', position: "relative", top: -12, left: -8, }} />
</div>
</>
)
}
function mapStateToProps (state) {
const { auth, global, members, webSocket } = state;
return {
// loading: members.isRequesting,
// user: auth.user,
// actions: global.actions,
// members: members.data,
// socket: webSocket.socket
};
}
export default connect(mapStateToProps)(Server);

34
web/client/src/sections/facility/containers/setControl.jsx

@ -0,0 +1,34 @@
import React, { useEffect } from 'react';
import { connect } from 'react-redux';
const SetControl = (props) => {
const { dispatch, actions, user, loading, socket } = props
useEffect(() => {
}, [])
return (
<>
<div>
<img src="/assets/images/install/watting.png" alt="" style={{ width: 'calc(100% + 16px)', position: "relative", top: -12, left: -8, }} />
</div>
</>
)
}
function mapStateToProps (state) {
const { auth, global, members, webSocket } = state;
return {
// loading: members.isRequesting,
// user: auth.user,
// actions: global.actions,
// members: members.data,
// socket: webSocket.socket
};
}
export default connect(mapStateToProps)(SetControl);

15
web/client/src/sections/facility/index.js

@ -0,0 +1,15 @@
'use strict';
import reducers from './reducers';
import routes from './routes';
import actions from './actions';
import { getNavItem } from './nav-item';
export default {
key: 'data',
name: '数据',
reducers: reducers,
routes: routes,
actions: actions,
getNavItem: getNavItem
};

37
web/client/src/sections/facility/nav-item.jsx

@ -0,0 +1,37 @@
import React from 'react';
import { IconCode } from '@douyinfe/semi-icons';
export function getNavItem (user, dispatch) {
return (
[
{
itemKey: 'data',
text: '数据',
icon: <IconCode />,
items: [
{
itemKey: 'dataMonitoring',
text: '数据监控',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconsjjiankong"></iconpark-icon>,
to: '/data/dataMonitoring/dataQuery',
items: [{
itemKey: 'dataQuery', to: '/data/dataMonitoring/dataQuery', text: '数据查询'
}]
}, {
itemKey: 'dataAnalysis',
text: '数据分析',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconsjfenxi"></iconpark-icon>,
to: '/data/dataAnalysis/dataComparison',
items: [{
itemKey: 'dataComparison', to: '/data/dataAnalysis/dataComparison', text: '数据对比'
},{
itemKey: 'dataAssociation', to: '/data/dataAnalysis/dataAssociation', text: '数据关联'
},{
itemKey: 'notebook', to: '/data/dataAnalysis/notebook', text: 'notebook'
}]
},
]
},
]
);
}

5
web/client/src/sections/facility/reducers/index.js

@ -0,0 +1,5 @@
'use strict';
export default {
}

42
web/client/src/sections/facility/routes.js

@ -0,0 +1,42 @@
import { DataQuery, DataComparison, DataAssociation,Notebook } from './containers';
export default [{
type: 'inner',
route: {
path: '/data',
key: 'data',
breadcrumb: '数据',
// 不设置 component 则面包屑禁止跳转
childRoutes: [{
path: '/dataMonitoring',
key: 'dataMonitoring',
breadcrumb: '数据监控',
childRoutes: [{
path: '/dataQuery',
key: 'dataQuery',
component: DataQuery,
breadcrumb: '数据查询',
}]
}, {
path: '/dataAnalysis',
key: 'dataAnalysis',
breadcrumb: '数据分析',
childRoutes: [{
path: '/dataComparison',
key: 'dataComparison',
component: DataComparison,
breadcrumb: '数据对比',
},{
path: '/dataAssociation',
key: 'dataAssociation',
component: DataAssociation,
breadcrumb: '数据关联',
},{
path: '/notebook',
key: 'notebook',
component: Notebook,
breadcrumb: 'notebook',
}]
}]
}
}];

7
web/client/src/sections/facility/style.less

@ -0,0 +1,7 @@
#example {
box-shadow: 3px 3px 2px black;
}
#example:hover {
color: yellowgreen;
}

5
web/client/src/sections/install/containers/index.js

@ -2,4 +2,7 @@
import Roles from './roles'; import Roles from './roles';
import System from './system'; import System from './system';
export { Roles,System }; import Setup from './setup';
import Set from './set';
export { Roles, System, Setup, Set };

34
web/client/src/sections/install/containers/set.jsx

@ -0,0 +1,34 @@
import React, { useEffect } from 'react';
import { connect } from 'react-redux';
const Set = (props) => {
const { dispatch, actions, user, loading, socket } = props
useEffect(() => {
}, [])
return (
<>
<div>
<img src="/assets/images/install/watting.png" alt="" style={{ width: 'calc(100% + 16px)', position: "relative", top: -12, left: -8, }} />
</div>
</>
)
}
function mapStateToProps (state) {
const { auth, global, members, webSocket } = state;
return {
// loading: members.isRequesting,
// user: auth.user,
// actions: global.actions,
// members: members.data,
// socket: webSocket.socket
};
}
export default connect(mapStateToProps)(Set);

34
web/client/src/sections/install/containers/setup.jsx

@ -0,0 +1,34 @@
import React, { useEffect } from 'react';
import { connect } from 'react-redux';
const Setup = (props) => {
const { dispatch, actions, user, loading, socket } = props
useEffect(() => {
}, [])
return (
<>
<div>
<img src="/assets/images/install/watting.png" alt="" style={{ width: 'calc(100% + 16px)', position: "relative", top: -12, left: -8, }} />
</div>
</>
)
}
function mapStateToProps (state) {
const { auth, global, members, webSocket } = state;
return {
// loading: members.isRequesting,
// user: auth.user,
// actions: global.actions,
// members: members.data,
// socket: webSocket.socket
};
}
export default connect(mapStateToProps)(Setup);

72
web/client/src/sections/install/nav-item.jsx

@ -2,32 +2,48 @@ import React from 'react';
import { IconCode } from '@douyinfe/semi-icons'; import { IconCode } from '@douyinfe/semi-icons';
export function getNavItem (user, dispatch) { export function getNavItem (user, dispatch) {
return ( return (
[ [
{ {
itemKey: 'install', itemKey: 'install',
text: '设置', text: '设置',
icon: <IconCode />, icon: <IconCode />,
items: [ items: [
{ {
itemKey: 'authentication', itemKey: 'authentication',
text: '鉴权管理', text: '鉴权管理',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="jq"></iconpark-icon>, icon: <iconpark-icon style={{ width: 20, height: 20 }} name="jq"></iconpark-icon>,
to: '/install/authentication/roles', to: '/install/authentication/roles',
items: [{ items: [{
itemKey: 'roles', to: '/install/authentication/roles', text: '人员及角色' itemKey: 'roles', to: '/install/authentication/roles', text: '人员及角色'
}] }]
}, { }, {
itemKey: 'mapping', itemKey: 'mapping',
text: '关系映射', text: '关系映射',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="ys"></iconpark-icon>, icon: <iconpark-icon style={{ width: 20, height: 20 }} name="ys"></iconpark-icon>,
to: '/install/mapping/system', to: '/install/mapping/system',
items: [{ items: [{
itemKey: 'system', to: '/install/mapping/system', text: '系统映射' itemKey: 'system', to: '/install/mapping/system', text: '系统映射'
}] }]
}, }, {
] itemKey: 'order ',
}, text: '工单管理',
] icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconjianshezhong"></iconpark-icon>,
); to: '/install/order /setup',
items: [{
itemKey: 'setup', to: '/install/order/setup', text: '工单设置'
}]
}, {
itemKey: 'relation',
text: '容差管理',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconjianshezhong"></iconpark-icon>,
to: '/install/relation/set',
items: [{
itemKey: 'set', to: '/install/relation/set', text: '容差设置'
}]
},
]
},
]
);
} }

85
web/client/src/sections/install/routes.js

@ -1,33 +1,56 @@
'use strict'; 'use strict';
import { Roles,System } from './containers'; import { Roles, System,Setup,Set } from './containers';
export default [{ export default [
type: 'inner', {
route: { type: 'inner',
path: '/install', route: {
key: 'install', path: '/install',
breadcrumb: '设置', key: 'install',
// 不设置 component 则面包屑禁止跳转 breadcrumb: '设置',
childRoutes: [{ // 不设置 component 则面包屑禁止跳转
path: '/authentication', childRoutes: [
key: 'authentication', {
breadcrumb: '鉴权管理', path: '/authentication',
childRoutes:[{ key: 'authentication',
path: '/roles', breadcrumb: '鉴权管理',
key: 'roles', childRoutes: [{
component: Roles, path: '/roles',
breadcrumb: '人员及角色', key: 'roles',
}] component: Roles,
},{ breadcrumb: '人员及角色',
path: '/mapping', }]
key: 'mapping', }, {
breadcrumb: '关系映射', path: '/mapping',
childRoutes:[{ key: 'mapping',
path: '/system', breadcrumb: '关系映射',
key: 'system', childRoutes: [{
component: System, path: '/system',
breadcrumb: '系统映射', key: 'system',
}] component: System,
}] breadcrumb: '系统映射',
} }]
}]; },, {
path: '/order',
key: 'order',
breadcrumb: '工单管理',
childRoutes: [{
path: '/setup',
key: 'setup',
component: Setup,
breadcrumb: '工单设置',
}]
}, {
path: '/relation',
key: 'relation',
breadcrumb: '容差管理',
childRoutes: [{
path: '/set',
key: 'set',
component: Set,
breadcrumb: '容差设置',
}]
}
]
}
}];

24
web/client/src/sections/problem/actions/problem.jsx

@ -62,3 +62,27 @@ export function postApiConfirm (data) { //确认应用接口/元素错误信
reducer: { name: '' } reducer: { name: '' }
}); });
} }
export function getAlarmDataGroup () { //
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
actionType: 'GET_ALARM_DATA_GROUP',
url: `${ApiTable.getAlarmDataGroup}`,
msg: { error: '获取数据告警分类失败' },
reducer: { name: '' }
});
}
export function getAlarmDataList (query) { //
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query,
actionType: 'GET_ALARM_DATA_LIST',
url: `${ApiTable.getAlarmDataList}`,
msg: { error: '查询数据告警列表失败' },
reducer: { name: '' }
});
}

3
web/client/src/sections/problem/components/inspection.jsx

@ -282,6 +282,9 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => {
<div style={{ marginBottom: 12 }}> <div style={{ marginBottom: 12 }}>
{pictureData.notedTime ? <span style={{ marginRight: 14 }}>核验信息{pictureData.notedPepUser}&nbsp;{moment(pictureData.notedTime).format("YYYY-MM-DD HH:MM:SS")}</span> : ""} {pictureData.notedTime ? <span style={{ marginRight: 14 }}>核验信息{pictureData.notedPepUser}&nbsp;{moment(pictureData.notedTime).format("YYYY-MM-DD HH:MM:SS")}</span> : ""}
<span>截取时间:{moment(pictureData.createTime).format("YYYY-MM-DD HH:MM:SS")}</span> <span>截取时间:{moment(pictureData.createTime).format("YYYY-MM-DD HH:MM:SS")}</span>
<img src={`/assets/images/problem/link.png`}
style={{ width: 16, height: 16, marginLeft: 6 }}
/>
</div> </div>
<img src={`/_file-server/${pictureData.screenshot}`} <img src={`/_file-server/${pictureData.screenshot}`}
style={{ width: 789, height: 359 }} style={{ width: 789, height: 359 }}

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

@ -16,27 +16,55 @@ const TableData = ({ dispatch, actions, route, collectData, setSetup, exhibition
switch (route) { switch (route) {
case 'useAbnormal': case 'useAbnormal':
dispatch(problem.getAlarmLnspectionApi({})).then((res) => { dispatch(problem.getAlarmLnspectionApi({})).then((res) => {
console.log(res.payload.data); console.log(res.payload.data)
let tableDatas = res.payload.data?.rows.map(v => ({ if (res.success) {
key: v.id, let tableDatas = res.payload.data?.rows.map(v => ({
serialNumber: v.serialNumber, key: v.id,
projectName: v.app?.projectCorrelations?.map(r => r.name)?.filter(c => c), serialNumber: v.serialNumber,
appName: v.app?.name, projectName: v.app?.projectCorrelations?.map(r => r.name)?.filter(c => c),
url: v.app?.url, appName: v.app?.name,
createTime: v.createTime ? moment(v.createTime).format("YYYY-MM-DD HH:MM:SS") : "", url: v.app?.url,
updateTime: v.updateTime ? moment(v.updateTime).format("YYYY-MM-DD HH:MM:SS") : "", createTime: v.createTime ? moment(v.createTime).format("YYYY-MM-DD HH:MM:SS") : "",
confirmTime: v.confirmTime ? moment(v.confirmTime).format("YYYY-MM-DD HH:MM:SS") : "", updateTime: v.updateTime ? moment(v.updateTime).format("YYYY-MM-DD HH:MM:SS") : "",
alarmContent: v.alarmContent, confirmTime: v.confirmTime ? moment(v.confirmTime).format("YYYY-MM-DD HH:MM:SS") : "",
screenshot: v.screenshot, alarmContent: v.alarmContent,
type: v.type, screenshot: v.screenshot,
confirm: v.confirm, type: v.type,
})) confirm: v.confirm,
console.log(tableDatas); }))
setTableData(tableDatas) // console.log(tableDatas);
setTableData(tableDatas)
}
}) })
break; break;
default: default:
dispatch(problem.getAlarmDataGroup()).then((res) => {
if (res.success) {
console.log(res.payload.data);
}
// let tableDatas = res.payload.data?.rows.map(v => ({
// key: v.id,
// serialNumber: v.serialNumber,
// projectName: v.app?.projectCorrelations?.map(r => r.name)?.filter(c => c),
// appName: v.app?.name,
// url: v.app?.url,
// createTime: v.createTime ? moment(v.createTime).format("YYYY-MM-DD HH:MM:SS") : "",
// updateTime: v.updateTime ? moment(v.updateTime).format("YYYY-MM-DD HH:MM:SS") : "",
// confirmTime: v.confirmTime ? moment(v.confirmTime).format("YYYY-MM-DD HH:MM:SS") : "",
// alarmContent: v.alarmContent,
// screenshot: v.screenshot,
// type: v.type,
// confirm: v.confirm,
// }))
// console.log(tableDatas);
// setTableData(tableDatas)
})
break; break;
} }

35
web/client/src/sections/problem/containers/dataAlarm.jsx

@ -25,7 +25,6 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
const [content, setContent] = useState(false); // const [content, setContent] = useState(false); //
const [selected, setSelected] = useState([]) // const [selected, setSelected] = useState([]) //
const tableType = { dataLnterrupt: 'dataLnterrupt', dataAbnormal: 'dataAbnormal', strategyHit: 'strategyHit', videoAbnormal: 'videoAbnormal', useAbnormal: 'useAbnormal', deviceAbnormal: 'deviceAbnormal' } const tableType = { dataLnterrupt: 'dataLnterrupt', dataAbnormal: 'dataAbnormal', strategyHit: 'strategyHit', videoAbnormal: 'videoAbnormal', useAbnormal: 'useAbnormal', deviceAbnormal: 'deviceAbnormal' }
const statistic = { dataLnterrupt: '数据中断统计', dataAbnormal: '数据异常统计', strategyHit: '策略命中统计', videoAbnormal: '视频异常统计', useAbnormal: '应用异常统计', deviceAbnormal: '设备异常统计' } const statistic = { dataLnterrupt: '数据中断统计', dataAbnormal: '数据异常统计', strategyHit: '策略命中统计', videoAbnormal: '视频异常统计', useAbnormal: '应用异常统计', deviceAbnormal: '设备异常统计' }
@ -162,27 +161,32 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
// //
const tableList = { const tableList = {
dataLnterrupt: ['projectName', '2', '3', '4', '6', '9', 'createTime', '5', '10', 'updateTime', '11', 'confirm', 'confirmTime', '14'], dataLnterrupt: ['index', 'projectName', '2', '3', '4', '6', '9', 'createTime', '5', '10', 'updateTime', '11', 'confirm', 'confirmTime', '14'],
dataAbnormal: ['projectName', '2', '3', '4', 'alarmContent', '16', '9', 'createTime', '5', '10', 'updateTime', '11', 'confirm', 'confirmTime'], dataAbnormal: ['index', 'projectName', '2', '3', '4', 'alarmContent', '16', '9', 'createTime', '5', '10', 'updateTime', '11', 'confirm', 'confirmTime'],
strategyHit: ['projectName', '2', '3', '17', '18', 'createTime', '5', '10', 'updateTime', '11', 'confirm', 'confirmTime'], strategyHit: ['index', 'projectName', '2', '3', '17', '18', 'createTime', '5', '10', 'updateTime', '11', 'confirm', 'confirmTime'],
videoAbnormal: ['projectName', '2', '3', '19', '20', '21', '22', '5', '6', 'createTime', 'updateTime', 'confirm', 'confirmTime'], videoAbnormal: ['index', 'projectName', '2', '3', '19', '20', '21', '22', '5', '6', 'createTime', 'updateTime', 'confirm', 'confirmTime'],
useAbnormal: ['projectName', 'appName', 'url', 'type', 'alarmContent', 'createTime', 'updateTime', 'confirm', 'confirmTime'], useAbnormal: ['index', 'projectName', 'appName', 'url', 'type', 'alarmContent', 'createTime', 'updateTime', 'confirm', 'confirmTime'],
deviceAbnormal: ['projectName', '2', '3', '19', 'alarmContent', '21', '5', '6', 'createTime', 'updateTime', 'confirm', 'confirmTime'], deviceAbnormal: ['index', 'projectName', '2', '3', '19', 'alarmContent', '21', '5', '6', 'createTime', 'updateTime', 'confirm', 'confirmTime'],
} }
// //
const columns = { const columns = {
dataLnterrupt: ['serialNumber', 'projectName', '2', '3', '4', '5', '6', 'createTime', 'updateTime',], dataLnterrupt: ['projectName', '2', '3', '4', '5', '6', 'createTime', 'updateTime',],
dataAbnormal: ['serialNumber', 'projectName', '2', '3', 'alarmContent', '5', '6', 'createTime', 'updateTime'], dataAbnormal: ['projectName', '2', '3', 'alarmContent', '5', '6', 'createTime', 'updateTime'],
strategyHit: ['serialNumber', 'projectName', '2', '3', '17', '5', '10', '11', 'updateTime'], strategyHit: ['projectName', '2', '3', '17', '5', '10', '11', 'updateTime'],
videoAbnormal: ['serialNumber', 'projectName', '2', '3', '21', '20', '5', 'createTime', 'updateTime'], videoAbnormal: ['projectName', '2', '3', '21', '20', '5', 'createTime', 'updateTime'],
useAbnormal: ['serialNumber', 'appName', 'projectName', 'url', 'type', 'alarmContent', 'createTime', 'updateTime'], useAbnormal: ['appName', 'projectName', 'url', 'type', 'alarmContent', 'createTime', 'updateTime'],
deviceAbnormal: ['serialNumber', 'projectName', '2', '3', 'alarmContent', '19', '5', 'createTime', 'updateTime'], deviceAbnormal: ['projectName', '2', '3', 'alarmContent', '19', '5', 'createTime', 'updateTime'],
} }
// //
const columnAll = [ const columnAll = [
{
name: "序号", value: "index", render: (_, r, index) => {
return index + 1;
},
},
{ name: '问题编号', value: 'serialNumber', render: (_, r, index) => r.serialNumber }, { name: '问题编号', value: 'serialNumber', render: (_, r, index) => r.serialNumber },
{ {
name: '项目名称', value: 'projectName', render: (_, r, index) => { name: '项目名称', value: 'projectName', render: (_, r, index) => {
@ -257,9 +261,9 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
if (route) { if (route) {
let setup = tableList[route].map(v => columnAll.find(vv => v == vv.value)) let setup = tableList[route].map(v => columnAll.find(vv => v == vv.value))
let data = ['serialNumber'] let data = []
if (tableType[route] == 'dataAbnormal') { if (tableType[route] == 'dataAbnormal') {
data = ['serialNumber', '6'] data = ['6']
data.splice(1, 0, ...arr) data.splice(1, 0, ...arr)
} else { } else {
data.splice(1, 0, ...arr) data.splice(1, 0, ...arr)
@ -275,6 +279,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
} }
}) })
TableDisplay.push({ TableDisplay.push({
title: '操作', title: '操作',
dataIndex: 'text', dataIndex: 'text',

10
web/client/src/sections/problem/nav-item.jsx

@ -5,9 +5,11 @@ export function getNavItem (user, dispatch) {
return ( return (
[{ [{
itemKey: 'problem', text: '问题', itemKey: 'problem', text: '问题',
icon: <IconCode />,
items: [ items: [
{ {
itemKey: 'dataAlarm', text: '数据告警', to: '/problem/dataAlarm/dataLnterrupt', icon: <iconpark-icon style={{ width: 20, height: 20 }} name="she-1"></iconpark-icon>, itemKey: 'dataAlarm', text: '数据告警', to: '/problem/dataAlarm/dataLnterrupt',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="sj"></iconpark-icon>,
items: [ items: [
{ itemKey: 'dataLnterrupt', to: '/problem/dataAlarm/dataLnterrupt', text: '数据中断' }, { itemKey: 'dataLnterrupt', to: '/problem/dataAlarm/dataLnterrupt', text: '数据中断' },
{ itemKey: 'dataAbnormal', to: '/problem/dataAlarm/dataAbnormal', text: '数据异常' }, { itemKey: 'dataAbnormal', to: '/problem/dataAlarm/dataAbnormal', text: '数据异常' },
@ -15,12 +17,14 @@ export function getNavItem (user, dispatch) {
{ itemKey: 'videoAbnormal', to: '/problem/dataAlarm/videoAbnormal', text: '视频异常' }, { itemKey: 'videoAbnormal', to: '/problem/dataAlarm/videoAbnormal', text: '视频异常' },
] ]
}, { }, {
itemKey: 'useAlarm', text: '应用告警', to: '/problem/useAlarm/useAbnormal', icon: <iconpark-icon style={{ width: 20, height: 20 }} name="she-1"></iconpark-icon>, itemKey: 'useAlarm', text: '应用告警', to: '/problem/useAlarm/useAbnormal',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="yy"></iconpark-icon>,
items: [ items: [
{ itemKey: 'useAbnormal', to: '/problem/useAlarm/useAbnormal', text: '应用异常' }, { itemKey: 'useAbnormal', to: '/problem/useAlarm/useAbnormal', text: '应用异常' },
] ]
}, { }, {
itemKey: 'deviceAlarm', text: '设备告警', to: '/problem/deviceAlarm/deviceAbnormal', icon: <iconpark-icon style={{ width: 20, height: 20 }} name="she-1"></iconpark-icon>, itemKey: 'deviceAlarm', text: '设备告警', to: '/problem/deviceAlarm/deviceAbnormal',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="sb"></iconpark-icon>,
items: [ items: [
{ itemKey: 'deviceAbnormal', to: '/problem/deviceAlarm/deviceAbnormal', text: '设备异常' }, { itemKey: 'deviceAbnormal', to: '/problem/deviceAlarm/deviceAbnormal', text: '设备异常' },
] ]

6
web/client/src/utils/webapi.js

@ -37,7 +37,11 @@ export const ApiTable = {
getAlarmLnspection: 'alarm/application/inspection', //查询应用巡检信息 getAlarmLnspection: 'alarm/application/inspection', //查询应用巡检信息
putAlarmApplicationNoted: 'alarm/application/noted', //预览状态 putAlarmApplicationNoted: 'alarm/application/noted', //预览状态
getAlarmLnspectionApi: 'alarm/application/api', //查询应用接口/元素错误信息 getAlarmLnspectionApi: 'alarm/application/api', //查询应用接口/元素错误信息
postApiConfirm:"alarm/application/api_confirm", //确认应用接口/元素错误信息 postApiConfirm: "alarm/application/api_confirm", //确认应用接口/元素错误信息
getAlarmDataGroup: 'alarm/data/group', //获取数据告警分类
getAlarmDataList: "/alarm/data/list", //查询数据告警列表
}; };
export const RouteTable = { export const RouteTable = {
apiRoot: "/api/root", apiRoot: "/api/root",

Loading…
Cancel
Save