Kaynağa Gözat

血压类型-输入框子组件存值预览bug修改2469

zhouna 5 yıl önce
ebeveyn
işleme
30fad9f2e1

+ 0 - 3
src/containers/InlineTag.js

@@ -6,9 +6,6 @@ import {SETCURRENTINPUT,CURRENT_TEXT_LABEL} from '@types/currentIll';
 import {SETCHECKINPUT} from "@types/checkBody";
 import InlineTag from "../common/components/InlineTag";
 import {getLabelIndex} from '@utils/tools.js';
-import {CHANGEOTHERTEXTLABEL} from "../store/types/otherHistory";
-import {CHANGECHECKTEXTLABEL} from "../store/types/checkBody";
-import {CHANGE_LABELVAL} from "../store/types/mainSuit";
 
 function mapStateToProps(state){
   return {}

+ 0 - 32
src/store/actions/checkBody.js

@@ -255,38 +255,6 @@ export function clearCheckBody(state,action){  //清空
   return res;
 }
 
-//文本输入标签
-export function setInputLabel(state,action){
-  let res = Object.assign({}, state);
-  const {i,text,prefix,suffix,subIndex} = action;
-  const item = res.data[i];
-  if(+item.tagType===3){      //multSpred标签
-    item.questionMapping[subIndex].value = text;
-    let texts = item.questionMapping.map((it)=>{
-      if(it.tagType===8){
-        return it.name;
-      }else{
-        return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
-      }
-      
-    });
-    res.saveText[i] = texts.join('');
-    res.update = Math.random();
-    return res;
-  }else{
-    if(item){
-      item.value=text;
-    }
-  }
-  if(text){
-    res.saveText[i] = prefix+text+suffix;
-  }else{//删除完要清空
-    res.saveText[i] = "";
-  }
-  res.update = Math.random();
-  return res;
-}
-
 // backspace删除
 export function backspaceText(state,action){
   let res = Object.assign({},state);

+ 0 - 26
src/store/actions/currentIll.js

@@ -670,32 +670,6 @@ export function addLabelItem(state,action){
   return res;
 }
 
-//文本输入标签
-export function setInputLabel(state,action){
-  let res = Object.assign({},state);
-  const {i,text,prefix,suffix,subIndex,total} = action;
-  const item = res.data[i];
-  if(+item.tagType===3){      //multSpred标签
-    item.questionMapping[subIndex].value = text;
-    let texts = item.questionMapping.map((it)=>{
-      return it.value?(it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||''):'';
-    });
-    res.saveText[i] = texts.join('');
-    res.update = Math.random();
-    return res;
-  }else{
-    if(item){
-      item.value=text;
-      res.saveText[i] = (prefix ||'')+ text + (suffix||'');
-    }else if(!total){//整个标签内容完全删除
-      res.data.splice(i,1);
-      res.saveText.splice(i,1);
-    }
-  }
-  res.update = Math.random();//console.log(888,res,action)
-  return res;
-}
-
 // backspace删除
 export function backspaceText(state,action){
   let res = Object.assign({},state);

+ 0 - 27
src/store/actions/mainSuit.js

@@ -680,33 +680,6 @@ export function addLabelItem(state,action){
   return res;
 }
 
-//文本输入标签
-export function setInputLabel(state,action){
-  let res = Object.assign({},state);//console.log(state,action)
-  const {i,text,prefix,suffix,subIndex} = action;
-  const item = res.data[i];
-  if(+item.tagType===3){      //multSpred标签
-    item.questionMapping[subIndex].value = text;
-    let texts = item.questionMapping.map((it)=>{
-      return it.value?(it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||''):'';
-    });
-    res.saveText[i] = texts.join('');
-    res.update = Math.random();
-    return res;
-  }else{
-    if(item){
-      item.value=text;
-    }
-  }
-  if(text){
-    res.saveText[i] = prefix+text+suffix;
-  }else{//删除完要清空
-    res.saveText[i] = "";
-  }
-  res.update = Math.random();
-  return res;
-}
-
 // backspace删除
 export function backspaceText(state,action){
   let res = Object.assign({},state);

+ 0 - 27
src/store/actions/otherHistory.js

@@ -64,33 +64,6 @@ export function setCheckText(state,action) {
   return res;
 }
 
-//文本输入标签
-export function setOtherInput(state,action){
-  let res = Object.assign({}, state);//console.log(state,action)
-  const {i, text, prefix, suffix, subIndex} = action;
-  const item = res.data[i];
-  if (+item.tagType === 3 || +item.tagType === 4) {      //multSpred标签
-    item.questionMapping[subIndex].value = text;
-    let texts = item.questionMapping.map((it) => {
-      return (it.labelPrefix || '') + (it.value || '') + (it.labelSuffix || '');
-    });
-    res.saveText[i] = texts.join('');
-    res.update = Math.random();
-    return res;
-  } else {
-    if (item) {
-      item.value = text;
-    }
-  }
-  if(text){
-    res.saveText[i] = prefix+text+suffix;
-  }else{//删除完要清空
-    res.saveText[i] = "";
-  }
-  res.update = Math.random();
-  return res;
-}
-
 //多选文字,如杂音
 export function setCheckBoxValue(state,action) {
   const res = Object.assign({},state);

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

@@ -16,7 +16,7 @@ const api={
 }
 
 //获取右侧推送信息
-export const billing = (mdata,boxMark) => {console.trace(122)
+export const billing = (mdata,boxMark) => {
  return (dispatch, getState) =>{
   const state = getState();
    const checkBody = state.checkBody.data;

+ 2 - 2
src/store/reducers/checkBody.js

@@ -3,9 +3,9 @@ import {RECOVER_TAG_CHECK,SET,SETNUMBER4,SETSELECTED4,SETCHECKBOX,ADDLABELITEM,S
   SETCHECKINPUT,DEL_CHECKBODY,CHECKCONFIRMSELECTED,
   CHECKBODY_MUL,DEL_CHECKBODY_LABLE,SET_CK_RADIO_INPUT_VAL,SET_IMPORT_CHECKBODY_LABEL,PRESET} from '../types/checkBody.js';
 import {recoveTag,set,setCheckBoxValue,addLabelItem,setCheckText,
-  setSearchData,insertLabelData,changeLabelVal,clearCheckBody,setInputLabel,backspaceText
+  setSearchData,insertLabelData,changeLabelVal,clearCheckBody,backspaceText
   ,confirm,multipleComfirn,delSingleLable,setImportCheckbodyLabel,preSetCheckbody} from '../actions/checkBody.js';
-import {setRadioInputValue,setRadioValue,setNumberValue} from '@utils/utils';
+import {setRadioInputValue,setRadioValue,setNumberValue,setInputLabel} from '@utils/utils';
 import config from '@config/index.js';
 
 const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签

+ 2 - 2
src/store/reducers/currentIll.js

@@ -4,9 +4,9 @@ import {RECOVER_TAG_CURRENT,SET_CURRENT,CURRENT_CONFIRM,INSERT_PROCESS,SET_CURRE
   SET_CURRENT_SEARCH,SETCURRENTTEXT,CURRENT_FOCUS_INDEX,SELECT_SEARCHDATA,CLEAR_CURRENT_EDIT,CURRENTADDLABELITEM,
   SETCURRENTINPUT,DEL_CURRENT,REMOVE_CURR_ID,CURRENT_MUL,DEL_CURRENT_LABLE,SET_RADIO_INPUT_VALUE,CURRENT_CHRONIC,SAVE_CURR_FREE} from '../types/currentIll';
 import {recoveTag,confirm,insertProcess,setData,setCheckBox,changeLabelVal,clearCurrentIll,
-  setTextModeValue,setModule,bigDataSymptom,setCheckText,insertLabelData,clearCurrentEdit,addLabelItem,setInputLabel,
+  setTextModeValue,setModule,bigDataSymptom,setCheckText,insertLabelData,clearCurrentEdit,addLabelItem,
   backspaceText,removeId,multipleComfirn,delSingleLable,fillChronicModule} from '../actions/currentIll';
-import {setRadioInputValue,setRadioValue,setNumberValue} from '@utils/utils';
+import {setRadioInputValue,setRadioValue,setNumberValue,setInputLabel} from '@utils/utils';
 
 const initState = {
   moduleData:[],

+ 2 - 2
src/store/reducers/mainSuit.js

@@ -5,9 +5,9 @@ import {RECOVER_TAG_MAIN,COMM_SYMPTOMS,CLEAR_COMSYMPTOMS,SHOW_TAIL,INSERT_MAIN,
   REMOVE_MAIN_ID,MAINSUIT_MUL,DEL_MAIN_LABLE,SET_FEATURE,SET_MS_RADIO_INPUT_VAL,SAVE_CHRONIC,MAIN_REMOVE_SPAN,SET_ADD_SEARCH,CLEAR_ADD_SEARCH} from '../types/mainSuit'
 import {recoveTag,getCommSymptoms,handleTailClick,insertMain,setSearch,getBigSymptom,setMainMoudle,confirm,
   commConfirm,changeLabelVal,saveFreeVal,clearMainSuit,insertSearch,setTextModeValue,setCheckText,
-  addLabelItem,setInputLabel,backspaceText,removeId,multipleComfirn,delSingleLable,
+  addLabelItem,backspaceText,removeId,multipleComfirn,delSingleLable,
   getSymptomFeature} from '../actions/mainSuit'
-import {setRadioInputValue,setNumberValue,setRadioValue} from '@utils/utils';
+import {setRadioInputValue,setNumberValue,setRadioValue,setInputLabel} from '@utils/utils';
 
 const initState = {
   showDrop:false,

+ 3 - 3
src/store/reducers/otherHistory.js

@@ -2,9 +2,9 @@ import {RECOVER_TAG_OTHER,SETDATA,CONFIRMSELECTED,SETRADIO,SETNUMBER,SETOTHERCHE
   SELECTOTHERSEARCHDATA,CLEAROTHERHISTORY,CHANGEOTHERTEXTLABEL,SETOTHERINPUT,SETTEXTMODEVALUE,OTHER_FOCUS_INDEX,OTHERHIS_CLEAR,
   OTHERADDLABELITEM,OTHEREDICLEAR,DEL_OTHERHIS,OTHERHIS_MUL,REMOVE_OTHER_ID,DEL_OTHERHIS_LABLE,SET_OT_RADIO_INPUT_VAL} from '../types/otherHistory';
 import {recoveTag,confirm,setCheckBoxValue,setCheckText,setSearchData,insertLabelData,clearOtherHistory,
-  changeTextLabel,setOtherInput,setTextModeValue,addLabelItem,otherEditClear,backspaceText,multipleComfirn,
+  changeTextLabel,setTextModeValue,addLabelItem,otherEditClear,backspaceText,multipleComfirn,
   removeId,delSingleLable} from '../actions/otherHistory';
-import {setRadioInputValue,setRadioValue,setNumberValue} from '@utils/utils';
+import {setRadioInputValue,setRadioValue,setNumberValue,setInputLabel} from '@utils/utils';
 import config from '@config/index';
 
 const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签
@@ -52,7 +52,7 @@ export default function(state=initState,action){//console.log(state)
     case CHANGEOTHERTEXTLABEL:
       return changeTextLabel(state,action);
     case SETOTHERINPUT:
-      return setOtherInput(state,action);
+      return setInputLabel(state,action);
     case SETTEXTMODEVALUE:
       return setTextModeValue(state,action);
     case OTHERADDLABELITEM:

+ 32 - 0
src/utils/utils.js

@@ -135,6 +135,38 @@ export const setRadioInputValue = (state,action)=>{
   return res;
 }
 
+//文本输入标签inlineTag值保存
+export function setInputLabel(state,action){
+  let res = Object.assign({}, state);
+  const {i,text,prefix,suffix,subIndex} = action;
+  const item = res.data[i];
+  if(+item.tagType===3){      //multSpred标签
+    item.questionMapping[subIndex].value = text;
+    let texts = item.questionMapping.map((it)=>{
+      if(it.tagType===8){
+        return it.name;
+      }else{
+        return it.value?(it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||''):'';
+      }
+
+    });
+    res.saveText[i] = texts.join('');
+    res.update = Math.random();
+    return res;
+  }else{
+    if(item){
+      item.value=text;
+    }
+  }
+  if(text){
+    res.saveText[i] = prefix+text+suffix;
+  }else{//删除完要清空
+    res.saveText[i] = "";
+  }
+  res.update = Math.random();
+  return res;
+}
+
 //获取大数据推送结果:
 // type需推送的类型,symData症状相关的内容(symptom入参),save参数是否要保存到本地做变化对比
 export async function getBigPush(type,symData,save){