Files
zsxt_nbzs_h5/web-react/src/pages/system/noticeReceived/form.jsx
2021-07-06 16:39:58 +08:00

55 lines
1.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import React, { Component } from 'react'
import { Spin, Divider, Modal, Row } from 'antd'
import { api } from 'common/api'
import { AntIcon } from 'components'
export default class form extends Component {
state = {
detailVisible: false,
detailLoading: false,
detailData: {},
}
/**
* mount后回调
*/
componentDidMount() {
this.props.created && this.props.created(this)
}
async onOpenDetail(id) {
this.setState({ detailLoading: true, detailVisible: true })
const { data } = await api.sysNoticeDetail({ id })
this.setState({
detailLoading: false,
detailData: data,
})
}
render() {
const { detailLoading, detailVisible, detailData } = this.state
return (
<Modal
width={1000}
footer={false}
visible={detailVisible}
onCancel={() => this.setState({ detailVisible: false, detailData: {} })}
>
<Spin spinning={detailLoading} indicator={<AntIcon type="loading" />}>
<div className="h3 mt-lg">{detailData.title}</div>
<Divider />
<div
className="pt-lg pb-lg"
dangerouslySetInnerHTML={{ __html: detailData.content }}
></div>
<Divider />
<Row justify="space-between" className="text-gray">
<span>发布人{detailData.publicUserName}</span>
<span>发布时间{detailData.publicTime} </span>
</Row>
</Spin>
</Modal>
)
}
}