Przeglądaj źródła

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

# Conflicts:
#	src/store/actions/currentIll.js
zhouna 5 lat temu
rodzic
commit
a483f72577

+ 2 - 94
src/components/NumberUnitDrop/index.jsx

@@ -13,7 +13,7 @@ import $ from 'jquery';
  * placeholder:灰显文字
  * handleSelect: 选中事件
  * show: 是否显示下拉
- *
+ * 双击编辑效果去掉2019-8-13
  * ***/
 class NumberUnitDrop extends Component{
   constructor(props){
@@ -37,10 +37,7 @@ class NumberUnitDrop extends Component{
     this.$suf = React.createRef();
     this.$cont = React.createRef();
     this.select = this.select.bind(this);
-    this.numInpBlur = this.numInpBlur.bind(this);
-    this.handleSpanInp = this.handleSpanInp.bind(this);
     this.handleNumClick = this.handleNumClick.bind(this);
-    this.changeToEdit = this.changeToEdit.bind(this);
   }
   select(obj){         //选中键盘上数字事件
     const {handleSelect,ikey,suffix,prefix,mainSaveText,formulaCode,mainData} = this.props;
@@ -84,59 +81,7 @@ class NumberUnitDrop extends Component{
     })
     handleHide&&handleHide();
   }
-  //数字框失焦,保存值到store中
-  numInpBlur(e){
-    e.stopPropagation();
-    // const {handleSelect,ikey,suffix,prefix,mainSaveText,handleLabelChange,boxMark,formulaCode} = this.props;
-    const {handleSelect,ikey,mainSaveText,handleLabelChange,boxMark,formulaCode} = this.props;
-    const {editable} = this.state;
-    if(editable){
-      // const text = e.target.innerText || e.target.innerHTML;
-      // this.$span.current.innerText='';      //修改生成文字变成输入的2倍bug 
-      let totalVal = e.target.innerText|| e.target.innerHTML;
-      let changeVal = this.$span.current.innerText.replace(/^\s*/,'');//数字框值-修改后;去掉前空格避免多空格叠加
-      let prefix = this.$pre.current.innerText.replace(/^\s*/,''); //前缀值-修改后
-      let suffix = this.$suf.current.innerText.replace(/^\s*/,''); //后缀值-修改后
-      // console.log('数字框:'+changeVal,";全部:"+totalVal,";前缀:"+prefix+";后缀:"+suffix);
-      handleLabelChange && handleLabelChange({ikey,changeVal,type:boxMark,totalVal,prefix,suffix,formulaCode});
-      // handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
-      // handleLabelChange&&handleLabelChange({ikey,changeVal:text,suffix,prefix,mainSaveText,type:boxMark,formulaCode});
-      
-    }
-    this.setState({
-      isClosed:false,
-      numEditable:true,
-      hasSelect:false,
-      editable:false
-    });
-    
-  }
 
-  handleSpanInp(e){ //数字框输入事件
-    e.stopPropagation();
-    // 主诉字数达到上限时不允许输入
-    const {mainSaveText,ikey,type,handleSelect,suffix,prefix,boxMark} = this.props;
-    const {labelVal,editable} = this.state;
-    let mainText = filterDataArr(mainSaveText);//主诉字数
-    if(editable){//避免IE中点击标签也会触发
-      let val = e.target.innerText || e.target.innerHTML;
-      if(+boxMark==1){
-        if(mainText.length >= config.limited){
-          if(val.length > labelVal.length){
-            e.target.innerText?(e.target.innerText = labelVal):(e.target.innerHTML = labelVal);
-            Notify.info(config.limitText);
-            return
-          }else if(val.length == labelVal.length){
-            this.setState({
-              labelVal:val
-            });
-          }else{
-            handleSelect&&handleSelect({ikey,text:val,suffix,prefix,mainSaveText});
-          }
-        }
-      }
-    }
-  }
   getClasses(){         //整个标签是否有值的状态
     const {value,hideTag,show,isImports} = this.props;
     const inpValue = this.state.value;
@@ -151,50 +96,13 @@ class NumberUnitDrop extends Component{
     }
     return className(isSelected,noTag,blueBorder,orgBorder);
   }
-  changeToEdit(e){        //整个标签双击编辑状态
-    e.stopPropagation();
-    window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty();
-    const {value,id,handleDbclick,patId,handleHide,show} = this.props;
-    const text = e.target.innerText || e.target.innerHTML;
-    clearTimeout(this.state.timer);//取消延时的单击事件
-    e.preventDefault();
-    if(show){
-      handleHide&&handleHide();
-    }
-    if(value&&value.trim()) {//有选中值的标签才能双击编辑
-      this.setState({
-        editable: true,
-        labelVal:text
-      });
-      //失焦关闭编辑状态
-      setTimeout(()=>{
-        // e.target.focus();
-        this.$cont.current.focus();
-      })
-      //双击埋点记录
-      handleDbclick && handleDbclick({id:patId||id});
-    }
-  }
-  componentDidMount(){
-    if(isIE()){
-      // $(this.$span.current).onIe8Input(function(e){
-      $(this.$cont.current).onIe8Input(function(e){
-        this.handleSpanInp(e)
-      },this);
-    }
-  }
 
   render(){
     const {placeholder,prefix,suffix,show,value,handleHide,hideTag} = this.props;
     const {editable,hasSelect,boxLeft,boxTop} = this.state;
     return <div className={this.getClasses()}
                 ref={this.$cont}
-                onClick={this.handleNumClick}
-                contentEditable={editable}
-                onBlur={this.numInpBlur}
-                onDoubleClick={hideTag?null:this.changeToEdit}
-                onKeyDown={handleEnter}
-                onInput={this.handleSpanInp}>
+                onClick={this.handleNumClick}>
       <span ref = {this.$pre}>{prefix?prefix+' ':prefix}</span>
       <span ref = {this.$span}
             onKeyDown={handleEnter}

+ 4 - 4
src/components/Operation/index.jsx

@@ -169,10 +169,10 @@ class Operation extends Component {
       // console.log(jsonStr.chief , JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')))
       if(whichSign == 0){
         if(
-          jsonStr.chief == JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')) && 
-          jsonStr.present == JSON.stringify(eval('('+JSON.parse(dataStr).present+')')) && 
-          jsonStr.other == JSON.stringify(eval('('+JSON.parse(dataStr).other+')')) && 
-          jsonStr.vital == JSON.stringify(eval('('+JSON.parse(dataStr).vital+')')) &&
+          filterDataArr(JSON.parse(jsonStr.chief)) == filterDataArr(eval('('+JSON.parse(dataStr).chief+')')) && 
+          filterDataArr(JSON.parse(jsonStr.present)) == filterDataArr(eval('('+JSON.parse(dataStr).present+')')) && 
+          filterDataArr(JSON.parse(jsonStr.other)) == filterDataArr(eval('('+JSON.parse(dataStr).other+')')) && 
+          filterDataArr(JSON.parse(jsonStr.vital)) == filterDataArr(eval('('+JSON.parse(dataStr).vital+')')) &&
           jsonStr.lis == JSON.parse(dataStr).lis &&
           jsonStr.pacs == JSON.parse(dataStr).pacs &&
           jsonStr.diag == JSON.parse(dataStr).diag &&

+ 48 - 7
src/components/WrapModalBody/WrapModalTableSon/index.jsx

@@ -12,32 +12,73 @@ class WrapModalTableSon extends React.Component {
     }
     this.getImgPath = this.getImgPath.bind(this)
     this.selectWaring = this.selectWaring.bind(this)
+    this.allCheckImportIns = this.allCheckImportIns.bind(this)
+    this.selectOneCheck = this.selectOneCheck.bind(this)
+  }
+  selectOneCheck(name,groupName,item){
+    const {selectOneCheck,allCheck} = this.props
+    selectOneCheck&&selectOneCheck(name,groupName,item)
+    
+    setTimeout(() => {
+      console.log(allCheck,78787)
+    }, 1000);
   }
   getImgPath(name,groupName,item){
-    const { checkedList,selectOneCheck } = this.props;
+    const { checkedList } = this.props;
     let num = 0;
     for(let k = 0;k < checkedList.length;k++){
       let tmpLis = checkedList[k];
       if(tmpLis == name){
-        return <img className={style.check} onClick={()=>selectOneCheck(name,groupName,item)} src={check_right} alt="" />
+        return <img className={style.check} onClick={()=>this.selectOneCheck(name,groupName,item)} src={check_right} alt="" />
       }else{
         ++num
       }
     }
     if(num == checkedList.length){
-      return <img className={style.check} onClick={()=>selectOneCheck(name,groupName,item)} src={check_circle} alt="" />
+      return <img className={style.check} onClick={()=>this.selectOneCheck(name,groupName,item)} src={check_circle} alt="" />
     }
   }
   selectWaring(){
     let tmpMsg = this.state.msg
-    const { selectWaring } = this.props;
+    const { selectWaring,hospitalSonInspect,checkedList,allCheck } = this.props;
+    // console.log(checkedList)
+    // let tmpAll = false,num=0;
+    // if(hospitalSonInspect&&hospitalSonInspect.lisExcelWrapper){
+    //   for(let i = 0;i < hospitalSonInspect.lisExcelWrapper.length;i++){
+    //     for(let j = 0;j < checkedList.length;j++){
+    //       if(hospitalSonInspect.lisExcelWrapper[i].itemName == checkedList[j]&&hospitalSonInspect.lisExcelWrapper[i].type!=0){
+    //         num++
+    //       }
+          
+    //     }
+    //   }
+    // }
+    // console.log(num,'sssssssssssssss')
+    // this.setState({
+    //   msg:(num == 0)?'取消选中异常值数据集':'选中异常值数据'
+    // },()=>{
+    //   selectWaring&&selectWaring()
+    // })
     this.setState({
-      msg:tmpMsg=='选中异常值数据'?'取消选中异常值数据集':'选中异常值数据'
+      msg:tmpMsg=='取消选中异常值数据'?'选中异常值数据':'取消选中异常值数据'
     })
     selectWaring&&selectWaring()
   }
+  allCheckImportIns(){
+    const { allCheckImportIns,allCheck } = this.props;
+    if(!allCheck){
+      this.setState({
+        msg:'取消选中异常值数据集'
+      })
+    }else{
+      this.setState({
+        msg:'选中异常值数据'
+      })
+    }
+    allCheckImportIns&&allCheckImportIns()
+  }
   render() {
-    const { hospitalSonInspect,allCheckImportIns,allCheck } = this.props;
+    const { hospitalSonInspect,allCheck } = this.props;
     return <div className={style['modalTable']}>
       <div className={style.sonTitle}>
         <span>组名称 : {hospitalSonInspect.groupName}</span><span className={style.btn} onClick={this.selectWaring}>{this.state.msg}</span>
@@ -45,7 +86,7 @@ class WrapModalTableSon extends React.Component {
       <div className={`${style.SonTable}`}>
         <table>
           <tr className={style.head}>
-            <td className={`${style.fst}`} onClick={allCheckImportIns}><img className={style.check} src={allCheck?check_right:check_circle} alt="" />全选</td>
+            <td className={`${style.fst}`} onClick={this.allCheckImportIns}><img className={style.check} src={allCheck?check_right:check_circle} alt="" />全选</td>
             <td className={`${style.sec}`}>编号</td>
             <td className={`${style.trd}`}>项目名称</td>
             <td className={`${style.four}`}>结果</td>

+ 3 - 39
src/store/actions/currentIll.js

@@ -1,5 +1,5 @@
 import config from '@config/index.js';
-import {formatContinueDots,getLabelIndex,fullfillText,getIds} from '@utils/tools';
+import {formatContinueDots,getLabelIndex,fullfillText,getIds,resetTagtype} from '@utils/tools';
 import {Notify} from '@commonComp';
 //插入病程变化模板
 function insertPro(data,processModule){
@@ -15,55 +15,19 @@ function insertPro(data,processModule){
   }
   return data;
 }
-// 处理tagType==4
-function resetTagtype(data){
-  let newDataArr = [];
-  if(data&&data.length>0){
-    for(let i=0; i<data.length;i++){
-      if(data[i].tagType==4){
-        newDataArr.push(...data[i].questionMapping);
-      }else{
-        newDataArr.push(data[i]);
-      }
-    }
-  }
-  return newDataArr;
-}
+
 //设置模板
 export const setModule = (state,action)=>{
   const res = Object.assign({},state);
-  // 处理tagType=4的类型
   const originalData = action.data||[];
   const originalSonData = action.processModule||[];
   const originalEmpty = action.emptyData||[];
   const originalEmptySon = action.currentEmptySon||[];
+  // 处理tagType=4的类型
   let spreadLabels=resetTagtype(originalData);
   let sonSpreadLabels=resetTagtype(originalSonData);//子模板
   let emptySpreadLabels=resetTagtype(originalEmpty);//空模板
   let emptySonSpreadLabels=resetTagtype(originalEmptySon);//空模板-子模板
-  /*if(originalData&&originalData.length>0){
-    for(let i=0; i<originalData.length;i++){
-      if(originalData[i].tagType==4){
-        spreadLabels.push(...originalData[i].questionMapping);
-      }else{
-        spreadLabels.push(originalData[i]);
-      }
-    }
-  }
-  if(originalSonData&&originalSonData.length>0){
-    for(let j=0; j<originalSonData.length;j++){
-      if(originalSonData[j].tagType==4){
-        sonSpreadLabels.push(...originalSonData[j].questionMapping);
-      }else{
-        sonSpreadLabels.push(originalSonData[j]);
-      }
-    }
-  }*/
-  
-  // res.moduleData = action.data;
-  // res.processModule = action.processModule;//病程变化模板
-  // res.emptyData = action.emptyData;//空模板
-  // res.currentEmptySon = action.currentEmptySon;//空模板-子模板
   res.moduleData = spreadLabels;
   res.processModule = sonSpreadLabels;//病程变化模板
   res.emptyData = emptySpreadLabels;//空模板

+ 4 - 24
src/store/actions/mainSuit.js

@@ -1,4 +1,4 @@
-import {getLabelIndex,fullfillText,getIds} from '@utils/tools.js';
+import {getLabelIndex,fullfillText,getIds,resetTagtype} from '@utils/tools.js';
 import config from '@config/index.js';
 import {Notify} from '@commonComp';
 
@@ -22,32 +22,12 @@ export const setMainMoudle = (state,action) => {
   const res = Object.assign({},state);
   // const emptySpan = JSON.parse(config.textLabel);
   // let data = action.data.push(emptySpan);
-  // 处理tagType=4的类型
   // const originalData = JSON.parse(JSON.stringify(action.data));
   const originalData = action.data||[];
   const originalSonData = action.addSymptom||[];
-  let spreadLabels=[];
-  let sonSpreadLabels=[];//子模板
-  if(originalData){
-    for(let i=0; i<originalData.length;i++){
-      if(originalData[i].tagType==4){
-        spreadLabels.push(...originalData[i].questionMapping);
-      }else{
-        spreadLabels.push(originalData[i]);
-      }
-    }
-  }
-  if(originalSonData){
-    for(let j=0; j<originalSonData.length;j++){
-      if(originalSonData[j].tagType==4){
-        sonSpreadLabels.push(...originalSonData[j].questionMapping);
-      }else{
-        sonSpreadLabels.push(originalSonData[j]);
-      }
-    }
-  } 
-  // res.moduleData = action.data;
-  // res.addSmoduleData = action.addSymptom;
+  // 处理tagType=4的类型
+  let spreadLabels=resetTagtype(originalData);
+  let sonSpreadLabels=resetTagtype(originalSonData);//子模板
   res.moduleData = spreadLabels;
   // res.saveText = res.save||[];
   res.saveText = res.save||res.saveText;//慢病

+ 18 - 1
src/utils/tools.js

@@ -1330,6 +1330,22 @@ function getAllString(checkedListImport,assistLabel){
   }
   return tmpString;
 }
+
+// 模板中处理tagType==4的数据
+function resetTagtype(data){
+  let newDataArr = [];
+  if(data&&data.length>0){
+    for(let i=0; i<data.length;i++){
+      if(data[i].tagType==4){
+        newDataArr.push(...data[i].questionMapping);
+      }else{
+        newDataArr.push(data[i]);
+      }
+    }
+  }
+  return newDataArr;
+}
+
 module.exports = {
     checkType: Type.checkType,
     getIds,
@@ -1381,5 +1397,6 @@ module.exports = {
     getStringPlus,
     getPushLists,
     getPushList,
-    getAllString
+    getAllString,
+    resetTagtype
 };