Browse Source

useAbnormal

dev
wenlele 2 years ago
parent
commit
eff01204d3
  1. 50
      web/client/src/sections/problem/components/tableData.jsx

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

@ -21,31 +21,31 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
useEffect(() => { useEffect(() => {
switch (route) { switch (route) {
case 'useAbnormal': case 'useAbnormal':
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: "加载超时" } // 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,
// serialNumber: v.serialNumber, // // serialNumber: v.serialNumber,
projectName: v.app?.projectCorrelations?.map(r => (r.name ? { name: r.name, state: '自定义' } : { // projectName: v.app?.projectCorrelations?.map(r => (r.name ? { name: r.name, state: '' } : {
name: r.pepProject?.project_name, state: r.pepProject?.construction_status // name: r.pepProject?.project_name, state: r.pepProject?.construction_status
}))?.filter(c => c), // }))?.filter(c => c),
appName: v.app?.name, // appName: v.app?.name,
url: v.app?.url, // url: v.app?.url,
createTime: v.createTime ? moment(v.createTime).format("YYYY-MM-DD HH:mm:ss") : "", // createTime: v.createTime ? moment(v.createTime).format("YYYY-MM-DD HH:mm:ss") : "",
updateTime: v.updateTime ? moment(v.updateTime).format("YYYY-MM-DD HH:mm:ss") : "", // updateTime: v.updateTime ? moment(v.updateTime).format("YYYY-MM-DD HH:mm:ss") : "",
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 ? typeData[v.type] : "", // type: v.type ? typeData[v.type] : "",
confirm: v.confirm, // confirm: v.confirm,
})) // }))
console.log(tableDatas); // console.log(tableDatas);
setTableData(tableDatas) // setTableData(tableDatas)
} // }
}) // })
break; break;
case 'videoAbnormal': case 'videoAbnormal':
// dispatch(problem.getAlarmDataGroup()).then((res) => { // dispatch(problem.getAlarmDataGroup()).then((res) => {

Loading…
Cancel
Save