|
|
@ -21,31 +21,31 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition |
|
|
|
useEffect(() => { |
|
|
|
switch (route) { |
|
|
|
case 'useAbnormal': |
|
|
|
dispatch(problem.getAlarmLnspectionApi({})).then((res) => { |
|
|
|
console.log(res.payload.data) |
|
|
|
if (res.success) { |
|
|
|
let typeData = { element: "元素异常", apiError: "接口报错 ", timeout: "加载超时" } |
|
|
|
setCount(res.payload.data?.count || 0) |
|
|
|
let tableDatas = res.payload.data?.rows.map(v => ({ |
|
|
|
key: v.id, |
|
|
|
// serialNumber: v.serialNumber, |
|
|
|
projectName: v.app?.projectCorrelations?.map(r => (r.name ? { name: r.name, state: '自定义' } : { |
|
|
|
name: r.pepProject?.project_name, state: r.pepProject?.construction_status |
|
|
|
}))?.filter(c => c), |
|
|
|
appName: v.app?.name, |
|
|
|
url: v.app?.url, |
|
|
|
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") : "", |
|
|
|
confirmTime: v.confirmTime ? moment(v.confirmTime).format("YYYY-MM-DD HH:mm:ss") : "", |
|
|
|
alarmContent: v.alarmContent, |
|
|
|
screenshot: v.screenshot, |
|
|
|
type: v.type ? typeData[v.type] : "", |
|
|
|
confirm: v.confirm, |
|
|
|
})) |
|
|
|
console.log(tableDatas); |
|
|
|
setTableData(tableDatas) |
|
|
|
} |
|
|
|
}) |
|
|
|
// dispatch(problem.getAlarmLnspectionApi({})).then((res) => { |
|
|
|
// console.log(res.payload.data) |
|
|
|
// if (res.success) { |
|
|
|
// let typeData = { element: "元素异常", apiError: "接口报错 ", timeout: "加载超时" } |
|
|
|
// setCount(res.payload.data?.count || 0) |
|
|
|
// let tableDatas = res.payload.data?.rows.map(v => ({ |
|
|
|
// key: v.id, |
|
|
|
// // serialNumber: v.serialNumber, |
|
|
|
// projectName: v.app?.projectCorrelations?.map(r => (r.name ? { name: r.name, state: '自定义' } : { |
|
|
|
// name: r.pepProject?.project_name, state: r.pepProject?.construction_status |
|
|
|
// }))?.filter(c => c), |
|
|
|
// appName: v.app?.name, |
|
|
|
// url: v.app?.url, |
|
|
|
// 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") : "", |
|
|
|
// confirmTime: v.confirmTime ? moment(v.confirmTime).format("YYYY-MM-DD HH:mm:ss") : "", |
|
|
|
// alarmContent: v.alarmContent, |
|
|
|
// screenshot: v.screenshot, |
|
|
|
// type: v.type ? typeData[v.type] : "", |
|
|
|
// confirm: v.confirm, |
|
|
|
// })) |
|
|
|
// console.log(tableDatas); |
|
|
|
// setTableData(tableDatas) |
|
|
|
// } |
|
|
|
// }) |
|
|
|
break; |
|
|
|
case 'videoAbnormal': |
|
|
|
// dispatch(problem.getAlarmDataGroup()).then((res) => { |
|
|
|