Bläddra i källkod

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

zhouna 5 år sedan
förälder
incheckning
0d772a3e4d
67 ändrade filer med 712 tillägg och 743 borttagningar
  1. 3 1
      src/common/components/Calendar/index.jsx
  2. 42 5
      src/common/components/EditableSpan/index.jsx
  3. 1 0
      src/common/components/EditableSpan/index.less
  4. 4 43
      src/common/components/InlineTag/index.jsx
  5. 1 1
      src/common/components/NumberUnitPan/index.jsx
  6. 1 1
      src/components/AddAssistCheck/index.jsx
  7. 14 10
      src/components/AssessResult/ChartItem/index.jsx
  8. 5 2
      src/components/Banner/index.jsx
  9. 1 0
      src/components/CheckBody/index.less
  10. 11 4
      src/components/ChronicInfo/index.jsx
  11. 1 0
      src/components/DiagnosticList/index.jsx
  12. 4 2
      src/components/Emergency/HisList/index.jsx
  13. 13 14
      src/components/Emergency/index.jsx
  14. 4 4
      src/components/EmergencyProcedure/EmergencyModal/index.less
  15. 1 1
      src/components/EmergencyProcedure/index.less
  16. 4 3
      src/components/HistoryCaseContainer/HistoryList/index.jsx
  17. 1 1
      src/components/MedicalInfo/index.jsx
  18. 3 42
      src/components/MultSpread/index.jsx
  19. 3 3
      src/components/Multiple/index.jsx
  20. 12 68
      src/components/NumberDrop/index.jsx
  21. 5 97
      src/components/NumberUnitDrop/index.jsx
  22. 37 29
      src/components/Operation/index.jsx
  23. 1 0
      src/components/Preview/index.jsx
  24. 2 2
      src/components/PreviewBody/Inspect/index.jsx
  25. 3 3
      src/components/PreviewBody/ItemPart/index.jsx
  26. 25 13
      src/components/PreviewBody/index.jsx
  27. 1 0
      src/components/PrintPreview/index.jsx
  28. 16 6
      src/components/PushContainer/index.jsx
  29. 1 1
      src/components/RadioDrop/index.jsx
  30. 3 3
      src/components/RadioInpDrop/index.jsx
  31. 6 1
      src/components/TemplateItems/index.jsx
  32. 6 0
      src/components/TemplateItems/index.less
  33. 4 2
      src/components/Treat/index.jsx
  34. 60 7
      src/components/WrapModalBody/WrapModalTableSon/index.jsx
  35. 4 4
      src/components/WrapModalBodyPac/WrapModalTableSon/index.jsx
  36. 0 10
      src/containers/CurrentIll.js
  37. 2 5
      src/containers/DiagnosticList.js
  38. 9 8
      src/containers/EditableSpan.js
  39. 9 8
      src/containers/Emergency.js
  40. 0 25
      src/containers/InlineTag.js
  41. 2 15
      src/containers/MainSuit.js
  42. 5 39
      src/containers/MultSpread.js
  43. 7 81
      src/containers/NumberDrop.js
  44. 1 1
      src/containers/PushContainer.js
  45. 1 1
      src/containers/PushItemsContainer.js
  46. 1 1
      src/containers/TypeConfigContainer.js
  47. 2 2
      src/containers/WrapModalBodyPac.js
  48. 28 13
      src/store/actions/checkBody.js
  49. 78 49
      src/store/actions/currentIll.js
  50. 65 44
      src/store/actions/mainSuit.js
  51. 49 21
      src/store/actions/otherHistory.js
  52. 3 2
      src/store/actions/wrapModalBodyPac.js
  53. 13 11
      src/store/async-actions/fetchModules.js
  54. 30 7
      src/store/async-actions/historyTemplates.js
  55. 1 0
      src/store/async-actions/homePage.js
  56. 3 3
      src/store/async-actions/patInfo.js
  57. 19 1
      src/store/async-actions/print.js
  58. 27 6
      src/store/async-actions/tabTemplate.js
  59. 2 0
      src/store/reducers/assessResult.js
  60. 2 1
      src/store/reducers/currentIll.js
  61. 1 1
      src/store/reducers/historyTemplates.js
  62. 2 1
      src/store/reducers/mainSuit.js
  63. 1 1
      src/store/reducers/otherHistory.js
  64. 13 2
      src/store/reducers/tabTemplate.js
  65. 2 2
      src/utils/config.js
  66. 0 1
      src/utils/drag.js
  67. 31 8
      src/utils/tools.js

+ 3 - 1
src/common/components/Calendar/index.jsx

@@ -114,7 +114,9 @@ class Calendar extends React.Component {
       second: this.state.select.second
     };
     this.setState({
-      select: info
+      select: info,
+      month:this.month,
+      year:this.year
     });
     // this.props.timeSure(Object.assign({}, info))
     this.props.handleChange(info);

+ 42 - 5
src/common/components/EditableSpan/index.jsx

