Browse Source

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

zhouna 6 years ago
parent
commit
0096087e84

+ 4 - 2
src/common/js/func.js

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

+ 2 - 0
src/components/AddInspect/SlideExcel/index.less

@@ -113,6 +113,7 @@
         td {
         td {
             text-align: left;
             text-align: left;
             padding-top: 6px;
             padding-top: 6px;
+            cursor: default;
         }
         }
         .excelUnit {
         .excelUnit {
             width: auto;
             width: auto;
@@ -157,6 +158,7 @@
   left: 50%;
   left: 50%;
   margin-left: -8px;
   margin-left: -8px;
   display: none;
   display: none;
+  cursor: pointer;
 }
 }
 .imgInfo:hover {
 .imgInfo:hover {
   background: url('../img/info3.png') no-repeat center center;
   background: url('../img/info3.png') no-repeat center center;

+ 4 - 1
src/components/AddInspect/SlideSelect/index.less

@@ -83,7 +83,8 @@
         height: 18px;
         height: 18px;
         width: 100%;
         width: 100%;
         td {
         td {
-            padding-top: 3px;
+          cursor: default;
+          padding-top: 3px;
         }
         }
     }
     }
 }
 }
@@ -130,6 +131,7 @@
             td {
             td {
                 text-align: left;
                 text-align: left;
                 padding-top: 6px;
                 padding-top: 6px;
+                cursor: default;
             }
             }
             .excelUnit {
             .excelUnit {
                 width: auto;
                 width: auto;
@@ -175,6 +177,7 @@
   left: 50%;
   left: 50%;
   margin-left: -8px;
   margin-left: -8px;
   display: none;
   display: none;
+  cursor: pointer;
 }
 }
 .imgInfo:hover {
 .imgInfo:hover {
   background: url('../img/info3.png') no-repeat center center;
   background: url('../img/info3.png') no-repeat center center;

+ 19 - 17
src/components/AddInspect/index.jsx

@@ -206,23 +206,25 @@ class Inspect extends React.Component {
             return (
             return (
               <li className={`${styles.itemPart} ${fillActive.details.length > 1 ? '' : styles.itemPartOne}`}>
               <li className={`${styles.itemPart} ${fillActive.details.length > 1 ? '' : styles.itemPartOne}`}>
                 <span className={styles.itemPartL}>{item.name}</span>
                 <span className={styles.itemPartL}>{item.name}</span>
-                <select className={styles.itemPartR} onChange={(e) => {
-                  if (e.target.value == '请选择') {
-                    this.changeActivePart(idx, '')
-                    return;
-                  }
-                  this.changeActivePart(idx, e.target.value);
-                }}
-                >
-                  <option value="请选择">请选择</option>
-                  {
-                    (item.questionDetailList).map((val) => {
-                      return <option value={val.name}
-                        selected={val.name == item.value ? true : false}
-                      >{val.name}</option>
-                    })
-                  }
-                </select>
+                <span className={styles.itemPartT}>
+                  <select className={styles.itemPartR} onChange={(e) => {
+                    if (e.target.value == '请选择') {
+                      this.changeActivePart(idx, '')
+                      return;
+                    }
+                    this.changeActivePart(idx, e.target.value);
+                  }}
+                  >
+                    <option value="请选择">请选择</option>
+                    {
+                      (item.questionDetailList).map((val) => {
+                        return <option value={val.name}
+                          selected={val.name == item.value ? true : false}
+                        >{val.name}</option>
+                      })
+                    }
+                  </select>
+                </span>
               </li>
               </li>
             )
             )
           } else if (item.controlType == 6) {
           } else if (item.controlType == 6) {

+ 2 - 1
src/components/AddInspect/index.less

@@ -147,7 +147,8 @@
     .itemPartR {
     .itemPartR {
         width: 62px;
         width: 62px;
         outline: none;
         outline: none;
-        float: right;
+        float: left;
+        margin-top: 5px;
     }
     }
     .itemPartT {
     .itemPartT {
         float: right;
         float: right;

BIN
src/components/DiagnosticList/img/delete-on.png


+ 14 - 2
src/components/DiagnosticList/index.jsx

@@ -1,6 +1,7 @@
 import React, { Component } from 'react';
 import React, { Component } from 'react';
 import style from './index.less';
 import style from './index.less';
 import del_icon from './img/delete.png'
 import del_icon from './img/delete.png'
+import del_on from './img/delete-on.png'
 import diagUp from './img/diagUp.png'
 import diagUp from './img/diagUp.png'
 import diagDown from './img/diagDown.png'
 import diagDown from './img/diagDown.png'
 import printIcon from '@common/images/team.png';
 import printIcon from '@common/images/team.png';
@@ -33,6 +34,7 @@ class DiagnosticList extends Component {
             isAssessConfirm:false,
             isAssessConfirm:false,
             radioVal:{},  //可能结果选择内容
             radioVal:{},  //可能结果选择内容
             possible:{},  //可能结果
             possible:{},  //可能结果
+            hasOndel: false
         }
         }
         this.deleteItem = this.deleteItem.bind(this);
         this.deleteItem = this.deleteItem.bind(this);
         this.cancel = this.cancel.bind(this);
         this.cancel = this.cancel.bind(this);
@@ -233,9 +235,19 @@ class DiagnosticList extends Component {
           })
           })
       }
       }
     }
     }
+    handleEnterDel() {
+      this.setState({
+        hasOndel: true
+      })
+    }
+    handleLeaveDel() {
+      this.setState({
+        hasOndel: false
+      })
+    }
     render(){
     render(){
         const { list, treatment, showReferRecord, showHistoryCase ,chronicMagItem} = this.props;
         const { list, treatment, showReferRecord, showHistoryCase ,chronicMagItem} = this.props;
-        const { visible, treatTitle ,showAssess, isAssessConfirm, radioVal, possible,assessId,disName} = this.state;
+        const { visible, treatTitle ,showAssess, isAssessConfirm, radioVal, possible,assessId,disName, hasOndel} = this.state;
         const chronicList = JSON.parse(localStorage.getItem('chronic')||null);
         const chronicList = JSON.parse(localStorage.getItem('chronic')||null);
         const chronicLine = chronicMagItem&&chronicMagItem.name;     //当前是否走的慢病流程
         const chronicLine = chronicMagItem&&chronicMagItem.name;     //当前是否走的慢病流程
         let isChronic = false;      //是否要显示管理评估
         let isChronic = false;      //是否要显示管理评估
@@ -264,7 +276,7 @@ class DiagnosticList extends Component {
                                           onClick={this.showAssessFn.bind(this,item)}>
                                           onClick={this.showAssessFn.bind(this,item)}>
                                         管理评估
                                         管理评估
                                     </span>:''}
                                     </span>:''}
-                                    <img className={style['diag-del']} src={del_icon} onClick={()=>{this.handleDeleteItem(item)}}/>
+                                    <img className={style['diag-del']} src={hasOndel ? del_on : del_icon} onMouseEnter={this.handleEnterDel.bind(this)} onMouseLeave={this.handleLeaveDel.bind(this)} onClick={()=>{this.handleDeleteItem(item)}}/>
                         </div>)
                         </div>)
                     })}
                     })}
                      {treatment&&<Treat title={treatTitle}></Treat>}
                      {treatment&&<Treat title={treatTitle}></Treat>}