|
@@ -579,9 +579,8 @@ export function setNumberValue(state,action){
|
|
|
const param = action.params;
|
|
|
const index = param.ikey;
|
|
|
let labelInx = getLabelIndex(index);
|
|
|
- const subInx = index.split("-")[2];//index.substr(index.length-1);
|
|
|
+ const subInx = index.split("-")[2];
|
|
|
let item = res.data[labelInx];
|
|
|
- // if(param.text.trim()){
|
|
|
if(+item.tagType===1){
|
|
|
item.value = param.text;
|
|
|
res.saveText[labelInx] = param.text?item.labelPrefix+param.text+item.labelSuffix:'';
|
|
@@ -592,16 +591,19 @@ export function setNumberValue(state,action){
|
|
|
if(it.value){ //至少有一个子值才黑显
|
|
|
hasValue = true;
|
|
|
}
|
|
|
- return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
|
|
|
+ if(it.tagType===8){
|
|
|
+ return it.name;
|
|
|
+ }else{
|
|
|
+ if(!it.value){
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
|
|
|
+ }
|
|
|
});
|
|
|
// res.saveText[labelInx] = sub.join(',');
|
|
|
res.saveText[labelInx] = hasValue?sub.join(''):'';
|
|
|
item.value = sub.join('');
|
|
|
}
|
|
|
- /*}else{//删除完标签内容则删除该标签
|
|
|
- res.data.splice(labelInx,1);
|
|
|
- res.saveText = fullfillText(res.data).saveText;
|
|
|
- }*/
|
|
|
res.update = Math.random();
|
|
|
return res;
|
|
|
}
|
|
@@ -611,13 +613,8 @@ export function setRadioValue(state,action){
|
|
|
let res = Object.assign({},state);
|
|
|
const {ikey,id,text} = action;
|
|
|
let labelInx = getLabelIndex(ikey);
|
|
|
- const subInx = ikey.split("-")[2]//ikey.substr(ikey.length-1);
|
|
|
+ const subInx = ikey.split("-")[2];
|
|
|
let item = res.data[labelInx];
|
|
|
- if(typeof text != 'string'){ //需要展开项--有无治疗类型
|
|
|
- const len = +item.copyType === 0?1:0;
|
|
|
- res.data.splice(labelInx,len,text);
|
|
|
- return res;
|
|
|
- }
|
|
|
if(+item.tagType===1){
|
|
|
item.value = text;
|
|
|
res.saveText[labelInx] = item.labelPrefix+text+item.labelSuffix;
|
|
@@ -644,7 +641,14 @@ export function setRadioValue(state,action){
|
|
|
if(it.value){ //至少有一个子值才黑显
|
|
|
hasValue = true;
|
|
|
}
|
|
|
- return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
|
|
|
+ if(it.tagType===8){
|
|
|
+ return it.name;
|
|
|
+ }else{
|
|
|
+ if(!it.value){
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
|
|
|
+ }
|
|
|
});
|
|
|
// res.saveText[labelInx] = sub.join(',');
|
|
|
res.saveText[labelInx] = hasValue?sub.join(''):'';
|
|
@@ -654,71 +658,6 @@ export function setRadioValue(state,action){
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
-//单选带输入值保存
|
|
|
-export const setRadioInputValue = (state,action)=>{
|
|
|
- const res = Object.assign({},state);
|
|
|
- const {ikey,values,id} = action.data;
|
|
|
- let index = getLabelIndex(ikey);
|
|
|
- let innerInx = ikey.split("-")[2];//ikey.substr(ikey.length-1);
|
|
|
- let item = res.data[index];
|
|
|
- if(item.tagType!=1){ //在组合项中
|
|
|
- item = res.data[index].questionMapping[innerInx];
|
|
|
- }
|
|
|
- let str='',temp='',obj=item.questionDetailList;
|
|
|
- if(!values){ //清空
|
|
|
- let sld=obj.find((item)=>{
|
|
|
- return item.selected==true;
|
|
|
- });
|
|
|
- sld?sld.selected=false:'';
|
|
|
- item.vals = null;
|
|
|
- item.value = '';
|
|
|
- if(res.data[index].tagType!=1){
|
|
|
- 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;
|
|
|
- }
|
|
|
- for(let i in values){
|
|
|
- temp = values[i];
|
|
|
- if(typeof temp=='object'){
|
|
|
- str+=temp.value;
|
|
|
- }else{
|
|
|
- str+=temp;
|
|
|
- }
|
|
|
- }
|
|
|
- //选中状态
|
|
|
- if(id){
|
|
|
- obj.map((its)=>{
|
|
|
- if(its.id === id){
|
|
|
- its.selected = true;
|
|
|
- }else{
|
|
|
- its.selected = false;
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- item.vals = values;
|
|
|
- item.value = str;
|
|
|
- if(res.data[index].tagType!=1){
|
|
|
- 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[index] = str;
|
|
|
- }
|
|
|
- res.update = Math.random();
|
|
|
- return res;
|
|
|
-}
|
|
|
//双击标签输入改变值
|
|
|
export const changeLabelVal = (state,action)=>{
|
|
|
const res = Object.assign({},state);
|