瀏覽代碼

其他史血压类型可输入bug修改

zhouna 6 年之前
父節點
當前提交
499aa89a01
共有 2 個文件被更改,包括 16 次插入5 次删除
  1. 1 1
      src/store/actions/checkBody.js
  2. 15 4
      src/store/actions/otherHistory.js

+ 1 - 1
src/store/actions/checkBody.js

@@ -421,7 +421,7 @@ export function clearCheckBody(state,action){  //清空
 
 //文本输入标签
 export function setInputLabel(state,action){
-  let res = Object.assign({},state);//console.log(state,action)
+  let res = Object.assign({}, state);
   const {i,text,prefix,suffix,subIndex} = action;
   const item = res.data[i];
   if(+item.tagType===3){      //multSpred标签

+ 15 - 4
src/store/actions/otherHistory.js

@@ -210,10 +210,21 @@ export function setCheckText(state,action) {
 
 //文本输入标签
 export function setOtherInput(state,action){
-  let res = Object.assign({},state);
-  const {i,text,prefix,suffix} = action;
-  if(res.data[i]){
-    res.data[i].value=text;
+  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;