Jelajahi Sumber

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

zhouna 6 tahun lalu
induk
melakukan
110ddb881e

+ 11 - 1
src/common/components/Textarea/index.jsx

@@ -18,6 +18,7 @@ class Textarea extends Component {
     this.handleInput = this.handleInput.bind(this);
     this.handleFocus = this.handleFocus.bind(this);
     this.handleBlur = this.handleBlur.bind(this);
+    this.handleKeydown = this.handleKeydown.bind(this);
   }
   handleFocus(){            //初始显示props中的值,focus已经显示输入的值,避免值更新闪烁
     const {handleFocus,fuzhen,handleInput} = this.props;
@@ -98,6 +99,14 @@ class Textarea extends Component {
     //存值到store
     handleInput&&handleInput({text});
   }
+  handleKeydown(e){
+    const {boxMark} = this.props;
+    const ev = e||window.event;
+    if(+boxMark==1){
+      //禁止回车事件
+      if(ev.keyCode==13){return false;}
+    }
+  }
   render() {
     const { title } = this.props;
     return (
@@ -109,7 +118,8 @@ class Textarea extends Component {
              ref={this.$dom}
              contentEditable={true}
              onInput={this.handleInput}
-             onBlur={this.handleBlur}>
+             onBlur={this.handleBlur}
+             onkeydown={this.handleKeydown}>
         </div>
       </div>
     );

+ 20 - 14
src/common/js/func.js

@@ -82,7 +82,8 @@ function notTextLabel(label){
 * 入参:arr源数组,
 *       noPre是否不添加前置文本标签,默认false即添加
 *       noEnd是否不添加后置文本标签,默认false即添加
-*       ifEmpty是否添加空标签,默认true即添加,传false添加逗号,如查体
+*       ifEmpty是否添加空标签,默认true即添加,传false添加逗号,如查体,
+*       showInCheck是否默认在查体中展开
 * */
 export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
   let newArr =[],
@@ -92,19 +93,22 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
       notText = true,
       saveText=[],
       tempText = '',
-      value = '';
+      value = '',
+      item={},
+      checkHiddenDefault=false;
   arr.map((it,i)=>{
     notText = notTextLabel(it);
     value = it.value||'';
-    textLabel = JSON.parse(config.textLabel);
-    _textLabel = JSON.parse(config._textLabel);
+    textLabel = !ifEmpty&&i==0?Object.assign({},JSON.parse(config.textLabel),{showInCheck:true}):JSON.parse(config.textLabel);
+    _textLabel = !ifEmpty&&i<config.showCheckNum+1?Object.assign({},JSON.parse(config._textLabel),{showInCheck:true}):JSON.parse(config._textLabel);
     if(i===0){
       //第一个标签不是文本标签时在前面添加文本标签
       if(!noPre&&notText){
         newArr.push(textLabel);
         saveText.push('');
       }
-      newArr.push(it);
+      item = ifEmpty?it:Object.assign({},it,{showInCheck:true});
+      newArr.push(item);
       if(it.tagType != 3){
         tempText = value?it.labelPrefix+value+it.labelSuffix:'';
         tempText = notText?tempText:it.value||it.name;
@@ -114,23 +118,25 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
       saveText.push(tempText);
     }else{
       pre = arr[i-1];
+      item = !ifEmpty&&i<config.showCheckNum?Object.assign({},it,{showInCheck:true}):it;
+      //判断单选项是否有默认选中,位置在隐藏区域时,查体所有标签展示
+      if(!ifEmpty&&!checkHiddenDefault&&i>config.showCheckNum&&+it.tagType===1&&(+it.controlType===0||+it.controlType===1)){
+        if(it.questionDetailList.find((it)=>it.defaultSelect=='1')){
+          checkHiddenDefault=true;
+        }
+      }
       //如果本身不是文本标签且前面一个也不是文本标签,该标签前面添加文本标签
       if(notTextLabel(pre)&&notText){
           // newArr.push(textLabel,it);
-          ifEmpty?newArr.push(textLabel,it):newArr.push(_textLabel,it);
+          ifEmpty?newArr.push(textLabel,it):newArr.push(_textLabel,item);
           if(it.tagType != 3) {
             tempText = value ? it.labelPrefix + value + it.labelSuffix : '';
           }else{
             tempText = getSaveText(it);
           }
-          saveText.push("",tempText); 
-        //最后一个非文本标签,后面添加一个文本标签
-        /*if(!noEnd&&i===arr.length-1){
-          newArr.push(textLabel);
-          saveText.push("");
-        }*/
+          saveText.push("",tempText);
       }else{    //本身是或者前面是文本标签时,前面不添加文本标签
-        newArr.push(it);
+        newArr.push(item);
         if(it.tagType != 3) {
           tempText = value ? it.labelPrefix + value + it.labelSuffix : '';
           // tempText = notText?tempText:it.value||it.name;
@@ -147,7 +153,7 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
       }
     }
   });
-  return {newArr,saveText};
+  return {newArr,saveText,checkHiddenDefault};
 };
 
 

+ 16 - 4
src/components/CheckBody/index.jsx

@@ -31,9 +31,13 @@ class CheckBody extends Component{
   }
   getLabels(){
     const {data,showArr,saveText,selecteds} = this.props;
-    let arr = [],list=[];
+    let arr = [],list=[];//console.log(data,saveText)
     const {boxMark,showAll} = this.state;
-    const showData = showAll?[...data]:[...data].splice(0,config.showCheckNum*2+1);
+    let showArray = data.filter((it)=>{
+      if(it.showInCheck)
+        return it;
+    });
+    const showData = this.props.showAll||showAll?[...data]:showArray;//[...data].splice(0,config.showCheckNum*2+1);
     if(showData){
       list = showData;
       arr = list.map((it,i)=>{
@@ -89,6 +93,14 @@ class CheckBody extends Component{
     //有主诉时且本身无数据,第一次点击获取数据,(不论获取成功与否)再点击不获取(直到刷新成空白页或清空)
     if(hasMain&&isEmpty!=false){
       this.props.getInit();
+      //隐藏区域有默认选中项,默认全部展开-有延迟,弃用
+      /*const that = this;
+      setTimeout(function(){
+        that.props.showAll&&that.setState({
+          showAll:true
+        });
+      },900)*/
+
     }
   }
   showHide(){
@@ -107,8 +119,8 @@ class CheckBody extends Component{
     const {searchData,totalHide,data,boxLeft,boxTop,saveText} = this.props;
     const {showAll} = this.state;
     const moreNum =config.showCheckNum*2+1;
-    const moreText = filterDataArr([...saveText].splice(moreNum));
-    const more = showAll?<span className={style['more']} onClick={this.showHide}>收起<img src={hideImg} /></span>:<span className={style['more']} onClick={this.showHide}>展开<img src={showImg} /></span>;
+    const moreText = filterDataArr([...saveText].splice(moreNum));      //被收起的标签中是否有有值得,有则不能再收起
+    const more = this.props.showAll||showAll?<span className={style['more']} onClick={this.showHide}>收起<img src={hideImg} /></span>:<span className={style['more']} onClick={this.showHide}>展开<img src={showImg} /></span>;
     const showMoreBtn = data.length>moreNum&&!moreText;
     return  <div className={style['container']}>
       <ItemBox title='查体' handleClick={this.handleClick}>

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

@@ -41,7 +41,7 @@ class Diagnosis extends Component {
     render() {
         
         
-        return (<div>
+        return (<div id="diagnosisResult">
             <ItemBox  id="diagnosis" title='诊断'  boxHeight='auto' titleTop='22px' marginTop='9px' backgroundColor='#EAF7FD'>
                 <DiagnosticList></DiagnosticList>
                 <div style={{marginLeft:'10px', position:'relative'}}>

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

@@ -84,6 +84,7 @@ class DiagnosticItem extends Component{
                 hideSearch&&hideSearch()
         //     })
         // }, 0)
+        document.getElementById("diagnosisResult").scrollIntoView(true)
     }
 
     render(){

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

@@ -97,7 +97,6 @@ class NumberDrop extends Component{
   }
   handleNumClick(e){     //数字框不可编辑的状态时点击事件,点击将数字框变为可输入且下拉不再显示直到失焦后再次聚集
     const {show,handleShow,ikey,id,patId,handleHide,value} = this.props;
-    this.$span.current.focus();
     if(show) {
       handleHide && handleHide();
       return;
@@ -111,6 +110,7 @@ class NumberDrop extends Component{
       clearTimeout(that.state.timer);
       const timer = setTimeout(function(){
         //只有弹窗关闭则点击数字键盘会清空当前数据
+        that.$span.current.focus();
         that.setState({
           hasSelect:false
         });
@@ -138,6 +138,7 @@ class NumberDrop extends Component{
     if(show){      //修改清空后第一次点击键盘不触发click事件bug
       return;
     }
+    //输入超出合理范围提示且清空
     const txt = e.target.innerText.replace(/^\s*/,'');
     if(max!=undefined&&!isNaN(+txt)&&(min>+txt||max<+txt)){
       this.beyondArea();

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

@@ -228,7 +228,7 @@ class SpreadDrop extends Component{
       const tIndex= exists.findIndex((it)=>it.questionId===item.questionId);
       const bIndex= withs.findIndex((it)=>it.questionId===item.questionId);
       if(tIndex!=-1){
-        exists.splice(tIndex,1,item);
+        exists.splice(tIndex,1,Object.assign({},item,{name}));    //修改单选列连接字符不显示bug
         this.setState({
           exists,
         })

+ 2 - 1
src/config/index.js

@@ -44,5 +44,6 @@ export default {
     },
     showCheckNum:16,        //查体默认展开非自由文本标签的个数
     radioOptionPer:'()',     //单选项输入占位符
-    Params
+    textReg:new RegExp("([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[a-zA-Z0-9])"), //包含中英文或数字
+  Params
 };

+ 1 - 0
src/containers/CheckBody.js

@@ -11,6 +11,7 @@ function mapStateToProps(state){
   const hasMain = filterDataArr(mainSuit.saveText);//||mainSuit.data.length;
   return {
     data:checkBody.data,
+    showAll:checkBody.showAll,
     isEmpty:checkBody.isEmpty,
     update:checkBody.update,   //用于触发更新
     showArr:homePage.showDrop,

+ 9 - 5
src/containers/SpreadDrop.js

@@ -136,7 +136,7 @@ function currentIll(dispatch,store,params){
   let existsId = exists && exists.length>0?getIds(exists):[];
   let withsId = withs && withs.length>0?getIds(withs):[];
   // const ids = existsId.join(",")+withsId.join(",");
-  const ids = (existsId.concat(withsId)).join(",");console.log("点击的下标是:",index,"选中的id是:",ids)
+  const ids = (existsId.concat(withsId)).join(",");
   let has = [],wes=[];
   //获取选中项目模板
   fetchModules(ids).then((res)=>{
@@ -309,7 +309,8 @@ function mainSuitCheck(dispatch,store,params){
   let ikey = getLabelIndex(index);
   dispatch({
     type: COMM_CONFIRM,
-    data: {exists:exists,existsName:existsName,ikey}
+    // data: {exists:exists,existsName:existsName,ikey}
+    data:Object.assign({},params,{existsName,withsName,labelInx})
   });
   dispatch({//隐藏下拉
     type:HIDEDROP
@@ -324,7 +325,8 @@ function currentCheck(dispatch,store,params){
   let labelInx = getLabelIndex(ikey);
   dispatch({
     type:SETMAINCHECKBOX,
-    data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    // data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    data:Object.assign({},params,{existsName,withsName,labelInx})
   })
 }
 
@@ -337,7 +339,8 @@ function checkBodyCheck(dispatch,store,params){
   let labelInx = getLabelIndex(ikey);
   dispatch({
     type:SETCHECKBOX,
-    data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    // data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    data:Object.assign({},params,{existsName,withsName,labelInx})
   })
 }
 //其他史普通多选确定
@@ -348,7 +351,8 @@ function otherHisCheck(dispatch,store,params){
   let labelInx = getLabelIndex(ikey);
   dispatch({
     type:SETOTHERCHECKBOX,
-    data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    // data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    data:Object.assign({},params,{existsName,withsName,labelInx})
   })
 }
 

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

@@ -4,8 +4,10 @@ import {getLabelIndex,fullfillText} from '@common/js/func.js';
 export function set(state,action){
   let res = Object.assign({},state);
   const {data} = action;
+  const obj = fullfillText(data,false,false,false);
   res.data = [...data];
-  res.saveText = fullfillText(res.data).saveText;//存逗号
+  res.saveText = obj.saveText;//存逗号
+  res.showAll = obj.checkHiddenDefault;
   res.update = Math.random();
   res.isEmpty = action.isEmpty;
   return res;
@@ -228,8 +230,8 @@ export function setCheckText(state,action) {
 //多选文字,如杂音
 export function setCheckBoxValue(state,action) {
   let res = Object.assign({},state);
-  const {labelInx,excluName,existsName,nones,withsName} = action.data;
-  let showText = (excluName||'')+(existsName||'')+(nones||'')+(withsName||'');
+  const {labelInx,excluName,existsName,nones,withsName,ban} = action.data;
+  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones||'');
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
   if(pattern.test(showText)){
@@ -254,11 +256,17 @@ export function setSearchData(state,action){
 //插入标签数据-搜索
 export function insertLabelData(state,action){
   let res = Object.assign({},state);
-  const text = Object.assign({},JSON.parse(config.textLabel));
   const searchStr = res.searchStr;
   const {index,data,isReplace,span,searchInEnd}=action;
   const showText = res.saveText[index];
-  const spreadLabels = data.tagType==4?fullfillText(data.questionMapping).newArr:[data];
+  let tempLabels = data.tagType==4?fullfillText(data.questionMapping).newArr:[data];
+  //查体中,默认显示区域搜索出来的标签要默认显示,隐藏区域搜索出的默认隐藏
+  let hideAreaIndex = [...res.data].reverse().findIndex((it)=>it.showInCheck);
+  hideAreaIndex = res.data.length-hideAreaIndex-1;        //默认显示的最后一个标签的位置
+  const text = Object.assign({},JSON.parse(config.textLabel),{showInCheck:index>hideAreaIndex?false:true});
+  let spreadLabels =tempLabels.map((it)=>{
+    return Object.assign({},it,{showInCheck:index>hideAreaIndex?false:true});
+  });
   let reg = searchInEnd?new RegExp(searchStr+"$"):new RegExp("^"+searchStr);
   const newText=showText.replace(reg,'')||'';
   if(!isReplace){

+ 29 - 24
src/store/actions/currentIll.js

@@ -63,12 +63,10 @@ export const setData = (state,action) =>{
   res.symptomIds = JSON.parse(JSON.stringify(mainIds));
   const num = action.info.num;//点击了几次添加病情变化
   const symptomFeature = action.info.symptomFeature;//分词
-  // const useEmpty = action.info.useEmpty;
   let useEmpty,mainData;
-  // let mainData = JSON.parse(JSON.stringify(action.info.mainData));//主诉模板数据
   let mainModleData = JSON.parse(JSON.stringify(action.info.mainData));//主诉模板数据
   let moduleData = JSON.parse(JSON.stringify(res.moduleData));//现病史模板
-  let addModule = JSON.parse(JSON.stringify(res.addModule));//拷贝的模板
+  // let addModule = JSON.parse(JSON.stringify(res.addModule));//拷贝的模板
   let current = JSON.parse(JSON.stringify(moduleData));
   let newMain = [];
   let mainLabelModule = res.mainLabelModule;//主诉选中的症状id获取到的模板
@@ -102,7 +100,7 @@ export const setData = (state,action) =>{
     })
     useEmpty = existData&&existData.length>0?false:true;
   }
-  // console.log(888,useEmpty);
+  
   if (useEmpty) {
     // res.data = res.emptyData;
     res.data = JSON.parse(JSON.stringify(res.emptyData));
@@ -137,12 +135,8 @@ export const setData = (state,action) =>{
       // 主症状添加tongYong标签选中文字
       let tongYText = tongYong?{name:tongYong,value:tongYong,tagType:config.tagType}:'';
       let mainCopy = JSON.parse(JSON.stringify(main));
-      /*if(tongYText){
-        for(let j=0; j<mainCopy.length; j++){
-          mainCopy[j].name = tongYong + (mainCopy[j].name).replace('、',"");
-          mainCopy[j].value = tongYong + (mainCopy[j].value).replace('、',"");
-        }
-      }*/
+      let manInput = [];
+      // 去掉主诉添加的顿号 
       for(let j=0; j<mainCopy.length; j++){
         if(tongYText){
           mainCopy[j].name = tongYong + (mainCopy[j].name).replace('、',"");
@@ -150,11 +144,18 @@ export const setData = (state,action) =>{
         }else{
           mainCopy[j].name = (mainCopy[j].name).replace('、',"");
           mainCopy[j].value = (mainCopy[j].value).replace('、',"");
+        }  
+        //查询是否有手动输入--输入的内容放到最后(3-27)
+        if(mainCopy[j].name != mainCopy[j].value){
+          const inputText = mainCopy[j].value.replace(mainCopy[j].name,"");
+          const textObj = Object.assign({},JSON.parse(config.textLabel),{name:inputText});
+          if(config.textReg.test(inputText)){//包含中英文或数字->即不全是标点符号才插入
+             manInput.push(textObj);
+          }
+          mainCopy[j].value = mainCopy[j].name;
         }
-        
       }
 
-
        // 将ids接口获取到的模板匹配到对应主症状后面
       // 主症状
       let newMainCopy = JSON.parse(JSON.stringify(mainCopy));
@@ -193,15 +194,20 @@ export const setData = (state,action) =>{
       }
       // 伴随
       // 去掉顿号
-     /* for(let b=0; b<withs.length; b++){
-        withs[b].name = withs[b].name.replace('、',"");
-      }*/
-      // let newWiths = JSON.parse(JSON.stringify(withs));
       let newWiths = [];
+      let manWithInput = [];
       if(withs.length>0){
         for(let b=0; b<withs.length; b++){
           withs[b].name = withs[b].name.replace('、',"");
           withs[b].value = withs[b].value.replace('、',"");
+          if(withs[b].name != withs[b].value){
+            const inputText = withs[b].value.replace(withs[b].name,"");
+            const textObj = Object.assign({},JSON.parse(config.textLabel),{name:inputText});
+            if(config.textReg.test(inputText)){//包含中英文或数字->即不全是标点符号才插入
+              manWithInput.push(textObj);
+            }           
+            withs[b].value = withs[b].name;  
+          }
         }
         newWiths = JSON.parse(JSON.stringify(withs));
         let withInd = 0;
@@ -237,7 +243,7 @@ export const setData = (state,action) =>{
         }
       }
       
-      let symptomArr = newMainCopy.concat(newWiths);
+      let symptomArr = newMainCopy.concat(manInput,newWiths,manWithInput);
       let newSymptomArr = JSON.parse(JSON.stringify(symptomArr));  
       //组装好的主症状和伴随症状插入现病史模板(flag=4前)
       let insertIdx = null;
@@ -363,16 +369,15 @@ export const confirm = (state,action) =>{
 //普通多选确定事件-主诉通用特征、初为后为等
 export const setCheckBox = (state,action)=>{
   const res = Object.assign({},state);
-  const {exists,labelInx,existsName} = action.data;
+  const {labelInx,excluName,existsName,nones,withsName,ban} = action.data;
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
-  let names=existsName;
+  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones||'');
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
-  if(pattern.test(existsName)){
-    names = existsName.substr(0,existsName.length-1);
+  if(pattern.test(showText)){
+    showText = showText.substr(0,showText.length-1);
   }
-  let arr = res.data;
-  arr[labelInx].value = names;
-  res.saveText[labelInx] = names;
+  res.data[labelInx].value = showText;
+  res.saveText[labelInx] = showText;
   res.selecteds[labelInx] = action.data;
   res.update=Math.random();
   return res;

+ 7 - 8
src/store/actions/mainSuit.js

@@ -264,17 +264,16 @@ export const confirm = (state,action) =>{
 // 普通多选确定事件
 export const commConfirm=(state,action)=>{
   const res = Object.assign({},state);
-  const {exists,ikey,existsName} = action.data;
+  const {labelInx,excluName,existsName,nones,withsName,ban} = action.data;
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
-  let names=existsName;
+  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones||'');
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
-  if(pattern.test(existsName)){
-    names = existsName.substr(0,existsName.length-1);
+  if(pattern.test(showText)){
+    showText = showText.substr(0,showText.length-1);
   }
-  let arr = res.data;
-  arr[ikey].value = names;
-  res.saveText[ikey] = names;
-  res.selecteds[ikey] = action.data;
+  res.data[labelInx].value = showText;
+  res.saveText[labelInx] = showText;
+  res.selecteds[labelInx] = action.data;
   res.update=Math.random();
   return res;
 }

+ 4 - 4
src/store/actions/otherHistory.js

@@ -196,10 +196,10 @@ export function setOtherInput(state,action){
 
 //多选文字,如杂音
 export function setCheckBoxValue(state,action) {
-  let res = Object.assign({},state);
-  const {labelInx,excluName,existsName,nones,withsName} = action.data;
-  let showText = (excluName||'')+(existsName||'')+(nones||'')+(withsName||'');
+  const res = Object.assign({},state);
+  const {labelInx,excluName,existsName,nones,withsName,ban} = action.data;
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
+  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones||'');
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
   if(pattern.test(showText)){
     showText = showText.substr(0,showText.length-1);
@@ -207,7 +207,7 @@ export function setCheckBoxValue(state,action) {
   res.data[labelInx].value = showText;
   res.saveText[labelInx] = showText;
   res.selecteds[labelInx] = action.data;
-  res.update = Math.random();
+  res.update=Math.random();
   return res;
 }
 //搜索结果

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

@@ -5,6 +5,7 @@ import {SET_MAINSUIT} from '@store/types/mainSuit';
 import config from '@config/index.js';
 import store from '@store';
 import {fullfillText} from '@common/js/func';
+import {formatContinueDots} from '@utils/tools';
 import {getOtherHisRecord,getInitData} from '@store/async-actions/fetchModules.js';
 import {initHistoryDetails} from '@store/async-actions/patInfo';
 import {storageLocal} from '@utils/tools';
@@ -21,7 +22,7 @@ function modulesParseJson(data){
   data.map((it)=>{
     moduleName[config.moduleCP[it.id]] = it.name;//添加病情变化/病程变化子模板需要使用模板名称
     obj = fullfillText(it.moduleDetailDTOList);
-    json[config.moduleCP[it.id]] = obj.newArr;
+    json[config.moduleCP[it.id]] = formatContinueDots(obj.newArr);
     saveTextJson[config.moduleCP[it.id]] = obj.saveText;
   });
   return {json,saveTextJson,moduleName};

+ 15 - 4
src/utils/tools.js

@@ -561,6 +561,16 @@ function trimDots(str){
   }).replace(/^[,,.。::"“??”;;、!!]+/,'');
 }
 
+//标签间连续标点只保留一个,保留前面一个
+function formatContinueDots(data){
+  let arr=data.filter((it,i)=>{
+    if(!(it.name==','&&data[i-1].name==',')){
+      return it;
+    }
+  });
+  return arr;
+}
+
 // 取消默认行为
 function preventDefault(event) {
     if (event.preventDefault) {
@@ -696,9 +706,9 @@ function timestampToTime(timestamp) {     //excel导入2019年5月1日会转换
 }
 function getPageLength(event) {     //兼容ie8获取页面距离左和上的距离,包括滚动距离
   let e = event || window.event;
-  let scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; 
-  let scrollY = document.documentElement.scrollTop || document.body.scrollTop; 
-  let x = e.pageX || e.clientX + scrollX; 
+  let scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
+  let scrollY = document.documentElement.scrollTop || document.body.scrollTop;
+  let x = e.pageX || e.clientX + scrollX;
   let y = e.pageY || e.clientY + scrollY;
   let page = {
     pageX:x,
@@ -736,7 +746,7 @@ function dragBox(domWrap,domDrag){
       }
       if(width-dragX < wrap.offsetWidth){    //不能超出右边界
         dragX = maxDragX
-      } 
+      }
       if(height-dragY < wrap.offsetHeight){     //不能超出下边界
         dragY = maxDragY
       }
@@ -788,4 +798,5 @@ module.exports = {
     timestampToTime,
     getPageLength,
     dragBox,
+    formatContinueDots
 };