Browse Source

合并new1
Squashed commit of the following:

commit e3ba8dd3de2b65773fe5b23f21c53828f524ee66
Author: zhouna <zhouna@zjlantone.com>
Date: Wed Jan 23 17:22:01 2019 +0800

修改请求地址

commit 461e1db27e39068ca7126b0ad04e756c31f74d74
Merge: adc853a 45b1158
Author: zhouna <zhouna@zjlantone.com>
Date: Wed Jan 23 16:53:11 2019 +0800

Merge remote-tracking branch 'origin/dev/otherHis' into dev/new1

# Conflicts:
# src/utils/config.js

commit 45b1158b6f5a13eb0b02560087f3b936f6449089
Author: zhouna <zhouna@zjlantone.com>
Date: Wed Jan 23 15:58:40 2019 +0800

其他史高血压选中bug修改

commit b7259ea8586061ab0b2757add5dc4f06a66ebccd
Author: zhouna <zhouna@zjlantone.com>
Date: Wed Jan 23 14:51:07 2019 +0800

文本模式其他史不受主诉为空限制,切换模式后其他史重新获取

commit 68058110e041e72b8c95979a4fd23e690912746b
Author: zhouna <zhouna@zjlantone.com>
Date: Tue Jan 22 20:43:26 2019 +0800

遮罩统一0.6透明度

commit 625ca181024a268f16f32eb2773ea337cf62db43
Author: zhouna <zhouna@zjlantone.com>
Date: Tue Jan 22 20:34:59 2019 +0800

透明度ie8

commit b2e679a35e0ff4831f689758eb14521541f967e2
Author: zhouna <zhouna@zjlantone.com>
Date: Tue Jan 22 16:50:45 2019 +0800

导入ie8暂时先灰掉

commit b286d0a89df15fcd3a92bce1e6828a050c1f085e
Author: zhouna <zhouna@zjlantone.com>
Date: Tue Jan 22 16:23:57 2019 +0800

文本模式ie8onInput存值,搜索下拉项样式

commit 5e7834e1ff17257abdf408037031c0d926d22bfc
Author: zhouna <zhouna@zjlantone.com>
Date: Tue Jan 22 15:02:18 2019 +0800

ie8的onInput代替函数

liucf 6 years ago
parent
commit
1906db381d

+ 2 - 0
src/common/components/CheckBox/Select/index.less

@@ -37,6 +37,8 @@
   .nospecialDis{
     color:#000000;
     opacity: 0.3;
+    filter:alpha(opacity=30);
+    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=30);";
     cursor: auto;
   }
 }

+ 2 - 0
src/common/components/CheckBox/index.less

@@ -63,6 +63,8 @@
 .nospecialDis{
   color:#000000;
   opacity: 0.3;
+  filter:alpha(opacity=30);
+  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=30);";
   cursor: auto;
 }
 .firstSel{

+ 4 - 0
src/common/components/ConfirmModal/index.less

@@ -65,6 +65,8 @@
 
 .modal-operator-close:active, .modal-operator-confirm:active {
     opacity: .6;
+    filter:alpha(opacity=60);
+    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=60);";
     transition: opacity .3s;
 }
 
@@ -76,5 +78,7 @@
     bottom: 0;
     background: #000;
     opacity: .6;
+    filter:alpha(opacity=60);
+    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=60);";
     z-index: 9998;
 }

+ 8 - 1
src/common/components/EditableSpan/index.jsx

@@ -1,8 +1,10 @@
 import React,{Component} from 'react';
 import style from './index.less';
 import config from "@config/index";
-import {filterArr,handleEnter} from '@utils/tools.js';
+import {filterArr,handleEnter,isIE} from '@utils/tools.js';
 import Notify from '../Notify/index.js';
+
+import $ from 'jquery';
 /*****
  * author:zn@2018-12-10
  * 自由文本输入组件
@@ -158,6 +160,11 @@ class EditableSpan extends Component{
     if(value){
       this.$span.current.innerText = value||'';
     }
+    if(isIE()){
+      $(this.$span.current).onIe8Input(function(e){
+        this.onChange(e)
+      },this);
+    }
   }
 
   render() {

+ 3 - 2
src/common/components/Loading/index.less

@@ -9,8 +9,9 @@
     width: 100%;
     height: 100%;
     background: #333;
-    opacity: .4;
-    filter:alpha(opacity=40);
+    opacity: .6;
+    filter:alpha(opacity=60);
+    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=60);";
   }
   .info{
     position: absolute;

+ 2 - 0
src/common/components/MixCheckBox/index.less

@@ -52,6 +52,8 @@
 }
 .disabled{
   opacity: 0.3;
+  filter:alpha(opacity=30);
+  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=30);";
 }
 .multiple-tab{
   // width: 200px;

+ 3 - 3
src/common/components/Modal/index.less

@@ -9,10 +9,10 @@
     left: 0;
     z-index: 1001;
     background-color: #272c36;
-    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"; /*IE8*/  
+    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; /*IE8*/
     // filter:progid:DXImageTransform.Microsoft.Alpha(opacity=70);//兼容ie8及以下/
