Browse Source

异常&问题 路由跳转

dev
wenlele 2 years ago
parent
commit
ba2b7596bf
  1. 8
      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

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

@ -258,7 +258,7 @@ async function apiErrorList(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 { 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
} }
} }

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