|
@@ -110,6 +110,7 @@ export const insertMain = (state,action) => {
|
|
|
// res.saveText[inserIndx] = text.name;
|
|
|
res.saveText = fullfillText(res.data).saveText;
|
|
|
res.mainIds.push(id);
|
|
|
+ res.mainSymptIds.push(id);
|
|
|
res.editClear = false;//主诉框编辑状态
|
|
|
res.update=Math.random();
|
|
|
return res;
|
|
@@ -138,6 +139,7 @@ export const confirm = (state,action) =>{
|
|
|
let existsId = getIds(exists);
|
|
|
let withsId = getIds(withs);
|
|
|
res.mainIds = res.mainIds?res.mainIds.concat(existsId,withsId):[];
|
|
|
+ res.mainSymptIds = res.mainSymptIds.concat(existsId,withsId);
|
|
|
}
|
|
|
|
|
|
let text = saveText.slice(0,labelIndx);
|
|
@@ -362,18 +364,14 @@ 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;
|
|
|
+ const index = action.data.ikey;
|
|
|
+ const newVal = action.data.changeVal;
|
|
|
let data = res.data;
|
|
|
let item = data[index];
|
|
|
- let labText = totalVal?totalVal:newVal;
|
|
|
- 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{//删除完标签内容则删除该标签
|
|
|
|
|
@@ -404,11 +402,12 @@ export const changeNumLabelVal = (state,action)=>{
|
|
|
}else{//删除完标签内容则删除该标签
|
|
|
res.data.splice(index,1);
|
|
|
res.saveText = fullfillText(res.data).saveText;
|
|
|
- }
|
|
|
+ }
|
|
|
res.update = Math.random();//console.log(44,action,res);
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
// 保存自由输入文本--无模板
|
|
|
export const saveFreeVal = (state,action)=>{
|
|
|
const res = Object.assign({},state);
|
|
@@ -430,7 +429,8 @@ export const clearMainSuit = (state,action)=>{//回读和清除
|
|
|
res.saveText = action.saveText;
|
|
|
// res.saveText = fullfillText(action.data).saveText;//解决删除data里的值保存,回读后页面上有内容saveText里没有的情况
|
|
|
res.selecteds = action.selecteds?action.selecteds:[];
|
|
|
- res.mainIds = action.mainIds
|
|
|
+ res.mainIds = action.mainIds;
|
|
|
+ res.mainSymptIds = action.mainSymptIds;
|
|
|
if(action.editClear){
|
|
|
res.editClear = action.editClear;
|
|
|
}
|
|
@@ -510,4 +510,25 @@ export function backspaceText(state,action){
|
|
|
res.saveText = fullfillText(data).saveText;
|
|
|
res.update = Math.random();
|
|
|
return res;
|
|
|
-}
|
|
|
+}
|
|
|
+
|
|
|
+//删除后移除id
|
|
|
+export function removeId(state,action){
|
|
|
+ let res = Object.assign({},state);
|
|
|
+ const {index,text} = action;
|
|
|
+ const data = res.data;
|
|
|
+ const id = data[index].id;
|
|
|
+ let ids = res.mainIds;
|
|
|
+ let mainIds = res.mainSymptIds;
|
|
|
+ if(ids.includes(id)){
|
|
|
+ ids.splice(ids.indexOf(id),1);
|
|
|
+ }
|
|
|
+ if(mainIds.includes(id)){
|
|
|
+ mainIds.splice(mainIds.indexOf(id),1);
|
|
|
+ }
|
|
|
+ data[index].id = "";
|
|
|
+ data[index].name = text;
|
|
|
+ data[index].value = text;
|
|
|
+ res.update = Math.random();
|
|
|
+ return res;
|
|
|
+}
|