forked from nsjcy/frontEnd/nsjcy

liuwh
2020-05-29 2fdc3dc444a2f8199866780205c0fa4b5ac40522
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import React from 'react';
 
import HeadView from '../view/HeadView';
import TableBtnView from '../view/TableBtnView';
import CommonSearchForm from '../view/CommonSearchForm';
import { Input, Button, DatePicker, Divider, message, Popconfirm, Select, Tooltip, Modal, Row, Col } from 'antd';
import moment from 'moment';
import bg_ns from '../asset/image/bg_ns.jpg';
import Fetch from '../fetch';
import TableView from '../view/TableView';
 
const Option = Select.Option;
 
export default class CriminalExecutionManager extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            list: [],
            formdata: {
                __key: Date.now(),
                page: 1,
                size: 10,
            },
            resetKey: Date.now(),
            loading: false,
            zIndex: '-1',
            savedate: {},
            display: 'block',
            fingerCode: ''
        };
    }
 
    componentDidMount() {
        document.title = '指纹对比';
        let _this = this;
        window.addEventListener('message', function (e) {
            console.log('反馈', e)
            console.log(e.data.submitstatus)
            console.log(_this.state.fingerCode)
            if (e.data.submitstatus && _this.state.fingerCode) {
                Fetch.criminalCompare()
                    .then(res => {
                        console.log("res", res)
                    });
            }
            if (e.data) {
                _this.setState({
                    ...e.data
                })
            }
        }, false);
        _this.iframeAddEventListener();
    }
 
 
    iframeAddEventListener = () => {
        let _this = this;
        this.iframeWin = this.refs.iframe && this.refs.iframe.contentWindow;
        this.refs.iframe && this.refs.iframe.addEventListener("load", function () {
            //代码能执行到这里说明已经载入成功完毕了
            //这里是回调函数
            _this.iframeWin.postMessage({
                fgData: true
            }, '*');
        }, false);
    }
 
    render() {
        const { iframeKey } = this.state;
        return (
            <div className="app-page">
                <HeadView history={this.props.history} />
                <div style={{ background: '#13A3DE', color: '#fff', height: '20vh', fontSize: '32px', textAlign: 'center', lineHeight: '20vh' }}>欢迎使用广州南沙检院刑事执行监督收集平台</div>
                <div style={{ display: "flex" }}>
                    <div style={{ width: "500px", flex: "3", margin: '24px' }}><img src={bg_ns} style={{ width: "100%" }} /></div>
                    <div style={{ flex: '2', margin: '24px' }}>
                        <iframe
                            key={iframeKey}
                            style={{ width: '100%', height: '550px' }}
                            onLoad={() => { }}
                            ref="iframe"
                            src='./fingerprint/bidui.html'
                            width="100%"
                            scrolling="no"
                            frameBorder="0"
                        />
                    </div>
                </div>
 
            </div>
        )
    }
}