ソースを参照

急诊全科病历导出名称修改

liucf 5 年 前
コミット
918c6449f2

+ 12 - 2
src/common/components/EditableSpan/index.jsx

@@ -62,6 +62,8 @@ class EditableSpan extends Component{
     const {handleChange,boxMark,i,handleSearch,value,mainSaveText,mainIds,handleClear} = this.props;
     const {labelVal,searchPre} = this.state;
     const text1 = e.target.innerText || e.target.innerHTML;
+    // e.newValue IE浏览器DOMCharacterDataModified监听
+    // const text1 = e.target.innerText || e.target.innerHTML || e.newValue;
     let mainText = filterDataArr(mainSaveText);//主诉字数
     if(+boxMark==1){
       if(mainText.length >= config.limited){
@@ -196,6 +198,10 @@ class EditableSpan extends Component{
     const ev = e||window.event;
     const target = ev.target||ev.srcElement;
     let innerVal = target.innerText || target.innerHTML,ele,boxTop;
+    // 可编辑div不支持oninput事件,用此事件替代
+    /*if(isIE() && innerVal != preVal){
+      this.onChange(ev);
+    }*/
     if(ev.keyCode==46){//delete
       //判断nexObj
       let nextObj = $(this.$span.current).next();
@@ -277,13 +283,17 @@ class EditableSpan extends Component{
   }
   componentDidMount(){
     const {value} = this.props;
+    const that = this;
     if(value){
       this.$span.current.innerText?(this.$span.current.innerText = value||''):(this.$span.current.innerHTML = value||'');
     }
     if(isIE()){
-      $(this.$span.current).onIe8Input(function(e){
+      // 左右移动没问题,但是输入过程中会失焦,并且有时光标在但是无法输入 
+      // $(this.$span.current)[0].addEventListener('DOMCharacterDataModified', function(e){that.onChange(e);}, false);
+      // 此方法会影响左右切换时光标消失
+      /*$(this.$span.current).onIe8Input(function(e){
         this.onChange(e)
-      },this);
+      },this);*/
     }
   }
   /*cancelSelect(e){//双击不选中

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

@@ -62,8 +62,8 @@ class EmergencyHis extends Component{
   }
 
   handleDownload(ids){//导出
-    const { getDownload } = this.props;
-    getDownload&&getDownload(ids)
+    const { getDownload ,info} = this.props;
+    getDownload&&getDownload({ids,info})
   }
   //搜索框输入
   handleInput(e){

+ 5 - 4
src/containers/Emergency.js

@@ -7,13 +7,14 @@ import { getSearchList } from '@store/async-actions/diagnosticSearch';
 import {Notify} from '@commonComp';
 
 const mapStateToProps = function(state){
-  const {emergencyHis} = state;
+  const {emergencyHis,patInfo} = state;
   return {
     data:emergencyHis.allHisRecord,
     total:emergencyHis.total,
     params:emergencyHis.params,
     preInfo : state.patInfo.message,
     searchData:emergencyHis.searchData,
+    info:patInfo.message
   }
 }
 
@@ -25,9 +26,9 @@ const mapDispatchToProps = function(dispatch){
     filterData(obj){
       dispatch(getFilterHis(obj))
     },
-    async getDownload(ids){
-      let resData = await downloadData(ids);
-      downloadExportedData(resData.data,"全科历史病历");
+    async getDownload(obj){
+      let resData = await downloadData(obj.ids);
+      downloadExportedData(resData.data,obj.info.hospitalDeptName+"病历");
     },
     clearHisRecord(){
       dispatch({type:CLEAR_RECORD})