Forráskód Böngészése

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

# Conflicts:
#	src/components/Advice/Textarea/index.jsx
#	src/components/Advice/index.jsx
zhouna 6 éve
szülő
commit
284c23e57c

+ 7 - 2
src/components/Advice/Textarea/index.jsx

@@ -31,8 +31,12 @@ class Textarea extends Component {
   }
   componentWillReceiveProps(next){
     const isRead = this.props.isRead;
-    if(next.isRead != isRead && next.value!=this.props.value){      //value对比解决复诊不显示bug
-      next.value ? this.$dom.current.innerText = next.value :  ''
+    // if(next.isRead != isRead && next.value!=this.props.value){      //value对比解决复诊不显示bug
+    //   next.value ? this.$dom.current.innerText = next.value :  this.$dom.current.innerText = next.value 
+    //   // this.$dom.current.innerText?(this.$dom.current.innerText = next.value||''):(this.$dom.current.innerHTML = next.value||'');
+    // }
+    if(next.isRead != isRead && next.value || next.isRead != isRead && next.value!=this.props.value){      //value对比解决复诊不显示bug
+      next.value ? this.$dom.current.innerText = next.value :  this.$dom.current.innerText = '' 
       // this.$dom.current.innerText?(this.$dom.current.innerText = next.value||''):(this.$dom.current.innerHTML = next.value||'');
     }
   }
@@ -40,6 +44,7 @@ class Textarea extends Component {
     const {value} = this.props;
     if(value && value.trim()){
       this.$dom.current.innerText = value
+      // this.$dom.current.focus()
       // this.$dom.current.innerText ? (this.$dom.current.innerText = value) : (this.$dom.current.innerHTML = value)
     //   this.$dom.current.nextSibling.innerText?(this.$dom.current.nextSibling.innerText = ''):(this.$dom.current.nextSibling.innerHTML = '')
     }

+ 3 - 3
src/components/Advice/index.jsx

@@ -60,7 +60,6 @@ class Advice extends Component{
   componentDidMount(){
   //   this.$dom.current.nextSibling.innerText?(this.$dom.current.nextSibling.innerText = ''):(this.$dom.current.nextSibling.innerHTML = '')
   // const {advice} = this.props.pushMessage.advice
-  // console.log('adviceInput', this.props.pushMessage)
   
 }
 
@@ -101,8 +100,9 @@ class Advice extends Component{
           {scheme}
         </div>}
         <div className={style['billing']} > 
-            {!advice.adviceInput && <Textarea value='' isRead={isRead} handleChangeAssistValue={this.handleAdviceInput} ></Textarea>}
-            {advice.adviceInput && <Textarea value={advice.adviceInput} isRead={isRead} handleChangeAssistValue={this.handleAdviceInput} ></Textarea>}
+            {/* {!advice.adviceInput && <Textarea value='' isRead={isRead} handleChangeAssistValue={this.handleAdviceInput} ></Textarea>}
+            {advice.adviceInput && <Textarea value={advice.adviceInput} isRead={isRead} handleChangeAssistValue={this.handleAdviceInput} ></Textarea>} */}
+            <Textarea value={advice.adviceInput} isRead={isRead} handleChangeAssistValue={this.handleAdviceInput} ></Textarea>
         </div>
       </ItemBox>
     </div>

+ 6 - 6
src/components/DiagnosticItem/index.jsx

@@ -54,12 +54,12 @@ class DiagnosticItem extends Component{
         //         visible: false,
         //     },()=>{
                 const { diagnosticList, addDiagnostic, clearInput, hideSearch } = this.props;
-                for (let i = 0; i < diagnosticList.length; i++) {
-                    if(diagnosticList[i].id === item.id && diagnosticList[i].name === item.name) {
-                        Notify.info('该诊断已存在');
-                        return
-                    }
-                }
+                // for (let i = 0; i < diagnosticList.length; i++) {
+                //     if(diagnosticList[i].id === item.id && diagnosticList[i].name === item.name) {
+                //         Notify.info('该诊断已存在');
+                //         return
+                //     }
+                // }
                 addDiagnostic&&addDiagnostic(item);
                 clearInput&&clearInput();
                 hideSearch&&hideSearch()

+ 1 - 0
src/containers/AdviceContainer.js

@@ -7,6 +7,7 @@ function mapStateToProps(state) {
     return ({
         pushMessage: state.pushMessage,
         isRead:state.homePage.isRead,
+        adviceInput: state.pushMessage.advice.adviceInput
     })
 }