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 (