Просмотр исходного кода

Merge remote-tracking branch 'origin/testedMerge'

zhouna 5 лет назад
Родитель
Сommit
7f13dc5858

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

@@ -10,6 +10,7 @@ import React, {Component} from 'react';
 import style from './index.less';
  import wnIcon from '@common/images/wn.png';
 import icon from '@common/images/loading.gif';
+import Notify from '@commonComp/Notify';
 import ReactDom from 'react-dom';
 
 /*const propTypes = {
@@ -43,9 +44,7 @@ class Loading extends React.Component{
             <div className={style['loading']} style={{display: show ? 'block' : 'none'}}>
                 {/*{this.props.shadeIsShow?<div className={style['cover']}/>:null}*/}
                 <div className={style['cover']}/>
-              {type==='warning'?<div className={style['t-info']}>
-                <p><img src={wnIcon} alt=""/>{text}</p>
-              </div>:<div className={style['info']}>
+              {type==='warning'?Notify.info(text,0, false,false):<div className={style['info']}>
                     <img src={icon}/>
                     <p>{text}</p>
                 </div>}

+ 8 - 8
src/common/components/Notify/index.js

@@ -29,19 +29,19 @@ function createNotification() {
 }
 
 let notification
-const notice = (type, content, duration=2000, onClose) => {
+const notice = (type, content, duration=2000, onClose, showClose=true) => {
     if (!notification) notification = createNotification()
-    return notification.addNotice({ type, content, duration, onClose })
+    return notification.addNotice({ type, content, duration, onClose,showClose })
 }
 
 export default {
-    info(content, duration, onClose) {
-        return notice('info', content, duration, onClose)
+    info(content, duration, onClose, showClose) {
+        return notice('info', content, duration, onClose, showClose)
     },
-    success(content = '操作成功', duration, onClose) {
-        return notice('success', content, duration, onClose)
+    success(content = '操作成功', duration, onClose, showClose) {
+        return notice('success', content, duration, onClose, showClose)
     },
-    error(content, duration , onClose) {
-        return notice('error', content, duration, onClose)
+    error(content, duration , onClose, showClose) {
+        return notice('error', content, duration, onClose, showClose)
     }
 }

+ 9 - 9
src/common/components/Notify/index.less

@@ -10,11 +10,11 @@
   top: 0; 
 }
 .notify-box {
-  min-width: 350px;
-  height:70px;
+  // min-width: 350px;
+  // height:70px;
   position: fixed;
-  padding-right: 90px;
-  top:30%;
+  padding-right: 100px;
+  top:40%;
   left:50%;
   transform: translate(-50%, -50%);
   // margin:-35px 0 0  -175px;
@@ -22,13 +22,13 @@
   border-radius: 10px;
   line-height: 70px;
   box-sizing: border-box;
-  border: 1px solid;
+  border: 1px solid #000;
 }
 .notify-text {
-  min-width: 224px;
-  height: 70px;
+  // min-width: 224px;
+  max-height: 280px;
   padding:  0 40px 0 0;
-  // overflow: hidden;
+  overflow-y: auto;
   position: relative;
   left: 66px;
   top: 0;
@@ -76,6 +76,6 @@
 }
 .notify-close {
   position: absolute;
-  right: 10px;
+  right: 0px;
   top: 15px;
 }

+ 1 - 2
src/common/components/Notify/notify.js

@@ -22,7 +22,6 @@ class NotifyBox extends Component {
 
         // notices.push(notice);//展示所有的提示
         notices[0] = notice;//仅展示最后一个提示
-        
         this.setState({ notices })
         if (notice.duration > 0) {
             clearTimeout(this.state.timer);
@@ -70,7 +69,7 @@ class NotifyBox extends Component {
                             <div className={style['notify-box']} style={styles[notice.type]}>
                                 <div className={style[`${icons[notice.type]}`]}></div>
                                 <div className={style['notify-text']}>{notice.content}</div>
-                                <img  className={style['notify-close']} onClick={()=>{this.removeNotice(notice.key)}} src={close}/>
+                                {notice.showClose&&<img  className={style['notify-close']} onClick={()=>{this.removeNotice(notice.key)}} src={close}/>}
                             </div>
                         </div>
                     ))

+ 75 - 30
src/common/components/NumberUnitPan/index.jsx

@@ -15,16 +15,17 @@ class NumberUnitPan extends Component{
       value:''
     }
     this.handleSelect = this.handleSelect.bind(this);
+    this.getUnitTable = this.getUnitTable.bind(this);
   }
   handleSelect(e){
     e.stopPropagation();
     const {handleSelect,toClear} = this.props;
     const text = e.target.innerText || e.target.innerHTML;
     const preValue = this.state.value;
-    if(+text==0 && !preValue){//第一位不能是0
-      Notify.info("请输入正确时间");
-      return false;
-    }
+    // if(+text==0 && !preValue){//第一位不能是0
+    //   Notify.info("请输入正确时间");
+    //   return false;
+    // }
     const value = toClear?'':this.state.value;     //键盘输入替换已有的值
     this.setState({
       value: value+text
@@ -48,10 +49,10 @@ class NumberUnitPan extends Component{
   handleBack(e){
     e.stopPropagation();
      const {handleSelect,value} = this.props;
-    const len = value.length-1;
-    if(len<0){
+    if(value===undefined||value==''){
       return;
     }
+    const len = value.length-1;
     const text = value.substring(0,len);
     this.setState({
       value:text
@@ -66,48 +67,40 @@ class NumberUnitPan extends Component{
       display:show?'table':'none'
     }
   }
-  componentWillReceiveProps(nextProps){
-    //重新选择的值替换 不追加
-     if(!nextProps.show){
-      this.setState({
-        value:''
-      });
-     }
-  }
-  render(){
-    const domNode = document.getElementById('root');
-    return <div className={style['panBox']} onBlur={(e)=>e.stopPropagation()} style={this.getStyle()}>
-        <table className={style['pan']} >
+  getUnitTable(){
+    const {unitType} = this.props;
+    if(unitType == 8){
+      return <table className={style['pan']} >
         <tr>
           <td><span onClick={this.handleSelect}>1</span></td>
           <td><span onClick={this.handleSelect}>2</span></td>
           <td><span onClick={this.handleSelect}>3</span></td>
-          <td><span onClick={this.handleSelect}>分钟</span></td>
-          <td><span onClick={this.handleSelect}></span></td>
-          <td><span onClick={this.handleSelect}>余</span></td>
+          <td><span onClick={this.handleSelect}>ml</span></td>
+          <td><span onClick={this.handleSelect}>qd</span></td>
+          <td><span onClick={this.handleClose.bind(this)} className={style.borderNone}>.</span></td>
         </tr>
         <tr>
           <td><span onClick={this.handleSelect}>4</span></td>
           <td><span onClick={this.handleSelect}>5</span></td>
           <td><span onClick={this.handleSelect}>6</span></td>
-          <td><span onClick={this.handleSelect}>小时</span></td>
-          <td><span onClick={this.handleSelect}></span></td>
-          <td><span onClick={this.handleSelect}>次</span></td> 
+          <td><span onClick={this.handleSelect}>mg</span></td>
+          <td><span onClick={this.handleSelect}>bid</span></td>
+          <td><span onClick={this.handleClose.bind(this)} className={style.borderNone}>.</span></td>
         </tr>
         <tr>
           <td><span onClick={this.handleSelect}>7</span></td>
           <td><span onClick={this.handleSelect}>8</span></td>
           <td><span onClick={this.handleSelect}>9</span></td>
-          <td><span onClick={this.handleSelect}></span></td>
-          <td><span onClick={this.handleSelect}></span></td>
-          <td><span onClick={this.handleSelect}>岁</span></td> 
+          <td><span onClick={this.handleSelect}>g</span></td>
+          <td><span onClick={this.handleSelect}>tid</span></td>
+          <td><span onClick={this.handleClose.bind(this)} className={style.borderNone}>.</span></td>
         </tr>
         <tr>
           <td><span onClick={this.handleSelect}>.</span></td>
           <td><span onClick={this.handleSelect}>0</span></td>
-          <td><span onClick={this.handleSelect}></span></td>
-          <td><span onClick={this.handleSelect}>/</span></td>
-          <td><span onClick={this.handleSelect}></span></td>
+          <td><span onClick={this.handleSelect}></span></td>
+          <td><span onClick={this.handleSelect}></span></td>
+          <td><span onClick={this.handleSelect}>qid</span></td>
           <td className={style['imgN']}><img src={backspace} onClick={this.handleBack.bind(this)} /></td>
         </tr>
         <tr>
@@ -115,6 +108,58 @@ class NumberUnitPan extends Component{
           <td colspan="3"><span onClick={this.handleClose.bind(this)} className={style['comf']}>确定</span></td>
         </tr>
       </table>
+    }
+    return <table className={style['pan']} >
+      <tr>
+        <td><span onClick={this.handleSelect}>1</span></td>
+        <td><span onClick={this.handleSelect}>2</span></td>
+        <td><span onClick={this.handleSelect}>3</span></td>
+        <td><span onClick={this.handleSelect}>分钟</span></td>
+        <td><span onClick={this.handleSelect}>周</span></td>
+        <td><span onClick={this.handleSelect}>余</span></td>
+      </tr>
+      <tr>
+        <td><span onClick={this.handleSelect}>4</span></td>
+        <td><span onClick={this.handleSelect}>5</span></td>
+        <td><span onClick={this.handleSelect}>6</span></td>
+        <td><span onClick={this.handleSelect}>小时</span></td>
+        <td><span onClick={this.handleSelect}>年</span></td>
+        <td><span onClick={this.handleSelect}>次</span></td>
+      </tr>
+      <tr>
+        <td><span onClick={this.handleSelect}>7</span></td>
+        <td><span onClick={this.handleSelect}>8</span></td>
+        <td><span onClick={this.handleSelect}>9</span></td>
+        <td><span onClick={this.handleSelect}>天</span></td>
+        <td><span onClick={this.handleSelect}>月</span></td>
+        <td><span onClick={this.handleSelect}>岁</span></td> 
+      </tr>
+      <tr>
+        <td><span onClick={this.handleSelect}>.</span></td>
+        <td><span onClick={this.handleSelect}>0</span></td>
+        <td><span onClick={this.handleSelect}>~</span></td>
+        <td><span onClick={this.handleSelect}>/</span></td>
+        <td><span onClick={this.handleSelect}>秒</span></td>
+        <td className={style['imgN']}><img src={backspace} onClick={this.handleBack.bind(this)} /></td>
+      </tr>
+      <tr>
+        <td colspan="3"><span onClick={this.handleClear.bind(this)} className={style['clearN']}>清空</span></td>
+        <td colspan="3"><span onClick={this.handleClose.bind(this)} className={style['comf']}>确定</span></td>
+      </tr>
+    </table>
+  }
+  componentWillReceiveProps(nextProps){
+    //重新选择的值替换 不追加
+     if(!nextProps.show){
+      this.setState({
+        value:''
+      });
+     }
+  }
+  render(){
+    const domNode = document.getElementById('root');
+    return <div className={style['panBox']} onBlur={(e)=>e.stopPropagation()} style={this.getStyle()}>
+        {this.getUnitTable()}
       </div>
   }
 }

+ 17 - 1
src/common/components/NumberUnitPan/index.less

@@ -5,9 +5,16 @@
 .pan{
   width: 280px;
   font-weight: normal;
+  tr {
+    overflow: hidden;
+    height:44px;
+    padding: 0;
+  }
   td{
-    width: 68px;
+    width: 49px;
     height:44px;
+    padding: 0;
+    overflow: hidden;
   }
   span{
     border:1px #fff solid;
@@ -17,7 +24,10 @@
     width: 100%;
     height: 100%;
     text-align: center;
+    height: 44px;
     line-height: 44px;
+    padding: 0;
+    margin: 0;
     color: #333;
     cursor: pointer;
   }
@@ -48,4 +58,10 @@
   .clearN:hover{
     border-color: #fff;
   }
+  .borderNone {
+    opacity: 0;
+  }
+  .borderNone:hover {
+    border: 1px solid transparent;
+  }
 }

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

@@ -38,7 +38,7 @@ class AddAssistCheck extends React.Component {
       let _close = document.getElementById("assiClose");   // 删除icon
       let _closeTil = $('#delTit')[0];   // 弹窗标题
       if(!this.isBar) {//onMousedown的目标为滚动条时,子项弹窗不关闭)
-          if (_con && searchWrapAssist != event.target && !_con.is(event.target) && _con.has(event.target).length === 0) { // Mark 1
+          if (_con && _con != event.target && !_con.is(event.target) && _con.has(event.target).length === 0) { // Mark 1
             if (this.state.show) {
               this.props.setHighter(48)
             }

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

@@ -90,7 +90,7 @@ class Advice extends Component{
         </div>}
         {!isFirstMainDiag && hasFollowUp &&<FollowUp  noHeader="true" textStyle={{padding: '0 10px'}}  setFollowUp={saveFollowUp} followUp = {followUp} isRead={isRead}></FollowUp>}
         {advice.scheme && advice.scheme.length > 0 &&<div contentEditable='false' className={`${style['scheme']} ${setFontColorSize(2)}`}>
-          {advice.scheme && advice.scheme.length > 0  && <h1>治疗方案</h1>}
+          {advice.scheme && advice.scheme.length > 0  && <h1>建议用药</h1>}
           {scheme}
         </div>}
         <div className={`${style['billing']} ${setFontColorSize(2)}`} > 

+ 5 - 0
src/components/CommonSymptom/index.jsx

@@ -63,6 +63,11 @@ class CommonSymptom extends Component{
       conceptId
     })
   }
+  componentWillReceiveProps(next){
+    if(next.show!==this.props.show){
+      this.handleClear();
+    }
+  }
   getStyle(id){
     const {conceptId} = this.state;
     if(conceptId.includes(id)){

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

@@ -202,6 +202,7 @@ class MultSpread extends Component{
           this.setBMIstate(it);
           return <NumberDrop prefix={it.labelPrefix}
                              suffix={it.labelSuffix}
+                             boxMark={boxMark}
                              placeholder={it.name}
                              isExtBlue={isExtBlue}
                              isSelectAll={text}

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

@@ -96,7 +96,7 @@ class NumberUnitDrop extends Component{
   }
 
   render(){
-    const {placeholder,prefix,suffix,show,value,handleHide,select_start,i,boxMark} = this.props;
+    const {placeholder,prefix,suffix,show,value,handleHide,select_start,i,boxMark,unitType} = this.props;
     const {editable,hasSelect} = this.state;
     return <div className={this.getClasses()}
                 ref={this.$cont}
@@ -111,7 +111,7 @@ class NumberUnitDrop extends Component{
       <span ref = {this.$suf} className="prefixUnset">{suffix?' '+suffix:suffix}</span>
       <NumberUnitPan handleSelect={(obj)=>this.select(obj)}
                  onClose={handleHide}
-                 show={show} toClear={!hasSelect} value={value}/>
+                 show={show} toClear={!hasSelect} unitType={unitType} value={value}/>
     </div>
   }
 }

+ 13 - 8
src/components/RadioInpDrop/index.jsx

@@ -153,7 +153,7 @@ class InputComp extends Component{
     // FF26 只有innerHTML
     const text = e.target.innerText || e.target.innerHTML;
     const {handleBlur,index} = this.props;
-    e.target.innerHTML = '';
+    // e.target.innerHTML = '';
     // FF26 会把&nbsp; 也获取到
     handleBlur(index,text.replace('&nbsp;',''));
   }
@@ -191,15 +191,19 @@ class InputComp extends Component{
     }
     this.over=false;
   }
-  componentWillReceiveProps(next){
-    //超过限制时,再点开下拉被删除的输入文字又出现bug修改
+  componentDidMount(){
+    const {value} = this.props;
     const inp = this.$inp.current;
-    const value = next.value;
-    inp.innerHTML = '';
-    setTimeout(function(){
-      inp.innerHTML = value;
-    });
+    inp.innerHTML = value
   }
+  // componentWillReceiveProps(next){
+  //   //超过限制时,再点开下拉被删除的输入文字又出现bug修改
+  //   const inp = this.$inp.current;
+  //   const value = next.value;
+  //   setTimeout(function(){
+  //     inp.innerHTML = value
+  //   });
+  // }
   render(){
     const {value} = this.props;
     return <span contentEditable={true}
@@ -208,6 +212,7 @@ class InputComp extends Component{
                  onClick={(e)=>{e.stopPropagation()}}
                  onFocus={(e)=>{e.stopPropagation()}}
                  onMouseDown={(e)=>{e.stopPropagation()}}
+                 onMouseUp={(e)=>{e.stopPropagation()}}
                  onInput={this.handleInp}
                  onBlur={this.handleBlur}>&nbsp;</span>
   }

+ 2 - 2
src/components/SpreadDrop/index.jsx

@@ -224,7 +224,7 @@ class SpreadDrop extends Component{
     const params = Object.assign({},this.state,{ikey,type,tagType,order,mainSaveText,copyType,value,mainData});
     delete params.tmpDom;       //避免上面deepClone selecteds报错
     handleConfirm&&handleConfirm(params);
-	this.btnClickFlag = true;
+	  this.btnClickFlag = true;
     //点确定后隐藏弹窗
     this.props.handleHide();
   }
@@ -391,7 +391,7 @@ class SpreadDrop extends Component{
     let showDefaulted = this.ifDefault();
     let showV = showDefaulted&&value===undefined?showVal:value;      //未选中过值时展示默认选中
     const noPushData = (+tagType===11)&&(!data[1]||!data[1].questionDetailList||data[1].questionDetailList.length===0);    //无推送数据
-    const showCommonData = (+type===2)&&(+tagType===11)&&noPushData&&CommonSymptoms.length>0?true:false;
+    const showCommonData = (+tagType===11)&&noPushData&&CommonSymptoms.length>0?true:false;
     if(!show&&tmpDom){
       $(tmpDom).parent().prev().attr({"contentEditable":true})
     }

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

@@ -138,4 +138,4 @@
     .manger {
         float: right;
     }
-}
+}

+ 12 - 4
src/containers/SpreadDrop.js

@@ -149,7 +149,7 @@ function mainSuitModule(dispatch,store,params){
 
 // 现病史
 function currentIll(dispatch,store,params){
-  const {nones,exists,withs,exclusion,excluName,ban,noneIds} = params;
+  const {nones,exists,withs,exclusion,excluName,ban,noneIds,tagType} = params;
   const index = params.ikey;
   let ikey = getLabelIndex(index);
   let existsId = exists && exists.length>0?getIds(exists):[];
@@ -157,6 +157,13 @@ function currentIll(dispatch,store,params){
   // const ids = (existsId.concat(withsId)).join(",");
   const ids = existsId.concat(withsId);
   let has = [],wes=[];
+  if(params.exclusion){//既往史
+    dispatch({
+      type: CURRENT_CONFIRM,
+      data:{exclusion,excluName,exists:has,withs:wes,nones:nones,ikey,ban,noneIds,tagType}
+    });
+    return ;
+  }
   //获取选中项目模板
   fetchModules(ids).then((res)=>{
     if(+res.data.code===0){
@@ -173,12 +180,13 @@ function currentIll(dispatch,store,params){
         });
         dispatch({
           type: CURRENT_CONFIRM,
-          data: {exists:has,withs:wes,nones:nones,ikey,ban,noneIds}
+          data: {exclusion,excluName,exists:has,withs:wes,nones:nones,ikey,ban,noneIds,tagType}
         });
       }else{
         dispatch({
           type: CURRENT_CONFIRM,
-          data: {exists,withs,nones,ikey,ban,noneIds}
+          data: {exclusion,excluName,exists:has,withs:wes,nones:nones,ikey,ban,noneIds,tagType}
+          // data: {exists,withs,nones,ikey,ban,noneIds}
         });
       }
       dispatch({    //自由文本标签数据更新
@@ -502,7 +510,7 @@ function mapDispatchToProps(dispatch,store){
         if(+result.code == 0){
           // let pushDataList = result.data.symptom;
           let bigDataList = result.data.symptom;
-          if(+obj.type===2&&!bigDataList&&!obj.hasCommon){
+          if(!bigDataList&&!obj.hasCommon){
             dispatch(getCommSymptoms());
             dispatch({
               type:SETDROPSHOW,

+ 17 - 0
src/containers/eleType.js

@@ -79,6 +79,7 @@ export function singleRadio(params){
                          show={showArr&&showArr[showInx]}
                          ikey={showInx}
                          value={data.value}
+                         unitType={data.controlType}
                          hideTag={hideTag}></NumberUnitDrop>;
     case 6:
       return <InlineTag prefix={data.labelPrefix}
@@ -113,6 +114,22 @@ export function singleRadio(params){
                          ikey={showInx}
                          value={data.value}
                          hideTag={hideTag}></NumberDrop>;
+    case 8://带单位数字键盘
+      return <NumberUnitDrop prefix={data.labelPrefix}
+                         suffix={data.labelSuffix}
+                         placeholder={data.name}
+                         mouseSelect={params.mouseSelected}
+                         i={i}
+                         isExtBlue={data.specFlag===4?true:false}
+                         formulaCode={data.formulaCode}
+                         boxMark={boxMark}
+                         id={data.id}
+                         isImports={boxMark==1 ?NumberUnitDropIsHigh: isHigh}
+                         show={showArr&&showArr[showInx]}
+                         ikey={showInx}
+                         unitType={data.controlType}
+                         value={data.value}
+                         hideTag={hideTag}></NumberUnitDrop>;
     case 11:
       return <RadioInpDrop data={data.questionDetailList}
                            vals={data.vals}

+ 35 - 11
src/store/actions/currentIll.js

@@ -136,7 +136,7 @@ export const setData = (state,action) =>{
   
   if (useEmpty) {
     const data = res.emptyData?JSON.parse(JSON.stringify(res.emptyData)):[];
-    res.data = fullfillText(data).newArr;
+    res.data = fullfillText(data,false,false,'2').newArr;
     res.useEmpty = true; //取子模板标识
   } else {
     if(mainData&&mainData.length>0){//主诉使用模板
@@ -272,7 +272,7 @@ export const setData = (state,action) =>{
         current = newSymptomArr;
       }
       let currentData = JSON.parse(JSON.stringify(current));
-      res.data = fullfillText(currentData).newArr;
+      res.data = fullfillText(currentData,false,false,'2').newArr;
     }else{//分词
       if(symptomFeature&&symptomFeature.length>0){
         let featureData = JSON.parse(JSON.stringify(symptomFeature));
@@ -319,12 +319,12 @@ export const setData = (state,action) =>{
           current = endFeatureData;
         }
         let currentData = JSON.parse(JSON.stringify(current));
-        res.data = fullfillText(currentData).newArr;
+        res.data = fullfillText(currentData,false,false,'2').newArr;
       }
     }
   }
   let resData = JSON.parse(JSON.stringify(res.data));
-  res.saveText = fullfillText(resData).saveText;
+  res.saveText = fullfillText(resData,false,false,'2').saveText;
   res.update=Math.random();
   return res;
 }
@@ -338,9 +338,20 @@ export const confirm = (state,action) =>{
   let res = Object.assign({},state);
   let length1 = res.data.length;
   let arr = JSON.parse(JSON.stringify(res.data));
-  const {nones,exists,withs,ikey,exclusion,excluName,ban,noneIds} = action.data;
+  const {nones,exists,withs,ikey,exclusion,excluName,ban,noneIds,tagType} = action.data;
   let existConpId = [];
   let withConpId = [];
+
+  const items = [...exists||[],...withs||[]];//既往史清空选项
+  if((!exists||!withs||items.length==0)&&!nones&&!exclusion){       //取消无殊的选中,空白提交
+    arr[ikey].value = '';
+    arr[ikey].selecteds = {};
+  }
+  //既往史选中互斥项
+  if(exclusion){
+    arr[ikey].value = excluName;
+    arr[ikey].selecteds = action.data;
+  }
   exists.map((v,i)=>{
     existConpId.push(v.conceptId);
   })
@@ -350,32 +361,45 @@ export const confirm = (state,action) =>{
   res.symptomIds = res.symptomIds.concat(existConpId,withConpId,noneIds);//搜索去重
   // 伴 标签
   const banText = JSON.stringify(ban)=='{}'?'':{id:ban.id,name:ban.name,value:ban.name,tagType:config.tagType};
-
   // 处理主症状标签及尾巴展开symptomType=1
   if(exists && exists.length>0){
     let tempArr = [];
      for(let i=0;i<exists.length; i++){
-      tempArr.push(getLabel(exists[i].id,exists[i].questionMapping && exists[i].questionMapping.length==0?exists[i].name+',':exists[i].name),...(exists[i].questionMapping && exists[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==1;})));
+      if(tagType == 6){
+        tempArr.push(...(exists[i].questionMapping && exists[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==1;})));
+      }else{
+        tempArr.push(getLabel(exists[i].id,exists[i].questionMapping && exists[i].questionMapping.length==0?exists[i].name+',':exists[i].name),...(exists[i].questionMapping && exists[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==1;})));
+      }
     }
     arr.splice(ikey,0,...formatContinueDots(tempArr));
   }
-  
   let length = arr.length - length1;
   let withsArr = JSON.parse(JSON.stringify(arr));
   // 伴 伴随症状标签及尾巴展开symptomType=2
   if(withs && withs.length>0){
     let tempArr = [];
     for(let i=0;i<withs.length; i++){
-      tempArr.push(banText,getLabel(withs[i].id,withs[i].questionMapping && withs[i].questionMapping.length==0?(withs[i].name+','):(withs[i].name)),...(withs[i].questionMapping&&withs[i].questionMapping.length>0?withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;}):[]));
+      if(tagType == 6){
+        tempArr.push(banText,...(withs[i].questionMapping&&withs[i].questionMapping.length>0?withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;}):[]));
+      }else{
+        tempArr.push(banText,getLabel(withs[i].id,withs[i].questionMapping && withs[i].questionMapping.length==0?(withs[i].name+','):(withs[i].name)),...(withs[i].questionMapping&&withs[i].questionMapping.length>0?withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;}):[]));
+      }
     }
     withsArr.splice(parseInt(ikey)+length,0,...formatContinueDots(tempArr));
   }
-
   // 无 不用展开
+
   let lengthN = withsArr.length - length1;
   let noneArr = JSON.parse(JSON.stringify(withsArr));  
   if(nones.length>1){//只点无不上去
-    const nonesName = nones.slice(0,nones.length-1)+',';
+    let nonesName = ""
+    if(tagType == 6){
+      nonesName = nones
+      noneArr[ikey].value = '';
+      noneArr[ikey].selecteds = {};
+    }else{
+      nonesName = nones.slice(0,nones.length-1)+','
+    }
     const noneObj = Object.assign({},JSON.parse(config.textLabel),{name:nonesName,value:nonesName});
     const none = nones?noneObj:'';
     noneArr.splice(parseInt(ikey)+lengthN,0,none);

+ 1 - 1
src/store/async-actions/fetchModules.js

@@ -217,7 +217,7 @@ export function setOtherHisModule(){
     const listObj = isHis && (mode == 1 || (!onlyOneText && mode == 0)) ? {
       newArr: arr,
       saveText: arrSave || []
-    } : fullfillText(model);
+    } : fullfillText(model,false,false,'3');
     dispatch({
       type: SETDATA,
       data: listObj.newArr,

+ 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.121:5050';//后端接口访问地址
-// const host='http://192.168.2.236:5050';//后端接口访问地址
-const host='http://192.168.2.241:5050';//后端接口访问地址
+const host='http://192.168.2.236: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'; //周铁刚

+ 36 - 10
src/utils/tools.js

@@ -557,6 +557,9 @@ function filterArr(arr){
 }
 
 function filterDataArr(arrTmp){   //数据处理
+    if(!Array.isArray(arrTmp)){
+      return
+    }
     let tmpArr = [];
     tmpArr = arrTmp.map((it,i)=>{     //连续的标点符号保留第一个
       if(!it)return '';
@@ -975,7 +978,7 @@ function notTextLabel(label){
 *  出参:newArr添加自由文本标签后的数据Array,
 *        saveText添加自由文本后对应的预览数据Array,
 * */
-function fullfillText(arr,noPre=false,noEnd=false){
+function fullfillText(arr,noPre=false,noEnd=false,boxMark){
   let newArr =[],
     pre={},
     textLabel={},
@@ -997,11 +1000,13 @@ function fullfillText(arr,noPre=false,noEnd=false){
         saveText.push('');
       }
       newArr.push(it);
-      if(it.tagType != 3){      //非血压类组合标签
+      if(it.tagType == 6||it.tagType == 2){
+        tempText = getDefaultedSaveText(it,boxMark);
+      }else if(it.tagType == 3){
+        tempText = getSaveText(it);
+      }else{      //非血压类组合标签
         tempText = value?it.labelPrefix+value+it.labelSuffix:'';
         tempText = notText?tempText:it.value||it.name;
-      }else{
-        tempText = getSaveText(it);
       }
       saveText.push(tempText);
       // 模板只有一个标签时第一项后面也要加空标签
@@ -1014,19 +1019,23 @@ function fullfillText(arr,noPre=false,noEnd=false){
       //如果本身不是文本标签且前面一个也不是文本标签,该标签前面添加文本标签
       if(notTextLabel(pre)&&notText){
         newArr.push(textLabel,it);
-        if(it.tagType != 3) {
-          tempText = value ? it.labelPrefix + value + it.labelSuffix : '';
-        }else{
+        if(it.tagType == 6||it.tagType == 2){
+          tempText = getDefaultedSaveText(it,boxMark);
+        }else if(it.tagType == 3){
           tempText = getSaveText(it);
+        }else{
+          tempText = value ? it.labelPrefix + value + it.labelSuffix : '';
         }
         saveText.push("",tempText);
       }else{    //本身是或者前面是文本标签时,前面不添加文本标签
         newArr.push(it);
-        if(it.tagType != 3) {
+        if(it.tagType == 6||it.tagType == 2){
+          tempText = getDefaultedSaveText(it,boxMark);
+        }else if(it.tagType == 3){
+          tempText = getSaveText(it);
+        } else{
           tempText = value ? it.labelPrefix + value + it.labelSuffix : '';
           tempText = notText ? tempText : (it.value || it.value == "" ? it.value : it.name);
-        }else{
-          tempText = getSaveText(it);
         }
         saveText.push(tempText);
       }
@@ -1040,6 +1049,23 @@ function fullfillText(arr,noPre=false,noEnd=false){
   return {newArr,saveText};
 };
 
+function getDefaultedSaveText(it,boxMark){
+  const state = store.getState();
+  const {readConfig,typeConfig}=state.typeConfig;
+  const hasReadMode = readConfig!==-1;
+  const curOtherMode =hasReadMode&&readConfig[2]!==null?readConfig[2]:typeConfig[2];
+  const curMode =hasReadMode&&readConfig[1]!==null?readConfig[1]:typeConfig[1];
+  const otherDefault=+curOtherMode===1;
+  const curDefault=+curMode===1;
+  const defaulted = (((boxMark=='2'&&curDefault)||(boxMark=='3'&&otherDefault)))&&it.selFlag=='1'&&it.value===undefined;
+  const ext = it.questionMapping.filter((i)=>{
+    return +i.exclusionType===1;
+  });
+  const text = ext.length>0&&defaulted?ext[0].questionDetailList[0].name:'';
+  //console.log(state);
+  return text;
+}
+
 /*
  * 查体添加自由文本标签函数
  * 默认标签直接添加,