Browse Source

合并分支

liucf 6 years ago
parent
commit
5136ff170b
43 changed files with 1033 additions and 287 deletions
  1. 2 2
      src/common/components/DropList/index.jsx
  2. 1 1
      src/common/components/InspectCommon/index.less
  3. 0 0
      src/common/images/added.png
  4. 6 1
      src/components/AddInspect/index.less
  5. 99 44
      src/components/AssessResult/ChartItem/index.jsx
  6. 2 15
      src/components/AssessResult/ChooseItem/index.jsx
  7. 40 20
      src/components/AssessResult/ScaleItem/index.jsx
  8. 32 10
      src/components/AssessResult/index.jsx
  9. 5 0
      src/components/AssessResult/index.less
  10. 53 23
      src/components/ChronicInfo/index.jsx
  11. 8 1
      src/components/ChronicInfo/index.less
  12. 1 1
      src/components/CopyRight/index.less
  13. 162 0
      src/components/Multiple/SlideItem/index.jsx
  14. 53 0
      src/components/Multiple/SlideItem/index.less
  15. 28 24
      src/components/Multiple/index.jsx
  16. 2 2
      src/components/PushItems/index.jsx
  17. 4 4
      src/components/RadioDrop/index.jsx
  18. 35 57
      src/components/TemplateItems/TemplateItem/index.jsx
  19. 2 0
      src/components/TemplateItems/TemplateItem/index.less
  20. 2 1
      src/components/TemplateItems/index.jsx
  21. 69 0
      src/components/Treat/AdverseReactions/index.jsx
  22. 27 0
      src/components/Treat/AdverseReactions/index.less
  23. 77 0
      src/components/Treat/LastTreat/LastDrug/index.jsx
  24. 14 0
      src/components/Treat/LastTreat/LastDrug/index.less
  25. 34 0
      src/components/Treat/LastTreat/index.jsx
  26. 27 0
      src/components/Treat/LastTreat/index.less
  27. 5 1
      src/components/Treat/index.jsx
  28. 1 0
      src/config/index.js
  29. 39 16
      src/containers/AssessResult.js
  30. 16 0
      src/containers/ChronicInfo.js
  31. 9 6
      src/containers/PushItemsContainer.js
  32. 11 9
      src/containers/Treat.js
  33. 29 31
      src/store/actions/currentIll.js
  34. 4 2
      src/store/actions/mainSuit.js
  35. 4 2
      src/store/actions/otherHistory.js
  36. 1 1
      src/store/async-actions/assistCheck.js
  37. 3 3
      src/store/async-actions/fetchModules.js
  38. 2 2
      src/store/async-actions/inspect.js
  39. 41 6
      src/store/reducers/assessResult.js
  40. 76 0
      src/store/reducers/treat.js
  41. 4 1
      src/store/types/assessResult.js
  42. 1 0
      src/utils/config.js
  43. 2 1
      src/utils/tools.js

+ 2 - 2
src/common/components/DropList/index.jsx

@@ -43,14 +43,14 @@ class DropList extends Component{
     onSelect&&onSelect(undefined);
   }
   render(){
-    const {data,hideTag} = this.props;
+    const {data,hideTag,boxMark} = this.props;
     const domNode = document.getElementById('root');
     return ReactDom.createPortal(
       <div className={this.getClass()} style={this.getStyle()} contentEditable='false'>
         <ul>
           {data&&data.map((it)=>{
             /*return <li onClick={(e)=>this.handleSelect(e,it)} className={it.selected||(it.selected!==false&&+it.defaultSelect===1)?style['selected']:''}>{it.labelPrefix}{it.questionDetailList&&it.questionDetailList.length>0?it.questionDetailList[0].name:it.name}{it.labelSuffix}</li>*/
-            return <li onClick={(e)=>this.handleSelect(e,it)} className={it.selected||(!hideTag&&it.selected!==false&&+it.defaultSelect===1)?style['selected']:''}>{it.labelPrefix}{it.name}{it.labelSuffix}</li>
+            return <li onClick={(e)=>this.handleSelect(e,it)} className={it.selected||(boxMark!=1&&!hideTag&&it.selected!==false&&+it.defaultSelect===1)?style['selected']:''}>{it.labelPrefix}{it.name}{it.labelSuffix}</li>
           })}
           <li onClick={(e)=>this.handleClear(e)} className='red'>清空选项</li>
         </ul>

+ 1 - 1
src/common/components/InspectCommon/index.less

@@ -6,7 +6,7 @@
     background-color: #fff;
     padding:28px 8px 8px 8px;
     min-width: 300px;
-    max-width: 600px;
+    max-width: 680px;
     box-sizing: border-box;
     margin-bottom: 80px;
     .llStyle;

src/common/images/已加入@2x.png → src/common/images/added.png


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

@@ -130,7 +130,7 @@
     // line-height: 28px;
     overflow: hidden;
     padding-top: 0 !important;
-    width: 290px;
+    width: 330px;
     float: left;
     padding: 0 15px;
     box-sizing: border-box;
@@ -154,9 +154,14 @@
         input {
             width: 40px;
             text-align: center;
+            float: left;
         }
         .unit {
             display: inline-block;
+            max-width: 70px;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space: nowrap;
         }
     }
 }

+ 99 - 44
src/components/AssessResult/ChartItem/index.jsx

@@ -2,6 +2,7 @@ import React, { Component } from "react";
 import style from "../index.less";
 import { Radio} from '@commonComp';
 import echarts from 'echarts';
