瀏覽代碼

静态信息接口修改

zhangxc 6 年之前
父節點
當前提交
5fa9fd810a

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

@@ -148,7 +148,7 @@ class AddAssistCheck extends React.Component {
             <span className={styles.assistName} style={{ width: winWidth < 1200 ? '120px' : 'auto' }}>
               <span className={styles.tagSpan}>
                 {item.name}:
-                <span className={styles.imgInfo} onClick={()=>getInfomation(item.questionId,item.name)}></span>
+                <span className={styles.imgInfo} onClick={()=>getInfomation({name: item.name, position: 1, type: 6})}></span>
               </span>
             </span>
             <div className={styles.textareaWrap}>

+ 3 - 3
src/components/AddInspect/SlideExcel/index.jsx

@@ -38,7 +38,7 @@ class SlideExcel extends Component {
           <span className={styles.excelDataTitle}>
               <span className={styles.tagSpan}>
                 {item.menus}
-                <span className={styles.imgInfo} onClick={()=>getInfomation('',item.lisExcelItem[0].uniquemealName || '','excel')}></span>
+                <span className={styles.imgInfo} onClick={()=>getInfomation({name:item.lisExcelItem[0].uniquemealName || '',type:12, position: 1})}></span>
               </span>
           </span>
           <table className={styles.table}>
@@ -47,7 +47,7 @@ class SlideExcel extends Component {
                       <td style={{width:'30%'}}>
                         <span className={styles.tagSpan}>
                           {value.itemName}
-                          <span className={styles.imgInfo} onClick={()=>getInfomation('',value.uniqueName || '','excel')}></span>
+                          <span className={styles.imgInfo} onClick={()=>getInfomation({name: value.uniqueName || '',type:12, position: 1})}></span>
                         </span>
                       </td>
                       <td style={{width:'20%'}}><span className={value.type == 1?'red':null}>{value.value}</span> {value.unit}</td>
@@ -62,7 +62,7 @@ class SlideExcel extends Component {
                         <td style={{width:'30%'}}>
                           <span className={styles.tagSpan}>
                             {value.itemName}
-                            <span className={styles.imgInfo} onClick={()=>getInfomation('',value.uniqueName || '','excel')}></span>
+                            <span className={styles.imgInfo} onClick={()=>getInfomation({name: value.uniqueName || '',type:12, position: 1})}></span>
                           </span>
                         </td>
                         <td style={{width:'20%'}}><span className={value.type == 1?'red':null}>{value.value}</span> {value.unit}</td>

+ 4 - 4
src/components/AddInspect/SlideSelect/index.jsx

@@ -73,13 +73,13 @@ class SlideSelect extends Component {
             <p className={styles.staticTagActive}>
                 <span className={styles.tagSpan} data-flg="current" style={{color:"#000"}} onClick={(e) => { handleLabelSub(e, item.questionId,idx); handleFillShow(e,idx) }}>
                   {item.name}
-                  <span className={styles.imgInfo} onClick={()=>getInfomation(item.questionId,item.name)}></span>
+                  <span className={styles.imgInfo} onClick={()=>getInfomation({name:item.uniqueName || '', position: 1, type: 12})}></span>
                 </span>
             </p>:
             <p >
                 <i className={styles.tagSpan} data-flg="current" onClick={(e) => { handleLabelSub(e,item.questionId,idx); handleFillShow(e,idx) }}>
                   {item.name}
-                  <span className={styles.imgInfo} onClick={()=>getInfomation(item.questionId,item.name)}></span>
+                  <span className={styles.imgInfo} onClick={()=>getInfomation({name:item.uniqueName || '', position: 1, type: 12})}></span>
                 </i>
             </p>
         }
@@ -101,7 +101,7 @@ class SlideSelect extends Component {
                                     <td style={{width:'30%'}}>
                                       <span className={styles.tagSpan}>
                                         {val.name}
-                                        <span className={styles.imgInfo} onClick={()=>getInfomation(val.id)}></span>                                        
+                                        <span className={styles.imgInfo} onClick={()=>getInfomation({name:val.uniqueName || '', position: 1, type: 12})}></span>                                        
                                       </span>
                                     </td>
                                     {showDetails(val)}
@@ -119,7 +119,7 @@ class SlideSelect extends Component {
                                     <td style={{width:'30%'}}>
                                       <span className={styles.tagSpan}>
                                         {val.name}
-                                        <span className={styles.imgInfo} onClick={()=>getInfomation(val.id)}></span>
+                                        <span className={styles.imgInfo} onClick={()=>getInfomation({name:val.uniqueName || '', position: 1, type: 12})}></span>
                                       </span>
                                     </td>
                                     {showDetails(val)}

+ 5 - 3
src/components/ChronicInfo/index.jsx

@@ -85,13 +85,15 @@ class ChronicInfo extends React.Component{
     //this.close()
   }
 
-  showInfo(id){
+  showInfo(item){
     // 静态知识显示在提示信息里(4-18)
     const {getInfomation} = this.props;
     const param = {
-      id:id,
+      id:item.id,
+      name: item.name,
       // id:40738, //目前只有“肾功能不全”有数据
       type:22,
+      position: 1
     }
     getInfomation&&getInfomation(param);
   }
@@ -344,7 +346,7 @@ class ChronicInfo extends React.Component{
                                     src={currentIndex === i ?(hasEnterImg ? infoMove : infoShow ): infoShow}
                                     onMouseEnter={this.handleMouseEnterImg.bind(this)}
                                     onMouseLeave = {this.handleMouseLeaveImg.bind(this)}
-                                    onClick={this.showInfo.bind(this,v.id)}/>}
+                                    onClick={this.showInfo.bind(this,v)}/>}
 
                                 </span>
                                 {/* <img src={infoShow} className={style["infoPic"]} onClick={this.showInfo.bind(this,v.id)}/> */}

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

@@ -59,7 +59,7 @@ class DiagnosticItem extends Component{
     getTips(item, e) {
         e.stopPropagation();
         const {getTips } = this.props;
-        getTips && getTips({id:item.id,type:7});
+        getTips && getTips({id:item.id,type:7,name: item.name, position: 1});
     }
     addDiagodal(diagType){
         const {item, isChronicMag,mode} = this.props;

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

@@ -105,7 +105,7 @@ class DiagnosticList extends Component {
     handleClickDiag(item) {
         const { getTips } = this.props;
         // getTips && getTips(item);
-        getTips && getTips({id:item.id,type:7});
+        getTips && getTips({id:item.id, type:7, name: item.name, position: 1});
     }
     referRecord() {
         const { hideReferRecord, showHistoryCaseModal ,chronicMagItem,hisTemplates,autoFillModules,typeConfig} = this.props

+ 5 - 5
src/components/PushItems/DetailsModal/index.jsx

@@ -29,7 +29,7 @@ class DetailsModal extends Component {
         },0)
         
         let scrollTop = 0
-        tipsDetails.introduceDetailList.map((it, ii) => {
+        tipsDetails.details.map((it, ii) => {
             if( ii < index) {
                 scrollTop = scrollTop + parseInt($('#' + it.title).css('height'))
             }
@@ -39,8 +39,8 @@ class DetailsModal extends Component {
     handleScrollModal(tipsDetails) {
         const scrollTop = $('#detailsContent').scrollTop()
         let divHeight = 0;
-        for (let i = 0; i < tipsDetails.introduceDetailList.length; i++) {
-            divHeight = divHeight + parseInt($('#' + tipsDetails.introduceDetailList[i].title).css('height')) -5
+        for (let i = 0; i < tipsDetails.details.length; i++) {
+            divHeight = divHeight + parseInt($('#' + tipsDetails.details[i].title).css('height')) -5
             if(divHeight > scrollTop) {
                 this.setState({
                     currentIndex: i
@@ -59,7 +59,7 @@ class DetailsModal extends Component {
                     <div className={styles['details-content-wrapper']} id="detailsContentWrap">
                         <h1 id="detailsContentTitle" className={`${styles['details-content-name']} drag-title`} >{tipsDetails && tipsDetails.tagName} <img className={styles['details-close']} onClick={this.hideTips} src={close} /></h1>
                         <div className={styles['details-content']} id= 'detailsContent' onScroll={this.handleScrollModal.bind(this, tipsDetails)}>
-                            {tipsDetails && tipsDetails.introduceDetailList && tipsDetails.introduceDetailList.map((item, index) => {
+                            {tipsDetails && tipsDetails.details && tipsDetails.details.map((item, index) => {
                                 return (<div id={item.title}>
                                     <div className={styles['details-content-title-box']} >
                                         <span className={styles['details-content-title-name']}>{item.title}</span>
@@ -72,7 +72,7 @@ class DetailsModal extends Component {
                         </div>
                         <div className={styles['content-menu-box']}>
                             <div className={styles['content-menu']}>
-                                {tipsDetails && tipsDetails.introduceDetailList && tipsDetails.introduceDetailList.map((item, index) => {
+                                {tipsDetails && tipsDetails.details && tipsDetails.details.map((item, index) => {
                                         return (<div>
                                             <div className={styles['details-menu-title-box']}>
                                                 {index === 0 ? '' : <div className={styles['details-content-menu-line']}></div>}

+ 4 - 6
src/components/PushItems/index.jsx

@@ -417,10 +417,10 @@ class PushItems extends Component {
                 提示信息
               </h1>
               <div className={style["content"]}>
-                {tips && tips.introduceDetailList ? (
+                {tips && tips.details ? (
                   <div>
                     <div className={style["title"]}>
-                      {tips.tagName}
+                      {tips.name}
                       <span
                         className={style["tips-details"]}
                         onClick={() => showTips(tips)}
@@ -429,10 +429,9 @@ class PushItems extends Component {
                         详情
                       </span>
                     </div>
-                    {tips.introduceDetailList &&
-                      tips.introduceDetailList.map((item, index) => {
+                    {tips.details &&
+                      tips.details.map((item, index) => {
                         return (
-                          item.position.indexOf("1") > -1 && (
                             <div>
                               <div
                                 dangerouslySetInnerHTML={{
@@ -450,7 +449,6 @@ class PushItems extends Component {
                                 </div>
                               )}
                             </div>
-                          )
                         );
                       })}
                   </div>

+ 3 - 3
src/containers/AssistCheck.js

@@ -6,7 +6,7 @@ import AssistCheck from '@components/AssistCheck';
 import { assistLable,delAssistLabel,changeAssistVal,changeDate } from '@store/actions/assistCheck';
 import { getSearchList,getInstroduce } from '@store/async-actions/assistCheck';
 import {ISREAD} from '@store/types/homePage.js';
-import {billing} from '@store/async-actions/pushMessage';
+import {billing, getConceptDetail} from '@store/async-actions/pushMessage';
 
 function mapStateToProps(state) {
     return {
@@ -22,8 +22,8 @@ function mapStateToProps(state) {
 
 function mapDispatchToProps(dispatch, store) {
     return {
-        getInfomation(id,name){
-            dispatch(getInstroduce(id,name))
+        getInfomation(item){
+            dispatch(getConceptDetail(item))
         },
         handleChangeValue(val) {
             dispatch(getSearchList(val))

+ 2 - 2
src/containers/ChronicInfo.js

@@ -1,7 +1,7 @@
 import {connect} from 'react-redux';
 import ChronicInfo from '../components/ChronicInfo';
 import {SHOW_TABLE_LIST,HIDE_TABLE_LIST, SET_CHRONIC_PUSHS} from '@store/types/pushMessage';
-import {getTableList,getScaleInfo,getTips} from '../store/async-actions/pushMessage';
+import {getTableList,getScaleInfo,getConceptDetail} from '../store/async-actions/pushMessage';
 import {ADD_ASSESS_ITEMS,SET_SAVE_ASSESS_DATA,SET_CHRONIC_CALCU_RESULT,ADD_WHOLE_SCALE_ITEMS,SET_CALCU_VALUES} from "@types/assessResult";
 import {saveMessage} from "../store/async-actions/print";
 import {saveClickNum} from '@store/async-actions/homePage';
@@ -116,7 +116,7 @@ function mapDispatchToProps(dispatch){
     },
     // 获取量表静态知识
     getInfomation(item){
-      dispatch(getTips(item));
+      dispatch(getConceptDetail(item));
     }
   }
 }

+ 2 - 2
src/containers/DiagnosticItem.js

@@ -6,7 +6,7 @@ import {  SHOW_SEARCH,  HIDE_SEARCH, SET_SEARCH_VALUE } from '@store/types/diagn
 import { isChronicMag } from'@store/async-actions/diagnosticList.js';
 import { addDiagnostic } from '@store/async-actions/treat';
 import { getSearchResult } from '@store/async-actions/diagnosticSearch';
-import {billing, getTips} from '../store/async-actions/pushMessage';
+import {billing, getConceptDetail} from '../store/async-actions/pushMessage';
 
 
 function mapStateToProps(state) {
@@ -39,7 +39,7 @@ function mapDispatchToProps(dispatch) {
             })
         },
         getTips: (diagItem) => {
-            dispatch(getTips(diagItem))
+            dispatch(getConceptDetail(diagItem))
         },
         isChronicMag: (item) =>{
             dispatch(isChronicMag(item))

+ 3 - 3
src/containers/DiagnosticList.js

@@ -4,7 +4,7 @@ import DiagnosticList from '@components/DiagnosticList';
 import { ADD_DIAGNOSTIC,  DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, GET_DIAGNOSTIC_STR, GET_IS_FIRST, HIDE_REFER_RECORD, SHOW_HISTORY_CASE,HIDE_HISTORY_CASE } from '@store/types/diagnosticList'; 
 import { getTreatResult } from '@store/async-actions/treat';
 import { SHOW_TREAT, DEL_REACT, DEL_FOLLOW_UP } from '@store/types/treat.js';
-import {billing, getTips} from '../store/async-actions/pushMessage';
+import {billing, getConceptDetail} from '../store/async-actions/pushMessage';
 import {keepPushData} from '@store/actions/tabTemplate';
 import { showHistory,sortHistory,activeHistory,visibleHistory } from '@store/actions/historyTemplates'
 import {CURRENT_CHRONIC} from '@store/types/currentIll';
@@ -84,8 +84,8 @@ function mapDispatchToProps(dispatch) {
             dispatch({type:MODI_LOADING,flag:true});
             dispatch(getTreatResult(item));
         },
-        getTips: (diagItem) => {
-            dispatch(getTips(diagItem))
+        getTips: (item) => {
+            dispatch(getConceptDetail(item))
         },
         getBilling: () => {
             dispatch(billing())

+ 4 - 4
src/containers/Inspect.js

@@ -1,9 +1,9 @@
 import React from 'react';
 import {connect} from 'react-redux';
 import Inspect from '@components/Inspect';
-import {getSearchList,getSublableList,getInstroduce } from '@store/async-actions/inspect';
+import {getSearchList,getSublableList } from '@store/async-actions/inspect';
 import {setLabel,fillActived,fillActiveDetail,checkValueIsChange,delExcelLis,clearLabel,delPartItem} from '@store/actions/inspect';
-import {billing} from '@store/async-actions/pushMessage';
+import {billing, getConceptDetail} from '@store/async-actions/pushMessage';
 function mapStateToProps(state) {//console.log(state)
     return {
         list:state.inspect.list,
@@ -22,8 +22,8 @@ function mapDispatchToProps(dispatch, store) {
         handleChangeValue(val){
             dispatch(getSearchList(val))
         },
-        getInfomation(id,name,type){
-            dispatch(getInstroduce(id,name,type))
+        getInfomation(item){
+            dispatch(getConceptDetail(item))
         },
         handleSign(id,idx,type){
             dispatch(setLabel(idx,type))

+ 2 - 5
src/containers/PushItemsContainer.js

@@ -3,7 +3,7 @@ import {connect} from 'react-redux';
 import PushItems from '../components/PushItems'
 import {CHANGE_ASSAY, CHANGE_CHECK, ADD_BILLING, SHOW_TIPS_DETAILS, HIDE_TIPS_DETAILS,SHOW_TABLE_LIST} from '@store/types/pushMessage';
 import { ADD_DIAGNOSTIC, GET_DIAGNOSTIC_STR } from '@store/types/diagnosticList';
-import {billing, getTips, getTipsDetails} from '../store/async-actions/pushMessage';
+import {billing, getAllConceptDetail} from '../store/async-actions/pushMessage';
 import { isAddMainSuit } from '@store/async-actions/diagnosticList';
 
 function mapStateToProps(state) {
@@ -46,11 +46,8 @@ function mapDispatchToProps(dispatch) {
                 check: checkedCheck,
             })
         },
-        getTips: (diagItem) => {
-            dispatch(getTips(diagItem))
-        },
         getTipsDetails: () => {
-            dispatch(getTipsDetails())
+            dispatch(getAllConceptDetail())
         },
         showTipsDetailsModal: () => {
             dispatch({

+ 0 - 20
src/store/async-actions/assistCheck.js

@@ -24,23 +24,3 @@ export const getSearchList = (val) => {
         })
     }
 };
-
-export const getInstroduce = (id,name)=>{    //获取辅检的提示信息
-  return (dispatch, getState) =>{
-      axios.json('/introduceInfo/getByQuestionId', {
-        questionId: id?id:'',
-        type: 6,
-        tagName:name?name:'',
-        position: 1
-    })
-    .then((data)=>{
-        dispatch({
-          type: SET_TIPS,
-          tips: data.data.data,
-          tmpFlg:'midPart'
-      })          
-    }).catch((e) => {
-        console.log(e)
-    })
-  }
-}

+ 0 - 32
src/store/async-actions/inspect.js

@@ -49,35 +49,3 @@ export const getSublableList = (id,idx) => {
         })
     }
 };
-
-export const getInstroduce = (id,name,type)=>{    //获取化验的提示信息
-  let url = '',param={};
-  if(type == 'excel'){
-    url = '/introduceInfo/getByQuestionName'
-    param = {
-      type: 5,
-      tagName:name?name:'',
-      position: 1
-    }
-  }else{
-    url = '/introduceInfo/getByQuestionId'
-    param = {
-      questionId: id?id:'',
-      type: 5,
-      tagName:name?name:'',
-      position: 1
-    }
-  }
-  return (dispatch, getState) =>{
-    axios.json(url, param)
-    .then((data)=>{
-        dispatch({
-          type: SET_TIPS,
-          tips: data.data.data,
-          tmpFlg:'midPart'
-        })          
-    }).catch((e) => {
-        console.log(e)
-    })
-  }
-}

+ 45 - 28
src/store/async-actions/pushMessage.js

@@ -11,6 +11,7 @@ const api={
   textPush:'/push/pushText',
   getTableList:'/scale/getList', //获取量表列表
   getTableInfo:'/scale/getContent', //获取量表明细
+  getConceptDetail:'/conceptDetail/getConceptDetail', //获取静态提示信息
 }
 
 //获取右侧推送信息
@@ -97,50 +98,66 @@ export const billing = (mdata,boxMark) => {
  }
 };
 
-  export const getTips = (diagItem) =>{
-    return (dispatch, getState) =>{
+//获取提示信息(静态信息)
+export const getConceptDetail = (item) => {
+    return(dispatch, getState) => {
         dispatch({
             type: SET_CLICK_DIAG,
-            clickDiag: diagItem
+            clickDiag: item
         })
-        const url = '/introduceInfo/getByQuestionId';
-        const params = {
-            questionId: diagItem.id,
-            type: diagItem.type,
-            position: 1
+        const params ={
+            name: item.name,
+            position: item.position,
+            type: item.type
         }
-        json(url, params)
-        .then((data)=>{
-                dispatch({
-                    type: SET_TIPS,
-                    tips: data.data.data
-                })
-        }).catch((e) => {
-            console.log(e)
-        })
 
+        json(api.getConceptDetail, params).then((res) => {
+            if(res.data.code == '0') {
+                if(item.position == '1') {
+                    if(item.type == '5' || item.type == '6') {
+                        dispatch({
+                            type: SET_TIPS,
+                            tips: res.data.data,
+                            tmpFlg:'midPart'
+                        })
+                    } else {
+                        dispatch({
+                            type: SET_TIPS,
+                            tips: res.data.data,
+                        })
+                    }
+                    
+                } else if(item.position == '2'){
+
+                }
+            } else {
+                Notify.info('提示信息未维护')
+            }
+            
+        })
     }
 }
 
-export const getTipsDetails = () => {
+export const getAllConceptDetail = () => {
     return(dispatch, getState) => {
         const state = getState();
-        // 诊断指南新窗口展示
-        // window.open(`/static/pages/information.html?type=7&&questionId=${state.diagnosticList.clickDiag.id}`);
-
-        //弹窗显示
-        const url ='/introduceInfo/getByQuestionId'
+        const clickItem = state.diagnosticList.clickDiag
         const params = {
-            type: state.diagnosticList.clickDiag.type,
-            questionId: state.diagnosticList.clickDiag.id,
+            type: clickItem.type,
+            name: clickItem.name,
             position:2
         }
-        json(url, params)
-        .then((data)=>{
+        json(api.getConceptDetail, params)
+        .then((res)=>{
+            if(res.data.code == '0') {
                 dispatch({
                     type: SET_TIPS_DETAILS,
-                    tipsDetails: data.data.data
+                    tipsDetails: res.data.data
                 })
+            } else {
+                Notify.info('提示信息未维护')
+            }
+                
         }).catch((e) => {
             console.log(e)
         })