Bläddra i källkod

Merge branch 'dev/new1' of http://192.168.2.236:10080/zhouna/newICSS into dev/new1

luolei 5 år sedan
förälder
incheckning
cd08f76012
41 ändrade filer med 665 tillägg och 107 borttagningar
  1. 9 38
      src/common/components/EditableSpan/index.jsx
  2. 11 0
      src/common/components/EditableSpan/index.less
  3. 5 4
      src/common/components/InlineTag/index.jsx
  4. 3 0
      src/common/components/InlineTag/index.less
  5. 3 2
      src/common/components/NumberPan/index.jsx
  6. 7 0
      src/common/components/NumberPan/index.less
  7. BIN
      src/common/components/SearchBox/imgs/clear.png
  8. BIN
      src/common/components/SearchBox/imgs/search.png
  9. 162 0
      src/common/components/SearchBox/index.jsx
  10. 54 0
      src/common/components/SearchBox/index.less
  11. 3 1
      src/common/components/index.js
  12. BIN
      src/common/images/addItem2.png
  13. 3 2
      src/common/less/variables.less
  14. 20 2
      src/components/AddAssistCheck/Textarea/index.jsx
  15. 3 2
      src/components/AddAssistCheck/Textarea/index.less
  16. 1 1
      src/components/AddAssistCheck/index.less
  17. 3 1
      src/components/CheckBody/index.jsx
  18. 1 1
      src/components/CopyRight/index.less
  19. 1 1
      src/components/MainSuit/index.jsx
  20. 84 6
      src/components/MultSpread/index.jsx
  21. 4 0
      src/components/MultSpread/index.less
  22. 3 2
      src/components/Multiple/index.jsx
  23. 6 0
      src/components/Multiple/index.less
  24. 39 5
      src/components/NumberDrop/index.jsx
  25. 5 2
      src/components/NumberDrop/index.less
  26. 1 1
      src/components/PushContainer/index.less
  27. 3 3
      src/components/PushItems/index.jsx
  28. 6 3
      src/components/PushItems/index.less
  29. 6 6
      src/components/RadioDrop/index.jsx
  30. 6 0
      src/components/RadioDrop/index.less
  31. 6 6
      src/components/RadioInpDrop/index.jsx
  32. 3 0
      src/components/RadioInpDrop/index.less
  33. 40 11
      src/components/SpreadDrop/index.jsx
  34. 16 0
      src/components/SpreadDrop/index.less
  35. 1 1
      src/containers/CurrentIll.js
  36. 6 3
      src/containers/MultSpread.js
  37. 68 0
      src/containers/SearchBox.js
  38. 9 0
      src/containers/eleType.js
  39. 49 0
      src/store/actions/mainSuit.js
  40. 12 3
      src/store/reducers/mainSuit.js
  41. 3 0
      src/store/types/mainSuit.js

+ 9 - 38
src/common/components/EditableSpan/index.jsx

