|
@@ -37,21 +37,21 @@ export const confirm = (state,action) =>{
|
|
|
return res;
|
|
|
}
|
|
|
//有,伴,无随配
|
|
|
- //arr.splice(ikey-1,1);
|
|
|
- let flabel = items[items.length-1]; //要插入的最后一个标签
|
|
|
- let labelText = flabel.value!==undefined?flabel.value:flabel.name;
|
|
|
- let text = labelText;
|
|
|
- //要插入的最后一个标签为自由文本,则和后面的文本标签文字合并
|
|
|
- if(flabel.tagType==8){
|
|
|
- flabel.value = labelText+nones;
|
|
|
- text = flabel.value;
|
|
|
- }
|
|
|
- arr.splice(ikey,0,...exists,...withs);
|
|
|
- //arr[ikey-1].value = text;
|
|
|
- //res.saveText[ikey+items.length] = text;
|
|
|
- res.saveText = fullfillText(arr).saveText;
|
|
|
- res.update=Math.random(); //用于触发组件更新(data变化了因在对象中无法被组件检测到)
|
|
|
- return res;
|
|
|
+ //arr.splice(ikey-1,1);
|
|
|
+ let flabel = items[items.length-1]; //要插入的最后一个标签
|
|
|
+ let labelText = flabel.value!==undefined?flabel.value:flabel.name;
|
|
|
+ let text = labelText;
|
|
|
+ //要插入的最后一个标签为自由文本,则和后面的文本标签文字合并
|
|
|
+ if(flabel.tagType==8){
|
|
|
+ flabel.value = labelText+nones;
|
|
|
+ text = flabel.value;
|
|
|
+ }
|
|
|
+ arr.splice(ikey,0,...exists,...withs);
|
|
|
+ //arr[ikey-1].value = text;
|
|
|
+ //res.saveText[ikey+items.length] = text;
|
|
|
+ res.saveText = fullfillText(arr).saveText;
|
|
|
+ res.update=Math.random(); //用于触发组件更新(data变化了因在对象中无法被组件检测到)
|
|
|
+ return res;
|
|
|
};
|
|
|
|
|
|
//单选下拉选中
|
|
@@ -269,14 +269,14 @@ export const changeNumLabelVal = (state,action)=>{
|
|
|
}
|
|
|
|
|
|
export function clearOtherHistory(state,action){ //清空数据
|
|
|
- let res = Object.assign({},state);
|
|
|
- res.data = action.data;
|
|
|
- res.saveText = action.saveText;
|
|
|
- res.selecteds = action.selecteds;
|
|
|
- res.editClear = action.editClear;
|
|
|
- res.isEmpty = action.isEmpty;
|
|
|
- return res;
|
|
|
- }
|
|
|
+ let res = Object.assign({},state);
|
|
|
+ res.data = action.data;
|
|
|
+ res.saveText = action.saveText;
|
|
|
+ res.selecteds = action.selecteds;
|
|
|
+ res.editClear = action.editClear;
|
|
|
+ res.isEmpty = action.isEmpty;
|
|
|
+ return res;
|
|
|
+}
|
|
|
//文本模式下值保存
|
|
|
export const setTextModeValue = (state,action)=>{
|
|
|
const res = Object.assign({},state);
|
|
@@ -286,19 +286,19 @@ export const setTextModeValue = (state,action)=>{
|
|
|
|
|
|
//复制标签(如血压)事件
|
|
|
export function addLabelItem(state,action){
|
|
|
- let res = Object.assign({},state);
|
|
|
- const {data,i} = action;
|
|
|
- const textLabel = JSON.parse(config.textLabel);
|
|
|
- //使用Object.assign({},data)拷贝操作时复制项和原项会同步修改
|
|
|
- if(!data) return res;
|
|
|
- res.data.splice(i+1,0,JSON.parse(data),textLabel);
|
|
|
- res.update = Math.random();
|
|
|
- return res;
|
|
|
+ let res = Object.assign({},state);
|
|
|
+ const {data,i} = action;
|
|
|
+ const textLabel = JSON.parse(config.textLabel);
|
|
|
+ //使用Object.assign({},data)拷贝操作时复制项和原项会同步修改
|
|
|
+ if(!data) return res;
|
|
|
+ res.data.splice(i+1,0,JSON.parse(data),textLabel);
|
|
|
+ res.update = Math.random();
|
|
|
+ return res;
|
|
|
}
|
|
|
export const otherEditClear = (state,action)=>{
|
|
|
- const res = Object.assign({},state);
|
|
|
- res.editClear = action.bool;
|
|
|
- return res;
|
|
|
+ const res = Object.assign({},state);
|
|
|
+ res.editClear = action.bool;
|
|
|
+ return res;
|
|
|
};
|
|
|
|
|
|
// backspace删除
|
|
@@ -307,7 +307,7 @@ export function backspaceText(state,action){
|
|
|
const {delIndex} = action;
|
|
|
const data = res.data;
|
|
|
if(data[delIndex-1].flag&&data[delIndex-1].flag==3){
|
|
|
- // if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
|
|
|
+ // if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
|
|
|
// 前一个是文本标签或者子模板 不做处理
|
|
|
}else if(data[delIndex-1].tagType==8){
|
|
|
data.splice(delIndex,1);
|
|
@@ -330,7 +330,7 @@ export function removeId(state,action){
|
|
|
if(!data[index].value && data[index-1].tagType==8){
|
|
|
data.splice(index,1);
|
|
|
res.saveText.splice(index,1);
|
|
|
- }
|
|
|
+ }
|
|
|
res.update = Math.random();
|
|
|
return res;
|
|
|
}
|