|
@@ -213,13 +213,17 @@ export function insertLabelData(state,action){
|
|
|
|
|
|
export function changeTextLabel(state,action) {
|
|
export function changeTextLabel(state,action) {
|
|
const res = Object.assign({},state);
|
|
const res = Object.assign({},state);
|
|
- const index = action.data.ikey;
|
|
|
|
- const newVal = action.data.changeVal;
|
|
|
|
|
|
+ const {changeVal,totalVal,ikey,prefix,suffix} = action.data;
|
|
|
|
+ const index = ikey;
|
|
|
|
+ const newVal = changeVal;
|
|
let item = res.data[index];
|
|
let item = res.data[index];
|
|
- if(newVal.trim()){
|
|
|
|
|
|
+ let labText = totalVal?totalVal:newVal;
|
|
|
|
+ if(labText.trim()){
|
|
if(item){
|
|
if(item){
|
|
item.value = newVal;
|
|
item.value = newVal;
|
|
- res.saveText[index] = newVal;
|
|
|
|
|
|
+ item.labelPrefix = prefix;
|
|
|
|
+ item.labelSuffix = suffix;
|
|
|
|
+ res.saveText[index] = labText;
|
|
}
|
|
}
|
|
}else{//删除完标签内容则删除该标签
|
|
}else{//删除完标签内容则删除该标签
|
|
res.data.splice(index,1);
|
|
res.data.splice(index,1);
|
|
@@ -232,13 +236,22 @@ export function changeTextLabel(state,action) {
|
|
// 数字键盘较特殊,有直接输入
|
|
// 数字键盘较特殊,有直接输入
|
|
export const changeNumLabelVal = (state,action)=>{
|
|
export const changeNumLabelVal = (state,action)=>{
|
|
const res = Object.assign({},state);
|
|
const res = Object.assign({},state);
|
|
- const index = action.data.ikey;
|
|
|
|
- const newVal = action.data.changeVal;
|
|
|
|
|
|
+ const {changeVal,totalVal,ikey,prefix,suffix} = action.data;
|
|
|
|
+ const index = ikey;
|
|
|
|
+ const newVal = changeVal;
|
|
let item = res.data[index];
|
|
let item = res.data[index];
|
|
- if(item){
|
|
|
|
- item.value = newVal;
|
|
|
|
- }
|
|
|
|
- res.saveText[index] = newVal;
|
|
|
|
|
|
+ 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;
|
|
|
|
+ };
|
|
res.update = Math.random();
|
|
res.update = Math.random();
|
|
return res;
|
|
return res;
|
|
}
|
|
}
|