Browse Source

巡检查询修改

dev
wenlele 3 years ago
parent
commit
b99e9ae574
  1. 4
      api/app/lib/controllers/alarm/app.js
  2. 8
      web/client/src/sections/problem/components/inspection.jsx

4
api/app/lib/controllers/alarm/app.js

@ -36,12 +36,12 @@ async function inspectionList (ctx) {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { clickHouse } = ctx.app.fs const { clickHouse } = ctx.app.fs
const { utils: { anxinStrucIdRange, pomsProjectRange } } = ctx.app.fs const { utils: { anxinStrucIdRange, pomsProjectRange } } = ctx.app.fs
const { timeStart, timeEnd, projectId, appId, noted } = ctx.query const { pepProjectId, timeStart, timeEnd, projectId, appId, noted } = ctx.query
let pomsProjectIds = null let pomsProjectIds = null
if (!projectId && !appId) { if (!projectId && !appId) {
let pomsProject = await pomsProjectRange({ let pomsProject = await pomsProjectRange({
ctx, ctx, pepProjectId
}) })
pomsProjectIds = pomsProject.map(p => p.id) pomsProjectIds = pomsProject.map(p => p.id)
} }

8
web/client/src/sections/problem/components/inspection.jsx

@ -11,7 +11,7 @@ import { log } from "ezuikit-js";
let projectScrollbar; let projectScrollbar;
let timer let timer
const Inspection = ({ dispatch, actions, user, route, statistic }) => { const Inspection = ({ dispatch, actions, user, route, statistic, pepProjectId }) => {
const { problem } = actions const { problem } = actions
const [selectProject, setSelectProject] = useState([]) // const [selectProject, setSelectProject] = useState([]) //
const [applyFilter, setApplyFilter] = useState([]) // const [applyFilter, setApplyFilter] = useState([]) //
@ -66,14 +66,14 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => {
dispatch(problem.getAlarmLnspection({ dispatch(problem.getAlarmLnspection({
timeStart: moment().day(moment().day() - 1).startOf('day').format('YYYY-MM-DD HH:mm:ss'), timeStart: moment().day(moment().day() - 1).startOf('day').format('YYYY-MM-DD HH:mm:ss'),
timeEnd: moment().endOf('day').format('YYYY-MM-DD HH:mm:ss') timeEnd: moment().endOf('day').format('YYYY-MM-DD HH:mm:ss')
, ...checkPatrol , ...checkPatrol, pepProjectId: pepProjectId
})).then((res) => { })).then((res) => {
if (res.success) { if (res.success) {
setPatrolAbnormal(res.payload.data) setPatrolAbnormal(res.payload.data)
setNotRead(res.payload.data.filter(v => !v.notedTime).length) setNotRead(res.payload.data.filter(v => !v.notedTime).length)
} }
}) })
}, [checkPatrol]) }, [checkPatrol, pepProjectId])
useEffect(() => { useEffect(() => {
@ -334,7 +334,7 @@ function mapStateToProps (state) {
return { return {
user: auth.user, user: auth.user,
actions: global.actions, actions: global.actions,
// global: global, pepProjectId: global.pepProjectId,
// members: members.data, // members: members.data,
}; };
} }

Loading…
Cancel
Save