Explorar el Código

Merge remote-tracking branch 'origin/CommonTemplate' into dev5.4.1

zhouna hace 5 años
padre
commit
8df5cb3430
Se han modificado 72 ficheros con 1539 adiciones y 308 borrados
  1. 4 2
      src/common/components/ConfirmModal/index.jsx
  2. 6 4
      src/common/components/ConfirmModal/index.less
  3. 17 4
      src/common/components/EditableSpan/index.jsx
  4. 5 0
      src/common/components/EditableSpan/index.less
  5. 19 6
      src/common/components/InlineTag/index.jsx
  6. 1 0
      src/common/components/ItemBox/index.jsx
  7. 15 0
      src/common/less/variables.less
  8. 13 8
      src/components/AssessResult/ScaleItem/index.jsx
  9. 3 3
      src/components/AssessResult/index.jsx
  10. 2 2
      src/components/CaseQuailty/index.jsx
  11. 29 21
      src/components/ChronicInfo/index.jsx
  12. 2 2
      src/components/DiagnosticItem/index.jsx
  13. 2 2
      src/components/MedicalInfo/index.jsx
  14. 20 8
      src/components/MultSpread/index.jsx
  15. 17 5
      src/components/Multiple/index.jsx
  16. 3 0
      src/components/Multiple/index.less
  17. 19 5
      src/components/NumberDrop/index.jsx
  18. 7 0
      src/components/NumberDrop/index.less
  19. 17 4
      src/components/NumberUnitDrop/index.jsx
  20. BIN
      src/components/Operation/Search/imgs/clear.png
  21. BIN
      src/components/Operation/Search/imgs/search.png
  22. 107 0
      src/components/Operation/Search/index.jsx
  23. 38 0
      src/components/Operation/Search/index.less
  24. 82 34
      src/components/Operation/index.jsx
  25. 57 17
      src/components/Operation/index.less
  26. 58 19
      src/components/PushContainer/index.jsx
  27. 0 1
      src/components/PushItems/index.jsx
  28. 19 6
      src/components/RadioDrop/index.jsx
  29. 3 0
      src/components/RadioDrop/index.less
  30. 18 5
      src/components/RadioInpDrop/index.jsx
  31. 17 5
      src/components/SpreadDrop/index.jsx
  32. 3 0
      src/components/SpreadDrop/index.less
  33. 78 22
      src/components/TemplateItems/TemplateItem/index.jsx
  34. 1 1
      src/components/TemplateItems/TemplateItem/index.less
  35. 97 30
      src/components/TemplateItems/index.jsx
  36. 38 6
      src/components/TemplateItems/index.less
  37. 15 2
      src/containers/AssessResult.js
  38. 26 12
      src/containers/ChronicInfo.js
  39. 9 2
      src/containers/EditableSpan.js
  40. 8 0
      src/containers/InlineTag.js
  41. 10 2
      src/containers/MultSpread.js
  42. 8 1
      src/containers/Multiple.js
  43. 8 1
      src/containers/NumberDrop.js
  44. 8 1
      src/containers/NumberUnitDrop.js
  45. 15 4
      src/containers/OperationContainer.js
  46. 9 2
      src/containers/RadioDrop.js
  47. 8 1
      src/containers/RadioInpDrop.js
  48. 8 1
      src/containers/SpreadDrop.js
  49. 34 3
      src/containers/eleType.js
  50. 58 15
      src/modules/HomePage/index.jsx
  51. 12 5
      src/store/actions/checkBody.js
  52. 25 1
      src/store/actions/homePage.js
  53. 41 1
      src/store/actions/tabTemplate.js
  54. 0 1
      src/store/actions/treat.js
  55. 21 2
      src/store/async-actions/patInfo.js
  56. 13 0
      src/store/async-actions/print.js
  57. 199 6
      src/store/async-actions/tabTemplate.js
  58. 4 2
      src/store/reducers/checkBody.js
  59. 4 2
      src/store/reducers/currentIll.js
  60. 11 3
      src/store/reducers/homePage.js
  61. 4 2
      src/store/reducers/mainSuit.js
  62. 4 2
      src/store/reducers/otherHistory.js
  63. 108 7
      src/store/reducers/tabTemplate.js
  64. 1 0
      src/store/types/checkBody.js
  65. 2 0
      src/store/types/currentIll.js
  66. 3 0
      src/store/types/homePage.js
  67. 1 0
      src/store/types/mainSuit.js
  68. 2 1
      src/store/types/otherHistory.js
  69. 8 0
      src/store/types/tabTemplate.js
  70. 2 2
      src/utils/config.js
  71. 5 1
      src/utils/tools.js
  72. 28 1
      src/utils/utils.js

+ 4 - 2
src/common/components/ConfirmModal/index.jsx

