Browse Source

结构化下主诉手动输入延时推送

liucf 6 years ago
parent
commit
7738e7ec5a

+ 1 - 1
src/common/js/func.js

@@ -66,7 +66,7 @@ export const strTrim = (str) =>{
 };
 
 //获取组合组件已填文字填入saveText
-function getSaveText(data){console.log(data)
+function getSaveText(data){//console.log(data)
   const arr = data.questionMapping.map((it)=>{
     return it.value?(it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||''):'';
   });

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

@@ -183,6 +183,7 @@ class MainSuit extends Component{
     }
     clearTimeout(this.state.timer);
     const timer = setTimeout(function(){
+      pushMessage && pushMessage(data);
       //调搜索接口 使用模板走EditableSpan里的搜索方法
       getSearchData && getSearchData({inpStr:data,boxMark:1});
     },config.delayTime);

+ 1 - 1
src/containers/AssistCheck.js

@@ -36,7 +36,7 @@ function mapDispatchToProps(dispatch, store) {
         //右侧推送
         fetchPushInfos(){
           //调右侧推送
-          dispatch(billing);
+          dispatch(billing());
         }
     }
 }

+ 1 - 1
src/containers/CheckBody.js

@@ -51,7 +51,7 @@ function mapDispatchToProps(dispatch,state){
     //右侧推送
     fetchPushInfos(){
       //调右侧推送
-      dispatch(billing);
+      dispatch(billing());
     },
   }
 }

+ 2 - 2
src/containers/CurrentIll.js

@@ -78,7 +78,7 @@ function mapDispatchToProps(dispatch) {
          //右侧推送
          setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
            if(didPushParamChange()){     //操作后内容有变化才推送
-             dispatch(billing);
+             dispatch(billing());
            }
          },500);
        },
@@ -91,7 +91,7 @@ function mapDispatchToProps(dispatch) {
         //文本模式下推送
         fetchPushInfos(){
           //调右侧推送
-          dispatch(billing);
+          dispatch(billing());
         },
       handleInput(obj){    //文本模式值保存
         dispatch({

+ 1 - 1
src/containers/DiagnosticList.js

@@ -64,7 +64,7 @@ function mapDispatchToProps(dispatch) {
             dispatch(getTips(diagItem))
         },
         getBilling: () => {
-            dispatch(billing)
+            dispatch(billing())
         }
     }
 }

+ 1 - 1
src/containers/EditableSpan.js

@@ -172,7 +172,7 @@ function mapDispatchToProps(dispatch,state) {
       clearTimeout(timer);
       let timer = setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送
-          dispatch(billing);
+          dispatch(billing());
           clearTimeout(timer);
         }
       },config.delayPushTime);

+ 1 - 1
src/containers/Inspect.js

@@ -48,7 +48,7 @@ function mapDispatchToProps(dispatch, store) {
         //右侧推送
         fetchPushInfos(){
           //调右侧推送
-          dispatch(billing);
+          dispatch(billing());
         }
     }
 }

+ 6 - 7
src/containers/MainSuit.js

@@ -79,7 +79,7 @@ function mapDispatchToProps(dispatch) {
           //右侧推送
           setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
             if(didPushParamChange()){     //操作后内容有变化才推送
-              dispatch(billing);
+              dispatch(billing());
             }
           },500);
         },
@@ -91,9 +91,9 @@ function mapDispatchToProps(dispatch) {
       setMainSuit: (value) => {
         dispatch({type: SET_MAIN_SUIT, value})
       },
-      pushMessage() {//结构模式右侧推送
-        console.log("右侧推送接口");
-        dispatch(billing);
+      pushMessage(data) {//结构模式右侧推送
+        // console.log("右侧推送接口");
+        dispatch(billing(data));
       },
       getSearchData:(item)=>{
         getSearch(item).then((res)=>{
@@ -108,7 +108,6 @@ function mapDispatchToProps(dispatch) {
               console.log(result.msg);
             }
         });
-        dispatch(billing);
       },
       insertSearch(obj){
         dispatch({
@@ -133,14 +132,14 @@ function mapDispatchToProps(dispatch) {
         //右侧推送
           setTimeout(function(){ 
             if(didPushParamChange()){
-              dispatch(billing);
+              dispatch(billing());
             }
           },500);
       },
       fetchPushInfos(){//文本模式下推送
         //调右侧推送
         console.log('右侧推送内容');
-        dispatch(billing);
+        dispatch(billing());
       },
       handleInput(obj){   //文本模式值保存
           dispatch({

+ 1 - 1
src/containers/NumberDrop.js

@@ -125,7 +125,7 @@ function mapDispatchToProps(dispatch,store){
       clearTimeout(timer);
       let timer = setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送
-          dispatch(billing);
+          dispatch(billing());
           clearTimeout(timer);
         }
       },config.delayPushTime);

+ 1 - 1
src/containers/NumberUnitDrop.js

@@ -120,7 +120,7 @@ function mapDispatchToProps(dispatch,store){
       clearTimeout(timer);
       let timer = setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送
-          dispatch(billing);
+          dispatch(billing());
           clearTimeout(timer);
         }
       },config.delayPushTime);

+ 2 - 2
src/containers/OtherHistory.js

@@ -52,7 +52,7 @@ function mapDispatchToProps(dispatch,store){
       //右侧推送
       setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送
-          dispatch(billing);
+          dispatch(billing());
         }
       },500);
     },
@@ -78,7 +78,7 @@ function mapDispatchToProps(dispatch,store){
     //右侧推送
     fetchPushInfos(){
       //调右侧推送
-      dispatch(billing);
+      dispatch(billing());
     },
     handleInput(obj){    //文本模式值保存
       dispatch({

+ 1 - 1
src/containers/PushItemsContainer.js

@@ -30,7 +30,7 @@ function mapDispatchToProps(dispatch) {
                 type: GET_DIAGNOSTIC_STR
             });
             dispatch(isAddMainSuit())
-            dispatch(billing);
+            dispatch(billing());
         },
         billing: (checkedAssay, checkedCheck) => {
             // dispatch(billing)

+ 2 - 2
src/containers/RadioDrop.js

@@ -107,7 +107,7 @@ function mapDispatchToProps(dispatch,store){
       //右侧推送
       setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送
-          dispatch(billing);
+          dispatch(billing());
         }
       },500);
     },
@@ -127,7 +127,7 @@ function mapDispatchToProps(dispatch,store){
         type:dbEditActions[+type],
         data:{changeVal:params.changeVal,ikey:ikey}
       });