-    filter: alpha(opacity=30);  /*IE5、IE5.5、IE6、IE7*/  
-    opacity: .3;
+    filter: alpha(opacity=60);  /*IE5、IE5.5、IE6、IE7*/
+    opacity: .6;
 }
 .content {
     background: #fff;

+ 2 - 0
src/common/components/Normal/index.less

@@ -19,4 +19,6 @@
 }
 .disabled{
   opacity: 0.3;
+  filter:alpha(opacity=30);
+  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=30);";
 }

+ 2 - 0
src/common/components/RadioB/index.less

@@ -18,6 +18,8 @@
   }
   .disabled{
     opacity: 0.3;
+    filter:alpha(opacity=30);
+    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=30);";
   }
 }
 .selected{

+ 9 - 2
src/common/components/Textarea/index.jsx

@@ -3,6 +3,8 @@ import style from "./index.less";
 import Notify from '../Notify';
 import config from '@config/index';
 import {setLastPosition} from '@common/js/util';
+import {isIE} from '@utils/tools.js';
+import $ from "jquery";
 
 class Textarea extends Component {
   constructor(props) {
@@ -46,10 +48,10 @@ class Textarea extends Component {
       })
       return;
     }
-    if(boxMark=='3'&&!hasMain){
+    /*if(boxMark=='3'&&!hasMain){
       e.target.innerText = '';
       return;
-    }
+    }*/
     this.setState({
       inpText:text,
       overFlag:false
@@ -84,6 +86,11 @@ class Textarea extends Component {
     if(value){
       this.$dom.current.innerText = value||'';
     }
+    if(isIE()){
+      $(this.$dom.current).onIe8Input(function(e){
+        this.handleInput(e)
+      },this);
+    }
   }
   render() {
     const { title } = this.props;

+ 3 - 1
src/components/Banner/index.less

@@ -42,7 +42,9 @@
         right: 0;
         bottom: 0;
         background: #000;
-        opacity: 0.3;
+        opacity: 0.6;
+        filter:alpha(opacity=60);
+        -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=60);";
         z-index: 2000;
       }
       .content {

+ 3 - 1
src/components/CopyRight/index.less

@@ -41,7 +41,9 @@
       right: 0;
       bottom:0;
       background: #000;
-      opacity: 0.2;
+      opacity: 0.6;
+      filter:alpha(opacity=60);
+      -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=60);";
     }
     .copyModal {
       .copyContent{

+ 3 - 3
src/components/HistoryCaseContainer/index.less

@@ -7,9 +7,9 @@
     width: 100%;
     height: 100%;
     background-color: #000;
-    opacity:0.5;
-    filter:alpha(opacity=50);  
-    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=50);";
+    opacity:0.6;
+    filter:alpha(opacity=60);
+    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=60);";
 }
 .center {
     text-align: center;

+ 2 - 0
src/components/InfoTitle/index.less

@@ -36,6 +36,8 @@
 .health{
     opacity: 0.3;
     color: rgba(0,0,0,0.6);
+    filter:alpha(opacity=30);
+    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=30);";
 }
 
 

+ 12 - 3
src/components/Inspect/index.jsx

@@ -7,6 +7,7 @@ import Notify from '@commonComp/Notify';
 import store from '@store';
 import $ from 'jquery';
 import { host } from '@utils/config.js';
+import {isIE} from '@utils/tools.js';
 
 
 (function ($) {
@@ -35,7 +36,8 @@ class Inspect extends React.Component {
         this.state = {
             val: '',
             visible:false,
-            dom:[]
+            dom:[],
+            isIE:isIE()
         }
         this.handleImportExcel = this.handleImportExcel.bind(this)
         this.cancel = this.cancel.bind(this)
@@ -103,6 +105,13 @@ class Inspect extends React.Component {
     cancel(){
         this.setState({visible:false})
     }
+  getStyle(){
+        if(this.state.isIE){
+            return styles.disabledBtn;
+        }else{
+            return styles.button;
+        }
+  }
     getWarings(lis){
         <ul>
             {
@@ -122,8 +131,8 @@ class Inspect extends React.Component {
 
                 <div className={styles.top}>
                     <span>化验结果数据</span>
-                    <div className={styles.button} onClick={this.handleImportExcel}>
-                        <button>导入化验结果</button>    
+                    <div className={this.getStyle()} onClick={this.state.isIE?null:this.handleImportExcel}>
+                        <button disabled={this.state.isIE?true:false}>导入化验结果</button>
                         <input type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} />
                     </div>
                 </div>

+ 9 - 0
src/components/Inspect/index.less

@@ -22,6 +22,15 @@
         border: 1px solid @template-color;
         overflow: hidden;
     }
+    .disabledBtn{
+        float: right;
+        border-radius: 5px;
+        border: 1px solid @placeholder-color;
+        overflow: hidden;
+        button{
+            color:@placeholder-color;
+        }
+    }
     button {
         outline: none;
         font-size: 12px;

+ 7 - 5
src/components/OtherHistory/index.jsx

@@ -38,7 +38,8 @@ class OtherHistory extends Component{
     return list;
   }
   handleInput(e){     //主诉未填无法输入
-    if(!this.props.hasMain){
+    const {type,hasMain} = this.props;
+    if(+type===0&&!hasMain){
       e.target.innerText='';
     }
   }
@@ -46,14 +47,15 @@ class OtherHistory extends Component{
     //第一次聚焦其他史时,主诉有数据则获取最近一次其他史记录(没有的话显示初始模板),主诉无数据则显示提示;其他时间其他史模板数据不调接口
     const {hasMain,type,setInitData,data,saveText,changeEditClear} = this.props;
     const hasData = saveText.join("")||data.length>0;
-    if(hasData){
+    if(hasData){      //其他史已有数据不获取
       return;
     }
-    if(hasMain){
-      setInitData();
-    }else{
+    if(+type===0&&!hasMain){
       Notify.error("无法操作,请先输入主诉");
+      return;
     }
+    //智能模式有主诉或者文本模式获取最近历史
+    setInitData();
 
     //回读后容器框要不可编辑,否则自由文本标签onInput,onFocus事件失效(原因未知)
     /*if(data.length>0){

+ 3 - 1
src/components/Preview/index.less

@@ -8,7 +8,9 @@
     right: 0;
     bottom: 0;
     background-color: #000;
-    opacity: 0.2;
+    opacity: 0.6;
+    filter:alpha(opacity=60);
+    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=60);";
   }
   .modal {
     width: 820px;

+ 2 - 0
src/components/PreviewBody/index.less

@@ -18,6 +18,8 @@
 
     .line{
       opacity: 0.2;
+      filter:alpha(opacity=20);
+      -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=20);";
       background: #FFFFFF;
       border: 1px solid #979797;
       margin:  45px 0px 15px 0px;

+ 3 - 1
src/components/PrintPreview/index.less

@@ -8,7 +8,9 @@
       right: 0;
       bottom: 0;
       background-color: #000;
-      opacity: 0.2;
+      opacity: 0.6;
+      filter:alpha(opacity=60);
+      -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=60);";
     }
     .modal {
       width: 820px;

+ 5 - 1
src/components/PushItems/index.less

@@ -234,6 +234,8 @@
       bottom: 0;
       background: #000;
       opacity: 0.3;
+      filter:alpha(opacity=30);
+      -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=30);";
       z-index: 3000;
     }
     .content {
@@ -299,7 +301,9 @@
       right:0;
       bottom: 0;
       background: #000;
-      opacity: 0.3;
+      opacity: 0.6;
+      filter:alpha(opacity=60);
+      -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=60);";
       z-index: 2000;
     }
     .message{

+ 3 - 1
src/components/SearchDrop/index.jsx

@@ -52,10 +52,12 @@ class SearchDrop extends Component{
     // onShow&&onShow(e,false);
   }
   render(){
+    let litext = '';
     return <div className={this.getClass()} contenteditable="false" id="searchBox" style={this.getStyle()}>
       <ul>
         {this.props.data&&this.props.data.map((it)=>{
-          return <li onClick={(e)=>this.handleSelect(e,it)}>{it.showType==1?it.name:it.name+'('+it.retrievalName+')'}</li>
+          litext = it.showType==1?it.name:it.name+'('+it.retrievalName+')';
+          return <li onClick={(e)=>this.handleSelect(e,it)} title={litext}>{litext}</li>
         })}
       </ul>
     </div>

+ 2 - 0
src/components/SearchDrop/index.less

@@ -9,6 +9,8 @@
     border:1px #fff solid;
     padding: 0 20px 0 30px;
     white-space: nowrap;
+    text-overflow: ellipsis;
+    overflow: hidden;
     cursor: pointer;
   }
   li:hover{

+ 4 - 0
src/containers/OtherHistory.js

@@ -7,6 +7,7 @@ import {getModule} from '@store/async-actions/fetchModules.js';
 import {billing} from '@store/async-actions/pushMessage';
 import {fullfillText} from '@common/js/func';
 import {didPushParamChange} from '@utils/tools.js';
+import {ISREAD} from "../store/types/homePage";
 
 function mapStateToProps(state){
   const {otherHistory,homePage,typeConfig,mainSuit} = state;
@@ -44,6 +45,9 @@ function mapDispatchToProps(dispatch,store){
           data:listObj.newArr,
           save:listObj.saveText
         });
+        dispatch({
+          type:ISREAD
+        })
       });
       //右侧推送
       setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的

+ 5 - 2
src/containers/SpreadDrop.js

@@ -142,15 +142,18 @@ function otherHisConfirm(dispatch,store,params){
     if(+res.data.code===0){
       const list = res.data.data;
       existsId.map((i)=>{
-        has.push(list[i]);
+        has.push(...list[i].questionMapping);
       });
       withsId.map((i)=>{
-        wes.push(list[i]);
+        wes.push(...list[i].questionMapping);
       });
       dispatch({
         type: CONFIRMSELECTED,
         data: {exists:fullfillText(has,false,false).newArr,withs:fullfillText(wes,false,false).newArr,nones:nones,ikey,copyType}
       });
+      dispatch({
+        type:ISREAD
+      });
     }
   });
 }

+ 5 - 4
src/containers/TypeConfigContainer.js

@@ -3,7 +3,7 @@ import { connect } from "react-redux";
 import Banner from "../components/Banner";
 import { SHOW_CONFIG_MODAL, CLOSE_CONFIG_MODAL, CHANGE_TYPE, CONFIRM_TYPE } from "../store/types/typeConfig";
 import {pushAllDataList} from '@utils/tools';
-import {saveMode} from '@store/async-actions/fetchModules';
+import {saveMode,getOtherHisRecord} from '@store/async-actions/fetchModules';
 import config from "@config/index";
 import { initItemList } from '@store/async-actions/tabTemplate';
 import { allCheckedShow } from '@store/actions/tabTemplate';
@@ -29,13 +29,14 @@ function mapDispatchToProps(dispatch) {
       dispatch({type: CHANGE_TYPE, typeConfig})
     },
     confirmType: confirmType => {
-      //清空所有数据
-      pushAllDataList('','clear');
-      Notify.success("模式切换成功");
       //保存模式切换结果
       dispatch(saveMode(confirmType)).then((res)=>{
         if(res.data.code=='0'&&res.data.data){
+          pushAllDataList('','clear');
           dispatch({type: CONFIRM_TYPE, confirmType});
+          //清空所有数据
+          dispatch(getOtherHisRecord());          //获取其他史最近记录
+          Notify.success("模式切换成功");
           dispatch(initItemList(confirmType));
           dispatch(allCheckedShow(false))    //全选反选显示重置
         }else{

+ 13 - 0
src/main.js

@@ -15,6 +15,19 @@ const render = (Component) => {
       = c.clear = c.exception = c.trace = c.assert = function () { };
     return c;
   })();
+  //ie8 onInput替代函数
+  $.fn.onIe8Input = function (fn,thisVal) {
+    return this.each(function () {
+      var $this = $(this);
+      var htmlold = $this.html();
+      $this.bind('blur keyup paste cut mouseup', function (e) {
+        var htmlnew = $this.html();
+        if (htmlold !== htmlnew) {
+          fn.call(thisVal,e);
+        }
+      })
+    })
+  };
     ReactDOM.render(
         <AppContainer>
             <Provider store={store}>

+ 17 - 16
src/store/actions/otherHistory.js

@@ -15,30 +15,31 @@ export const confirm = (state,action) =>{
     return res;
   }
   //只有无的项目选中
+  if(+copyType===0) {      //原标签保留
+    arr.splice(ikey,1);
+  }
   if(arr[ikey].value)  arr[ikey].value= '';
+  let newPreText = (arr[ikey-1].value||arr[ikey-1].name||'')+nones;//console.log(arr[ikey-1],newPreText)
   if([...exists,...withs].length==0&&nones){
-    const newPreText = arr[ikey-1].name+nones;//console.log(arr[ikey-1],newPreText)
     arr[ikey-1].value = newPreText;
     res.saveText[ikey-1] = newPreText;
     res.update=Math.random();
     return res;
   }
-  //有、伴项目有选中
-  //const existDatas = fullfillText(exists).newArr;
-  //let withDatas = fullfillText(withs).newArr;
-  /*if(withDatas&&withDatas.length>0){
-    withDatas[0].value=withs.length>0?"伴":'';
-  }*/
-  //const text = Object.assign({},JSON.parse(config.textLabel),{value:"伴"}):undefined;
-  if(+copyType===1){       //原标签保留
+  //有,无,伴随配
+    arr.splice(ikey-1,1);
+    let flabel = [...exists,...withs][0];         //要插入的第一个标签
+    let text = newPreText;
+    //要插入的第一个标签为自由文本,则和前一个文本标签文字合并
+    if(flabel.tagType==8){
+      flabel.value = newPreText+(flabel.value||flabel.name);
+      text = flabel.value;
+    }
     arr.splice(ikey-1,0,...exists,...withs);
-  }else{                 //替换原标签
-    arr.splice(ikey,1);
-    arr.splice(ikey-1,1,...exists,...withs);
-  }
-
-  res.update=Math.random();         //用于触发组件更新(data变化了因在对象中无法被组件检测到)
-  return res;
+    arr[ikey-1].value = text;
+    res.saveText[ikey-1] = text;
+    res.update=Math.random();         //用于触发组件更新(data变化了因在对象中无法被组件检测到)
+    return res;
 };
 
 //单选下拉选中

+ 6 - 4
src/store/async-actions/fetchModules.js

@@ -57,24 +57,26 @@ export const getOtherHisRecord = ()=>{
   return (dispatch,getStore)=>{
     const state = getStore();
     const {message} =state.patInfo;
+    const mode = state.typeConfig.typeConfig;
     const param = {
       hospitalCode:message.hospitalCode,
       patientCode:message.patientCode,
-      sign:state.typeConfig.typeConfig
+      sign:mode
     };
     json(api.getOtherHisRecord,param).then((res)=>{
       if(res.data.code=='0'){
         const data = res.data.data;
-        const obj = JSON.parse(data.dataJson);
+        const obj = JSON.parse(data.dataJson||'{}');
+        const objStr = JSON.parse(data.otherStr||'[]');
         let arr = [];
-        if(!obj||!obj.other||obj.other.length==0){        //无其他史历史记录用默认模板
+        if((!obj||!obj.other||obj.other.length==0)&&!objStr[0]){        //无其他史历史记录用默认模板
           //arr = state.homePage.initData.otherHis;
         }else{
           arr = obj.other;
           dispatch({
             type:SETOTHERHISTORY,
             data:arr,
-            save:JSON.parse(data.otherStr)
+            save:objStr
           });
         }
       }

+ 5 - 3
src/utils/ajax.js

@@ -4,6 +4,8 @@ const $ = require('jquery');
 $.support.cors = true;
 const axios=require('axios');
 const qs=require('querystring');
+const isLocal = window.location.hostname.indexOf('localhost')!=-1;
+const qhost = isLocal?host:'';
 axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
 axios.defaults.baseURL = host;       //默认地址
 // axios.defaults.timeout = 60000;       //请求超时
@@ -51,7 +53,7 @@ const post=(url,data)=>{
 
   return axios({
     method:'post',
-    url:host+url,
+    url:qhost+url,
     data
   });
 };
@@ -62,7 +64,7 @@ const json=(url,data)=>{
   return new Promise((resolve,reject)=>{
     $.ajax({
       method:'post',
-      url:host+url,
+      url:qhost+url,
       data:JSON.stringify(data),
       contentType:"application/json; charset=UTF-8",
       success:function(res){
@@ -76,7 +78,7 @@ const json=(url,data)=>{
 };
 
 const get=(url)=>{
-  return axios.get(host+url).then(data=>data.data);
+  return axios.get(qhost+url).then(data=>data.data);
 };
 
 module.exports={