|
|
@ -37,8 +37,6 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb |
|
|
|
const [videoModal, setVideoModal] = useState(false) //视频播放弹框 |
|
|
|
const [videoData, setVideoData] = useState({}) //视频播放参数 |
|
|
|
const [videoToken, setVideoToken] = useState() //视频token |
|
|
|
const [alarmToConfirm, setAlarmToConfirm] = useState(null) //告警确认 |
|
|
|
|
|
|
|
|
|
|
|
const TextAreaApi = useRef('') |
|
|
|
|
|
|
@ -306,15 +304,14 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb |
|
|
|
name: '操作', sort: 25, value: 'text', render: (_, r, index) => { |
|
|
|
return <div style={{ width: 195 }}> |
|
|
|
{r.State < 3 || route && ['videoAbnormal', 'useAbnormal'].includes(route) && !r.confirmTime ? |
|
|
|
<Button theme='borderless' style={{ width: 65 }} onClick={() => { |
|
|
|
setConfirm(true) |
|
|
|
setSelected([r.key]) |
|
|
|
setAlarmToConfirm(r) |
|
|
|
}}>确认</Button> |
|
|
|
: r.State == 3 || r.autoRestore || r.confirmAuto ? |
|
|
|
<Button theme='borderless' style={{ width: 65 }} onClick={() => { |
|
|
|
setConfirm(true) |
|
|
|
setSelected([r.key]) |
|
|
|
}}>确认</Button> |
|
|
|
: r.State == 3 || r.autoRestore || r.confirmAuto ? |
|
|
|
<Button theme='borderless' style={{ width: 65 }} disabled>自动恢复</Button> : |
|
|
|
<Button theme='borderless' style={{ width: 65 }} disabled>已确认</Button> |
|
|
|
} |
|
|
|
<Button theme='borderless' style={{ width: 65 }} disabled>已确认</Button> |
|
|
|
} |
|
|
|
{route && ['dataLnterrupt', 'dataAbnormal', 'strategyHit', 'deviceAbnormal'].includes(route) ? <> |
|
|
|
<Button theme='borderless' style={{ width: 65 }} disabled>已派单</Button> |
|
|
|
{route == 'deviceAbnormal' ? "" : <Button theme='borderless' style={{ width: 65 }} onClick={() => { |
|
|
@ -384,18 +381,24 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb |
|
|
|
|
|
|
|
// console.log(selected); |
|
|
|
|
|
|
|
const getAlarmConfirmItem = () => { |
|
|
|
let source = route == 'useAbnormal' ? alarmToConfirm.appName : alarmToConfirm.SourceName; |
|
|
|
let type = route == 'useAbnormal' ? alarmToConfirm.type : route == 'videoAbnormal' ? alarmToConfirm.AlarmContent : alarmToConfirm.AlarmGroupUnit; |
|
|
|
return { |
|
|
|
pepUserId: user.pomsUserInfo.pepUserId, |
|
|
|
projectCorrelationIds: alarmToConfirm?.projectName?.map(p => p.id), |
|
|
|
alarmInfo: { |
|
|
|
id: alarmToConfirm.key, |
|
|
|
source: source,//告警源 |
|
|
|
type: type,//异常类型 |
|
|
|
const getAlarmConfirmItems = () => { |
|
|
|
let confirmItems = []; |
|
|
|
selected.map(s => { |
|
|
|
let alarmInfo = tableData.find(td => td.key == s); |
|
|
|
let source = route == 'useAbnormal' ? alarmInfo.appName : alarmInfo.SourceName; |
|
|
|
let type = route == 'useAbnormal' ? alarmInfo.type : route == 'videoAbnormal' ? alarmInfo.AlarmContent : alarmInfo.AlarmGroupUnit; |
|
|
|
let item = { |
|
|
|
pepUserId: user.pomsUserInfo.pepUserId, |
|
|
|
projectCorrelationIds: alarmInfo?.projectName?.map(p => p.id), |
|
|
|
alarmInfo: { |
|
|
|
id: alarmInfo.key, |
|
|
|
source: source,//告警源 |
|
|
|
type: type,//异常类型 |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
confirmItems.push(item); |
|
|
|
}) |
|
|
|
return confirmItems; |
|
|
|
} |
|
|
|
|
|
|
|
return ( |
|
|
@ -457,7 +460,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb |
|
|
|
width={600} |
|
|
|
onCancel={() => setConfirm(false)} |
|
|
|
onOk={() => { |
|
|
|
let confirmPost = getAlarmConfirmItem(); |
|
|
|
let confirmPost = getAlarmConfirmItems(); |
|
|
|
if (route == 'useAbnormal') { |
|
|
|
TextAreaApi.current.validate().then((v) => { |
|
|
|
dispatch(problem.postApiConfirm({ appAlarmId: selected, confirm: content, confirmPost })).then(res => { |
|
|
|