Prechádzať zdrojové kódy

Merge branch 'newVersion6.0' of http://192.168.2.236:10080/zhouna/newICSS into newVersion6.0

luolei 4 rokov pred
rodič
commit
62c252ae5d

+ 31 - 5
src/components/PushData/index.jsx

@@ -1,26 +1,52 @@
 import React, { Component } from 'react';
 import style from './index.less';
 import arrowIcon from '@images/arrowIcon.png';
+import {pushPage2} from '@utils/config';
+import {dragBox} from '@utils/drag';
 
 class PushData extends Component{
     constructor(props){
         super(props);
         this.state = {
+            hashNum:0
         }
+        this.showPushData = this.showPushData.bind(this)
+        this.hidePushData = this.hidePushData.bind(this)
     }
+    showPushData(){
+        const {togglePushData} = this.props
+        setTimeout(function(){
+        dragBox('dragModalWrap','dragModalTitle','add')
+
+        })
+        togglePushData()
+    }
+    hidePushData(){
+        const {togglePushData} = this.props
+        dragBox('dragModalWrap','dragModalTitle','del')
+        togglePushData()
+    }
+    componentWillReceiveProps(next){
+        // if(next.update!=this.props.update){
+          this.setState({
+            hashNum:Math.random()
+          });
+        // }
+      }
 
     render(){
+        const {hashNum } = this.state
         const {mrId,planCode,showPushData,togglePushData } = this.props
-        // const url =`${pushPage}?mrId=${mrId}&planCode=${planCode}`;
+        const url =`${pushPage2}?mrId=${mrId}&planCode=${planCode}&data=${hashNum}`;
         return <div >
-            {!showPushData&&<div className={style['slideButton']} onClick={togglePushData}> 
+            {!showPushData&&<div className={style['slideButton']} onClick={this.showPushData}> 
                 朗通智能提醒 
                     <img class={style['arrowIcon']} src={arrowIcon} alt=""/>
               
             </div>}
-            {showPushData&&<div className={style['pushWrapper']}>
-                <div className={style['pushDataTitle']}>朗通智能提醒 <span className={style['pushDataHide']} onClick={togglePushData}>收起</span></div>
-                {/* <iframe id='embedPage'  src={url} frameborder="0"></iframe> */}
+            {showPushData&&<div id="dragModalWrap" className={style['pushWrapper']}>
+                <div id="dragModalTitle"  className={style['pushDataTitle']}>朗通智能提醒 <span className={style['pushDataHide']} onClick={this.hidePushData}>收起</span></div>
+                <iframe id='embedPage'  src={url} frameborder="0" width="400" height="560"></iframe>
               
             </div>}
         </div>

+ 10 - 6
src/components/PushData/index.less

@@ -1,16 +1,17 @@
 .slideButton{
-    position: fixed;
+    position: absolute;
     width:158px;
     height:40px;
     padding: 0 0 0 15px;
     line-height: 40px;
     bottom: 150px;
-    right: 20px;
+    right: 0px;
     font-size:16px;
     background: #7AC1DE;
     color: #fff;
     border-radius:100px 0px 0px 100px;
     cursor: pointer;
+    z-index: 31;
 }
 .arrowIcon{
     width: 22px;
@@ -19,14 +20,16 @@
     top: 8px;
 }
 .pushWrapper{
-    width:400px;
+    width:402px;
     height:600px;
     border-radius:4px;
     border: 1px solid #E6E6E6;
-    position: fixed;
-    bottom: 84px;
-    right: 30px;
+    position: absolute;
+    bottom: 70px;
+    right: 10px;
     background: #fff;
+    z-index: 31;
+
 }
 .pushDataTitle{
     height: 40px;
@@ -36,6 +39,7 @@
     font-size:16px;
     text-align: center;
     position: relative;
+    cursor:move
 }
 .pushDataHide{
     display: inline-block;

+ 6 - 2
src/containers/PushDataContainer.js

@@ -3,10 +3,14 @@ import { connect } from 'react-redux';
 import PushData from '@components/PushData';
 import { TOGGLE_PUSH_DATA } from '@store/types/homePage.js';
 function mapStateToProps(state){
+    console.log('state',state.print.mrInfo)
     const {showPushData } = state.homePage;
-    return {
-        showPushData:showPushData
+    const {mrInfo } = state.print;
 
+    return {
+        showPushData:showPushData,
+        mrId:mrInfo.mrId,
+        planCode:mrInfo.mode
     }
 }
 

+ 2 - 1
src/utils/config.js

@@ -12,5 +12,6 @@ module.exports={
     host,
     prefix:'',            //带权限验证的api
     pushPage:'http://192.168.2.241:5488/icssIndex.html',        //右侧推送页面的地址
-    imageUrlPrefix
+    imageUrlPrefix,
+    pushPage2:'http://localhost:8081/cdss.html',        //右侧推送页面的地址
 };