diff --git a/web/client/src/sections/problem/actions/dataAlarm.jsx b/web/client/src/sections/problem/actions/dataAlarm.jsx deleted file mode 100644 index ff08638..0000000 --- a/web/client/src/sections/problem/actions/dataAlarm.jsx +++ /dev/null @@ -1,14 +0,0 @@ -'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' } -// }); -// } diff --git a/web/client/src/sections/problem/actions/index.js b/web/client/src/sections/problem/actions/index.js index 61e0e1a..48de4dd 100644 --- a/web/client/src/sections/problem/actions/index.js +++ b/web/client/src/sections/problem/actions/index.js @@ -1,7 +1,7 @@ 'use strict'; -import * as dataAlarm from './dataAlarm' +import * as problem from './problem' export default { - ...dataAlarm + ...problem } \ 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 new file mode 100644 index 0000000..8e20756 --- /dev/null +++ b/web/client/src/sections/problem/actions/problem.jsx @@ -0,0 +1,27 @@ +'use strict'; + +import { ApiTable, basicAction } from '$utils' + +export function getProjectPoms () { //获取已绑定项目 + return dispatch => basicAction({ + type: 'get', + dispatch: dispatch, + actionType: 'GET_PROJECT_POMS', + url: `${ApiTable.getProjectPoms}`, + msg: { error: '获取已绑定项目失败' }, + reducer: { name: '' } + }); +} + + +export function getAlarmLnspection (query) { //查询应用巡检信息 + return dispatch => basicAction({ + type: 'get', + dispatch: dispatch, + query, + actionType: 'GET_ALARM_LNICSPECTION', + url: `${ApiTable.getAlarmLnspection}`, + msg: { error: '查询应用巡检信息失败' }, + reducer: { name: '' } + }); +} diff --git a/web/client/src/sections/problem/components/inspection.jsx b/web/client/src/sections/problem/components/inspection.jsx index e7ef8c9..c7dadd4 100644 --- a/web/client/src/sections/problem/components/inspection.jsx +++ b/web/client/src/sections/problem/components/inspection.jsx @@ -1,22 +1,128 @@ import React, { useState, useEffect, useRef } from "react"; import { connect } from "react-redux"; -import { DatePicker } from "@douyinfe/semi-ui"; +import { Button, Form, Modal, Skeleton, Pagination, Table } from "@douyinfe/semi-ui"; + + +const Inspection = ({ dispatch, actions, route, statistic }) => { + const { problem } = actions + const [selectProject, setSelectProject] = useState([]) + const [applyFilter, setApplyFilter] = useState([]) + + const api = useRef(); + + // console.log(actions); + + useEffect(() => { + dispatch(problem.getProjectPoms()).then((res) => { + // console.log(res.payload.data); + if (res.success) { + let project = [] + let apply = [] + res.payload.data?.rows?.map(v => { + project.push({ name: v.pepProjectName || v.name || v.id, value: v.id }) + v.projectApps.map(app => apply.push({ name: app.name, value: app.id })) + }) + setSelectProject(project) + setApplyFilter(apply) + } + }) + dispatch(problem.getAlarmLnspection({})).then((res) => { + console.log(res.payload.data); + }) + }, []) -const Inspection = ({ dispatch, actions, route }) => { - console.log(route); return (
-
数据异常统计
-
开发中,敬请期待!
+
+ + {statistic[route]} + APPLY SEMI-AUTOMATIC INSPECTION +
仅保留48小时内的图片数据,每小时覆盖执行一次 03专项2期:已阅共123个
+
+
+
console.log(values)} + // onValueChange={values=>console.log(values)} + getFormApi={(formApi) => (api.current = formApi)} + layout="horizontal" + style={{ position: "relative", width: "100%", flex: 1 }} + > + console.log(v)} + /> + + {selectProject?.map((item) => { + return ( + + {item.name} + + ); + })} + + + {applyFilter?.map((item) => { + return ( + + {item.name} + + ); + })} + + + {[{ name: '已阅', value: 'noted' }, { name: '未阅', value: 'unnote' }].map((item) => { + return ( + + {item.name} + + ); + })} + + + +
+
+ +
-
) } @@ -26,7 +132,7 @@ function mapStateToProps (state) { const { auth, global, members } = state; return { // user: auth.user, - // actions: global.actions, + actions: global.actions, // global: global, // members: members.data, }; diff --git a/web/client/src/sections/problem/components/statistics.jsx b/web/client/src/sections/problem/components/statistics.jsx index 6a92d05..54c599a 100644 --- a/web/client/src/sections/problem/components/statistics.jsx +++ b/web/client/src/sections/problem/components/statistics.jsx @@ -3,15 +3,15 @@ import { connect } from "react-redux"; import { DatePicker } from "@douyinfe/semi-ui"; import Inspection from "./inspection"; -const Statistics = ({ dispatch, actions, route }) => { +const Statistics = ({ dispatch, actions, route ,statistic}) => { - console.log(route); + // console.log(route); return ( <>{route == 'useAbnormal' ? - : + :
-
数据异常统计
+
{statistic[route]}
{/* { const [exhibition, setExhibition] = useState([]); //单一表格展现信息 const tableType = { dataLnterrupt: 'dataLnterrupt', dataAbnormal: 'dataAbnormal', strategyHit: 'strategyHit', videoAbnormal: 'videoAbnormal', useAbnormal: 'useAbnormal', deviceAbnormal: 'deviceAbnormal' } + const statistic = { dataLnterrupt: '数据中断统计', dataAbnormal: '数据异常统计', strategyHit: '策略命中统计', videoAbnormal: '视频异常统计', useAbnormal: '应用异常统计', deviceAbnormal: '设备异常统计' } useEffect(() => { setRoute(match.url.substring(match.url.lastIndexOf("/") + 1, match.url.length)) - console.log(match.url) - console.log(tableType); + // console.log(match.url) + // console.log(tableType); }, []) @@ -203,7 +204,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { let arr = localStorage.getItem(name) ? JSON.parse(localStorage.getItem(name)) : []; - console.log(arr); + // console.log(arr); if (route) { let setup = tableList[route].map(v => columnAll.find(vv => v == vv.value)) @@ -216,7 +217,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { } - console.log(data) + // console.log(data) let TableDisplay = data.map(v => { let datas = columnAll.find(vv => v == vv.value) @@ -226,8 +227,8 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { }) - console.log(TableDisplay); - console.log(setup); + // console.log(TableDisplay); + // console.log(setup); setExhibition(TableDisplay) setTableSetup([{ list: setup }]) } @@ -264,6 +265,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {