Browse Source

BUG修改

dev
wenlele 2 years ago
parent
commit
d245dd2bc5
  1. 17
      api/app/lib/controllers/alarm/app.js
  2. BIN
      web/client/assets/images/problem/export.png
  3. 12
      web/client/src/sections/problem/components/inspection.jsx
  4. 2
      web/client/src/sections/problem/components/sideSheet.jsx
  5. 31
      web/client/src/sections/problem/components/tableData.jsx
  6. 8
      web/client/src/sections/problem/containers/dataAlarm.jsx

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

@ -239,14 +239,17 @@ async function apiErrorList (ctx) {
} }
} }
if (errType) { // if (errType) {
if (errType == 'element') { // if (errType == 'element') {
findOption.where.screenshot = { $ne: null } // findOption.where.screenshot = { $ne: null }
} else if (errType == 'timeout') { // } else if (errType == 'timeout') {
} else if (errType == 'apiError') { // } else if (errType == 'apiError') {
findOption.where.screenshot = null // findOption.where.screenshot = null
} // }
// }
if(errType){
findOption.where.type = errType
} }
if (confirmState) { if (confirmState) {
if (confirmState == 'confirmd') { if (confirmState == 'confirmd') {

BIN
web/client/assets/images/problem/export.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 983 B

After

Width:  |  Height:  |  Size: 1.3 KiB

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

@ -92,12 +92,12 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => {
return ( return (
<div style={{ width: '100%', backgroundColor: 'white', marginBottom: 20 }}> <div style={{ width: '100%', backgroundColor: 'white', marginBottom: 20 }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start' }}> <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', marginLeft: 10 }}>
<div style={{ width: 400, }}> <div style={{ width: 400, }}>
<span style={{ width: 3, height: 20, background: '#005ABD', display: 'inline-block', margin: "0 10px 0 20px" }}></span> <span style={{ width: 3, height: 20, background: '#005ABD', display: 'inline-block', margin: "0 10px 0 0px" }}></span>
<span style={{ fontSize: 24, fontFamily: 'YouSheBiaoTiHei', color: '#101531', marginRight: 10 }}>{statistic[route]}</span> <span style={{ fontSize: 24, fontFamily: 'YouSheBiaoTiHei', color: '#101531', marginRight: 10 }}>{statistic[route]}</span>
<span style={{ fontSize: 12 }}>APPLY SEMI-AUTOMATIC INSPECTION</span> <span style={{ fontSize: 12, color: 'rgb(150, 151, 153)' }}>APPLY SEMI-AUTOMATIC INSPECTION</span>
<div style={{ fontSize: 12 }}>仅保留48小时内的图片数据,每小时覆盖执行一次 <span style={{ fontWeight: 500, color: '#005ABD', fontSize: 12 }}>03专项2期阅共{notRead}</span></div> <div style={{ fontSize: 12, color: 'rgb(150, 151, 153)' }}>仅保留48小时内的图片数据,每小时覆盖执行一次 <span style={{ fontWeight: 500, color: '#005ABD', fontSize: 12 }}>阅共{notRead}</span></div>
</div> </div>
<div style={{ flex: 1, position: 'relative' }}> <div style={{ flex: 1, position: 'relative' }}>
<Form <Form
@ -176,7 +176,7 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => {
labelPosition="left" labelPosition="left"
field='noted' field='noted'
key='noted' key='noted'
style={{ width: 116, marginRight: 54, color: "#F9F9F9", marginBottom: 10 }} style={{ width: 116, marginRight: 60, color: "#F9F9F9", marginBottom: 10 }}
placeholder="全部" placeholder="全部"
showClear showClear
> >
@ -188,7 +188,7 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => {
); );
})} })}
</Form.Select> </Form.Select>
<Button theme="solid" type="primary" htmlType='submit' style={{ width: 65, height: 30, borderRadius: 3, position: 'absolute', right: 2, bottom: 12 }}>查询</Button> <Button theme="solid" type="primary" htmlType='submit' style={{ width: 65, height: 30, borderRadius: 3, position: 'absolute', right: 10, bottom: 12 }}>查询</Button>
</Form> </Form>
</div> </div>
</div> </div>

2
web/client/src/sections/problem/components/sideSheet.jsx

