Ver código fonte

Merge branch 'groupType' into groupTypeStyle

luolei 5 anos atrás
pai
commit
a03273f1fd

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

@@ -22,10 +22,10 @@ class NumberUnitPan extends Component{
     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

+ 1 - 1
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();
   }

+ 5 - 12
src/components/TemplateItems/index.jsx

@@ -166,7 +166,7 @@ class TemplateItems extends React.Component {
                     <div className={style.comAdminWrp}>
                         <div className={`${style.tempLists} ${style.tempListsP}`} ref={this.$cont} style={{display:admin?'none':'block',border:'1px solid #EAEDF1'}}>
                             {//个人
-                                allCheckShow ?<div className={`${style.wrapperTop} ${style.wrapperTopM} ${style.personalTmp}`}>
+                                allCheckShow&&!admin ?<div className={`${style.wrapperTop} ${style.wrapperTopM} ${style.personalTmp}`}>
                                     <i></i>
                                     <i></i>
                                     <div className={style['check-wrap']} onClick={handleAllCheckbox}>
@@ -181,18 +181,11 @@ class TemplateItems extends React.Component {
                                 </div>:null
                             }
                             {
-                                <div className="clearfix">
-                                    {
-                                        !allCheckShow&&<div className={`${style.personalTmp} ${style.personalTmpOwn} clearfix`}>
-                                            <span className={style.tip}>个人模板</span>
-                                            <i></i>
-                                            {
-                                                items.length > 0&&<span className={`${style['fr-element']} ${style['manger']}`} onClick={handleMangerTemplate}>管理</span>
-                                            }
-                                        </div>
-                                    }
+                                !allCheckShow&&<div className={`${style.personalTmp} clearfix`}>
+                                    <span className={style.tip}>个人模板</span>
+                                    <i></i>
                                     {
-                                        !admin?!allCheckShowAdmin&&<div className={`${style.personalTmp} ${style.personalTmpStatand}`}>标准模板</div>:''
+                                        items.length > 0&&<span className={`${style['fr-element']} ${style['manger']}`} onClick={handleMangerTemplate}>管理</span>
                                     }
                                 </div>
                             }

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

@@ -121,20 +121,17 @@
 .fr-element {
     // float: right;
     color: #3B9ED0;
-    color: #fff;
     display: inline-block;
     height: 36px;
     line-height: 36px;
 }
 .personalTmp {
-    width: 50%;
-    float: left;
+    width: 100%;
     height: 40px !important;
     line-height: 40px !important;
     background-color: #EDF8FF;
     padding: 0 10px;
     box-sizing: border-box;
-    cursor: pointer;
     .tip {
 
     }
@@ -142,7 +139,3 @@
         float: right;
     }
 }
-.personalTmpOwn {
-    background-color: #2A9BD5;
-    color: #fff;
-}

+ 11 - 3
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({    //自由文本标签数据更新

+ 31 - 7
src/store/actions/currentIll.js

@@ -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);