|
|
@ -8,7 +8,7 @@ import { emit } from "superagent"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition, |
|
|
|
const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition, pepProjectId, |
|
|
|
selected, setSelected, setIfBulk, setConfirm, setGenre, query, setQuery, tableData, setTableData }) => { |
|
|
|
const { problem } = actions |
|
|
|
|
|
|
@ -21,7 +21,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition |
|
|
|
useEffect(() => { |
|
|
|
switch (route) { |
|
|
|
case 'useAbnormal': |
|
|
|
dispatch(problem.getAlarmLnspectionApi({ ...search, pepProjectId: '' })).then((res) => { |
|
|
|
dispatch(problem.getAlarmLnspectionApi({ ...search, pepProjectId: pepProjectId })).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
let typeData = { element: "元素异常", apiError: "接口报错 ", timeout: "加载超时" } |
|
|
|
let tableDatas = res.payload.data?.rows.map(v => ({ |
|
|
@ -34,7 +34,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition |
|
|
|
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, |
|
|
|
alarmContent: v.alarmContent || '无', |
|
|
|
screenshot: v.screenshot, |
|
|
|
type: v.type ? typeData[v.type] : "", |
|
|
|
confirm: v.confirm, |
|
|
@ -54,7 +54,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
dispatch(problem.getAlarmVideoList({ ...search, pepProjectId: '' })).then((res) => { |
|
|
|
dispatch(problem.getAlarmVideoList({ ...search, pepProjectId: pepProjectId })).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
let tableDatas = res.payload.data?.map(v => ({ |
|
|
|
key: v.alarmId, |
|
|
@ -72,7 +72,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition |
|
|
|
resolve: v.resolve || [], |
|
|
|
cameraChannelNo: v.cameraChannelNo, |
|
|
|
cameraSerialNo: v.cameraSerialNo, |
|
|
|
cameraKindId: v.cameraKindId ? cameraKind?.find(v => v.value == v.cameraKindId)?.name : "", |
|
|
|
cameraKindId: v.cameraKindId ? cameraKind?.find(u => u.value == v.cameraKindId)?.name : "", |
|
|
|
venderName: v.venderName, |
|
|
|
platform: v.platform, |
|
|
|
confirm: v.confirmContent, |
|
|
@ -101,7 +101,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition |
|
|
|
}) |
|
|
|
setGenre(genreData) |
|
|
|
if (data && data[0]?.id) { |
|
|
|
dispatch(problem.getAlarmDataList({ ...query, ...search, groupId: data.map(v => v.id).join(), pepProjectId: '' })).then((res) => { |
|
|
|
dispatch(problem.getAlarmDataList({ ...query, ...search, groupId: data.map(v => v.id).join(), pepProjectId: pepProjectId })).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
setCount(res.payload.data?.count || 0) |
|
|
|
let tableDatas = res.payload.data?.rows?.map(v => ({ |
|
|
@ -111,10 +111,10 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition |
|
|
|
name: r.pepProject?.projectName, state: r.pepProject?.constructionStatus |
|
|
|
}))?.filter(c => c), |
|
|
|
createTime: v.StartTime ? moment(v.StartTime).format("YYYY-MM-DD HH:mm:ss") : "", |
|
|
|
updateTime: v.EndTime ? moment(v.EndTime).format("YYYY-MM-DD HH:mm:ss") : "无", |
|
|
|
updateTime: v.EndTime ? moment(v.EndTime).format("YYYY-MM-DD HH:mm:ss") : "", |
|
|
|
confirmTime: v.confirmedTime ? moment(v.confirmedTime).format("YYYY-MM-DD HH:mm:ss") : "", |
|
|
|
SourceName: v.SourceName, |
|
|
|
AlarmGroupUnit: v.AlarmGroupUnit ? genreData.find(r => r.value == v.AlarmGroupUnit)?.name : "", |
|
|
|
AlarmGroupUnit: v.AlarmGroupUnit ? genreData.find(r => r.value == v.AlarmGroupUnit)?.name : "无", |
|
|
|
Strategy: v.AlarmGroupUnit ? genreData.find(r => r.value == v.AlarmGroupUnit)?.name : "", |
|
|
|
type: route == 'deviceAbnormal' ? v.DeviceStatus == 0 ? "离线" : '' : v.AlarmGroupUnit ? genreData.find(r => r.value == v.AlarmGroupUnit)?.name : "", |
|
|
|
cameraKindId: v.AlarmGroupUnit ? genreData.find(r => r.value == v.AlarmGroupUnit)?.name : "", |
|
|
@ -137,7 +137,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
}, [query, search]) |
|
|
|
}, [query, search, pepProjectId]) |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
@ -348,11 +348,12 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition |
|
|
|
|
|
|
|
function mapStateToProps (state) { |
|
|
|
const { auth, global, members } = state; |
|
|
|
// console.log(auth.user); |
|
|
|
// console.log(global); |
|
|
|
return { |
|
|
|
user: auth.user, |
|
|
|
actions: global.actions, |
|
|
|
global: global, |
|
|
|
pepProjectId: global.pepProjectId, |
|
|
|
// members: members, |
|
|
|
}; |
|
|
|
} |
|
|
|