巴林闲侠
2 years ago
8 changed files with 419 additions and 80 deletions
@ -0,0 +1,36 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
import { ApiTable, basicAction } from '$utils' |
||||
|
|
||||
|
export function getContinuityType () { |
||||
|
return dispatch => basicAction({ |
||||
|
type: 'get', |
||||
|
dispatch: dispatch, |
||||
|
actionType: 'GET_DATA_CONTINUITY_TYPE', |
||||
|
url: `${ApiTable.getDataContinuityType}`, |
||||
|
msg: { error: '获取数据类型失败' }, |
||||
|
reducer: { name: 'dataContinuityType' } |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
export function getContinuityList (query) { |
||||
|
return dispatch => basicAction({ |
||||
|
type: 'get', |
||||
|
query: query, |
||||
|
dispatch: dispatch, |
||||
|
actionType: 'GET_DATA_CONTINUITY', |
||||
|
url: `${ApiTable.getDataContinuity}`, |
||||
|
msg: { error: '获取数据列表失败' }, |
||||
|
reducer: { name: 'dataContinuity' } |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
export function getContinuityDetail (continuityId) { |
||||
|
return dispatch => basicAction({ |
||||
|
type: 'get', |
||||
|
dispatch: dispatch, |
||||
|
actionType: 'GET_DATA_CONTINUITY_DETAIL', |
||||
|
url: `${ApiTable.getDataContinuityDetail.replace('{continuityId}', continuityId)}`, |
||||
|
msg: { error: '获取数据详情失败' }, |
||||
|
}); |
||||
|
} |
@ -1,7 +1,7 @@ |
|||||
'use strict'; |
'use strict'; |
||||
|
|
||||
import * as console from './console' |
import * as dataQuery from './dataQuery' |
||||
|
|
||||
export default { |
export default { |
||||
...console |
...dataQuery |
||||
} |
} |
@ -0,0 +1,61 @@ |
|||||
|
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 } = 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} ${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 } = state; |
||||
|
return { |
||||
|
user: auth.user, |
||||
|
actions: global.actions, |
||||
|
clientWidth: global.clientWidth, |
||||
|
}; |
||||
|
} |
||||
|
|
||||
|
export default connect(mapStateToProps)(DataQueryCkeck); |
Loading…
Reference in new issue