Browse Source

Merge branch 'ChronicMag' of http://192.168.2.236:10080/zhouna/newICSS into ChronicMag

Luolei 6 years ago
parent
commit
039c3bed07

+ 5 - 0
src/common/js/func.js

@@ -118,6 +118,11 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
         tempText = getSaveText(it);
       }
       saveText.push(tempText);
+      // 模板只有一个标签时第一项后面也要加空标签
+      if(arr.length==1){
+        newArr.push(textLabel);
+        saveText.push('');
+      }
     }else{
       pre = arr[i-1];
       item = !ifEmpty&&cNum<config.showCheckNum?Object.assign({},it,{showInCheck:true}):it;

+ 2 - 1
src/components/ScaleTable/index.jsx

@@ -240,7 +240,8 @@ class ScaleTable extends React.Component{
                 return <div className={style['group']}>
                   <p className={style['groupName']}>{v.groupName}</p>
                   {v.rows&&v.rows.map((it,ind)=>{
-                    return <div style={{borderBottom:'1px solid #EBEBEB'}}>
+                    return <div className={style['rows']}>
+                        {it.required==1&&it.row.length>1?<span className={style['tip']}>本组选项可多选或根据需要选择某一条选项</span>:''}
                       {it.row.map((item,index)=>{
                         if(item.controlType==0){
                           return <div className={style['block']} style={{border:it.required==1&&!item.isSelect&&start?'1px solid #f00':'none'}}>

+ 10 - 0
src/components/ScaleTable/index.less

@@ -53,6 +53,16 @@ strong{
     color:#000;
     margin: 25px 0;
   }
+  .rows{
+    border-bottom: 1px solid #EBEBEB;
+    position: relative;
+    .tip{
+      position: absolute;
+      top:-16px;
+      color: #c9c9c9;
+      font-size: 12px;
+    }
+  }
   .subTotal{
     height: 49px;
     line-height: 49px;

+ 9 - 8
src/store/actions/currentIll.js

@@ -147,8 +147,8 @@ export const setData = (state,action) =>{
   }
   
   if (useEmpty) {
-    // res.data = res.emptyData;
-    res.data = res.emptyData&&res.emptyData.length>0?JSON.parse(JSON.stringify(res.emptyData)):moduleData;
+    const data = res.emptyData?JSON.parse(JSON.stringify(res.emptyData)):[];
+    res.data = fullfillText(data).newArr;
   } else {
     if(mainData&&mainData.length>0){//主诉使用模板
       // 目前只需要将第一个主诉病程移植到现病史
@@ -351,7 +351,7 @@ 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;console.log(111,action)
+  const {nones,exists,withs,ikey,exclusion,excluName,ban,noneIds} = action.data;
   let existsId = exists && exists.length>0?getIds(exists):[];
   let withsId = withs && withs.length>0?getIds(withs):[];
   res.symptomIds = res.symptomIds.concat(existsId,withsId,noneIds);//搜索去重
@@ -620,7 +620,8 @@ export const changeLabelVal = (state,action)=>{
   }else{//删除完标签内容则删除该标签
     const num = nextIsDot?2:1;
     res.data.splice(index,num);
-    res.saveText = fullfillText(res.data).saveText;
+    res.saveText.splice(index,num);
+    // res.saveText = fullfillText(res.data).saveText;
   } 
   res.update = Math.random();
   return res;
@@ -651,7 +652,8 @@ export const changeNumLabelVal = (state,action)=>{
   }else{//删除完标签内容则删除该标签
     const num = nextIsDot?2:1;
     res.data.splice(index,num);
-    res.saveText = fullfillText(res.data).saveText;
+    res.saveText.splice(index,num);
+    // res.saveText = fullfillText(res.data).saveText;
   }
   res.update = Math.random();
   return res;
@@ -746,7 +748,7 @@ export function insertLabelData(state,action){
     let resData = JSON.parse(JSON.stringify(res.data));
     resData.splice(focusIndex,1,text,...(FilteredDotMapping2));
     res.data = fullfillText(resData).newArr;
-    res.saveText[focusIndex] = searchData;
+    res.saveText = fullfillText(res.data).saveText;
   }else{
     let resData;
     const searchStr = res.searchStr;
@@ -915,7 +917,6 @@ export function removeId(state,action){
     data[index].name = text;
     data[index].value = text;
   }
-  //console.log(345,action,res);
   res.update = Math.random();
   return res;
 }
@@ -924,7 +925,7 @@ export function removeId(state,action){
 export function multipleComfirn(state,action){
   let res = Object.assign({},state);
   const {ikey,seleData,fullIkey} = action.data;
-  let data = res.data;//console.log(action,data[ikey])
+  let data = res.data;
   let index = fullIkey.substr(fullIkey.length-1,1);
   if(data[ikey].tagType==3){    //在组合项中
     let item = data[ikey].questionMapping;