|
@@ -138,8 +138,13 @@ export function setRadioValue(state,action){
|
|
|
export const setRadioInputValue = (state,action)=>{
|
|
|
const res = Object.assign({},state);
|
|
|
const {ikey,values,id} = action.data;
|
|
|
- const item = res.data[ikey];
|
|
|
- let str='',temp='',obj=res.data[ikey].questionDetailList;
|
|
|
+ let index = getLabelIndex(ikey);
|
|
|
+ let innerInx = ikey.substr(ikey.length-1);
|
|
|
+ let item = res.data[index];
|
|
|
+ if(item.tagType==3){ //在组合项中
|
|
|
+ item = res.data[index].questionMapping[innerInx];
|
|
|
+ }
|
|
|
+ let str='',temp='',obj=item.questionDetailList;
|
|
|
if(!values){ //清空
|
|
|
let sld=obj.find((item)=>{
|
|
|
return item.selected==true;
|
|
@@ -147,7 +152,18 @@ export const setRadioInputValue = (state,action)=>{
|
|
|
sld?sld.selected=false:'';
|
|
|
item.vals = null;
|
|
|
item.value = '';
|
|
|
- res.saveText[ikey] = '';
|
|
|
+ if(res.data[index].tagType==3){
|
|
|
+ let hasValue = false;
|
|
|
+ const sub = res.data[index].questionMapping.map((it)=>{
|
|
|
+ if(it.value){ //至少有一个子值才黑显
|
|
|
+ hasValue = true;
|
|
|
+ }
|
|
|
+ return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
|
|
|
+ });
|
|
|
+ res.saveText[index] = hasValue?sub.join(''):'';
|
|
|
+ }else{
|
|
|
+ res.saveText[index] = '';
|
|
|
+ }
|
|
|
res.update = Math.random();
|
|
|
return res;
|
|
|
}
|
|
@@ -171,7 +187,15 @@ export const setRadioInputValue = (state,action)=>{
|
|
|
}
|
|
|
item.vals = values;
|
|
|
item.value = str;
|
|
|
- res.saveText[ikey] = str;
|
|
|
+ if(res.data[index].tagType==3){
|
|
|
+ let hasValue = false;
|
|
|
+ const sub = res.data[index].questionMapping.map((it)=>{
|
|
|
+ return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
|
|
|
+ });
|
|
|
+ res.saveText[index] = sub.join('');
|
|
|
+ }else {
|
|
|
+ res.saveText[ikey] = str;
|
|
|
+ }
|
|
|
res.update = Math.random();
|
|
|
return res;
|
|
|
}
|
|
@@ -232,7 +256,7 @@ export function insertLabelData(state,action){
|
|
|
let res = Object.assign({},state);
|
|
|
const text = Object.assign({},JSON.parse(config.textLabel));
|
|
|
const searchStr = res.searchStr;
|
|
|
- const {index,data,isReplace,span,searchInEnd}=action;console.log("查体",data);
|
|
|
+ const {index,data,isReplace,span,searchInEnd}=action;
|
|
|
const showText = res.saveText[index];
|
|
|
const spreadLabels = data.tagType==4?fullfillText(data.questionMapping).newArr:[data];
|
|
|
let reg = searchInEnd?new RegExp(searchStr+"$"):new RegExp("^"+searchStr);
|