diff --git a/web/client/assets/images/problem/dropDown.png b/web/client/assets/images/problem/dropDown.png new file mode 100644 index 0000000..aeefc21 Binary files /dev/null and b/web/client/assets/images/problem/dropDown.png differ diff --git a/web/client/assets/images/problem/export.png b/web/client/assets/images/problem/export.png new file mode 100644 index 0000000..21a75b5 Binary files /dev/null and b/web/client/assets/images/problem/export.png differ diff --git a/web/client/assets/images/problem/preview.png b/web/client/assets/images/problem/preview.png new file mode 100644 index 0000000..3222d01 Binary files /dev/null and b/web/client/assets/images/problem/preview.png differ diff --git a/web/client/assets/images/problem/pullUp.png b/web/client/assets/images/problem/pullUp.png new file mode 100644 index 0000000..c4457d3 Binary files /dev/null and b/web/client/assets/images/problem/pullUp.png differ diff --git a/web/client/src/sections/problem/components/inspection.jsx b/web/client/src/sections/problem/components/inspection.jsx index 6c67195..3ae8221 100644 --- a/web/client/src/sections/problem/components/inspection.jsx +++ b/web/client/src/sections/problem/components/inspection.jsx @@ -4,6 +4,8 @@ import { connect } from "react-redux"; import { Button, Form, Modal, Skeleton, Pagination, Table } from "@douyinfe/semi-ui"; import moment from "moment"; import PerfectScrollbar from "perfect-scrollbar"; +import './inspection.less' +import { log } from "ezuikit-js"; let projectScrollbar; @@ -12,12 +14,19 @@ const Inspection = ({ dispatch, actions, route, statistic }) => { const [selectProject, setSelectProject] = useState([]) //所选项目 const [applyFilter, setApplyFilter] = useState([]) //应用筛选 const [patrolAbnormal, setPatrolAbnormal] = useState([]) //巡检异常信息 + const [checkPatrol, setCheckPatrol] = useState({}) //巡检异常查询 + const [unfold, setUnfold] = useState(true) //展开收起 + const [picturePop, setPicturePop] = useState(false) //图片弹窗 + const [pictureId, setPictureId] = useState() //图片id + const [pictureData, setPictureData] = useState({}) //图片数据 const api = useRef(); + const unfoldApi = useRef(false); // console.log(actions); useEffect(() => { + dispatch(problem.getProjectPoms()).then((res) => { // console.log(res.payload.data); if (res.success) { @@ -25,67 +34,101 @@ const Inspection = ({ dispatch, actions, route, statistic }) => { 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 })) + v.apps.map(app => apply.push({ name: app.name, value: app.id })) }) setSelectProject(project) setApplyFilter(apply) } }) - dispatch(problem.getAlarmLnspection({})).then((res) => { + }, []) + + useEffect(() => { + if (projectScrollbar) projectScrollbar.destroy() + const domEquipment = document.getElementById("inspection"); + if (unfold) { + projectScrollbar = new PerfectScrollbar("#inspection", { + suppressScrollY: true, + }); + if (domEquipment && projectScrollbar) projectScrollbar.update() + } else { + projectScrollbar = new PerfectScrollbar("#inspection", { + suppressScrollX: true, + }) + if (domEquipment && projectScrollbar) projectScrollbar.update() + } + }) + + useEffect(() => { + dispatch(problem.getAlarmLnspection(checkPatrol)).then((res) => { console.log(res.payload.data); if (res.success) { setPatrolAbnormal(res.payload.data) } }) - - projectScrollbar = new PerfectScrollbar("#inspection", { - suppressScrollY: true, - }); - }, []) + }, [checkPatrol]); useEffect(() => { - - const domEquipment = document.getElementById("inspection"); - if (domEquipment && projectScrollbar) { - projectScrollbar.update(); + if (patrolAbnormal && pictureId) { + console.log(patrolAbnormal.find(v => v.id == pictureId)); + setPictureData(patrolAbnormal.find(v => v.id == pictureId)) } - }); + }, [pictureId]); return ( -