+import config from "@config";
 /**
  * 来源于后台数据
  * 图表类型
@@ -11,56 +12,88 @@ import echarts from 'echarts';
 class ChartItem extends Component {
   constructor(props) {
     super(props);
-    this.state={
-      weekArr:[],
-      oneMonthArr:[],
-      sixMonthArr:[],
-      yearMonthArr:[]
-    };
     this.getContainers = this.getContainers.bind(this);
+    this.rangChange = this.rangChange.bind(this);
+    this.getXAxisArr = this.getXAxisArr.bind(this);
   }
-  getXAxisArr(){
+  getXAxisArr(type){
     let now = new Date().getTime();
     let arr = [],temp=0;
-    for(let i=0;i<7;i++){
-      temp=i*1000*60*60*24;
-      arr.unshift(...this.getDayHours(now-temp));
+    //近一周
+    switch(type){
+      case 'week':
+        for(let i=0;i<7;i++){
+          temp=i*1000*60*60*24;
+          arr.unshift(...this.getDayHours(now-temp,true));
+        }
+        break;
+      case 'month':
+        for(let i=0;i<30;i++){
+          temp=i*1000*60*60*24;
+          arr.unshift(this.getDayHours(now-temp));
+        }
+        break;
+      case 'sixMonth':
+        for(let i=0;i<180;i++){
+          temp=i*1000*60*60*24;
+          arr.unshift(this.getDayHours(now-temp));
+        }
+        break;
+      case 'year':
+        for(let i=0;i<365;i++){
+          temp=i*1000*60*60*24;
+          arr.unshift(this.getDayHours(now-temp));
+        }
+        break;
+      default:
     }
+
     return arr;
   }
-  getDayHours(time){
+  getDayHours(time,isHour){
     const year = new Date(time).getFullYear();
     const month = new Date(time).getMonth()+1;
     const date = new Date(time).getDate();
     const hour = new Date(time).getHours();
     let arr=[],temp='';
-    for(let i=0;i<24;i++){
-      temp = hour-i>-1?hour-i:hour-i+24;
-      arr.unshift(year+'-'+(month<10?'0'+month:month)+'-'+(date<10?'0'+date:date)+" "+(temp<10?'0'+temp:temp));
+    const str= year+'-'+(month<10?'0'+month:month)+'-'+(date<10?'0'+date:date);
+    if(isHour){
+      for(let i=0;i<24;i++){
+        temp = hour-i>-1?hour-i:hour-i+24;
+        arr.unshift(str+" "+(temp<10?'0'+temp:temp));
+      }
+      return arr;
+    }else{
+      return str;
     }
-    return arr;
+  }
+  rangChange(type,index){
+    const {initFn,handleChange} = this.props;
+    const times = this.getXAxisArr(type);
+    const range = [times[0],times[times.length-1]];
+    const temp=this.props.timeTypes;
+    initFn&&initFn({range,rangeType:type,index});
+    handleChange(Object.assign(temp,{[index]:type}));
   }
   getContainers(){
-    const obj = this.props.data;
-    const {weekArr} = this.state;
+    const timeTypes = this.props.timeTypes;
+    const range = this.getXAxisArr(config.chartDismen);
+    const obj = this.props.data[range[0]+range[range.length-1]];
     let arr = [];
     for(let i in obj){
-      arr.push(<Chart data={obj[i]} index={i} xAxis = {weekArr}/>)
+      arr.push(<Chart data={obj[i]} type={timeTypes&&timeTypes[i]} index={i} getXAxisArr={this.getXAxisArr} handleRangeChange={this.rangChange}/>)
     }
     return arr;
   }
   componentDidMount(){
     const {initFn} = this.props;
-    initFn&&initFn();
-    this.setState({
-      weekArr:this.getXAxisArr(),
-      oneMonthArr:[],
-      threeMonthArr:[],
-      yearMonthArr:[]
-    });
+    const type = config.chartDismen;
+    const times = this.getXAxisArr(config.chartDismen);
+    const range = [times[0],times[times.length-1]];
+    initFn&&initFn({range,rangeType:type});
   }
   render() {
-    const {title,data } = this.props;
+    const {title} = this.props;
     return <div className={style['assess-item']}>
       <h2>{title}</h2>
       <div className={style['item-content']}>
@@ -74,21 +107,37 @@ class Chart extends Component{
   constructor(props) {
     super(props);
     this.state={
-      timeRange:'week'
+      chartObj:null,
+      //timeRange:'year',
+      week:props.getXAxisArr('week'),
+      month:props.getXAxisArr('month'),
+      sixMonth:props.getXAxisArr('sixMonth'),
+      year:props.getXAxisArr('year')
     };
     this.drawChart = this.drawChart.bind(this);
+    this.timeSwitch = this.timeSwitch.bind(this);
   }
   drawChart(){
-    const {index,xAxis,data} = this.props;
+    const {index,data,getXAxisArr,type} = this.props;
+    const xAxis = getXAxisArr(type);
     const id = 'chart'+index;
     let series = [],names=[],inx=-1;
-    var myChart = echarts.init(document.getElementById(id));
+    let myChart = echarts.init(document.getElementById(id));
 
-    data.map((it)=>{
-      let values=new Array(168);
-      //values[24]=10;
-      it.creatTime.map((x,i)=>{
-        inx=xAxis.findIndex((a)=>{return a==x.substr(0,13)});     //日期对应横坐标的位置
+    const interval = {
+      week:24,
+      month:4,
+      sixMonth:9,
+      year:60
+    };
+    data&&data.map((it)=>{
+      let values=new Array();
+      let name='';
+      it&&it.creatTime.map((x,i)=>{
+        inx=xAxis.findIndex((a)=>{
+          name=type=='week'?x.substr(0,13):x.substr(0,10);
+          return a==name;
+        });     //日期对应横坐标的位置
         if(inx!=-1){
           values[inx] = it.indexValue[i];       //值对应横坐标的位置
         }
@@ -121,12 +170,12 @@ class Chart extends Component{
         },
         axisTick:{
           show:false,
-          interval:24
+          interval:interval[type]
         },
         axisLabel:{
           show:true,
           showMaxLabel:true,
-          interval:24,
+          interval:interval[type],
           rotate:45,
           fontSize:10
         }
@@ -148,21 +197,27 @@ class Chart extends Component{
     myChart.setOption(option);
   }
   timeSwitch(type){
-    this.setState({
-      timeRange:type
-    });
+    const {handleRangeChange,index} = this.props;
+
+    handleRangeChange&&handleRangeChange(type,index);
+
+    const that=this;
+    setTimeout(()=>{
+      that.drawChart();
+    },300);
+
   }
   componentDidMount(){
     this.drawChart();
   }
   render(){
-    const {timeRange} = this.state;
+    const {type} = this.props;
     return <div className={style['cont']}>
               <div className={style['time-range']}>
-                <span className={timeRange=='year'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("year")}>近一年</span>
-                <span className={timeRange=='6month'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("6month")}>近六个月</span>
-                <span className={timeRange=='month'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("month")}>近一个月</span>
-                <span className={timeRange=='week'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("week")}>近一周</span>
+                <span className={type=='year'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("year")}>近一年</span>
+                <span className={type=='sixMonth'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("sixMonth")}>近六个月</span>
+                <span className={type=='month'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("month")}>近一个月</span>
+                <span className={type=='week'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("week")}>近一周</span>
               </div>
               <div className={style["chart-box"]} id={'chart'+this.props.index}></div>
             </div>;

+ 2 - 15
src/components/AssessResult/ChooseItem/index.jsx

@@ -13,15 +13,8 @@ class ChooseItem extends Component {
       saveData:null,
       selecteds:{},
     };
-    //this.setInitState = this.setInitState.bind(this);
   }
-  /*setInitState(){
-    if(this.state.saveData){
-      this.setState({
-        saveData:this.props.data
-      });
-    }
-  }*/
+
   handleRadio(name,value){
     const {selecteds} = this.state;
     const {handleChange} = this.props;
@@ -29,13 +22,7 @@ class ChooseItem extends Component {
       selecteds:Object.assign({},selecteds,{[name]:value})
     });
     handleChange&&handleChange(Object.assign({},selecteds,{[name]:value}));     //不能用this.state.selecteds,因为state更新不是即时的
