showModal.jsx 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import React from "react";
  2. import { Spin, Button, Tabs, Table, message, Modal } from "antd";
  3. const ShowModal = React.createClass({
  4. getInitialState() {
  5. return {
  6. newVisible: true
  7. };
  8. },
  9. handleOk() {
  10. this.setState({
  11. newVisible: false
  12. });
  13. },
  14. render() {
  15. return this.state.newVisible ? (
  16. <Modal
  17. style={{ position: "relative" }}
  18. title="消息提醒"
  19. visible={this.props.ShowModal}
  20. closable={false}
  21. footer={null}
  22. >
  23. <div style={{ textAlign: "center" }}>
  24. 您有新消息尚未查看,请及时查看信息!
  25. <a href={"/admin/index.html#normal"}>点我查看信息</a>
  26. </div>
  27. <Button
  28. onClick={this.handleOk}
  29. type={"primary"}
  30. style={{
  31. position: "relative",
  32. left: "50%",
  33. transform: "translateX(-50%)",
  34. bottom: -10
  35. }}
  36. >
  37. 关闭
  38. </Button>
  39. </Modal>
  40. ) : null;
  41. }
  42. });
  43. export default ShowModal;