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/copy/fingerprint/js/main.js |    4 +
 SunshineIns/src/page/CriminalExecution.jsx  |   39 ++++++++++---------
 SunshineIns/src/copy/fingerprint/指纹登记.html  |   21 ++++++----
 3 files changed, 35 insertions(+), 29 deletions(-)

diff --git a/SunshineIns/src/copy/fingerprint/js/main.js b/SunshineIns/src/copy/fingerprint/js/main.js
index 4b8894a..33e7456 100644
--- a/SunshineIns/src/copy/fingerprint/js/main.js
+++ b/SunshineIns/src/copy/fingerprint/js/main.js
@@ -356,10 +356,12 @@
  * @create 2013-05-15 17:12:21 pm
  * @param ${pers_person_templateCount}:指纹数
  */
-function submitEvent()
+function submitEvent(event)
 {
+	console.log('event', event);
 	storeDataToHtml();
 	console.log('storeDataToHtml()', storeDataToHtml());
+	window.top.postMessage('message from iframe1');
 	showFPCount('指纹数:');
 	//closeWindow();
 	close();
diff --git "a/SunshineIns/src/copy/fingerprint/\346\214\207\347\272\271\347\231\273\350\256\260.html" "b/SunshineIns/src/copy/fingerprint/\346\214\207\347\272\271\347\231\273\350\256\260.html"
index dc35eec..3e4a4d8 100644
--- "a/SunshineIns/src/copy/fingerprint/\346\214\207\347\272\271\347\231\273\350\256\260.html"
+++ "b/SunshineIns/src/copy/fingerprint/\346\214\207\347\272\271\347\231\273\350\256\260.html"
@@ -12,7 +12,7 @@
 	<script type="text/javascript" src="js/dhtmlxCommon.js"></script>
 </head>
 
-<body onload="myfunction()">
+<body>
 	<form method="post" id="fpVerifyForm" name="fpVerifyForm" action="authLoginAction!login.do?fpLogin=fpLogin"
 		enctype="multipart/form-data" style="display: none">
 		<input type="hidden" id="verifyModel" name="verifyModel" /> <input type="hidden" id="verifyTemplate"
@@ -45,7 +45,7 @@
 			<input type="hidden" id="whetherModify" name="whetherModify" alt="" value="111" />
 
 			<div style="position: absolute; left: 310px; top: 325px; width: 70px; height: 28px;">
-				<button type="button" id="submitButtonId" name="makeSureName" onclick="submitEvent()"
+				<button type="button" id="submitButtonId" name="makeSureName" onclick="submitEvent(event)"
 					class="button-form">确定</button>
 				<!-- ${common_edit_ok}:确定 -->
 			</div>
@@ -59,13 +59,16 @@
 	</div>
 </body>
 <script>
-	window.addEventListener(
-		'message',
-		function (e) {
-			console.log(e);
-		},
-		false
-	);
+	window.onload = function () {
+		myfunction();
+		window.addEventListener(
+			'message',
+			function (e) {
+				console.log('接受', e);
+			},
+			false
+		);
+	}
 </script>
 
 </html>
\ No newline at end of file
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