|
@@ -385,17 +385,13 @@ export function setRadioValue(state,action){
|
|
|
//双击标签输入改变值
|
|
|
export const changeLabelVal = (state,action)=>{
|
|
|
const res = Object.assign({},state);
|
|
|
- const {changeVal,totalVal,ikey,prefix,suffix} = action.data;
|
|
|
- const index = ikey;
|
|
|
- const newVal = changeVal;
|
|
|
- let labText = totalVal?totalVal:newVal;
|
|
|
+ const index = action.data.ikey;
|
|
|
+ const newVal = action.data.changeVal;
|
|
|
let item = res.data[index];
|
|
|
- if(labText.trim()){
|
|
|
+ if(newVal.trim()){
|
|
|
if(item){
|
|
|
item.value = newVal;
|
|
|
- item.labelPrefix = prefix||'';
|
|
|
- item.labelSuffix = suffix||'';
|
|
|
- res.saveText[index] = labText;
|
|
|
+ res.saveText[index] = newVal;
|
|
|
}
|
|
|
}else{//删除完标签内容则删除该标签
|
|
|
res.data.splice(index,1);
|
|
@@ -408,22 +404,13 @@ export const changeLabelVal = (state,action)=>{
|
|
|
// 数字键盘较特殊,有直接输入
|
|
|
export const changeNumLabelVal = (state,action)=>{
|
|
|
const res = Object.assign({},state);
|
|
|
- const {changeVal,totalVal,ikey,prefix,suffix} = action.data;
|
|
|
- const index = ikey;
|
|
|
- const newVal = changeVal;
|
|
|
+ const index = action.data.ikey;
|
|
|
+ const newVal = action.data.changeVal;
|
|
|
let item = res.data[index];
|
|
|
- let labText = totalVal?totalVal:newVal; //如单选没有前后缀
|
|
|
- if(labText.trim()){
|
|
|
- if(item){
|
|
|
- item.value = newVal;
|
|
|
- item.labelPrefix = prefix||'';
|
|
|
- item.labelSuffix = suffix||'';
|
|
|
- }
|
|
|
- res.saveText[index] = labText;
|
|
|
- }else{//删除完标签内容则删除该标签
|
|
|
- res.data.splice(index,1);
|
|
|
- res.saveText = fullfillText(res.data).saveText;
|
|
|
+ if(item){
|
|
|
+ item.value = newVal;
|
|
|
}
|
|
|
+ res.saveText[index] = newVal;
|
|
|
res.update = Math.random();
|
|
|
return res;
|
|
|
}
|
|
@@ -484,7 +471,7 @@ export function setCheckText(state,action) {
|
|
|
//res.data[i].name=''; //默认显示的文字
|
|
|
}
|
|
|
res.saveText[i] = text;
|
|
|
- res.update = Math.random();
|
|
|
+ res.update = Math.random();console.log(3333,action,res);
|
|
|
return res;
|
|
|
}
|
|
|
|