-    /*const list = item.details.map((it)=>{
-      if(it.detailName==value){
-        return Object.assign(it,{isSelected:true});
-      }else{
-        return Object.assign(it,{isSelected:false});
-      }
-    });*/
+
   }
   handleCheckbox(name,value){
     let {selecteds} = this.state;

+ 40 - 20
src/components/AssessResult/ScaleItem/index.jsx

@@ -7,33 +7,53 @@ import deleteIcon from '@common/images/delete.png';
  * **/
 class ScaleItem extends Component {
   constructor(props) {
-    super(props)
+    super(props);
+    this.state={
+      supplement:''
+    };
+    this.getItems = this.getItems.bind(this);
+    this.getDetailItems = this.getDetailItems.bind(this);
+  }
+  getDetailItems(item,i){
+    let arr = [],temp='';
+    const {indexs} = this.props;
+    item.details.map((it,j)=>{
+      if(indexs[i]&&indexs[i].includes(j)){
+        if(it.type==1){     //量表
+          temp =<span className={style['scale']}>【{it.content.name}】</span>;
+        }else if(it.type==2){      //计算公式
+          temp = <span>计算公式</span>
+        }else if(it.type==3){
+          temp = <span>可能结果</span>
+        }
+        arr.push(<li>
+          <span>{item.name}:</span>
+          <div className={style['row']}>{temp}</div>
+          <div className={style["recommend"]} onClick={()=>this.props.handleRemove(i,j)}>
+            <img src={deleteIcon} />
+          </div>
+        </li>);
+      }
+    });
+    return arr;
+  }
+  getItems(){
+    const { data } = this.props;
+    return data.map((it,i)=>{
+      return this.getDetailItems(it,i);
+    });
   }
   render() {
-    const {title,data  } = this.props;
+    const {title,handleInp} = this.props;
     return <div className={style['assess-item']}>
       <h2>{title}</h2>
       <div className={style['item-content']}>
         <ul>
+          {
+            this.getItems()
+          }
           <li>
-            <span>糖尿病周围神经病变:</span>
-            <div className={style['row']}>
-              正常
-            </div>
-            <div className={style["recommend"]}>
-              <img src={deleteIcon} />
-            </div>
-          </li>
-          <li>
-            <span>肾功能不全:</span>
-            <div className={style['row']}>
-            </div>
-            <div className={style["recommend"]}>
-              <img src={deleteIcon} />
-            </div>
-          </li>
-          <li>
-            <textarea className={style['edit-row']} name="supplement" id="" rows="6" placeholder='评估描述'></textarea>
+            <textarea className={style['edit-row']} name="supplement" rows="6" placeholder='评估描述' onInput={(e)=>handleInp(e.target.value)}></textarea>
           </li>
         </ul>
       </div>

+ 32 - 10
src/components/AssessResult/index.jsx

@@ -10,40 +10,62 @@ class AssessResult extends Component {
   constructor(props) {
     super(props);
     this.state={
-      chooseSelecteds:{}
+      chooseSelecteds:{},     //大数据选择模块
+      chartTimeTypes:{},      //图表模块
+      wholeAssessItems:props.wholeIndexs,     //整体评估模块
+      wholeAssessText:props.wholeText||''     //整体评估补充说明
     }
-    //this.handleChooseChange = this.handleChooseChange.bind(this);
+    this.handleChooseChange = this.handleChooseChange.bind(this);
+    this.handleScaleDel = this.handleScaleDel.bind(this);
+    this.handleScaleText = this.handleScaleText.bind(this);
   }
   componentWillMount(){
     //获取评估
     this.props.getAssess();
   }
-  handleScaleDel(){
-
+  handleScaleText(text){
+      this.setState({
+        wholeAssessText:text
+      })
+  }
+  handleScaleDel(i,j){
+    const items = Object.assign({},this.state.wholeAssessItems);
+    const inx = items[i].findIndex(x=>x==j);
+    items[i].splice(inx,1);
+    this.setState({
+      wholeAssessItems: items
+    });
   }
   handleChooseChange(i,selects){
     const {chooseSelecteds} = this.state;
     this.setState({
       chooseSelecteds: Object.assign(chooseSelecteds,{[i]:selects})
     });
-    console.log(this.state.chooseSelecteds)
   }
-  handleChartChange(){
-
+  handleChartChange(i,selects){
+    const {chartTimeTypes} = this.state;
+    this.setState({
+      chartTimeTypes:Object.assign(chartTimeTypes,{[i]:selects})
+    });
+  }
+  componentWillUnmount(){
+    //点确定关闭弹窗时把参数传到父组件去
+    const {handleSave,isAssessConfirm} = this.props;
+    isAssessConfirm&&handleSave(this.state);
   }
   handoutTypes(item,i){
-    const {getIndexData,indexData} =this.props;
+    const {getIndexData,indexData,timeTypes,wholeAssessData,wholeIndexs} =this.props;
     //console.log(indexData)
     const chartData = indexData;
     const name = item.regionName+":";
     const list = item.data&&item.data.rows;
     switch (+item.regionType){
       case 0:     //数据来源与右侧手动添加
-        return <ScaleItem title={name} data={list} handleChange={this.handleScaleDel}></ScaleItem>;
+        return <ScaleItem title={name} data={wholeAssessData} handleRemove={this.handleScaleDel} handleInp={this.handleScaleText} indexs={this.state.wholeAssessItems}></ScaleItem>;
       case 1:     //数据来源于大数据
         return <ChooseItem title={name} data={list} handleChange={this.handleChooseChange.bind(this,i)}></ChooseItem>;
       case 10:    //数据来源于后台
-        return <ChartItem title={name} data={chartData||{}} initFn={getIndexData} handleChange={this.handleChartChange}></ChartItem>;
+        return <ChartItem title={name} data={chartData||{}} timeTypes={timeTypes} initFn={getIndexData} handleChange={this.handleChartChange.bind(this,i)}></ChartItem>;
       default:
         return '';
     }

+ 5 - 0
src/components/AssessResult/index.less

@@ -37,10 +37,15 @@
     .row{
       display: inline-block;
     }
+    .scale{
+      color: @blue;
+      cursor: pointer;
+    }
     .recommend{
       max-width: 200px;
       float: right;
       color: #929292;
+      cursor: pointer;
     }
   }
   .edit-row{

File diff suppressed because it is too large
+ 53 - 23
src/components/ChronicInfo/index.jsx


+ 8 - 1
src/components/ChronicInfo/index.less

@@ -69,8 +69,9 @@
           color:#3B9ED0;
           cursor: pointer;
         }
-        .listResult{
+        .listResult,.addResult{
           float: right;
+          cursor: pointer;
           display: inline-block;
           width: 99px;
           height: 26px;
@@ -85,6 +86,12 @@
             margin:-3px 3px 0 0;
           }
         }
+        .addResult{
+          color: #3B9ED0;
+          text-align: left;
+          padding-left: 5px;
+          cursor: default;
+        }
         .infoBox{
           position: absolute;
           top:27px;

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

@@ -2,7 +2,7 @@
   position: absolute;
   bottom: 0px;      //页面布局
   z-index: 40;
-  width: 418px;
+  width: 450px;
   .disTips{
     padding: 10px 20px 0px 20px;
     font-size: 10px;

+ 162 - 0
src/components/Multiple/SlideItem/index.jsx

@@ -0,0 +1,162 @@
+import react from "react";
+import style from "./index.less";
+import $ from 'jquery';
+import classNames from 'classnames';
+import {handleEnter,isIE,filterArr,deepClone,filterDataArr} from '@utils/tools.js';
+import {Notify} from '@commonComp';
+import ReactDom from "react-dom";
+import config from '@config/index.js';
+/**
+  单列多选组件(tagtype=1,controlType=2)
+  2019-2-20 By_liucf
+  参数:
+  placeholder:标签名
+  value:标签选中的值
+  show:是否展示下拉
+  data:下拉数据
+  type:标识哪一项数据(1-主诉,2-现病史,3-其他史,4-查体)
+**/
+
+class Multiple extends react.Component{
+  constructor(props){
+    super(props);
+    const {seleData,seleId} = deepClone(props.selecteds||[]);
+    this.state={
+      editable:false,
+      timer:null,
+      labelVal:"",
+      seleData:seleData||"",
+      seleId:seleId||[],
+      boxLeft:null,
+      boxTop:null
+    }
+    this.$div = React.createRef();
+    this.handleSelect = this.handleSelect.bind(this);
+    this.onChange = this.onChange.bind(this);
+    this.handleBlur = this.handleBlur.bind(this);
+    this.handleClear = this.handleClear.bind(this);
+    this.handleComfirn = this.handleComfirn.bind(this);
+  }
+
+  getListClass(){
+    let name = style['text-list'];
+    let isHide = this.props.show?'':style['hide'];
+    return classNames(style['list'],name,isHide);
+  }
+
+  getSeleStyle(id){
+    const {seleId} = this.state;
+    if(seleId.includes(id)){
+      return style['selected'];
+    }
+    return '';
+  }
+
+  handleSelect(e,item){
+    e&&e.stopPropagation();
+    let {seleData,seleId} = this.state;
+    const {name,id} = item;
+    if(seleId.includes(id)){
+      seleId.splice(seleId.indexOf(id),1);
+      seleData = seleData.replace(name,'');
+    }else{
+      seleId.push(id);
+      seleData += name;
+    }
+    this.setState({
+      seleData,
+      seleId
+    })
+  }
+
+  onChange(e){
+    const {mainSaveText,ikey,type,handleLabelChange} = this.props;
+    const {labelVal,editable} = this.state;
+    let mainText = filterDataArr(mainSaveText);//主诉字数
+    if(editable){//避免IE中点击标签也会触发
+      let val = e.target.innerText || e.target.innerHTML;
+      if(+type==1){// 主诉字数达到上限时不允许输入
+        if(mainText.length >= config.limited){
+          if(val.length > labelVal.length){
+            e.target.innerText?(e.target.innerText = labelVal):(e.target.innerHTML = labelVal);
+            Notify.info(config.limitText);
+            return
+          }else if(val.length == labelVal.length){
+            this.setState({
+              labelVal:val
+            });
+          }else{
+            handleLabelChange && handleLabelChange({ikey,changeVal:val,type});
+          }
+        }
+      }
+    }
+  }
+
+  handleBlur(e){//修改存值
+    e.stopPropagation();
+    const {ikey,type,handleLabelChange} = this.props;
+    const {editable} = this.state;
+    const ev = e || window.event;
+    if(editable){
+      // 更改标签的value值
+      let changeVal = ev.target.innerText || e.target.innerHTML;
+      if(!isIE()){
+        e.target.innerText?(e.target.innerText = ''):(e.target.innerHTML='');      //避免出现重复输入值
+      }
+      handleLabelChange && handleLabelChange({ikey,changeVal,type});
+    }
+    this.setState({
+      editable:false
+    });
+  }
+
+  handleClear(e){
+    e&&e.stopPropagation();
+    this.setState({
+      seleData:"",
+      seleId:[]
+    })
+  }
+
+  handleComfirn(e){
+    e&&e.stopPropagation();
+    const {handleConfirm,ikey,order,mainSaveText,value,handleHide,type} = this.props;
+    const params = Object.assign({},this.state,{ikey,order,mainSaveText,value,type});
+    handleConfirm&&handleConfirm(params);
+    handleHide&&handleHide();
+  }
+
+  componentDidMount(){
+    if(isIE()){
+      $(this.$div.current).onIe8Input(function(e){
+        this.onChange(e)
+      },this);
+    }
+  }
+  getStyle(){
+    const {left,top,show} = this.props;
+    return {
+      left:left?left+'px':'0',
+      top:top?top+'px':'0',
+      display:show?'table':'none'        //table onBlur阻止冒泡是为了修复multSpread中数字键盘点击触发最外层数字组件onBlur事件
+    }
+  }
+  render(){
+    const {placeholder,value,show,data} = this.props;
+    const {editable,boxTop,boxLeft} = this.state;
+    const domNode = document.getElementById('root');
+    return ReactDom.createPortal(
+      <div className={this.getListClass()} style={this.getStyle()} contentEditable="false">
+        <ul>
+          {data&&data.map((it)=>{
+          return <li onClick={(e)=>this.handleSelect(e,it)} className={this.getSeleStyle(it.id)} title={it.name.length>8?it.name:''}>{it.name&&it.name.length>8?it.name.slice(0,8)+'...':it.name}</li>
+        })}
+          <li onClick={this.handleClear} className={style['mClear']}>清空选项</li>
+          <li onClick={this.handleComfirn} className={style['mConfirm']}>确定</li>
+        </ul>
+      </div>,domNode)
+  }
+}
+
+export default Multiple;

+ 53 - 0
src/components/Multiple/SlideItem/index.less

@@ -0,0 +1,53 @@
+@import "~@less/mixin.less";
+.container{
+  display: inline-block;
+}
+.selected{
+    .select-li;
+  }
+.tag,.selected-tag{
+  cursor: pointer;
+  line-height: 20px;
+}
+
+.selected-tag{
+  padding: 0;
+  color: @text-color;
+  border-bottom: 1px @border-color solid;
+  line-height: 22px;
+}
+.hide-tag{
+  padding: 0;
+  color: @text-color;
+  line-height: 22px;
+}
+.list{
+  .pop;
+  padding: 0 0 10px;
+  color: @text-color;
+  li{
+    height: 32px;
+    line-height: 32px;
+    border:1px #fff solid;
+    padding: 0 20px;
+    white-space: nowrap;
+    cursor: pointer;
+  }
+  // li:hover,.selected{
+  li:hover{
+    border-color:#3B9ED0;
+  }
+}
+.hide{
+  display: none;
+}
+
+.mClear{
+  color:red;
+}
+.mConfirm{
+  color: #3B9ED0;
+  text-align: center;
+  border: 1px solid #3B9ED0;
+
+}

+ 28 - 24
src/components/Multiple/index.jsx

@@ -2,8 +2,9 @@ import react from "react";
 import style from "./index.less";
 import $ from 'jquery';
 import classNames from 'classnames';
-import {handleEnter,isIE,filterArr,deepClone,filterDataArr} from '@utils/tools.js';
+import {handleEnter,isIE,filterArr,deepClone,filterDataArr,getPageCoordinate} from '@utils/tools.js';
 import {Notify} from '@commonComp';
+import SlideItem from "./SlideItem";
 import config from '@config/index.js';
 /**
   单列多选组件(tagtype=1,controlType=2)
@@ -27,7 +28,9 @@ class Multiple extends react.Component{
       seleData:seleData||"",
       seleId:seleId||[],
       boxLeft:null,
-      boxTop:null
+      boxTop:null,
+      tmpScroll:null,
+      tmpTop:null
     }
     this.$div = React.createRef();
     this.handleShow = this.handleShow.bind(this);
@@ -36,7 +39,6 @@ class Multiple extends react.Component{
     this.onChange = this.onChange.bind(this);
     this.handleBlur = this.handleBlur.bind(this);
     this.handleClear = this.handleClear.bind(this);
-    this.handleComfirn = this.handleComfirn.bind(this);
   }
 
   getClass(){
@@ -73,8 +75,16 @@ class Multiple extends react.Component{
     const ht = e.target.offsetHeight;   //如杂音选中文字有多行时,写死会遮挡
     let boxTop = offsetTop + ht +2 + 'px';
     this.setState({
-      boxLeft:boxLeft,
-      boxTop:boxTop
+      boxLeft:getPageCoordinate(e).boxLeft,
+      boxTop:getPageCoordinate(e).boxTop,
+      tmpScroll: $("#addScrollEvent")[0].scrollTop,
+      tmpTop:getPageCoordinate(e).boxTop
+    })
+    $("#addScrollEvent").scroll(()=>{
+      let scrollYs = $("#addScrollEvent")[0].scrollTop;
+      this.setState({
+        boxTop:this.state.tmpTop - scrollYs + this.state.tmpScroll
+      })
     })
      this.setStateInit();
     const {ikey,handleShow,placeholder,flag,id,value,tagType,type} = this.props;
@@ -181,14 +191,6 @@ class Multiple extends react.Component{
     })
   }
 
-  handleComfirn(e){
-    e&&e.stopPropagation();
-    const {handleConfirm,ikey,order,mainSaveText,value,handleHide,type} = this.props;
-    const params = Object.assign({},this.state,{ikey,order,mainSaveText,value,type});
-    handleConfirm&&handleConfirm(params);
-    handleHide&&handleHide();
-  }
-
   componentDidMount(){
     if(isIE()){
       $(this.$div.current).onIe8Input(function(e){
@@ -196,9 +198,8 @@ class Multiple extends react.Component{
       },this);
     }
   }
-
   render(){
-    const {placeholder,value,show,data} = this.props;
+    const {placeholder,value,show,data,handleConfirm,ikey,order,mainSaveText,handleHide,type} = this.props;
     const {editable,boxTop,boxLeft} = this.state;
     return <div className={style["container"]}>
       <div className={this.getClass()}
@@ -209,15 +210,18 @@ class Multiple extends react.Component{
       onInput={this.onChange}
       onkeydown={handleEnter}
       contentEditable={editable}>{value||placeholder}</div>
-      <div className={this.getListClass()} style={{top:boxTop,left:boxLeft}} contentEditable="false">
-        <ul>
-          {data&&data.map((it)=>{
-          return <li onClick={(e)=>this.handleSelect(e,it)} className={this.getSeleStyle(it.id)} title={it.name.length>8?it.name:''}>{it.name&&it.name.length>8?it.name.slice(0,8)+'...':it.name}</li>
-        })}
-          <li onClick={this.handleClear} className={style['mClear']}>清空选项</li>
-          <li onClick={this.handleComfirn} className={style['mConfirm']}>确定</li>
-        </ul>
-        
+      <div className={this.getListClass()} contentEditable="false">
+        <SlideItem 
+          show={show} 
+          left={boxLeft} 
+          top={boxTop} 
+          data={data} 
+          handleConfirm={handleConfirm} 
+          ikey={ikey}
+          order={order}
+          mainSaveText={mainSaveText}
+          handleHide={handleHide}
+          type={type}></SlideItem>
       </div>
     </div>
   }

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

@@ -160,7 +160,7 @@ class PushItems extends Component {
       tips,
       tmpFlg,
     } = this.props.pushMessage;
-    const { tipsDiscalimer,chronicPushItems} = this.props;
+    const { tipsDiscalimer,chronicPushItems,wholeIndexs} = this.props;
     const { moreAssay, moreCheck ,show} = this.state;
     const {
       showMore,
@@ -422,7 +422,7 @@ class PushItems extends Component {
                 )}
               </div>
             </div>
-            {chronicPushItems&&chronicPushItems.length>0?<ChronicInfo data={chronicPushItems}></ChronicInfo>:''}
+            {chronicPushItems&&chronicPushItems.length>0?<ChronicInfo data={chronicPushItems} indexs={wholeIndexs}></ChronicInfo>:''}
             <div className={style["tips"]}>
               <h1>
                 <img src={tipsImg} />

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

@@ -101,11 +101,11 @@ class RadioDrop extends Component{
     },$("#addScrollEvent")[0])
   }
   componentDidMount(){    //默认值选中
-    const {data,ikey,handleSelect,hideTag,mainSaveText,value} = this.props;
+    const {data,ikey,handleSelect,hideTag,mainSaveText,value,boxMark} = this.props;
     const selected = data.find((it)=>{
       return it.selected === undefined&&+it.defaultSelect===1;
     });
-    if(!hideTag&&selected){
+    if(boxMark!=1&&!hideTag&&selected){
       // const text = selected.labelPrefix+selected.name+selected.labelSuffix;
       const text = selected.name;
       handleSelect&&handleSelect({ikey,id:selected.id,text,mainSaveText,value});
@@ -144,7 +144,7 @@ class RadioDrop extends Component{
     handleDbclick&&handleDbclick({id:patId||id});
   }
   render(){
-    const {data,prefix,suffix,placeholder,show,value,hideTag} = this.props;
+    const {data,prefix,suffix,placeholder,show,value,hideTag,boxMark} = this.props;
     const {boxLeft,boxTop} = this.state;
     return <div className={style['container']} ref = {this.$cont}>
       {prefix}
@@ -157,7 +157,7 @@ class RadioDrop extends Component{
         {value||placeholder}
       </div>
       {suffix}
-      <DropList onSelect={this.handleSelect} data={data} left={boxLeft} top={boxTop} show={show} hideTag={hideTag}/>
+      <DropList onSelect={this.handleSelect} boxMark={boxMark} data={data} left={boxLeft} top={boxTop} show={show} hideTag={hideTag}/>
     </div>
   }
 }

+ 35 - 57
src/components/TemplateItems/TemplateItem/index.jsx

@@ -10,7 +10,6 @@ import edit_icon from './img/edit_grey.png';
 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 Notify from '@commonComp/Notify';
 import store from '@store'
 import {checkItems} from '@store/actions/tabTemplate';
 import $ from 'jquery';
@@ -19,72 +18,27 @@ class TemplateItem extends React.Component {
     constructor() {
         super();
         this.content = null;
-        this.isAnimate = false;
         this.state = {
-            isOpen: false,
             delHover: false,
             editHover: false,
             checkBox:false,
-            bgColor:false
+            bgColor:false,
         };
         this.titleDOM = null;
         this.isConfirmClick = false;
         this.timer = null;
-    }
-    genContent() {
-        const {preview} = this.props;
-        this.title = '';
-        let DesItems = [];
-        for(var a in previewJson){
-            DesItems.push(<DesItem preview={preview} des={a} />);            
-        }
-        // if(previewJson){
-        //     console.log(previewJson,1000)
-        //     previewJson.forEach((v, i) => {
-        //         DesItems.push(<DesItem des={v} key={i} />);
-        //         this.title += `${v}\n`;
-        //     });
-        // }
-        return DesItems;
+        this.handleTitleClick = this.handleTitleClick.bind(this)
     }
 
     getArrow() {
         return this.state.isOpen ? arrow_down_icon : arrow_icon;
     }
 
-    getContentStyle() {
-        return {
-            display: this.state.isOpen ? 'block' : 'none'
-        }
-    }
-
     handleContentClick(e,sex) {
         e.stopPropagation();
         this.props.handleContentClick(this.props.id,sex);
     }
 
-    handleTitleClick() {
-        if (this.isAnimate) {
-            return;
-        }
-        this.isAnimate = true;
-        if (this.state.isOpen) {
-            $(this.content).slideUp(() => {
-                this.isAnimate = false;
-                this.setState({
-                    isOpen: false
-                });
-            });
-            // console.log($(this.content).parent().siblings().find('.content'))
-            return;
-        }
-        $(this.content).slideDown(() => {
-            this.isAnimate = false;
-            this.setState({
-                isOpen: true
-            });
-        });
-    }
     handleCheckboxClick(e,id){          //点击复选框
         e.stopPropagation();
         let tempCheck = this.state.checkBox;
@@ -157,6 +111,36 @@ class TemplateItem extends React.Component {
         this.titleDOM.innerHTML = this.props.title;
     }
 
+    handleTitleClick(e) {
+      if($(e.target).attr('src')){
+        let tmpDomLis = $(e.target).parent().parent().siblings()
+        $(e.target).parent().next().slideToggle()
+        if($(e.target).parent().next().height() == 0){
+          $(e.target).attr('src',arrow_down_icon)
+        }else{
+          $(e.target).attr('src',arrow_icon)
+        }
+        for(let i = 0;i < tmpDomLis.length;i++){
+          let tmpDiv = tmpDomLis[i]
+          $(tmpDiv).children().eq(1).slideUp()
+          $(tmpDiv).children().eq(0).children('img').eq(0).attr('src',arrow_icon)
+        }
+      }else{
+        let tmpDomLis = $(e.target).parent().siblings()
+        $(e.target).next().slideToggle()
+        if($(e.target).next().height() == 0){
+          $(e.target).children('img').eq(0).attr('src',arrow_down_icon)
+        }else{
+          $(e.target).children('img').eq(0).attr('src',arrow_icon)
+        }
+        for(let i = 0;i < tmpDomLis.length;i++){
+          let tmpDiv = tmpDomLis[i]
+          $(tmpDiv).children().eq(1).slideUp()
+          $(tmpDiv).children().eq(0).children('img').eq(0).attr('src',arrow_icon)
+        }
+      }
+    }
+
     render() {
         const { allCheckShow,id,name,preview,sex } = this.props;
         let previewJson = JSON.parse(preview);
@@ -167,7 +151,7 @@ class TemplateItem extends React.Component {
                     allCheckShow?
                     `${style["title-wrapper"]} ${style["clearfix"]} ${style[this.getCheckIcon()[1]]}`:
                     `${style["title-wrapper"]} ${style["clearfix"]}`} 
-                    onClick={() => this.handleTitleClick()}
+                    onClick={this.handleTitleClick}
                 >
                     {
                         allCheckShow?<div className={style['check-wrap']} onClick={(e)=>{this.handleCheckboxClick(e,id)}}>
@@ -182,9 +166,9 @@ class TemplateItem extends React.Component {
                     >
                         {name+sexStr}
                     </span>
-                    <img className={style.arrow} src={this.getArrow()} />
+                    <img className={style.arrow} src={arrow_icon} />
                     <img title={'删除模板'} 
-                        className={style.del} 
+                        className={style.del}
                         style={{display:allCheckShow?'none':'block'}}
                         src={this.getDelIcon()} 
                         onMouseEnter={() => this.handleDelIconMouseEnter()}
@@ -204,21 +188,15 @@ class TemplateItem extends React.Component {
                     ref={(content) => this.content = content}
                     className={style.content}
                     title={this.title}
-                    style={this.getContentStyle()}
                 >
                     {
                         previewJson?<DesItem preview={previewJson}></DesItem>:<p>暂无数据</p>
                     }
-                    
                 </div>
             </div>
         )
     }
 
-    componentDidUpdate() {
-        this.isAnimate = false;
-    }
-
     componentWillUnmount() {
         clearTimeout(this.timer);
     }

+ 2 - 0
src/components/TemplateItems/TemplateItem/index.less

@@ -14,6 +14,7 @@
 //   margin-bottom: 5px;
   border: 1px solid #fff;
   &:hover{
+    border: 1px solid @blue-background-color;
     border: 1px solid @blue-background-color;
     .title{
       color:@blue-background-color;
@@ -131,5 +132,6 @@
     width: 100%;
     box-sizing: border-box;
     cursor: pointer;
+    display: none;
   }
 }

+ 2 - 1
src/components/TemplateItems/index.jsx

@@ -27,11 +27,12 @@ class TemplateItems extends React.Component {
     }
     genItems() {
         const Items = [];
-        this.props.items.forEach((v) => {
+        this.props.items.forEach((v,idx) => {
             Items.push(
                 <TemplateItem
                     {...v}
                     key={v.id}
+                    idx={idx}
                     checkItems={this.props.checkItems}
                     allCheckShow={this.props.allCheckShow}
                     handleContentClick={this.props.handleContentClick}

+ 69 - 0
src/components/Treat/AdverseReactions/index.jsx

@@ -0,0 +1,69 @@
+import React, { Component } from 'react';
+import style from './index.less';
+import info2 from './../img/info2.png';
+import info3 from './../img/info3.png';
+import $ from "jquery";
+
+class AdverseReactions extends Component {
+    constructor(props){
+        super(props);
+        this.state = {
+            currentIndex: -1
+        }
+        this.handleMouseLeaveDrug = this.handleMouseLeaveDrug.bind(this);
+        this.handleMouseLeaveImg = this.handleMouseLeaveImg.bind(this);
+        this.setDrugInfo = this.setDrugInfo.bind(this);
+    }
+    handleMouseEnterDrug(index, item) {
+        const drugNameWidth = parseInt($('#'+item.medicitionName)[0].offsetWidth)
+        const imgLeft = drugNameWidth/2-8
+        $('#'+item.medicitionName).find('img').css('left', imgLeft)
+        this.setState({
+            currentIndex: index,
+        })
+    }
+    handleMouseLeaveDrug() {
+        this.setState({
+            currentIndex: -1, 
+        })
+    }
+    handleMouseEnterImg() {
+        this.setState({
+            hasEnterImg: true
+        })
+    }
+    handleMouseLeaveImg() {
+        this.setState({
+            hasEnterImg: false
+        })
+    }
+    setDrugInfo(item) {
+        const { setDrugInfo } = this.props;
+        setDrugInfo && setDrugInfo(item);
+    }
+
+
+    render() {
+        const { icon, titleStyle,titleBg, filter, title, showDrugInfo, setDrugInfo, adversReactionList } = this.props
+        return(
+            <div className={style['last-treat-wrapper']}>
+                { console.log('adversReactionList', adversReactionList) }
+                <div className={style['last-treat-title-box']} style={titleStyle}></div>
+                <div className={style['last-treat-title']} ><img className={style['last-treat-icon']} src={icon}/>{title}</div>
+                {adversReactionList.map((item, index) => {
+                    return (<div key={item.id}><span>{item.tagName}:</span>
+                        {item.details.map((item, index) => {
+                            return <span key={item.name}>
+                                <input type="checkbox" checked={item.checked} id={item.name} onChange={()=>{console.log('change')}}/>
+                                <label for={item.name}> {item.name} </label>
+                            </span>
+                        })}
+                    </div>)
+                })}
+            </div>
+        )
+    }
+
+}
+
+export default AdverseReactions;

+ 27 - 0
src/components/Treat/AdverseReactions/index.less

@@ -0,0 +1,27 @@
+.last-treat-wrapper {
+    position: relative;
+    padding: 10px 0 0 0;
+}
+.last-treat-title-box {
+    height: 36px;
+    line-height: 36px;
+    background: rgb(47,199,156);
+    opacity: 0.1;
+    filter:alpha(opacity=10);
+    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=10);";
+}
+.last-treat-title {
+    position: absolute;
+    width: 100%;
+    top: 10px;
+    height: 36px;
+    line-height: 36px;
+    font-weight: bold;
+}
+.last-treat-icon {
+    width: 16px;
+    float: left;
+    margin: 10px;
+}
+
+

+ 77 - 0
src/components/Treat/LastTreat/LastDrug/index.jsx

@@ -0,0 +1,77 @@
+import React, { Component } from 'react';
+import style from './index.less';
+import info2 from './../../img/info2.png';
+import info3 from './../../img/info3.png';
+import $ from "jquery";
+
+class LastDrug extends Component {
+    constructor(props){
+        super(props);
+        this.state = {
+            currentIndex: -1
+        }
+        this.handleMouseLeaveDrug = this.handleMouseLeaveDrug.bind(this);
+        this.handleMouseLeaveImg = this.handleMouseLeaveImg.bind(this);
+        this.setDrugInfo = this.setDrugInfo.bind(this);
+    }
+    handleMouseEnterDrug(index, item) {
+        const drugNameWidth = parseInt($('#'+item.medicitionName)[0].offsetWidth)
+        const imgLeft = drugNameWidth/2-8
+        $('#'+item.medicitionName).find('img').css('left', imgLeft)
+        this.setState({
+            currentIndex: index,
+        })
+    }
+    handleMouseLeaveDrug() {
+        this.setState({
+            currentIndex: -1, 
+        })
+    }
+    handleMouseEnterImg() {
+        this.setState({
+            hasEnterImg: true
+        })
+    }
+    handleMouseLeaveImg() {
+        this.setState({
+            hasEnterImg: false
+        })
+    }
+    setDrugInfo(item) {
+        const { setDrugInfo } = this.props;
+        setDrugInfo && setDrugInfo(item);
+    }
+
+
+    render() {
+        const { icon, titleStyle,titleBg, filter, title, lastDrugList, showDrugInfo } = this.props
+        const  { currentIndex, hasEnterImg } = this.state
+        return(
+             <div className={style['last-common-box']}>
+                <div className={style['last-common-title']}>{title}</div>
+                <div className={style['last-common-list']}>
+                    {lastDrugList.map((item, index) => {
+                        return<span
+                            onMouseEnter={this.handleMouseEnterDrug.bind(this, index, item)}
+                            onMouseLeave = {this.handleMouseLeaveDrug}
+                            id={item.medicitionName}
+                            className={style['last-common-warpper']}
+                            > 
+                            {item.medicitionName} 
+                            {<img className={style['info-img']}  
+                                style ={currentIndex === index  ? {display: "inline-block"} : {display: "none"}}
+                                src={currentIndex === index ?(hasEnterImg ? info3 : info2 ): info2} 
+                                onMouseEnter={this.handleMouseEnterImg.bind(this)}
+                                onMouseLeave = {this.handleMouseLeaveImg}
+                                onClick={() =>{this.setDrugInfo(item);showDrugInfo();}}/>}
+                            {index == lastDrugList.length-1 ?  '' : <span>,</span>}
+                        </span>
+                    })}
+                </div>
+            </div>
+        )
+    }
+
+}
+
+export default LastDrug;

+ 14 - 0
src/components/Treat/LastTreat/LastDrug/index.less

@@ -0,0 +1,14 @@
+.last-common-title {
+    height: 30px;
+    line-height: 30px;
+}
+.last-common-warpper {
+    position: relative;
+    margin: 0 20px 0 0
+}
+.info-img {
+    position: absolute;
+    width: 15px;
+    position: absolute;
+    top: -15px;
+}

+ 34 - 0
src/components/Treat/LastTreat/index.jsx

@@ -0,0 +1,34 @@
+import React, { Component } from 'react';
+import style from './index.less';
+import LastDrug from './LastDrug/index.jsx';
+import info2 from './../img/info2.png';
+import info3 from './../img/info3.png';
+import $ from "jquery";
+
+class LastTreat extends Component {
+    constructor(props){
+        super(props);
+        this.state = {
+            currentIndex: -1
+        }
+    }
+   
+
+    render() {
+        const { icon, titleStyle,titleBg, filter, title, lastTreat, showDrugInfo, setDrugInfo } = this.props
+        const { chronicDisMedica, commonDisMedica } = lastTreat
+        return(
+            chronicDisMedica && chronicDisMedica.length > 0 && commonDisMedica && commonDisMedica.length > 0 &&
+            <div className={style['last-treat-wrapper']}>
+                {console.log('lasttreatTreat', lastTreat)}
+                <div className={style['last-treat-title-box']} style={titleStyle}></div>
+                <div className={style['last-treat-title']} ><img className={style['last-treat-icon']} src={icon}/>{title}</div>
+                {commonDisMedica.length > 0 && <LastDrug title='普通病用药内容' lastDrugList = {commonDisMedica}  showDrugInfo={showDrugInfo} setDrugInfo={setDrugInfo}></LastDrug>}
+                {chronicDisMedica.length > 0 && <LastDrug title='慢病用药内容' lastDrugList = {chronicDisMedica}  showDrugInfo={showDrugInfo} setDrugInfo={setDrugInfo}></LastDrug>}
+            </div>
+        )
+    }
+
+}
+
+export default LastTreat;

+ 27 - 0
src/components/Treat/LastTreat/index.less

@@ -0,0 +1,27 @@
+.last-treat-wrapper {
+    position: relative;
+    padding: 10px 0 0 0;
+}
+.last-treat-title-box {
+    height: 36px;
+    line-height: 36px;
+    background: rgb(47,199,156);
+    opacity: 0.1;
+    filter:alpha(opacity=10);
+    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=10);";
+}
+.last-treat-title {
+    position: absolute;
+    width: 100%;
+    top: 10px;
+    height: 36px;
+    line-height: 36px;
+    font-weight: bold;
+}
+.last-treat-icon {
+    width: 16px;
+    float: left;
+    margin: 10px;
+}
+
+

+ 5 - 1
src/components/Treat/index.jsx

@@ -2,6 +2,8 @@ import React,{ Component } from 'react';
 import style from './index.less';
 import GeneralTreat from './GeneralTreat/index.jsx';
 import DrugTreat from './DrugTreat/index.jsx';
+import LastTreat from './LastTreat/index.jsx';
+import AdverseReactions from './AdverseReactions/index.jsx';
 import TreatDesc from '@components/TreatDesc'
 import {dragBox,windowRemoveEventHandler} from '@utils/tools'
 import DrugInfo from '@components/TreatDesc/DrugInfo';
@@ -51,7 +53,7 @@ class Treat extends Component {
       $('#drugWrapper').css({'z-index': 301});
     }
     render(){
-        const {setDrugInfoMore,treatIndex,treatIndexSet, generalTreat, treatment, treatItem, surgeryTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title, drugInfoList, hideDrugInfoMore} = this.props;
+        const {setDrugInfoMore,treatIndex,treatIndexSet, generalTreat, treatment, treatItem, surgeryTreat, lastTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title, drugInfoList, hideDrugInfoMore, adversReactionList} = this.props;
         const { zIndex,show } = this.state
         return(
             <div   className={style['treat-wrapper']}>
@@ -63,6 +65,8 @@ class Treat extends Component {
 
                     <div className={style['treat-inner-box']}>
                         <GeneralTreat icon={generalIcon} title='一般治疗'   generalTreat={generalTreat}></GeneralTreat>
+                        {/* <LastTreat icon={generalIcon} title='上次用药情况' lastTreat={lastTreat}  showDrugInfo = {showDrugInfo} setDrugInfo={ setDrugInfo }></LastTreat>
+                        <AdverseReactions icon={generalIcon} title='不良反应' adversReactionList = {adversReactionList}></AdverseReactions> */}
                         <DrugTreat treatment={ treatment } 
                                 selectDrug={selectDrug} 
                                 setOtherRecommend={ setOtherRecommend } 

+ 1 - 0
src/config/index.js

@@ -54,6 +54,7 @@ export default {
       year:"年",
       age:"岁",
     },
+    chartDismen:'year',   //评估图表默认维度:近1年year,近6个月sixMonth,近1个月month,近1周week
     showCheckNum:16,        //查体默认展开非自由文本标签的个数
     radioOptionPer:'()',     //单选项输入占位符
     textReg:new RegExp("([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[a-zA-Z0-9])"), //包含中英文或数字

+ 39 - 16
src/containers/AssessResult.js

@@ -4,7 +4,7 @@ import AssessResult from '@components/AssessResult';
 import {ISREAD} from '@store/types/homePage.js';
 import {billing} from '@store/async-actions/pushMessage';
 import {getAssessData,getIndexData} from '@store/async-actions/fetchModules';
-import {SET_ASSESS_DATA,SET_INDEX_DATA} from '@types/assessResult';
+import {SET_ASSESS_DATA,SET_INDEX_DATA,SET_INDEX_SUB_TYPE,REMOVE_ASSESS_ITEMS} from '@types/assessResult';
 import store from '@store';
 
 /***
@@ -17,14 +17,18 @@ import store from '@store';
  *
  * ***/
 
-function mapStateToProps(state) {
-  //console.log(state)
+function mapStateToProps(state) {console.log(state)
   const {assessResult} = state;
   return {
     data:assessResult.data,
     indexData:assessResult.indexData,
     saveIndexData:assessResult.saveIndexData,
-    saveData:assessResult.saveData
+    saveData:assessResult.saveData,
+    update:assessResult.update,
+    update1:assessResult.update1,
+    timeTypes:assessResult.indexTimeTypes,
+    wholeAssessData:assessResult.wholeAssess,
+    wholeIndexs:assessResult.wholeIndexs
   }
 }
 
@@ -42,23 +46,42 @@ function mapDispatchToProps(dispatch) {
         console.log(error);
       });
     },
-    getIndexData(){
+    getIndexData(param){
       const state=store.getState();
+      const {range,rangeType,index} = param;
       const indexData = state.assessResult.indexData;
-      if(Object.keys(indexData).length!=0){
+      const obj = indexData[range[0]+range[range.length-1]];
+
+      if(index!=undefined&&obj&&Object.keys(obj).length!=0){      //该维度已获取过数据
+        //console.log(obj,rangeType,index);
+        /*dispatch({
+          type:SET_INDEX_SUB_TYPE,
+          index,
+          rangeType
+        });*/
         return ;
       }
-      dispatch(getIndexData()).then((res)=>{
+      dispatch(getIndexData(range)).then((res)=>{
         if(res.data.code=='0'){
           dispatch({
             type:SET_INDEX_DATA,
-            data:parseChartData(res.data.data)
-          })
+            data:parseChartData(res.data.data),
+            range,
+            index,
+            rangeType
+          });
         }
       }).catch(error=>{
         console.log(error);
       });
-    }
+    },
+    /*removeAssessResult(pIndex,i){
+      dispatch({
+        type:REMOVE_ASSESS_ITEMS,
+        pIndex,
+        index:i
+      });
+    }*/
   }
 }
 
@@ -68,12 +91,12 @@ function parseChartData(indexData){
   if(!indexData){
     return [];
   }
-  indexData.indexConfigData.map((it)=>{
-    arr=obj[it.orderNo]||[];
-    nameArr=nameObj[it.orderNo]||[];
-    temp=indexData.itemIndexData.find((i)=>{return i.itemName==it.indexUnique});
-    obj[it.orderNo]=[...arr,temp];
-    nameObj[it.orderNo]=[...nameArr,it.indexUnique];
+  indexData.itemIndexData.map((it)=>{
+    temp=indexData.indexConfigData.find((i)=>{return it.itemName==i.indexUnique});
+    arr=obj[temp.orderNo]||[];
+    nameArr=nameObj[temp.orderNo]||[];
+    obj[temp.orderNo]=[...arr,it];
+    nameObj[temp.orderNo]=[...nameArr,it.itemName];
   });
   //nameObj,obj;
   return obj;

+ 16 - 0
src/containers/ChronicInfo.js

@@ -2,6 +2,7 @@ import {connect} from 'react-redux';
 import ChronicInfo from '../components/ChronicInfo';
 import {SHOW_TABLE_LIST,HIDE_TABLE_LIST} from '@store/types/pushMessage';
 import {getTableList,getScaleInfo} from '../store/async-actions/pushMessage';
+import {ADD_ASSESS_ITEMS,SET_SAVE_ASSESS_DATA} from "@types/assessResult";
 
 function mapStateToProps(state){
   return{
@@ -11,6 +12,7 @@ function mapStateToProps(state){
     showList: state.pushMessage.showList,
     scaleInfo: state.pushMessage.scaleInfo,//量表明细
     chronicDesease:state.mainSuit.chronicDesease,//主诉存的慢病
+    update:state.assessResult.update1
   }
 }
 
@@ -25,6 +27,20 @@ function mapDispatchToProps(dispatch){
     },
     getScaleInfo(item){
       dispatch(getScaleInfo(item))
+    },
+    addAssessItem(row,pIndex,i){         //加入评估记录
+      let obj = Object.assign({},row);
+      //obj.details[i].add=true;
+      dispatch({
+        type:ADD_ASSESS_ITEMS,
+        data:obj,
+        index:pIndex,
+        subIndex:i
+      })
+    },
+    //保存管理评估
+    saveAssessInfos(obj){
+      dispatch(Object.assign({},obj,{type:SET_SAVE_ASSESS_DATA}));
     }
   }
 }

+ 9 - 6
src/containers/PushItemsContainer.js

@@ -7,14 +7,17 @@ import {billing, getTips, getTipsDetails,getTableList} from '../store/async-acti
 import { isAddMainSuit } from '@store/async-actions/diagnosticList';
 
 function mapStateToProps(state) {
+  const {pushMessage,diagnosticList} = state;
         return {
-        pushMessage: state.pushMessage,
+        pushMessage: pushMessage,
         tipsDiscalimer:  state.copyRight.disContent,
-        chronicMagItem: state.diagnosticList.chronicMagItem,
-        questionId: state.diagnosticList.clickDiag,
-        tableList: state.pushMessage.tableList,
-        showList: state.pushMessage.showList,
-        chronicPushItems: state.pushMessage.chronicPushItems,
+        chronicMagItem: diagnosticList.chronicMagItem,
+        questionId: diagnosticList.clickDiag,
+        tableList: pushMessage.tableList,
+        showList: pushMessage.showList,
+        chronicPushItems: pushMessage.chronicPushItems,
+        wholeIndexs:state.assessResult.wholeIndexs,
+        update:state.assessResult.update1
     }
 }
 

+ 11 - 9
src/containers/Treat.js

@@ -8,16 +8,18 @@ import { showDrugInfo } from '../store/actions/treat';
 
 
 function mapStateToProps(state){
-    const { treat } = state;
+    const { treatment, generalTreat, surgeryTreat, lastTreat, adversReactionList, treatDesc, drugInfo, showDrugInfo, treatItem , drugInfoList} = state.treat;
     return {
-        treatment: treat.treatment,
-        generalTreat: treat.generalTreat,
-        surgeryTreat: treat.surgeryTreat,
-        treatDesc: treat.treatDesc,
-        drugInfo: treat.drugInfo,
-        showDrug: treat.showDrugInfo,
-        treatItem: treat.treatItem,
-        drugInfoList: treat.drugInfoList,   //药品说明书列表(查询多个药品说明书)
+        treatment: treatment,
+        generalTreat: generalTreat,
+        surgeryTreat: surgeryTreat,
+        lastTreat: lastTreat,
+        adversReactionList: adversReactionList,
+        treatDesc: treatDesc,
+        drugInfo: drugInfo,
+        showDrug: showDrugInfo,
+        treatItem: treatItem,
+        drugInfoList: drugInfoList,   //药品说明书列表(查询多个药品说明书)
 
     }
 }

+ 29 - 31
src/store/actions/currentIll.js

@@ -758,15 +758,21 @@ export function insertLabelData(state,action){
   let focusIndex = res.focusIndex;
   let saveText = res.saveText;
   let banIdx = saveText.indexOf("伴");
-  
+  //伴随展开数据-过滤了连续标点
+  const FilteredDotMapping2=formatContinueDots(data.questionMapping.filter((item)=>{
+    return item.symptomType==0||item.symptomType==2;
+  }));
+  //主症状展开数据-过滤连续了标点
+  const FilteredDotMapping1=formatContinueDots(data.questionMapping.filter((item)=>{
+    return item.symptomType==0||item.symptomType==1;
+  }));
   if(isReplace){
     span.current.innerText?(span.current.innerText = ''):(span.current.innerHTML = '');
     // res.data.splice(focusIndex,1,text,data);
     // 搜索结果展开伴随symptomType==2的尾巴
+
     let resData = JSON.parse(JSON.stringify(res.data));
-    resData.splice(focusIndex,1,text,...(data.questionMapping.filter((item)=>{
-                              return item.symptomType==0||item.symptomType==2;
-                            })));
+    resData.splice(focusIndex,1,text,...(FilteredDotMapping2));
     res.data = fullfillText(resData).newArr;
     res.saveText[focusIndex] = searchData;
   }else{
@@ -780,55 +786,45 @@ export function insertLabelData(state,action){
       res.symptomIds.push(id);
       // 没有伴展开主诉symptomType=0/1的尾巴,有伴一>第一个点选上去的伴为依据,伴前展开主诉,伴后展开伴随;多余的伴以及手动输入的伴不做处理(2-25)
       if(banIdx==-1){
+
         // if(strIndex <= 1){//前
         if(strIndex < 1){//前
-          res.data.splice(index,1,text,...(data.questionMapping.filter((item)=>{
-                                   return item.symptomType==0||item.symptomType==1;
-                                })),pText);
+          res.data.splice(index,1,text,...(FilteredDotMapping1),pText);
           res.saveText = fullfillText(res.data).saveText;
-          res.selecteds.splice(index,1,null,...new Array(data.questionMapping.length).fill(null),null);
+          res.selecteds.splice(index,1,null,...new Array(FilteredDotMapping1.length).fill(null),null);
         }else{
-          res.data.splice(index,1,pText,text,...(data.questionMapping.filter((item)=>{
-                                   return item.symptomType==0||item.symptomType==1;
-                                })));
+          res.data.splice(index,1,pText,text,...(FilteredDotMapping1));
           res.saveText = fullfillText(res.data).saveText;
-          res.selecteds.splice(index,1,null,null,...new Array(data.questionMapping.length).fill(null));
+          res.selecteds.splice(index,1,null,null,...new Array(FilteredDotMapping1.length).fill(null));
         }
       }else{
         if(focusIndex > banIdx){//伴后
           if(strIndex < 1){//前
-            res.data.splice(index,1,text,...(data.questionMapping.filter((item)=>{
-                                   return item.symptomType==0||item.symptomType==2;
-                                })),pText);
+            res.data.splice(index,1,text,...(FilteredDotMapping2),pText);
             res.saveText = fullfillText(res.data).saveText;
-            res.selecteds.splice(index,1,null,...new Array(data.questionMapping.length).fill(null),null);
+            res.selecteds.splice(index,1,null,...new Array(FilteredDotMapping2.length).fill(null),null);
           }else{
-            res.data.splice(index,1,pText,text,...(data.questionMapping.filter((item)=>{
-                                   return item.symptomType==0||item.symptomType==2;
-                                })));
+            res.data.splice(index,1,pText,text,...(FilteredDotMapping2));
             res.saveText = fullfillText(res.data).saveText;
-            res.selecteds.splice(index,1,null,null,...new Array(data.questionMapping.length).fill(null));
+            res.selecteds.splice(index,1,null,null,...new Array(FilteredDotMapping2.length).fill(null));
           }
         }else{//伴前
           if(strIndex < 1){//前
-            res.data.splice(index,1,text,...(data.questionMapping.filter((item)=>{
-                                   return item.symptomType==0||item.symptomType==1;
-                                })),pText);
+            res.data.splice(index,1,text,...(FilteredDotMapping1),pText);
             res.saveText = fullfillText(res.data).saveText;
-            res.selecteds.splice(index,1,null,...new Array(data.questionMapping.length).fill(null),null);
+            res.selecteds.splice(index,1,null,...new Array(FilteredDotMapping1.length).fill(null),null);
           }else{
-            res.data.splice(index,1,pText,text,...(data.questionMapping.filter((item)=>{
-                                   return item.symptomType==0||item.symptomType==1;
-                                })));
+            res.data.splice(index,1,pText,text,...(FilteredDotMapping1));
             res.saveText = fullfillText(res.data).saveText;
-            res.selecteds.splice(index,1,null,null,...new Array(data.questionMapping.length).fill(null));
+            res.selecteds.splice(index,1,null,null,...new Array(FilteredDotMapping1.length).fill(null));
           }
         }
       }
       res.data = fullfillText(res.data).newArr;
       res.saveText = fullfillText(res.data).saveText;
     }else{//标签
-      const spreadLabels = data.tagType==4?fullfillText(data.questionMapping).newArr:[data];
+      const arr=fullfillText(data.questionMapping).newArr;      //过滤连续标点
+      const spreadLabels = data.tagType==4?formatContinueDots(arr):[data];
       if(strIndex < 1){//前
         // 判断前一个是否为文本标签,是直接插入标签,不是则在前面插入一个空文本标签
         const preItem = res.data[index-1];
@@ -872,10 +868,12 @@ export const clearCurrentEdit = (state,action)=>{
 export function addLabelItem(state,action){
   let res = Object.assign({},state);
   const {data,i} = action;
-  const textLabel = JSON.parse(config.textLabel);
+  const textLabel = Object.assign({},JSON.parse(config._textLabel),{showInCheck:JSON.parse(data).showInCheck});
   //使用Object.assign({},data)拷贝操作时复制项和原项会同步修改
   if(!data) return res;
-  res.data.splice(i+1,0,JSON.parse(data),textLabel);
+  res.data.splice(+i+2,0,JSON.parse(data),textLabel);
+  res.saveText.splice(+i+2,0,'','');
+  res.selecteds.splice(+i+2,0,null,null);
   res.update = Math.random();
   return res;
 }

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

@@ -707,10 +707,12 @@ export function setCheckText(state,action) {
 export function addLabelItem(state,action){
   let res = Object.assign({},state);
   const {data,i} = action;
-  const textLabel = JSON.parse(config.textLabel);
+  const textLabel = Object.assign({},JSON.parse(config._textLabel),{showInCheck:JSON.parse(data).showInCheck});
   //使用Object.assign({},data)拷贝操作时复制项和原项会同步修改
   if(!data) return res;
-  res.data.splice(i+1,0,JSON.parse(data),textLabel);
+  res.data.splice(+i+2,0,JSON.parse(data),textLabel);
+  res.saveText.splice(+i+2,0,'','');
+  res.selecteds.splice(+i+2,0,null,null);
   res.update = Math.random();
   return res;
 }

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

@@ -409,10 +409,12 @@ export const setTextModeValue = (state,action)=>{
 export function addLabelItem(state,action){
   let res = Object.assign({},state);
   const {data,i} = action;
-  const textLabel = JSON.parse(config.textLabel);
+  const textLabel = Object.assign({},JSON.parse(config._textLabel),{showInCheck:JSON.parse(data).showInCheck});
   //使用Object.assign({},data)拷贝操作时复制项和原项会同步修改
   if(!data) return res;
-  res.data.splice(i+1,0,JSON.parse(data),textLabel);
+  res.data.splice(+i+2,0,JSON.parse(data),textLabel);
+  res.saveText.splice(+i+2,0,'','');
+  res.selecteds.splice(+i+2,0,null,null);
   res.update = Math.random();
   return res;
 }

+ 1 - 1
src/store/async-actions/assistCheck.js

@@ -27,7 +27,7 @@ export const getSearchList = (val) => {
 
 export const getInstroduce = (id,name)=>{    //获取辅检的提示信息
   return (dispatch, getState) =>{
-      axios.json('/api/icss/introduceInfo/getByQuestionId', {
+      axios.json('/introduceInfo/getByQuestionId', {
         questionId: id?id:'',
         type: 6,
         tagName:name?name:'',

+ 3 - 3
src/store/async-actions/fetchModules.js

@@ -199,13 +199,13 @@ export function getAssessData(){
   }
 }
 
-export function getIndexData(){
+export function getIndexData(range){
   return (dispatch,getStore)=>{
     const {patInfo} = getStore();
     const param = {
       diseaseId:21773,
-      startTime:'2017-08-01',
-      endTime:'2019-04-10',
+      startTime:range[0],
+      endTime:range[1],
       patientId:1001,//patInfo.message.patientId,
     };
     return json(api.getIndexData,param);

+ 2 - 2
src/store/async-actions/inspect.js

@@ -53,14 +53,14 @@ export const getSublableList = (id,idx) => {
 export const getInstroduce = (id,name,type)=>{    //获取化验的提示信息
   let url = '',param={};
   if(type == 'excel'){
-    url = '/api/icss/introduceInfo/getByQuestionName'
+    url = '/introduceInfo/getByQuestionName'
     param = {
       type: 5,
       tagName:name?name:'',
       position: 1
     }
   }else{
-    url = '/api/icss/introduceInfo/getByQuestionId'
+    url = '/introduceInfo/getByQuestionId'
     param = {
       questionId: id?id:'',
       type: 5,

+ 41 - 6
src/store/reducers/assessResult.js

@@ -1,23 +1,58 @@
-import {SET_ASSESS_DATA,SET_INDEX_DATA,SET_SAVE_ASSESS_DATA} from '@types/assessResult';
+import {SET_ASSESS_DATA,SET_INDEX_DATA,SET_SAVE_ASSESS_DATA,SET_INDEX_SUB_TYPE,ADD_ASSESS_ITEMS,REMOVE_ASSESS_ITEMS} from '@types/assessResult';
+import config from "@config";
 
 const init = {
   data:[],        //评估模块数据
   indexData:{},     //评估图表数据
-  saveData:[],      //保存的评估数据-点确定时保存
-  saveIndexData:{}    //保存的评估图表数据-点确定时保存
+  indexTimeTypes:{},    //单个图表选中的维度
+  wholeAssess:[],     //整体评估数据
+  wholeIndexs:{},     //已加入的评估数据的index,加入按钮状态用
+  wholeAssessText:'',   //整体评估补充说明
+  chooseSelecteds:{},   //选项勾选状态
 };
 export default (state=init,action)=>{
   const res = Object.assign({},state);
+  const {data,range,index,rangeType} = action;
   switch (action.type){
     case SET_ASSESS_DATA:
       res.data = action.data;
       return res;
     case SET_INDEX_DATA:
-      res.indexData = action.data;
+      res.indexData[range[0]+range[1]] = data;
+      Object.keys(data).map((i)=>{
+        if(i===index){
+          res.indexTimeTypes[i]=rangeType;
+        }else{
+          res.indexTimeTypes[i]=config.chartDismen;
+        }
+      });
+      res.update = Math.random();   //对象更新
+      return res;
+    case SET_INDEX_SUB_TYPE:
+      if(!index){
+        return res;
+      }
+      res.indexTimeTypes[index] = rangeType;
+      res.update = Math.random();   //对象更新
       return res;
     case SET_SAVE_ASSESS_DATA:
-      res.saveData = action.data;
-      res.saveIndexData = action.indexData;
+      res.wholeIndexs = action.wholeAssessItems;
+      //res.indexTimeTypes = action.chartTimeTypes;
+      res.wholeAssessText = action.wholeAssessText;
+      res.chooseSelecteds = action.chooseSelecteds;
+      return res;
+    //case CLEAR_ASSESS_DATA:
+    case ADD_ASSESS_ITEMS:
+      res.wholeAssess[action.index] = action.data;
+      let arr = res.wholeIndexs[action.index];
+      res.wholeIndexs[action.index] = arr?[...arr,action.subIndex]:[action.subIndex];
+      res.update1 = Math.random();   //对象更新,与其他字段名不同因为绑定在pushItems,避免不必要的渲染
+      return res;
+    case REMOVE_ASSESS_ITEMS:
+      const {index,pIndex} = action;
+      const temp =[...res.wholeIndexs[pIndex]];
+      res.wholeIndexs[pIndex].splice(temp.findIndex((i)=>i==index),1);
+      //res.wholeAssess[pIndex].details[index].add=false;
       return res;
     default:
       return res;

+ 76 - 0
src/store/reducers/treat.js

@@ -68,6 +68,82 @@ const initState = {
     //         ]
     //     }
     // ],
+    lastTreat: {
+        commonDisMedica: [
+            {
+                medicitionName: '泮托拉唑',
+                id: 145
+            },
+            {
+                medicitionName: '奥美拉唑',
+                id: 341
+            }
+        ],
+        chronicDisMedica: [
+            {
+                medicitionName: '兰索拉唑',
+                id: 342
+            },
+            {
+                medicitionName: '山莨菪碱',
+                id: 344
+            }
+        ],
+    },
+    adversReactionList:[
+        {
+            id: 40772,
+            name: '低血糖反应',
+            tagName: '低血糖反应',
+            showInfo: '0',
+            controlType: 2,
+            details: [
+                {
+                    name: "无",
+                    value: 0
+                },
+                {
+                    name: "偶尔",
+                    value: 0
+                },
+                {
+                    name: "频",
+                    value: 0
+                }
+            ]
+
+        },
+        {
+            id: 40773,
+            name: '胃肠道不良反应',
+            tagName: '胃肠道不良反应',
+            showInfo: '0',
+            controlType: 2,
+            details: [
+                {
+                    name: "腹胀 ",
+                    value: 0
+                },
+                {
+                    name: "厌食",
+                    value: 0
+                },
+                {
+                    name: "嗳气",
+                    value: 0
+                },
+                {
+                    name: "恶心",
+                    value: 0
+                },
+                {
+                    name: "呕吐",
+                    value: 0
+                }
+            ]
+
+        }
+    ],
     treatDesc:{
         title: '药品推荐',
     }

+ 4 - 1
src/store/types/assessResult.js

@@ -1,3 +1,6 @@
 export const SET_ASSESS_DATA = 'SET_ASSESS_DATA';     //推送的评估弹窗内容
 export const SET_INDEX_DATA = 'SET_INDEX_DATA';       //评估图表数据
-export const SET_SAVE_ASSESS_DATA = 'SET_SAVE_ASSESS_DATA';  //保存的评估弹窗数据
+export const SET_SAVE_ASSESS_DATA = 'SET_SAVE_ASSESS_DATA';  //保存的评估弹窗数据
+export const SET_INDEX_SUB_TYPE = 'SET_INDEX_SUB_TYPE';   //保存单个图表时间维度
+export const ADD_ASSESS_ITEMS = 'ADD_ASSESS_ITEMS';     //加入评估
+export const REMOVE_ASSESS_ITEMS = 'REMOVE_ASSESS_ITEMS';  //整体评估删除

+ 1 - 0
src/utils/config.js

@@ -1,3 +1,4 @@
+// const host='http://192.168.3.1:5050';//赵
 // const host='http://192.168.3.100:5050';//王峰
 // const host='http://192.168.2.241:5050';//后端接口访问地址
 const host='http://192.168.2.236:5050';//后端接口访问地址

+ 2 - 1
src/utils/tools.js

@@ -586,7 +586,8 @@ function trimDots(str){
 
 //标签间连续标点只保留一个,保留前面一个
 function formatContinueDots(data){
-  let arr=data.filter((it,i)=>{
+  let arr=[];
+  arr=data&&data.filter((it,i)=>{
     if(i==0||(it.name&&(it.name.match(config.punctuationReg))||(data[i-1].name&&data[i-1].name.match(config.punctuationReg)))){
       return it;
     }