运维服务中台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
2.0 KiB

import React, { useEffect, useState, useRef } from 'react';
import { connect } from 'react-redux';
import moment from 'moment';
import SimpleBar from 'simplebar-react';
import { SkeletonScreen, } from "$components";
import { IconSearch } from '@douyinfe/semi-icons';
import { Form, Button, Skeleton, Table, Pagination, SideSheet } from '@douyinfe/semi-ui';
import '../style.less'
function DataQueryCkeck (props) {
const { clientWidth, visible, onCancel, checkData, actions, dispatch, dataContinuityType } = props
const { data: sectionData } = actions
const [loading, setLoading] = useState(false);
const [htmlCode, setHtmlCode] = useState('');
useEffect(() => {
if (checkData.id) {
setLoading(true)
setHtmlCode('')
dispatch(sectionData.getContinuityDetail(checkData.id)).then(res => {
if (res.success) {
setHtmlCode(res.payload?.data?.file || '')
}
setLoading(false)
})
}
}, [checkData])
return (
<SideSheet
title={`${checkData?.alarmDataContinuityType?.name || dataContinuityType?.find(d => d.typeNumber == checkData.type)?.name} ${moment(checkData.createTime).format('YYYY-MM-DD HH:mm:ss')}`}
visible={visible}
onCancel={() => {
onCancel()
setHtmlCode('')
}}
width={clientWidth - 200}
>
<SimpleBar style={{ height: 'calc(100vh - 82px)', }} forceVisible="y" >
<Skeleton
loading={loading}
active={true}
placeholder={SkeletonScreen()}
>
<div dangerouslySetInnerHTML={{ __html: htmlCode }} />
</Skeleton>
</SimpleBar>
</SideSheet>
)
}
function mapStateToProps (state) {
const { auth, global, dataContinuityType } = state;
return {
user: auth.user,
actions: global.actions,
clientWidth: global.clientWidth,
dataContinuityType: dataContinuityType.data || [],
};
}
export default connect(mapStateToProps)(DataQueryCkeck);