-      dispatch(billing);
+      dispatch(billing());
       dispatch({
         type:ISREAD
       })

+ 2 - 2
src/containers/SpreadDrop.js

@@ -332,7 +332,7 @@ function handleLabel(dispatch,params){
       break;
     default:
   }
-  dispatch(billing);
+  dispatch(billing());
   dispatch({
     type:ISREAD
   })
@@ -349,7 +349,7 @@ function mapDispatchToProps(dispatch,store){
       //右侧推送
       setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送
-          dispatch(billing);
+          dispatch(billing());
         }
       },500);
     },

+ 10 - 23
src/store/actions/currentIll.js

@@ -385,17 +385,13 @@ export function setRadioValue(state,action){
 //双击标签输入改变值
 export const changeLabelVal = (state,action)=>{
   const res = Object.assign({},state);
-  const {changeVal,totalVal,ikey,prefix,suffix} = action.data;
-  const index = ikey;
-  const newVal = changeVal;
-  let labText = totalVal?totalVal:newVal;
+  const index = action.data.ikey;
+  const newVal = action.data.changeVal;
   let item = res.data[index];
-  if(labText.trim()){
+  if(newVal.trim()){
     if(item){
       item.value = newVal;
-      item.labelPrefix = prefix||'';
-      item.labelSuffix = suffix||'';
-      res.saveText[index] = labText;
+      res.saveText[index] = newVal;
     }
   }else{//删除完标签内容则删除该标签
     res.data.splice(index,1);
@@ -408,22 +404,13 @@ export const changeLabelVal = (state,action)=>{
 // 数字键盘较特殊,有直接输入
 export const changeNumLabelVal = (state,action)=>{
   const res = Object.assign({},state);
-  const {changeVal,totalVal,ikey,prefix,suffix} = action.data;
-  const index = ikey;
-  const newVal = changeVal;
+  const index = action.data.ikey;
+  const newVal = action.data.changeVal;
   let item = res.data[index];
-  let labText = totalVal?totalVal:newVal;   //如单选没有前后缀
-  if(labText.trim()){
-    if(item){
-      item.value = newVal;
-      item.labelPrefix = prefix||'';
-      item.labelSuffix = suffix||'';
-    }
-    res.saveText[index] = labText;
-  }else{//删除完标签内容则删除该标签
-    res.data.splice(index,1);
-    res.saveText = fullfillText(res.data).saveText;
+  if(item){
+    item.value = newVal;
   }
+  res.saveText[index] = newVal;
   res.update = Math.random();
   return res;
 }
@@ -484,7 +471,7 @@ export function setCheckText(state,action) {
     //res.data[i].name='';      //默认显示的文字
   }
   res.saveText[i] = text;
-  res.update = Math.random();
+  res.update = Math.random();console.log(3333,action,res);
   return res;
 }
 

+ 5 - 2
src/store/async-actions/pushMessage.js

@@ -9,7 +9,8 @@ const api={
 }
 
 //获取右侧推送信息
-export const billing = (dispatch, getState) => {
+export const billing = (mdata) => {
+ return (dispatch, getState) =>{
   const state = getState();
   let url = api.push;
   if(+state.typeConfig.typeConfig===1){
@@ -25,7 +26,7 @@ export const billing = (dispatch, getState) => {
     pacs: emrData.pacs,
     sex: emrData.sex,
     vital:emrData.vital,
-    symptom: emrData.current + emrData.main
+    symptom: mdata?(emrData.current + mdata):(emrData.current + emrData.main)
   };
   storageLocal.set('emrParam',params);      //推送数据存储,用作推送前对比是否有变,有变才推送
     json(url, params).then((data) => {
@@ -63,8 +64,10 @@ export const billing = (dispatch, getState) => {
   }).catch((e) =>{
       console.log(e)
   }) 
+ }
 };
 
+
 export const getTips = (diagItem) =>{
     return (dispatch, getState) =>{
         dispatch({

+ 1 - 1
src/utils/tools.js

@@ -218,7 +218,7 @@ const getAllDataStringList =(baseList) =>{           //获取所有模块文本
       'diag' : baseList.diagnosticList.diagnosticStr,
       'advice' : baseList.pushMessage.AdviceStr
     }
-    console.log(jsonDataString,'文本模式数据获取')
+    // console.log(jsonDataString,'文本模式数据获取')
     return jsonDataString;
 }
 /**