ソースを参照

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

zhouna 6 年 前
コミット
e1e807faa2
2 ファイル変更4 行追加6 行削除
  1. 3 5
      src/common/js/func.js
  2. 1 1
      src/components/DiagnosticList/index.jsx

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

@@ -96,13 +96,12 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
       value = '',
       item={},
       cNum = 0,
-      checkHiddenDefault=false;
+      checkHiddenDefault=false;//console.log(arr)
   arr&&arr.map((it,i)=>{
     notText = notTextLabel(it);
     cNum = i;
     value = it.value||'';
     textLabel = !ifEmpty&&i==0?Object.assign({},JSON.parse(config.textLabel),{showInCheck:true}):JSON.parse(config.textLabel);
-    //n个显示的标签最后一个标签后面要落关标,所以+1
     _textLabel = !ifEmpty&&cNum<config.showCheckNum+1?Object.assign({},JSON.parse(config._textLabel),{showInCheck:true}):JSON.parse(config._textLabel);
     if(i===0){
       //第一个标签不是文本标签时在前面添加文本标签
@@ -120,7 +119,7 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
       }
       saveText.push(tempText);
       // 模板只有一个标签时第一项后面也要加空标签
-      if(arr.length==1&&notText){
+      if(arr.length==1){
         newArr.push(textLabel);
         saveText.push('');
       }
@@ -156,8 +155,7 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
       }
       if(notText&&!noEnd&&i===arr.length-1){//最后一个非文本标签,后面添加一个文本标签
         //不能用上面的变量textLabel,因为上一个if可能也进了,这样就是同一个对象,值改变时会同步
-        const _text = arr.length>config.showCheckNum?JSON.parse(config._textLabel):_textLabel;
-        newArr.push(ifEmpty?textLabel:_text);
+        newArr.push(ifEmpty?textLabel:_textLabel);
         saveText.push("");
       }
     }

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

@@ -252,7 +252,7 @@ class DiagnosticList extends Component {
                         return (<div draggable={true} className={style['diag-box'] + ' clearfix'}  key={item.id} >
                                     {index === 0 ? '' : <span className={style['diag-up']} onClick={() => {this.upDiagnostic(index)}}><img className={style["diag-up"]} src={diagUp}/></span>}
                                     {list.length === 1 ? '' : index !== 0 ? '' : <span onClick={() => {this.downDiagnostic(index)}} className={style['diag-down']}><img className={style["diag-down"]} src={diagDown}/></span>}
-                                    <span className={style['diag-number']} style={{fontWeight:index === 0 ?'bold':'normal'}}>{index === 0 ? '' : index+1}</span>
+                                    <span className={style['diag-number']} style={{fontWeight:index === 0 ?'bold':'normal'}}>{index === 0 ? '1' : index+1}</span>
                                     <span className={style['diag-name']} onClick={()=>{this.handleClickDiag(item)}}>{item.name}<span></span></span> 
                                     {item.type === 1 ? <span className={style['diag-first']}>初诊</span> :<span className={style['diag-second']}> 复诊</span>}
                                     <span className={style['treat']}