diff --git a/web/client/assets/images/background/console.png b/web/client/assets/images/background/console.png new file mode 100644 index 0000000..02add22 Binary files /dev/null and b/web/client/assets/images/background/console.png differ diff --git a/web/client/assets/images/favicon.ico b/web/client/assets/images/favicon.ico index 8551bf9..d9d46c4 100644 Binary files a/web/client/assets/images/favicon.ico and b/web/client/assets/images/favicon.ico differ diff --git a/web/client/assets/images/problem/link.png b/web/client/assets/images/problem/link.png new file mode 100644 index 0000000..e5343a5 Binary files /dev/null and b/web/client/assets/images/problem/link.png differ diff --git a/web/client/index.ejs b/web/client/index.ejs index bda653c..6d2bdfc 100644 --- a/web/client/index.ejs +++ b/web/client/index.ejs @@ -12,8 +12,7 @@ - + diff --git a/web/client/index.html b/web/client/index.html index 30f34fb..ac0b018 100644 --- a/web/client/index.html +++ b/web/client/index.html @@ -10,7 +10,7 @@ - + diff --git a/web/client/src/app.jsx b/web/client/src/app.jsx index baca1e8..9a55669 100644 --- a/web/client/src/app.jsx +++ b/web/client/src/app.jsx @@ -9,6 +9,7 @@ import Install from './sections/install'; import Problem from './sections/problem'; import NoMatch from './sections/noMatch'; import Console from './sections/console'; +import Facility from './sections/facility'; import Data from './sections/data'; const App = props => { @@ -35,8 +36,8 @@ const App = props => { ) diff --git a/web/client/src/layout/components/header/index.jsx b/web/client/src/layout/components/header/index.jsx index 441e986..b21379a 100644 --- a/web/client/src/layout/components/header/index.jsx +++ b/web/client/src/layout/components/header/index.jsx @@ -1,125 +1,138 @@ "use strict"; import React from "react"; 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"; const Header = (props) => { - const { dispatch, history, user, actions, socket, headerItems, tochange } = props; + const { dispatch, history, user, actions, socket, headerItems, tochange } = props; - return ( - <> -
-
- } - > -
-
- - {user?.name?.substr(0, 1)} - -
- {user.name} -
v.name + '、')} style={{ width: 100, overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' }}>{user?.department?.map(v => v.name + '、')}
-
-
-
用户中心
-
安全认证
-
- + > +
+
+ + {user?.name?.substr(0, 1)} + +
+ {user.name} +
v.name + '、')} style={{ width: 100, overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' }}>{user?.department?.map(v => v.name + '、')}
+
+
+
用户中心
+
安全认证
+
+ - {/* collapseButton collapseText */} + {/* collapseButton collapseText */} - - - } - /> - - - ); + + + } + /> + + + ); }; function mapStateToProps (state) { - const { global, auth, webSocket } = state; - return { - actions: global.actions, - user: auth.user, - socket: webSocket.socket, - }; + const { global, auth, webSocket } = state; + return { + actions: global.actions, + user: auth.user, + socket: webSocket.socket, + }; } export default connect(mapStateToProps)(Header); diff --git a/web/client/src/sections/analysis/containers/operationData.jsx b/web/client/src/sections/analysis/containers/operationData.jsx index e37e5de..003eb46 100644 --- a/web/client/src/sections/analysis/containers/operationData.jsx +++ b/web/client/src/sections/analysis/containers/operationData.jsx @@ -29,7 +29,7 @@ const Console = (props) => { return ( <>
- +
) diff --git a/web/client/src/sections/analysis/containers/problemData.jsx b/web/client/src/sections/analysis/containers/problemData.jsx index e37e5de..0ac898b 100644 --- a/web/client/src/sections/analysis/containers/problemData.jsx +++ b/web/client/src/sections/analysis/containers/problemData.jsx @@ -29,7 +29,7 @@ const Console = (props) => { return ( <>
- +
) diff --git a/web/client/src/sections/analysis/containers/workorderData.jsx b/web/client/src/sections/analysis/containers/workorderData.jsx index e37e5de..003eb46 100644 --- a/web/client/src/sections/analysis/containers/workorderData.jsx +++ b/web/client/src/sections/analysis/containers/workorderData.jsx @@ -29,7 +29,7 @@ const Console = (props) => { return ( <>
- +
) diff --git a/web/client/src/sections/analysis/nav-item.jsx b/web/client/src/sections/analysis/nav-item.jsx index 1fdac6c..2389033 100644 --- a/web/client/src/sections/analysis/nav-item.jsx +++ b/web/client/src/sections/analysis/nav-item.jsx @@ -12,7 +12,7 @@ export function getNavItem (user, dispatch) { { itemKey: 'problemAnalysis', text: '问题分析', - icon: , + icon: , to: '/analysis/problemAnalysis/problemData', items: [{ itemKey: 'problemData', to: '/analysis/problemAnalysis/problemData', text: '问题数据' @@ -20,7 +20,7 @@ export function getNavItem (user, dispatch) { }, { itemKey: 'operationAnalysis', text: '运维分析', - icon: , + icon: , to: '/analysis/operationAnalysis/operationData', items: [{ itemKey: 'operationData', to: '/analysis/operationAnalysis/operationData', text: '运维数据' @@ -28,7 +28,7 @@ export function getNavItem (user, dispatch) { },{ itemKey: 'workorderAnalysis', text: '工单分析', - icon: , + icon: , to: '/analysis/workorderAnalysis/workorderData', items: [{ itemKey: 'workorderData', to: '/analysis/workorderAnalysis/workorderData', text: '工单数据' diff --git a/web/client/src/sections/console/containers/console.jsx b/web/client/src/sections/console/containers/console.jsx index e37e5de..f3bb34d 100644 --- a/web/client/src/sections/console/containers/console.jsx +++ b/web/client/src/sections/console/containers/console.jsx @@ -29,7 +29,7 @@ const Console = (props) => { return ( <>
- +
) diff --git a/web/client/src/sections/data/containers/dataAssociation.jsx b/web/client/src/sections/data/containers/dataAssociation.jsx index e37e5de..7c54b72 100644 --- a/web/client/src/sections/data/containers/dataAssociation.jsx +++ b/web/client/src/sections/data/containers/dataAssociation.jsx @@ -5,45 +5,45 @@ import '../style.less' const { Meta } = Card; const Console = (props) => { - const { dispatch, actions, user, loading, socket } = props + const { dispatch, actions, user, loading, socket } = props - useEffect(() => { - // ACTION 示例 - // dispatch(actions.example.getMembers(user.orgId)) - }, []) + useEffect(() => { + // ACTION 示例 + // dispatch(actions.example.getMembers(user.orgId)) + }, []) - // websocket 使用测试 - // useEffect(() => { - // console.log(socket) - // if (socket) { - // socket.on('TEST', function (msg) { - // console.info(msg); - // }); - // return () => { - // socket.off("TEST"); - // } - // } + // websocket 使用测试 + // useEffect(() => { + // console.log(socket) + // if (socket) { + // socket.on('TEST', function (msg) { + // console.info(msg); + // }); + // return () => { + // socket.off("TEST"); + // } + // } - // }, [socket]) + // }, [socket]) - return ( - <> -
- -
- - ) + return ( + <> + + + ) } 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 - }; + 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)(Console); diff --git a/web/client/src/sections/data/containers/dataComparison.jsx b/web/client/src/sections/data/containers/dataComparison.jsx index e37e5de..9b307c1 100644 --- a/web/client/src/sections/data/containers/dataComparison.jsx +++ b/web/client/src/sections/data/containers/dataComparison.jsx @@ -29,7 +29,7 @@ const Console = (props) => { return ( <>
- +
) diff --git a/web/client/src/sections/data/containers/dataQuery.jsx b/web/client/src/sections/data/containers/dataQuery.jsx index e37e5de..003eb46 100644 --- a/web/client/src/sections/data/containers/dataQuery.jsx +++ b/web/client/src/sections/data/containers/dataQuery.jsx @@ -29,7 +29,7 @@ const Console = (props) => { return ( <>
- +
) diff --git a/web/client/src/sections/data/containers/notebook.jsx b/web/client/src/sections/data/containers/notebook.jsx index e37e5de..9b307c1 100644 --- a/web/client/src/sections/data/containers/notebook.jsx +++ b/web/client/src/sections/data/containers/notebook.jsx @@ -29,7 +29,7 @@ const Console = (props) => { return ( <>
- +
) diff --git a/web/client/src/sections/data/nav-item.jsx b/web/client/src/sections/data/nav-item.jsx index b131deb..b72f146 100644 --- a/web/client/src/sections/data/nav-item.jsx +++ b/web/client/src/sections/data/nav-item.jsx @@ -12,7 +12,7 @@ export function getNavItem (user, dispatch) { { itemKey: 'dataMonitoring', text: '数据监控', - icon: , + icon: , to: '/data/dataMonitoring/dataQuery', items: [{ itemKey: 'dataQuery', to: '/data/dataMonitoring/dataQuery', text: '数据查询' @@ -20,7 +20,7 @@ export function getNavItem (user, dispatch) { }, { itemKey: 'dataAnalysis', text: '数据分析', - icon: , + icon: , to: '/data/dataAnalysis/dataComparison', items: [{ itemKey: 'dataComparison', to: '/data/dataAnalysis/dataComparison', text: '数据对比' diff --git a/web/client/src/sections/facility/actions/index.js b/web/client/src/sections/facility/actions/index.js new file mode 100644 index 0000000..eb109ab --- /dev/null +++ b/web/client/src/sections/facility/actions/index.js @@ -0,0 +1,2 @@ +'use strict'; + diff --git a/web/client/src/sections/facility/containers/index.js b/web/client/src/sections/facility/containers/index.js new file mode 100644 index 0000000..009b261 --- /dev/null +++ b/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}; \ No newline at end of file diff --git a/web/client/src/sections/facility/containers/rest.jsx b/web/client/src/sections/facility/containers/rest.jsx new file mode 100644 index 0000000..27f758a --- /dev/null +++ b/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 ( + <> +
+ +
+ + ) +} + +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); diff --git a/web/client/src/sections/facility/containers/server.jsx b/web/client/src/sections/facility/containers/server.jsx new file mode 100644 index 0000000..8abf95c --- /dev/null +++ b/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 ( + <> +
+ +
+ + ) +} + +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); diff --git a/web/client/src/sections/facility/containers/setControl.jsx b/web/client/src/sections/facility/containers/setControl.jsx new file mode 100644 index 0000000..c116207 --- /dev/null +++ b/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 ( + <> +
+ +
+ + ) +} + +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); diff --git a/web/client/src/sections/facility/index.js b/web/client/src/sections/facility/index.js new file mode 100644 index 0000000..e3946b0 --- /dev/null +++ b/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 +}; \ No newline at end of file diff --git a/web/client/src/sections/facility/nav-item.jsx b/web/client/src/sections/facility/nav-item.jsx new file mode 100644 index 0000000..b72f146 --- /dev/null +++ b/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: , + items: [ + { + itemKey: 'dataMonitoring', + text: '数据监控', + icon: , + to: '/data/dataMonitoring/dataQuery', + items: [{ + itemKey: 'dataQuery', to: '/data/dataMonitoring/dataQuery', text: '数据查询' + }] + }, { + itemKey: 'dataAnalysis', + text: '数据分析', + 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' + }] + }, + ] + }, + ] + ); +} \ No newline at end of file diff --git a/web/client/src/sections/facility/reducers/index.js b/web/client/src/sections/facility/reducers/index.js new file mode 100644 index 0000000..7ed1088 --- /dev/null +++ b/web/client/src/sections/facility/reducers/index.js @@ -0,0 +1,5 @@ +'use strict'; + +export default { + +} \ No newline at end of file diff --git a/web/client/src/sections/facility/routes.js b/web/client/src/sections/facility/routes.js new file mode 100644 index 0000000..d3e4627 --- /dev/null +++ b/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', + }] + }] + } +}]; \ No newline at end of file diff --git a/web/client/src/sections/facility/style.less b/web/client/src/sections/facility/style.less new file mode 100644 index 0000000..75ecdb6 --- /dev/null +++ b/web/client/src/sections/facility/style.less @@ -0,0 +1,7 @@ +#example { + box-shadow: 3px 3px 2px black; +} + +#example:hover { + color: yellowgreen; +} \ No newline at end of file diff --git a/web/client/src/sections/install/containers/index.js b/web/client/src/sections/install/containers/index.js index 6f93c06..afbe8a0 100644 --- a/web/client/src/sections/install/containers/index.js +++ b/web/client/src/sections/install/containers/index.js @@ -2,4 +2,7 @@ import Roles from './roles'; import System from './system'; -export { Roles,System }; \ No newline at end of file +import Setup from './setup'; +import Set from './set'; + +export { Roles, System, Setup, Set }; \ No newline at end of file diff --git a/web/client/src/sections/install/containers/set.jsx b/web/client/src/sections/install/containers/set.jsx new file mode 100644 index 0000000..73f2875 --- /dev/null +++ b/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 ( + <> +
+ +
+ + ) +} + +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); diff --git a/web/client/src/sections/install/containers/setup.jsx b/web/client/src/sections/install/containers/setup.jsx new file mode 100644 index 0000000..340093e --- /dev/null +++ b/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 ( + <> +
+ +
+ + ) +} + +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); diff --git a/web/client/src/sections/install/nav-item.jsx b/web/client/src/sections/install/nav-item.jsx index fc55919..634ceaf 100644 --- a/web/client/src/sections/install/nav-item.jsx +++ b/web/client/src/sections/install/nav-item.jsx @@ -2,32 +2,48 @@ import React from 'react'; import { IconCode } from '@douyinfe/semi-icons'; export function getNavItem (user, dispatch) { - return ( - [ - { - itemKey: 'install', - text: '设置', - icon: , - items: [ - { - itemKey: 'authentication', - text: '鉴权管理', - icon: , - to: '/install/authentication/roles', - items: [{ - itemKey: 'roles', to: '/install/authentication/roles', text: '人员及角色' - }] - }, { - itemKey: 'mapping', - text: '关系映射', - icon: , - to: '/install/mapping/system', - items: [{ - itemKey: 'system', to: '/install/mapping/system', text: '系统映射' - }] - }, - ] - }, - ] - ); + return ( + [ + { + itemKey: 'install', + text: '设置', + icon: , + items: [ + { + itemKey: 'authentication', + text: '鉴权管理', + icon: , + to: '/install/authentication/roles', + items: [{ + itemKey: 'roles', to: '/install/authentication/roles', text: '人员及角色' + }] + }, { + itemKey: 'mapping', + text: '关系映射', + icon: , + to: '/install/mapping/system', + items: [{ + itemKey: 'system', to: '/install/mapping/system', text: '系统映射' + }] + }, { + itemKey: 'order ', + text: '工单管理', + icon: , + to: '/install/order /setup', + items: [{ + itemKey: 'setup', to: '/install/order/setup', text: '工单设置' + }] + }, { + itemKey: 'relation', + text: '容差管理', + icon: , + to: '/install/relation/set', + items: [{ + itemKey: 'set', to: '/install/relation/set', text: '容差设置' + }] + }, + ] + }, + ] + ); } \ No newline at end of file diff --git a/web/client/src/sections/install/routes.js b/web/client/src/sections/install/routes.js index f596dcc..99892f7 100644 --- a/web/client/src/sections/install/routes.js +++ b/web/client/src/sections/install/routes.js @@ -1,33 +1,56 @@ 'use strict'; -import { Roles,System } from './containers'; +import { Roles, System,Setup,Set } from './containers'; -export default [{ - type: 'inner', - route: { - path: '/install', - key: 'install', - breadcrumb: '设置', - // 不设置 component 则面包屑禁止跳转 - childRoutes: [{ - path: '/authentication', - key: 'authentication', - breadcrumb: '鉴权管理', - childRoutes:[{ - path: '/roles', - key: 'roles', - component: Roles, - breadcrumb: '人员及角色', - }] - },{ - path: '/mapping', - key: 'mapping', - breadcrumb: '关系映射', - childRoutes:[{ - path: '/system', - key: 'system', - component: System, - breadcrumb: '系统映射', - }] - }] - } -}]; \ No newline at end of file +export default [ + { + type: 'inner', + route: { + path: '/install', + key: 'install', + breadcrumb: '设置', + // 不设置 component 则面包屑禁止跳转 + childRoutes: [ + { + path: '/authentication', + key: 'authentication', + breadcrumb: '鉴权管理', + childRoutes: [{ + path: '/roles', + key: 'roles', + component: Roles, + breadcrumb: '人员及角色', + }] + }, { + path: '/mapping', + key: 'mapping', + breadcrumb: '关系映射', + childRoutes: [{ + path: '/system', + 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: '容差设置', + }] + } + ] + } + }]; \ No newline at end of file diff --git a/web/client/src/sections/problem/actions/problem.jsx b/web/client/src/sections/problem/actions/problem.jsx index cbb08c6..0512cfa 100644 --- a/web/client/src/sections/problem/actions/problem.jsx +++ b/web/client/src/sections/problem/actions/problem.jsx @@ -62,3 +62,27 @@ export function postApiConfirm (data) { //确认应用接口/元素错误信 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: '' } + }); +} \ No newline at end of file diff --git a/web/client/src/sections/problem/components/inspection.jsx b/web/client/src/sections/problem/components/inspection.jsx index 908d1a6..ddd6a7c 100644 --- a/web/client/src/sections/problem/components/inspection.jsx +++ b/web/client/src/sections/problem/components/inspection.jsx @@ -282,6 +282,9 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => {
{pictureData.notedTime ? 核验信息:{pictureData.notedPepUser} {moment(pictureData.notedTime).format("YYYY-MM-DD HH:MM:SS")} : ""} 截取时间:{moment(pictureData.createTime).format("YYYY-MM-DD HH:MM:SS")} +
{ - 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) + console.log(res.payload.data) + if (res.success) { + 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; 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; } diff --git a/web/client/src/sections/problem/containers/dataAlarm.jsx b/web/client/src/sections/problem/containers/dataAlarm.jsx index f73c2fe..faaea14 100644 --- a/web/client/src/sections/problem/containers/dataAlarm.jsx +++ b/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 [selected, setSelected] = useState([]) //表格被勾选项 - const tableType = { dataLnterrupt: 'dataLnterrupt', dataAbnormal: 'dataAbnormal', strategyHit: 'strategyHit', videoAbnormal: 'videoAbnormal', useAbnormal: 'useAbnormal', deviceAbnormal: 'deviceAbnormal' } const statistic = { dataLnterrupt: '数据中断统计', dataAbnormal: '数据异常统计', strategyHit: '策略命中统计', videoAbnormal: '视频异常统计', useAbnormal: '应用异常统计', deviceAbnormal: '设备异常统计' } @@ -162,27 +161,32 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { //表格设置信息 const tableList = { - dataLnterrupt: ['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'], - strategyHit: ['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'], - useAbnormal: ['projectName', 'appName', 'url', 'type', 'alarmContent', 'createTime', 'updateTime', 'confirm', 'confirmTime'], - deviceAbnormal: ['projectName', '2', '3', '19', 'alarmContent', '21', '5', '6', 'createTime', 'updateTime', 'confirm', 'confirmTime'], + dataLnterrupt: ['index', 'projectName', '2', '3', '4', '6', '9', 'createTime', '5', '10', 'updateTime', '11', 'confirm', 'confirmTime', '14'], + dataAbnormal: ['index', 'projectName', '2', '3', '4', 'alarmContent', '16', '9', 'createTime', '5', '10', 'updateTime', '11', 'confirm', 'confirmTime'], + strategyHit: ['index', 'projectName', '2', '3', '17', '18', 'createTime', '5', '10', 'updateTime', '11', 'confirm', 'confirmTime'], + videoAbnormal: ['index', 'projectName', '2', '3', '19', '20', '21', '22', '5', '6', 'createTime', 'updateTime', 'confirm', 'confirmTime'], + useAbnormal: ['index', 'projectName', 'appName', 'url', 'type', 'alarmContent', 'createTime', 'updateTime', 'confirm', 'confirmTime'], + deviceAbnormal: ['index', 'projectName', '2', '3', '19', 'alarmContent', '21', '5', '6', 'createTime', 'updateTime', 'confirm', 'confirmTime'], } //表格默认配置信息 const columns = { - dataLnterrupt: ['serialNumber', 'projectName', '2', '3', '4', '5', '6', 'createTime', 'updateTime',], - dataAbnormal: ['serialNumber', 'projectName', '2', '3', 'alarmContent', '5', '6', 'createTime', 'updateTime'], - strategyHit: ['serialNumber', 'projectName', '2', '3', '17', '5', '10', '11', 'updateTime'], - videoAbnormal: ['serialNumber', 'projectName', '2', '3', '21', '20', '5', 'createTime', 'updateTime'], - useAbnormal: ['serialNumber', 'appName', 'projectName', 'url', 'type', 'alarmContent', 'createTime', 'updateTime'], - deviceAbnormal: ['serialNumber', 'projectName', '2', '3', 'alarmContent', '19', '5', 'createTime', 'updateTime'], + dataLnterrupt: ['projectName', '2', '3', '4', '5', '6', 'createTime', 'updateTime',], + dataAbnormal: ['projectName', '2', '3', 'alarmContent', '5', '6', 'createTime', 'updateTime'], + strategyHit: ['projectName', '2', '3', '17', '5', '10', '11', 'updateTime'], + videoAbnormal: ['projectName', '2', '3', '21', '20', '5', 'createTime', 'updateTime'], + useAbnormal: ['appName', 'projectName', 'url', 'type', 'alarmContent', 'createTime', 'updateTime'], + deviceAbnormal: ['projectName', '2', '3', 'alarmContent', '19', '5', 'createTime', 'updateTime'], } //所有表格信息 const columnAll = [ + { + name: "序号", value: "index", render: (_, r, index) => { + return index + 1; + }, + }, { name: '问题编号', value: 'serialNumber', render: (_, r, index) => r.serialNumber }, { name: '项目名称', value: 'projectName', render: (_, r, index) => { @@ -257,9 +261,9 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { if (route) { let setup = tableList[route].map(v => columnAll.find(vv => v == vv.value)) - let data = ['serialNumber'] + let data = [] if (tableType[route] == 'dataAbnormal') { - data = ['serialNumber', '6'] + data = ['6'] data.splice(1, 0, ...arr) } else { data.splice(1, 0, ...arr) @@ -275,6 +279,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { } }) + TableDisplay.push({ title: '操作', dataIndex: 'text', diff --git a/web/client/src/sections/problem/nav-item.jsx b/web/client/src/sections/problem/nav-item.jsx index dc1d7d3..790f566 100644 --- a/web/client/src/sections/problem/nav-item.jsx +++ b/web/client/src/sections/problem/nav-item.jsx @@ -5,9 +5,11 @@ export function getNavItem (user, dispatch) { return ( [{ itemKey: 'problem', text: '问题', + icon: , items: [ { - itemKey: 'dataAlarm', text: '数据告警', to: '/problem/dataAlarm/dataLnterrupt', icon: , + itemKey: 'dataAlarm', text: '数据告警', to: '/problem/dataAlarm/dataLnterrupt', + icon: , items: [ { itemKey: 'dataLnterrupt', to: '/problem/dataAlarm/dataLnterrupt', 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: 'useAlarm', text: '应用告警', to: '/problem/useAlarm/useAbnormal', icon: , + itemKey: 'useAlarm', text: '应用告警', to: '/problem/useAlarm/useAbnormal', + icon: , items: [ { itemKey: 'useAbnormal', to: '/problem/useAlarm/useAbnormal', text: '应用异常' }, ] }, { - itemKey: 'deviceAlarm', text: '设备告警', to: '/problem/deviceAlarm/deviceAbnormal', icon: , + itemKey: 'deviceAlarm', text: '设备告警', to: '/problem/deviceAlarm/deviceAbnormal', + icon: , items: [ { itemKey: 'deviceAbnormal', to: '/problem/deviceAlarm/deviceAbnormal', text: '设备异常' }, ] diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js index d89a3ed..cf1948f 100644 --- a/web/client/src/utils/webapi.js +++ b/web/client/src/utils/webapi.js @@ -37,7 +37,11 @@ export const ApiTable = { getAlarmLnspection: 'alarm/application/inspection', //查询应用巡检信息 putAlarmApplicationNoted: 'alarm/application/noted', //预览状态 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 = { apiRoot: "/api/root",