@ -120,7 +120,7 @@ function SideSheets ({ dispatch, actions, close }) {
title: "产生时间", title: "产生时间",
dataIndex: "Time", dataIndex: "Time",
rowKey: 'Time', rowKey: 'Time',
render: (_, r, index) => moment(r.time).format("YYYY-MM-DD HH:mm:ss") render: (_, r, index) => r.Time?moment(r.Time).format("YYYY-MM-DD HH:mm:ss"):""
}, },
] ]

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

@ -8,7 +8,7 @@ import { emit } from "superagent";
const TableData = ({ route,dispatch, actions, collectData, setSetup, exhibition, const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition,
selected, setSelected, setIfBulk, setConfirm, setGenre, query, setQuery }) => { selected, setSelected, setIfBulk, setConfirm, setGenre, query, setQuery }) => {
const { problem } = actions const { problem } = actions
@ -24,6 +24,7 @@ const TableData = ({ route,dispatch, actions, collectData, setSetup, exhibition,
dispatch(problem.getAlarmLnspectionApi({})).then((res) => { dispatch(problem.getAlarmLnspectionApi({})).then((res) => {
console.log(res.payload.data) console.log(res.payload.data)
if (res.success) { if (res.success) {
let typeData = { element: "元素异常", apiError: "接口报错 ", timeout: "加载超时" }
setCount(res.payload.data?.count || 0) setCount(res.payload.data?.count || 0)
let tableDatas = res.payload.data?.rows.map(v => ({ let tableDatas = res.payload.data?.rows.map(v => ({
key: v.id, key: v.id,
@ -36,7 +37,7 @@ const TableData = ({ route,dispatch, actions, collectData, setSetup, exhibition,
confirmTime: v.confirmTime ? moment(v.confirmTime).format("YYYY-MM-DD HH:mm:ss") : "", confirmTime: v.confirmTime ? moment(v.confirmTime).format("YYYY-MM-DD HH:mm:ss") : "",
alarmContent: v.alarmContent, alarmContent: v.alarmContent,
screenshot: v.screenshot, screenshot: v.screenshot,
type: v.type, type: v.type ? typeData[v.type] : "",
confirm: v.confirm, confirm: v.confirm,
})) }))
// console.log(tableDatas); // console.log(tableDatas);
@ -173,23 +174,23 @@ const TableData = ({ route,dispatch, actions, collectData, setSetup, exhibition,
marginRight: 10 marginRight: 10
}} }}
> >
<img title='导出' src="/assets/images/problem/export.png" style={{ width: 24, height: 24 }} /> <img title='导出' src="/assets/images/problem/export.png" style={{ width: 20 }} />
<img title='设置' src="/assets/images/problem/setup.png" style={{ width: 24, height: 24 }} onClick={() => setSetup(true)} /> <img title='设置' src="/assets/images/problem/setup.png" style={{ width: 20 }} onClick={() => setSetup(true)} />
<Button <Button
theme="solid" theme="solid"
type="primary" type="primary"
style={{ width: 65, height: 30, borderRadius: 3, }} style={{ width: 80, height: 32, borderRadius: 3, }}
onClick={() => { onClick={() => {
api.current.validate().then((v) => { api.current.validate().then((v) => {
console.log(v); // console.log(v);
console.log({ // console.log({
state: v.state, // state: v.state,
keywordTarget: v.keywordTarget, // keywordTarget: v.keywordTarget,
keyword: v.keyword, // keyword: v.keyword,
groupUnitId: v.groupUnitId, // groupUnitId: v.groupUnitId,
sustainTimeStart: v.time ? moment(v.time[0]).format("YYYY-MM-DD HH:mm:ss") : "", // sustainTimeStart: v.time ? moment(v.time[0]).format("YYYY-MM-DD HH:mm:ss") : "",
sustainTimeEnd: v.time ? moment(v.time[1]).format("YYYY-MM-DD HH:mm:ss") : "", // sustainTimeEnd: v.time ? moment(v.time[1]).format("YYYY-MM-DD HH:mm:ss") : "",
}); // });
setSearch({ setSearch({
state: v.state, state: v.state,
@ -266,7 +267,7 @@ const TableData = ({ route,dispatch, actions, collectData, setSetup, exhibition,
} }
setCheckAll(!checkAll) setCheckAll(!checkAll)
}} }}
style={{ width: 93, height: 24, borderRadius: '1px', border: '1px solid #0F7EFB', color: '#0F7EFB', fontWeight: 400, margin: '0 10px' }}> style={{ width: 93, height: 24, borderRadius: '1px', border: '1px solid #0F7EFB', color: '#0F7EFB',background:"#FFFFFF", fontWeight: 400, margin: '0 10px' }}>
{checkAll ? '全选' : "取消全选"} {checkAll ? '全选' : "取消全选"}
</Button> </Button>
<Button type='primary' theme='solid' onClick={() => (setIfBulk(true), setConfirm(true))} style={{ width: 93, height: 24, borderRadius: '1px', border: '1px solid #0F7EFB', color: '#FFFFFF', fontWeight: 400, }}>批量确认</Button> <Button type='primary' theme='solid' onClick={() => (setIfBulk(true), setConfirm(true))} style={{ width: 93, height: 24, borderRadius: '1px', border: '1px solid #0F7EFB', color: '#FFFFFF', fontWeight: 400, }}>批量确认</Button>

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

@ -145,7 +145,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
dataLnterrupt: ['index', 'projectName', 'StructureName', 'SourceName', 'AlarmGroupUnit', 'AlarmCodeName', 'createTime', 'AlarmContent', 'CurrentLevel', 'updateTime', 'detailCount', 'confirm', 'confirmTime',], dataLnterrupt: ['index', 'projectName', 'StructureName', 'SourceName', 'AlarmGroupUnit', 'AlarmCodeName', 'createTime', 'AlarmContent', 'CurrentLevel', 'updateTime', 'detailCount', 'confirm', 'confirmTime',],
dataAbnormal: ['index', 'projectName', 'StructureName', 'SourceName', 'type', 'alarmType', 'createTime', 'AlarmContent', 'CurrentLevel', 'updateTime', 'detailCount', 'confirm', 'confirmTime'], dataAbnormal: ['index', 'projectName', 'StructureName', 'SourceName', 'type', 'alarmType', 'createTime', 'AlarmContent', 'CurrentLevel', 'updateTime', 'detailCount', 'confirm', 'confirmTime'],
strategyHit: ['index', 'projectName', 'StructureName', 'SourceName', 'Strategy', 'State', 'createTime', 'AlarmContent', 'CurrentLevel', 'updateTime', 'detailCount', 'confirm', 'confirmTime'], strategyHit: ['index', 'projectName', 'StructureName', 'SourceName', 'Strategy', 'State', 'createTime', 'AlarmContent', 'CurrentLevel', 'updateTime', 'detailCount', 'confirm', 'confirmTime'],
videoAbnormal: ['index', 'projectName', 'StructureName', 'SourceName', '19', '20', '21', '22', 'AlarmContent', 'AlarmCodeName', 'createTime', 'updateTime', 'confirm', 'confirmTime'], videoAbnormal: ['index', 'projectName', 'StructureName', 'SourceName', '19', '20', '21', '22', 'AlarmContent', '111', 'createTime', 'updateTime', 'confirm', 'confirmTime','56115'],
useAbnormal: ['index', 'projectName', 'appName', 'url', 'type', 'alarmContent', 'createTime', 'updateTime', 'confirm', 'confirmTime'], useAbnormal: ['index', 'projectName', 'appName', 'url', 'type', 'alarmContent', 'createTime', 'updateTime', 'confirm', 'confirmTime'],
deviceAbnormal: ['index', 'projectName', 'StructureName', 'SourceName', '19', 'alarmContent', '21', 'AlarmContent', 'AlarmCodeName', 'createTime', 'updateTime', 'confirm', 'confirmTime'], deviceAbnormal: ['index', 'projectName', 'StructureName', 'SourceName', '19', 'alarmContent', '21', 'AlarmContent', 'AlarmCodeName', 'createTime', 'updateTime', 'confirm', 'confirmTime'],
} }
@ -250,9 +250,9 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
{ name: '接入方式', value: '22' }, { name: '接入方式', value: '22' },
{ name: '应用名称', value: 'appName' }, { name: '应用名称', value: 'appName' },
{ name: 'URL地址', value: 'url' }, { name: 'URL地址', value: 'url' },
{ {name: '异常类型', value: 'type'},
name: '异常类型', value: 'type' {name: '解决方案', value: '111'},
}, {name: '在离线', value: '56115'},
] ]

Loading…
Cancel
Save