Browse Source

异常&问题 路由跳转

dev
wenlele 2 years ago
parent
commit
ba2b7596bf
  1. 20
      api/app/lib/controllers/alarm/app.js
  2. 7
      web/client/src/sections/problem/components/tableData.jsx
  3. 6
      web/client/src/sections/problem/containers/dataAlarm.jsx

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

@ -2,7 +2,7 @@
const moment = require('moment') const moment = require('moment')
const { alarmConfirmLog } = require('./alarmConfirmLog'); const { alarmConfirmLog } = require('./alarmConfirmLog');
async function inspection(ctx) { async function inspection (ctx) {
// 巡查 // 巡查
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
@ -31,7 +31,7 @@ async function inspection(ctx) {
} }
} }
async function inspectionList(ctx) { async function inspectionList (ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { clickHouse } = ctx.app.fs const { clickHouse } = ctx.app.fs
@ -116,7 +116,7 @@ async function inspectionList(ctx) {
} }
} }
async function notedInspection(ctx) { async function notedInspection (ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { inspectionId } = ctx.request.body const { inspectionId } = ctx.request.body
@ -141,7 +141,7 @@ async function notedInspection(ctx) {
} }
} }
async function apiError(ctx) { async function apiError (ctx) {
try { try {
const { utils: { sendAppearToWeb } } = ctx.app.fs const { utils: { sendAppearToWeb } } = ctx.app.fs
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
@ -253,12 +253,12 @@ async function apiError(ctx) {
} }
} }
async function apiErrorList(ctx) { async function apiErrorList (ctx) {
try { try {
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 { keyword, errType, confirmState, sustainTimeStart, sustainTimeEnd, limit, page, pepProjectId } = ctx.query const { keyword, errType, confirmState, state, sustainTimeStart, sustainTimeEnd, limit, page, pepProjectId } = ctx.query
let pomsProject = await pomsProjectRange({ let pomsProject = await pomsProjectRange({
ctx, pepProjectId, ctx, pepProjectId,
@ -311,10 +311,10 @@ async function apiErrorList(ctx) {
if (errType) { if (errType) {
findOption.where.type = errType // element / apiError findOption.where.type = errType // element / apiError
} }
if (confirmState) { if (confirmState || state) {
if (confirmState == 'confirmd') { if (confirmState == 'confirmd' || state == 'histroy') {
findOption.where.confirmTime = { $ne: null } findOption.where.confirmTime = { $ne: null }
} else if (confirmState == 'unconfirmed') { } else if (confirmState == 'unconfirmed' || state == 'new') {
findOption.where.confirmTime = null findOption.where.confirmTime = null
} }
} }
@ -365,7 +365,7 @@ async function apiErrorList(ctx) {
} }
} }
async function confirmApiError(ctx) { async function confirmApiError (ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { confirm, appAlarmId = [], confirmPost } = ctx.request.body const { confirm, appAlarmId = [], confirmPost } = ctx.request.body

7
web/client/src/sections/problem/components/tableData.jsx

@ -14,9 +14,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
const { problem } = actions const { problem } = actions
const [count, setCount] = useState(0) // const [count, setCount] = useState(0) //
// const [search, setSearch] = useState({})
const [checkAll, setCheckAll] = useState(true) // const [checkAll, setCheckAll] = useState(true) //
const api = useRef(); const api = useRef();
const search = useRef({ const search = useRef({
state: '', keywordTarget: '', keyword: '', kindId: '', groupUnitId: '', state: '', keywordTarget: '', keyword: '', kindId: '', groupUnitId: '',
@ -123,7 +121,8 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
useEffect(() => { useEffect(() => {
if (location) { if (location) {
search.current = { ...search.current, ...location } search.current = { ...search.current, ...location, state: 'new' }
api.current?.setValues({...location, state: 'new'})
} }
if (route !== 'videoAbnormal' && route !== 'useAbnormal') { if (route !== 'videoAbnormal' && route !== 'useAbnormal') {
dispatch(problem.getAlarmDataGroup()).then((res) => { dispatch(problem.getAlarmDataGroup()).then((res) => {
@ -157,7 +156,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
} }
}, []) }, [])
console.log(location);
return ( return (
<> <>

6
web/client/src/sections/problem/containers/dataAlarm.jsx

@ -128,10 +128,10 @@ const DataAlarm = (props) => {
{ name: '元素异常', value: 'element' }] { name: '元素异常', value: 'element' }]
}, },
{ {
name: '异常状态', field: 'confirmState', name: '异常状态', field: 'state',
data: [ data: [
{ name: '当前', value: 'unconfirmed' }, { name: '当前', value: 'new' },
{ name: '历史', value: 'confirmd' }] { name: '历史', value: 'histroy' }]
}], }],
deviceAbnormal: [ // (deviceAbnormal) deviceAbnormal: [ // (deviceAbnormal)
{ name: '搜索', field: '1' }, { name: '搜索', field: '1' },

Loading…
Cancel
Save