Browse Source

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

zhouna 5 years ago
parent
commit
7d51967631

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

@@ -303,7 +303,8 @@ class EditableSpan extends Component{
             }
           }else{
             let tmpVal = data.substr(0,data.length-1)
-            handleChange&&handleChange({text1:tmpVal,boxMark,i:index});
+            // handleChange&&handleChange({text1:tmpVal,boxMark,i:index});
+            removeId && removeId({boxMark,i:index-1,text:""});
             preObj.html(tmpVal)
             if(preObj[0].nodeName !=="DIV"){
               moveEnd(preObj[0]);
@@ -353,16 +354,16 @@ class EditableSpan extends Component{
     const isFull = full?' '+style['full']:'';       //是否宽度设为整行宽度
     //有标点符号之外的字符或者前一个标签有选中值时,显示为黑色,否则查体中,有体征标记显示蓝色,否则灰显
     const ext = preIsExt?style['ext']:style['unselect'];
-    const unselect = value.match(config.punctuationReg)||preSelected?'':ext;
+    const unselect = value.match(config.punctuationReg)||(preSelected&&preSelected.match(config.punctuationReg))?'':ext;
     const hasBr = br?style['editable-br']:'';       //最后一个体征标签换行
     const selectedArea = mouseSelect?style['selected-area']:'';
     const $span = this.$span.current;
+    const val = $span&&$span.innerText.trim();
     if(br&&$span&&!$span.innerText){
       this.$span.current.innerHTML=' ';
     }
-    return classNames(style['editable-span'],isFull,unselect,hasBr,setFontColorSize(2,6),selectedArea);
+    return classNames(style['editable-span'],isFull,hasBr,setFontColorSize(2,unselect?6:8),unselect,selectedArea);
   }
-
   render() {
     return <span className={this.getClass()}
                  contentEditable='true'

+ 1 - 0
src/common/less/variables.less

@@ -201,6 +201,7 @@
 .blue-border{
   border:2px @blue solid;
   border-radius: 2px;
+  cursor: text!important;
   /*box-shadow: 0px 0px 2px @blue;*/
 }
 

+ 3 - 2
src/components/NumberDrop/index.jsx

@@ -219,8 +219,8 @@ class NumberDrop extends Component{
     e.stopPropagation();
   }
   handleMouseDown(){
-    const {i,setSelectArea,boxMark,show}= this.props;
-    !show&&setSelectArea({i,boxMark,dir:'start'});
+    const {i,setSelectArea,boxMark}= this.props;
+    setSelectArea({i,boxMark,dir:'start'});
   }
   componentDidMount(){
     //设置最小宽度避免输入后宽度跳动
@@ -268,6 +268,7 @@ class NumberDrop extends Component{
             style={{minWidth:'10px',display:'inline-block',textAlign:'center'}}
             ref = {this.$span}
             onkeyup={this.handleKeyDowm}
+            onmousedown={(e)=>e.stopPropagation()}
             onBlur={this.numInpBlur}
             onInput={this.handleSpanInp}
             className={`${this.getSpanClass(nospecial)}`}

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

@@ -2,6 +2,7 @@
 .container{
   display: inline-block;
   position: relative;
+  cursor: pointer;
   /*margin-right: 5px;*/
 }
 .tag,.selected-tag,.no-tag{

+ 1 - 1
src/store/actions/currentIll.js

@@ -692,7 +692,7 @@ export function removeId(state,action){
       data[index].value = text;
     }
   }else{
-    if(!data[index].value && data[index-1].tagType==8){
+    if(!data[index].value &&data[index-1]&& data[index-1].tagType==8){
       data.splice(index,1);
       res.saveText.splice(index,1);
     }else{

+ 21 - 12
src/store/reducers/assistCheck.js

@@ -43,16 +43,18 @@ export default (state = initSearchList, action) => {
       }
     }
     newState.assistLabel = [...tempArr]
-    newState.dataString = getAllString(newState.checkedListImport,newState.assistLabel)
-    newState.dataArr = getAllString(newState.checkedListImport,newState.assistLabel,1)
+    let tmpObj = getAllString(newState.checkedListImport,newState.assistLabel)
+    newState.dataString = tmpObj.str
+    newState.dataArr = tmpObj.arr
     return newState;
   }
   if (action.type == GET_ASSIST_SEARCH_LIST) { //右侧推送添加到左侧
     const newState = Object.assign({}, state);
     newState.list = action.list
     newState.assistVal = action.val
-    newState.dataString = getAllString(newState.checkedListImport,newState.assistLabel)
-    newState.dataArr = getAllString(newState.checkedListImport,newState.assistLabel,1)
+    let tmpObj = getAllString(newState.checkedListImport,newState.assistLabel)
+    newState.dataString = tmpObj.str
+    newState.dataArr = tmpObj.arr
     return newState;
   }
   if (action.type == GET_ASSIST_LABEL) { //默认
@@ -73,8 +75,9 @@ export default (state = initSearchList, action) => {
         newState.assistLabel = [...tempArrs];
       }
     }
-    newState.dataArr = getAllString(newState.checkedListImport,newState.assistLabel,1)
-    newState.dataString = getAllString(newState.checkedListImport,newState.assistLabel)
+    let tmpObj = getAllString(newState.checkedListImport,newState.assistLabel)
+    newState.dataArr = tmpObj.arr
+    newState.dataString = tmpObj.str
     return newState;
   }
   if (action.type == DEL_ASSIST_LABEL) { //删除
@@ -91,8 +94,9 @@ export default (state = initSearchList, action) => {
       }
       newState.assistLabel = [...tempArrs]
     }
-    newState.dataArr = getAllString(newState.checkedListImport,newState.assistLabel,1)
-    newState.dataString = getAllString(newState.checkedListImport,newState.assistLabel)
+    let tmpObj = getAllString(newState.checkedListImport,newState.assistLabel)
+    newState.dataArr = tmpObj.arr
+    newState.dataString = tmpObj.str
     return newState;
   }
   if (action.type == CHANGE_ASSIST_VAL) { //改变输入值
@@ -104,8 +108,9 @@ export default (state = initSearchList, action) => {
         newState.assistLabel = [...tempArr]
       }
     }
-    newState.dataArr = getAllString(newState.checkedListImport,newState.assistLabel,1)
-    newState.dataString = getAllString(newState.checkedListImport,newState.assistLabel)
+    let tmpObj = getAllString(newState.checkedListImport,newState.assistLabel)
+    newState.dataArr = tmpObj.arr
+    newState.dataString = tmpObj.str
     return newState;
   }
   if (action.type == CHANGE_DATE) { //新增
@@ -117,8 +122,9 @@ export default (state = initSearchList, action) => {
         newState.assistLabel = [...tempArr]
       }
     }
-    newState.dataArr = getAllString(newState.checkedListImport,newState.assistLabel,1)
-    newState.dataString = getAllString(newState.checkedListImport,newState.assistLabel)
+    let tmpObj = getAllString(newState.checkedListImport,newState.assistLabel)
+    newState.dataArr = tmpObj.arr
+    newState.dataString = tmpObj.str
     return newState;
   }
   if (action.type == CLEAR_ASSIST_DATA) {
@@ -126,6 +132,9 @@ export default (state = initSearchList, action) => {
     newState.assistLabel = [...action.data];
     newState.dataString = action.saveText;
     newState.checkedListImport = action.checkedListImport;
+    if(action.checkedListImport.length == 0&&action.data.length==0){
+      newState.dataArr = [];
+    }
     return newState;
   }
   return state;

+ 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'; //周铁刚

+ 24 - 14
src/utils/tools.js

@@ -1369,7 +1369,7 @@ function getPushLists(data1,data2){     //推送数据
 }
 
 function getAllString(checkedListImport,assistLabel,flg){
-  let tmpImportLis = [],tmpString='',tmpArr=[];
+  let tmpImportLis = [],tmpString='',tmpArr=[],tmpObj={};
   for(let i = 0;i < checkedListImport.length;i++){
     for(let j = 0;j < checkedListImport[i].length;j++){
       tmpImportLis.push(checkedListImport[i][j])
@@ -1379,20 +1379,24 @@ function getAllString(checkedListImport,assistLabel,flg){
   for (let i = 0; i < tempArr.length; i++) {
     let tmpVal = tempArr[i].value ? tempArr[i].value.trim() : tempArr[i].value;
     let obj = {
-      "dateValue": tempArr[i].time,
+      "dateValue": tempArr[i].time||"",
       "name": "",
-      "uniqueName": tempArr[i].name,
-      "desc": tempArr[i].value,
-      "result": tempArr[i].value,
+      "uniqueName": tempArr[i].name||"",
+      "desc": tempArr[i].value||"",
+      "result": tempArr[i].value||"",
     }
     tmpArr.push(obj)
     tmpString += (tempArr[i].name + (tmpVal ? (':' + tmpVal) + ', ' : ': ') + (tempArr[i].time ? '报告日期:' + tempArr[i].time : '') + '^;')
   }
-  if(flg){
-    return tmpArr;
-  }else{
-    return tmpString;
+  return tmpObj = {
+    arr:tmpArr,
+    str:tmpString
   }
+  // if(flg){
+  //   return tmpArr;
+  // }else{
+  //   return tmpString;
+  // }
 }
 
 // 模板中处理tagType==4的数据
@@ -1477,7 +1481,6 @@ function moveEnd(obj,flg) {
  *      2体征颜色单独处理不需要设置
  */
 const setFontColorSize = (flg,pacs) => {
-  // setTimeout(() => {
     const classNameSelect = ['largeFontSize','middleFontSize','simpleFontSize','simpleLightColor','simpleColor','selectColor']
     const state = store.getState();
     let readConfig = state.typeConfig.readConfig
@@ -1499,6 +1502,8 @@ const setFontColorSize = (flg,pacs) => {
           classStr = `largeFontSize selectColor`
         }else if(pacs == 7){
           classStr = `largeFontSize fontWeight selectColor`
+        }else if(pacs == 8){
+          classStr = `largeFontSize selectColor`
         }else{
           classStr = `largeFontSize`
         }
@@ -1513,6 +1518,8 @@ const setFontColorSize = (flg,pacs) => {
           classStr = `simpleFontSize selectColor`
         }else if(pacs == 7){
           classStr = `simpleFontSize fontWeight selectColor`
+        }else if(pacs == 8){
+          classStr = `simpleFontSize selectColor`
         }else{
           classStr = `simpleFontSize`
         }
@@ -1534,6 +1541,8 @@ const setFontColorSize = (flg,pacs) => {
         }else if(pacs == 5){
           classStr = `largeFontSize specialSize`
         }else if(pacs == 6){
+          classStr = `largeFontSize`
+        }else if(pacs == 8){
           classStr = `simpleColor largeFontSize`
         }else if(pacs == 7){
           classStr = `largeFontSize fontWeight`
@@ -1551,11 +1560,13 @@ const setFontColorSize = (flg,pacs) => {
           classStr = `simpleFontSize fontWeight`
         }else if(pacs == 6){
           classStr = `simpleFontSize`
+        }else if(pacs == 8){
+          classStr = `simpleColor simpleFontSize`
+        }else if(pacs == 7){
+          classStr = `simpleFontSize fontWeight`
         }else{
           classStr = `simpleFontSize`
         }
-      }else if(pacs == 7){
-        classStr = `simpleFontSize fontWeight`
       }else if(flg == 1){
         classStr = `simpleLightColor simpleFontSize`
       }else{
@@ -1563,10 +1574,9 @@ const setFontColorSize = (flg,pacs) => {
       }
     }
     return classStr;
-  // }, 0);
 }
 
-//获取生命体征或非生命体征标签
+//获取生命体征或非生命体征标签  
 function getLifeLabels(arr,flag){     //flag=true获取非生命体征
   const newArr = arr.filter((it)=>{
     return flag?+it.specFlag!==4:+it.specFlag===4;