wenlele
2 years ago
12 changed files with 186 additions and 3 deletions
@ -0,0 +1,14 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
import { ApiTable ,basicAction} from '$utils' |
||||
|
|
||||
|
// export function getMembers (orgId) { |
||||
|
// return dispatch => basicAction({ |
||||
|
// type: 'get', |
||||
|
// dispatch: dispatch, |
||||
|
// actionType: 'GET_MEMBERS', |
||||
|
// url: `${ApiTable.getEnterprisesMembers.replace('{enterpriseId}', orgId)}`, |
||||
|
// msg: { error: '获取用户列表失败' }, |
||||
|
// reducer: { name: 'members' } |
||||
|
// }); |
||||
|
// } |
@ -0,0 +1,7 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
import * as dataAlarm from './dataAlarm' |
||||
|
|
||||
|
export default { |
||||
|
...dataAlarm |
||||
|
} |
@ -0,0 +1,35 @@ |
|||||
|
import React, { useEffect, useState } from 'react'; |
||||
|
import { connect } from 'react-redux'; |
||||
|
import { IconAlertCircle } from '@douyinfe/semi-icons'; |
||||
|
import '../style.less' |
||||
|
|
||||
|
const DataAlarm = (props) => { |
||||
|
const { dispatch, actions, user, loading, socket } = props |
||||
|
const [abnormalLenght, setAbnormalLenght] = useState(1) //异常数量 |
||||
|
|
||||
|
useEffect(() => { |
||||
|
console.log(props); |
||||
|
}, []) |
||||
|
|
||||
|
return ( |
||||
|
<> |
||||
|
<div> |
||||
|
{abnormalLenght > 0 ? <IconAlertCircle /> : ""} |
||||
|
</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)(DataAlarm); |
@ -0,0 +1,5 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
import DataAlarm from './dataAlarm'; |
||||
|
|
||||
|
export { DataAlarm }; |
@ -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: 'problem', |
||||
|
name: '书写示例', |
||||
|
reducers: reducers, |
||||
|
routes: routes, |
||||
|
actions: actions, |
||||
|
getNavItem: getNavItem |
||||
|
}; |
@ -0,0 +1,33 @@ |
|||||
|
import React from 'react'; |
||||
|
import { IconCode } from '@douyinfe/semi-icons'; |
||||
|
|
||||
|
export function getNavItem (user, dispatch) { |
||||
|
return ( |
||||
|
[{ |
||||
|
itemKey: 'problem', text: '问题', |
||||
|
items: [ |
||||
|
{ |
||||
|
itemKey: 'dataAlarm', text: '数据告警', icon: <iconpark-icon style={{ width: 20, height: 20 }} name="she-1"></iconpark-icon>, |
||||
|
items: [ |
||||
|
{ itemKey: 'dataLnterrupt', to: '/problem/dataAlarm/dataLnterrupt', text: '数据中断' }, |
||||
|
{ itemKey: 'dataAbnormal', to: '/problem/dataAlarm/dataAbnormal', text: '数据异常' }, |
||||
|
{ itemKey: 'strategyHit', to: '/problem/dataAlarm/strategyHit', text: '策略命中' }, |
||||
|
{ itemKey: 'videoAbnormal', to: '/problem/dataAlarm/videoAbnormal', text: '视频异常' }, |
||||
|
] |
||||
|
}, { |
||||
|
itemKey: 'useAlarm', text: '应用告警', icon: <iconpark-icon style={{ width: 20, height: 20 }} name="she-1"></iconpark-icon>, |
||||
|
items: [ |
||||
|
{ itemKey: 'useAbnormal', to: '/problem/useAlarm/useAbnormal', text: '应用异常' }, |
||||
|
] |
||||
|
}, { |
||||
|
itemKey: 'deviceAlarm', text: '设备告警', icon: <iconpark-icon style={{ width: 20, height: 20 }} name="she-1"></iconpark-icon>, |
||||
|
items: [ |
||||
|
{ itemKey: 'deviceAbnormal', to: '/problem/deviceAlarm/deviceAbnormal', text: '设备异常' }, |
||||
|
] |
||||
|
}, |
||||
|
] |
||||
|
}, |
||||
|
|
||||
|
] |
||||
|
); |
||||
|
} |
@ -0,0 +1,5 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
export default { |
||||
|
|
||||
|
} |
@ -0,0 +1,61 @@ |
|||||
|
'use strict'; |
||||
|
import { DataAlarm, } from './containers'; |
||||
|
|
||||
|
export default [{ |
||||
|
type: 'inner', |
||||
|
route: { |
||||
|
path: '/problem', |
||||
|
key: 'problem', |
||||
|
breadcrumb: '问题', |
||||
|
// 不设置 component 则面包屑禁止跳转
|
||||
|
childRoutes: [{ |
||||
|
path: '/dataAlarm', |
||||
|
key: 'dataAlarm', |
||||
|
breadcrumb: '数据告警', |
||||
|
// 不设置 component 则面包屑禁止跳转
|
||||
|
childRoutes: [{ |
||||
|
path: '/dataLnterrupt', |
||||
|
key: 'dataLnterrupt', |
||||
|
breadcrumb: '数据中断', |
||||
|
component: DataAlarm, |
||||
|
}, { |
||||
|
path: '/dataAbnormal', |
||||
|
key: 'dataAbnormal', |
||||
|
breadcrumb: '数据异常', |
||||
|
component: DataAlarm, |
||||
|
}, { |
||||
|
path: '/strategyHit', |
||||
|
key: 'strategyHit', |
||||
|
breadcrumb: '策略命中', |
||||
|
component: DataAlarm, |
||||
|
}, { |
||||
|
path: '/videoAbnormal', |
||||
|
key: 'videoAbnormal', |
||||
|
breadcrumb: '视频异常', |
||||
|
component: DataAlarm, |
||||
|
}] |
||||
|
}, { |
||||
|
path: '/useAlarm', |
||||
|
key: 'useAlarm', |
||||
|
breadcrumb: '应用告警', |
||||
|
// 不设置 component 则面包屑禁止跳转
|
||||
|
childRoutes: [{ |
||||
|
path: '/useAbnormal', |
||||
|
key: 'useAbnormal', |
||||
|
breadcrumb: '应用异常', |
||||
|
component: DataAlarm, |
||||
|
},] |
||||
|
}, { |
||||
|
path: '/deviceAlarm', |
||||
|
key: 'deviceAlarm', |
||||
|
breadcrumb: '设备告警', |
||||
|
// 不设置 component 则面包屑禁止跳转
|
||||
|
childRoutes: [{ |
||||
|
path: '/deviceAbnormal', |
||||
|
key: 'deviceAbnormal', |
||||
|
breadcrumb: '设备异常', |
||||
|
component: DataAlarm, |
||||
|
},] |
||||
|
}] |
||||
|
} |
||||
|
}]; |
@ -0,0 +1,7 @@ |
|||||
|
#example { |
||||
|
box-shadow: 3px 3px 2px black; |
||||
|
} |
||||
|
|
||||
|
#example:hover { |
||||
|
color: yellowgreen; |
||||
|
} |
Loading…
Reference in new issue