|
@@ -138,8 +138,13 @@ export function setRadioValue(state,action){
|
|
export const setRadioInputValue = (state,action)=>{
|
|
export const setRadioInputValue = (state,action)=>{
|
|
const res = Object.assign({},state);
|
|
const res = Object.assign({},state);
|
|
const {ikey,values,id} = action.data;
|
|
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){ //清空
|
|
if(!values){ //清空
|
|
let sld=obj.find((item)=>{
|
|
let sld=obj.find((item)=>{
|
|
return item.selected==true;
|
|
return item.selected==true;
|
|
@@ -147,7 +152,18 @@ export const setRadioInputValue = (state,action)=>{
|
|
sld?sld.selected=false:'';
|
|
sld?sld.selected=false:'';
|
|
item.vals = null;
|
|
item.vals = null;
|
|
item.value = '';
|
|
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();
|
|
res.update = Math.random();
|
|
return res;
|
|
return res;
|
|
}
|
|
}
|
|
@@ -171,7 +187,15 @@ export const setRadioInputValue = (state,action)=>{
|
|
}
|
|
}
|
|
item.vals = values;
|
|
item.vals = values;
|
|
item.value = str;
|
|
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();
|
|
res.update = Math.random();
|
|
return res;
|
|
return res;
|
|
}
|
|
}
|
|
@@ -232,7 +256,7 @@ export function insertLabelData(state,action){
|
|
let res = Object.assign({},state);
|
|
let res = Object.assign({},state);
|
|
const text = Object.assign({},JSON.parse(config.textLabel));
|
|
const text = Object.assign({},JSON.parse(config.textLabel));
|
|
const searchStr = res.searchStr;
|
|
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 showText = res.saveText[index];
|
|
const spreadLabels = data.tagType==4?fullfillText(data.questionMapping).newArr:[data];
|
|
const spreadLabels = data.tagType==4?fullfillText(data.questionMapping).newArr:[data];
|
|
let reg = searchInEnd?new RegExp(searchStr+"$"):new RegExp("^"+searchStr);
|
|
let reg = searchInEnd?new RegExp(searchStr+"$"):new RegExp("^"+searchStr);
|
|
@@ -384,8 +408,23 @@ export function backspaceText(state,action){
|
|
// 单列多选
|
|
// 单列多选
|
|
export function multipleComfirn(state,action){
|
|
export function multipleComfirn(state,action){
|
|
let res = Object.assign({},state);
|
|
let res = Object.assign({},state);
|
|
- const {ikey,seleData} = action.data;
|
|
|
|
- let data = res.data;
|
|
|
|
|
|
+ const {ikey,seleData,fullIkey} = action.data;
|
|
|
|
+ let data = res.data;//console.log(action,data[ikey])
|
|
|
|
+ let index = fullIkey.substr(fullIkey.length-1,1);
|
|
|
|
+ if(data[ikey].tagType==3){ //在组合项中
|
|
|
|
+ let item = data[ikey].questionMapping;
|
|
|
|
+ let arr=[];
|
|
|
|
+ item[index].value = seleData;
|
|
|
|
+ item.map((it)=>{
|
|
|
|
+ if(it.value){
|
|
|
|
+ arr.push(it.labelPrefix+it.value+it.labelSuffix);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ res.saveText[ikey] = arr.join("");
|
|
|
|
+ res.update = Math.random();
|
|
|
|
+ res.selecteds[ikey] = {[index]:action.data};
|
|
|
|
+ return res;
|
|
|
|
+ }
|
|
data[ikey].value = seleData;
|
|
data[ikey].value = seleData;
|
|
res.saveText[ikey] = seleData;
|
|
res.saveText[ikey] = seleData;
|
|
res.selecteds[ikey] = action.data;
|
|
res.selecteds[ikey] = action.data;
|