From 04990562a326e33f6a9e05aa456981ecc62fedd5 Mon Sep 17 00:00:00 2001
From: Mr Ke <kelq@hugeinfo.com.cn>
Date: Wed, 27 May 2020 15:34:55 +0800
Subject: [PATCH] 1

---
 SunshineIns/src/page/CriminalExecution.jsx |   39 ++++++++++++++++++++-------------------
 1 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/SunshineIns/src/page/CriminalExecution.jsx b/SunshineIns/src/page/CriminalExecution.jsx
index fae5615..17fc789 100644
--- a/SunshineIns/src/page/CriminalExecution.jsx
+++ b/SunshineIns/src/page/CriminalExecution.jsx
@@ -64,17 +64,18 @@
                 size: 10,
             },
             resetKey: Date.now(),
-            loading: false
+            loading: false,
+            zIndex: '-1'
         };
     }
 
     componentDidMount() {
         document.title = '社会观护管理';
         window.addEventListener('message', function (e) {
-
+            console.log('反馈',e)
         }, false);
         console.log('this', this);
-        // this.iframeAddEventListener();
+        this.iframeAddEventListener();
     }
 
     setFormData = data => {
@@ -104,7 +105,9 @@
     showModal = (id) => {
         this.setState({
             visible: true,
+            zIndex: 1000
         });
+        this.sendMsg()
         // Fetch.socialCompanyDetail(id)
         //   .then(res => {
         //     this.setState({ savedate: res })
@@ -187,19 +190,25 @@
 
     iframeAddEventListener = () => {
         let _this = this;
-        this.iframeWin = this.refs.iframe.contentWindow;
+        this.iframeWin = this.refs.iframe && this.refs.iframe.contentWindow;
         this.refs.iframe && this.refs.iframe.addEventListener("load", function () {
             //代码能执行到这里说明已经载入成功完毕了
             //这里是回调函数
-            console.log('menu', window.localStorage.getItem('menu'));
             _this.iframeWin.postMessage({
                 fgData: false
             }, '*');
         }, false);
     }
 
+    sendMsg = () => {
+        this.iframeWin = this.refs.iframe && this.refs.iframe.contentWindow;
+        this.iframeWin.postMessage({
+            fgData: false
+        }, '*');
+    }
+
     render() {
-        const { data, resetKey, visible, loading, savedate, closeKey, formData } = this.state;
+        const { data, resetKey, visible, loading, savedate, closeKey, formData, zIndex } = this.state;
         return (
             <div className="app-page">
                 <HeadView history={this.props.history} />
@@ -226,22 +235,13 @@
                         ]} />
                     <TableView columns={this.renderColumns()} data={data} pageSize='10' size='default' loading={loading} />
                 </div>
-                {/* <div style={{ display: 'block' }}> */}
-                {/* <iframe
-                        style={{ width: '100%', height: '100%' }}
-                        onLoad={() => { }}
-                        ref="iframe"
-                        src='./fingerprint/指纹登记.html'
-                        width="100%"
-                        scrolling="no"
-                        frameBorder="0"
-                    /> */}
                 <Modal
+                    zIndex={zIndex}
                     key={closeKey}
                     confirmLoading={loading}
-                    visible={visible}
-                    title="公司信息"
-                    onCancel={() => { this.setState({ visible: false }) }}
+                    visible={true}
+                    title="指纹录入"
+                    onCancel={() => { this.setState({ visible: false, zIndex: '-1',  }) }}
                     bodyStyle={{ lineHeight: 4 }}
                     footer={null}
                     width={'80%'}
@@ -257,6 +257,7 @@
                         frameBorder="0"
                     />
                 </Modal>
+
                 {/* </div> */}
             </div>
         )

--
Gitblit v1.8.0