Browse Source

历史病例量表无数据提示1166,图表无数据提示1331

zhouna 6 năm trước cách đây
mục cha
commit
50fd238c27

+ 5 - 8
src/components/AssessResult/AssessHis/index.jsx

@@ -1,6 +1,6 @@
 import React, { Component } from "react";
 import style from "./index.less";
-import { Radio,ComplexModal} from '@commonComp';
+import { Radio,ComplexModal,Notify} from '@commonComp';
 import arrow from '@common/images/show.png';
 import arrowDown from '@common/images/close.png';
 import loadingIcon from '@common/images/loading.gif';
@@ -85,16 +85,13 @@ class AssessResultHis extends Component {
       return data===null||(data&&data.length==0)?<p className={style['no-data']}>没有历史评估记录!</p>:'';
     }
   }
-  /*componentDidMount(){
-    const indexTimeTypes = JSON.parse(JSON.stringify(this.props.indexTimeTypes));
-    console.log(indexTimeTypes)
-    this.setState({
-      chartTimeTypes:indexTimeTypes
-    });
-  }*/
   showScaleFn(item,pid){
     const { list,inquiryId } = this.props;
     const obj = list&&list[inquiryId];
+    if(!(obj.scaleInfo&&obj.scaleInfo[item.id])){
+      Notify.info("未保存该量表数据");
+      return ;
+    }
     if(item){
       this.setState({
         tableName:item.name,

+ 13 - 11
src/components/AssessResult/ChartItem/index.jsx

@@ -90,7 +90,7 @@ class ChartItem extends Component {
     for(let i in obj){
       arr.push(<Chart data={obj[i]} endDate={endDate} type={timeTypes&&timeTypes[i]} index={i} getXAxisArr={this.getXAxisArr} handleRangeChange={this.rangChange}/>)
     }
-    return arr;
+    return arr.length>0?arr:<p style={{color:'#acacac'}}>该模块暂无数据</p>;
   }
   componentDidMount(){
     const {initFn,pindex} = this.props;
@@ -133,14 +133,14 @@ class Chart extends Component{
     let series = [],names=[],inx=-1;
     let myChart = echarts.init(document.getElementById(id) ,null, {renderer: 'svg'});
     let xAxisArr = [...xAxis];
-
     const interval = {
       week:23,
       month:4,
       sixMonth:9,
       year:60
     };
-    data&&data.map((it)=>{
+
+    data&&data.map((it,j)=>{
       let values=new Array();
       let name='';
       it&&it.creatTime.map((x,i)=>{
@@ -160,7 +160,12 @@ class Chart extends Component{
         name: it.itemName,
         type: 'line',
         data: values,
-        showAllSymbol:true
+        showAllSymbol:true,
+        symbol:config.chartSymbols[j%7],
+        symbolSize:7,
+        itemStyle:{
+          color:config.chartColors[j%7]
+        }
       });
     });
     // 指定图表的配置项和数据
@@ -172,16 +177,13 @@ class Chart extends Component{
         }
       },
       legend: {
-        type:'scroll',
-        /*formatter: function (name) {
-          return name.split("-")[name.split("-").length-1];
-        },*/
-        data:names,
+        show:false
+        /*data:names,
         padding:0,
-        itemHeight:16,
+        itemHeight:16,*/
       },
       grid:{
-        top:80
+        top:40
       },
       xAxis: {
         type: 'category',

+ 1 - 1
src/components/AssessResult/ScaleItem/index.jsx

@@ -186,7 +186,7 @@ class ScaleItem extends Component {
                                footer="true">
                       <table>
                         {it.content.details.map((item1,idd)=>{
-                          if(item1.controlType==1){//单选
+                          if(item1.controlType==1||item1.controlType==3){//单选
                             return <tr>
                               <td>
                                 <span>{'请选择'+item1.name+':'}</span>

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

@@ -85,7 +85,7 @@
   }
   .time-range{
     position: absolute;
-    bottom: 180px;
+    bottom: 224px;
     /*top: 26px;*/
     z-index: 2;
     width: 100%;

+ 2 - 22
src/components/ChronicInfo/index.jsx

@@ -350,13 +350,13 @@ class ChronicInfo extends React.Component{
                                 footer="true">
                                 <table>
                                 {it.content.details.map((item,idd)=>{
-                                    if(item.controlType==1){//单选
+                                    if(item.controlType==3||item.controlType==1){//单选
                                       return <tr>
                                         <td>
                                           <span>{'请选择'+item.name+':'}</span>
                                         </td>
                                         <td>
-                                          {item.details.map((ii,ind)=>{
+                                          {Array.isArray(item.details)&&item.details.map((ii,ind)=>{
                                             return <div className={style["chooseItem"]}>
                                                     <Radio label={ii.detailName}
                                                              isSelect={ii.state == 1}
@@ -366,8 +366,6 @@ class ChronicInfo extends React.Component{
                                           })}
                                         </td>  
                                       </tr>
-                                    }else if(item.controlType==1){//多选
-
                                     }else if(item.controlType==2){//输入框
                                       return <tr>
                                         <td>
@@ -380,24 +378,6 @@ class ChronicInfo extends React.Component{
                                           <span>{item.uint}</span>
                                         </td>
                                         
-                                      </tr>
-                                    }else if(item.controlType==3){//下拉
-                                      return <tr>
-                                        <td>
-                                          <span>{'请选择'+item.name+':'}</span>
-                                        </td>
-                                        <td>
-                                          {item.details.map((ii,ind)=>{
-                                            return <div className={style["chooseItem"]}>
-                                                    <Radio label={ii.detailName}
-                                                            // isSelect={radioVal[i]==ii.detailName}
-                                                            isSelect={ii.state == 1}
-                                                            handleClick={this.handleForRadio.bind(this,ii,v,i)}>
-                                                    </Radio>
-                                                  </div>
-                                          })}
-                                        </td>
-                                        
                                       </tr>
                                     }
                                 })}

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

@@ -81,7 +81,7 @@ class ScaleTableHis extends React.Component{
   }
 
   render(){
-    const {title,data,result} = this.props;console.log(this.props)
+    const {title,data,result} = this.props;
     const scale = data && this.filterScale(data);
     const datas = scale && scale.content && JSON.parse(scale.content);
     const scaleResult = datas; //量表计算结果

+ 2 - 0
src/config/index.js

@@ -55,6 +55,8 @@ export default {
       age:"岁",
     },
     chartDismen:'year',   //评估图表默认维度:近1年year,近6个月sixMonth,近1个月month,近1周week
+    chartSymbols:['emptyCircle' , 'rect', 'arrow', 'triangle', 'diamond','circle', 'pin', 'roundRect'],
+    chartColors:['#3B9ED0','#F50933', '#F99903', '#66CB33', '#91c7ae','#749f83',  '#ca8622'],
     showCheckNum:16,        //查体默认展开非自由文本标签的个数
     radioOptionPer:'()',     //单选项输入占位符
     textReg:new RegExp("([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[a-zA-Z0-9])"), //包含中英文或数字