@@ -243,22 +243,7 @@ class EditableSpan extends Component{
         if(preObj[0].nodeName !=="DIV"){
           this.moveEnd(preObj[0]);
         }
-      }
-      
-      if(innerVal !== preVal){
-        
-      }
-      else{
-        // 中英文数字和下划线--单独删除标签
-        /*const reg = new RegExp("([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[a-zA-Z0-9_])");
-        if(index!==0 && reg.test(innerVal)){
-          let obj = preObj[0].nodeName=="DIV"?preObj.prev():preObj;
-          delSingleLable && delSingleLable({boxMark,i:index});
-          this.moveEnd(obj[0]);  
-          this.setState({
-            index: null
-          })
-        }*/
+      }else{
         let data = innerVal.trim();
         //判断是否为空、中英文:, 。、;,且不是第一位
         // let pattern = new RegExp(/^\,?$|^\,?$|^\.?$|^\。?$|^\、?$|^\;?$|^\;?$|^\:?$|^\:?$|\s/);
@@ -268,7 +253,7 @@ class EditableSpan extends Component{
           // let preObj = $(this.$span.current).prev();
           let obj = preObj[0].nodeName=="DIV"?preObj.prev():preObj;
           handleKeydown&&handleKeydown({boxMark,i:index,text:data,flag:'backsp'});
-          this.moveEnd(obj[0]);  
+          this.moveEnd(obj[0]);
           this.setState({
             index: null
           })
@@ -292,34 +277,20 @@ class EditableSpan extends Component{
   }
   componentDidMount(){
     const {value} = this.props;
-    const that = this;
     if(value){
       this.$span.current.innerText?(this.$span.current.innerText = value||''):(this.$span.current.innerHTML = value||'');
     }
-    if(isIE()){
-      // 左右移动没问题,但是输入过程中会失焦,并且有时光标在但是无法输入 
-      // $(this.$span.current)[0].addEventListener('DOMCharacterDataModified', function(e){that.onChange(e);}, false);
-      // 此方法会影响左右切换时光标消失
-      /*$(this.$span.current).onIe8Input(function(e){
-        this.onChange(e)
-      },this);*/
-    }
   }
-  /*cancelSelect(e){//双击不选中
-    if(document.selection&&document.selection.empty){
-        document.selection.empty();
-      }else if (window.getSelection) {
-        var sel=window.getSelection();
-        sel.removeAllRanges();
-      }
-    }*/
   getClass(){
-    const {full,value,saveText,i} = this.props;
+    const {full,value,saveText,i,preIsExt,afterIsExt} = this.props;
+    const br = preIsExt&&!afterIsExt;       //最后一个体征标签
     const preSelected = saveText[i-1];
     const isFull = full?' '+style['full']:'';       //是否宽度设为整行宽度
-    //有标点符号之外的字符或者前一个标签有选中值时,显示为黑色,否则灰显
-    const unselect = value.match(config.punctuationReg)||preSelected?'':style['unselect'];
-    return classNames(style['editable-span'],isFull,unselect);
+    //有标点符号之外的字符或者前一个标签有选中值时,显示为黑色,否则查体中,有体征标记显示蓝色,否则灰显
+    const ext = preIsExt?style['ext']:style['unselect'];
+    const unselect = value.match(config.punctuationReg)||preSelected?'':ext;
+    const hasBr = br?style['editable-br']:'';       //最后一个体征标签换行
+    return classNames(style['editable-span'],isFull,unselect,hasBr);
   }
 
   render() {

+ 11 - 0
src/common/components/EditableSpan/index.less

@@ -11,10 +11,21 @@
   text-align: left;
   padding-right: 1px;//火狐左右移动需要
 }
+.editable-br{
+  .editable-span;
+  display: inline;
+}
+.editable-br:after{
+  content: "\A";
+  white-space: pre;
+}
 .full{
   width: 100%;
   line-height: 22px;
 }
 .unselect{
   color: @placeholder-color;
+}
+.ext{
+  color: @extBlue;
 }

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

@@ -58,16 +58,17 @@ class InlineTag extends Component {
     }
   }
   getStyle(){
-    const {hideTag,placeholder} = this.props;
-    const value = this.state.value;//this.$span.current&&this.$span.current.innerText.trim();
+    const {hideTag,placeholder,isExtBlue} = this.props;
+    const value = this.state.value;
+    const ext = isExtBlue?style['ext']:'';
     if(hideTag){
       if(value){
         return classNames(style['selected-no-tag']);
       }
-      return style['no-tag'];
+      return classNames(style['no-tag'],ext);
     }
     if(!value||value.trim()==placeholder){
-      return classNames(style['gray']);
+      return classNames(style['gray'],ext);
     }
     return style['selected-tag'];
   }

+ 3 - 0
src/common/components/InlineTag/index.less

@@ -14,6 +14,9 @@
 }
 .gray{
    .tag;
+  &.ext{
+    color: @extBlue;
+  }
  }
 .free-in{
   display: inline-block;

+ 3 - 2
src/common/components/NumberPan/index.jsx

@@ -59,6 +59,7 @@ class NumberPan extends Component{
   }
   render(){
     const select = this.handleSelect;
+    const noString=this.props.noString;
     const domNode = document.getElementById('root');
     return <div className={style['panBox']}
                 style={this.getStyle()}
@@ -70,7 +71,7 @@ class NumberPan extends Component{
           <td><button onMouseUp={select}>1</button></td>
           <td><button onMouseUp={select}>2</button></td>
           <td><button onMouseUp={select}>3</button></td>
-          <td><button onMouseUp={select}>/</button></td>
+          <td><button className={noString?style['disabled']:''} onMouseUp={noString?null:select}>/</button></td>
         </tr>
         <tr>
           <td><button onMouseUp={select}>4</button></td>
@@ -87,7 +88,7 @@ class NumberPan extends Component{
         <tr>
           <td><button onMouseUp={select}>.</button></td>
           <td><button onMouseUp={select}>0</button></td>
-          <td><button onMouseUp={select}>~</button></td>
+          <td><button className={noString?style['disabled']:''} onMouseUp={noString?null:select}>~</button></td>
           <td><button onMouseUp={this.handleClose.bind(this)} className={style['confirm']}>确定</button></td>
         </tr>
       </table>

+ 7 - 0
src/common/components/NumberPan/index.less

@@ -9,6 +9,13 @@
   td{
     width: 68px;
     height:44px;
+    .disabled{
+      opacity: .4;
+      cursor: not-allowed;
+    }
+    .disabled:hover{
+      border: none;
+    }
   }
   button{
     border:1px #fff solid;

BIN
src/common/components/SearchBox/imgs/clear.png


BIN
src/common/components/SearchBox/imgs/search.png


+ 162 - 0
src/common/components/SearchBox/index.jsx

@@ -0,0 +1,162 @@
+import React from 'react';
+import styles from './index.less';
+import clear from './imgs/clear.png';
+import search from './imgs/search.png';
+import config from '@config/index';
+import classNames from 'classnames';
+import SearchDrop from '@components/SearchDrop';
+import ScrollArea from 'react-scrollbar';
+/**
+ * 主诉“添加症状”下拉中的:搜索框(含结果下拉)
+ * 接收参数:
+ * show:上级下拉是否隐藏,用于componentWillReceiveProps中
+ * cliIndex:上级点击标签的index(如“添加症状”),用于选中数据插入的位置标识;
+ */
+class SearchBox extends React.Component {
+    constructor(props) {
+        super(props);
+        this.state = {
+          showBox:false, //显示搜索结果
+          border:'',
+          showClear:false, //显示清空icon
+          timer:null
+        }
+        this.textInput = React.createRef();
+        this.handleClearVal = this.handleClearVal.bind(this);
+        this.handleFocus = this.handleFocus.bind(this);
+        this.handleBlur = this.handleBlur.bind(this);
+        this.clickIcon = this.clickIcon.bind(this);
+        this.handleSearchSelect = this.handleSearchSelect.bind(this);
+        this.reset = this.reset.bind(this);
+    }
+    handleClearVal(){
+        const { clearSearch } = this.props;
+        this.textInput.current.value = '';
+        this.textInput.current.focus();
+        this.setState({
+          showClear:false
+        });
+        clearSearch&&clearSearch();
+    }
+    handleSearchSelect(e,item){
+      e.stopPropagation();
+      e.preventDefault();
+      const {cliIndex,chooseSearch,clearSearch,onSelect} = this.props;
+      chooseSearch&&chooseSearch({item:item,index:cliIndex});
+      onSelect();//上一级的“确定”事件
+      clearSearch&&clearSearch();
+      this.textInput.current.value = "";
+    }
+    handleInput(e){
+      e.stopPropagation();
+      e.preventDefault();
+      const { getSearchData ,mainIds} = this.props;
+        clearTimeout(this.state.timer);
+        let timer = setTimeout(()=>{
+            clearTimeout(this.state.timer);
+            if(e.target.value.trim() == ''){
+              this.setState({
+                showClear:false
+              })
+              return
+            }
+            this.setState({
+              showClear:true
+            })
+            getSearchData && getSearchData({inpStr:e.target.value.replace('<br>',''),boxMark:1,itemType:0,mainIds:mainIds});
+        },config.delayTime);
+        this.setState({
+          timer
+        });
+    }
+    handleFocus(e){//聚焦时边框变蓝色
+      e.stopPropagation();
+      e.preventDefault();
+      this.setState({border:true})
+    }
+    handleBlur(e){
+      e.stopPropagation();
+      e.preventDefault();
+      this.setState({border:false})
+    }
+    clickIcon(){
+      this.setState({showBox:true})
+      setTimeout(()=>{
+        this.textInput.current.focus();
+      },0)
+    }
+    // 重置事件
+    reset(){
+      const { clearSearch } = this.props;
+      clearSearch();
+      this.textInput.current.value = "";
+      this.setState({
+        showBox:false,
+        border:false,
+        showClear:false
+      })
+    }
+    componentDidMount(){
+      this.props.onRef(this);
+    }
+    componentWillReceiveProps(next){
+      // 隐藏时,清空搜索框内文字,清空搜索结果,隐藏搜索框
+      const { clearSearch } = this.props;
+      if(!next.show && next.show != this.props.show){
+        this.reset();
+      }
+    }
+    render() {
+        const { mainSearchData } = this.props;
+        const { showClear ,border, showBox} = this.state;
+        const showBd = showBox?styles['borderNone']:'';//显示边框
+        const borderCor = border?styles['border']:''; //蓝色边框
+        const isShow = showBox?styles['show']:styles['hide']; //是否显示输入框
+        let litext = '';
+        const contStyle={
+          opacity:'0.4',
+          right:'0',
+          top:'1px',
+          zIndex:'15',
+          width:'14px',
+          background:'#f1f1f1'};
+        const barStyle={background:'#777',width:'100%'};
+        return (
+            <div className={classNames(styles['search'])} onClick={(e)=>{e.stopPropagation();}} onBlur={(e)=>{e.stopPropagation();}}>
+                <img className={styles.searchVal} src={search} alt="搜索" onClick={this.clickIcon}/>
+                <img style={{display:showClear?'block':'none'}} className={styles.clearVal} src={clear} onClick={this.handleClearVal} alt="清空" />
+                <input
+                    className={classNames(isShow,borderCor,showBd)}
+                    type="text"
+                    maxLength="30"
+                    ref={this.textInput}
+                    onFocus={this.handleFocus}
+                    onBlur={this.handleBlur}
+                    onInput={(e) => { 
+                      this.handleInput(e)
+                    }}
+                    onPropertyChange={(e) => {  // 兼容ie
+                      this.handleInput(e)
+                    }}
+                />
+                {mainSearchData&&mainSearchData.length>0 ? <div className={styles.autoList}>
+                    <ScrollArea speed={0.8}
+                      horizontal={false}
+                      stopScrollPropagation={mainSearchData.length>6?true:false}
+                      style={{maxHeight:'225px'}}
+                      verticalContainerStyle={contStyle}
+                      verticalScrollbarStyle={barStyle}
+                      contentClassName="content">
+                      <ul>
+                        {mainSearchData&&mainSearchData.map((it)=>{
+                          litext = it.showType==1?it.name:it.name+'('+it.retrievalName+')';
+                          return <li key={it.conceptId} onClick={(e)=>this.handleSearchSelect(e,it)} title={litext}>{litext}</li>
+                        })}
+                      </ul>
+                    </ScrollArea>
+                  </div>:''}
+            </div>
+        )
+    }
+}
+export default SearchBox;

+ 54 - 0
src/common/components/SearchBox/index.less

@@ -0,0 +1,54 @@
+@import "~@less/variables.less";
+
+.search {
+    .contentZIndex1;
+    width: 316px;
+    padding: 8px;
+    box-sizing: border-box;
+    position: relative;
+    background-color: #fff;
+    .autoList {
+      position: absolute;
+      width: 300px;
+      background: #fff;
+      border: 1px solid #ccc;
+       ul{
+        li:hover{
+          border: 1px solid #3B9ED0;
+        }
+      } 
+    }
+    input {
+        width: 100%;
+        height: 34px;
+        line-height: 34px;
+        padding: 0 32px;
+        box-sizing: border-box;
+    }
+    input::ms-clear{
+        display: none;
+    }
+    .border {
+        border: 1px solid @blue !important;
+    }
+    .borderNone {
+        border: 1px solid #979797;
+    }
+    img {
+        position: absolute;
+        top: 15px;
+    }
+    .searchVal {
+        left: 18px;
+    }
+    .clearVal{
+        cursor: pointer;
+        right: 18px;
+    }
+}
+.show {
+    display:block;
+}
+.hide {
+    display: none;
+}

+ 3 - 1
src/common/components/index.js

@@ -24,6 +24,7 @@ import DelToast from "./DelToast";
 import TailInlineTag from "./TailInlineTag";
 import Footer from "./Footer";
 import WrapModalContainer from "./WrapModalContainer";
+import SearchBox from "./SearchBox";
 
 module.exports = {
     Banner,
@@ -52,5 +53,6 @@ module.exports = {
     MiniToast,
     TailInlineTag,
     Footer,
-    WrapModalContainer
+    WrapModalContainer,
+    SearchBox
 };

BIN
src/common/images/addItem2.png


+ 3 - 2
src/common/less/variables.less

@@ -4,6 +4,7 @@
 @cyan: #00bcd4;
 @blue: #3B9ED0;
 @red:#ff0000;
+@extBlue:#71A9FE;
 @tab-color:#3B9ED0;
 
 @ipt-color:#E9F5FA;
@@ -139,7 +140,7 @@
    display: inline-block;
    position: relative;
   /* margin-right: 5px;*/
-   padding: 0 3px 3px 0;
+   padding: 0 3px 3px 2px;
    color: @placeholder-color;
   cursor: pointer;
   &:before{
@@ -165,7 +166,7 @@
   position: relative;
   /*margin-right: 5px;
   padding: 0 3px 0;*/
-  color: unset!important;
+  color: unset;
   border:none!important;
   &:before,&:after{
   content: ''!important;

+ 20 - 2
src/components/AddAssistCheck/Textarea/index.jsx

@@ -1,6 +1,7 @@
 import React, { Component } from "react";
 import style from "./index.less";
 import config from '@config/index';
+import ScrollArea from 'react-scrollbar';
 import $ from 'jquery';
 
 class Textarea extends Component {
@@ -69,7 +70,24 @@ class Textarea extends Component {
   }
   render() {
     const {idx,disabled} = this.props;
-    return (
+    //出现滚动条时阻止滚动冒泡,未出现时不阻止,否则外部滚动条滚不动
+    const showedBar = $("#datePick .scrollbar-container").length===1;
+    const contStyle={
+      opacity:'0.4',
+      right:'0',
+      top:'1px',
+      zIndex:'15',
+      width:'8px',
+      background:'#f1f1f1'};
+    const barStyle={background:'#777',width:'100%'};
+    return (<ScrollArea speed={0.8}
+                        horizontal={false}
+                        stopScrollPropagation={showedBar?true:false}
+                        style={{maxHeight:'100px'}}
+                        className={style["area"]}
+                        verticalContainerStyle={contStyle}
+                        verticalScrollbarStyle={barStyle}
+                        contentClassName="content">
       <div className={style.textWap}>
         <div className={style.divTextarea}
             contenteditable={disabled?false:true}
@@ -78,7 +96,7 @@ class Textarea extends Component {
             onKeyUp={this.handleInput}
         ></div>
         <p ref={this.textInput} onClick={this.handleFocus} className={style.textareaWarring}></p>
-      </div>
+      </div></ScrollArea>
     );
   }
 }

+ 3 - 2
src/components/AddAssistCheck/Textarea/index.less

@@ -1,7 +1,7 @@
 .divTextarea {
-  overflow-y: auto;
+  /*overflow-y: auto;*/
   overflow-x: hidden;
-  max-height: 100px;
+  /*max-height: 100px;*/
   border-bottom: 1px dashed #333;
   box-sizing: border-box;
   min-height: 21px;
@@ -14,6 +14,7 @@
   // z-index: 10;
   word-break: break-all;
   word-wrap:break-word;
+  padding-right: 6px;
 }
 .textWap {
   overflow: hidden;

+ 1 - 1
src/components/AddAssistCheck/index.less

@@ -105,7 +105,7 @@
     }
 
     .textareaWrap {
-      padding-right: 250px;
+      padding-right: 245px;
       width: 100%;
     }
   }

+ 3 - 1
src/components/CheckBody/index.jsx

@@ -60,7 +60,9 @@ class CheckBody extends Component{
     if(showData){
       list = showData;
       arr = list.map((it,i)=>{
-        return chooseType({item:it,boxMark,i,showArr,saveText,selecteds,importLabel,setHighter});
+        const preIsExt = list[i-1]&&list[i-1].specFlag===4?true:false;//前一个标签是否为体征标签
+        const afterIsExt = list[i+1]&&list[i+1].specFlag===4?true:false;//后一个标签是否为体征标签
+        return chooseType({item:it,preIsExt,afterIsExt,boxMark,i,showArr,saveText,selecteds,importLabel,setHighter});
       });
     }
     showMoreBtn&&arr.push(more);      //是否显示收起展开按钮

+ 1 - 1
src/components/CopyRight/index.less

@@ -10,7 +10,7 @@
     text-align: center;
   }
     .copy{
-      padding: 10px 20px 20px 20px;
+      padding: 10px 20px 10px 20px;
       font-size: 12px;
       span {
         border: 1px solid #f00;

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

@@ -163,7 +163,7 @@ class MainSuit extends Component{
       }
       ev.target.blur();
       ev.target.innerText?(ev.target.innerText = data.substr(0,config.limited)):(ev.target.innerHTML = data.substr(0,config.limited));  //输入法内输入多个字再按enter的情况
-      console.log(333,data,ev)
+      //console.log(333,data,ev)
       // ev.target.blur();
       this.setState({
         inpText:data.substr(0,config.limited),

+ 84 - 6
src/components/MultSpread/index.jsx

@@ -6,6 +6,7 @@ import RadioInpDrop from "@containers/RadioInpDrop";
 import InlineTag from '@containers/InlineTag';
 import Multiple from '@containers/Multiple';
 import addIcon from '@images/addItem.png';
+import addIcon1 from '@images/addItem2.png';
 import style from "./index.less";
 import tools from '@utils/tools';
 import NumberUnitDrop from '@containers/NumberUnitDrop';
@@ -33,8 +34,16 @@ class MultSpread extends Component{
   constructor(props){
     super(props);
     this.state = {
-      numDoms:[]
+      numDoms:[],
+      tall:0,       //升高
+      weight:0,     //体重
+      bmi:'',        //BMI
+      wrBmi:false,      //是否无效bmi值,是则要清空身高体重,不能用判断bmi是否为空来判断,因为初始就是为空
     };
+    this.setBMIParam = this.setBMIParam.bind(this);
+    this.setBMI = this.setBMI.bind(this);
+    this.isBMIUseable = this.isBMIUseable.bind(this);
+    this.setBMIstate = this.setBMIstate.bind(this);
   }
   getClass(){
     const {saveText,ikey,showAdd} = this.props;
@@ -70,8 +79,64 @@ class MultSpread extends Component{
     const doms = this.state.numDoms;
     doms[i+1]&&this.moveEnd(doms[i+1].current)
   }
+  isBMIUseable(name,val){
+    const {tall,weight} = this.state;
+    //身高不能为0,否则分母为0,身高体重任何一个为空,则BMI清空
+    if((name==='tall'&&(!val||!weight))||(name==='weight'&&(!tall||!val))){
+      return false;
+    }
+    return true;
+  }
+  setBMIParam(name,val){        //设置bmi相关数据,身高、体重
+    const {tall,weight} = this.state;
+    const useable = this.isBMIUseable(name,val);
+    this.setState({
+      [name]:val
+    });
+    if(useable){
+      const result = name==='tall'?weight/Math.pow(val/100,2):val/Math.pow(tall/100,2);
+      this.setState({
+        bmi:result.toFixed(1),
+        wrBmi:false
+      })
+    }else{
+      this.setState({
+        bmi:'',
+        wrBmi:false
+      })
+    }
+  }
+  setBMI(val){
+    //手动修改BMI赋值,且身高体重清空
+    if(val===this.state.bmi){     //聚焦但未修改时
+      return ;
+    }
+    this.setState({
+      bmi:val,
+      wrBmi:true,
+      tall:0,
+      weight:0
+    });
+  }
+  setBMIstate(item){
+    //回读时bmi相关state赋值
+    const map={
+      BMI_SG:'tall',
+      BMI_TZ:'weight',
+      BMI_RES:'bmi',
+    };
+    const st = this.state;
+    const key = map[item.formulaCode];
+    //回读BMI相关项有值时,state赋值
+    if(key&&st[key]!==item.value){
+      this.setState({
+        [key]:item.value
+      });
+    }
+  }
   getLabels(){
-    const {data,ikey,showArr,copyId,selecteds,boxMark} = this.props;
+    const {data,ikey,showArr,copyId,selecteds,boxMark,isExtBlue} = this.props;
+    const {wrBmi,bmi} = this.state;
     let show = false;
     let inx = '',count=0;
     const list = data.map((it,i)=>{
@@ -84,6 +149,7 @@ class MultSpread extends Component{
           const list = it.questionDetailList&&it.questionDetailList.length>0?it.questionDetailList:it.questionMapping;
           return <RadioDrop data={list}
                             boxMark={boxMark}
+                            isExtBlue={isExtBlue}
                             placeholder={it.name}
                             show={show}
                             value = {it.value}
@@ -96,6 +162,7 @@ class MultSpread extends Component{
           return <Multiple data={dataList}
                            ikey={inx}
                            placeholder={it.name}
+                           isExtBlue={isExtBlue}
                            value={it.value}
                            copyType={it.copyType}
                            selecteds={selecteds ?selecteds[i]:[]}
@@ -109,6 +176,7 @@ class MultSpread extends Component{
                                suffix={it.labelSuffix}
                                placeholder={it.name}
                                boxMark={ikey.substr(0,1)}
+                               isExtBlue={isExtBlue}
                                id={it.id}
                                show={show}
                                ikey={inx}
@@ -119,18 +187,26 @@ class MultSpread extends Component{
           return <InlineTag prefix={it.labelPrefix}
                             suffix={it.labelSuffix}
                             placeholder={it.name}
+                            isExtBlue={isExtBlue}
                             value={it.value}
                             id={it.id}
                             ikey={inx} hideTag={true}></InlineTag>;
         case +it.controlType===7:
           const min = it.minValue;//!=null&&it.minValue!=undefined?it.minValue-1:undefined;
           const max = it.maxValue;//!=null&&it.maxValue!=undefined?+it.maxValue+1:undefined;
+          this.setBMIstate(it);
           return <NumberDrop prefix={it.labelPrefix}
                              suffix={it.labelSuffix}
                              placeholder={it.name}
+                             isExtBlue={isExtBlue}
                              //inputRef = {this['$inp'+(count++)]}
                              saveDoms={this.saveDoms.bind(this)}
                              reFocus={this.setNextFocus.bind(this)}
+                             setBMI={this.setBMI}
+                             wrBmi={wrBmi}
+                             bmi={bmi}
+                             setBMIParam={this.setBMIParam}
+                             formulaCode={it.formulaCode}
                              num = {count++}
                              min={min}
                              max={max}
@@ -148,6 +224,7 @@ class MultSpread extends Component{
                              show={showArr&&showArr[inx]}
                              value = {it.value}
                              boxMark={boxMark}
+                             isExtBlue={isExtBlue}
                              id={it.id}
                              ikey={inx}
                              hideTag={true}></RadioInpDrop>;
@@ -168,21 +245,22 @@ class MultSpread extends Component{
     }
   }
   getContClass(){
-    const {isImports,ikey,saveText} = this.props;
+    const {isImports,ikey,saveText,isExtBlue} = this.props;
     const labelInx = tools.getLabelIndex(ikey);
     const text = saveText&&saveText[+labelInx];
+    const ext = !text&&isExtBlue?style['ext']:'';
     const orgBorder = isImports&&!text?style['orange-border']:'';
-    return classNames(orgBorder);
+    return classNames(orgBorder,ext);
   }
   render(){
-    const {showAdd,addLabelItem,ikey,copyId,textPrefix,textSuffix} = this.props;
+    const {showAdd,addLabelItem,ikey,copyId,textPrefix,textSuffix,isExtBlue} = this.props;
     return (<div className={this.getContClass()}
                  style={{display:'inline-block'}}>
       {textPrefix?<span>{textPrefix}</span>:''}
       <div className={this.getClass()}>
       {this.getLabels()}
       {textSuffix?<span>{textSuffix}</span>:''}
-      {showAdd?<img src={addIcon} alt="添加血压项"
+      {showAdd?<img src={isExtBlue?addIcon1:addIcon} alt="复制该项"
                     className={style['add-icon']}
                     onClick={()=>addLabelItem({ikey,copyId})}/>:''}
     </div>

+ 4 - 0
src/components/MultSpread/index.less

@@ -1,6 +1,10 @@
 @import "~@less/variables.less";
+.ext>div{
+    color: @extBlue;
+}
 .container{
   .tag;
+  padding: 0 3px 0 2px;
   cursor: unset;
 }
 .cont{

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

@@ -37,8 +37,9 @@ class Multiple extends react.Component{
   }
 
   getClass(){
-    const {show,value,hideTag,isImports} = this.props;
+    const {show,value,hideTag,isImports,isExtBlue} = this.props;
     const orgBorder = isImports&&!value?style['orange-border']:'';
+    const ext = isExtBlue?style['ext']:'';
     if(show){
       $(this.$div.current).addClass(style['borderd']);
     }else{
@@ -47,7 +48,7 @@ class Multiple extends react.Component{
     if(value){
       return hideTag?classNames(style['hide-tag'],orgBorder):classNames(style['selected-tag'],orgBorder);
     }
-    return hideTag?'':classNames(style['tag'],orgBorder);
+    return hideTag?'':classNames(style['tag'],orgBorder,ext);
   }
 
   getListClass(){

+ 6 - 0
src/components/Multiple/index.less

@@ -9,6 +9,9 @@
 .tag,.selected-tag{
   cursor: pointer;
   line-height: 20px;
+  &.ext{
+    color: @extBlue!important;
+  }
 }
 
 .selected-tag{
@@ -21,4 +24,7 @@
   padding: 0;
   color: @text-color;
   line-height: 22px;
+  &.ext{
+    color: @extBlue;
+  }
 }

+ 39 - 5
src/components/NumberDrop/index.jsx

@@ -31,6 +31,7 @@ class NumberDrop extends Component{
     this.handleNumFocus = this.handleNumFocus.bind(this);
     this.handleKeyDowm = this.handleKeyDowm.bind(this);
     this.beyondArea = this.beyondArea.bind(this);
+    this.emitBMIData = this.emitBMIData.bind(this);
   }
   select(text){        //选中键盘上数字事件
     //placeholder修改后,第一次点击键盘触发blur后onClick不触发,原因未知,改为onMouseup可触发
@@ -64,11 +65,30 @@ class NumberDrop extends Component{
     }
 
     handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
+    //BMI相关数据上传
+    this.emitBMIData(text);
+  }
+  emitBMIData(text){
+    //手动修改BMI相关值时数据上传
+    const {setBMIParam,formulaCode,setBMI} = this.props;
+    if(formulaCode==="BMI_RES"){
+      setBMI&&setBMI(text);
+    }
+    if(text!==0&&(formulaCode==="BMI_SG"||formulaCode==="BMI_TZ")){
+      const map={
+        BMI_SG:'tall',
+        BMI_TZ:'weight'
+      };
+      setTimeout(function(){
+        setBMIParam&&setBMIParam(map[formulaCode],text);
+      });
+    }
   }
   beyondArea(){
     const {handleSelect,ikey,suffix,prefix,mainSaveText} = this.props;
     Notify.info("输入数值不符合规范,请重新输入!");
     handleSelect&&handleSelect({ikey,text:'',suffix,prefix,mainSaveText});
+    this.emitBMIData('');
     this.setState({
       placeholder:this.props.placeholder,
       hasSelect:false
@@ -165,6 +185,7 @@ class NumberDrop extends Component{
     let text = val===placeholder?'':val;
     //e.target.innerText = '';      //避免出现重复输入值
     handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
+    this.emitBMIData(text);
   }
   handleSpanInp(e){   //数字框输入事件
     e.stopPropagation();
@@ -176,12 +197,13 @@ class NumberDrop extends Component{
     handleHide&&handleHide();
   }
   getClasses(){         //整个标签是否有值的状态
-    const {hideTag,placeholder,isImports} = this.props;
+    const {hideTag,placeholder,isImports,isExtBlue} = this.props;
     const val = this.state.value;
     const isSelected = val&&val!=placeholder?style['selected']:style['container'];
     const orgBorder = isImports&&!(val&&val!=placeholder)?style['orange-border']:'';
+    const ext = isExtBlue?style['ext']:'';
     const noTag = hideTag?style['no-tag']:'';
-    return className(isSelected,noTag,orgBorder);
+    return className(isSelected,noTag,orgBorder,ext);
   }
   getSpanClass(){       //将被替换的文字选中状态显示
     const cls = this.props.show?style['blued']:style['nol'];
@@ -202,16 +224,27 @@ class NumberDrop extends Component{
     })
   }
   componentWillReceiveProps(nextProps){
+    //BMI存值
+    const {formulaCode,bmi,suffix,prefix,ikey,handleSelect,mainSaveText,wrBmi} = this.props;
+    if(formulaCode==="BMI_RES"&&nextProps.bmi!==bmi){
+      handleSelect&&handleSelect({ikey,text:nextProps.bmi,suffix,prefix,mainSaveText});
+    }
+    //手动修改BMI时身高体重清空
+    if(wrBmi!==nextProps.wrBmi&&(formulaCode==="BMI_SG"||formulaCode==="BMI_TZ")){
+      handleSelect&&handleSelect({ikey,text:'',suffix,prefix,mainSaveText});
+    }
+
     if((nextProps.placeholder == this.props.placeholder)&&(nextProps.value == this.props.value)){
       return
     }
     this.setState({
       placeholder:nextProps.placeholder,
       value:nextProps.value
-    })
+    });
   }
   render(){
-    const {prefix,suffix,show,value,handleHide,allClick} = this.props;
+    const {prefix,suffix,show,value,handleHide,allClick,bmi,formulaCode} = this.props;
+    const val = formulaCode==="BMI_RES"?(+bmi===Infinity||isNaN(bmi)?'':bmi):value;
     const {placeholder,hasSelect} = this.state;
     return <div className={this.getClasses()}
                 style={{position:'relative'}}
@@ -226,9 +259,10 @@ class NumberDrop extends Component{
             onBlur={this.numInpBlur}
             onInput={this.handleSpanInp}
             className={this.getSpanClass()}
-            >&nbsp;{value||placeholder}</span>
+            >&nbsp;{val||placeholder}</span>
       <span>{suffix}</span>
       <NumberPan handleSelect={this.select.bind(this)}
+                 noString={formulaCode?true:false}
                  onClose={handleHide}
                  show={show}
                  toClear={!hasSelect}/>

+ 5 - 2
src/components/NumberDrop/index.less

@@ -1,6 +1,9 @@
 @import "~@less/variables.less";
 .container{
   .tag;
+  &.ext{
+    color: @extBlue!important;
+  }
   line-height: 22px;
   .blued{
     background: @blue;
@@ -9,7 +12,7 @@
   .nol,.blued{
     min-width:10px;
     height: 22px;
-    vertical-align: text-bottom;
+    /*vertical-align: bottom;*/
     display:inline-block;
     text-align:center;
     word-break:break-all;
@@ -33,6 +36,6 @@
     text-align:center;
     word-break:break-all;
     height: 22px;
-    vertical-align: text-bottom;
+    /*vertical-align: bottom;*/
   }
 }

+ 1 - 1
src/components/PushContainer/index.less

@@ -11,7 +11,7 @@
   // top: 50px;
   // bottom: 10px;
   // right: 10px;
-  padding-bottom:50px;
+  padding-bottom:30px;
   border-left: 10px #e4e6e7 solid;
 }
 .title{

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

@@ -137,12 +137,12 @@ class PushItems extends Component {
   }
 
   componentDidMount() {
-    const height = getWindowInnerHeight() - 170;
+    const height = getWindowInnerHeight() - 190;
     this.$cont.current.style.height = height + "px";
 
     windowEventHandler('resize', ()=>{
       if(this.$cont.current){
-        const height = getWindowInnerHeight() - 170;
+        const height = getWindowInnerHeight() - 190;
         this.$cont.current.style.height = height + "px";
       }
     });
@@ -277,7 +277,7 @@ class PushItems extends Component {
               tipsDiscalimer = {tipsDiscalimer}
             ></TipsMsg>
           </div>
-         {tipsDiscalimer.data && <div className={style['disTips']} dangerouslySetInnerHTML={{__html: tipsDiscalimer.data.data &&tipsDiscalimer.data.data.find(item => item.disclaimerCode == '2')&&tipsDiscalimer.data.data.find(item => item.disclaimerCode == '2').description}}></div>}
+         {tipsDiscalimer.data && <div  className={style['disTips']} dangerouslySetInnerHTML={{__html: tipsDiscalimer.data.data &&tipsDiscalimer.data.data.find(item => item.disclaimerCode == '2')&&tipsDiscalimer.data.data.find(item => item.disclaimerCode == '2').description}}></div>}
         </div>
         {showTipsDetails && <DetailsModal  
             showTipsDetails = {showTipsDetails}

+ 6 - 3
src/components/PushItems/index.less

@@ -1,7 +1,7 @@
 @import "~@less/variables.less";
 .push-content-wrapper{
   // padding-top: 50px;
-  padding: 0px 15px ;
+  padding: 0px 15px 40px;
   line-height: 20px; 
   width: @push-width;
   overflow: hidden;
@@ -110,9 +110,12 @@
   
 }
 .disTips {
-  padding: 10px 20px 0px 10px;
+  padding: 0px 20px 0px 10px;
+  height: 32px;
+  line-height: 16px;
+  overflow-y: auto;
   background: #fff;
-  font-size: 10px;
+  font-size: 12px;
   color: #979797;
   text-align: center;
   position: absolute;

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

@@ -34,21 +34,21 @@ class RadioDrop extends Component{
     this.handleEditLabel = this.handleEditLabel.bind(this);
   }
   getClass(){
-    const {value,hideTag,placeholder,show,isImports} = this.props;
-    const blueBorder = this.state.editable?style['blue-border']:'';
-    const orgBorder = isImports?style['orange-border']:'';
+    const {value,hideTag,show,isImports,isExtBlue} = this.props;
+    const ext = isExtBlue?style['ext']:'';
+    const orgBorder = isImports?style['orange-border']:'';      //橙色框高亮
     if(show){
       $(this.$cont.current).addClass(style['borderd']);
     }else{
       $(this.$cont.current).removeClass(style['borderd']);
     }
     if(hideTag){
-      return style['no-tag'];
+      return classNames(style['no-tag'],ext);
     }
     if(value){
-      return blueBorder?classNames(style['selected-tag'],blueBorder):style['selected-tag'];
+      return style['selected-tag'];
     }
-    return classNames(style['tag'],orgBorder);
+    return classNames(style['tag'],orgBorder,ext);
   }
   handleSelect(item){
     const {handleSelect,ikey,mainSaveText,value} = this.props;

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

@@ -10,8 +10,14 @@
   word-break: break-all;
   /*line-height: 20px;*/
 }
+.no-tag{
+  color:inherit;
+}
 .tag{
   color:@placeholder-color;
+  &.ext{
+    color: @extBlue!important;
+  }
 }
 .tag:before{
   content: '[';

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

@@ -36,21 +36,21 @@ class RadioInpDrop extends Component{
     this.handleInnerInp = this.handleInnerInp.bind(this);
   }
   getClass(){
-    const {value,hideTag,placeholder,show,isImports} = this.props;
-    const blueBorder = this.state.editable?style['blue-border']:'';
-    const orgBorder = isImports&&!value?style['orange-border']:'';
+    const {value,hideTag,show,isImports,isExtBlue} = this.props;
+    const orgBorder = isImports&&!value?style['orange-border']:'';    //查体,是否橙色框高亮
+    const ext = isExtBlue?style['ext']:'';      //查体,是否是体征
     if(show){
       $(this.$cont.current).addClass(style['borderd']);
     }else{
       $(this.$cont.current).removeClass(style['borderd']);
     }
     if(hideTag){
-      return style['no-tag'];
+      return classNames(style['no-tag'],ext);
     }
     if(value){
-      return blueBorder?classNames(style['selected-tag'],blueBorder):style['selected-tag'];
+      return style['selected-tag'];
     }
-    return classNames(style['tag'],orgBorder);
+    return classNames(style['tag'],orgBorder,ext);
   }
   handleSelect(item){
     const {handleSelect,ikey,value,placeholder,mainSaveText} = this.props;

+ 3 - 0
src/components/RadioInpDrop/index.less

@@ -7,6 +7,9 @@
 .tag,.selected-tag,.no-tag{
   display: inline-block;
   cursor: pointer;
+  &.ext{
+    color: @extBlue;
+  }
   /*line-height: 20px;*/
 }
 .tag{

+ 40 - 11
src/components/SpreadDrop/index.jsx

@@ -5,6 +5,7 @@ import style from './index.less';
 import {setPosition,deepClone,filterArr,handleEnter,isIE,windowEventHandler,filterDataArr,getIds,getPageCoordinate} from '@utils/tools.js';
 import {Notify} from '@commonComp';
 import ScrollArea from 'react-scrollbar';
+import SearchBox from '@containers/SearchBox'
 import $ from 'jquery';
 /****
  * 标签组合下拉,选中的项目展开
@@ -200,7 +201,7 @@ class SpreadDrop extends Component{
     this.clearState();
   }
   handleConfirm(e){
-    e.stopPropagation();
+    // e.stopPropagation();
     const {handleConfirm,ikey,type,tagType,order,mainSaveText,copyType,value,mainData} = this.props;
     const params = Object.assign({},this.state,{ikey,type,tagType,order,mainSaveText,copyType,value,mainData});
     delete params.tmpDom;       //避免上面deepClone selecteds报错
@@ -330,9 +331,10 @@ class SpreadDrop extends Component{
     });
   }
   getClass(){
-    const {isImports,show,value} = this.props;
+    const {isImports,show,value,isExtBlue} = this.props;
     const blueBorder = this.state.editable?style['blue-border']:'';
     const orgBorder = isImports&&!value?style['orange-border']:'';
+    const ext = isExtBlue?style['ext']:'';
     if(show){
       $(this.$div.current).addClass(style['borderd']);
     }else{
@@ -341,7 +343,7 @@ class SpreadDrop extends Component{
     if(value){
       return classNames(style['selected-tag'],blueBorder);
     }
-    return classNames(style['tag'],orgBorder);
+    return classNames(style['tag'],orgBorder,ext);
   }
 
   componentDidMount(){
@@ -358,8 +360,9 @@ class SpreadDrop extends Component{
     }
   }*/
   render(){
-    const {placeholder,value,show,data,order} = this.props;
+    const {placeholder,value,show,data,order,type,tagType,ikey} = this.props;
     const {tmpDom,left} = this.state
+    const clickIndx = ikey.split('-')[1];//展开下拉的index
     if(!show&&tmpDom){
       $(tmpDom).parent().prev().attr({"contentEditable":true})
     }
@@ -378,8 +381,8 @@ class SpreadDrop extends Component{
         onInput={this.onChange}
         onkeydown={handleEnter}
         >{value||placeholder}</div>
-          <ListItems parDiv={this.$list} data={data} order={order} left={left}
-             show={show} handleSelect={this.handleSelect} handleConfirm={this.handleConfirm} handleClear={this.handleClear} {...this.state}></ListItems>
+          <ListItems parDiv={this.$list} data={data} order={order} left={left} boxMark={type} tagType={tagType}
+             show={show} cliIndex={clickIndx} handleSelect={this.handleSelect} handleConfirm={this.handleConfirm} handleClear={this.handleClear} {...this.state}></ListItems>
       </div>
   }
 }
@@ -388,6 +391,7 @@ class ListItems extends Component{
   constructor(props){
     super(props);
     this.$cont = React.createRef();
+    this.clickConfirm = this.clickConfirm.bind(this);
   }
   getLabels(){
     const {data,handleSelect} = this.props;
@@ -415,6 +419,11 @@ class ListItems extends Component{
     });
     return list;
   }
+  clickConfirm(){
+    const {handleConfirm} = this.props;
+    this.child&&this.child.reset();//重置搜索框中的数据
+    handleConfirm();   
+  }
   getStyle(){
     const {show,left} = this.props;
     return {
@@ -423,14 +432,19 @@ class ListItems extends Component{
     }
   }
   render (){
-    const {handleClear,handleConfirm,order,parDiv} = this.props;
+    const {handleClear,handleConfirm,order,parDiv,boxMark,tagType,show,cliIndex} = this.props;
     return <div className={style["drop-list"]} ref={parDiv} style={this.getStyle()} contentEditable="false" onClick={(e)=>{e.stopPropagation();}}>
         <p className={style['orderTips']}>按{order?'从左到右从上到下':'点击'}顺序成文</p>
         {this.getLabels()}
         <div className="oper clearfix">
           <span className={style['clear']} onClick={handleClear}>清空选项</span>
-          <span className={style['confirm']} onClick={handleConfirm}>确定</span>
+          <span className={style['confirm']} onClick={this.clickConfirm}>确定</span>
         </div>
+        
+        {boxMark==1 && tagType==11 && <div className="search">
+                  <div className={style["line"]}></div>
+                  <SearchBox show={show} cliIndex={cliIndex} onSelect={handleConfirm} onRef={(child)=>{this.child = child;}}/>
+                </div>}
       </div>
   }
 }
@@ -525,11 +539,26 @@ class ListItem extends Component{
       return <li onClick={(e)=>this.handleClick(e,it,i)} className={this.getClass(it.id)} title={it.name.length>8?it.name:''}>{it.name&&it.name.length>8?it.name.slice(0,8)+'...':it.name}</li>
     });
   }
-  render(){
+
+  getMainData(){//主诉添加症状-带搜索框
     const {datas,isSpecialPos} = this.props;
+    return datas&&datas.map((it,i)=>{
+      return <li onClick={(e)=>this.handleClick(e,it,i)} 
+            className={this.getClass(it.id)} 
+            title={it.name.length>4?it.name:''}
+            style={{'width':'55px','display':'inline-block'}}>
+            {it.name&&it.name.length>4?it.name.slice(0,4)+'...':it.name}
+          </li>
+    });
+  }
+
+  render(){
+    const {datas,isSpecialPos,boxMark,tagType,listIndex} = this.props;
     const pos = isSpecialPos?style['independent']:'';
-    return  <ul className={classNames(style['row'],pos)} onBlur={(e)=>e.stopPropagation()}>
-      {this.getData()}
+    const ifMainSear = boxMark==1 && tagType==11?true:false;
+    const main = ifMainSear&&listIndex==1?style['mainUl']:'';//伴字ul不设置宽度
+    return  <ul className={classNames(style['row'],pos,main)} onBlur={(e)=>e.stopPropagation()}>
+      {ifMainSear?this.getMainData():this.getData()}
     </ul>
   }
 }

+ 16 - 0
src/components/SpreadDrop/index.less

@@ -20,6 +20,19 @@
     width: 100%;
     border-bottom: 1px @disable-border-color solid;
   }
+  .mainUl{
+    width: 495px;
+    white-space: normal;
+    li{
+      width: 99px !important;
+    }
+  }
+  .line{
+    width: 100%;
+    height: 1px;
+    background: #EAEDF1;
+    margin: 20px 0 0 10px;
+  }
   li{
     padding-left: 20px;
     cursor: pointer;
@@ -41,6 +54,9 @@
 .tag,.selected-tag{
   cursor: pointer;
   line-height: 20px;
+  &.ext{
+    color: @extBlue;
+  }
 }
 
 .selected-tag{

+ 1 - 1
src/containers/CurrentIll.js

@@ -80,7 +80,7 @@ function mapDispatchToProps(dispatch) {
          //右侧推送
          setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
            if(didPushParamChange()){     //操作后内容有变化才推送
-             dispatch(billing());
+             dispatch(billing('',2));       //参数意义:点到现病史时查体无数据则提前获取查体模板,避免点查体时模板返回慢
            }
          },500);
        },

+ 6 - 3
src/containers/MultSpread.js

@@ -27,10 +27,13 @@ const getCopyData = (copyId,inx,boxMark)=>{
       data:JSON.stringify(copy),
       i:inx
     });
-    //自由文本组件更新
-    dispatch({
-      type:ISREAD
+    setTimeout(function () {      //血压添加时后面逗号不显示bug
+      dispatch({
+        type:ISREAD
+      })
     })
+    //自由文本组件更新
+
   }
 };
 

+ 68 - 0
src/containers/SearchBox.js

@@ -0,0 +1,68 @@
+import {connect} from 'react-redux';
+import SearchBox from '@commonComp/SearchBox';
+import {getSearch} from '@store/async-actions/fetchModules.js';
+import {CLEAR_ADD_SEARCH,SET_ADD_SEARCH,CHOOSE_SEARCH} from '@store/types/mainSuit';
+import {ISREAD} from '@store/types/homePage.js';
+import {billing} from '@store/async-actions/pushMessage';
+import {Notify} from '@commonComp';
+import {filterDataArr} from '@utils/tools.js';
+import store from '@store';
+import config from '@config/index.js';
+
+function mapStateToProps(state){
+  return{
+    mainSearchData:state.mainSuit.addSearchData,//主诉-添加症状-搜索结果
+    mainIds:state.mainSuit.mainIds,  //搜索去重id
+  }
+}
+
+function mapDispatchToProps(dispatch){
+  return{
+    // 主诉-添加症状-搜索
+    getSearchData:(item)=>{
+      getSearch(item).then((res)=>{
+          let result = res.data;
+          if(+result.code == 0){
+            let data = result.data;
+            dispatch({
+              type:SET_ADD_SEARCH,
+              data:data
+            })
+          }else{
+            console.log(result.msg);
+          }
+      });
+    },
+    chooseSearch(obj){
+      // 主诉字数限制
+      let state = store.getState();
+      let mainSaveText = state.mainSuit.saveText;
+      let text = filterDataArr(mainSaveText);
+      let total = text.length + obj.item.name.length + 1; //+1是因为顿号
+      if(total >= config.limited){
+        Notify.info(config.limitText);
+        return
+      }
+      dispatch({
+        type: CHOOSE_SEARCH,
+        item:obj.item,
+        index:obj.index
+      })
+      dispatch({    //自由文本标签数据更新
+        type:ISREAD
+      });
+      //右侧推送
+      setTimeout(function(){ 
+        dispatch(billing());
+      },200);
+    },
+    clearSearch:()=>{
+      dispatch({
+        type: CLEAR_ADD_SEARCH
+      })
+    },
+  }
+}
+
+const SearchBoxContainer = connect(mapStateToProps,mapDispatchToProps)(SearchBox);
+export default SearchBoxContainer;

+ 9 - 0
src/containers/eleType.js

@@ -31,6 +31,7 @@ export function singleRadio(params){
       const list = data.questionDetailList&&data.questionDetailList.length>0?data.questionDetailList:data.questionMapping;
       return <RadioDrop data={custom&&custom.length?[...custom,...list]:list}
                         placeholder={data.name}
+                        isExtBlue={data.specFlag===4?true:false}
                         show={showArr&&showArr[showInx]}
                         value = {data.value}
                         boxMark={boxMark}
@@ -45,6 +46,7 @@ export function singleRadio(params){
                      placeholder={data.name}
                      value={data.value}
                      copyType={data.copyType}
+                     isExtBlue={data.specFlag===4?true:false}
                      selecteds={selecteds ?selecteds[i]:[]}
                      show={showArr&&showArr[showInx]}
                      order={data.textGenerate}
@@ -59,6 +61,7 @@ export function singleRadio(params){
       return <NumberUnitDrop prefix={data.labelPrefix}
                          suffix={data.labelSuffix}
                          placeholder={data.name}
+                         isExtBlue={data.specFlag===4?true:false}
                          formulaCode={data.formulaCode}
                          boxMark={boxMark}
                          id={data.id}
@@ -71,6 +74,7 @@ export function singleRadio(params){
       return <InlineTag prefix={data.labelPrefix}
                         suffix={data.labelSuffix}
                         placeholder={data.name}
+                        isExtBlue={data.specFlag===4?true:false}
                         value={data.value}
                         isImports={isHigh}
                         id={data.id}
@@ -78,10 +82,12 @@ export function singleRadio(params){
     case 7:
       const min = data.minValue;//!=null&&data.minValue!=undefined?data.minValue-1:undefined;
       const max = data.maxValue;//!=null&&data.maxValue!=undefined?+data.maxValue+1:undefined;
+
       return <NumberDrop prefix={data.labelPrefix}
                          suffix={data.labelSuffix}
                          min={min}
                          max={max}
+                         isExtBlue={data.specFlag===4?true:false}
                          placeholder={data.name}
                          boxMark={boxMark}
                          id={data.id}
@@ -95,6 +101,7 @@ export function singleRadio(params){
       return <RadioInpDrop data={data.questionDetailList}
                            vals={data.vals}
                         placeholder={data.name}
+                        isExtBlue={data.specFlag===4?true:false}
                         show={showArr&&showArr[showInx]}
                         value = {data.value}
                         boxMark={boxMark}
@@ -115,6 +122,7 @@ function multLabels(params){
                      showAdd = {+data.showAdd===1}
                      copyId={data.id}
                      fullData = {data}
+                     isExtBlue={data.specFlag===4?true:false}
                      showArr={showArr||{}}
                      update={Math.random()}
                      boxMark={boxMark}
@@ -138,6 +146,7 @@ function multCheckLabels(params,tagType){
                      placeholder={data.name}
                      value={data.value}
                      copyType={data.copyType}
+                     isExtBlue={data.specFlag===4?true:false}
                      selecteds={selecteds ?selecteds[i]:[]}
                      show={showArr&&showArr[showInx]}
                      order={data.textGenerate}

+ 49 - 0
src/store/actions/mainSuit.js

@@ -403,6 +403,55 @@ export const setSearch = (state,action)=>{
   res.isEnd = action.isEnd;
   return res;
 }
+// 主诉-添加症状-选中搜索结果
+export const chooseSearch = (state,action)=>{
+  const res = Object.assign({},state);
+  const index = parseInt(action.index);
+  const item = action.item;
+  let data = res.data;
+  let text = {id:item.questionId,name:item.name,value:item.name,tagType:config.tagType,conceptId:item.conceptId};
+  // 判断index前是saveText中是否有伴
+  let nText = {};
+  if(!data[index].pos){//第一病程
+    const preText = res.saveText.slice(0,index);
+    const ind = preText.indexOf("伴");
+    if(ind != -1){
+      nText = Object.assign({},text,{exist:2});
+    }else{
+      nText = Object.assign({},text,{exist:1});
+    }
+  }else{//第二及以上病程
+    nText = Object.assign({},text);
+  }
+
+  // 缓存到localStorage中
+  const mainSymp = storageLocal.get('mainSymp');
+  if(mainSymp){
+    let localArr = JSON.parse(mainSymp);
+    let sympArr = JSON.parse(JSON.stringify(localArr));
+    for(let k=0; k<localArr.length; k++){//判断是否已存在
+      if(localArr[k].conceptId==item.conceptId){
+        sympArr.splice(k,1);
+      }
+    }
+    sympArr.push(nText);
+    if(sympArr.length>5){
+      storageLocal.set('mainSymp',sympArr.slice(sympArr.length-5,));
+    }else{
+      storageLocal.set('mainSymp',sympArr);
+    }
+  }
+  // 插入data中
+  // res.data.splice(index,0,nText);
+  res.data.splice(index,0,Object.assign({},nText,{name:'、'+item.name,value:'、'+item.name}));
+  res.saveText.splice(index,0,'、'+item.name);
+  res.mainIds.push(item.conceptId);
+  if(item.questionId){
+    res.mainTailIds.push(item.questionId);
+  }
+  res.update=Math.random();
+  return res;
+}
 
 //将选中的搜索结果插入
 export const insertSearch = (state,action)=>{

+ 12 - 3
src/store/reducers/mainSuit.js

@@ -2,11 +2,11 @@ import {RECOVER_TAG_MAIN,COMM_SYMPTOMS,CLEAR_COMSYMPTOMS,SHOW_TAIL,INSERT_MAIN,
   SET_SEARCH,CLEAR_SEARCH,GET_BIGDATAPUSH,SET_MAINSUIT,MIX_CONFIRM,NUMBER_SELECT,
   RADIO_SELECT,COMM_CONFIRM,CHANGE_LABELVAL,SAVE_FREE,CLEAR_MAIN_SUIT,SET_DATA,
   INSERT_SEARCH,MAIN_FOCUS_INDEX,SETTEXTMODEVALUE,SETMAINTEXT,MAINADDLABELITEM,SETMAININPUT,DEL_MAIN,CHANGE_LABELVAL_NUMBER,
-  REMOVE_MAIN_ID,MAINSUIT_MUL,DEL_MAIN_LABLE,SET_FEATURE,SET_MS_RADIO_INPUT_VAL,SAVE_CHRONIC,MAIN_REMOVE_SPAN} from '../types/mainSuit'
+  REMOVE_MAIN_ID,MAINSUIT_MUL,DEL_MAIN_LABLE,SET_FEATURE,SET_MS_RADIO_INPUT_VAL,SAVE_CHRONIC,MAIN_REMOVE_SPAN,SET_ADD_SEARCH,CLEAR_ADD_SEARCH,CHOOSE_SEARCH} from '../types/mainSuit'
 import {recoveTag,getCommSymptoms,handleTailClick,insertMain,setSearch,getBigSymptom,setMainMoudle,confirm,
   setNumberValue,setRadioValue,commConfirm,changeLabelVal,saveFreeVal,clearMainSuit,insertSearch,setTextModeValue,setCheckText,
   addLabelItem,setInputLabel,backspaceText,changeNumLabelVal,removeId,multipleComfirn,delSingleLable,
-  getSymptomFeature,setRadioInputValue} from '../actions/mainSuit'
+  getSymptomFeature,setRadioInputValue,chooseSearch} from '../actions/mainSuit'
 
 
 const initState = {
@@ -29,7 +29,8 @@ const initState = {
   },
   chronicDesease:null, //慢病
   mainTailIds:[],  //获取症状尾巴用
-  mainReadSonM:[] //回读的子模板
+  mainReadSonM:[], //回读的子模板
+  addSearchData:[] //添加症状里的搜索
 }
 
 export default function(state=initState,action){
@@ -118,6 +119,14 @@ export default function(state=initState,action){
         res.editClear = true;
       }
       return res;
+    case SET_ADD_SEARCH: //添加症状-搜索
+      res.addSearchData = action.data;
+      return res;
+    case CHOOSE_SEARCH:
+      return chooseSearch(state,action);
+    case CLEAR_ADD_SEARCH://清空症状搜索结果
+      res.addSearchData = [];
+      return res;
     default:
       return state;
   }

+ 3 - 0
src/store/types/mainSuit.js

@@ -31,3 +31,6 @@ export const SET_MS_RADIO_INPUT_VAL = 'SET_MS_RADIO_INPUT_VAL';
 export const SAVE_CHRONIC = 'SAVE_CHRONIC'; //储存慢病信息
 export const RECOVER_TAG_MAIN = 'RECOVER_TAG_MAIN';   //恢复已删除标签
 export const MAIN_REMOVE_SPAN = 'MAIN_REMOVE_SPAN';   //删除最后一个空span
+export const SET_ADD_SEARCH = 'SET_ADD_SEARCH';   //添加症状-搜索
+export const CLEAR_ADD_SEARCH = 'CLEAR_ADD_SEARCH';   //添加症状-搜索
+export const CHOOSE_SEARCH = 'CHOOSE_SEARCH';   //添加症状-搜索