|
@@ -581,7 +581,7 @@ export function setCheckText(state,action) {
|
|
|
//搜索 插入标签数据
|
|
|
export function insertLabelData(state,action){
|
|
|
let res = Object.assign({},state);
|
|
|
- const {index,data,isReplace,span}=action;console.log('现病史搜索数据',action);
|
|
|
+ const {index,data,isReplace,span}=action;
|
|
|
let id = data.id;
|
|
|
let searchData = action.name;
|
|
|
// res.symptomIds.push(id);
|
|
@@ -679,11 +679,23 @@ export function insertLabelData(state,action){
|
|
|
res.saveText = fullfillText(resData).saveText;
|
|
|
}else{//标签
|
|
|
if(strIndex < 1){//前
|
|
|
- res.data.splice(focusIndex,0,data,textEmpty);
|
|
|
- res.saveText.splice(focusIndex,0,'','');
|
|
|
- res.selecteds.splice(focusIndex,0,null,null);
|
|
|
- res.data[focusIndex+1].value = value;
|
|
|
- res.saveText[focusIndex+1] = value;
|
|
|
+ // 判断前一个是否为文本标签,是直接插入标签,不是则在前面插入一个空文本标签
|
|
|
+ const preItem = res.data[focusIndex-1];
|
|
|
+ if(preItem&&preItem.tagType==8){
|
|
|
+ res.data.splice(focusIndex,0,data);
|
|
|
+ res.saveText.splice(focusIndex,0,'','');
|
|
|
+ res.selecteds.splice(focusIndex,0,null,null);
|
|
|
+ res.data[focusIndex+1].value = value;
|
|
|
+ res.saveText[focusIndex+1] = value;
|
|
|
+ }else{
|
|
|
+ res.data.splice(focusIndex,0,textEmpty,data);
|
|
|
+ res.saveText.splice(focusIndex,0,'','');
|
|
|
+ res.selecteds.splice(focusIndex,0,null,null);
|
|
|
+ res.data[focusIndex+2].value = value;
|
|
|
+ res.saveText[focusIndex+2] = value;
|
|
|
+ }
|
|
|
+ // res.data.splice(focusIndex,0,data,textEmpty);
|
|
|
+
|
|
|
}else{
|
|
|
res.data.splice(focusIndex+1,0,data,textEmpty);
|
|
|
res.saveText.splice(focusIndex+1,0,'','');
|
|
@@ -697,7 +709,7 @@ export function insertLabelData(state,action){
|
|
|
// res.saveText = fullfillText(resData).saveText;
|
|
|
}
|
|
|
res.searchData = []; //选中清空搜索内容(即关闭搜索弹窗)
|
|
|
- res.update = Math.random();
|
|
|
+ res.update = Math.random();//console.log('现病史',res);
|
|
|
return res;
|
|
|
}
|
|
|
|