@@ -69,6 +69,7 @@ const defaultProps = {
     cancelBg: '#fff',
     width: '300px',
     height: '200px',
+    borderBtm:'0'
 };
 
 class ConfirmModal extends Component {
@@ -123,7 +124,8 @@ class ConfirmModal extends Component {
             height, 
             closable, 
             noFooter,
-            icon
+            icon,
+            borderBtm
         } = this.props;
         const marginLeft = -parseInt(width)/2
         const marginTop = -parseInt(height)/2
@@ -131,7 +133,7 @@ class ConfirmModal extends Component {
             <NewPortal visible={visible}>
                 <div className={styles['modal-wrapper']} id='confirm'>
                     <div className={styles[['modal']]} style = {{width: width, marginLeft:marginLeft, minHeight:height, marginTop:marginTop}}>
-                        <div className={styles['modal-title']} style={{background: titleBg}}>
+                        <div className={styles['modal-title']} style={{background: titleBg,borderBottom:borderBtm}}>
                             {icon?<img src={icon} className={styles['icon']}/>:''}
                             {title ? title : ''} 
                             {closable ? <img onClick={this.closeModal} className={styles['modal-close']} src = {close}/> : false}

+ 6 - 4
src/common/components/ConfirmModal/index.less

@@ -8,15 +8,16 @@
     margin: auto;
     border-radius: 5px;
     background: #fff;
-    overflow: hidden;
+    // overflow: hidden;
 }
 
 .modal-title {
     width: 100%;
-    height: 50px;
-    line-height: 50px;
+    height: 46px;
+    line-height: 46px;
     padding: 0 10px;
-    background: #e5e5e5
+    background: #e5e5e5;
+    border-radius: 5px 5px 0 0;
 }
 
 .icon{
@@ -27,6 +28,7 @@
 .modal-close {
     position: absolute;
     right: 0px;
+    top: 2px;
     width: 40px;
     height: 40px;
     cursor: pointer;

+ 17 - 4
src/common/components/EditableSpan/index.jsx

@@ -38,6 +38,8 @@ class EditableSpan extends Component{
     this.handleKeydown = this.handleKeydown.bind(this);
     this.handleKeyup = this.handleKeyup.bind(this);
     this.handleClick = this.handleClick.bind(this);
+    this.selectStart = this.selectStart.bind(this);
+    this.selectEnd=this.selectEnd.bind(this);
   }
   handleFocus(e){
     e.stopPropagation();
@@ -179,7 +181,7 @@ class EditableSpan extends Component{
     }
   }
   handleKeyup(e){
-    const {boxMark,handleKeydown,removeId,handleClear,removeSpan,handleChange} = this.props;
+    const {boxMark,handleKeydown,removeId,handleClear,removeSpan,handleChange,select_end} = this.props;
     const {preVal,index} = this.state;
     const ev = e||window.event;
     const target = ev.target||ev.srcElement;
@@ -246,7 +248,7 @@ class EditableSpan extends Component{
       }
     }
 
-    if(ev.keyCode==8){
+    if(ev.keyCode==8&&!select_end){
       // 主诉现病史去重:删除最后一个字的时候移除该数据(将name、id和value替换成空)并移除id
       // 前面是标签,内容为空时再删一次才移除标签;前面是文本,则直接移除;
       let preObj = $(this.$span.current).prev();
@@ -333,8 +335,16 @@ class EditableSpan extends Component{
       this.$span.current.innerText?(this.$span.current.innerText = value||''):(this.$span.current.innerHTML = value||'');
     }
   }
+  selectStart(){
+    const {i,setSelectArea,boxMark}= this.props;
+    setSelectArea({i,boxMark,dir:'start'});
+  }
+  selectEnd(){
+    const {i,setSelectArea,boxMark}= this.props;
+    setSelectArea({i,boxMark,dir:'end'});
+  }
   getClass(){
-    const {full,value,saveText,i,preIsExt,afterIsExt} = this.props;
+    const {full,value,saveText,i,preIsExt,afterIsExt,mouseSelect} = this.props;
     const br = preIsExt&&!afterIsExt;       //最后一个体征标签
     const preSelected = saveText[i-1];
     const isFull = full?' '+style['full']:'';       //是否宽度设为整行宽度
@@ -342,11 +352,12 @@ class EditableSpan extends Component{
     const ext = preIsExt?style['ext']:style['unselect'];
     const unselect = value.match(config.punctuationReg)||preSelected?'':ext;
     const hasBr = br?style['editable-br']:'';       //最后一个体征标签换行
+    const selectedArea = mouseSelect?style['selected-area']:'';
     const $span = this.$span.current;
     if(br&&$span&&!$span.innerText){
       this.$span.current.innerHTML='&nbsp;';
     }
-    return classNames(style['editable-span'],isFull,unselect,hasBr,setFontColorSize(2,6));
+    return classNames(style['editable-span'],isFull,unselect,hasBr,setFontColorSize(2,6),selectedArea);
   }
 
   render() {
@@ -356,6 +367,8 @@ class EditableSpan extends Component{
                  onInput={this.onChange}
                  onFocus={this.handleFocus}
                  onBlur={this.handleBlur}
+                 onmousedown={this.selectStart}
+                 onmouseup={this.selectEnd}
                  onkeydown={this.handleKeydown}
                  onclick={this.handleClick}
                  onkeyup={this.handleKeyup}></span>;

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

@@ -6,11 +6,16 @@
   min-width: 10px;
   // line-height: 2;
   min-height: 16px;//火狐需要
+  height: 25px;
   line-height: 22px;
   vertical-align: unset;
   text-align: left;
   padding-right: 1px;//火狐左右移动需要
   font-weight: bold;
+  &.selected-area{
+  background: #338fff;
+  color: #fff!important;
+}
 }
 .editable-br{
   .editable-span;

+ 19 - 6
src/common/components/InlineTag/index.jsx

@@ -77,19 +77,20 @@ class InlineTag extends Component {
     }
   }
   getStyle(){
-    const {hideTag,placeholder,isExtBlue} = this.props;
+    const {hideTag,placeholder,isExtBlue,mouseSelect} = this.props;
     const value = this.state.value;
     const ext = isExtBlue?style['ext']:'';//是否为体征
+    const selectedArea = mouseSelect?style['selected-area']:'';
     if(hideTag){//是否是多标签组合
       if(value){
-        return classNames(style['selected-no-tag'], setFontColorSize());
+        return classNames(style['selected-no-tag'], setFontColorSize(),selectedArea);
       }
-      return classNames(style['no-tag'],ext, setFontColorSize(2),'prefixUnsetColor');
+      return classNames(style['no-tag'],ext, setFontColorSize(2),'prefixUnsetColor',selectedArea);
     }
     if(!value||value.trim()==placeholder){//灰色标签
-      return classNames(style['gray'],ext, setFontColorSize(2));
+      return classNames(style['gray'],ext, setFontColorSize(2),selectedArea);
     }
-    return classNames(style['selected-tag'],ext, setFontColorSize());
+    return classNames(style['selected-tag'],ext, setFontColorSize(),selectedArea);
   }
   moveEnd(obj) {
     if(window.getSelection){//ie11 10 9 ff safari
@@ -108,6 +109,16 @@ class InlineTag extends Component {
   handleFixClick(){
     this.moveEnd(this.$span.current);
   }
+  handleMouseUp(){
+    const {select_start,i,setSelectArea,boxMark}= this.props;
+    if(select_start!==undefined){
+      setSelectArea({i,boxMark,dir:'end'});
+    }
+  }
+  handleMouseDown(){
+    const {i,setSelectArea,boxMark}= this.props;
+    setSelectArea({i,boxMark,dir:'start'});
+  }
   componentDidMount(){
     //设置最小宽度避免输入后宽度跳动
     this.$span.current.innerHTML=this.props.placeholder;
@@ -117,7 +128,9 @@ class InlineTag extends Component {
   render(){
     const {prefix,suffix,isExtBlue} = this.props;
     return <div className={this.getStyle()}
-                onClick={this.handleFixClick}>
+                onClick={this.handleFixClick}
+                onMouseUp={this.handleMouseUp.bind(this)}
+                onMouseDown={this.handleMouseDown.bind(this)}>
                 <span className="prefixUnset">{prefix}</span>
                 <span className={`${style['free-in']} prefixUnset`}
                       contentEditable={true}

+ 1 - 0
src/common/components/ItemBox/index.jsx

@@ -30,6 +30,7 @@ class ItemBox extends Component {
   }
 
   handleClick(e){
+    e.stopPropagation();
     const {handleClick} = this.props;
     handleClick && handleClick(e);//为了获取鼠标位置,显示搜索结果框;
   }

+ 15 - 0
src/common/less/variables.less

@@ -143,6 +143,13 @@
     /*width: 8px;*/
     display: inline-block;
   }
+  &.selected-area{
+     background: #338fff;
+    color: #fff!important;
+    span,div{
+      color: #fff!important;
+    }
+   }
  }
 .selected-tag{
   position: relative;//发热
@@ -151,7 +158,15 @@
   font-weight: bold;
   /*padding: 0 3px 0;*/
   border-bottom: 1px @border-color solid;
+  &.selected-area{
+    background: #338fff;
+    color: #fff!important;
+    span,div{
+      color: #fff!important;
+    }
+  }
 }
+
 .no-tag{
   display: inline-block;
   position: relative;

+ 13 - 8
src/components/AssessResult/ScaleItem/index.jsx

@@ -83,6 +83,7 @@ class ScaleItem extends Component {
     }
   }
   handleInputformula(id,calcuContent,i,e) {
+    const { calcuResult,handleCalcu } = this.props;
     const {calcuValues} = this.state;
     let obj = deepClone(calcuValues);
     let values = (obj&&obj[id])||deepClone(calcuContent);
@@ -96,6 +97,7 @@ class ScaleItem extends Component {
       isCalculated:false,
       calcuValues:obj
     });
+    handleCalcu&&handleCalcu(id,values,calcuResult);
   }
   handleForRadio(id,calcuContent,i,fidx){//计算公式
     const { calcuValues } = this.state;
@@ -135,8 +137,8 @@ class ScaleItem extends Component {
   }
   calcuFormula(item) { //计算公式计算
     const { calcuResult,handleCalcu } = this.props;
-    const {formulaId,calcuValues} = this.state;
-    let it=calcuValues&&calcuValues[formulaId];
+    const {calcuValues,formulaId} = this.state;
+    let it=calcuValues&&deepClone(calcuValues[formulaId]);
     let allHasInfo = true;
     for (let i = 0; i < it.length; i++) {
       if(it[i].controlType == 2) {  //输入框类型的有没有填值
@@ -155,14 +157,16 @@ class ScaleItem extends Component {
         }
       }
     }
-    item.content.details = calcuValues[formulaId];
+    const itemCopy = deepClone(item)
+    itemCopy.content.details = calcuValues[formulaId]
+    // item.content.details = calcuValues[formulaId];
     if(allHasInfo) { //所有都有值,则计算
       let results = deepClone(calcuResult);
-      getFormulaResult({type:2,data:item}).then((res)=>{
+      getFormulaResult({type:2,data:itemCopy}).then((res)=>{
         if(+res.data.code==0){
           const result = res.data.data.result;
           results[formulaId] = result;
-          handleCalcu&&handleCalcu(calcuValues,results);
+          handleCalcu&&handleCalcu(formulaId,calcuValues[formulaId],results);
           this.setState({
             isCalculated:true
           });
@@ -176,10 +180,9 @@ class ScaleItem extends Component {
   }
   getDetailItems(item,i){
     let arr = [],temp='';
-    const {indexs,result,formulaResult,disabled,calcuResult} = this.props;
-    const {optionId,formulaId,radioVal,calcuValues} = this.state;
+    const {indexs,result,formulaResult,disabled,calcuValues,calcuResult} = this.props;
+    const {optionId,formulaId,radioVal} = this.state;
     const possible=result&&result.possible;
-
     item.details.map((its,j)=>{
       let it=its;
       if(indexs[i]&&indexs[i].includes(j)){
@@ -194,6 +197,7 @@ class ScaleItem extends Component {
         }else if(its.type==2){      //计算公式
           const showRes = calcuResult&&calcuResult[item.conceptId]||it.content.result;
           const details = calcuValues&&calcuValues[item.conceptId]||it.content.details;
+
           const cresult = showRes&&showRes[1]&&showRes[1].text;
                     temp = <div className={style['results']}>
                     <span>计算公式结果:</span>
@@ -233,6 +237,7 @@ class ScaleItem extends Component {
                               </td>
                             </tr>
                           }else if(item1.controlType==2){//输入框
+                            
                             return <tr>
                               <td>
                                 <span>{item1.isShow == '0' ? item1.name+':':'请输入'+item1.name+':'}</span>

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

@@ -91,14 +91,14 @@ class AssessResult extends Component {
       chartTimeTypes:Object.assign(chartTimeTypes,{[i]:selects})
     });
   }
-  handleCalcu(values,ret){
+  handleCalcu(id,values,ret){
     const {saveCalcuValue,saveCalcuResult}=this.props;
     this.setState({
       calcuResult:ret,
-      calcuValues:values
+      calcuValues:{[id]:values}
     });
     saveCalcuResult&&saveCalcuResult(ret);
-    saveCalcuValue&&saveCalcuValue(values);
+    saveCalcuValue&&saveCalcuValue(values, id);
   }
   componentWillUnmount(){
     //点确定关闭弹窗时把参数传到父组件去

+ 2 - 2
src/components/CaseQuailty/index.jsx

@@ -8,11 +8,11 @@ class CaseQuailty extends Component {
     this.$cont = React.createRef();
   }
   componentDidMount(){
-    const height = getWindowInnerHeight()-148;
+    const height = getWindowInnerHeight()-149;
     this.$cont.current.style.height = height+"px";
     windowEventHandler('resize', ()=>{
       if(this.$cont.current){
-        const height = getWindowInnerHeight()-148;
+        const height = getWindowInnerHeight()-149;
         this.$cont.current.style.height = height+"px";
       }
     });

+ 29 - 21
src/components/ChronicInfo/index.jsx

@@ -228,24 +228,27 @@ class ChronicInfo extends React.Component{
     addAssessItem(v,pIndex,i);
   }
   addFormula(it,v,pIndex,i){
-    const {chronicMagItem} = this.props;
+    const {chronicMagItem, setCalcuInfo} = this.props;
     this.closeFormula(it);
-    chronicMagItem&&this.handleAddAssessItem(v,pIndex,i);
+    const itCopy = deepClone(it)
+    const vCopy = deepClone(v)
+    setCalcuInfo && setCalcuInfo(v.conceptId,itCopy.content.details,itCopy.content.result)
+    chronicMagItem&&this.handleAddAssessItem(vCopy,pIndex,i);
   }
-  handleInputformula(id,calcuContent,i,e) {
-    const {calcuValues} = this.state;
-    let obj = deepClone(calcuValues);
-    let values = (obj&&obj[id])||deepClone(calcuContent);
+  handleInputformula(id,calcuContent,i,j,idd,cres,e) {
+    // const {calcuValues} = this.state;
+    const {calcuResult,calcuValues,setCalcuInfo,data,setChronicPush} = this.props;
+    const dataCopy = deepClone(data)
+      let obj = deepClone(dataCopy[i].details[j].content.details);
+    let values = deepClone(obj);
     const txt = e.target.value;
-    values[i].value = txt.replace(/[\u4e00-\u9fa5]|[^\d.]/g,'');       //处理中文输入法的情况
-    obj[id] = values;
+    values[idd].value = txt.replace(/[\u4e00-\u9fa5]|[^\d.]/g,'');       //处理中文输入法的情况
     if(/[\u4e00-\u9fa5]|[^\d.]/g.test(txt)){
       e.target.value = txt.replace(/[\u4e00-\u9fa5]|[^\d.]/g,'');
     }
-    this.setState({
-      isCalculated:false,
-      calcuValues:obj
-    });
+  
+    dataCopy[i].details[j].content.details = values
+    setChronicPush&&setChronicPush(dataCopy)
   }
   handleForRadio(id,calcuContent,i,fidx){//计算公式
     const { calcuValues } = this.state;
@@ -295,11 +298,10 @@ class ChronicInfo extends React.Component{
       radioVal:Object.assign({},obj.radioVal),//不设置radioVal只有最近一次选中的值
     })
   }
-  calcuFormula(id,it) { //计算公式计算
-    const { calcuFormula } = this.props;
+  calcuFormula(id,it,i,j) { //计算公式计算
+    const {calcuFormula, data } = this.props;
     let item = deepClone(it);
-    const values = this.state.calcuValues;
-    const calcuValues = Object.keys(values).length&&values[id]?values[id]:item.content.details;
+    const calcuValues = item.content.details
     let allHasInfo = true;
     for (let i = 0; i < calcuValues.length; i++) {
       if(calcuValues[i].controlType == 2) {  //输入框类型的有没有填值
@@ -325,7 +327,7 @@ class ChronicInfo extends React.Component{
         data: item,
         disId: id
       };
-      calcuFormula(param);
+      calcuFormula(param,data,i, j);
       this.setState({
         isCalculated:true
       });
@@ -404,9 +406,15 @@ class ChronicInfo extends React.Component{
                                 </span>
                               </p>
                         }else if(it.type==2){
-                          const cres = calcuResult&&calcuResult[v.conceptId]||it.content.result;
+                          //如果保存过,则使用保存内容
+                          // const cres = calcuResult&&calcuResult[v.conceptId]||it.content.result;
+                          //每次都取最新推送内容
+                          const cres = it.content.result || [];
                           const result = cres&&cres[1]&&cres[1].text;
-                          const details = calcuValues&&calcuValues[v.conceptId]||it.content.details;
+                          //如果保存过,则使用保存内容
+                          // const details = calcuValues&&calcuValues[v.conceptId]||it.content.details;
+                          //每次都取最新推送内容
+                          const details = it.content.details || [];
                           return <div className={style["marTop"]}>
                             <span className={style["limit"]}>
                               计算公式结果:
@@ -449,7 +457,7 @@ class ChronicInfo extends React.Component{
                                           <span>{item.isShow == '0' ? item.name+':':'请输入'+item.name+':'}</span>
                                         </td>
                                         <td>
-                                          {item.isShow == '0' ? item.value + ' ' +item.uint : <input type="text" className={style['itemInp']} placeholder="请输入"  value={item.value} onInput={this.handleInputformula.bind(this,v.conceptId,details,idd)}/>}
+                                          {item.isShow == '0' ? item.value + ' ' +item.uint : <input type="text" className={style['itemInp']} placeholder="请输入"  value={item.value} onInput={this.handleInputformula.bind(this,v.conceptId,details,i,j,idd,cres)}/>}
                                         </td>
                                         <td>
                                           {item.isShow != '0'&&<span>{item.uint}</span>}
@@ -459,7 +467,7 @@ class ChronicInfo extends React.Component{
                                     }
                                 })}
                                 </table>
-                                <div className={style["forMulBtn"]} onClick={this.calcuFormula.bind(this,v.conceptId,it)}>计算</div>
+                                <div className={style["forMulBtn"]} onClick={this.calcuFormula.bind(this,v.conceptId,it,i,j)}>计算</div>
                                 <table>
                                   {cres && Array.isArray(cres) &&cres.map((itemResult, resultIndex) => {
                                     return <tr>

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

@@ -64,11 +64,11 @@ class DiagnosticItem extends Component{
         getTips && getTips({id:item.id,type:7,name: item.name, position: 1});
     }
     addDiagodal(diagType){
-        const {item, isChronicMag} = this.props;
+        const {item, isChronicMag,mode} = this.props;
         item.type = diagType;
          const {  addDiagnostic, clearInput, hideSearch } = this.props;
 
-         if(item.type == 2) {
+         if(item.type == 2&&mode=='0') {      //文本模式不走慢病
              isChronicMag(item);
          }
          addDiagnostic&&addDiagnostic(item);

+ 2 - 2
src/components/MedicalInfo/index.jsx

@@ -115,12 +115,12 @@ class MedicalInfo extends Component {
     });
   }
   componentDidMount(){
-    const height = getWindowInnerHeight()-148;
+    const height = getWindowInnerHeight()-149;
     this.$cont.current.style.height = height+"px";
     this.props.getFilters();
     windowEventHandler('resize', ()=>{
       if(this.$cont.current){
-        const height = getWindowInnerHeight()-148;
+        const height = getWindowInnerHeight()-149;
         this.$cont.current.style.height = height+"px";
       }
       if(this.$ul.current){

+ 20 - 8
src/components/MultSpread/index.jsx

@@ -48,13 +48,14 @@ class MultSpread extends Component{
     this.setBMIstate = this.setBMIstate.bind(this);
   }
   getClass(){
-    const {saveText,ikey,showAdd,isExtBlue} = this.props;
+    const {saveText,ikey,showAdd,isExtBlue,mouseSelect} = this.props;
     const labelInx = tools.getLabelIndex(ikey);
     const text = saveText&&saveText[+labelInx];
     //const orgBorder = isImports&&!text?style['orange-border']:'';
     const isSelected = text?style['selected']:style['container'];
     const hasAdd = showAdd?style['add']:'';
-    return classNames(isSelected,hasAdd,setFontColorSize(!!text?'2,6':isExtBlue?2:1));
+    const selectedArea = mouseSelect?style['selected-area']:'';
+    return classNames(isSelected,hasAdd,setFontColorSize(!!text?'2,6':isExtBlue?2:1),selectedArea);
   }
   saveDoms(it){
     const doms = this.state.numDoms;
@@ -138,7 +139,7 @@ class MultSpread extends Component{
   }
   getLabels(){
     const {data,ikey,showArr,copyId,boxMark,isExtBlue,saveText} = this.props;
-    const {wrBmi,bmi} = this.state;
+    const {wrBmi,bmi,isSelectAll} = this.state;
     const labelInx = tools.getLabelIndex(ikey);
     const text = !!(saveText&&saveText[+labelInx]);
     let show = false;
@@ -157,7 +158,6 @@ class MultSpread extends Component{
                             placeholder={it.name}
                             show={show}
                             value = {it.value}
-                            isSelectAll={text}
                             ikey={inx}
                             id={it.id}
                             patId = {copyId}
@@ -240,6 +240,16 @@ class MultSpread extends Component{
     });
     return list;
   }
+  handleMouseUp(){
+    const {select_start,i,setSelectArea,boxMark}= this.props;
+    if(select_start!==undefined){
+      setSelectArea({i,boxMark,dir:'end'});
+    }
+  }
+  handleMouseDown(){
+    const {i,setSelectArea,boxMark}= this.props;
+    setSelectArea({i,boxMark,dir:'start'});
+  }
   componentDidMount(){
     //挂载完成保存有加号的项目数据
     const {saveAddItem,fullData,copyId,showAdd} = this.props;
@@ -251,18 +261,20 @@ class MultSpread extends Component{
     }
   }
   getContClass(){
-    const {isImports,ikey,saveText,isExtBlue} = this.props;
+    const {isImports,ikey,saveText,isExtBlue,mouseSelect} = 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,ext);
+    const selectedArea = mouseSelect?style['selected-area']:'';
+    return classNames(orgBorder,ext,selectedArea);
   }
   render(){
     const {showAdd,addLabelItem,ikey,copyId,textPrefix,textSuffix,isExtBlue} = this.props;
     return (<div className={this.getContClass()}
-                 style={{display:'inline-block'}}>
+                 style={{display:'inline-block'}}
+                 onMouseUp={this.handleMouseUp.bind(this)}
+                 onMouseDown={this.handleMouseDown.bind(this)}>
         {textPrefix?<span className="prefixUnset">{textPrefix}</span>:''}
         <div className={this.getClass()}>
           {this.getLabels()}

+ 17 - 5
src/components/Multiple/index.jsx

@@ -37,10 +37,11 @@ class Multiple extends react.Component{
   }
 
   getClass(){
-    const {show,value,hideTag,isImports,isExtBlue} = this.props;
+    const {show,value,hideTag,isImports,isExtBlue,mouseSelect} = this.props;
     const orgBorder = isImports&&!value?style['orange-border']:'';
     const ext = isExtBlue?style['ext']:'';
     const editBorder = this.state.editable?style['blue-border']:'';
+    const selectedArea = mouseSelect?style['selected-area']:'';
     if(show){
       $(this.$div.current).addClass(style['borderd']);
     }else{
@@ -48,14 +49,14 @@ class Multiple extends react.Component{
     }
     if(value){
       if(hideTag){
-          return classNames(style['hide-tag'],orgBorder,setFontColorSize(isExtBlue?2:''))
+          return classNames(style['hide-tag'],orgBorder,setFontColorSize(isExtBlue?2:''),selectedArea)
         }
-      return classNames(style['selected-tag'],orgBorder,editBorder,setFontColorSize());
+      return classNames(style['selected-tag'],orgBorder,editBorder,setFontColorSize(),selectedArea);
     }else{
       if(hideTag){
         return isExtBlue?classNames(setFontColorSize(2)):classNames(setFontColorSize(2),'prefixUnsetColor')
       }
-      return classNames(style['tag'],orgBorder,ext,setFontColorSize(1));
+      return classNames(style['tag'],orgBorder,ext,setFontColorSize(1),selectedArea);
     }
     // if(value){
       //   return hideTag?classNames(style['hide-tag'],orgBorder,setFontColorSize(isExtBlue?2:'')):classNames(style['selected-tag'],orgBorder,editBorder,setFontColorSize());
@@ -160,7 +161,16 @@ class Multiple extends react.Component{
     handleConfirm&&handleConfirm(params);
     handleHide&&handleHide();
   }
-
+  handleMouseUp(){
+    const {select_start,i,setSelectArea,boxMark}= this.props;
+    if(select_start!==undefined){
+      setSelectArea({i,boxMark,dir:'end'});
+    }
+  }
+  handleMouseDown(){
+    const {i,setSelectArea,boxMark}= this.props;
+    setSelectArea({i,boxMark,dir:'start'});
+  }
   componentDidMount(){
     if(isIE()){
       $(this.$div.current).onIe8Input(function(e){
@@ -179,6 +189,8 @@ class Multiple extends react.Component{
       onBlur={this.handleBlur}
       onInput={this.onChange}
       onKeyDown={handleEnter}
+      onMouseUp={this.handleMouseUp.bind(this)}
+      onMouseDown={this.handleMouseDown.bind(this)}
       contentEditable={editable}>{value||placeholder}</div>
       <div className={this.getListClass()} contentEditable="false">
         <SlideItem

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

@@ -8,6 +8,9 @@
   line-height: 20px;
   &.ext{
     color: @extBlue!important;
+    &.selected-area{
+      color: #fff!important;
+    }
   }
 }
 

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

@@ -198,24 +198,36 @@ class NumberDrop extends Component{
     handleHide&&handleHide();
   }
   getClasses(nospecial){         //整个标签是否有值的状态
-    const {hideTag,placeholder,isImports,isExtBlue,isSelectAll} = this.props;
+    const {hideTag,placeholder,isImports,isExtBlue,isSelectAll,mouseSelect} = 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,ext,setFontColorSize(val||isSelectAll?'2,6':isExtBlue?2:1));
+    const selectedArea = mouseSelect?style['selected-area']:'';
+    return className(isSelected,noTag,orgBorder,ext,setFontColorSize(val||isSelectAll?'2,6':isExtBlue?2:1),selectedArea);
   }
   getSpanClass(nospecial){       //将被替换的文字选中状态显示
-    const {isSelectAll,isExtBlue,show} = this.props;
+    const {isSelectAll,isExtBlue,show,mouseSelect} = this.props;
     const val = this.state.value;
+    const selectedArea = mouseSelect?style['selected-area']:'';
     const cls = this.props.show?style['blued']:style['nol'];
     // return cls+' '+setFontColorSize(nospecial?'':2);
-    return className(show?style['blued']:(style['nol'],setFontColorSize(val?'2,6':isSelectAll?'2,6':isExtBlue?2:1)))
+    return className(show?style['blued']:(style['nol'],setFontColorSize(val?'2,6':isSelectAll?'2,6':isExtBlue?2:1)),selectedArea)
   }
   stopBubble(e){
     e.stopPropagation();
   }
+  handleMouseUp(){
+    const {select_start,i,setSelectArea,boxMark}= this.props;
+    if(select_start!==undefined){
+      setSelectArea({i,boxMark,dir:'end'});
+    }
+  }
+  handleMouseDown(){
+    const {i,setSelectArea,boxMark}= this.props;
+    setSelectArea({i,boxMark,dir:'start'});
+  }
   componentDidMount(){
     //设置最小宽度避免输入后宽度跳动
     const spanWidth = window.getComputedStyle(this.$span.current).width;
@@ -252,7 +264,9 @@ class NumberDrop extends Component{
     const {placeholder,hasSelect} = this.state;
     return <div className={this.getClasses(nospecial)}
                 style={{position:'relative'}}
-                onClick={allClick?this.handleNumClick:null}>
+                onClick={allClick?this.handleNumClick:null}
+                onMouseUp={this.handleMouseUp.bind(this)}
+                onMouseDown={this.handleMouseDown.bind(this)}>
       <span className={`${setFontColorSize(val?'':isSelectAll?2:isExtBlue?2:1)} prefixUnset`}>{prefix}</span>
       <span onFocus={this.handleNumFocus}
             onClick={allClick?null:this.handleNumClick}

+ 7 - 0
src/components/NumberDrop/index.less

@@ -4,6 +4,13 @@
   &.ext{
     color: @extBlue;
   }
+  &.selected-area{
+    background: #338fff;
+    color: #fff!important;
+    span{
+      color: #fff!important;
+    }
+  }
   line-height: 22px;
   .blued{
     background: @blue;

+ 17 - 4
src/components/NumberUnitDrop/index.jsx

@@ -68,25 +68,36 @@ class NumberUnitDrop extends Component{
     handleHide&&handleHide();
   }
 
+  handleMouseUp(){
+    const {select_start,i,setSelectArea,boxMark}= this.props;
+    if(select_start!==undefined){
+      setSelectArea({i,boxMark,dir:'end'});
+    }
+  }
+  handleMouseDown(){
+    const {i,setSelectArea,boxMark}= this.props;
+    setSelectArea({i,boxMark,dir:'start'});
+  }
   getClasses(){         //整个标签是否有值的状态
-    const {value,hideTag,show,isImports,isExtBlue} = this.props;
+    const {value,hideTag,show,isImports,isExtBlue,mouseSelect} = this.props;
     const inpValue = this.state.value;
     const blueBorder = this.state.editable?style['blue-border']:'';
     const isSelected = value||inpValue?style['selected']:style['container'];
     const orgBorder = isImports&&!(value||inpValue)?style['orange-border']:'';
     const noTag = hideTag?style['no-tag']:'';
+    const selectedArea = mouseSelect?style['selected-area']:'';
     if(show){
       $(this.$cont.current).addClass(style['borderd']);
     }else{
       $(this.$cont.current).removeClass(style['borderd']);
     }
     if(value){
-      return className(isSelected,noTag,blueBorder,orgBorder,setFontColorSize(isExtBlue?2:''));
+      return className(isSelected,noTag,blueBorder,orgBorder,setFontColorSize(isExtBlue?2:''),selectedArea);
     }else{
       if(isExtBlue){
-        return classNames(isSelected,noTag,blueBorder,orgBorder, setFontColorSize(2),'prefixUnsetColor');
+        return classNames(isSelected,noTag,blueBorder,orgBorder, setFontColorSize(2),'prefixUnsetColor',selectedArea);
       }else{
-        return className(isSelected,noTag,blueBorder,orgBorder,setFontColorSize(1));
+        return className(isSelected,noTag,blueBorder,orgBorder,setFontColorSize(1),selectedArea);
       }
     }
   }
@@ -96,6 +107,8 @@ class NumberUnitDrop extends Component{
     const {editable,hasSelect} = this.state;
     return <div className={this.getClasses()}
                 ref={this.$cont}
+                onMouseUp={this.handleMouseUp.bind(this)}
+                onMouseDown={this.handleMouseDown.bind(this)}
                 onClick={this.handleNumClick}>
       <span ref = {this.$pre} className="prefixUnset">{prefix?prefix+' ':prefix}</span>
       <span ref = {this.$span}

BIN
src/components/Operation/Search/imgs/clear.png


BIN
src/components/Operation/Search/imgs/search.png


+ 107 - 0
src/components/Operation/Search/index.jsx

@@ -0,0 +1,107 @@
+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 $ from 'jquery';
+/**
+ * 前提条件父元素有定位
+ * visible  搜索显示隐藏
+ * handleChangeValue  函数参数为输入框的value值
+ */
+class SearchList extends React.Component {
+    constructor(props) {
+        super(props);
+        this.state = {
+            val:'',
+            border:'',
+            show:false,
+            timer:null
+        }
+        this.textInput = React.createRef();
+        this.handleClearVal = this.handleClearVal.bind(this);
+        this.handleFocus = this.handleFocus.bind(this);
+        this.handleBlur = this.handleBlur.bind(this);
+    }
+    componentDidMount(){
+      this.props.handleChangeValue('');
+    //   this.textInput.current.focus();
+      const {windowHeight,pageTop,height,refreshScroller} = this.props;
+    }
+    handleClearVal(){
+        const { handleChangeValue } = this.props;
+        this.textInput.current.value = '';
+        this.textInput.current.focus();
+        this.setState({
+            val:'',
+            show:false
+        });
+        handleChangeValue('');
+    }
+    handleInput(e){
+      const { handleChangeValue,handleChangeIpt } = this.props;
+        clearTimeout(this.state.timer);
+        let timer = setTimeout(()=>{
+            clearTimeout(this.state.timer);
+            if(e.target.value.trim() == ''){
+                this.setState({
+                    show:false
+                })
+                return  handleChangeValue('');
+            }
+            this.setState({
+                val:e.target.value,
+                show:true
+            })
+            handleChangeValue(e.target.value);
+            handleChangeIpt(e.target.value);
+        },config.delayTime);
+        this.setState({
+            timer
+        });
+    }
+    handleFocus(){
+      if(this.state.val.trim() != ''){
+        return;
+      }else{
+          this.setState({border:true})
+      }
+    }
+    handleBlur(){
+      this.setState({border:false,val:''})
+    }
+    componentWillReceiveProps(next){
+        console.log(next.value)
+        if(next.value&&(next.value != this.props.value)){
+            this.textInput.current.value = next.value;
+        }
+    }
+    render() {
+        const { children,visible } = this.props;
+        const { show } = this.state;
+        return (
+            <div id="searchOption" className={styles.search}>
+                <img style={{display:show?'block':'none'}} className={styles.clearVal} src={clear} onClick={this.handleClearVal} alt="清空" />
+                <input
+                    className={this.state.border ?`${styles.border}`:`${styles.borderNone}`}
+                    type="text"
+                    maxLength="30"
+                    ref={this.textInput}
+                    onFocus={this.handleFocus}
+                    onBlur={this.handleBlur}
+                    onInput={(e) => { 
+                        this.handleInput(e)
+                    }}
+                    onPropertyChange={(e) => {  // 兼容ie
+                        this.handleInput(e)
+                    }}
+                    placeholder="搜索"
+                />
+                <div className={styles.autoList}>
+                    {children}
+                </div>
+            </div>
+        )
+    }
+}
+export default SearchList;

+ 38 - 0
src/components/Operation/Search/index.less

@@ -0,0 +1,38 @@
+@import "~@less/variables.less";
+
+.search {
+    .contentZIndex1;
+    width: 240px;
+    box-sizing: border-box;
+    position: relative;
+    background-color: #fff;
+    display: inline-block !important;
+    margin-right: 20px;
+
+    input {
+        width: 100%;
+        height: 30px;
+        line-height: 30px;
+        padding: 0 30px 0 10px;
+        box-sizing: border-box;
+        border: 1px solid #ccc;
+    }
+    .border {
+        // border: 1px solid @blue;
+    }
+    .borderNone {
+        border: 1px solid #ccc;
+    }
+    img {
+        position: absolute;
+        top: 5px;
+    }
+    .clearVal{
+        cursor: pointer;
+        right: 5px;
+    }
+}
+
+.hide {
+    display: none;
+}

+ 82 - 34
src/components/Operation/index.jsx

@@ -7,9 +7,11 @@ import cancelTag from '@common/images/icon_back.png';
 import PrintPreviewContainer from '@containers/PrintPreviewContainer';
 import PreviewContainer from '@containers/PreviewContainer';
 import { ConfirmModal, Notify } from '@commonComp';
+import Search from './Search';
 import check_circle from './img/check-circle.png';
 import check_right from './img/check-right.png';
 import {getAllDataList,getAllDataStringList,isAllPartClear,isAllClear,filterDataArr,readyKeepHistory} from '@utils/tools';
+
 import {dragBox} from '@utils/drag';
 import store from '@store';
 import $ from 'jquery';
@@ -28,6 +30,8 @@ class Operation extends Component {
       zIndex:40,
       sex:'3',
       le:'',
+      deptId:'',//科室id
+      value:''
     }
     this.showPrint = this.showPrint.bind(this);
     this.closePrint = this.closePrint.bind(this);
@@ -37,6 +41,8 @@ class Operation extends Component {
     this.clearAll = this.clearAll.bind(this);
     this.saveHis = this.saveHis.bind(this);
     this.keypress = this.keypress.bind(this);
+    this.setDeptId = this.setDeptId.bind(this);
+    this.handleChangeIpt = this.handleChangeIpt.bind(this);
   }
 
   showPrint() {
@@ -87,7 +93,6 @@ class Operation extends Component {
         oKBg: '#3B9ED0',
         msg: <p className={style['msg']}>是否保存该病历?</p>
       })
-      
       this.props.diagShowTmp(true)
     }
   }
@@ -151,8 +156,8 @@ class Operation extends Component {
     let jsonData = getAllDataList(baseList);
     let jsonStr = getAllDataStringList(baseList);
     let whichSign = baseList.typeConfig.mode;
-    let tmpLis = baseList.tabTemplate.items;
-    let flg = isAllClear(jsonStr)
+    let tmpLis = [];
+    let flg = isAllClear(jsonStr);
     if(!flg){
       Notify.info('模板数据不能为空')
       return false
@@ -160,6 +165,11 @@ class Operation extends Component {
     // console.log(jsonStr.chief,'文本')
     // console.log(jsonData,'结构')       //测试需要用到,不要删了
     // console.log(tmpLis,'接口返回的')
+    if(this.props.admin){
+      tmpLis = baseList.tabTemplate.adminItems;
+    }else{
+      tmpLis = baseList.tabTemplate.items;
+    }
     for(let i = 0;i <tmpLis.length;i++){
       let dataStr = tmpLis[i].preview;
       if(
@@ -180,24 +190,31 @@ class Operation extends Component {
   }
   changeTitle() {
     return <div className={style['box']}>
-      <input className={style['ipt']}
-        placeholder="请输入模板名称"
-        type="text"
-        maxLength='30'
-        onInput={(e) => {
-          this.handleInput(e)
-        }}
-        onPropertyChange={(e) => {  // 兼容ie
-          this.handleInput(e)
-        }}
-        onKeyPress={e => this.keypress(e)}
-      />
-      <div className={style['line']}></div>
+      {/* <div className={style.titleTip}></div> */}
       <div className={style['iptWrap']}>
-        <p>请选择模板性别归属(错误引用,显示可能有误)</p>
-        <span className={style['commonSex']} id="commonSex" onClick={this.changeRadio.bind(this,1)}><img src={check_right} alt=""/><i style={{color:'#000'}}>通用</i></span>
-        <span id="maleSex" onClick={this.changeRadio.bind(this,2)}><img src={check_circle} alt=""/><i>男</i></span>
-        <span id="femaleSex" onClick={this.changeRadio.bind(this,3)}><img src={check_circle} alt=""/><i>女</i></span>
+        <div className={style.name}>
+          <span>模版名称:</span>
+          <input className={style['ipt']}
+            placeholder="请输入模板名称"
+            type="text"
+            maxLength='30'
+            onInput={(e) => {
+              this.handleInput(e)
+            }}
+            onPropertyChange={(e) => {  // 兼容ie
+              this.handleInput(e)
+            }}
+            onKeyPress={e => this.keypress(e)}
+          />
+        </div>
+        <div className={style.male}>
+          <span>性别归属:</span>
+          <span className={style['commonSex']} id="commonSex" onClick={this.changeRadio.bind(this,1)}><img src={check_right} alt=""/><i style={{color:'#000'}}>通用</i></span>
+          <span id="maleSex" onClick={this.changeRadio.bind(this,2)}><img src={check_circle} alt=""/><i>男</i></span>
+          <span id="femaleSex" onClick={this.changeRadio.bind(this,3)}><img src={check_circle} alt=""/><i>女</i></span>
+          <span style={{paddingRight:0,color:'#777777'}}>(注:错误引用,显示可能有误)</span>
+        </div>
+        {/* <p>请选择模板性别归属(错误引用,显示可能有误)</p> */}
       </div>
     </div>
   }
@@ -229,8 +246,8 @@ class Operation extends Component {
     }
   }
   makeSure() {
-    const { save, clear, saveDataAll,diagShowTmp ,chronicMagItem,chronicDesease} = this.props;
-    const { type } = this.state;
+    const { save, clear, saveDataAll,saveDataAlls,diagShowTmp ,chronicMagItem,chronicDesease,admin} = this.props;
+    const { type,deptId,sex,title } = this.state;
     if (type == 1) {
       diagShowTmp(false)
       this.setState({ title: '' })
@@ -250,8 +267,15 @@ class Operation extends Component {
       if (this.state.title.trim() == '') {
         Notify.error('请输入模板名称')
         return;
+      }else if(admin&&deptId == ''){
+        Notify.error('请选择科室')
+        return;
+      }
+      if(admin){
+        saveDataAlls(title,sex,deptId);
+      }else{
+        saveDataAll(title,sex);
       }
-      saveDataAll(this.state.title,this.state.sex);
     }
   }
   closeDiagBox(){
@@ -265,15 +289,16 @@ class Operation extends Component {
       this.setState({ title: '' }) 
     }
   }
+  setDeptId(id,name){
+    this.props.handleClearValue()
+    this.setState({
+      deptId :id,
+      value:name
+    })
+  }
   componentWillReceiveProps(next){//监听滚动事件
     const that = this;
     if(next.winWidth <= 1024){
-      /*$(document).on('scroll',function(){
-        let left = -($(document).scrollLeft() - 10) + 'px';
-        that.setState({
-          le:left
-        })
-      })*/
       $(window).scroll(function(){
         let scrollLeft = document.body.scrollLeft || document.documentElement.scrollLeft;
         let left = -(scrollLeft - 10) +'px';
@@ -283,12 +308,16 @@ class Operation extends Component {
       })
     }
   }
-
+  handleChangeIpt(val){
+    this.setState({
+      value:val
+    })
+  }
   render() {
-    const { showPrint, closePrint, showPreview, closePreview } = this;
+    const { showPrint, closePrint, showPreview, closePreview,handleChangeIpt } = this;
     const { visible, preVisible,diagShow } = this.props.print;
-    const {winWidth,cancelDelTag} = this.props;
-    const {zIndex,type,le} = this.state;
+    const {winWidth,cancelDelTag,departLis,handleChangeValue,admin} = this.props;
+    const {zIndex,type,le,value} = this.state;
     return <div className={style['container']} style={{left:le}}>
       <span className={style['button']} onClick={showPrint}><img src={printImg} /> 打印病历</span>
       <span className={style['preButton']} onClick={showPreview}><img src={preview} /> 预览</span>
@@ -306,12 +335,31 @@ class Operation extends Component {
         cancel={() => {this.closeDiagBox()}}
         okText={this.state.okText}
         height={type==3?228:200}
-        width={type==3?400:300}
+        width={type==3?545:300}
         okBorderColor={this.state.borderColor}
         okColor={this.state.okColor}
         oKBg={this.state.oKBg}
+        borderBtm={type==3?'1px solid #f5f5f5':null}
+        title={type==3?'保存病历模板':null}
       >
         {this.state.msg}
+        {
+          admin&&type==3?<div className={style.department}>
+              <span>科室归属:</span>
+              <Search handleChangeValue={handleChangeValue} handleChangeIpt={handleChangeIpt} value={value} visible={true}>
+                <ul className={style.departLis}>
+                  {
+                    departLis.map((item,idx)=>{
+                      return <li onClick={()=>this.setDeptId(item.id,item.conceptDeptName)}>
+                        {item.conceptDeptName}
+                      </li>
+                    })
+                  }
+                </ul>
+              </Search>
+              <span style={{paddingRight:0,color:'#777777'}}>(支持汉字关键字搜索)</span>
+          </div>:null
+        }
       </ConfirmModal>
     </div>;
   }

+ 57 - 17
src/components/Operation/index.less

@@ -117,10 +117,18 @@
     }
 }
 .iptWrap {
-  width: 320px;
+   padding: 0 15px;
   line-height: 18px;
-  margin: 10px auto;
-  text-align: center;
+  margin: 18px auto;
+  text-align: left;
+  .name {
+      text-align: left;
+      input {
+          border: 1px solid #CCCCCC;
+          padding: 5px 10px;
+          width: 240px;
+      }
+  }
   p {
     text-align: left;
     font-size: 12px;
@@ -130,7 +138,7 @@
   span {
     display: inline-block;
     cursor: pointer;
-    padding-right: 24px;
+    padding-right: 20px;
     font-size: 14px;
     i {
       color: #6b6969;
@@ -149,23 +157,55 @@
     padding-bottom: 50px;
 }
 .box {
-    padding-top: 10px;
     box-sizing: border-box;
-    height: 110px;
+    height: 88px;
 }
-.ipt {
-    font-size: 16px;
-    width: 320px;
-    height: 20px;
-    line-height: 18px;
-    display: block;
-    margin: 0 auto;
+
+.department {
+    position: relative;
     text-align: left;
+    padding: 0 0 30px 16px;
+    span {
+        padding-right: 20px;
+    }
+}
+.male {
+    padding: 15px 0;
 }
 .line {
-    width: 332px;
     height: 1px;
-    margin: 8px auto 0 auto;
-    background: #D8D8D8;
+    background-color: #979797;
+    position: relative;
+    top: -2px;
 }
-
+.titleTip {
+    position: absolute;
+    top:15px;
+    left: 20px;
+}
+.departLis {
+    position: absolute;
+    top: 29px;
+    left: 0;
+    max-height: 200px;
+    overflow: auto;
+    background-color: #fff;
+    width: 240px;
+    // box-shadow: 0 10px 20px 0 #989DA3;
+    border: 1px solid #dedede;
+    li {
+        height: 36px;
+        line-height: 36px;
+        padding: 0 30px;
+        padding-top: 0;
+        box-sizing: border-box;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+        border: 1px solid transparent;
+        cursor: pointer;
+    }
+    li:hover {
+        border: 1px solid #3B9ED0;
+    }
+}

+ 58 - 19
src/components/PushContainer/index.jsx

@@ -1,8 +1,8 @@
 import React, { Component } from 'react';
 import style from './index.less';
 import { Tab, ConfirmModal, Notify } from '@commonComp';
-import { tabChange, allChecked, changeVisible, keepPushData, allCheckedShow } from '@store/actions/tabTemplate';
-import { initItemList, delItem, delBatchItem, changeTitleAsync, setPageView } from '@store/async-actions/tabTemplate';
+import { tabChange, allChecked, changeVisible, keepPushData, allCheckedShow,allCheckedAdmin,allCheckedShowAdmin } from '@store/actions/tabTemplate';
+import { initItemList, delItem,delItemAdmin, delBatchItem, delBatchItemAdmin,changeTitleAsync, setPageView,changeTitleAsyncAdmin,setPageViewAdmin } from '@store/async-actions/tabTemplate';
 import { connect } from "react-redux";
 import store from '@store';
 import { billing } from '@store/async-actions/pushMessage';
@@ -51,7 +51,9 @@ class PushContainer extends Component {
     this.handleTemplateDel = this.handleTemplateDel.bind(this)
     this.handleTitleChange = this.handleTitleChange.bind(this)
     this.handleAllCheckbox = this.handleAllCheckbox.bind(this)
+    this.handleAllCheckboxAdmin = this.handleAllCheckboxAdmin.bind(this)
     this.handleMangerTemplate = this.handleMangerTemplate.bind(this)
+    this.handleMangerTemplateAdmin = this.handleMangerTemplateAdmin.bind(this)
     this.handleDelList = this.handleDelList.bind(this)
     this.makeSure = this.makeSure.bind(this)
     this.handleClose = this.handleClose.bind(this);
@@ -178,6 +180,22 @@ class PushContainer extends Component {
     })
   }
 
+  handleAllCheckboxAdmin() {        //全.反选
+    let tmpFlg = this.props.allCheckedAdmin;
+    if (this.props.checkItemsAdmin.length < this.props.adminItems.length && this.props.allCheckedAdmin) {
+      tmpFlg = false;
+    } else if (this.props.checkItemsAdmin.length == this.props.adminItems.length && !this.props.allCheckedAdmin) {
+      tmpFlg = true;
+    }  //两种特殊情况处理
+    store.dispatch(allCheckedAdmin(!tmpFlg))
+  }
+
+  handleMangerTemplateAdmin() {      //管理
+    let tmpFlg = this.props.allCheckShowAdmin;
+    store.dispatch(allCheckedAdmin(false))
+    store.dispatch(allCheckedShowAdmin(!tmpFlg))
+  }
+
   handleAllCheckbox() {        //全.反选
     let tmpFlg = this.props.allChecked;
     if (this.props.checkItems.length < this.props.items.length && this.props.allChecked) {
@@ -211,10 +229,18 @@ class PushContainer extends Component {
   
   makeSure() {
     if (this.state.type == 1) {
-      store.dispatch(delItem(this.state.id))
+      if(this.props.admin){
+        store.dispatch(delItemAdmin(this.state.id))
+      }else{
+        store.dispatch(delItem(this.state.id))
+      }
       store.dispatch(changeVisible(false))
     } else if (this.state.type == 2) {
-      store.dispatch(delBatchItem(this.props.checkItems))
+      if(this.props.admin){
+        store.dispatch(delBatchItemAdmin(this.props.checkItemsAdmin))
+      }else{
+        store.dispatch(delBatchItem(this.props.checkItems))
+      }
       store.dispatch(changeVisible(false))
     } else if (this.state.type == 3) {
       if (this.state.title == this.state.text) {
@@ -222,24 +248,25 @@ class PushContainer extends Component {
         Notify.success('标题修改成功');
         return;
       }
+      if ((this.state.title).trim() == '') {
+        Notify.info('请输入模板名称');
+        return;
+      }
       let tempObj = {
         id: this.state.currId,
         title: this.state.title
       }
-      store.dispatch(changeTitleAsync(tempObj))
+      if(this.props.admin){
+        store.dispatch(changeTitleAsyncAdmin(tempObj))
+      }else{
+        store.dispatch(changeTitleAsync(tempObj))
+      }
     } else if (this.state.type == 4) {        //模板引入
-      const { items } = this.props;
-      store.dispatch(setPageView(this.state.id))
-      // items && items.map((part) => {
-      //   if (this.state.id == part.id) {
-      //     let typeConfig = part.type;
-      //     // store.dispatch(keepPushData(part, 'part'))//引用数据的存储,用于保存模板是判断数据是否变化
-      //     // pushAllDataList(typeConfig, 'push', part, 'template')//引用
-      //     // if (didPushParamChange()) {
-      //       // store.dispatch(billing())
-      //     // }
-      //   }
-      // })
+      if(this.props.admin){
+        store.dispatch(setPageViewAdmin(this.state.id))
+      }else{
+        store.dispatch(setPageView(this.state.id))
+      }
       store.dispatch(changeVisible(false))
     }
   }
@@ -247,7 +274,7 @@ class PushContainer extends Component {
     store.dispatch(changeVisible(false));
   }
   render() {
-    const { activeId, checkItems, visible, showMsg,hasMore,current, items, allCheckShow } = this.props;
+    const { activeId, checkItems, visible, showMsg,hasMore,current, items, allCheckShow,allCheckShowAdmin,adminItems,admin,checkItemsAdmin } = this.props;
     return <div className={style["container"]} ref={this.$cont} >
       <Tab tabs={this.state.tabs}
         activeId={activeId}
@@ -258,10 +285,16 @@ class PushContainer extends Component {
           <CaseQuailty></CaseQuailty>
           <TemplateItems
             items={items}
+            adminItems={adminItems}
+            admin={admin}
+            handleAllCheckboxAdmin={this.handleAllCheckboxAdmin}
+            handleMangerTemplateAdmin={this.handleMangerTemplateAdmin}
             current={current}
             hasMore={hasMore}
             checkItems={checkItems}
+            checkItemsAdmin={checkItemsAdmin}
             allCheckShow={allCheckShow}
+            allCheckShowAdmin={allCheckShowAdmin}
             handleContentClick={this.handleContentClick}
             handleTemplateDel={this.handleTemplateDel}
             handleTitleChange={this.handleTitleChange}
@@ -291,9 +324,11 @@ class PushContainer extends Component {
   }
 }
 
-const mapStateToProps = (state) => {
+const mapStateToProps = (state) => {//console.log(state)
   return {
     items: state.tabTemplate.items,
+    adminItems: state.tabTemplate.adminItems,
+    admin: state.homePage.admin,
     current: state.tabTemplate.current,
     hasMore: state.tabTemplate.hasMore,
     activeId: state.tabTemplate.activeId,
@@ -302,6 +337,10 @@ const mapStateToProps = (state) => {
     visible: state.tabTemplate.visible,
     showMsg: state.tabTemplate.showMsg,
     allCheckShow: state.tabTemplate.allCheckShow,
+
+    allCheckedAdmin: state.tabTemplate.allCheckedAdmin,
+    allCheckShowAdmin: state.tabTemplate.allCheckShowAdmin,
+    checkItemsAdmin: state.tabTemplate.checkItemsAdmin,
   }
 }
 

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

@@ -138,7 +138,6 @@ class PushItems extends Component {
   componentDidMount() {
     const height = getWindowInnerHeight() - 190;
     this.$cont.current.style.height = height + "px";
-
     windowEventHandler('resize', ()=>{
       if(this.$cont.current){
         const height = getWindowInnerHeight() - 190;

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

@@ -34,12 +34,13 @@ class RadioDrop extends Component{
     this.handleEditLabel = this.handleEditLabel.bind(this);
   }
   getClass(){
-    const {value,hideTag,show,isImports,isExtBlue,isSelectAll} = this.props;
+    const {value,hideTag,show,isImports,isExtBlue,mouseSelect} = this.props;
     const ext = isExtBlue?style['ext']:'';
     const orgBorder = isImports?style['orange-border']:'';      //橙色框高亮
     const editBorder = this.state.editable?style['blue-border']:'';
+    const selectedArea = mouseSelect?style['selected-area']:'';
     if(show){
-      $(this.$cont.current).addClass(style['borderd']);
+      $(this.$cont.current).addClass(style['borderd'],);
     }else{
       $(this.$cont.current).removeClass(style['borderd']);
     }
@@ -48,14 +49,14 @@ class RadioDrop extends Component{
     // }
     if(value){
       if(hideTag){
-        return classNames(style['no-tag'],ext,setFontColorSize(isExtBlue?2:''));
+        return classNames(style['no-tag'],ext,setFontColorSize(isExtBlue?2:''),selectedArea);
       }
-      return classNames(style['selected-tag'],ext,editBorder,setFontColorSize());
+      return classNames(style['selected-tag'],ext,editBorder,setFontColorSize(),selectedArea);
     }else{
       if(hideTag){
-        return isExtBlue?classNames(setFontColorSize(2)):classNames(setFontColorSize(2),'prefixUnsetColor')
+        return isExtBlue?classNames(setFontColorSize(2)):classNames(setFontColorSize(2),'prefixUnsetColor',)
       }
-      return classNames(style['tag'],orgBorder,ext,setFontColorSize(1));
+      return classNames(style['tag'],orgBorder,ext,setFontColorSize(1),selectedArea);
     }
   }
   handleSelect(item){
@@ -148,6 +149,16 @@ class RadioDrop extends Component{
     })
     handleDbclick&&handleDbclick({id:patId||id});
   }
+  handleMouseUp(){
+    const {select_start,i,setSelectArea,boxMark}= this.props;
+    if(select_start!==undefined){
+      setSelectArea({i,boxMark,dir:'end'});
+    }
+  }
+  handleMouseDown(){
+    const {i,setSelectArea,boxMark}= this.props;
+    setSelectArea({i,boxMark,dir:'start'});
+  }
   render(){
     const {data,placeholder,show,value,hideTag,boxMark} = this.props;
     const {tmpDom} = this.state
@@ -161,6 +172,8 @@ class RadioDrop extends Component{
            onDoubleClick={hideTag?null:this.handledbClick}
            onFocus={(e)=>{e.stopPropagation()}}
            onClick={(e)=>this.handleShow(e,true)}
+           onMouseUp={this.handleMouseUp.bind(this)}
+           onMouseDown={this.handleMouseDown.bind(this)}
            onKeyDown={handleEnter}>
         {value||placeholder}
       </div>

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

@@ -17,6 +17,9 @@
   color:@placeholder-color;
   &.ext{
     color: @extBlue!important;
+    &.selected-area{
+    color: #fff!important;
+  }
   }
 }
 .tag:before{

+ 18 - 5
src/components/RadioInpDrop/index.jsx

@@ -30,9 +30,10 @@ class RadioInpDrop extends Component{
     this.handleInnerBlur = this.handleInnerBlur.bind(this);
   }
   getClass(){
-    const {value,hideTag,show,isImports,isExtBlue} = this.props;
+    const {value,hideTag,show,isImports,isExtBlue,mouseSelect} = this.props;
     const orgBorder = isImports&&!value?style['orange-border']:'';    //查体,是否橙色框高亮
     const ext = isExtBlue?style['ext']:'';      //查体,是否是体征
+    const selectedArea = mouseSelect?style['selected-area']:'';
     if(show){
       $(this.$cont.current).addClass(style['borderd']);
     }else{
@@ -40,14 +41,14 @@ class RadioInpDrop extends Component{
     }
     if(value){
       if(hideTag){
-        return classNames(style['no-tag'],ext,setFontColorSize());
+        return classNames(style['no-tag'],ext,setFontColorSize(),selectedArea);
       }
-      return classNames(style['selected-tag'],setFontColorSize());
+      return classNames(style['selected-tag'],setFontColorSize(),selectedArea);
     }else{
       if(hideTag){
-        return classNames(style['no-tag'],ext,setFontColorSize(2));
+        return classNames(style['no-tag'],ext,setFontColorSize(2),selectedArea);
       }
-      return classNames(style['tag'],orgBorder,ext,setFontColorSize(2,6));
+      return classNames(style['tag'],orgBorder,ext,setFontColorSize(2,6),selectedArea);
     }
   }
   handleSelect(item){
@@ -95,6 +96,16 @@ class RadioInpDrop extends Component{
     });
     handleSaveInp({values:vals,ikey,boxMark,mainSaveText});
   }
+  handleMouseUp(){
+    const {select_start,i,setSelectArea,boxMark}= this.props;
+    if(select_start!==undefined){
+      setSelectArea({i,boxMark,dir:'end'});
+    }
+  }
+  handleMouseDown(){
+    const {i,setSelectArea,boxMark}= this.props;
+    setSelectArea({i,boxMark,dir:'start'});
+  }
   parseInputDom(){
     const {mainSaveText,ikey,boxMark} = this.props;
     const {texts} = this.state;
@@ -122,6 +133,8 @@ class RadioInpDrop extends Component{
     return <div className={style['container']} ref = {this.$cont}>
       <div className={this.getClass()}
            onClick={(e)=>this.handleShow(e)}
+           onMouseUp={this.handleMouseUp.bind(this)}
+           onMouseDown={this.handleMouseDown.bind(this)}
            onKeyDown={handleEnter}>
         {vals?this.parseInputDom():<span className='inheritStyle'>{placeholder}</span>}
       </div>

+ 17 - 5
src/components/SpreadDrop/index.jsx

@@ -350,9 +350,10 @@ class SpreadDrop extends Component{
     this.props.handleHide();
   }
   getClass(){
-    const {isImports,show,value,isExtBlue,defaulted} = this.props;
+    const {isImports,show,value,isExtBlue,defaulted,mouseSelect} = this.props;
     const blueBorder = this.state.editable?style['blue-border']:'';
     const orgBorder = isImports&&!value?style['orange-border']:'';
+    const selectedArea = mouseSelect?style['selected-area']:'';
     const ext = isExtBlue?style['ext']:'';
     let showDefaulted = this.ifDefault();
     if(show){
@@ -361,18 +362,28 @@ class SpreadDrop extends Component{
       $(this.$div.current).removeClass(style['borderd']);
     }
     if(value||(showDefaulted&&value===undefined&&defaulted)){
-      return classNames(style['selected-tag'],blueBorder,setFontColorSize());
+      return classNames(style['selected-tag'],blueBorder,setFontColorSize(),selectedArea);
     }
     if(!value){
-      return classNames(style['tag'],orgBorder,ext,setFontColorSize(2,6));
+      return classNames(style['tag'],orgBorder,ext,setFontColorSize(2,6),selectedArea);
     }
-    return classNames(style['tag'],orgBorder,ext,setFontColorSize(1));
+    return classNames(style['tag'],orgBorder,ext,setFontColorSize(1),selectedArea);
   }
   ifDefault(){
     const {type,otherDefault,curDefault,showVal} = this.props;
     const showDefaulted = ((type=='2'&&curDefault)||(type=='3'&&otherDefault))&&showVal;
     return showDefaulted;
   }
+  handleMouseUp(){
+    const {select_start,i,setSelectArea,boxMark}= this.props;
+    if(select_start!==undefined){
+      setSelectArea({i,boxMark,dir:'end'});
+    }
+  }
+  handleMouseDown(){
+    const {i,setSelectArea,boxMark}= this.props;
+    setSelectArea({i,boxMark,dir:'start'});
+  }
   componentDidMount(){
     if(isIE()){
       $(this.$div.current).onIe8Input(function(e){
@@ -391,7 +402,6 @@ class SpreadDrop extends Component{
     }
     const {editable} = this.state;
     return  <div className={style['container']}
-              /*onFocus={(e)=>e.stopPropagation()}*/
               onBlur={(e)=>e.stopPropagation()}
               onInput={(e)=>e.stopPropagation()}>
         <div
@@ -403,6 +413,8 @@ class SpreadDrop extends Component{
         onBlur={this.handleBlur}
         onInput={this.onChange}
         onkeydown={handleEnter}
+        onMouseUp={this.handleMouseUp.bind(this)}
+        onMouseDown={this.handleMouseDown.bind(this)}
         >{showV||placeholder}</div>
       {showCommonData&&show?<CommonSymptom data={CommonSymptoms} show={true} onSelect={this.handleCommonSelect.bind(this)} isCurrent={true} />:
           <ListItems parDiv={this.$list} defaulted={showDefaulted&&defaulted} pos={pos} data={data} order={order} left={left} boxMark={type} tagType={tagType}

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

@@ -8,5 +8,8 @@
   }
   .ext {
     color: @extBlue !important;
+    &.selected-area{
+      color: #fff!important;
+    }
   }
 }

+ 78 - 22
src/components/TemplateItems/TemplateItem/index.jsx

@@ -11,7 +11,7 @@ import editing_icon from './img/edit_blue.png';
 import check_circle from './img/check-circle.png';
 import check_right from './img/check-right.png';
 import store from '@store'
-import { checkItems } from '@store/actions/tabTemplate';
+import { checkItems,checkItemsAdmin } from '@store/actions/tabTemplate';
 import $ from 'jquery';
 
 class TemplateItem extends React.Component {
@@ -26,6 +26,8 @@ class TemplateItem extends React.Component {
     };
     this.isConfirmClick = false;
     this.handleTitleClick = this.handleTitleClick.bind(this)
+    this.getStyleFst = this.getStyleFst.bind(this)
+    this.getStyleSec = this.getStyleSec.bind(this)
   }
 
   getArrow() {
@@ -40,15 +42,27 @@ class TemplateItem extends React.Component {
   handleCheckboxClick(e, id) {          //点击复选框
     e.stopPropagation();
     let tempCheck = this.state.checkBox;
-    this.setState({
-      checkBox: !tempCheck
-    })
-    store.dispatch(checkItems(id))
+    let sign = this.props.admin;
+    // this.setState({
+    //   checkBox: !tempCheck
+    // })
+    if(sign){
+      store.dispatch(checkItemsAdmin(id))
+    }else{
+      store.dispatch(checkItems(id))
+    }
   }
 
   getCheckIcon() {
-    let tempCheckItems = this.props.checkItems;
-    if (tempCheckItems.indexOf(this.props.id) != -1) {
+    const {checkItemsAdmin,checkItems,admin,adminflg,id} = this.props
+    if(admin||adminflg){
+      if (checkItemsAdmin.indexOf(id) != -1) {
+        return [check_right, 'title-wrapper-bg']
+      } else {
+        return [check_circle, '']
+      }
+    }
+    if (checkItems.indexOf(id) != -1) {
       return [check_right, 'title-wrapper-bg']
     } else {
       return [check_circle, '']
@@ -147,24 +161,66 @@ class TemplateItem extends React.Component {
       }
     }
   }
-
+  getStyleFst() {
+    const { allCheckShow, id, name, preview, sex,admin,checkItemsAdmin,allCheckShowAdmin,adminflg } = this.props;
+    if(admin) {
+      if(allCheckShowAdmin){
+        return `${style["title-wrapper"]} ${style["clearfix"]} ${style[this.getCheckIcon()[1]]}`
+      }
+      return `${style["title-wrapper"]} ${style["clearfix"]}`
+    }else{
+      if(adminflg){
+        if(allCheckShowAdmin){
+          return `${style["title-wrapper"]} ${style["clearfix"]} ${style[this.getCheckIcon()[1]]}`
+        }
+        return `${style["title-wrapper"]} ${style["clearfix"]}`
+      }
+      if(allCheckShow){
+        return `${style["title-wrapper"]} ${style["clearfix"]} ${style[this.getCheckIcon()[1]]}`
+      }
+      return `${style["title-wrapper"]} ${style["clearfix"]}`
+    }
+  }
+  getStyleSec(){
+    const { allCheckShow, id, name, preview, sex,admin,checkItemsAdmin,allCheckShowAdmin,adminflg } = this.props;
+    if(admin) {
+      if(allCheckShowAdmin){
+        return <div className={style['check-wrap']} onClick={(e) => { this.handleCheckboxClick(e, id) }}>
+        <img className={`${style['fl-element']} ${style['check-box']}`}
+          src={this.getCheckIcon()[0]}
+        /></div>
+      }
+      return null
+    }else{
+      if(adminflg){
+        if(allCheckShowAdmin){
+          return <div className={style['check-wrap']} onClick={(e) => { this.handleCheckboxClick(e, id) }}>
+          <img className={`${style['fl-element']} ${style['check-box']}`}
+            src={this.getCheckIcon()[0]}
+          /></div>
+        }
+        return null
+      }
+      if(allCheckShow){
+        return <div className={style['check-wrap']} onClick={(e) => { this.handleCheckboxClick(e, id) }}>
+        <img className={`${style['fl-element']} ${style['check-box']}`}
+          src={this.getCheckIcon()[0]}
+        /></div>
+      }
+      return null
+    }
+  }
   render() {
-    const { allCheckShow, id, name, preview, sex } = this.props;
+    const { allCheckShow, id, name, preview,conceptDeptName, sex,admin,checkItemsAdmin,allCheckShowAdmin,adminflg } = this.props;
     let previewJson = JSON.parse(preview);
-    let sexStr = sex == 2 ? ' (女)' : sex == 1 ? ' (男)' : ' (通用)';
+    let sexStr = sex == 2 ? ' (女'+(conceptDeptName&&admin?'-'+conceptDeptName:'')+')' : sex == 1 ? ' (男'+(conceptDeptName&&admin?'-'+conceptDeptName:'')+')' : ' (通用'+(conceptDeptName&&admin?'-'+conceptDeptName:'')+')';
     return (
       <div className={style.wrapper}>
-        <div className={
-          allCheckShow ?
-            `${style["title-wrapper"]} ${style["clearfix"]} ${style[this.getCheckIcon()[1]]}` :
-            `${style["title-wrapper"]} ${style["clearfix"]}`}
+        <div className={this.getStyleFst()}
           onClick={this.handleTitleClick}
         >
           {
-            allCheckShow ? <div className={style['check-wrap']} onClick={(e) => { this.handleCheckboxClick(e, id) }}>
-              <img className={`${style['fl-element']} ${style['check-box']}`}
-                src={this.getCheckIcon()[0]}
-              /></div> : null
+            this.getStyleSec()
           }
           <i
             className={style['title']}
@@ -173,22 +229,22 @@ class TemplateItem extends React.Component {
             {name + sexStr}
           </i>
           <img className={style.arrow} src={arrow_icon} />
-          <img title={'删除模板'}
+          {!admin&&adminflg?null:<img title={'删除模板'}
             className={style.del}
             style={{ display: allCheckShow ? 'none' : 'block' }}
             src={this.getDelIcon()}
             onMouseEnter={() => this.handleDelIconMouseEnter()}
             onMouseLeave={() => this.handleDelIconMouseLeave()}
             onClick={(e) => this.handleTemplateDel(e)}
-          />
+          />}
           <span className={style.quote} onClick={(e) => this.handleContentClick(e, sex)}>引用</span>
-          <img title={'修改模板标题'}
+          {!admin&&adminflg?null:<img title={'修改模板标题'}
             className={style.edit}
             src={this.getEditIcon()}
             onMouseEnter={() => this.handleEditIconMouseEnter()}
             onMouseLeave={() => this.handleEditIconMouseLeave()}
             onClick={(e) => this.handleEditIconClick(e, name)}
-          />
+          />}
         </div>
         <div
           ref={(content) => this.content = content}

+ 1 - 1
src/components/TemplateItems/TemplateItem/index.less

@@ -33,7 +33,7 @@
     position: relative;
     height: 45px;
     line-height: 45px;
-    padding: 0 15px;
+    padding: 0 10px;
     cursor: pointer;
     img {
         display: inline-block;

+ 97 - 30
src/components/TemplateItems/index.jsx

@@ -14,9 +14,11 @@ class TemplateItems extends React.Component {
         super(props);
         this.state = {
             msg:'还没有保存模板',
-            val:''
+            val:'',
+            height:''
         }
         this.$cont = React.createRef();
+        this.$conts = React.createRef();
         this.$search = React.createRef();
         this.genItems = this.genItems.bind(this);
         this.templateSearch = this.templateSearch.bind(this);
@@ -26,17 +28,22 @@ class TemplateItems extends React.Component {
     }  
     componentDidMount(){
         const height = getWindowInnerHeight()-195;
-        this.$cont.current.style.height = height+"px";
+        this.setState({
+            height:height
+        })
         windowEventHandler('resize', ()=>{
-            if(this.$cont.current){
+            if(this.$conts.current){
                 const height = getWindowInnerHeight()-195;
-                this.$cont.current.style.height = height+"px";
+                this.setState({
+                    height:height
+                })
             }
         });
     }
-    genItems() {
+    genItems(items,flg) {
         const Items = [];
-        this.props.items.forEach((v,idx) => {
+        const {admin,adminItems,checkItemsAdmin} = this.props;
+        items.forEach((v,idx) => {
             Items.push(
                 <TemplateItem
                     {...v}
@@ -47,13 +54,26 @@ class TemplateItems extends React.Component {
                     handleContentClick={this.props.handleContentClick}
                     handleTemplateDel={this.props.handleTemplateDel}
                     handleTitleChange={this.props.handleTitleChange}
+
+                    admin={this.props.admin}
+                    adminflg={flg}
+                    checkItemsAdmin={checkItemsAdmin}
+                    allCheckShowAdmin={this.props.allCheckShowAdmin}
                 />
             );
         });
         return Items;
     }
     getCheckIcon() {
-        if (this.props.items.length == this.props.checkItems.length && this.props.checkItems.length != 0) {
+        const {admin,checkItems,items,checkItemsAdmin,adminItems} = this.props;
+        if(admin){
+            if (adminItems.length == checkItemsAdmin.length && checkItemsAdmin.length != 0) {
+                return check_right;
+            } else {
+                return check_circle;
+            }
+        }
+        if (items.length == checkItems.length && checkItems.length != 0) {
             return check_right;
         } else {
             return check_circle;
@@ -83,16 +103,10 @@ class TemplateItems extends React.Component {
         const value = (this.$search.current.value).substring(0,30);
         // this.$search.current.value = value
         setTimeout(() => {
-            
             this.setState({
                 val: value
             });
         }, 30);
-        // if (value === '') {
-        //     this.setState({
-        //         val: ''
-        //     });
-        // }
     }
 
     clear(){
@@ -100,25 +114,24 @@ class TemplateItems extends React.Component {
         this.setState({
             val:''
         })
-        
         this.$search.current.focus();
     }
 
     render() {
-        const { allCheckShow, handleMangerTemplate,handleClickGetMore, handleDelList, handleAllCheckbox, items,checkItems,current,hasMore } = this.props;
-        // console.log(allCheckShow,7877877)
+        const { checkItemsAdmin,handleAllCheckboxAdmin,handleMangerTemplateAdmin,allCheckShowAdmin,admin,adminItems,allCheckShow, handleMangerTemplate,handleClickGetMore, handleDelList, handleAllCheckbox, items,checkItems,current,hasMore } = this.props;
+        const {height} = this.state
         return (
-            <div className={style.wrapper}>
-                {
-                    items ? (allCheckShow ?
+            <div className={style.wrapper} >
+                {//管理员操作
+                    adminItems&&admin ? (allCheckShowAdmin ?
                         <div className={style.wrapperTop}>
-                            <div className={style['check-wrap']} onClick={handleAllCheckbox}>
+                            <div className={style['check-wrap']} onClick={handleAllCheckboxAdmin} style={{paddingLeft:'10px'}}>
                                 <img className={`${style['fl-element']} ${style['check-box']}`} src={this.getCheckIcon()} />
                             </div>
-                            <span onClick={handleAllCheckbox}>全选</span>
-                            <span className={`${style['fr-element']} ${style['done']}`} onClick={handleMangerTemplate}>完成</span>
+                            <span onClick={handleAllCheckboxAdmin}>全选</span>
+                            <span className={`${style['fr-element']} ${style['done']}`} onClick={handleMangerTemplateAdmin}>完成</span>
                             {
-                                checkItems.length>0?<span className={`${style['fr-element']} ${style['del-items']}`} onClick={handleDelList}>删除</span>:
+                                checkItemsAdmin.length>0?<span className={`${style['fr-element']} ${style['del-items']}`} onClick={handleDelList}>删除</span>:
                                 <span className={`${style['fr-element']} ${style['del-items-gray']}`}>删除</span>
                             }
                         </div> :
@@ -129,19 +142,73 @@ class TemplateItems extends React.Component {
                                 <div className={style.search} onClick={this.templateSearch}>搜索</div>
                             </div>
                             {
-                                items.length > 0&&<span className={`${style['fr-element']} ${style['manger']}`} onClick={handleMangerTemplate}>管理</span>
+                                adminItems.length > 0&&<span className={`${style['fr-element']} ${style['manger']}`} onClick={handleMangerTemplateAdmin}>管理</span>
+                            }
+                    </div>) : null
+                }
+                {//个人
+                    items&&!admin ? 
+                        <div className={style.wrapperTop}>
+                            <div className={style.templateSearch}>
+                                <input placeholder="模板搜索" maxLength="30" ref={this.$search} type="text" onInput={this.handleChange} onPropertyChange={this.handleChange} onKeyUp={this.handleEnter}/>
+                                {this.state.val?<img src={delIcon} alt="清空" onClick={this.clear}/>:''}
+                                <div className={style.search} onClick={this.templateSearch}>搜索</div>
+                            </div>
+                    </div> : null
+                }
+                {
+                    <div className={style.comAdminWrp}>
+                        <div className={`${style.tempLists} ${style.tempListsP}`} ref={this.$cont} style={{display:admin?'none':'block',border:'1px solid #EAEDF1'}}>
+                            {//个人
+                                allCheckShow&&!admin ?<div className={`${style.wrapperTop} ${style.wrapperTopM} ${style.personalTmp}`}>
+                                    <i></i>
+                                    <i></i>
+                                    <div className={style['check-wrap']} onClick={handleAllCheckbox}>
+                                        <img className={`${style['fl-element']} ${style['check-box']}`} src={this.getCheckIcon()} />
+                                    </div>
+                                    <span onClick={handleAllCheckbox}>全选</span>
+                                    <span className={`${style['fr-element']} ${style['done']}`} onClick={handleMangerTemplate}>完成</span>
+                                    {
+                                        checkItems.length>0?<span className={`${style['fr-element']} ${style['del-items']}`} onClick={handleDelList}>删除</span>:
+                                        <span className={`${style['fr-element']} ${style['del-items-gray']}`}>删除</span>
+                                    }
+                                </div>:null
+                            }
+                            {
+                                !allCheckShow&&<div className={`${style.personalTmp} clearfix`}>
+                                    <span className={style.tip}>个人模板</span>
+                                    <i></i>
+                                    {
+                                        items.length > 0&&<span className={`${style['fr-element']} ${style['manger']}`} onClick={handleMangerTemplate}>管理</span>
+                                    }
+                                </div>
+                            }
+                            {
+                                <div style={{height:height/2-42+'px',overflow:'auto'}}>
+                                    {this.genItems(items).length > 0?this.genItems(items): <Empty message={this.state.msg}></Empty>}
+                                </div>
+                            }
+                        </div>
+                        <div className={style.tempLists} ref={this.$conts} style={{border:admin?'0':'1px solid #EAEDF1'}}>
+                            {
+                                !admin?!allCheckShowAdmin&&<div className={`${style.personalTmp}`}>标准模板</div>:''
+                            }
+                            {
+                                <div style={{height:admin?height+'px':(height-20)/2-42+'px',overflow:'auto'}}>
+                                    {this.genItems(adminItems,true).length > 0?this.genItems(adminItems,true): <Empty message={this.state.msg}></Empty>}
+                                </div>
                             }
-                    </div>) : <div style={{height:'36px'}}></div>
+                        </div>
+                    </div>
                 }
-                <div className={style.tempLists} ref={this.$cont}>
+                {/* <div className={style.tempLists} ref={this.$cont}>
                     {
                         this.genItems().length > 0?this.genItems(): <Empty message={this.state.msg}></Empty>
                     }
-                    {/* {//注释掉的暂时没有分也功能
+                    {//注释掉的暂时没有分也功能
                       hasMore?<p onClick={()=>handleClickGetMore(current)} className={style.loadMore}>点击查看更多</p>:null
-                    } */}
-                    
-                </div>
+                    } 
+                </div> */}
             </div>
         )
     }

+ 38 - 6
src/components/TemplateItems/index.less

@@ -9,8 +9,12 @@
     .tempLists {
         overflow-y: auto;
         background-color: #fff;
+        position: relative;
         // margin-top: 15px;
     }
+    .tempListsP {
+        margin-bottom: 10px;
+    }
     .emptyWrap {
         padding: 0 20px;
         margin-top: 15px;
@@ -25,7 +29,7 @@
     .wrapperTop {
         height: 46px;
         padding: 0 15px;
-        margin-top: 10px;
+        // margin-top: 10px;
         // background-color: #EAEDF1;
         cursor: pointer;
         .check-box {
@@ -38,7 +42,6 @@
         }
         .check-wrap{
             height: 36px;
-            padding-right: 10px;
             float: left;
         }
         span {
@@ -65,6 +68,9 @@
             color: @template-color;
         }
     }
+    .wrapperTopM {
+        padding: 0 10px;
+    }
     .loadMore {
       text-align: center;
       color: #2a9bd5;
@@ -80,7 +86,7 @@
         }
         input {
             box-sizing: border-box;
-            width: 270px;
+            width: 300px;
             display: inline-block;
             line-height: 34px;
             height: 34px;
@@ -94,16 +100,42 @@
             text-align: center;
             background-color: #2A9BD5;
             color: #fff;
-            height: 35px;
-            line-height: 35px;
+            height: 34px;
+            line-height: 34px;
         }
         img {
             position: absolute;
             width: 15px;
-            left: 264px;
+            left: 294px;
             top: 10px;
             cursor: pointer;
         }
     }
+    
+    .comAdminWrp {
+        padding: 0 15px;
+    }
+}
+
+
+.fr-element {
+    // float: right;
+    color: #3B9ED0;
+    display: inline-block;
+    height: 36px;
+    line-height: 36px;
 }
+.personalTmp {
+    width: 100%;
+    height: 40px !important;
+    line-height: 40px !important;
+    background-color: #EDF8FF;
+    padding: 0 10px;
+    box-sizing: border-box;
+    .tip {
 
+    }
+    .manger {
+        float: right;
+    }
+}

+ 15 - 2
src/containers/AssessResult.js

@@ -76,6 +76,18 @@ function mapDispatchToProps(dispatch) {
         data:deepClone(data)
       })
     },
+    // setCalcuInfo(id, calcuVal, calcuResult) {
+    //   dispatch({
+    //     type: SET_CHRONIC_CALCU_RESULT,
+    //     result:calcuResult,
+    //     id:id
+    //   });
+    //   dispatch({
+    //     type:SET_CALCU_VALUES,
+    //     data:deepClone(calcuVal),
+    //     id:id
+    //   })
+    // },
     showScaleFn(item,isPop){
       dispatch({
         type:SHOW_TABLE_LIST,
@@ -101,10 +113,11 @@ function mapDispatchToProps(dispatch) {
         wholeResults: data
       })
     },
-    saveCalcuValue(data){
+    saveCalcuValue(data,id){
       dispatch({
         type:SET_CALCU_VALUES,
-        data
+        data,
+        id
       })
     }
   }

+ 26 - 12
src/containers/ChronicInfo.js

@@ -99,27 +99,41 @@ function mapDispatchToProps(dispatch){
         type: SET_CHRONIC_PUSHS,
         data: data
       });
+     
+    },
+    setCalcuInfo(id, calcuVal, calcuResult) {
       dispatch({
-        type:SET_CALCU_VALUES,
-        data:calcuItem,
-        id
+        type: SET_CHRONIC_CALCU_RESULT,
+        result:calcuResult,
+        id:id
       });
+      dispatch({
+        type:SET_CALCU_VALUES,
+        data:deepClone(calcuVal),
+        id:id
+      })
     },
     // 计算公式计算
-    calcuFormula(param) {
+    calcuFormula(param,data,i, j) {
       getFormulaResult(param).then((res)=>{
         if(+res.data.code==0){
           const result = res.data.data.result;
+          const dataCopy = deepClone(data)
+          dataCopy[i].details[j].content.result = result
           dispatch({
-            type: SET_CHRONIC_CALCU_RESULT,
-            result:deepClone(result),
-            id:param.disId
+            type: SET_CHRONIC_PUSHS,
+            data: dataCopy
           });
-          dispatch({
-            type:SET_CALCU_VALUES,
-            data:param.data.content.details,
-            id:param.disId
-          })
+          // dispatch({
+          //   type: SET_CHRONIC_CALCU_RESULT,
+          //   result:deepClone(result),
+          //   id:param.disId
+          // });
+          // dispatch({
+          //   type:SET_CALCU_VALUES,
+          //   data:param.data.content.details,
+          //   id:param.disId
+          // })
         }else{
           Notify.error(res.data.msg||'计算没有结果返回');
         }

+ 9 - 2
src/containers/EditableSpan.js

@@ -7,14 +7,15 @@ import {SET_CURRENT_SEARCH,CURRENT_CLEAR,SETCURRENTTEXT,CURRENT_FOCUS_INDEX,DEL_
 import {getSearch} from '@store/async-actions/fetchModules';
 import {billing} from '@store/async-actions/pushMessage';
 import {didPushParamChange,storageLocal} from '@utils/tools';
-import {SETTEXTFOCUS,RESET,SETDROPSHOW,ISREAD} from '@types/homePage';
+import {SETTEXTFOCUS,RESET,SETDROPSHOW,ISREAD,SET_SELECTED_AREA} from '@types/homePage';
 import config from '@config/index';
 
 function mapStateToProps(state){//console.log(state)
   return {
     mainSaveText:state.mainSuit.saveText,
     isRead:state.homePage.isRead,
-    data:state.currentIll.data
+    data:state.currentIll.data,
+    select_end:state.homePage.select_end,
   }
 }
 
@@ -292,6 +293,12 @@ function mapDispatchToProps(dispatch,state) {
       dispatch({
         type:MAIN_REMOVE_SPAN
       })
+    },
+    setSelectArea(data){
+      dispatch({
+        type:SET_SELECTED_AREA,
+        data
+      })
     }
   }
 }

+ 8 - 0
src/containers/InlineTag.js

@@ -6,10 +6,12 @@ import {SETCURRENTINPUT,CURRENT_TEXT_LABEL} from '@types/currentIll';
 import {SETCHECKINPUT} from "@types/checkBody";
 import InlineTag from "../common/components/InlineTag";
 import {getLabelIndex} from '@utils/tools.js';
+import {SET_SELECTED_AREA} from '@types/homePage';
 
 function mapStateToProps(state){
   return {
     mainSaveText:state.mainSuit.saveText,
+    select_start:state.homePage.select_start,
   }
 }
 
@@ -36,6 +38,12 @@ function mapDispatchToProps(dispatch,store){
         subIndex:inner
       })
     },
+    setSelectArea(data){
+    dispatch({
+      type:SET_SELECTED_AREA,
+      data
+    })
+  }
   }
 }
 

+ 10 - 2
src/containers/MultSpread.js

@@ -5,10 +5,12 @@ import {OTHERADDLABELITEM} from '@types/otherHistory';
 import {ADDLABELITEM} from '@types/checkBody';
 import {MAINADDLABELITEM} from '@store/types/mainSuit';
 import {CURRENTADDLABELITEM} from '@store/types/currentIll';
-import {HIDE,RESET,CLICKCOUNT,SETADDITEMINIT,ISREAD} from '@store/types/homePage';
+import {HIDE,RESET,CLICKCOUNT,SETADDITEMINIT,ISREAD,SET_SELECTED_AREA} from '@store/types/homePage';
 
 function mapStateToProps(state){
-  return {}
+  return {
+    select_start:state.homePage.select_start,
+  }
 }
 
 const typeObj={
@@ -75,6 +77,12 @@ function mapDispatchToProps(dispatch){
         clickType:'单击',
         num:1
       });
+    },
+    setSelectArea(data){
+      dispatch({
+        type:SET_SELECTED_AREA,
+        data
+      })
     }
   }
 }

+ 8 - 1
src/containers/Multiple.js

@@ -1,7 +1,7 @@
 // import React from "react";
 import {connect} from "react-redux";
 import Multiple from "@components/Multiple";
-import {RESET,SETDROPSHOW,HIDEDROP,CLICKCOUNT} from '@store/types/homePage.js';
+import {RESET,SETDROPSHOW,HIDEDROP,CLICKCOUNT,SET_SELECTED_AREA} from '@store/types/homePage.js';
 import {CURRENT_MUL,CURRENT_TEXT_LABEL} from '@types/currentIll';
 import {MAINSUIT_MUL,CHANGE_LABELVAL} from '@types/mainSuit';
 import {OTHERHIS_MUL,CHANGEOTHERTEXTLABEL} from '@types/otherHistory';
@@ -136,6 +136,7 @@ function handleLabel(dispatch,obj){
 function mapStateToProps(state){
   return{
     mainSaveText:state.mainSuit.saveText,
+    select_start:state.homePage.select_start,
   }
 }
 
@@ -181,6 +182,12 @@ function mapDispatchToProps(dispatch){
           dispatch(billing('',params.ikey.substr(0,1)));
         }
       },500);
+    },
+    setSelectArea(data){
+      dispatch({
+        type:SET_SELECTED_AREA,
+        data
+      })
     }
   }
 }

+ 8 - 1
src/containers/NumberDrop.js

@@ -3,7 +3,7 @@ import {connect} from 'react-redux';
 import NumberDrop from "@components/NumberDrop";
 import {SETNUMBER,CHANGEOTHERTEXTLABEL} from '@types/otherHistory';
 import {SETNUMBER4} from '@types/checkBody';
-import {SETDROPSHOW,CLICKCOUNT,HIDE,RESET,HIDEDROP,ISREAD} from '@types/homePage';
+import {SETDROPSHOW,CLICKCOUNT,HIDE,RESET,HIDEDROP,ISREAD,SET_SELECTED_AREA} from '@types/homePage';
 import {NUMBER_SELECT} from '@store/types/mainSuit';
 import {CURRENT_NUMBER} from '@store/types/currentIll';
 import {billing} from '@store/async-actions/pushMessage';
@@ -14,6 +14,7 @@ import config from '@config/index';
 function mapStateToProps(state){
   return {
     mainSaveText:state.mainSuit.saveText,
+    select_start:state.homePage.select_start,
   }
 }
 //查体数字键盘选中
@@ -102,6 +103,12 @@ function mapDispatchToProps(dispatch,store){
         type: RESET
       });*/
     },
+    setSelectArea(data){
+      dispatch({
+        type:SET_SELECTED_AREA,
+        data
+      })
+    }
   }
 }
 

+ 8 - 1
src/containers/NumberUnitDrop.js

@@ -3,7 +3,7 @@ import {connect} from 'react-redux';
 import NumberUnitDrop from "@components/NumberUnitDrop";
 import {SETNUMBER,CHANGEOTHERTEXTLABEL} from '@types/otherHistory';
 import {SETNUMBER4,CHANGECHECKTEXTLABEL} from '@types/checkBody.js';
-import {SETDROPSHOW,CLICKCOUNT,HIDE,RESET,HIDEDROP,ISREAD} from '@types/homePage.js';
+import {SETDROPSHOW,CLICKCOUNT,HIDE,RESET,HIDEDROP,ISREAD,SET_SELECTED_AREA} from '@types/homePage.js';
 import {NUMBER_SELECT,CHANGE_LABELVAL} from '@store/types/mainSuit.js';
 import {CURRENT_NUMBER,CURRENT_TEXT_LABEL} from '@store/types/currentIll.js';
 import {Notify} from '@commonComp';
@@ -15,6 +15,7 @@ function mapStateToProps(state){
   return {
     mainSaveText:state.mainSuit.saveText,
     mainData:state.mainSuit.data,
+    select_start:state.homePage.select_start,
   }
 }
 //查体数字键盘选中
@@ -195,6 +196,12 @@ function mapDispatchToProps(dispatch,store){
       dispatch({
         type: ISREAD
       });
+    },
+    setSelectArea(data){
+      dispatch({
+        type:SET_SELECTED_AREA,
+        data
+      })
     }
   }
 }

+ 15 - 4
src/containers/OperationContainer.js

@@ -9,7 +9,8 @@ import {
     DIAG_SHOW
 } from "../store/types/print";
 import {saveMessage,clearMessages} from "../store/async-actions/print";
-import {saveTemplateDetail} from '@store/async-actions/tabTemplate';
+import {saveTemplateDetail,getDepartments,saveAdminTemplateDetail } from '@store/async-actions/tabTemplate';
+import {getDptLis} from '@store/actions/tabTemplate';
 import {saveClickNum,getInitModules} from '@store/async-actions/homePage';
 import {getOtherHisRecord} from '@store/async-actions/fetchModules';
 import {RECOVER_TAG_MAIN} from '@store/types/mainSuit';
@@ -27,13 +28,21 @@ function mapStateToProps(state) {
     return ({
         print,
         winWidth:homePage.windowWidth,
+        admin:homePage.admin,
         chronicMagItem: state.diagnosticList.chronicMagItem,//慢病疾病
         chronicDesease:state.mainSuit.chronicDesease,//主诉存的慢病
+        departLis:state.tabTemplate.departLis,
     });
 }
 
 function mapDispatchToProps(dispatch) {
     return {
+        handleClearValue:()=> {
+          dispatch(dispatch(getDptLis([])))
+        },
+        handleChangeValue:(val)=> {
+          val&&dispatch(getDepartments(val))
+        },
         showPrintPreview: () => {
             dispatch({
                 type: SHOW_PRINT_PREVIEW
@@ -66,6 +75,9 @@ function mapDispatchToProps(dispatch) {
                 dispatch(getInitModules);
             }
         },
+        saveDataAlls(val,sex,id){
+          dispatch(saveAdminTemplateDetail(val,sex,id))
+        },
         saveDataAll(val,sex){
           dispatch(saveTemplateDetail(val,sex))
         },
@@ -83,16 +95,15 @@ function mapDispatchToProps(dispatch) {
                '4':RECOVER_TAG_CHECK
             };
             const deledTags = localStorage.getItem('deletedTags')?JSON.parse(localStorage.getItem('deletedTags')):[];
-            const deledSelects = localStorage.getItem('deletedSelects')?JSON.parse(localStorage.getItem('deletedSelects')):[];
             if(deledTags.length===0){
               Notify.info('暂无标签可还原');
               return ;
             }
             const arr = deledTags[0].delIndex.split("-");
+            const item = deledTags[0];
             dispatch({
               type:maps[arr[0]],
-              data:deledTags[0],
-              select:deledSelects[0],
+              data:item.tagType?item:item.tags,
               index:arr[1]
             });
           dispatch({

+ 9 - 2
src/containers/RadioDrop.js

@@ -3,7 +3,7 @@ import {connect} from 'react-redux';
 import RadioDrop from "@components/RadioDrop";
 import {SETRADIO,CLEARSELECTED,CONFIRMSELECTED,CHANGEOTHERTEXTLABEL} from '@types/otherHistory';
 import {SETSELECTED4,CHANGECHECKTEXTLABEL} from '@types/checkBody';
-import {SETDROPSHOW,HIDE,RESET,HIDEDROP,CLICKCOUNT,ISREAD} from '@types/homePage.js';
+import {SETDROPSHOW,HIDE,RESET,HIDEDROP,CLICKCOUNT,ISREAD,SET_SELECTED_AREA} from '@types/homePage.js';
 import {RADIO_SELECT,CHANGE_LABELVAL} from '@store/types/mainSuit.js';
 import {CURRENT_RADIO,CURRENT_TEXT_LABEL} from '@store/types/currentIll.js';
 import {Notify} from '@commonComp';
@@ -16,7 +16,8 @@ function mapStateToProps(state){
   return {
     mainSaveText:state.mainSuit.saveText,
     readDefault:typeConfig.readConfig[1],
-    confDefault:typeConfig.typeConfig[1]
+    confDefault:typeConfig.typeConfig[1],
+    select_start:state.homePage.select_start,
   }
 }
 
@@ -151,6 +152,12 @@ function mapDispatchToProps(dispatch,store){
       dispatch({
         type: RESET
       });
+    },
+    setSelectArea(data){
+      dispatch({
+        type:SET_SELECTED_AREA,
+        data
+      })
     }
   }
 }

+ 8 - 1
src/containers/RadioInpDrop.js

@@ -3,7 +3,7 @@ import {connect} from 'react-redux';
 import RadioInpDrop from "@components/RadioInpDrop";
 import {SETRADIO,CLEARSELECTED,CONFIRMSELECTED,SET_OT_RADIO_INPUT_VAL} from '@types/otherHistory';
 import {SETSELECTED4,SET_CK_RADIO_INPUT_VAL} from '@types/checkBody';
-import {SETDROPSHOW,HIDE,RESET,HIDEDROP,CLICKCOUNT,ISREAD} from '@types/homePage.js';
+import {SETDROPSHOW,HIDE,RESET,HIDEDROP,CLICKCOUNT,ISREAD,SET_SELECTED_AREA} from '@types/homePage.js';
 import {RADIO_SELECT,SET_MS_RADIO_INPUT_VAL} from '@store/types/mainSuit.js';
 import {CURRENT_RADIO,SET_RADIO_INPUT_VALUE} from '@store/types/currentIll.js';
 import {Notify} from '@commonComp';
@@ -14,6 +14,7 @@ import config from '@config/index.js';
 function mapStateToProps(state){
   return {
     mainSaveText:state.mainSuit.saveText,
+    select_start:state.homePage.select_start,
   }
 }
 
@@ -161,6 +162,12 @@ function mapDispatchToProps(dispatch,store){
       dispatch({
         type: RESET
       });
+    },
+    setSelectArea(data){
+      dispatch({
+        type:SET_SELECTED_AREA,
+        data
+      })
     }
   }
 }

+ 8 - 1
src/containers/SpreadDrop.js

@@ -3,7 +3,7 @@ import {connect} from 'react-redux';
 
 import SpreadDrop from '@components/SpreadDrop';
 import {SETSELECTED,CLEARSELECTED,CONFIRMSELECTED,SETOTHERCHECKBOX,CHANGEOTHERTEXTLABEL} from '@types/otherHistory';
-import {RESET,SETDROPSHOW,HIDEDROP,CLICKCOUNT,ISREAD} from '@store/types/homePage.js';
+import {RESET,SETDROPSHOW,HIDEDROP,CLICKCOUNT,ISREAD,SET_SELECTED_AREA} from '@store/types/homePage.js';
 import {getModules as fetchModules} from '@store/async-actions/fetchModules.js';
 import {getCommSymptomPush,getCommSymptoms} from '@store/async-actions/mainSuit.js'
 import {GET_BIGDATAPUSH,MIX_CONFIRM,COMM_CONFIRM,CHANGE_LABELVAL} from '@store/types/mainSuit';
@@ -28,6 +28,7 @@ function mapStateToProps(state) {//console.log(state);
     otherDefault:+curOtherMode===1,
     curDefault:+curMode===1,
     CommonSymptoms:mainSuit.CommonSymptoms,//常见症状
+    select_start:homePage.select_start,
   }
 }
 
@@ -557,6 +558,12 @@ function mapDispatchToProps(dispatch,store){
     },
     handleLabelChange(obj){//标签内输入
       handleLabel(dispatch,obj);
+    },
+    setSelectArea(data){
+      dispatch({
+        type:SET_SELECTED_AREA,
+        data
+      })
     }
   }
 }

+ 34 - 3
src/containers/eleType.js

@@ -9,6 +9,8 @@ import InlineTag from '@containers/InlineTag';
 import NumberUnitDrop from '@containers/NumberUnitDrop';
 import Multiple from '@containers/Multiple';
 
+import store from '@store';
+
 /******
  * 下拉类型分发
  * 先根据tagType分为几个大类填写单
@@ -31,6 +33,8 @@ 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}
+                        mouseSelect={params.mouseSelected}
+                        i={i}
                         isGeneray={+data.selFlag===1}
                         isExtBlue={+data.specFlag===4?true:false}
                         show={showArr&&showArr[showInx]}
@@ -44,6 +48,9 @@ export function singleRadio(params){
       const dataList = data.questionDetailList&&data.questionDetailList.length>0?data.questionDetailList:data.questionMapping;
       return <Multiple data={dataList}
                      ikey={showInx}
+                     mouseSelect={params.mouseSelected}
+                     i={i}
+                     boxMark={boxMark}
                      placeholder={data.name}
                      value={data.value}
                      copyType={data.copyType}
@@ -57,11 +64,13 @@ export function singleRadio(params){
                      textSuffix={data.labelSuffix}
                      id={data.id}></Multiple>
     case 3:
-      return <EditableSpan {...params} value={data.value||data.value==''?data.value:data.name} update={Math.random()}/>;
+      return <EditableSpan {...params} mouseSelect={params.mouseSelected} value={data.value||data.value==''?data.value:data.name} update={Math.random()}/>;
     case 5://带单位数字键盘
       return <NumberUnitDrop prefix={data.labelPrefix}
                          suffix={data.labelSuffix}
                          placeholder={data.name}
+                         mouseSelect={params.mouseSelected}
+                         i={i}
                          isExtBlue={data.specFlag===4?true:false}
                          formulaCode={data.formulaCode}
                          boxMark={boxMark}
@@ -75,6 +84,8 @@ export function singleRadio(params){
       return <InlineTag prefix={data.labelPrefix}
                         suffix={data.labelSuffix}
                         boxMark={boxMark}
+                        mouseSelect={params.mouseSelected}
+                        i={i}
                         placeholder={data.name}
                         isExtBlue={data.specFlag===4?true:false}
                         value={data.value}
@@ -89,6 +100,8 @@ export function singleRadio(params){
                          suffix={data.labelSuffix}
                          min={min}
                          max={max}
+                         mouseSelect={params.mouseSelected}
+                         i={i}
                          formulaCode={data.formulaCode}
                          isExtBlue={data.specFlag===4?true:false}
                          placeholder={data.name}
@@ -104,6 +117,8 @@ export function singleRadio(params){
       return <RadioInpDrop data={data.questionDetailList}
                            vals={data.vals}
                         placeholder={data.name}
+                        mouseSelect={params.mouseSelected}
+                        i={i}
                         isExtBlue={data.specFlag===4?true:false}
                         show={showArr&&showArr[showInx]}
                         value = {data.value}
@@ -125,6 +140,8 @@ function multLabels(params){
                      showAdd = {+data.showAdd===1}
                      copyId={data.id}
                      fullData = {data}
+                     mouseSelect={params.mouseSelected}
+                     i={i}
                      isExtBlue={data.specFlag===4?true:false}
                      showArr={showArr||{}}
                      update={Math.random()}
@@ -151,7 +168,10 @@ function multCheckLabels(params,tagType){
   }
   return <SpreadDrop data={data.questionMapping}
                      pos={data.pos}
+                     i={i}
+                     boxMark={boxMark}
                      ikey={showInx}
+                     mouseSelect={params.mouseSelected}
                      defaulted={defaulted}
                      showVal={showVal}
                      setHighter={setHighter}
@@ -170,7 +190,18 @@ function multCheckLabels(params,tagType){
 }
 
 export default function(params){
-  
+  const {homePage} = store.getState();
+  const {select_start,select_end,select_boxMark}=homePage;
+  const {i,boxMark}=params;
+  let start = select_start;
+  let end = select_end;
+  if(start>end){    //从后往前选
+    start = select_end;
+    end = select_start;
+  }
+  const isInArea = start!==undefined&&end!==undefined&&(start<i||start==i)&&(end>i||end==i);
+  params.mouseSelected = select_boxMark===boxMark&&isInArea;
+  //console.log(select_start,select_end,select_boxMark,isInArea,boxMark)
   const data = params.item;
   switch (+data.tagType) {
     case 1:
@@ -194,7 +225,7 @@ export default function(params){
         }
       }
       // 删除后value为空,应展示空而不是name
-      return <EditableSpan {...params} noSearch={data.noSearch} value={data.value||data.value==''?data.value:data.name} full={data.full||isLast}/>;
+      return <EditableSpan {...params} mouseSelect={params.mouseSelected} noSearch={data.noSearch} value={data.value||data.value==''?data.value:data.name} full={data.full||isLast}/>;
     case 11://推送类型
       return multCheckLabels(params,data.tagType);
     default:

+ 58 - 15
src/modules/HomePage/index.jsx

@@ -6,12 +6,12 @@ import BodyContainer from "@components/BodyContainer";
 import {ConfirmModal} from '@commonComp';
 import store from '@store';
 
-import {HIDEDROP,SETMINSCREEN,SETSYSTEMCONFIG,SETPRE,SETREADDITEMS} from '@store/types/homePage.js';
+import {HIDEDROP,SETMINSCREEN,SETSYSTEMCONFIG,SETPRE,SETREADDITEMS,RESET_SELECT_TAG} from '@store/types/homePage.js';
 import {billing} from '@store/async-actions/pushMessage';
-import {CLEAR_SEARCH} from '@types/mainSuit';
-import {CURRENT_CLEAR} from '@types/currentIll';
-import {OTHERHIS_CLEAR} from '@types/otherHistory';
-import {CHECKBODY_CLEAR} from '@types/checkBody';
+import {CLEAR_SEARCH,DELETE_MAIN_SELECTED_TAGS} from '@types/mainSuit';
+import {CURRENT_CLEAR,DELETE_CURRENT_SELECTED_TAGS} from '@types/currentIll';
+import {OTHERHIS_CLEAR,DELETE_OTHER_SELECTED_TAGS} from '@types/otherHistory';
+import {CHECKBODY_CLEAR,DELETE_CHECK_SELECTED_TAGS} from '@types/checkBody';
 import style from './index.less';
 import {getInitModules,getChronic,getSystemConfig} from '@store/async-actions/homePage.js';
 import {getPreMsg} from '@store/async-actions/patInfo.js';
@@ -19,6 +19,7 @@ import {tellPred} from '@store/async-actions/preIcss.js';
 import { getUrlArgObject,parseNameVal,pushAllDataList } from "@utils/tools";
 import $ from 'jquery';
 import loading from '@common/images/loading.gif';
+
 class HomePage extends Component {
     constructor() {
         super();
@@ -56,13 +57,14 @@ class HomePage extends Component {
             } 
         })
     }
-    hidePops(e){
-        const {hideAllDrop,handleClear } = this.props;
-    if(!this.isBar){    //onMousrdown的目标为滚动条时,标签填写单不关闭
-      hideAllDrop();        //隐藏填写单
-      handleClear&&handleClear();       //清空搜索结果
-    }
-
+    hidePops(){
+        const {hideAllDrop,handleClear,resetSelect } = this.props;
+        //重置选中范围
+        resetSelect();
+        if(!this.isBar){    //onMousrdown的目标为滚动条时,标签填写单不关闭
+          hideAllDrop();        //隐藏填写单
+          handleClear&&handleClear();       //清空搜索结果
+        }
     }
   setElem(e){
       //onMousedown的目标为滚动条时,标签填写单不关闭
@@ -71,11 +73,18 @@ class HomePage extends Component {
     }else{
       this.isBar = false;
     }
+  }
+  handleKeyUp(e){
+      const {deleteLabels} = this.props;
+    //删除选中标签
+    if(e.keyCode==8||e.keyCode==46){      //backspace或del都可删除
+      deleteLabels();
+    }
   }
     render() {
         const {flag,showPre,noReferRecord,referRecord} = this.props;
         return <div className={style['home-page']}
-                    onClick={this.hidePops} onmousedown={this.setElem.bind(this)}>
+                    onClick={this.hidePops} onmousedown={this.setElem.bind(this)} onkeyup={this.handleKeyUp.bind(this)}>
             <BannerContainer />
             {/* <InfoTitle /> */}
             <BodyContainer></BodyContainer>
@@ -96,6 +105,12 @@ const mapStateToProps = function (state) {
     showPre:state.homePage.showPre
   }
 };
+const boxMap = {
+  '1':DELETE_MAIN_SELECTED_TAGS,
+  '2':DELETE_CURRENT_SELECTED_TAGS,
+  '3':DELETE_OTHER_SELECTED_TAGS,
+  '4':DELETE_CHECK_SELECTED_TAGS
+};
 const mapDispatchToProps = function (dispatch) {
   return {
     clearAddItems(){
@@ -104,7 +119,9 @@ const mapDispatchToProps = function (dispatch) {
       })
     },
     referRecord(){
-        pushAllDataList(1,'push',store.getState().homePage.preData,'preIcss');
+        const state = store.getState();
+        const {homePage} = state;
+        pushAllDataList(1,'push',homePage.preData,'preIcss');
         dispatch(billing())
         dispatch({type:SETPRE,show:false});
         tellPred()
@@ -146,7 +163,33 @@ const mapDispatchToProps = function (dispatch) {
 
             }
           });
-        }
+        },
+      deleteLabels(){   //选中删除标签
+        const state = store.getState();
+        const {homePage} = state;
+        const start = homePage.select_start;
+        const end = homePage.select_end;
+        const boxMark = homePage.select_boxMark;
+        if(!boxMark)return;
+        dispatch({
+          type:boxMap[boxMark],
+          start,
+          end,
+          boxMark
+        });
+        //删除后清楚选中标记
+        //setTimeout(()=>{
+          dispatch({
+            type:RESET_SELECT_TAG
+          });
+        //})
+
+      },
+      resetSelect(){
+          dispatch({
+            type:RESET_SELECT_TAG
+          })
+      }
     }
 };
 

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

@@ -317,12 +317,19 @@ export function setImportCheckbodyLabel(state,action) {
 export function recoveTag(state,action) {
   let res = Object.assign({},state);
   let arr = [...res.data];
-  arr.splice(action.index,0,action.data);
+  const isArr= !action.data.tagType;
+  if(!isArr){
+    arr.splice(action.index,0,action.data);
+  }else{
+    arr.splice(action.index,0,...action.data);
+  }
   const dataArr = checkFullfillText(arr);
-  let nextLabel = dataArr.newArr[(+action.index)+1];
-  //展开收起状态
-  if(nextLabel.tagType==8){
-    nextLabel.showInCheck=action.data.showInCheck;
+  if(!isArr){
+    let nextLabel = dataArr.newArr[(+action.index)+1];
+    //展开收起状态
+    if(nextLabel.tagType==8){
+      nextLabel.showInCheck=action.data.showInCheck;
+    }
   }
   res.data = dataArr.newArr;
   res.saveText = dataArr.saveText;

+ 25 - 1
src/store/actions/homePage.js

@@ -114,4 +114,28 @@ export const getAssistList = (state,action)=>{
   let res = Object.assign({},state);
   res.assistList = action.data
   return res;
-};
+};
+
+export const setSelectArea = (state,action)=>{
+  let res = Object.assign({},state);
+  const {i,dir,boxMark} = action.data;
+  if(dir==='start'){      //重新开始选取区域,结束位置清空
+    delete res['select_end'];
+  }
+  res['select_'+dir]=i;
+  res.select_boxMark=boxMark;
+  if(res.select_start===res.select_end){      //起点和终点一样,则不选中
+    delete res.select_boxMark;
+    delete res.select_start;
+    delete res.select_end;
+  }
+  return res;
+}
+
+export const resetSelectArea = (state,action)=>{
+  let res = Object.assign({},state);
+  delete res.select_boxMark;
+  delete res.select_start;
+  delete res.select_end;
+  return res;
+}

+ 41 - 1
src/store/actions/tabTemplate.js

@@ -10,12 +10,24 @@ import {
     SHOW_MESSAGE,
     KEEP_PUSH_DATA,
     ALL_CHECKED_SHOW,
+    GET_DPT_LIS,
+    INIT_ADMIN_ITEMS,
+    ALL_CHECKED_ADMIN,
+    ALL_CHECKED_SHOW_ADMIN,
+    CKECK_ITEMS_ADMIN,
+    DEL_ITEMS_ADMIN,
+    BATCH_DEL_ITEMS_ADMIN,
+    CHANGE_TITLE_ADMIN
 } from '@store/types/tabTemplate';
 
 export const delItems = (id) => ({ //删除模板
     type: DEL_ITEMS,
     id
 });
+export const delItemsAdmin = (id) => ({ //删除模板
+    type: DEL_ITEMS_ADMIN,
+    id
+});
 export const tabChange = (idx) => ({ //tab切换
     type: TAB_CHANGE,
     idx
@@ -24,22 +36,42 @@ export const initItems = (state) => ({ //数据初始化
     type: INIT_ITEMS,
     state
 });
+export const initAdminItems = (state) => ({ //数据初始化
+    type: INIT_ADMIN_ITEMS,
+    state
+});
 export const checkItems = (id) => ({ //选中的模板
     type: CKECK_ITEMS,
     id
 });
+export const checkItemsAdmin = (id) => ({ //选中的模板
+    type: CKECK_ITEMS_ADMIN,
+    id
+});
 export const batchDelItems = (ids) => ({ //删除选中的模板
     type: BATCH_DEL_ITEMS,
     ids
 });
+export const batchDelItemsAdmin = (ids) => ({ //删除选中的模板
+    type: BATCH_DEL_ITEMS_ADMIN,
+    ids
+});
 export const allChecked = (bool, flg) => ({ //全选反选
     type: ALL_CHECKED,
     bool
 });
-export const changeTitle = (obj) => ({ //全选反选
+export const allCheckedAdmin = (bool, flg) => ({ //全选反选
+    type: ALL_CHECKED_ADMIN,
+    bool
+});
+export const changeTitle = (obj) => ({ 
     type: CHANGE_TITLE,
     obj
 });
+export const changeTitleAdmin = (obj) => ({ 
+    type: CHANGE_TITLE_ADMIN,
+    obj
+});
 export const changeVisible = (bool) => ({ //弹窗
     type: CHANGE_VISIBLE,
     bool
@@ -56,4 +88,12 @@ export const showMsg = (bool) => ({ //tip提示
 export const allCheckedShow = (bool) => ({ 
     type: ALL_CHECKED_SHOW,
     bool
+});
+export const allCheckedShowAdmin = (bool) => ({ 
+    type: ALL_CHECKED_SHOW_ADMIN,
+    bool
+});
+export const getDptLis = (list) => ({ 
+    type: GET_DPT_LIS,
+    list
 });

+ 0 - 1
src/store/actions/treat.js

@@ -22,7 +22,6 @@ export const clearTreat = (state, action) => {
     res.adversReactionList=[];
     res.hasFollowUp = false;
     res.followUp = '';
-    console.log('res', res)
     return res
 }
 

+ 21 - 2
src/store/async-actions/patInfo.js

@@ -5,7 +5,7 @@ import {getInfos} from '@store/actions/getInfoByUuid';
 import {getUrlArgObject,pushAllDataList,getAllDataList,storageLocal} from '@utils/tools';
 import {getInitModules,getCommonList} from '@store/async-actions/homePage.js';
 import store from '@store'
-import {ISREAD,MODI_LOADING,SETPRE,SETPREDATA} from "../types/homePage";
+import {ISREAD,MODI_LOADING,SETPRE,SETPREDATA,SETADMIN} from "../types/homePage";
 import { initItemList } from '@store/async-actions/tabTemplate';
 import config from '@config/index';
 import {Notify} from '@commonComp';
@@ -17,6 +17,7 @@ const api = {
     getPreMsg:'/api/prec/inquiryInfo/getInquiryDetail',
     getPreMsgLis:'/api/prec/inquiryInfo/hisInquirys',
     getDoctorConfig:'/doctorPageMode/getDoctorPageModes',       //获取医生设置
+    getAdminCheckout:'/sysSet/getAdminCheckout',     //获取管理员身份
 };
 
 //获取预问诊信息
@@ -47,6 +48,23 @@ export const getPreMsg = (dispatch, getState) => {
         }
     })
 }
+//获取管理员身份
+export const getAdminCheckout = (val1,val2,dispatch) => {
+    json(api.getAdminCheckout, {
+      "doctorId": val1,
+      "hospitalId": val2
+    }).then((res) => {
+        const data = res.data;
+        if (data.code == 0) {
+            dispatch({
+              type: SETADMIN,
+              admin:data.data
+            });
+        } else {
+            console.log(res)
+        }
+    })
+}
 //获取医院id
 export const initHospitalInfo = (dispatch, getState) => {
     let baseList = getState();
@@ -134,7 +152,7 @@ function getDoctorConfig(id,dispatch){
   json(api.getDoctorConfig,{doctorId:id}).then((res)=>{
     if(res.data.code==='0'){
       const configs = parseDoctorCon(res.data.data);
-      if(!configs){
+      if(!configs||Object.keys(configs).length===0){
         return ;
       }
       dispatch({
@@ -167,6 +185,7 @@ export async function getPatientMessage(dispatch, getState){
   let data1 = {},data2 = {};
   if(res1.data.code=='0'){
     data1 = res1.data.data;
+    getAdminCheckout(data1.doctorId,data1.hospitalId,dispatch)
     getDoctorConfig(data1.doctorId,dispatch);
   }
   if(res2.data.code=='0'){

+ 13 - 0
src/store/async-actions/print.js

@@ -53,6 +53,17 @@ export const realSaveData = (bool,list) => {
     let jsonData = getAllDataList(baseList);
     const lisData = baseList.inspect.pushItem;
     const lisArr = transferIndexData(lisData);
+    //分出体征和非体征标签单独传
+    const checkBody = baseList.checkBody.data;
+    let vitalTags = [],unVitalTags=[];
+    checkBody&&checkBody.map((it)=>{
+        if(it.specFlag===4){
+          vitalTags.push(it);
+        }else{
+          unVitalTags.push(it);
+        }
+    });
+
     const haveAssess = Object.keys(baseList.assessResult.data).length>0;
     let otherData = {},pacsData={};
     const docConfigs = dConfig.readConfig===-1||!dConfig.readConfig?dConfig.typeConfig:dConfig.readConfig;
@@ -79,6 +90,8 @@ export const realSaveData = (bool,list) => {
         "dataJson": JSON.stringify(Object.assign({haveAssess:haveAssess,docConfigs:docConfigs},jsonData)),
         "indexData":lisArr,
         "inquiryEvaluation":evaluation,
+        "vitalSigns":JSON.stringify(vitalTags||[]),
+        "physicalExcVs":JSON.stringify(unVitalTags||[]),
         "detailList": [{
             "content": jsonStr.chief,
             "contentValue":filterDataArr(JSON.parse(jsonStr.chief)),

+ 199 - 6
src/store/async-actions/tabTemplate.js

@@ -5,7 +5,12 @@ import {
   batchDelItems,
   changeTitle,
   keepPushData,
-  changeVisible
+  changeVisible,
+  getDptLis,
+  initAdminItems,
+  delItemsAdmin,
+  batchDelItemsAdmin,
+  changeTitleAdmin,
 } from '@store/actions/tabTemplate';
 import {DIAG_SHOW} from "@store/types/print";
 import Notify from '@commonComp/Notify';
@@ -14,11 +19,21 @@ import {
   getAllDataList,
   getAllDataStringList,
   pushAllDataList,
+  getUrlArgObject,
   didPushParamChange
 } from '@utils/tools';
 import { billing } from '@store/async-actions/pushMessage';
 
-export const initItemList = (current,name) => { //初始化数据
+export const initItemList = (current,name) => {
+  let admin = store.getState().homePage.admin;
+  if(admin){
+    return initAdminItemList(current,name)
+  }else{
+    return initCommonItemList(current,name)
+  }
+}
+
+export const initCommonItemList = (current,name) => { //初始化数据
   let baseList = store.getState();
   let state = baseList.patInfo.message;
 
@@ -27,6 +42,7 @@ export const initItemList = (current,name) => { //初始化数据
       "doctorId": state.doctorId,
       "hospitalDeptId": state.hospitalDeptId,
       "hospitalId": state.hospitalId,
+      "hospitalCode": state.hospitalCode,
       "current": current,
       "sex":[1,2,3],
       "size": 9999,
@@ -42,6 +58,30 @@ export const initItemList = (current,name) => { //初始化数据
     })
   }
 };
+export const initAdminItemList = (current,name) => { //初始化数据
+  let baseList = store.getState();
+  let state = baseList.patInfo.message;
+  return (dispatch) => {
+    axios.json('/templateAdmin/getTemplatePageAlls', {
+      "doctorId": state.doctorId,
+      "hospitalDeptId": '',
+      "hospitalId": state.hospitalId,
+      "hospitalCode": state.hospitalCode,
+      "current": current,
+      "sex":[1,2,3],
+      "size": 9999,
+      "name":name||''
+    }).then((res) => {
+      const data = res.data;
+      if (data.code == 0) {
+        // data.data.flg = flg||false  //获取下一页,暂时不用
+        dispatch(initAdminItems(data.data));
+      } else {
+        Notify.error(data.msg)
+      }
+    })
+  }
+};
 
 export const saveTemplateDetail = (val,sex) => { //保存为模板
   let baseList = store.getState();
@@ -104,6 +144,67 @@ export const saveTemplateDetail = (val,sex) => { //保存为模板
     })
   }
 };
+export const saveAdminTemplateDetail = (val,sex,id) => { //保存为模板
+  let baseList = store.getState();
+  let jsonData = getAllDataList(baseList);
+  let jsonStr = getAllDataStringList(baseList);
+  const dConfig = baseList.typeConfig;
+  const readMode = dConfig.readMode;          //回读模式
+  let whichSign = readMode===-1||readMode===null?dConfig.mode:readMode;
+  const docConfigs = dConfig.readConfig===-1||!dConfig.readConfig?dConfig.typeConfig:dConfig.readConfig;
+  jsonData.docConfigs=docConfigs;     //保存当时的设置引用
+  let state = baseList.patInfo.message;
+  let preview = {
+    "chief": jsonStr.chief,
+    "present": jsonStr.present,
+    "other": jsonStr.other,
+    "vital": jsonStr.vital,
+    "lis": jsonStr.lis,
+    "pacs": jsonStr.pacs,
+    "diag": jsonStr.diag,
+    "advice": jsonStr.advice,
+  }
+  function getdata(idx){
+    let tmpObj = {
+      "doctorId": state.doctorId,
+      "hospitalDeptId": id,
+      "hospitalId": state.hospitalId,
+      "dataJson": JSON.stringify(jsonData),
+      "modeName": val,
+      "modeType": whichSign,
+      "preview": idx ? JSON.stringify(preview):preview,
+      "sex":sex
+    }
+    return tmpObj;
+  }
+  return (dispatch) => {
+    axios.json('/templateAdmin/saveTemplateAdmin', getdata()).then((res) => {
+      const data = res.data;
+      if (data.code == 0) {
+        Notify.success('模板保存成功');
+        dispatch(initItemList(1,""));
+        dispatch(keepPushData(getdata(1),'part'));
+        dispatch({
+          type: DIAG_SHOW,
+          data:false
+        });
+      } else {
+        if(data.msg == '该模板名存在'){         //存在不关闭弹窗
+          dispatch({
+            type: DIAG_SHOW,
+            data:true
+          });
+        }else{
+          dispatch({
+            type: DIAG_SHOW,
+            data:false
+          });
+        }
+        Notify.error(data.msg);
+      }
+    })
+  }
+};
 
 export const delItem = (id) => { //删除
   return (dispatch) => {
@@ -120,6 +221,24 @@ export const delItem = (id) => { //删除
     })
   }
 };
+export const delItemAdmin = (id) => { //删除
+  let baseList = store.getState().patInfo.message;
+  return (dispatch) => {
+    axios.json('/templateAdmin/cancelTemplateAdminb', {
+      "ids": id, 
+      "doctorId": baseList.doctorId,
+      "hospitalId": baseList.hospitalId,
+    }).then((res) => {
+      let data = res.data;
+      if (data.code == 0) {
+        dispatch(delItemsAdmin(id));
+        Notify.success('模板删除成功');
+      } else {
+        Notify.error(data.msg);
+      }
+    })
+  }
+};
 export const delBatchItem = (ids) => { //批量删除
   return (dispatch) => {
     axios.json('/templateInfo/cancelTemplateInfos', {
@@ -134,15 +253,53 @@ export const delBatchItem = (ids) => { //批量删除
     })
   }
 };
+export const delBatchItemAdmin = (ids) => { //批量删除
+  let baseList = store.getState().patInfo.message;
+  return (dispatch) => {
+    axios.json('/templateAdmin/cancelTemplateAdminb', {
+      "ids": ids.join(","), 
+      "doctorId": baseList.doctorId,
+      "hospitalId": baseList.hospitalId,
+    }).then((res) => {
+      let data = res.data;
+      if (data.code == 0) {
+        dispatch(batchDelItemsAdmin(ids));
+      } else {
+        Notify.error(data.msg);
+      }
+    })
+  }
+};
 
-export const changeTitleAsync = (obj) => { //改标题
+export const changeTitleAsyncAdmin = (obj) => { //改标题
   let baseList = store.getState();
   let whichSign = baseList.typeConfig.mode;
   let state = baseList.patInfo.message;
-  if (obj.title.trim() == '') {
-    Notify.info('请输入模板名称');
-    return;
+  return (dispatch) => {
+    axios.json('/templateAdmin/updateByAdminNames', {
+      "doctorId": state.doctorId,
+      "hospitalDeptId": state.hospitalDeptId,
+      "hospitalId": state.hospitalId,
+      "id": obj.id,
+      "modeName": obj.title,
+      "type": whichSign
+    }).then((res) => {
+      let data = res.data;
+      if (data.code == 0) {
+        dispatch(changeTitleAdmin(obj));
+        Notify.success('标题修改成功');
+        store.dispatch(changeVisible(false))
+      } else {
+        // console.log(data)
+        Notify.error(data.msg)
+      }
+    })
   }
+};
+export const changeTitleAsync = (obj) => { //改标题
+  let baseList = store.getState();
+  let whichSign = baseList.typeConfig.mode;
+  let state = baseList.patInfo.message;
   return (dispatch) => {
     axios.json('/templateInfo/updateByIdUsNames', {
       "doctorId": state.doctorId,
@@ -182,4 +339,40 @@ export const setPageView = (id) => { //获取模板结构化数据
       }
     })
   }
+};
+export const setPageViewAdmin = (id) => { //获取模板结构化数据
+  return (dispatch) => {
+    axios.json('/templateAdmin/getTemplateIdAlls', {
+      id: id
+    }).then((res) => {
+      let data = res.data;
+      if (data.code == 0) {
+        //模板列表不筛选模式后,单个模式引用时看本身的模式
+        pushAllDataList(data.data.type, 'push', data.data, 'template')//引用
+        if(didPushParamChange()){     //诊断变化时会调推送,避免重复调
+          dispatch(billing())
+        }
+      } else {
+        Notify.error(data.msg);
+      }
+    })
+  }
+};
+
+export const getDepartments = (value) => { //获取模板结构化数据
+  return (dispatch) => {
+    axios.json('/doctorInfo/getHospitalDeptInfoAll', {
+      "deptInfoName": value,
+      "hospitalCode": getUrlArgObject('hospitalId'),
+      "thirdpartyName": ""
+    }).then((res) => {
+      let data = res.data;
+      if (data.code == 0) {
+        console.log(data)
+        dispatch(getDptLis(data.data))
+      } else {
+        Notify.error(data.msg);
+      }
+    })
+  }
 };

+ 4 - 2
src/store/reducers/checkBody.js

@@ -1,11 +1,11 @@
 import {RECOVER_TAG_CHECK,SET,SETNUMBER4,SETSELECTED4,SETCHECKBOX,ADDLABELITEM,SETCHECKTEXT,SETSEARCHDATA,
   SELECTSEARCHDATA,CHANGECHECKTEXTLABEL,CLEARCHECKBODY,CHECK_FOCUS_INDEX,CHECKBODY_CLEAR,
   SETCHECKINPUT,DEL_CHECKBODY,CHECKCONFIRMSELECTED,
-  CHECKBODY_MUL,DEL_CHECKBODY_LABLE,SET_CK_RADIO_INPUT_VAL,SET_IMPORT_CHECKBODY_LABEL,PRESET,REPUSH_CHECK_LABELS} from '../types/checkBody.js';
+  CHECKBODY_MUL,DEL_CHECKBODY_LABLE,SET_CK_RADIO_INPUT_VAL,SET_IMPORT_CHECKBODY_LABEL,PRESET,REPUSH_CHECK_LABELS,DELETE_CHECK_SELECTED_TAGS} from '../types/checkBody.js';
 import {recoveTag,set,setCheckBoxValue,
   setSearchData,insertLabelData,changeLabelVal,clearCheckBody,backspaceText
   ,confirm,multipleComfirn,delSingleLable,setImportCheckbodyLabel,preSetCheckbody,reflashLabels} from '../actions/checkBody.js';
-import {setRadioInputValue,setRadioValue,setNumberValue,setCheckText,addLabelItem,setInputLabel} from '@utils/utils';
+import {setRadioInputValue,setRadioValue,setNumberValue,setCheckText,addLabelItem,setInputLabel,deleteSelectedLabels} from '@utils/utils';
 import config from '@config/index.js';
 
 const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签
@@ -67,6 +67,8 @@ export default function(state=initState,action){
       return setImportCheckbodyLabel(state,action);
     case RECOVER_TAG_CHECK:
       return recoveTag(state,action);
+    case DELETE_CHECK_SELECTED_TAGS:
+      return deleteSelectedLabels(state,action);
     case REPUSH_CHECK_LABELS:
       return reflashLabels(state,action);
     default:

+ 4 - 2
src/store/reducers/currentIll.js

@@ -3,11 +3,11 @@ import {RECOVER_TAG_CURRENT,SET_CURRENT,CURRENT_CONFIRM,INSERT_PROCESS,SET_CURRE
   CURRENT_RADIO,CURRENT_NUMBER,CURRENT_TEXT_LABEL,CLEAR_CURRENT_ILL,SETTEXTMODEVALUE,CURRENT_GET_BIGDATAPUSH,CURRENT_CLEAR,
   SET_CURRENT_SEARCH,SETCURRENTTEXT,CURRENT_FOCUS_INDEX,SELECT_SEARCHDATA,CLEAR_CURRENT_EDIT,CURRENTADDLABELITEM,
   SETCURRENTINPUT,DEL_CURRENT,REMOVE_CURR_ID,CURRENT_MUL,DEL_CURRENT_LABLE,SET_RADIO_INPUT_VALUE,CURRENT_CHRONIC,
-  SAVE_CURR_FREE,SHOW_COMMON_ON_CURRENT} from '../types/currentIll';
+  SAVE_CURR_FREE,SHOW_COMMON_ON_CURRENT,DELETE_CURRENT_SELECTED_TAGS} from '../types/currentIll';
 import {confirm,insertProcess,setData,setCheckBox,changeLabelVal,clearCurrentIll,
   setTextModeValue,setModule,bigDataSymptom,insertLabelData,clearCurrentEdit,
   backspaceText,removeId,multipleComfirn,delSingleLable,fillChronicModule} from '../actions/currentIll';
-import {recoveTag,setRadioInputValue,setRadioValue,setNumberValue,setCheckText,addLabelItem,setInputLabel} from '@utils/utils';
+import {recoveTag,setRadioInputValue,setRadioValue,setNumberValue,setCheckText,addLabelItem,setInputLabel,deleteSelectedLabels} from '@utils/utils';
 
 const initState = {
   moduleData:[],
@@ -88,6 +88,8 @@ export default function(state=initState,action){
       return res;
     case RECOVER_TAG_CURRENT:
       return recoveTag(state,action);
+    case DELETE_CURRENT_SELECTED_TAGS:
+      return deleteSelectedLabels(state,action);
     case SHOW_COMMON_ON_CURRENT:
       res.showCommon = action.show;
       return res;

+ 11 - 3
src/store/reducers/homePage.js

@@ -1,6 +1,6 @@
 import {HIDE,RESET,SETINITDATA,SETDROPSHOW,SETADDITEMINIT,SETT0EDIT,SETREADDITEMS,SETPREDATA,
-  HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY,SETMINSCREEN,MODI_LOADING,GET_INSPECT_LIST,GET_ASSIST_LIST,SETALLMODULES,SETSYSTEMCONFIG,SETPRE} from '../types/homePage.js';
-import {showDrop,setAddItemInit,setLabelToEdit,confirmHide,clickNum,getInspectList,getAssistList} from '../actions/homePage.js';
+  HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY,SETMINSCREEN,MODI_LOADING,GET_INSPECT_LIST,GET_ASSIST_LIST,SETALLMODULES,SETSYSTEMCONFIG,SETPRE,RESET_SELECT_TAG,SET_SELECTED_AREA,SETADMIN} from '../types/homePage.js';
+import {showDrop,setAddItemInit,setLabelToEdit,confirmHide,clickNum,getInspectList,getAssistList,setSelectArea,resetSelectArea} from '../actions/homePage.js';
 
 const initState = {
   totalHide:false,
@@ -20,7 +20,8 @@ const initState = {
   sysConfig:{},
   showPre:false,
   preData:{},
-  item:{}
+  item:{},
+  admin:false
 };
 
 export default function (state=initState,action) {
@@ -83,6 +84,13 @@ export default function (state=initState,action) {
       res.preData = action.preData;
       res.item = action.item;
       return res;
+    case SETADMIN:
+      res.admin = action.admin;
+      return res;
+    case SET_SELECTED_AREA:
+      return setSelectArea(state,action);
+    case RESET_SELECT_TAG:
+      return resetSelectArea(state,action);
     default:
       return res;
   }

+ 4 - 2
src/store/reducers/mainSuit.js

@@ -2,12 +2,12 @@ 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,
-  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} 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,DELETE_MAIN_SELECTED_TAGS} from '../types/mainSuit'
 import {getCommSymptoms,handleTailClick,insertMain,setSearch,getBigSymptom,setMainMoudle,confirm,
   commConfirm,changeLabelVal,saveFreeVal,clearMainSuit,insertSearch,setTextModeValue,
   backspaceText,removeId,multipleComfirn,delSingleLable,
   getSymptomFeature} from '../actions/mainSuit'
-import {recoveTag,setRadioInputValue,setNumberValue,setRadioValue,setCheckText,addLabelItem,setInputLabel} from '@utils/utils';
+import {recoveTag,setRadioInputValue,setNumberValue,setRadioValue,setCheckText,addLabelItem,setInputLabel,deleteSelectedLabels} from '@utils/utils';
 
 const initState = {
   showDrop:false,
@@ -125,6 +125,8 @@ export default function(state=initState,action){
         res.addSearchData = [];
       }
       return res;
+    case DELETE_MAIN_SELECTED_TAGS:
+      return deleteSelectedLabels(state,action);
     default:
       return state;
   }

+ 4 - 2
src/store/reducers/otherHistory.js

@@ -1,10 +1,10 @@
 import {RECOVER_TAG_OTHER,SETDATA,CONFIRMSELECTED,SETRADIO,SETNUMBER,SETOTHERCHECKBOX,SETOTHERTEXT,SETOTHERSEARCHDATA,
   SELECTOTHERSEARCHDATA,CLEAROTHERHISTORY,CHANGEOTHERTEXTLABEL,SETOTHERINPUT,SETTEXTMODEVALUE,OTHER_FOCUS_INDEX,OTHERHIS_CLEAR,
-  OTHERADDLABELITEM,OTHEREDICLEAR,DEL_OTHERHIS,OTHERHIS_MUL,REMOVE_OTHER_ID,DEL_OTHERHIS_LABLE,SET_OT_RADIO_INPUT_VAL} from '../types/otherHistory';
+  OTHERADDLABELITEM,OTHEREDICLEAR,DEL_OTHERHIS,OTHERHIS_MUL,REMOVE_OTHER_ID,DEL_OTHERHIS_LABLE,SET_OT_RADIO_INPUT_VAL,DELETE_OTHER_SELECTED_TAGS} from '../types/otherHistory';
 import {confirm,setCheckBoxValue,setSearchData,insertLabelData,clearOtherHistory,
   changeTextLabel,setNumberValue,setTextModeValue,otherEditClear,backspaceText,multipleComfirn,
   removeId,delSingleLable} from '../actions/otherHistory';
-import {recoveTag,setRadioInputValue,setRadioValue,addLabelItem,setCheckText,setInputLabel} from '@utils/utils';
+import {recoveTag,setRadioInputValue,setRadioValue,addLabelItem,setCheckText,setInputLabel,deleteSelectedLabels} from '@utils/utils';
 import config from '@config/index';
 
 const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签
@@ -75,6 +75,8 @@ export default function(state=initState,action){//console.log(state)
       return setRadioInputValue(state,action);
     case RECOVER_TAG_OTHER:
       return recoveTag(state,action);
+    case DELETE_OTHER_SELECTED_TAGS:
+      return deleteSelectedLabels(state,action);
     default:
       return res;
   }

+ 108 - 7
src/store/reducers/tabTemplate.js

@@ -10,6 +10,14 @@ import {
   SHOW_MESSAGE,
   KEEP_PUSH_DATA,
   ALL_CHECKED_SHOW,
+  GET_DPT_LIS,
+  INIT_ADMIN_ITEMS,
+  ALL_CHECKED_ADMIN,
+  ALL_CHECKED_SHOW_ADMIN,
+  CKECK_ITEMS_ADMIN,
+  DEL_ITEMS_ADMIN,
+  BATCH_DEL_ITEMS_ADMIN,
+  CHANGE_TITLE_ADMIN,
 } from '../types/tabTemplate';
 
 
@@ -22,23 +30,43 @@ const initDataList = {
     type: ''
   },
   items: [],
+  adminItems:[],
   allChecked: false, //全选反选
+  allCheckedAdmin:false,//全选反选管理员模板
   checkItems: [], //选中要删除的元素
+  checkItemsAdmin: [], //选中要删除的元素管理员
   activeItem: {}, //引用的模板
   activeItemHis: {}, //引用的历史病例
   allCheckShow: false, //全选反选是否显示
+  allCheckShowAdmin: false, //全选反选是否显示管理员
   current:1,//当前页
   hasMore:true,//是否显示更多
+  departLis:[],//搜索的科室列表
 }
 export default (state = initDataList, action) => {
+  if (action.type === GET_DPT_LIS) {
+    const newState = Object.assign({}, state);
+    newState.departLis = action.list;
+    return newState;
+  }
   if (action.type === DEL_ITEMS) {
     const newState = Object.assign({}, state);
     let tempArr = newState.items;
     tempArr.splice(tempArr.findIndex(item => item.id == action.id), 1)
     newState.items = [...tempArr];
-    // if(tempArr.length == 0){
-    //   newState.allCheckShow = false
-    // }
+    if(tempArr.length == 0){
+      newState.allCheckShow = false
+    }
+    return newState;
+  }
+  if (action.type === DEL_ITEMS_ADMIN) {
+    const newState = Object.assign({}, state);
+    let tempArr = newState.adminItems;
+    tempArr.splice(tempArr.findIndex(item => item.id == action.id), 1)
+    newState.adminItems = [...tempArr];
+    if(tempArr.length == 0){
+      newState.allCheckShowAdmin = false
+    }
     return newState;
   }
   if (action.type === BATCH_DEL_ITEMS) {
@@ -49,12 +77,26 @@ export default (state = initDataList, action) => {
       tempArr.splice(tempArr.findIndex(item => item.id == currentId), 1)
     }
     newState.items = [...tempArr];
-    // if(tempArr.length == 0){
-    //   newState.allCheckShow = false
-    // }
+    if(tempArr.length == 0){
+      newState.allCheckShow = false
+    }
     newState.checkItems = [];
     return newState;
   }
+  if (action.type === BATCH_DEL_ITEMS_ADMIN) {
+    const newState = Object.assign({}, state);
+    let tempArr = newState.adminItems;
+    for (let i = 0; i < action.ids.length; i++) {
+      let currentId = action.ids[i];
+      tempArr.splice(tempArr.findIndex(item => item.id == currentId), 1)
+    }
+    newState.adminItems = [...tempArr];
+    if(tempArr.length == 0){
+      newState.allCheckShowAdmin = false
+    }
+    newState.checkItemsAdmin = [];
+    return newState;
+  }
   if (action.type === INIT_ITEMS) {
     const newState = Object.assign({}, state);
     // let tmpItems = JSON.parse(JSON.stringify(newState.items))
@@ -65,7 +107,23 @@ export default (state = initDataList, action) => {
     // }else{
     //   newState.items = tmpItems.concat(action.state.records);
     // }
-    newState.items = action.state.records
+    newState.items = action.state.personalTemplate.records
+    newState.adminItems = action.state.adminTemplate.records
+    newState.current = action.state.current;
+    newState.hasMore = action.state.current<action.state.pages;
+    return newState;
+  }
+  if (action.type === INIT_ADMIN_ITEMS) {
+    const newState = Object.assign({}, state);
+    // let tmpItems = JSON.parse(JSON.stringify(newState.items))
+    // let tmpCurrent = JSON.parse(JSON.stringify(newState.current))
+    // console.log(action.state.flg,action.state.pages,tmpCurrent,45544)
+    // if(action.state.current == 1&&!action.state.flg){//进入页面会调取分页相关先去掉
+    //   newState.items = action.state.records
+    // }else{
+    //   newState.items = tmpItems.concat(action.state.records);
+    // }
+    newState.adminItems = action.state.records
     newState.current = action.state.current;
     newState.hasMore = action.state.current<action.state.pages;
     return newState;
@@ -96,6 +154,17 @@ export default (state = initDataList, action) => {
     newState.items = [...tempArr];
     return newState;
   }
+  if (action.type === CHANGE_TITLE_ADMIN) {
+    const newState = Object.assign({}, state);
+    let tempArr = newState.adminItems;
+    for (let i = 0; i < tempArr.length; i++) {
+      if (tempArr[i].id == action.obj.id) {
+        tempArr[i].name = action.obj.title
+      }
+    }
+    newState.adminItems = [...tempArr];
+    return newState;
+  }
   if (action.type === CKECK_ITEMS) {
     const newState = Object.assign({}, state);
     if (newState.checkItems.indexOf(action.id) == -1) {
@@ -109,6 +178,19 @@ export default (state = initDataList, action) => {
     }
     return newState;
   }
+  if (action.type === CKECK_ITEMS_ADMIN) {
+    const newState = Object.assign({}, state);
+    if (newState.checkItemsAdmin.indexOf(action.id) == -1) {
+      let tempArr = newState.checkItemsAdmin;
+      tempArr.push(action.id);
+      newState.checkItemsAdmin = [...tempArr]
+    } else {
+      let tempArr = newState.checkItemsAdmin;
+      tempArr.splice(tempArr.findIndex(item => item === action.id), 1)
+      newState.checkItemsAdmin = [...tempArr]
+    }
+    return newState;
+  }
   if (action.type === KEEP_PUSH_DATA) {
     const newState = Object.assign({}, state);
     action.flg == 'his' ? (newState.activeItemHis = action.data) : (newState.activeItem = action.data);
@@ -127,6 +209,20 @@ export default (state = initDataList, action) => {
     newState.allChecked = action.bool;
     newState.checkItems = [...tempArr];
     return newState;
+  }  
+  if (action.type === ALL_CHECKED_ADMIN) {//管理员全选反选
+    const newState = Object.assign({}, state);
+    let tempArr = [];
+    if (action.bool) {
+      newState.adminItems.forEach((val) => {
+        tempArr.push(val.id)
+      })
+    } else {
+      tempArr = []
+    }
+    newState.allCheckedAdmin = action.bool;
+    newState.checkItemsAdmin = [...tempArr];
+    return newState;
   }
 
   if (action.type === ALL_CHECKED_SHOW) {
@@ -134,5 +230,10 @@ export default (state = initDataList, action) => {
     newState.allCheckShow = action.bool;
     return newState;
   }
+  if (action.type === ALL_CHECKED_SHOW_ADMIN) {
+    const newState = Object.assign({}, state);
+    newState.allCheckShowAdmin = action.bool;
+    return newState;
+  }
   return state;
 }

+ 1 - 0
src/store/types/checkBody.js

@@ -20,4 +20,5 @@ export const SET_CK_RADIO_INPUT_VAL = 'SET_CK_RADIO_INPUT_VAL';
 export const SET_IMPORT_CHECKBODY_LABEL='SET_IMPORT_CHECKBODY_LABEL';
 export const PRESET = 'PRESET_CHECKBODY_DATA';
 export const RECOVER_TAG_CHECK = 'RECOVER_TAG_CHECK';     //恢复已删除标签
+export const DELETE_CHECK_SELECTED_TAGS='DELETE_CHECK_SELECTED_TAGS';
 export const REPUSH_CHECK_LABELS = 'REPUSH_CHECK_LABELS';   //重新获取查体

+ 2 - 0
src/store/types/currentIll.js

@@ -30,3 +30,5 @@ export const SAVE_CURR_FREE = 'SAVE_CURR_FREE';//自由输入
 export const CHANGE_CURRENT_LABELVAL = 'CHANGE_CURRENT_LABELVAL';//双击标签输入改变值
 export const RECOVER_TAG_CURRENT = 'RECOVER_TAG_CURRENT';     //恢复已删除标签
 export const SHOW_COMMON_ON_CURRENT = 'SHOW_COMMON_ON_CURRENT';     //现病史中显示常用症状
+export const DELETE_CURRENT_SELECTED_TAGS='DELETE_CURRENT_SELECTED_TAGS';
+

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

@@ -18,3 +18,6 @@ export const SETALLMODULES = 'SETALLMODULES';    //储存所有模板数据
 export const SETSYSTEMCONFIG = 'SETSYSTEMCONFIG';   //设置配置数据
 export const SETPRE = 'SETPRE';   //设置预问诊引用弹窗
 export const SETPREDATA = 'SETPREDATA';   //设置预问诊数据暂存
+export const SETADMIN = 'SETADMIN';   //设置管理员身份
+export const RESET_SELECT_TAG='RESET_SELECT_TAG';   //重置选中标签的各标记
+export const SET_SELECTED_AREA='SET_SELECTED_AREA';

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

@@ -32,3 +32,4 @@ 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 DELETE_MAIN_SELECTED_TAGS='DELETE_MAIN_SELECTED_TAGS';

+ 2 - 1
src/store/types/otherHistory.js

@@ -21,4 +21,5 @@ export const OTHERHIS_MUL = 'OTHERHIS_MUL';    //单列多选
 export const REMOVE_OTHER_ID = 'REMOVE_OTHER_ID';    
 export const DEL_OTHERHIS_LABLE = 'DEL_OTHERHIS_LABLE';
 export const SET_OT_RADIO_INPUT_VAL = 'SET_OT_RADIO_INPUT_VAL';
-export const RECOVER_TAG_OTHER = 'RECOVER_TAG_OTHER'; //恢复已删除标签
+export const RECOVER_TAG_OTHER = 'RECOVER_TAG_OTHER'; //恢复已删除标签
+export const DELETE_OTHER_SELECTED_TAGS='DELETE_OTHER_SELECTED_TAGS';

+ 8 - 0
src/store/types/tabTemplate.js

@@ -9,3 +9,11 @@ export const CHANGE_VISIBLE = 'CHANGE_VISIBLE';
 export const SHOW_MESSAGE = 'SHOW_MESSAGE';
 export const KEEP_PUSH_DATA = 'KEEP_PUSH_DATA';
 export const ALL_CHECKED_SHOW = 'ALL_CHECKED_SHOW';
+export const GET_DPT_LIS = 'GET_DPT_LIS';
+export const INIT_ADMIN_ITEMS = 'INIT_ADMIN_ITEMS';
+export const ALL_CHECKED_ADMIN = 'ALL_CHECKED_ADMIN';
+export const ALL_CHECKED_SHOW_ADMIN = 'ALL_CHECKED_SHOW_ADMIN';
+export const CKECK_ITEMS_ADMIN = 'CKECK_ITEMS_ADMIN';
+export const DEL_ITEMS_ADMIN = 'DEL_ITEMS_ADMIN';
+export const BATCH_DEL_ITEMS_ADMIN = 'BATCH_DEL_ITEMS_ADMIN';
+export const CHANGE_TITLE_ADMIN = 'CHANGE_TITLE_ADMIN';

+ 2 - 2
src/utils/config.js

@@ -1,8 +1,8 @@
 // const host='http://192.168.3.1:5050';//赵
 // const host='http://192.168.3.100:5050';//王峰
 // const host='http://192.168.2.121:5050';//后端接口访问地址
-// const host='http://192.168.2.236:5050';//后端接口访问地址
-const host='http://192.168.2.241:5050';//后端接口访问地址
+const host='http://192.168.2.236:5050';//后端接口访问地址
+// const host='http://192.168.2.241:5050';//后端接口访问地址
 // const host='http://192.168.3.11:5050';//王宇
 //const host='http://192.168.2.164:8080';
 // const host='http://192.168.3.117:5050'; //周铁刚

+ 5 - 1
src/utils/tools.js

@@ -1358,7 +1358,11 @@ function resetTagtype(data){
 //记录最近3次被删除的标签
 function handleLocalDelTag(mark,index,tag){
   const deledTag =  localStorage.getItem('deletedTags')?JSON.parse(localStorage.getItem('deletedTags')):[];
-  deledTag.unshift(Object.assign({},tag,{delIndex:mark+'-'+index}));
+  if(tag.tagType){
+    deledTag.unshift(Object.assign({},tag,{delIndex:mark+'-'+index}));
+  }else{
+    deledTag.unshift({tags:tag,delIndex:mark+'-'+index});
+  }
   deledTag.length = deledTag.length>config.recoverTagNum?config.recoverTagNum:deledTag.length;
   localStorage.setItem('deletedTags',JSON.stringify(deledTag));
 }

+ 28 - 1
src/utils/utils.js

@@ -1,5 +1,5 @@
 import config from '@config/index.js';
-import {getLabelIndex,checkFullfillText,fullfillText,shiftLocalDelTag,getEMRParams,storageLocal} from './tools';
+import {getLabelIndex,checkFullfillText,fullfillText,shiftLocalDelTag,getEMRParams,storageLocal,handleLocalDelTag} from './tools';
 import { json } from "./ajax";
 /**
  * 各类标签统一的处理函数
@@ -234,4 +234,31 @@ export async function getBigPush(type,symData,save){
     storageLocal.set('emrParam',savePm);      //推送数据存储,用作推送前对比是否有变,有变才推送
   }
   return json(api.push,params);
+}
+
+//删除选中标签
+export function deleteSelectedLabels(state,action){
+  let res = Object.assign({}, state);
+  const {start,end,boxMark} = action;
+  let n = Math.abs(end-start)+1;
+  const arr = res.data;
+  const startIsText = arr[start].tagType=='8';
+  const endIsText = arr[end].tagType=='8';
+  if(!startIsText&&!endIsText){
+    n=Math.abs(end-start)+2;
+  }
+  if(start>end){      //从后往前选中
+    const temp = arr.splice(end,n);
+    handleLocalDelTag(boxMark,end,temp);
+  }else if(start===end){
+    return res;
+  }else{
+    const temp = arr.splice(start,n);
+    handleLocalDelTag(boxMark,start,temp);
+  }
+  const newObj = boxMark=='4'?checkFullfillText(arr):fullfillText(arr);
+  res.data = newObj.newArr;
+  res.saveText = newObj.saveText;
+  res.update = Math.random();
+  return res;
 }