@@ -62,6 +62,8 @@ class EditableSpan extends Component{
     const {handleChange,boxMark,i,handleSearch,value,mainSaveText,mainIds,handleClear} = this.props;
     const {labelVal,searchPre} = this.state;
     const text1 = e.target.innerText || e.target.innerHTML;
+    // e.newValue IE浏览器DOMCharacterDataModified监听
+    // const text1 = e.target.innerText || e.target.innerHTML || e.newValue;
     let mainText = filterDataArr(mainSaveText);//主诉字数
     if(+boxMark==1){
       if(mainText.length >= config.limited){
@@ -151,8 +153,8 @@ class EditableSpan extends Component{
     let innerVal = target.innerText || target.innerHTML,ele,boxTop;
     //禁止回车事件
     if(ev.keyCode==13){return false;}
-    //backspace事件
-    if(ev.keyCode==8){
+    //backspace事件 和delete
+    if(ev.keyCode==8 || ev.keyCode==46){
       //用于对比backspace前后的值
       this.setState({
         preVal:innerVal
@@ -196,6 +198,37 @@ class EditableSpan extends Component{
     const ev = e||window.event;
     const target = ev.target||ev.srcElement;
     let innerVal = target.innerText || target.innerHTML,ele,boxTop;
+    // 可编辑div不支持oninput事件,用此事件替代
+    /*if(isIE() && innerVal != preVal){
+      this.onChange(ev);
+    }*/
+    if(ev.keyCode==46){//delete
+      //判断nexObj
+      let nextObj = $(this.$span.current).next();
+      if(preVal.trim().length==1&& !innerVal){
+        removeId && removeId({boxMark,i:index,text:"",flag:'del'});
+        handleClear && handleClear({boxMark});//删除最后一个字时清空搜索结果,避免现病史搜索框不立即消失的情况
+        //如果后一个不是标签,则光标移到最前
+        if(nextObj && nextObj[0].nodeName !=="DIV"){
+          nextObj.focus();
+        }
+      }
+      //action里往后删除
+      if(innerVal == preVal){
+        let data = innerVal.trim();
+        if(nextObj && !config.punctuationReg.test(data)){
+          handleKeydown&&handleKeydown({boxMark,i:index,text:data,flag:'del'});
+          // nextObj.focus();  
+          if(nextObj[0].nodeName !=="DIV"){
+            nextObj.focus();
+          }
+          /*this.setState({
+            index: null
+          })*/
+        }
+      }
+    }
+
     if(ev.keyCode==8){     
       // 主诉现病史去重:删除最后一个字的时候移除该数据(将name、id和value替换成空)并移除id
       // 前面是标签,内容为空时再删一次才移除标签;前面是文本,则直接移除;
@@ -229,7 +262,7 @@ class EditableSpan extends Component{
         if(index!==0 && !config.punctuationReg.test(data)){
           // let preObj = $(this.$span.current).prev();
           let obj = preObj[0].nodeName=="DIV"?preObj.prev():preObj;
-          handleKeydown&&handleKeydown({boxMark,i:index,text:data});
+          handleKeydown&&handleKeydown({boxMark,i:index,text:data,flag:'backsp'});
           this.moveEnd(obj[0]);  
           this.setState({
             index: null
@@ -250,13 +283,17 @@ class EditableSpan extends Component{
   }
   componentDidMount(){
     const {value} = this.props;
+    const that = this;
     if(value){
       this.$span.current.innerText?(this.$span.current.innerText = value||''):(this.$span.current.innerHTML = value||'');
     }
     if(isIE()){
-      $(this.$span.current).onIe8Input(function(e){
+      // 左右移动没问题,但是输入过程中会失焦,并且有时光标在但是无法输入 
+      // $(this.$span.current)[0].addEventListener('DOMCharacterDataModified', function(e){that.onChange(e);}, false);
+      // 此方法会影响左右切换时光标消失
+      /*$(this.$span.current).onIe8Input(function(e){
         this.onChange(e)
-      },this);
+      },this);*/
     }
   }
   /*cancelSelect(e){//双击不选中

+ 1 - 0
src/common/components/EditableSpan/index.less

@@ -5,6 +5,7 @@
   word-break: break-word;
   min-width: 10px;
   // line-height: 2;
+  /*height: 16px;*/
   line-height: 16px;
   vertical-align: middle;
   text-align: left;

+ 4 - 43
src/common/components/InlineTag/index.jsx

@@ -15,49 +15,16 @@ import {handleEnter} from '@utils/tools.js';
 class InlineTag extends Component {
   constructor(props){
     super(props);
-    this.$box = React.createRef();
     this.$span = React.createRef();
-    this.$pre = React.createRef();
-    this.$suf = React.createRef();
     this.state = {
-      editable:false,
       value:props.value||'',
       placeholder:props.placeholder||''
     };
-    this.changeToEdit = this.changeToEdit.bind(this);
-    this.changeToClick = this.changeToClick.bind(this);
     this.handleBlur = this.handleBlur.bind(this);
     this.handleInput = this.handleInput.bind(this);
     this.handleFocus = this.handleFocus.bind(this);
     this.handleFixClick = this.handleFixClick.bind(this);
   }
-  changeToEdit(e){
-    const {handledbClick,id} = this.props;
-    // 输入框有值才可以双击编辑
-    const text = this.$span.current.innerText;
-    if(!text.trim()){
-      return
-    }
-    this.setState({
-      editable:true
-    });
-    //埋点记录
-    handledbClick&&handledbClick({id});
-  }
-  changeToClick(e){
-    e.stopPropagation();
-    const {saveEditText,ikey} = this.props;
-    this.setState({
-      editable:false
-    });
-    saveEditText&&saveEditText({
-      changeVal:this.$span.current.innerText,
-      totalVal:this.$box.current.innerText,
-      prefix:this.$pre.current.innerText,
-      suffix:this.$suf.current.innerText,
-      ikey
-    });
-  }
   handleInput(e){       //输入时保存临时值,在修改灰显为黑色时判断用
     e.stopPropagation();
   }
@@ -125,24 +92,18 @@ class InlineTag extends Component {
   }
   render(){
     const {prefix,suffix} = this.props;
-    const {editable,placeholder,value} = this.state;
+    const {placeholder,value} = this.state;
     return <div className={this.getStyle()}
-                 onDoubleClick={this.changeToEdit}
-                 /*onClick={!editable?this.handleFixClick:''}*/
-                 onKeyDown={handleEnter}
-                 onBlur={this.changeToClick} 
-                 ref={this.$box} 
-                 contentEditable={editable}>
-                <span ref={this.$pre}>&nbsp;{prefix}</span>
+                onClick={this.handleFixClick}>
+                <span>{prefix}</span>
                 <span className={style['free-in']}
                       contentEditable={true}
                       onBlur={this.handleBlur}
                       onInput={this.handleInput}
                       onFocus={this.handleFocus}
-                      /*onClick={e=>e.stopPropagation()}*/
                       onKeyDown={handleEnter}
                       ref={this.$span}>&nbsp;{value||placeholder}</span>
-                <span ref={this.$suf}>&nbsp;{suffix}</span>
+                <span>{suffix}</span>
             </div>;
     }
 }

+ 1 - 1
src/common/components/NumberUnitPan/index.jsx

@@ -77,7 +77,7 @@ class NumberUnitPan extends Component{
   render(){
     const domNode = document.getElementById('root');
     return ReactDom.createPortal( 
-      <div className={style['panBox']} onBlur={(e)=>e.stopPropagation()} style={this.getStyle()}>
+      <div className={style['panBox']} onBlur={(e)=>e.stopPropagation()} onDoubleClick={(e)=>e.stopPropagation()} style={this.getStyle()}>
         <table className={style['pan']} >
         <tr>
           <td><span onClick={this.handleSelect}>1</span></td>

+ 1 - 1
src/components/AddAssistCheck/index.jsx

@@ -37,7 +37,7 @@ class AddAssistCheck extends React.Component {
       if (_con && searchWrapAssist != event.target && !_con.is(event.target) && _con.has(event.target).length === 0) { // Mark 1
         this.setState({ show: false });
       }
-      if (!_cons.is(event.target) && _cons.has(event.target).length === 0) { // Mark 1
+      if (!_cons.is(event.target) && _cons.has(event.target).length === 0 || event.target.isEqualNode(_close)) { // Mark 1
         this.setState({ date: false });
       }
       

+ 14 - 10
src/components/AssessResult/ChartItem/index.jsx

@@ -24,10 +24,12 @@ class ChartItem extends Component {
     //近一周
     switch(type){
       case 'week':
-        for(let i=0;i<7;i++){
+        arr.push(...this.getDayHours(now,true,1));
+        for(let i=1;i<6;i++){
           temp=i*1000*60*60*24;
           arr.unshift(...this.getDayHours(now-temp,true));
-        }
+        };
+        arr.unshift(...this.getDayHours(now-6*1000*60*60*24,true,2));
         break;
       case 'month':
         for(let i=0;i<30;i++){
@@ -52,7 +54,7 @@ class ChartItem extends Component {
 
     return arr;
   }
-  getDayHours(time,isHour){
+  getDayHours(time,isHour,isLimit){
     const year = new Date(time).getFullYear();
     const month = new Date(time).getMonth()+1;
     const date = new Date(time).getDate();
@@ -60,9 +62,10 @@ class ChartItem extends Component {
     let arr=[],temp='';
     const str= year+'-'+(month<10?'0'+month:month)+'-'+(date<10?'0'+date:date);
     if(isHour){
-      for(let i=0;i<24;i++){
-        temp = hour-i>-1?hour-i:hour-i+24;
-        arr.unshift(str+" "+(temp<10?'0'+temp:temp)+":00:00");
+      const num = isLimit===1?hour+1:24;
+      for(let i=(isLimit===2?hour:0);i<num;i++){
+        //temp = hour-i>-1?hour-i:hour-i+24;
+        arr.push(str+" "+(i<10?'0'+i:i)+":00:00");
       }
       return arr;
     }else{
@@ -70,14 +73,14 @@ class ChartItem extends Component {
     }
   }
   rangChange(type,i){
-    const {initFn,handleChange,data,pindex} = this.props;
+    const {initFn,disName,handleChange,data,pindex} = this.props;
     const times = this.getXAxisArr(type);
     const startTime=times[0];
     const endTime=times[times.length-1];
     const range = [startTime,endTime];
     const temp=this.props.timeTypes;
     if(!data[startTime+endTime]){
-      initFn&&initFn({range,rangeType:type,index:i,pindex,getNew:false});
+      initFn&&initFn({range,disName,rangeType:type,index:i,pindex,getNew:false});
     }
     handleChange&&handleChange(Object.assign(temp,{[i]:type}));
   }
@@ -150,6 +153,7 @@ class Chart extends Component{
     let series = [],names=[],inx=-1;
     let myChart = echarts.init(document.getElementById(id) ,null, {renderer: 'svg'});
     let xAxisArr = [...xAxis];
+    const strNum = type=='week'?13:10;
     const interval = {
       week:23,
       month:4,
@@ -161,8 +165,8 @@ class Chart extends Component{
       let name='';
       it&&it.creatTime.map((x,i)=>{
         inx=xAxis.findIndex((a)=>{
-          name=x.substr(0,13);
-          return a.substr(0,13)==name;
+          name=x.substr(0,strNum);
+          return a.substr(0,strNum)==name;
         });     //日期对应横坐标的位置
         if(inx!=-1){
           if(type=='week'){

+ 5 - 2
src/components/Banner/index.jsx

@@ -10,7 +10,7 @@ import {Notify} from '@commonComp';
 // import Emergency from '@components/Emergency';
 import Emergency from '@containers/Emergency';
 import {getAllHis} from '@store/async-actions/fetchModules.js';
-import {timestampToTime} from '@utils/tools.js';
+import {timestampToTime,getCurrentDate} from '@utils/tools.js';
 import {dragBox} from '@utils/drag';
 import {CLEAR_COMSYMPTOMS} from '@store/types/mainSuit';
 
@@ -75,8 +75,11 @@ class Banner extends Component {
   }*/
   showHisModal(){
     const {getAllRecord} = this.props;
+    // 进入时默认展示当天的病例
     const item = {
-      current:1
+      current:1,
+      startDate:getCurrentDate(false)+' 00:00:00',
+      endDate:getCurrentDate(false)+' 23:59:59'
     }
     getAllRecord&&getAllRecord(item);
     this.setState({

+ 1 - 0
src/components/CheckBody/index.less

@@ -7,6 +7,7 @@
   /*float: right;*/
   position: absolute;
   right: 0;
+  bottom: 0;
   background: #fff;
   img{
     vertical-align: text-top;

+ 11 - 4
src/components/ChronicInfo/index.jsx

@@ -232,10 +232,10 @@ class ChronicInfo extends React.Component{
   }
   handleReg(e){   //只能输入数字和特殊符号
     //const hasDot = e.target.value.indexOf('.')!=-1;
-    const key = e.key;
-    if(key!='Backspace'&&((/[^\d|.\/%*~]/.test(key)))){
-      e.preventDefault();
-    }
+    // const key = e.key;
+    // if(key!='Backspace'&&((/[^\d|.\/%*~]/.test(key)))){
+    //   e.preventDefault();
+    // }
   }
   handleInputformula(id,calcuContent,i,e) {
     const {calcuValues} = this.state;
@@ -488,6 +488,13 @@ class ChronicInfo extends React.Component{
     return list;
   }
   componentWillReceiveProps(next){
+    //计算公式可能结果弹窗关闭1916
+    if(!next.data||next.data.length==0){
+      this.setState({
+        formulaId:null,
+        optionId:null
+      });
+    }
     if(JSON.stringify(next.calcuValues)!=JSON.stringify(this.props.calcuValues)){
       this.setState({
         calcuValues:next.calcuValues

+ 1 - 0
src/components/DiagnosticList/index.jsx

@@ -113,6 +113,7 @@ class DiagnosticList extends Component {
         // showHistoryCaseModal && showHistoryCaseModal()
         // store.dispatch(initItemList(chronicMagItem))
         initItemList(chronicMagItem).then((res)=>{
+          console.log(99999,chronicMagItem)
             const result = res.data;
             if(result.code==0 && result.data){
               store.dispatch(setInitHistory(result.data));

+ 4 - 2
src/components/Emergency/HisList/index.jsx

@@ -58,18 +58,20 @@ class HisList extends Component {
     handleFilter&&handleFilter(obj);
   }
   handleFilter(flag){
-    const {handleFilter} = this.props;
+    const {handleFilter,detail} = this.props;
     const {hasSecond} = this.state;
     if(flag == hasSecond){return}
     this.setState({
       hasSecond:flag,
       all:false,
-      select:[]
+      select:[],
+      index:0
     })
     const obj = {
       flag:flag
     }
     handleFilter&&handleFilter(obj);
+    detail&&detail(0);
   }
 
   handleGetMore(){

+ 13 - 14
src/components/Emergency/index.jsx

@@ -62,8 +62,8 @@ class EmergencyHis extends Component{
   }
 
   handleDownload(ids){//导出
-    const { getDownload } = this.props;
-    getDownload&&getDownload(ids)
+    const { getDownload ,info} = this.props;
+    getDownload&&getDownload({ids,info})
   }
   //搜索框输入
   handleInput(e){
@@ -104,28 +104,27 @@ class EmergencyHis extends Component{
     const {chooseItem,index,filtFlag,changeInd} = this.state;
     const {addSecond,data} = this.props;
     if(chooseItem.trim()){
+      // 在非默认筛选条件下添加二次诊断后重新调筛选接口
+      if(filtFlag !== -1){
+        if(filtFlag ==0){//无二次诊断添加后重置index
+          this.setState({
+            index:0,
+            changeInd:!changeInd //重置list中的index标识
+          })
+        }
+      }
       // 添加接口
       const item = {
         name:chooseItem,
         id:data[index].inquiryId
       }
-      addSecond&&addSecond(item);
+      addSecond&&addSecond({item,flag:filtFlag});
       this.searInp.current.value = "";
       this.setState({
         valChange:true,
         chooseItem:''
       });
     }
-    // 在非默认筛选条件下添加二次诊断后重新调筛选接口
-    if(filtFlag !== -1){
-      this.handleFilter({flag:filtFlag});
-      if(filtFlag ==0){//无二次诊断添加后重置index
-        this.setState({
-          index:0,
-          changeInd:!changeInd //重置list中的index标识
-        })
-      }
-    }
   }
 
   componentWillUnmount(){
@@ -143,7 +142,7 @@ class EmergencyHis extends Component{
     let baseObj = data[index];
     let dataJson,dataStr;
     if(baseObj){
-        dataJson = JSON.stringify(baseObj) == "{}" ? {} : JSON.parse(baseObj.dataJson);
+        // dataJson = JSON.stringify(baseObj) == "{}" ? {} : JSON.parse(baseObj.dataJson);
         dataStr = JSON.stringify(baseObj) == "{}" ? [] : baseObj.detailList;
     }
     const getAllDataStringList = () =>{           //获取所有模块文本的数据

+ 4 - 4
src/components/EmergencyProcedure/EmergencyModal/index.less

@@ -143,15 +143,15 @@
   overflow: hidden;
   z-index: 500;
   width: 900px;
-  padding-top: 30px;
+  padding-top: 20px;
   box-sizing: border-box;
   margin-left: -450px;
-  // margin-top: -400px;
+  // margin-top: -415px;
   // height: 800px;
   // top: 50%;
   left: 50%;
-  top: 40px;
-  bottom: 40px;
+  top: 60px;
+  bottom: 60px;
   .emergencyImg{
     height: 100%;
     width: 100%;

+ 1 - 1
src/components/EmergencyProcedure/index.less

@@ -8,7 +8,7 @@
     -ms-user-select: none;
     user-select: none;
     position: fixed;
-    z-index: 205;
+    z-index: 202;
     top: 55px;
     right: 20px;
     width: auto;

+ 4 - 3
src/components/HistoryCaseContainer/HistoryList/index.jsx

@@ -13,6 +13,7 @@ import { ConfirmModal } from '@commonComp';
 import {showHistory} from "@store/actions/historyTemplates";
 import { CONFIRM_TYPE } from "@store/types/typeConfig";
 import {billing} from '@store/async-actions/pushMessage';
+import {getHistempDetail} from '@store/async-actions/historyTemplates';
 
 
 class HistoryCaseContainer extends React.Component {
@@ -54,7 +55,7 @@ class HistoryCaseContainer extends React.Component {
         activeId:idx,
         activeHis:tmpItems,
         dataStr:tmpItems.detailList||[],
-        dataJson:JSON.parse(tmpItems.dataJson)||{},
+        // dataJson:JSON.parse(tmpItems.dataJson)||{},
       })
     }
     makeSure(){
@@ -62,7 +63,7 @@ class HistoryCaseContainer extends React.Component {
         this.setState({visible:false})
         store.dispatch(showHistory(false))
         store.dispatch({type: CONFIRM_TYPE, confirmType: activeHis.sign});
-        pushAllDataList(activeHis.sign,'push',activeHis,'history')       //引用
+        store.dispatch(getHistempDetail(activeHis))
         if(didPushParamChange()){
           store.dispatch(billing())
         }
@@ -81,7 +82,7 @@ class HistoryCaseContainer extends React.Component {
         activeId:idx,
         activeHis:val,
         dataStr:val.detailList||[],
-        dataJson:JSON.parse(val.dataJson)||{},
+        // dataJson:JSON.parse(val.dataJson)||{},
       })
     }
     render(){

+ 1 - 1
src/components/MedicalInfo/index.jsx

@@ -53,7 +53,7 @@ class MedicalInfo extends Component {
       this.setState({
         val: '',
         hasSearch: false,
-        msg: ''
+        msg: '',
       });
       clearResult && clearResult();
     }

+ 3 - 42
src/components/MultSpread/index.jsx

@@ -33,12 +33,8 @@ class MultSpread extends Component{
   constructor(props){
     super(props);
     this.state = {
-      editable: false,
       numDoms:[]
     };
-    this.$cont = React.createRef();
-    this.changeToEdit = this.changeToEdit.bind(this);
-    this.handleEdit = this.handleEdit.bind(this);
   }
   getClass(){
     const {saveText,ikey,showAdd} = this.props;
@@ -76,12 +72,11 @@ class MultSpread extends Component{
   }
   getLabels(){
     const {data,ikey,showArr,copyId,selecteds,boxMark} = this.props;
-    const {editable}= this.state;
     let show = false;
     let inx = '',count=0;
     const list = data.map((it,i)=>{
       inx=ikey+'-'+i;
-      show = editable?false:showArr&&showArr[inx];
+      show = showArr&&showArr[inx];
       switch (true){
         case +it.tagType===8:
           return it.name;
@@ -166,33 +161,6 @@ class MultSpread extends Component{
     });
     return list;
   }
-  changeToEdit(e){
-    const {name,copyId,ikey,placeholder,handleDbclick,saveText,prefix,suffix} = this.props;
-    const labelInx = tools.getLabelIndex(ikey);
-    const text = saveText&&saveText[+labelInx];
-    //clearTimeout(this.state.timer);//取消延时的单击事件
-    e.preventDefault();
-    if(text&&text.trim()) {//有选中值的标签才能双击编辑
-      this.setState({
-        editable: true
-      });
-      //失焦关闭编辑状态
-      setTimeout(()=>{
-        this.$cont.current.focus();
-      });
-      //双击埋点记录
-      handleDbclick && handleDbclick({id:copyId});
-    }
-  }
-  handleEdit(e){
-    const {saveEditText,ikey} = this.props;
-    if(!this.state.editable) return;
-    this.setState({
-      editable: false
-    });
-    let totalVal = e.target.innerText || e.target.innerHTML;
-    saveEditText && saveEditText({ikey,type:ikey.split("-")[0],totalVal});
-  }
   componentDidMount(){
     //挂载完成保存有加号的项目数据
     const {saveAddItem,fullData,copyId,showAdd} = this.props;
@@ -204,23 +172,16 @@ class MultSpread extends Component{
     }
   }
   getContClass(){
-    const {editable} = this.state;
     const {isImports,ikey,saveText} = this.props;
     const labelInx = tools.getLabelIndex(ikey);
     const text = saveText&&saveText[+labelInx];
     const orgBorder = isImports&&!text?style['orange-border']:'';
-    const edit = editable?style['blue-border']:'';
-    return classNames(edit,orgBorder);
+    return classNames(orgBorder);
   }
   render(){
     const {showAdd,addLabelItem,ikey,copyId,textPrefix,textSuffix} = this.props;
     return (<div className={this.getContClass()}
-                 style={{display:'inline-block'}}
-                 onDoubleClick={this.changeToEdit}
-                 ref = {this.$cont}
-                 contentEditable={this.state.editable}
-                 onBlur={this.handleEdit}
-                 onKeyDown={tools.handleEnter}>
+                 style={{display:'inline-block'}}>
       {textPrefix?<span>{textPrefix}</span>:''}
       <div className={this.getClass()}>
       {this.getLabels()}

+ 3 - 3
src/components/Multiple/index.jsx

@@ -173,16 +173,16 @@ class Multiple extends react.Component{
     }
   }
   render(){
-    const {placeholder,value,show,data,handleConfirm,ikey,order,mainSaveText,handleHide,type} = this.props;
+    const {placeholder,value,show,data,hideTag} = this.props;
     const {editable,boxTop,boxLeft,seleData,seleId} = this.state;
     return <div className={style["container"]}>
       <div className={this.getClass()}
       ref={this.$div}
       onClick={this.handleShow}
-      onDoubleClick={this.changeToEdit}
+      onDoubleClick={hideTag?null:this.changeToEdit}
       onBlur={this.handleBlur}
       onInput={this.onChange}
-      onkeydown={handleEnter}
+      onKeyDown={handleEnter}
       contentEditable={editable}>{value||placeholder}</div>
       <div className={this.getListClass()} contentEditable="false">
         <SlideItem 

+ 12 - 68
src/components/NumberDrop/index.jsx

@@ -3,7 +3,7 @@ import className from 'classnames';
 import {NumberPan,Notify} from '@commonComp';
 import style from './index.less';
 import $ from "jquery";
-import {handleEnter,getPageCoordinate} from '@utils/tools.js';
+import {getPageCoordinate} from '@utils/tools.js';
 /***
  * author:zn@2018-11-19
  * 接收参数:
@@ -18,7 +18,7 @@ class NumberDrop extends Component{
   constructor(props){
     super(props);
     this.state={
-      editable:false,      //标签是否可输入
+      /*editable:false,      //标签是否可输入*/
       timer:null,
       sltTimer:null,
       blurTimer:null,
@@ -30,16 +30,10 @@ class NumberDrop extends Component{
       placeholder:props.placeholder
     };
     this.$span = React.createRef();
-    this.$pre = React.createRef();
-    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.handleNumFocus = this.handleNumFocus.bind(this);
-    this.handleBlur = this.handleBlur.bind(this);
-    this.changeToEdit = this.changeToEdit.bind(this);
     this.handleKeyDowm = this.handleKeyDowm.bind(this);
     this.beyondArea = this.beyondArea.bind(this);
   }
@@ -109,23 +103,12 @@ class NumberDrop extends Component{
       handleHide && handleHide();
       return;
     }else{
-      const {editable} = this.state;
-      if(editable){
-        return;
-      }
-      const that = this;
-      //双击时不显示下拉
-      clearTimeout(that.state.timer);
-      const timer = setTimeout(function(){
-        //只有弹窗关闭则点击数字键盘会清空当前数据
-        that.$span.current.focus();
-        that.setState({
-          hasSelect:false
-        });
-        handleShow&&handleShow({ikey,id:patId||id});
-      },300);
+      this.$span.current.focus();
+      this.setState({
+        hasSelect:false
+      });
+      handleShow&&handleShow({ikey,id:patId||id});
       this.setState({
-        timer,
         boxLeft:getPageCoordinate(e).boxLeft,
         boxTop:getPageCoordinate(e).boxTop,
         tmpScroll: $("#addScrollEvent")[0].scrollTop,
@@ -207,42 +190,10 @@ class NumberDrop extends Component{
   getClasses(){         //整个标签是否有值的状态
     const {hideTag,placeholder,value,isImports} = this.props;
     const val = value;
-    const blueBorder = this.state.editable?style['blue-border']:'';
     const isSelected = val&&val!=placeholder?style['selected']:style['container'];
     const orgBorder = isImports&&!(val&&val!=placeholder)?style['orange-border']:'';
     const noTag = hideTag?style['no-tag']:'';
-    return className(isSelected,noTag,blueBorder,orgBorder);
-  }
-  changeToEdit(e){        //整个标签双击编辑状态
-    window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty();
-    const {value,id,handleDbclick,patId,handleHide,show} = this.props;
-    clearTimeout(this.state.timer);//取消延时的单击事件
-    e.preventDefault();
-    if(show){
-      handleHide&&handleHide();
-    }
-    if(value&&value.trim()) {//有选中值的标签才能双击编辑
-      this.setState({
-        editable: true
-      });
-      setTimeout(()=>{
-        this.$cont.current.focus();
-      })
-      //双击埋点记录
-      handleDbclick && handleDbclick({id:patId||id});
-    }
-  }
-  handleBlur(e){     //双击编辑blur
-    const {handleLabelChange,ikey,boxMark,value} = this.props;
-    this.setState({
-      editable: false
-    });
-    let totalVal = e.target.innerText.trim();
-    let changeVal = this.$span.current.innerText.trim();//数字框值-修改后;去掉前空格避免多空格叠加
-    let prefix = this.$pre.current.innerText.trim(); //前缀值-修改后
-    let suffix = this.$suf.current.innerText.trim(); //后缀值-修改后
-    // console.log('数字框:'+changeVal,";全部:"+totalVal,";前缀:"+prefix+";后缀:"+suffix);
-    handleLabelChange && handleLabelChange({ikey,changeVal,type:boxMark,totalVal,prefix,suffix});
+    return className(isSelected,noTag,orgBorder);
   }
   getSpanClass(){       //将被替换的文字选中状态显示
     const cls = this.props.show?style['blued']:'';
@@ -264,17 +215,10 @@ class NumberDrop extends Component{
   }
   render(){
     const {prefix,suffix,show,value,handleHide,allClick} = this.props;
-    const {placeholder,editable,hasSelect,boxTop,boxLeft} = this.state;
-    //console.log(prefix,value,placeholder+'1',this.props.placeholder)
+    const {placeholder,hasSelect,boxTop,boxLeft} = this.state;
     return <div className={this.getClasses()}
-                ref={this.$cont}
-                onDblClick ={this.changeToEdit}
-                onClick={allClick?this.handleNumClick:null}
-                contentEditable={editable}
-                onBlur={this.handleBlur}
-                onKeyDown={handleEnter}
-                onFocus={this.stopBubble.bind(this)}>
-      <span ref = {this.$pre}>&nbsp;{prefix}</span>
+                onClick={allClick?this.handleNumClick:null}>
+      <span>{prefix}</span>
       <span onFocus={this.handleNumFocus}
             onClick={allClick?null:this.handleNumClick}
             contentEditable={true}
@@ -285,7 +229,7 @@ class NumberDrop extends Component{
             onInput={this.handleSpanInp}
             className={this.getSpanClass()}
             >&nbsp;{value||placeholder}</span>
-      <span ref = {this.$suf}>&nbsp;{suffix}</span>
+      <span>{suffix}</span>
       <NumberPan handleSelect={this.select.bind(this)}
                  onClose={handleHide}
                  show={show}

+ 5 - 97
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,53 +96,16 @@ 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} = this.props;
-    const {numEditable,editable,hasSelect,boxLeft,boxTop} = this.state;
+    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={this.changeToEdit}
-                onkeydown={handleEnter}
-                onInput={this.handleSpanInp}>
+                onClick={this.handleNumClick}>
       <span ref = {this.$pre}>{prefix?prefix+' ':prefix}</span>
       <span ref = {this.$span}
-            onkeydown={handleEnter}
+            onKeyDown={handleEnter}
             style={{cursor:editable?'text':'pointer'}}>{value||placeholder}</span>
       <span ref = {this.$suf}>{suffix?' '+suffix:suffix}</span>
       <NumberUnitPan handleSelect={(obj)=>this.select(obj)}

+ 37 - 29
src/components/Operation/index.jsx

@@ -160,33 +160,37 @@ class Operation extends Component {
       Notify.info('模板数据不能为空')
       return false
     }
-    console.log(jsonStr,'文本')
-    console.log(jsonData,'结构')       //测试需要用到,不要删了
+    // console.log(jsonStr,'文本')
+    // console.log(jsonData,'结构')       //测试需要用到,不要删了
+    // console.log(tmpLis,'接口返回的')
     for(let i = 0;i <tmpLis.length;i++){
       let dataStr = tmpLis[i].preview;
-      let dataJson = tmpLis[i].dataJson;
+      // let dataJson = tmpLis[i].dataJson;
       // console.log(jsonStr.chief , JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')))
-      // console.log(jsonData.chief , JSON.parse(dataJson).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+')'))  &&
-          JSON.stringify(jsonData.chief) == JSON.stringify(JSON.parse(dataJson).chief) &&    
-          JSON.stringify(jsonData.checkedListImport) == JSON.stringify(JSON.parse(dataJson).checkedListImport) &&    
-          JSON.stringify(jsonData.present) == JSON.stringify(JSON.parse(dataJson).present)  &&     
-          JSON.stringify(jsonData.other) == JSON.stringify(JSON.parse(dataJson).other) &&
-          JSON.stringify(jsonData.vital) == JSON.stringify(JSON.parse(dataJson).vital) && 
-          JSON.stringify(jsonData.lis) == JSON.stringify(JSON.parse(dataJson).lis) &&  
-          JSON.stringify(jsonData.pacs) == JSON.stringify(JSON.parse(dataJson).pacs) &&     
-          JSON.stringify(jsonData.diag) == JSON.stringify(JSON.parse(dataJson).diag) &&    
-          JSON.stringify(jsonData.advice) == JSON.stringify(JSON.parse(dataJson).advice) &&    
-          JSON.stringify(jsonData.mainSuitSelecteds) == JSON.stringify(JSON.parse(dataJson).mainSuitSelecteds) &&      
-          JSON.stringify(jsonData.currentIllSelecteds) == JSON.stringify(JSON.parse(dataJson).currentIllSelecteds) &&     
-          JSON.stringify(jsonData.otherHistorySelecteds) == JSON.stringify(JSON.parse(dataJson).otherHistorySelecteds) && 
-          JSON.stringify(jsonData.checkBodySelecteds) == JSON.stringify(JSON.parse(dataJson).checkBodySelecteds) &&     
-          JSON.stringify(jsonData.addItems) == JSON.stringify(JSON.parse(dataJson).addItems)
+          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 &&
+          jsonStr.advice == JSON.parse(dataStr).advice
+          // JSON.stringify(jsonData.chief) == JSON.stringify(JSON.parse(dataJson).chief) &&    
+          // JSON.stringify(jsonData.checkedListImport) == JSON.stringify(JSON.parse(dataJson).checkedListImport) &&    
+          // JSON.stringify(jsonData.present) == JSON.stringify(JSON.parse(dataJson).present)  &&     
+          // JSON.stringify(jsonData.other) == JSON.stringify(JSON.parse(dataJson).other) &&
+          // JSON.stringify(jsonData.vital) == JSON.stringify(JSON.parse(dataJson).vital) && 
+          // JSON.stringify(jsonData.lis) == JSON.stringify(JSON.parse(dataJson).lis) &&  
+          // JSON.stringify(jsonData.pacs) == JSON.stringify(JSON.parse(dataJson).pacs) &&     
+          // JSON.stringify(jsonData.diag) == JSON.stringify(JSON.parse(dataJson).diag) &&    
+          // JSON.stringify(jsonData.advice) == JSON.stringify(JSON.parse(dataJson).advice) &&    
+          // JSON.stringify(jsonData.mainSuitSelecteds) == JSON.stringify(JSON.parse(dataJson).mainSuitSelecteds) &&      
+          // JSON.stringify(jsonData.currentIllSelecteds) == JSON.stringify(JSON.parse(dataJson).currentIllSelecteds) &&     
+          // JSON.stringify(jsonData.otherHistorySelecteds) == JSON.stringify(JSON.parse(dataJson).otherHistorySelecteds) && 
+          // JSON.stringify(jsonData.checkBodySelecteds) == JSON.stringify(JSON.parse(dataJson).checkBodySelecteds) &&     
+          // JSON.stringify(jsonData.addItems) == JSON.stringify(JSON.parse(dataJson).addItems)
         ){
           Notify.info('该模板已保存');
           return false;
@@ -197,13 +201,17 @@ class Operation extends Component {
           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+')'))  &&
-          JSON.stringify(jsonData.vital) == JSON.stringify(JSON.parse(dataJson).vital) && 
-          JSON.stringify(jsonData.lis) == JSON.stringify(JSON.parse(dataJson).lis) &&  
-          JSON.stringify(jsonData.pacs) == JSON.stringify(JSON.parse(dataJson).pacs) &&     
-          JSON.stringify(jsonData.diag) == JSON.stringify(JSON.parse(dataJson).diag) &&    
-          JSON.stringify(jsonData.advice) == JSON.stringify(JSON.parse(dataJson).advice) &&        
-          JSON.stringify(jsonData.addItems) == JSON.stringify(JSON.parse(dataJson).addItems)
+          jsonStr.vital == JSON.stringify(eval('('+JSON.parse(dataStr).vital+')')) &&
+          jsonStr.lis == JSON.parse(dataStr).lis &&
+          jsonStr.pacs == JSON.parse(dataStr).pacs &&
+          jsonStr.diag == JSON.parse(dataStr).diag &&
+          jsonStr.advice == JSON.parse(dataStr).advice
+          // JSON.stringify(jsonData.vital) == JSON.stringify(JSON.parse(dataJson).vital) && 
+          // JSON.stringify(jsonData.lis) == JSON.stringify(JSON.parse(dataJson).lis) &&  
+          // JSON.stringify(jsonData.pacs) == JSON.stringify(JSON.parse(dataJson).pacs) &&     
+          // JSON.stringify(jsonData.diag) == JSON.stringify(JSON.parse(dataJson).diag) &&    
+          // JSON.stringify(jsonData.advice) == JSON.stringify(JSON.parse(dataJson).advice) &&        
+          // JSON.stringify(jsonData.addItems) == JSON.stringify(JSON.parse(dataJson).addItems)
         ){
           Notify.info('该模板已保存');
           return false;

+ 1 - 0
src/components/Preview/index.jsx

@@ -28,6 +28,7 @@ class Preview extends Component {
             dataJson={dataJson}
             dataStr={dataStr}
             show={false}
+            come={'preview'}
         ></PreviewBody>
       </div>
     </div>

+ 2 - 2
src/components/PreviewBody/Inspect/index.jsx

@@ -7,7 +7,7 @@ const PreviewInspect = (props) => {
       <td className={style['patInfoSec']}>化验:</td>
       <td className={style['patInfoSec']}>
         {
-          dataJson.lis.getExcelDataList && dataJson.lis.getExcelDataList.map((items) => {
+          dataJson&&dataJson.getExcelDataList && dataJson.getExcelDataList.map((items) => {
             return items.lisExcelRes && items.lisExcelRes.map((item) => {
               return <table style={style.assistTable}>
                 <tr style={style.assistTableTrFst}><td><span>{item.menus}</span></td></tr>
@@ -32,7 +32,7 @@ const PreviewInspect = (props) => {
           })
         }
         {
-          dataJson.lis.labelList && dataJson.lis.labelList.map((item, idx) => {
+          dataJson&&dataJson.labelList && dataJson.labelList.map((item, idx) => {
             return <table style={{ margin: '8px 0', width: '100%' }}>
               {
                 item.show?<tr className={style.assistTableTrFst}><td><span> {item.name} </span></td></tr>:

+ 3 - 3
src/components/PreviewBody/ItemPart/index.jsx

@@ -22,9 +22,9 @@ const ItemPart = (props) => {
       </td>:
       <td className={style['patInfoSec']}>
       {
-        other_yjs.str1
+        other_yjs&&other_yjs.str1
       }
-      {dataJson['yjs_1']||dataJson['yjs_2']||dataJson['yjs_3']||dataJson['yjs_4']?<table className={style['formulaTable']}>
+      {(dataJson&&dataJson['yjs_1'])||(dataJson&&dataJson['yjs_2'])||(dataJson&&dataJson['yjs_3'])||(dataJson&&dataJson['yjs_4'])?<table className={style['formulaTable']}>
         <tr>
           <td rowSpan='2' className={style['alignMiddle']}>月经史:(</td>
           <td rowSpan='2' className={style['alignMiddle']}>{dataJson['yjs_1']||'初潮年龄'}</td>
@@ -36,7 +36,7 @@ const ItemPart = (props) => {
         </tr>
       </table>:''}
       {
-        other_yjs.str2
+       other_yjs&&other_yjs.str2
       }
     </td>
 

+ 25 - 13
src/components/PreviewBody/index.jsx

@@ -101,8 +101,20 @@ class PreviewBody extends Component {
     }
   }
   render() {
-    const { show, preInfo, dataJson, dataStr, baseObj, flg ,showAssessBtn,showHistoryCases} = this.props;
-    const other_yjs = dataStr.other?filterOtherDataArr(JSON.parse(dataStr.other),dataJson.other):'';
+    const { show, preInfo, dataJson, dataStr, baseObj, flg ,come,showAssessBtn,showHistoryCases} = this.props;
+    let other_data={},lis_data={},pas_data={},other_yjs='',access='',adviceData={};
+    if(!come){
+      other_data = JSON.parse(baseObj.detailList[2].contentJson)
+      lis_data = JSON.parse(baseObj.detailList[4].contentJson)
+      pas_data = JSON.parse(baseObj.detailList[5].contentJson)
+      adviceData = JSON.parse(baseObj.detailList[7].contentJson)
+      other_yjs = other_data&&other_data.pfix;
+      access = other_data&&other_data.haveAssess
+    }else{
+      other_yjs = dataStr.other?filterOtherDataArr(JSON.parse(dataStr.other),dataJson.other):'';
+      access = dataJson.haveAssess
+      adviceData=dataJson.advice
+    }
     //const isChronic = (dataJson.diagChronicMagItem&&dataJson.diagChronicMagItem.name)||(dataJson.mainChronicDesease&&dataJson.mainChronicDesease.name);
     const noData = JSON.stringify(preInfo) == '{}';
     return <div className={style['content']} style={{ width: flg ? '700' : '820' }}>
@@ -111,26 +123,26 @@ class PreviewBody extends Component {
         <table className={style['infos']}>
           <ItemPart dataStr={dataStr.chief} title={'主诉:'} type={1}></ItemPart>
           <ItemPart dataStr={dataStr.present} title={'现病史:'} type={1}></ItemPart>
-          <ItemPart dataStr={dataStr.present} title={'其他史:'} dataJson={dataJson} other_yjs={other_yjs} type={3}></ItemPart>
+          <ItemPart dataStr={dataStr.present} title={'其他史:'} dataJson={come?dataJson:other_data} other_yjs={other_yjs} type={3}></ItemPart>
           <ItemPart dataStr={dataStr.vital} title={'查体:'} type={1}></ItemPart>
-          <PreviewInspect dataJson={dataJson} toTime={this.toTime} dateTime={this.state.dateTime} showDetails={this.showDetails}></PreviewInspect>
+          <PreviewInspect dataJson={come?dataJson.lis:lis_data} toTime={this.toTime} dateTime={this.state.dateTime} showDetails={this.showDetails}></PreviewInspect>
           <ItemPart dataStr={dataStr.pacs} title={'辅检:'} type={2}></ItemPart>
           <ItemPart dataStr={dataStr.diag} title={'诊断:'} type={2}></ItemPart>
           <tr className={style['patInfoFst']}>
             <td className={style['patInfoSec']}>医嘱:</td>
             <td className={`${style['patInfoSec']} ${style['pushMessage']} ${style['font14']}`}>
-              {((dataJson.advice.assay && dataJson.advice.assay.length > 0) || (dataJson.advice.check && dataJson.advice.assay.check > 0)) && <p className={style.pushMessageTitle}><span>开单项目</span></p>}
+              {((adviceData&&adviceData.assay && adviceData.assay.length > 0) || ((adviceData&&adviceData.check)&& (adviceData&&adviceData.assay.check > 0))) && <p className={style.pushMessageTitle}><span>开单项目</span></p>}
               {
-                ((dataJson.advice.assay && dataJson.advice.assay.length > 0) || (dataJson.advice.check && dataJson.advice.assay.check > 0)) && <div className={style.pushMessageDes}>{dataJson.advice.check?dataJson.advice.check+',':''} {dataJson.advice.assay}</div>
+                ((adviceData&&adviceData.assay && adviceData.assay.length > 0) || ((adviceData&&adviceData.check) && (adviceData&&adviceData.assay.check > 0))) && <div className={style.pushMessageDes}>{adviceData.check?adviceData.check+',':''} {adviceData.assay}</div>
               }
-              {dataJson.advice.commontreatment && dataJson.advice.commontreatment.length > 0 && <p  className={style.pushMessageTitle}><span>一般治疗</span></p>}
+              {adviceData&&adviceData.commontreatment && adviceData.commontreatment.length > 0 && <p  className={style.pushMessageTitle}><span>一般治疗</span></p>}
               {
-                dataJson.advice.commontreatment && <div dangerouslySetInnerHTML={{__html: dataJson.advice.commontreatment}} className={style.pushMessageDes}></div>
+                adviceData&&adviceData.commontreatment && <div dangerouslySetInnerHTML={{__html: adviceData.commontreatment}} className={style.pushMessageDes}></div>
               }
-              {dataJson.advice.followUp && dataJson.advice.followUp.length > 0 && <p className={style.pushMessageTitle}><span>回访时间:<span className={style['bbtm']}>{dataJson.advice.followUp}</span> 后回访,不适随诊</span></p>}
-              {dataJson.advice.scheme && dataJson.advice.scheme.length > 0 && <p className={style.pushMessageTitle}><span>治疗方案</span></p>}
+              {adviceData&&adviceData.followUp && adviceData.followUp.length > 0 && <p className={style.pushMessageTitle}><span>回访时间:<span className={style['bbtm']}>{adviceData.followUp}</span> 后回访,不适随诊</span></p>}
+              {adviceData&&adviceData.scheme && adviceData.scheme.length > 0 && <p className={style.pushMessageTitle}><span>治疗方案</span></p>}
               {
-                dataJson.advice.scheme && dataJson.advice.scheme.map((item, index) => {
+                adviceData&&adviceData.scheme && adviceData.scheme.map((item, index) => {
                   return <p>{item.treatment.map((it, ii) => {
                     return (it.treatmentStr && it.treatmentStr.length > 0 ?
                       <div className={style.pushMessageDes}>{it.treatmentStr}</div> : '')
@@ -138,13 +150,13 @@ class PreviewBody extends Component {
                   })
               }
               {
-                dataJson.advice.adviceInput && <div className={style.pushMessageDes}>{dataJson.advice.adviceInput}</div>
+                adviceData&&adviceData.adviceInput && <div dangerouslySetInnerHTML={{__html: adviceData.adviceInput}} className={style.pushMessageDes}></div>
               }
             </td>
           </tr>
         </table>
         <p className={style.docName}>医生签名:<span>{baseObj ? baseObj.doctorName : (noData ? '' : preInfo.doctorName)}</span></p>
-        {showAssessBtn&&dataJson.haveAssess?<AssessResultHis showHistoryCases={showHistoryCases} inquiryId={baseObj&&baseObj.id} inquiryDate={baseObj&&baseObj.inquiryDate}></AssessResultHis>:""}
+        {showAssessBtn&&access?<AssessResultHis showHistoryCases={showHistoryCases} inquiryId={baseObj&&baseObj.id} inquiryDate={baseObj&&baseObj.inquiryDate}></AssessResultHis>:""}
         <div onClick={() => { this.surePrint(dataStr) }} className={style.printBtn} style={{
           display: show ? 'inline-block' : 'none',
         }}>打印</div>

+ 1 - 0
src/components/PrintPreview/index.jsx

@@ -33,6 +33,7 @@ class PrintPreview extends Component {
                       show={true}
                       onClose={onClose}
                       save={save}
+                      come={'preview'}
                   ></PreviewBody>
             </div>
         </div>

+ 16 - 6
src/components/PushContainer/index.jsx

@@ -2,8 +2,7 @@ import React, { Component } from 'react';
 import style from './index.less';
 import { Tab, ConfirmModal, Notify } from '@commonComp';
 import { tabChange, allChecked, changeVisible, keepPushData, allCheckedShow } from '@store/actions/tabTemplate';
-import { initItemList, delItem, delBatchItem, changeTitleAsync, saveTemplateDetail } from '@store/async-actions/tabTemplate';
-import { CHANGE_TYPE } from "@store/types/typeConfig";
+import { initItemList, delItem, delBatchItem, changeTitleAsync, setPageView } from '@store/async-actions/tabTemplate';
 import { connect } from "react-redux";
 import store from '@store';
 import { billing } from '@store/async-actions/pushMessage';
@@ -66,7 +65,7 @@ class PushContainer extends Component {
    */
   handleActiveClick(id) {
     if (id == '1') {
-      store.dispatch(initItemList());
+      store.dispatch(initItemList("",1));
     }
     store.dispatch(tabChange(id))
   }
@@ -205,6 +204,11 @@ class PushContainer extends Component {
     })
     store.dispatch(changeVisible(true))
   }
+  handleClickGetMore(page){
+    let tmpPage = ++page
+    store.dispatch(initItemList("",tmpPage,true))
+  }
+  
   makeSure() {
     if (this.state.type == 1) {
       store.dispatch(delItem(this.state.id))
@@ -225,11 +229,12 @@ class PushContainer extends Component {
       store.dispatch(changeTitleAsync(tempObj))
     } else if (this.state.type == 4) {        //模板引入
       const { items } = this.props;
+      store.dispatch(setPageView(this.state.id,items[0].type))
       items && items.map((part) => {
         if (this.state.id == part.id) {
           let typeConfig = part.type;
-          store.dispatch(keepPushData(part, 'part'))                 //引用数据的存储,用于保存模板是判断数据是否变化
-          pushAllDataList(typeConfig, 'push', part, 'template')       //引用
+          // store.dispatch(keepPushData(part, 'part'))//引用数据的存储,用于保存模板是判断数据是否变化
+          // pushAllDataList(typeConfig, 'push', part, 'template')//引用
           if (didPushParamChange()) {
             store.dispatch(billing())
           }
@@ -242,7 +247,7 @@ class PushContainer extends Component {
     store.dispatch(changeVisible(false));
   }
   render() {
-    const { activeId, checkItems, visible, showMsg, items, allCheckShow } = this.props;
+    const { activeId, checkItems, visible, showMsg,hasMore,current, items, allCheckShow } = this.props;
     return <div className={style["container"]} ref={this.$cont} >
       <Tab tabs={this.state.tabs}
         activeId={activeId}
@@ -252,6 +257,8 @@ class PushContainer extends Component {
           <PushItemsContainer></PushItemsContainer>
           <TemplateItems
             items={items}
+            current={current}
+            hasMore={hasMore}
             checkItems={checkItems}
             allCheckShow={allCheckShow}
             handleContentClick={this.handleContentClick}
@@ -260,6 +267,7 @@ class PushContainer extends Component {
             handleDelList={this.handleDelList}
             handleMangerTemplate={this.handleMangerTemplate}
             handleAllCheckbox={this.handleAllCheckbox}
+            handleClickGetMore={this.handleClickGetMore}
           ></TemplateItems>
           <MedicalInfoContainer></MedicalInfoContainer>
           <ScaleSearchContainer></ScaleSearchContainer>
@@ -285,6 +293,8 @@ class PushContainer extends Component {
 const mapStateToProps = (state) => {
   return {
     items: state.tabTemplate.items,
+    current: state.tabTemplate.current,
+    hasMore: state.tabTemplate.hasMore,
     activeId: state.tabTemplate.activeId,
     checkItems: state.tabTemplate.checkItems,
     allChecked: state.tabTemplate.allChecked,

+ 1 - 1
src/components/RadioDrop/index.jsx

@@ -152,7 +152,7 @@ class RadioDrop extends Component{
       <div className={this.getClass()}
            onBlur={this.handleEditLabel}
            contentEditable={this.state.editable}
-           onDoubleClick={this.handledbClick}
+           onDoubleClick={hideTag?null:this.handledbClick}
            onFocus={(e)=>{e.stopPropagation()}}
            onClick={(e)=>this.handleShow(e,true)}
            onkeydown={handleEnter}>

+ 3 - 3
src/components/RadioInpDrop/index.jsx

@@ -205,15 +205,15 @@ class RadioInpDrop extends Component{
     return list;
   }
   render(){
-    const {data,show,vals,placeholder} = this.props;
+    const {data,show,vals,placeholder,hideTag} = this.props;
     const {boxLeft,boxTop} = this.state;
     return <div className={style['container']} ref = {this.$cont}>
       <div className={this.getClass()}
            onBlur={this.handleEditLabel}
            contentEditable={this.state.editable}
-           onDoubleClick={this.handledbClick}
+           onDoubleClick={hideTag?null:this.handledbClick}
            onClick={(e)=>this.handleShow(e,true)}
-           onkeydown={handleEnter}>
+           onKeyDown={handleEnter}>
         {vals?this.parseInputDom():<span>{placeholder}</span>}
       </div>
       <DropList onSelect={this.handleSelect} data={data} left={boxLeft} top={boxTop} show={show}/>

+ 6 - 1
src/components/TemplateItems/index.jsx

@@ -50,7 +50,8 @@ class TemplateItems extends React.Component {
         }
     }
     render() {
-        const { allCheckShow, handleMangerTemplate, handleDelList, handleAllCheckbox, items,checkItems } = this.props;
+        const { allCheckShow, handleMangerTemplate,handleClickGetMore, handleDelList, handleAllCheckbox, items,checkItems,current,hasMore } = this.props;
+        // console.log(hasMore,current,7877877)
         return (
             <div className={style.wrapper}>
                 {
@@ -75,6 +76,10 @@ class TemplateItems extends React.Component {
                         this.genItems().length > 0?this.genItems():
                         <Empty message={'还没有保存模板'}></Empty>
                     }
+                    {
+                      hasMore?<p onClick={()=>handleClickGetMore(current)} className={style.loadMore}>点击查看更多</p>:null
+                    }
+                    
                 </div>
             </div>
         )

+ 6 - 0
src/components/TemplateItems/index.less

@@ -52,5 +52,11 @@
             color: @template-color;
         }
     }
+    .loadMore {
+      text-align: center;
+      color: #2a9bd5;
+      cursor: pointer;
+      margin-top: 15px;
+    }
 }
 

+ 4 - 2
src/components/Treat/index.jsx

@@ -16,6 +16,7 @@ import drugIcon from './img/drug.png';
 import adverseReactionIcon from './img/adverseReaction.png';
 import $ from "jquery";
 import {dragBox} from '@utils/drag';
+import ReactDom from "react-dom";
 
 class Treat extends Component {
     constructor(props){
@@ -65,7 +66,8 @@ class Treat extends Component {
                 selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo,
                 title, drugInfoList, hideDrugInfoMore, adversReactionList, changeReact, followUp, setFollowUp, isRead, hasFollowUp} = this.props;
         const { zIndex,show } = this.state
-        return(
+        const domNode = document.getElementById('root');
+        return ReactDom.createPortal(
             <div   className={style['treat-wrapper']}>
                 <div className={style['treat-mask']} onClick={this.hideTreat}>
                 </div>
@@ -125,7 +127,7 @@ class Treat extends Component {
                 {showDrug && drugInfo && <DrugInfo setTreatBox={this.setTreatBox} treatIndexSet={treatIndexSet} drugInfo = {drugInfo} hideDrugInfo = {hideDrugInfo}></DrugInfo>}
                 {/* 查询多个药品说明书 (添加数据查看药品说明书用)*/}
                 {/* {showDrug && <DrugInfo drugInfoList = {drugInfoList} hideDrugInfoMore = {hideDrugInfoMore}></DrugInfo>} */}
-            </div>
+            </div>,domNode
         )
     }
 }

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

@@ -6,34 +6,87 @@ import {getStatusImg} from '@utils/tools';
 
 class WrapModalTableSon extends React.Component {
   constructor(props) {
-    super(props)
+    super(props);
+    this.state = {
+      msg:'选中异常值数据'
+    }
     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,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=='取消选中异常值数据集'?'选中异常值数据':'取消选中异常值数据集'
+    })
+    selectWaring&&selectWaring()
+  }
+  allCheckImportIns(){
+    const { allCheckImportIns,allCheck } = this.props;
+    if(!allCheck){
+      this.setState({
+        msg:'取消选中异常值数据集'
+      })
+    }else{
+      this.setState({
+        msg:'选中异常值数据'
+      })
     }
+    allCheckImportIns&&allCheckImportIns()
   }
   render() {
-    const { hospitalSonInspect,allCheckImportIns,allCheck,selectWaring } = 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={selectWaring}>选中异常值数据</span>
+        <span>组名称 : {hospitalSonInspect.groupName}</span><span className={style.btn} onClick={this.selectWaring}>{this.state.msg}</span>
       </div>
       <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>

+ 4 - 4
src/components/WrapModalBodyPac/WrapModalTableSon/index.jsx

@@ -8,19 +8,19 @@ class WrapModalTableSon extends React.Component {
     super(props)
     this.getImgPath = this.getImgPath.bind(this)
   }
-  getImgPath(name,checkItem,item){
+  getImgPath(name,checkItem,item,idx){
     const { checkedList,selectOneCheck } = 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,checkItem,item)} src={check_right} alt="" />
+        return <img className={style.check} onClick={()=>selectOneCheck(name,checkItem,item,idx)} src={check_right} alt="" />
       }else{
         ++num
       }
     }
     if(num == checkedList.length){
-      return <img className={style.check} onClick={()=>selectOneCheck(name,checkItem,item)} src={check_circle} alt="" />
+      return <img className={style.check} onClick={()=>selectOneCheck(name,checkItem,item,idx)} src={check_circle} alt="" />
     }
   }
   render() {
@@ -48,7 +48,7 @@ class WrapModalTableSon extends React.Component {
               return <tr>
                 <td className={`${style.fst}`}>
                   {
-                    this.getImgPath(item.checkItem,hospitalSonInspect.checkItem,item)
+                    this.getImgPath(item.checkItem,hospitalSonInspect.checkItem,item,idx)
                   }
                 </td>
                 <td title={item.checkItem} className={`${style.sec}`}>{item.checkItem}</td>

+ 0 - 10
src/containers/CurrentIll.js

@@ -56,18 +56,8 @@ function mapDispatchToProps(dispatch) {
           clickType:'单击',
           num:1
         });
-        // 判断是否有子模板数据
-        const sonId = obj.relationModule;//子模板id
-        let sonArr = allModules.filter((item)=>{return item.id==sonId})
-        if(sonArr.length==0){//未匹配到子模板
-          Notify.info("未找到相关内容");
-          return
-        }
         dispatch({
           type:INSERT_PROCESS,
-          // id:obj.relationModule,
-          // allModules:allModules
-          addSmoduleData:JSON.parse(JSON.stringify(sonArr[0].moduleDetailDTOList))
         });
         dispatch({
           type:ISREAD

+ 2 - 5
src/containers/DiagnosticList.js

@@ -1,16 +1,13 @@
 import React from 'react';
 import { connect } from 'react-redux';
 import DiagnosticList from '@components/DiagnosticList';
-import { ADD_DIAGNOSTIC,  DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, GET_DIAGNOSTIC_STR, GET_IS_FIRST, HIDE_REFER_RECORD, SHOW_HISTORY_CASE,HIDE_HISTORY_CASE ,SHOW_LOADING} from '@store/types/diagnosticList'; 
+import { DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, GET_DIAGNOSTIC_STR, HIDE_REFER_RECORD, SHOW_HISTORY_CASE,HIDE_HISTORY_CASE ,SHOW_LOADING} from '@store/types/diagnosticList'; 
 import { getTreatResult } from '@store/async-actions/treat';
 import { SHOW_TREAT, DEL_REACT, DEL_FOLLOW_UP } from '@store/types/treat.js';
 import {billing, getConceptDetail} from '../store/async-actions/pushMessage';
 import {keepPushData} from '@store/actions/tabTemplate';
-import { showHistory,sortHistory,activeHistory,visibleHistory } from '@store/actions/historyTemplates'
-import {CURRENT_CHRONIC} from '@store/types/currentIll';
+import { visibleHistory } from '@store/actions/historyTemplates'
 import {autoFillModules} from '@store/async-actions/fetchModules';
-import { initItemList } from '@store/async-actions/historyTemplates';
-import {MODI_LOADING} from '@store/types/homePage.js';
 import {SET_ASSESS_DATA} from '@types/assessResult';
 
 function mapStateToProps(state) {

+ 9 - 8
src/containers/EditableSpan.js

@@ -223,20 +223,20 @@ function mapDispatchToProps(dispatch,state) {
           break;
       }
     },
-    handleKeydown(obj){//backspace删除
+    handleKeydown(obj){//backspace删除 + delete
       if(obj.i==null){return}
       switch (+obj.boxMark){
         case 1:
-          dispatch({type:DEL_MAIN,delIndex:obj.i,text:obj.text});
+          dispatch({type:DEL_MAIN,delIndex:obj.i,text:obj.text,flag:obj.flag});
           break;
         case 2:
-          dispatch({type:DEL_CURRENT,delIndex:obj.i,text:obj.text});
+          dispatch({type:DEL_CURRENT,delIndex:obj.i,text:obj.text,flag:obj.flag});
           break;
         case 3:
-          dispatch({type:DEL_OTHERHIS,delIndex:obj.i});
+          dispatch({type:DEL_OTHERHIS,delIndex:obj.i,flag:obj.flag});
           break;
         case 4:
-          dispatch({type:DEL_CHECKBODY,delIndex:obj.i});
+          dispatch({type:DEL_CHECKBODY,delIndex:obj.i,flag:obj.flag});
           break;
         default:
           break;
@@ -247,15 +247,16 @@ function mapDispatchToProps(dispatch,state) {
       })
     },
     removeId(obj){//删除时移除id
+      if(obj.i==null){return}
       switch (+obj.boxMark){
         case 1:
-          dispatch({type:REMOVE_MAIN_ID,index:obj.i,text:obj.text});
+          dispatch({type:REMOVE_MAIN_ID,index:obj.i,text:obj.text,flag:obj.flag});
           break;
         case 2:
-          dispatch({type:REMOVE_CURR_ID,index:obj.i,text:obj.text});
+          dispatch({type:REMOVE_CURR_ID,index:obj.i,text:obj.text,flag:obj.flag});
           break;
         case 3:
-          dispatch({type:REMOVE_OTHER_ID,index:obj.i});//移除多余空标签
+          dispatch({type:REMOVE_OTHER_ID,index:obj.i,flag:obj.flag});//移除多余空标签
           break;
         default:
           break;

+ 9 - 8
src/containers/Emergency.js

@@ -7,13 +7,14 @@ import { getSearchList } from '@store/async-actions/diagnosticSearch';
 import {Notify} from '@commonComp';
 
 const mapStateToProps = function(state){
-  const {emergencyHis} = state;
+  const {emergencyHis,patInfo} = state;
   return {
     data:emergencyHis.allHisRecord,
     total:emergencyHis.total,
     params:emergencyHis.params,
     preInfo : state.patInfo.message,
     searchData:emergencyHis.searchData,
+    info:patInfo.message
   }
 }
 
@@ -25,9 +26,9 @@ const mapDispatchToProps = function(dispatch){
     filterData(obj){
       dispatch(getFilterHis(obj))
     },
-    async getDownload(ids){
-      let resData = await downloadData(ids);
-      downloadExportedData(resData.data,"全科历史病历");
+    async getDownload(obj){
+      let resData = await downloadData(obj.ids);
+      downloadExportedData(resData.data,obj.info.hospitalDeptName+"病历");
     },
     clearHisRecord(){
       dispatch({type:CLEAR_RECORD})
@@ -35,12 +36,12 @@ const mapDispatchToProps = function(dispatch){
     handleChangeValue(val){
       dispatch(getSearchList(val,true))
     },
-    async addSecond(item){
-      // dispatch(addSecondDiag(item))
-      let resData = await addSecondDiag(item);
+    async addSecond(obj){
+      let resData = await addSecondDiag(obj.item);
       if(resData&&resData.data.code==0){
         Notify.info("添加成功");
-        dispatch(getFilterHis({flag:-1}));
+        // dispatch(getFilterHis({flag:-1}));
+        dispatch(getFilterHis({flag:obj.flag}));
       }
       
     }

+ 0 - 25
src/containers/InlineTag.js

@@ -6,7 +6,6 @@ import {SETCURRENTINPUT,CURRENT_TEXT_LABEL} from '@types/currentIll';
 import {SETCHECKINPUT} from "@types/checkBody";
 import InlineTag from "../common/components/InlineTag";
 import {getLabelIndex} from '@utils/tools.js';
-import {CLICKCOUNT} from '@types/homePage.js';
 import {CHANGEOTHERTEXTLABEL} from "../store/types/otherHistory";
 import {CHANGECHECKTEXTLABEL} from "../store/types/checkBody";
 import {CHANGE_LABELVAL} from "../store/types/mainSuit";
@@ -22,13 +21,6 @@ const tagInpActions = {
   4:SETCHECKINPUT
 };
 
-const inpEditActions = {
-  1:CHANGE_LABELVAL,
-  2:CURRENT_TEXT_LABEL,
-  3:CHANGEOTHERTEXTLABEL,
-  4:CHANGECHECKTEXTLABEL
-};
-
 function mapDispatchToProps(dispatch,store){
   return {
     handleInput(params) {
@@ -45,23 +37,6 @@ function mapDispatchToProps(dispatch,store){
         subIndex:inner
       })
     },
-    handledbClick(obj){
-      dispatch({
-        type:CLICKCOUNT,
-        data:obj,
-        clickType:'双击',
-        num:1
-      });
-    },
-    saveEditText(obj){
-      const i = getLabelIndex(obj.ikey);
-      const type = obj.ikey.substr(0,1);
-      obj.ikey = i;
-      dispatch({
-        type:inpEditActions[type],
-        data:obj
-      })
-    }
   }
 }
 

+ 2 - 15
src/containers/MainSuit.js

@@ -59,7 +59,8 @@ function mapDispatchToProps(dispatch) {
             type: CLEAR_COMSYMPTOMS
           })
         },
-        handleTailClick:(obj,saveText,allModules)=>{//点击带尾巴的标签,如添加病程变化
+        handleTailClick:(obj,saveText,allModules)=>{
+        //点击带尾巴的标签,如添加病程变化
           let text = filterDataArr(saveText);
           if(text.length >= config.limited){
             Notify.info(config.limitText);
@@ -72,22 +73,8 @@ function mapDispatchToProps(dispatch) {
             clickType:'单击',
             num:1
           });
-          // 判断是否有子模板数据
-          const sonId = obj.relationModule;
-          let sonArr = allModules.filter((item)=>{return item.id==sonId})
-          if(sonArr.length==0){//未匹配到子模板
-            Notify.info("未找到相关内容");
-            return
-          }
-          /*dispatch({
-            type: SHOW_TAIL,
-            info:obj.questionMapping,
-            id:obj.relationModule,
-            allModules:allModules
-          })*/
           dispatch({
             type: SHOW_TAIL,
-            addSmoduleData:JSON.parse(JSON.stringify(sonArr[0].moduleDetailDTOList))
           })
           dispatch({
             type:ISREAD

+ 5 - 39
src/containers/MultSpread.js

@@ -1,11 +1,11 @@
 import React from 'react';
 import {connect} from 'react-redux';
 import MultSpread from "@components/MultSpread";
-import {SETSELECTED,CLEARSELECTED,CONFIRMSELECTED,CHANGEOTHERTEXTLABEL,OTHERADDLABELITEM} from '@types/otherHistory';
-import {CHANGECHECKTEXTLABEL,ADDLABELITEM} from '@types/checkBody.js';
-import {CHANGE_LABELVAL,MAINADDLABELITEM} from '@store/types/mainSuit.js';
-import {CURRENTADDLABELITEM,CURRENT_TEXT_LABEL} from '@store/types/currentIll.js';
-import {HIDE,RESET,CLICKCOUNT,SETADDITEMINIT,ISREAD} from '@store/types/homePage.js';
+import {OTHERADDLABELITEM} from '@types/otherHistory';
+import {ADDLABELITEM} from '@types/checkBody';
+import {MAINADDLABELITEM} from '@store/types/mainSuit';
+import {CURRENTADDLABELITEM} from '@store/types/currentIll';
+import {HIDE,RESET,CLICKCOUNT,SETADDITEMINIT,ISREAD} from '@store/types/homePage';
 
 function mapStateToProps(state){
   return {}
@@ -34,15 +34,6 @@ const getCopyData = (copyId,inx,boxMark)=>{
   }
 };
 
-/**************************双击标签输入*********************************/
-
-const editTypes={
-  1:CHANGE_LABELVAL,      //主诉
-  2:CURRENT_TEXT_LABEL,                   //现病史
-  3:CHANGEOTHERTEXTLABEL,  //其他史
-  4:CHANGECHECKTEXTLABEL    //查体
-};
-
 function mapDispatchToProps(dispatch){
   return {
     resetHide(){
@@ -50,14 +41,6 @@ function mapDispatchToProps(dispatch){
         type: RESET
       })
     },
-    handleDbclick(obj){
-      dispatch({
-        type:CLICKCOUNT,
-        data:obj,
-        clickType:'双击',
-        num:1
-      });
-    },
     saveAddItem(id,data){      //保存有加号的标签原始数据
       dispatch({
         type:SETADDITEMINIT,
@@ -78,16 +61,6 @@ function mapDispatchToProps(dispatch){
       });
       dispatch(getCopyData(copyId,inx,boxMark));
     },
-    saveEditText(params){
-      const {type} = params;
-      const index = params.ikey;
-      let ikey = index.split("-")[1];
-      const {changeVal,totalVal} = params;
-      dispatch({
-        type:editTypes[+type],
-        data:{changeVal:changeVal,ikey:ikey,totalVal}
-      });
-    },
     handleClick(obj){
       dispatch({
         type:CLICKCOUNT,
@@ -96,13 +69,6 @@ function mapDispatchToProps(dispatch){
         num:1
       });
     }
-    /*handleConfirm(checks,key){
-      dispatch({
-        type: CONFIRMSELECTED,
-        checks,
-        key
-      })
-    }*/
   }
 }
 

+ 7 - 81
src/containers/NumberDrop.js

@@ -1,15 +1,15 @@
 import React from 'react';
 import {connect} from 'react-redux';
 import NumberDrop from "@components/NumberDrop";
-import {SETNUMBER,CHANGEOTHERTEXTLABEL,CHANGEOTHERTEXTLABEL_NUMBER} from '@types/otherHistory';
-import {SETNUMBER4,CHANGECHECKTEXTLABEL,CHANGECHECKTEXTLABEL_NUMBER} from '@types/checkBody.js';
-import {SETDROPSHOW,CLICKCOUNT,HIDE,RESET,HIDEDROP,ISREAD} from '@types/homePage.js';
-import {NUMBER_SELECT,CHANGE_LABELVAL,CHANGE_LABELVAL_NUMBER} from '@store/types/mainSuit.js';
-import {CURRENT_NUMBER,CURRENT_TEXT_LABEL,CURRENT_TEXT_LABEL_NUMBER} from '@store/types/currentIll.js';
+import {SETNUMBER,CHANGEOTHERTEXTLABEL} from '@types/otherHistory';
+import {SETNUMBER4} from '@types/checkBody';
+import {SETDROPSHOW,CLICKCOUNT,HIDE,RESET,HIDEDROP,ISREAD} from '@types/homePage';
+import {NUMBER_SELECT} from '@store/types/mainSuit';
+import {CURRENT_NUMBER} from '@store/types/currentIll';
 import {billing} from '@store/async-actions/pushMessage';
 import {Notify} from '@commonComp';
-import {filterArr,didPushParamChange,filterDataArr,getLabelIndex} from '@utils/tools.js';
-import config from '@config/index.js';
+import {filterArr,didPushParamChange,filterDataArr} from '@utils/tools';
+import config from '@config/index';
 
 function mapStateToProps(state){
   return {
@@ -69,55 +69,7 @@ function handleModuleDiff(dispatch,params){
     default:
   }
 }
-/**************************双击标签输入*********************************/
-// 主诉
-function mainSuitLabel(dispatch,params){
-  const index = params.ikey;
-  let ikey = getLabelIndex(index);
-  const {changeVal,totalVal} = params;
-  dispatch({
-    // type:CHANGE_LABELVAL,
-    type:CHANGE_LABELVAL_NUMBER,
-    data:Object.assign({},params,{ikey})
-  })
-}
-// 现病史
-function currentLabel(dispatch,params){
-  const index = params.ikey;
-  let ikey = getLabelIndex(index);
-  dispatch({
-    // type:CURRENT_TEXT_LABEL,
-    type:CURRENT_TEXT_LABEL_NUMBER,
-    data:Object.assign({},params,{ikey})
-  });
-  dispatch({
-    type:ISREAD
-  })
-}
-
-//其他史
-function otherHisLabelEdit(dispatch,params){
-  const index = params.ikey;
-  //const {changeVal,totalVal} = params;
-  let ikey = getLabelIndex(index);
-  dispatch({
-    // type:CHANGEOTHERTEXTLABEL,
-    type:CHANGEOTHERTEXTLABEL_NUMBER,
-    data:Object.assign({},params,{ikey})
-  })
-}
 
-//查体
-function checkBodyLabelEdit(dispatch,params){
-  const index = params.ikey;
-  let ikey = getLabelIndex(index);
-  //const {changeVal,totalVal} = params;
-  dispatch({
-    // type:CHANGECHECKTEXTLABEL,
-    type:CHANGECHECKTEXTLABEL_NUMBER,
-    data:Object.assign({},params,{ikey})
-  })
-}
 function mapDispatchToProps(dispatch,store){
   return {
     handleSelect(params){
@@ -130,14 +82,6 @@ function mapDispatchToProps(dispatch,store){
         }
       },config.delayPushTime);
     },
-    handleDbclick(obj){
-      dispatch({
-        type:CLICKCOUNT,
-        data:obj,
-        clickType:'双击',
-        num:1
-      });
-    },
     handleHide(){
       dispatch({
         type:HIDEDROP
@@ -158,24 +102,6 @@ function mapDispatchToProps(dispatch,store){
         type: RESET
       });*/
     },
-    handleLabelChange(params){
-      const {type} = params;
-      switch (+type){
-        case 1:
-          mainSuitLabel(dispatch,params);
-          break;
-        case 2:
-          currentLabel(dispatch,params);
-          break;
-        case 3:
-          otherHisLabelEdit(dispatch,params);
-          break;
-        case 4:
-          checkBodyLabelEdit(dispatch,params);
-          break;
-        default:
-      }
-    }
   }
 }
 

+ 1 - 1
src/containers/PushContainer.js

@@ -7,7 +7,7 @@ function mapStateToProps(state) {
     return {
         showHistoryCases:state.historyTemplates.showHistoryCases,
         activeHistory:state.historyTemplates.activeHistory,
-        items:state.historyTemplates.items,
+        items:state.historyTemplates.items
     }
 }
 

+ 1 - 1
src/containers/PushItemsContainer.js

@@ -17,7 +17,7 @@ function mapStateToProps(state) {//console.log(state)
         tableList: pushMessage.tableList,
         showList: pushMessage.showList,
         chronicPushItems: pushMessage.chronicPushItems,
-        setPushEmergencyIdx: state.pushMessage.setPushEmergencyIdx || '',  
+        setPushEmergencyIdx: state.pushMessage.setPushEmergencyIdx || '',
         sysConfig:state.homePage.sysConfig,
         windowHeight:state.homePage.windowHeight,
     }

+ 1 - 1
src/containers/TypeConfigContainer.js

@@ -49,7 +49,7 @@ function mapDispatchToProps(dispatch) {
           });
           dispatch(getOtherHisRecord());        //获取其他史最近记录
           Notify.success("模式切换成功");
-          dispatch(initItemList(confirmType));
+          dispatch(initItemList(confirmType,1));//切换模式调用模板接口
           dispatch(allCheckedShow(false))    //全选反选显示重置
           dispatch({//推送重置
             type: BILLING_ADVICE,

+ 2 - 2
src/containers/WrapModalBodyPac.js

@@ -23,8 +23,8 @@ function mapDispatchToProps(dispatch, store) {
         showInIcss(){
           dispatch(showInIcsss())
         },
-        selectOneCheck(name,checkItem,item){
-          dispatch(selectOneChecks(name,checkItem,item))
+        selectOneCheck(name,checkItem,item,idx){
+          dispatch(selectOneChecks(name,checkItem,item,idx))
         },
         allCheckImport() {
           dispatch(allCheckImports())

+ 28 - 13
src/store/actions/checkBody.js

@@ -456,20 +456,35 @@ export function setInputLabel(state,action){
 // backspace删除
 export function backspaceText(state,action){
   let res = Object.assign({},state);
-  const {delIndex} = action;
+  const {delIndex,flag} = action;
   const data = res.data;
-  if(data[delIndex-1].flag&&data[delIndex-1].flag==3){
-    // if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
-    // 前一个是文本标签或者子模板 不做处理
-  }else if(data[delIndex-1].tagType==8){
-    data.splice(delIndex,1);
-    res.selecteds.splice(delIndex,1);      //杂音类样式选中状态对应
-    res.saveText.splice(delIndex,1);
-  }
-  else{
-    data.splice(delIndex-1,2);
-    res.selecteds.splice(delIndex-1,2);      //杂音类样式选中状态对应
-    res.saveText.splice(delIndex-1,2);
+  if(flag == 'backsp'){
+    // 前一个是文本标签或者子模板,只改变值
+    if(data[delIndex-1].flag&&data[delIndex-1].flag==3){//子模板不删  
+      // data[delIndex].value = text;
+    }else if(data[delIndex-1].tagType==8){
+      data.splice(delIndex,1);
+      res.selecteds.splice(delIndex,1);      //杂音类样式选中状态对应
+      res.saveText.splice(delIndex,1);
+    }
+    else{
+      data.splice(delIndex-1,2);
+      res.selecteds.splice(delIndex-1,2); 
+      res.saveText.splice(delIndex-1,2);
+    }
+  }else if(flag == 'del'){
+    if(data[delIndex+1] && data[delIndex+1].flag&&data[delIndex+1].flag==3){//子模板不删  
+      
+    }else if(data[delIndex+1] && data[delIndex+1].tagType==8){
+      data.splice(delIndex,1);
+      res.selecteds.splice(delIndex,1);      //杂音类样式选中状态对应
+      res.saveText.splice(delIndex,1);
+    }
+    else{
+      data.splice(delIndex,2);
+      res.selecteds.splice(delIndex,2);  
+      res.saveText.splice(delIndex,2);
+    }
   }
   // res.saveText = fullfillText(data).saveText;
   res.update = Math.random();

+ 78 - 49
src/store/actions/currentIll.js

@@ -1,6 +1,6 @@
 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){
   let index;
@@ -19,35 +19,19 @@ function insertPro(data,processModule){
 //设置模板
 export const setModule = (state,action)=>{
   const res = Object.assign({},state);
-  // 处理tagType=4的类型
   const originalData = action.data||[];
   const originalSonData = action.processModule||[];
-  let spreadLabels=[];
-  let sonSpreadLabels=[];//子模板
-  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;//病程变化模板
+  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);//空模板-子模板
   res.moduleData = spreadLabels;
   res.processModule = sonSpreadLabels;//病程变化模板
-  res.emptyData = action.emptyData;//空模板
+  res.emptyData = emptySpreadLabels;//空模板
+  res.currentEmptySon = emptySonSpreadLabels;//空模板-子模板
   let data = action.data;
   let sliceIdx;
   data&&data.map((v,i)=>{
@@ -63,7 +47,22 @@ export const setModule = (state,action)=>{
 //插入病程变化
 export const insertProcess = (state,action)=>{
   const res = Object.assign({},state);
-  let addSmoduleData = action.addSmoduleData;
+  const useEmpty = res.useEmpty;
+  let addSmoduleData = [];
+  if(res.currReadSonM.length>0){
+    addSmoduleData = JSON.parse(JSON.stringify(res.currReadSonM))
+  }else{
+    if(!useEmpty){
+      addSmoduleData = res.processModule.length>0?JSON.parse(JSON.stringify(res.processModule)):[];
+    }else{//使用空模板则取空模板的子模板
+      addSmoduleData = res.currentEmptySon.length>0?JSON.parse(JSON.stringify(res.currentEmptySon)):[];
+    }
+    
+  }
+  if(addSmoduleData.length==0){//未匹配到子模板
+    Notify.info("未找到相关内容");
+    return
+  }
   let data = res.data;
   let newData = insertPro(data,addSmoduleData);
   res.data = fullfillText(newData).newArr;
@@ -138,6 +137,7 @@ export const setData = (state,action) =>{
   if (useEmpty) {
     const data = res.emptyData?JSON.parse(JSON.stringify(res.emptyData)):[];
     res.data = fullfillText(data).newArr;
+    res.useEmpty = true; //取子模板标识
   } else {
     if(mainData&&mainData.length>0){//主诉使用模板
       // 目前只需要将第一个主诉病程移植到现病史
@@ -670,6 +670,7 @@ export const clearCurrentIll = (state,action)=>{
   res.saveText = action.saveText;
   res.selecteds = action.selecteds?action.selecteds:[];
   res.symptomIds = action.symptomIds;
+  res.currReadSonM = action.currReadSonM||[];
   if(action.editClear){
     res.editClear = action.editClear;
   }
@@ -887,21 +888,36 @@ export function setInputLabel(state,action){
 // backspace删除
 export function backspaceText(state,action){
   let res = Object.assign({},state);
-  const {delIndex,text} = action;
+  const {delIndex,text,flag} = action;
   const data = res.data;
   // if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
-  // 前一个是文本标签或者子模板,只改变值
-  if(data[delIndex-1].flag&&data[delIndex-1].flag==3){//子模板不删  
-    // data[delIndex].value = text;
-  }else if(data[delIndex-1].tagType==8){
-    data.splice(delIndex,1);
-    res.selecteds.splice(delIndex,1);      //杂音类样式选中状态对应
-    res.saveText.splice(delIndex,1);
-  }
-  else{
-    data.splice(delIndex-1,2);
-    res.selecteds.splice(delIndex-1,2);      //杂音类样式选中状态对应
-    res.saveText.splice(delIndex-1,2);
+  if(flag == 'backsp'){
+    // 前一个是文本标签或者子模板,只改变值
+    if(data[delIndex-1].flag&&data[delIndex-1].flag==3){//子模板不删  
+      // data[delIndex].value = text;
+    }else if(data[delIndex-1].tagType==8){
+      data.splice(delIndex,1);
+      res.selecteds.splice(delIndex,1);      //杂音类样式选中状态对应
+      res.saveText.splice(delIndex,1);
+    }
+    else{
+      data.splice(delIndex-1,2);
+      res.selecteds.splice(delIndex-1,2); 
+      res.saveText.splice(delIndex-1,2);
+    }
+  }else if(flag == 'del'){
+    if(data[delIndex+1] && data[delIndex+1].flag&&data[delIndex+1].flag==3){//子模板不删  
+      
+    }else if(data[delIndex+1] && data[delIndex+1].tagType==8){
+      data.splice(delIndex,1);
+      res.selecteds.splice(delIndex,1);      //杂音类样式选中状态对应
+      res.saveText.splice(delIndex,1);
+    }
+    else{
+      data.splice(delIndex,2);
+      res.selecteds.splice(delIndex,2);  
+      res.saveText.splice(delIndex,2);
+    }
   }
   // res.saveText = fullfillText(data).saveText;
   res.update = Math.random();
@@ -911,7 +927,7 @@ export function backspaceText(state,action){
 //删除后移除id
 export function removeId(state,action){
   let res = Object.assign({},state);
-  const {index,text} = action;
+  const {index,text,flag} = action;
   const data = res.data;
   // const id = data[index].id;
   const id = data[index].conceptId;
@@ -919,15 +935,28 @@ export function removeId(state,action){
   if(ids.includes(id)){
     ids.splice(ids.indexOf(id),1);
   }
-  if(!data[index].value && data[index-1].tagType==8){
-    data.splice(index,1);
-    res.saveText.splice(index,1);
+  if(flag == 'del'){
+    if(!data[index].value && data[index+1] && data[index+1].tagType==8){
+      data.splice(index,1);
+      res.saveText.splice(index,1);
+    }else{
+      data[index].id = "";
+      data[index].conceptId = "";
+      data[index].name = text;
+      data[index].value = text;
+    }
   }else{
-    data[index].id = "";
-    data[index].conceptId = "";
-    data[index].name = text;
-    data[index].value = text;
+    if(!data[index].value && data[index-1].tagType==8){
+      data.splice(index,1);
+      res.saveText.splice(index,1);
+    }else{
+      data[index].id = "";
+      data[index].conceptId = "";
+      data[index].name = text;
+      data[index].value = text;
+    }
   }
+  
   res.update = Math.random();
   return res;
 }

+ 65 - 44
src/store/actions/mainSuit.js

@@ -1,6 +1,6 @@
-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';
 
 function insertPro(data,processModule){//插入添加病情变化模板
   let index;
@@ -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;//慢病
@@ -97,7 +77,17 @@ export const handleTailClick = (state,action)=>{
   const res = Object.assign({},state);
   let num = res.moduleNum.num;
   num++;
-  let addSmoduleData = action.addSmoduleData;
+  // 有回读的子模板,则优先用回读的
+  let addSmoduleData = [];
+  if(res.mainReadSonM.length>0){
+    addSmoduleData = JSON.parse(JSON.stringify(res.mainReadSonM))
+  }else{
+    addSmoduleData = res.addSmoduleData.length>0?JSON.parse(JSON.stringify(res.addSmoduleData)):[];
+  }
+  if(addSmoduleData.length==0){//未匹配到子模板
+    Notify.info("未找到相关内容");
+    return
+  }
   let datas = JSON.parse(JSON.stringify(res.data));
   
   for(let i=0; i<addSmoduleData.length; i++){
@@ -655,6 +645,11 @@ export const clearMainSuit = (state,action)=>{//回读和清除
   res.mainIds = action.mainIds;
   res.mainTailIds = action.mainTailIds || [];
   res.chronicDesease = action.chronicDesease;//慢病疾病字段
+  res.mainReadSonM = action.mainReadSonM || [];//子模板
+  /*const readModule = action.mainReadSonM;
+  if(readModule&&readModule.length>0){//有回读子模板,则覆盖
+    res.addSmoduleData = readModule;
+  }*/
   if(action.editClear){
     res.editClear = action.editClear;
   }
@@ -734,19 +729,33 @@ export function setInputLabel(state,action){
 // backspace删除
 export function backspaceText(state,action){
   let res = Object.assign({},state);
-  const {delIndex} = action;
+  const {delIndex,flag} = action;
   const data = res.data;
-  if(data[delIndex-1].flag&&data[delIndex-1].flag==3){
-  // if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
-    // 前一个是文本标签或者子模板 不做处理
-  }else if(data[delIndex-1].tagType==8){
-    data.splice(delIndex,1);
-    res.saveText.splice(delIndex,1);
-  }
-  else{
-    data.splice(delIndex-1,2);
-    res.saveText.splice(delIndex-1,2);
+  if(flag == 'backsp'){
+    if(data[delIndex-1].flag&&data[delIndex-1].flag==3){
+    // if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
+      // 前一个是文本标签或者子模板 不做处理
+    }else if(data[delIndex-1].tagType==8){
+      data.splice(delIndex,1);
+      res.saveText.splice(delIndex,1);
+    }
+    else{
+      data.splice(delIndex-1,2);
+      res.saveText.splice(delIndex-1,2);
+    }
+  }else if(flag == 'del'){
+    if(data[delIndex+1] && data[delIndex+1].flag&&data[delIndex+1].flag==3){
+      // 后一个是文本标签或者子模板 不做处理
+    }else if(data[delIndex+1] && data[delIndex+1].tagType==8){
+      data.splice(delIndex,1);
+      res.saveText.splice(delIndex,1);
+    }
+    else{
+      data.splice(delIndex,2);
+      res.saveText.splice(delIndex,2);
+    }
   }
+  
   // res.saveText = fullfillText(data).saveText;
   res.update = Math.random();
   return res;
@@ -755,7 +764,7 @@ export function backspaceText(state,action){
 //删除后移除id
 export function removeId(state,action){
   let res = Object.assign({},state);
-  const {index,text} = action;
+  const {index,text,flag} = action;
   const data = res.data;
   // 获取尾巴id-questionId
   const id = data[index].id;
@@ -769,14 +778,26 @@ export function removeId(state,action){
   if(ids.includes(copid)){
     ids.splice(ids.indexOf(copid),1);
   }
-  if(!data[index].value && data[index-1].tagType==8){
-    data.splice(index,1);
-    res.saveText.splice(index,1);
+  if(flag == 'del'){
+    if(!data[index].value && data[index+1] &&data[index+1].tagType==8){
+      data.splice(index,1);
+      res.saveText.splice(index,1);
+    }else{
+      data[index].id = "";
+      data[index].name = text;
+      data[index].value = text;
+    }
   }else{
-    data[index].id = "";
-    data[index].name = text;
-    data[index].value = text;
+    if(!data[index].value && data[index-1].tagType==8){
+      data.splice(index,1);
+      res.saveText.splice(index,1);
+    }else{
+      data[index].id = "";
+      data[index].name = text;
+      data[index].value = text;
+    }
   }
+  
   res.update = Math.random();
   return res;
 }

+ 49 - 21
src/store/actions/otherHistory.js

@@ -448,25 +448,45 @@ export const otherEditClear = (state,action)=>{
 // backspace删除
 export function backspaceText(state,action){
   let res = Object.assign({},state);
-  const {delIndex} = action;
+  const {delIndex,flag} = action;
   const data = res.data;
-  if(data[delIndex-1].flag&&data[delIndex-1].flag==3){
-  // if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
-    // 前一个是文本标签或者子模板 不做处理
-  }else if(data[delIndex-1].tagType==8){
-    data.splice(delIndex,1);
-    res.selecteds.splice(delIndex,1);      //杂音类样式选中状态对应
-    res.saveText.splice(delIndex,1);
-  }
-  else{
-    //月经史删除处理
-    if(data[delIndex-1].formulaCode){
-      res[data[delIndex-1].formulaCode]=undefined;
+  if(flag == 'backsp'){
+    if(data[delIndex-1].flag&&data[delIndex-1].flag==3){
+    // if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
+      // 前一个是文本标签或者子模板 不做处理
+    }else if(data[delIndex-1].tagType==8){
+      data.splice(delIndex,1);
+      res.selecteds.splice(delIndex,1);      //杂音类样式选中状态对应
+      res.saveText.splice(delIndex,1);
+    }
+    else{
+      //月经史删除处理
+      if(data[delIndex-1].formulaCode){
+        res[data[delIndex-1].formulaCode]=undefined;
+      }
+      data.splice(delIndex-1,2);
+      res.selecteds.splice(delIndex-1,2);      //杂音类样式选中状态对应
+      res.saveText.splice(delIndex-1,2);
+    }
+  }else if(flag == 'del'){
+    if(data[delIndex+1] && data[delIndex+1].flag&&data[delIndex+1].flag==3){//子模板不删  
+      
+    }else if(data[delIndex+1] && data[delIndex+1].tagType==8){
+      data.splice(delIndex,1);
+      res.selecteds.splice(delIndex,1);      //杂音类样式选中状态对应
+      res.saveText.splice(delIndex,1);
+    }
+    else{
+      //月经史删除处理
+      if(data[delIndex+1] &&data[delIndex+1].formulaCode){
+        res[data[delIndex+1].formulaCode]=undefined;
+      }
+      data.splice(delIndex,2);
+      res.selecteds.splice(delIndex,2);  
+      res.saveText.splice(delIndex,2);
     }
-    data.splice(delIndex-1,2);
-    res.selecteds.splice(delIndex-1,2);      //杂音类样式选中状态对应
-    res.saveText.splice(delIndex-1,2);
   }
+  
   // res.saveText = fullfillText(data).saveText;
   res.update = Math.random();
   return res;
@@ -475,12 +495,20 @@ export function backspaceText(state,action){
 //删除后移除空标签
 export function removeId(state,action){
   let res = Object.assign({},state);
-  const {index} = action;
+  const {index,flag} = action;
   const data = res.data;
-  if(!data[index].value && data[index-1].tagType==8){
-    data.splice(index,1);
-    res.saveText.splice(index,1);
-  } 
+  if(flag == 'del'){//delete
+    if(!data[index].value && data[inde+1] && data[inde+1].tagType==8){
+      data.splice(index,1);
+      res.saveText.splice(index,1);
+    } 
+  }else{ //backspace
+    if(!data[index].value && data[index-1].tagType==8){
+      data.splice(index,1);
+      res.saveText.splice(index,1);
+    } 
+  }
+  
   res.update = Math.random();
   return res;
 }

+ 3 - 2
src/store/actions/wrapModalBodyPac.js

@@ -3,11 +3,12 @@ import {SET_ALLCHECKS,SHOW_IN_ICSSS,SELECT_ONE_CHECKS,SEARCH_HOSPITAL_PAC_SON,SE
 export const showInIcsss = () => ({         //确认选择显示到页面
   type:SHOW_IN_ICSSS
 })
-export const selectOneChecks = (name,checkItem,item) => ({         //选一个
+export const selectOneChecks = (name,checkItem,item,idx) => ({         //选一个
   type:SELECT_ONE_CHECKS,
   name,
   checkItem,
-  item
+  item,
+  idx
 })
 export const allCheckImports = () => ({         //全选反选
   type:SET_ALLCHECKS

+ 13 - 11
src/store/async-actions/fetchModules.js

@@ -1,15 +1,15 @@
-import {json,expJson} from '@utils/ajax.js';
-import {SET,PRESET} from '@types/checkBody.js';
+import {json,expJson} from '@utils/ajax';
+import {SET,PRESET} from '@types/checkBody';
 import {SETDATA} from '@store/types/otherHistory';
 import store from '@store';
-import {getEMRParams,didPushParamChange,inspectAndAssist,fullfillText,checkFullfillText,deepClone} from '@utils/tools.js';
+import {getEMRParams,didPushParamChange,inspectAndAssist,fullfillText,checkFullfillText,deepClone,filterDataArr} from '@utils/tools';
 import {Notify} from '@commonComp';
 import {billing} from '@store/async-actions/pushMessage';
 import {SETOTHERHISTORY,ISREAD} from "../types/homePage";
 import config from "@config/index";
 import {CURRENT_CHRONIC} from '@store/types/currentIll';
-import {MODI_LOADING} from '@store/types/homePage.js';
-import {GET_ALL_HIS,FILTER_ALL_HIS} from '@store/types/emergencyHis.js';
+import {MODI_LOADING} from '@store/types/homePage';
+import {GET_ALL_HIS,FILTER_ALL_HIS} from '@store/types/emergencyHis';
 import {SET_IMPORT_CHECKBODY_LABEL} from "../types/checkBody";
 
 const api={
@@ -120,17 +120,18 @@ export const getOtherHisRecord = ()=>{
               save:[objStr[0]]
             });
           }else{
+            const text = filterDataArr(objStr);
             dispatch({
               type:SETOTHERHISTORY,
-              data:arr,
-              period:{
+              data:[{tagType:8,name:'',controlType:0,value:text}],
+              /*period:{
                 yjs_1: obj.yjs_1,
                 yjs_2: obj.yjs_2,
                 yjs_3: obj.yjs_3,
                 yjs_4: obj.yjs_4,
               },
-              selecteds:obj.otherHistorySelecteds,
-              save:objStr
+              selecteds:obj.otherHistorySelecteds,*/
+              save:[text]
             });
           }
         }
@@ -339,12 +340,13 @@ export function getAllHis(item){
     const {params} = state.emergencyHis;
     let param = {};
     if(JSON.stringify(params) == '{}'){
-      param = {
+      /*param = {
         "current": item.current,
         "hospitalDeptId": message.hospitalDeptId,
         "hospitalId": message.hospitalId,
         "size": 6,
-      }
+      }*/
+      param = Object.assign({},item,{hospitalDeptId:message.hospitalDeptId,hospitalId:message.hospitalId,size:6})
     }else{
       param = Object.assign({},params,{current:item.current})
     }

+ 30 - 7
src/store/async-actions/historyTemplates.js

@@ -1,17 +1,20 @@
 import axios from '@utils/ajax';
-
+import { pushAllDataList } from '@utils/tools';
 import { initHistory } from '@store/actions/historyTemplates';
+import Notify from '@commonComp/Notify';
 import store from '@store';
 
 export const initItemList = (item) => {
-    let baseList = store.getState();
-    // let whichSign = baseList.typeConfig.typeConfig;
-    let state = baseList.patInfo.message;
-    const param = {
+  let baseList = store.getState();
+  // let whichSign = baseList.typeConfig.typeConfig;
+  let state = baseList.patInfo.message;
+  const param = {
       "hospitalId": state.hospitalId,
       "patientId": state.patientId,
-      "disName":item?item.name : 'dis',
-      "disType":item?1:0
+      "disName":item&&item.name?item.name : 'dis',
+      "disType":item?1:0,
+      "current": 1,
+      "size": 9999
     }
     /*return (dispatch) => {
         axios.json('/inquiryInfo/hisInquirys',param).then((res)=>{
@@ -25,6 +28,26 @@ export const initItemList = (item) => {
     }*/
     return axios.json('/inquiryInfo/hisInquirys',param);
 };
+export const getHistempDetail = (item) => {
+  const param = {
+      "inquiryId": item.id
+    }
+    return (dispatch) => {
+        axios.json('/inquiryInfo/getInquiryDetail',param).then((res)=>{
+            const data =res.data;
+            if(data.code == 0){
+                let tmpData = data.data
+                // let tmpList = tmpData.inquiryDetailList
+                // tmpData.detailList = tmpList
+                // console.log(tmpData)
+                pushAllDataList(item.sign,'push',tmpData,'history')       //引用                
+            }else{
+                console.log(data)
+                Notify.error(data.msg);
+            }
+        })
+    }
+};
 
 export function setInitHistory(data){
   return (dispatch) => {

+ 1 - 0
src/store/async-actions/homePage.js

@@ -76,6 +76,7 @@ export const getInitModules= (dispatch,getStore)=>{
             processModule:formatContinueDots(initData.process),//病程变化
             saveProcess:initSaveText.process,
             emptyData:formatContinueDots(initData.currentEmpty),//现病史空模板
+            currentEmptySon:formatContinueDots(initData.currentEmptySon),//现病史空模板-子模板
             saveEmpty:initSaveText.currentEmpty,
           });
         }else{//慢病--没有主诉模板

+ 3 - 3
src/store/async-actions/patInfo.js

@@ -74,10 +74,10 @@ export const initHistoryDetails = (dispatch) => {
                         confirmType: detail.sign
                     })
                     if(baseList.tabTemplate.items.length == 0){
-                      dispatch(initItemList());        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
+                      dispatch(initItemList("",1));        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
                     }
                 }else{
-                  dispatch(initItemList(baseList.typeConfig.typeConfig))
+                  dispatch(initItemList(baseList.typeConfig.typeConfig,1))
                 }
                 dispatch({type:MODI_LOADING,flag:false});
             } else {
@@ -104,7 +104,7 @@ export async function getPatientMessage(dispatch, getState){
   let res2 = await json(api.getPatBaseInfo, params);
   /*console.log(res2);
   console.log(2);*/
-  let data1 = {},data2={};
+  let data1 = {},data2 = {};
   if(res1.data.code=='0'){
     data1 = res1.data.data;
   }

+ 19 - 1
src/store/async-actions/print.js

@@ -7,7 +7,8 @@ import {
     getAllDataList,
     getAllDataStringList,
     pushAllDataList,
-    filterDataArr
+    filterDataArr,
+    filterOtherDataArr
 } from '@utils/tools';
 
 export const saveMessage = (bool) => {
@@ -20,12 +21,21 @@ export const saveMessage = (bool) => {
     const lisData = baseList.inspect.pushItem;
     const lisArr = transferIndexData(lisData);
     const haveAssess = Object.keys(baseList.assessResult.data).length>0;
+    let otherData = {},pacsData={};
     const evaluation={
       htmlContent:haveAssess?JSON.stringify(getEvaluations(baseList.assessResult,pushMessage)):'{}',
       //scaleList:[]
     };//getEvaluation();
     //console.log(baseList)
     // console.log(jsonStr.diag,'保存历史病历')
+    otherData['yjs_1']=jsonData['yjs_1']||''
+    otherData['yjs_2']=jsonData['yjs_2']||''
+    otherData['yjs_3']=jsonData['yjs_3']||''
+    otherData['yjs_4']=jsonData['yjs_4']||''
+    otherData['haveAssess']=haveAssess
+    otherData['pfix']=jsonStr.other?filterOtherDataArr(JSON.parse(jsonStr.other),jsonData.other):''
+    pacsData.pacs = jsonData.pacs
+    pacsData.checkedListImport = jsonData.checkedListImport
     json('/inquiryInfo/saveInquiry', {
         "doctorId": state.doctorId,
         "hospitalDeptId": state.hospitalDeptId,
@@ -37,34 +47,42 @@ export const saveMessage = (bool) => {
         "detailList": [{
             "content": jsonStr.chief,
             "contentValue":filterDataArr(JSON.parse(jsonStr.chief)),
+            "contentJson":'',
             "type": 1
         }, {
             "content": jsonStr.present,
             "contentValue":filterDataArr(JSON.parse(jsonStr.present)),
+            "contentJson":'',
             "type": 2
         }, {
             "content": jsonStr.other,
             "contentValue":filterDataArr(JSON.parse(jsonStr.other)),
+            "contentJson":JSON.stringify(otherData),
             "type": 3
         }, {
             "content": jsonStr.vital,
             "contentValue":filterDataArr(JSON.parse(jsonStr.vital)),
+            "contentJson":'',
             "type": 4
         }, {
             "content": jsonStr.lis,
             "contentValue":jsonStr.lis,
+            "contentJson":JSON.stringify(jsonData.lis),
             "type": 5
         }, {
             "content": jsonStr.pacs,
             "contentValue":jsonStr.pacs,
+            "contentJson":JSON.stringify(pacsData),
             "type": 6
         }, {
             "content": jsonStr.diag,
             "contentValue":jsonStr.diag,
+            "contentJson":'',
             "type": 7
         }, {
             "content": jsonStr.advice,
             "contentValue":jsonStr.advice,
+            "contentJson":JSON.stringify(jsonData.advice),
             "type": 8
         }],
         "sign": whichSign, //类型0结构化 1文本

+ 27 - 6
src/store/async-actions/tabTemplate.js

@@ -12,24 +12,29 @@ import Notify from '@commonComp/Notify';
 import store from '@store';
 import {
   getAllDataList,
-  getAllDataStringList
+  getAllDataStringList,
+  pushAllDataList
 } from '@utils/tools';
 
-export const initItemList = (type) => { //初始化数据
+export const initItemList = (type,current,flg) => { //初始化数据
   let baseList = store.getState();
   let whichSign = baseList.typeConfig.typeConfig;
   let state = baseList.patInfo.message;
 
   return (dispatch) => {
-    axios.json('/templateInfo/getByDoctorIdTemplates', {
+    axios.json('/templateInfo/getTemplatePageAlls', {
       "doctorId": state.doctorId,
       "hospitalDeptId": state.hospitalDeptId,
       "hospitalId": state.hospitalId,
       "type": type || whichSign,
+      "current": current,
+      "sex":[1,2,3],
+      "size": 9999
     }).then((res) => {
       const data = res.data;
       if (data.code == 0) {
-        dispatch(initItems(data));
+        // data.data.flg = flg||false  //获取下一页,暂时不用
+        dispatch(initItems(data.data));
       } else {
         Notify.error(data.msg)
       }
@@ -71,7 +76,7 @@ export const saveTemplateDetail = (val,sex) => { //保存为模板
       const data = res.data;
       if (data.code == 0) {
         Notify.success('模板保存成功');
-        dispatch(initItemList());
+        dispatch(initItemList("",1));
         dispatch(keepPushData(getdata(1),'part'));
         dispatch({
           type: DIAG_SHOW,
@@ -124,6 +129,7 @@ export const delBatchItem = (ids) => { //批量删除
     })
   }
 };
+
 export const changeTitleAsync = (obj) => { //改标题
   let baseList = store.getState();
   let whichSign = baseList.typeConfig.typeConfig;
@@ -147,9 +153,24 @@ export const changeTitleAsync = (obj) => { //改标题
         Notify.success('标题修改成功');
         store.dispatch(changeVisible(false))
       } else {
-        console.log(data)
+        // console.log(data)
         Notify.error(data.msg)
       }
     })
   }
+};
+
+export const setPageView = (id,typeConfig) => { //批量删除
+  return (dispatch) => {
+    axios.json('/templateInfo/getTemplateIdAlls', {
+      id: id
+    }).then((res) => {
+      let data = res.data;
+      if (data.code == 0) {
+        pushAllDataList(typeConfig, 'push', data.data, 'template')//引用
+      } else {
+        Notify.error(data.msg);
+      }
+    })
+  }
 };

+ 2 - 0
src/store/reducers/assessResult.js

@@ -47,6 +47,8 @@ export default (state=init,action)=>{
       res.indexTimeTypes = {};
       return res;
     case CLEAR_ASSESS_RESULT_VALUE:
+      res.data = {};
+      res.indexNames = {};
       res.addedScaleIds = [];
       res.calcuResult = {};
       res.calcuValues = {};

+ 2 - 1
src/store/reducers/currentIll.js

@@ -16,7 +16,8 @@ const initState = {
   editClear:true,
   addModule:[],
   emptyData:[],
-  symptomIds:[] //搜索去重
+  symptomIds:[], //搜索去重
+  currReadSonM:[] //回读的子模板
 };
 export default function(state=initState,action){    
   const res = Object.assign({},state);

+ 1 - 1
src/store/reducers/historyTemplates.js

@@ -28,7 +28,7 @@ export default (state = initHistoryList, action) => {
     }
     if (action.type === HISTORY_INIT) {
         const newState = Object.assign({}, state);
-        const tempArr = action.data || [];
+        const tempArr = action.data.records || [];
         newState.items = [...tempArr];
         newState.activeHistory = tempArr[0];
         return newState;

+ 2 - 1
src/store/reducers/mainSuit.js

@@ -28,7 +28,8 @@ const initState = {
     refresh:false //用于数据更新
   },
   chronicDesease:null, //慢病
-  mainTailIds:[]  //获取症状尾巴用
+  mainTailIds:[],  //获取症状尾巴用
+  mainReadSonM:[] //回读的子模板
 }
 
 export default function(state=initState,action){

+ 1 - 1
src/store/reducers/otherHistory.js

@@ -4,7 +4,7 @@ import {SETDATA,CONFIRMSELECTED,SETRADIO,SETNUMBER,SETOTHERCHECKBOX,SETOTHERTEXT
 import {confirm,setRadioValue,setNumberValue,setCheckBoxValue,setCheckText,setSearchData,insertLabelData,clearOtherHistory,
   changeTextLabel,setOtherInput,setTextModeValue,addLabelItem,otherEditClear,backspaceText,changeNumLabelVal,multipleComfirn,
   removeId,delSingleLable,setRadioInputValue} from '../actions/otherHistory';
-import config from '@config/index.js';
+import config from '@config/index';
 
 const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签
 const initState = {data:[block],isEmpty:true,saveText:[],selecteds:[],focusIndex:'',editClear:true};

+ 13 - 2
src/store/reducers/tabTemplate.js

@@ -27,6 +27,8 @@ const initDataList = {
   activeItem: {}, //引用的模板
   activeItemHis: {}, //引用的历史病例
   allCheckShow: false, //全选反选是否显示
+  current:1,//当前页
+  hasMore:true,//是否显示更多
 }
 export default (state = initDataList, action) => {
   if (action.type === DEL_ITEMS) {
@@ -49,7 +51,17 @@ export default (state = initDataList, action) => {
   }
   if (action.type === INIT_ITEMS) {
     const newState = Object.assign({}, state);
-    newState.items = action.state.data;
+    // let tmpItems = JSON.parse(JSON.stringify(newState.items))
+    // let tmpCurrent = JSON.parse(JSON.stringify(newState.current))
+    // console.log(action.state.flg,action.state.pages,tmpCurrent,45544)
+    // if(action.state.current == 1&&!action.state.flg){//进入页面会调取分页相关先去掉
+    //   newState.items = action.state.records
+    // }else{
+    //   newState.items = tmpItems.concat(action.state.records);
+    // }
+    newState.items = action.state.records
+    newState.current = action.state.current;
+    newState.hasMore = action.state.current<action.state.pages;
     return newState;
   }
   if (action.type === CHANGE_VISIBLE) {
@@ -89,7 +101,6 @@ export default (state = initDataList, action) => {
       tempArr.splice(tempArr.findIndex(item => item === action.id), 1)
       newState.checkItems = [...tempArr]
     }
-    console.log(newState.checkItems)
     return newState;
   }
   if (action.type === KEEP_PUSH_DATA) {

+ 2 - 2
src/utils/config.js

@@ -1,8 +1,8 @@
 // const host='http://192.168.3.1:5050';//赵
 // const host='http://192.168.3.100:5050';//王峰
-const host='http://192.168.2.241:5050';//后端接口访问地址
-// const host='http://192.168.2.121:5050';//后端接口访问地址
 // const host='http://192.168.2.236:5050';//后端接口访问地址
+// const host='http://192.168.2.121:5050';//后端接口访问地址
+const host='http://192.168.2.241:5050';//后端接口访问地址
 // const host='http://192.168.3.11:5050';//王宇
 //const host='http://192.168.2.164:8080';
 // const host='http://192.168.3.117:5050'; //周铁刚

+ 0 - 1
src/utils/drag.js

@@ -94,7 +94,6 @@ function dragBox(dragWrap,dragTop,type,addDom,img) {
   } else {
     drag.on('mousedown', function (event) {
       let lenHeight = wrap.height()
-      console.log(lenHeight,78787)
       if(img){
         $("#preImg").css("height",(lenHeight)+'px')
       }

+ 31 - 8
src/utils/tools.js

@@ -151,7 +151,7 @@ const getUrlArgObject = (parm) => {
     return args[parm];//返回对象  
 } 
 const getAllDataList =(baseList) =>{           //获取所有模块结构化的数据
-    let jsonData = {};
+    let jsonData = {};console.log(111,baseList)
     //月经史公式
     const other = baseList.otherHistory;
     jsonData.lis = {};
@@ -181,6 +181,8 @@ const getAllDataList =(baseList) =>{           //获取所有模块结构化的
     jsonData.diagChronicMagItem = baseList.diagnosticList.chronicMagItem;      //诊断慢病{}
     jsonData.currentIds = baseList.currentIll.symptomIds;      //现病史去重
     jsonData.isFirstMainDiag = baseList.treat.isFirstMainDiag;      //治疗方案
+    jsonData.mainReadSonM = baseList.mainSuit.addSmoduleData;      //主诉-子模板
+    jsonData.currReadSonM = baseList.currentIll.useEmpty?baseList.currentIll.currentEmptySon:baseList.currentIll.processModule;      //现病史-子模板
     // console.log(jsonData,'结构化数据获取')
     return jsonData;
 }
@@ -233,8 +235,8 @@ const getAllDataStringList =(baseList) =>{           //获取所有模块文本
 const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清空所有的数据
     if(action == 'clear'){     //清空
       const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签
-      store.dispatch({type: CLEAR_MAIN_SUIT,data:[],saveText:[],selecteds:[],editClear:true,mainIds:[],mainTailIds:[],clearAction:true,symptomFeature:[],chronicDesease:null});
-        store.dispatch({type: CLEAR_CURRENT_ILL,data:[],saveText:[],selecteds:[],editClear:true,symptomIds:[]});
+      store.dispatch({type: CLEAR_MAIN_SUIT,data:[],saveText:[],selecteds:[],editClear:true,mainIds:[],mainTailIds:[],clearAction:true,symptomFeature:[],chronicDesease:null,mainReadSonM:[]});
+        store.dispatch({type: CLEAR_CURRENT_ILL,data:[],saveText:[],selecteds:[],editClear:true,symptomIds:[],currReadSonM:[]});
         store.dispatch({type: CLEAROTHERHISTORY,data:[block],isEmpty:true,saveText:[],selecteds:[],editClear:true,yjs_1:'',yjs_2:'',yjs_3:'',yjs_4:''});
         store.dispatch({type: CLEARCHECKBODY,data:[block],isEmpty:true,saveText:[],selecteds:[]});
         store.dispatch(clearAssistData([],'',[]));
@@ -286,7 +288,7 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
           //其他史data
           const oData = dataJson.other;
           const onlyOneText = oData.length==1&&oData[0].tagType==8&&!(oData[0].name||oData[0].value);
-            if(type == 'template'){        //结构化模板回读
+          if(type == 'template'){        //结构化模板回读
               let dataJsonStr = JSON.parse(reData.preview);
                 // console.log(dataJson,dataJsonStr,'结构化模板引用')
                 store.dispatch({
@@ -296,13 +298,15 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                     saveText:JSON.parse(dataJsonStr.chief),
                     mainIds:dataJson.mainsuitIds?dataJson.mainsuitIds:[],
                     chronicDesease:dataJson.mainChronicDesease,
+                    mainReadSonM:dataJson.mainReadSonM,
                 });
                 store.dispatch({
                     type: CLEAR_CURRENT_ILL,
                     data:dataJson.present,
                     selecteds:dataJson.currentIllSelecteds?dataJson.currentIllSelecteds:[],
                     saveText:JSON.parse(dataJsonStr.present),
-                    symptomIds:dataJson.currentIds?dataJson.currentIds:[]
+                    symptomIds:dataJson.currentIds?dataJson.currentIds:[],
+                    currReadSonM:dataJson.currReadSonM
                 });
                 store.dispatch({
                     type: CLEAROTHERHISTORY,
@@ -354,7 +358,7 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
             }else{    //结构化历史病历回读
                 /*let dataJson = JSON.parse(reData.dataJson);*/
                 let dataJsonStr = reData.detailList;
-              // console.log(dataJson,dataJsonStr,'结构化历史病历回读')
+              // console.log(dataJsonStr,'结构化历史病历回读')
                 // console.log(dataJson.mainSuitSelecteds,7887)
                 store.dispatch({
                     type: CLEAR_MAIN_SUIT,
@@ -363,13 +367,15 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                     saveText:dataJsonStr[0].content ? JSON.parse(dataJsonStr[0].content) :[],
                     mainIds:dataJson.mainsuitIds?dataJson.mainsuitIds:[],
                     chronicDesease:dataJson.mainChronicDesease,
+                    mainReadSonM:dataJson.mainReadSonM,
                 });
                 store.dispatch({
                     type: CLEAR_CURRENT_ILL,
                     data:dataJson.present,
                     selecteds:dataJson.currentIllSelecteds?dataJson.currentIllSelecteds:[],
                     saveText:dataJsonStr[1].content ? JSON.parse(dataJsonStr[1].content):[],
-                    symptomIds:dataJson.currentIds?dataJson.currentIds:[]
+                    symptomIds:dataJson.currentIds?dataJson.currentIds:[],
+                    currReadSonM:dataJson.currReadSonM
                 });
                 store.dispatch({
                     type: CLEAROTHERHISTORY,
@@ -1324,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,
@@ -1375,5 +1397,6 @@ module.exports = {
     getStringPlus,
     getPushLists,
     getPushList,
-    getAllString
+    getAllString,
+    resetTagtype
 };