|
@@ -167,16 +167,19 @@ export const confirm = (state,action) =>{
|
|
|
// 第二病程-伴位置处理
|
|
|
let forwardId;
|
|
|
let text;
|
|
|
- for(let n=labelIndx-1; n>0; n--){
|
|
|
+ for(let n=labelIndx-1; n>=0; n--){
|
|
|
// if(arr[n].id==8){
|
|
|
if(arr[n].flag && arr[n].flag==1){//添加症状打标flag=1
|
|
|
forwardId = n;
|
|
|
- continue;
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
if(forwardId){
|
|
|
text = saveText.slice(forwardId,labelIndx);
|
|
|
let index = text.indexOf('伴');
|
|
|
+ let sliceArr = arr.slice(forwardId,labelIndx);
|
|
|
+ let newSliceArr = JSON.parse(JSON.stringify(sliceArr));
|
|
|
+
|
|
|
if(index==-1){//没有伴,直接插入ikey前
|
|
|
if(exists.length > 0){
|
|
|
let withsAddP = addPoint(exists,1);
|
|
@@ -200,17 +203,27 @@ export const confirm = (state,action) =>{
|
|
|
}
|
|
|
}else{//有伴
|
|
|
if(exists.length > 0){
|
|
|
- for(let i=0; i<exists.length; i++){
|
|
|
- let pos = index + i;
|
|
|
- arr.splice(pos,0,getTextLabel(exists[i].id,'、'+exists[i].name,1));
|
|
|
- res.saveText[pos] = exists[i].name;
|
|
|
+ // 判断前面是否已有主症状--是否加顿号、
|
|
|
+ let existsAddP,startInd;
|
|
|
+ for(let m=0; m<newSliceArr.length; m++){
|
|
|
+ if(newSliceArr[m].exist && newSliceArr[m].exist==1){
|
|
|
+ startInd = 0;
|
|
|
+ break;
|
|
|
+ }else{
|
|
|
+ startInd = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ existsAddP = addPoint(exists,startInd);
|
|
|
+ for(let i=0; i<existsAddP.length; i++){
|
|
|
+ let pos = forwardId + index + i;
|
|
|
+ arr.splice(pos,0,getTextLabel(existsAddP[i].id,existsAddP[i].name,1));
|
|
|
+ res.saveText[pos] = existsAddP[i].name;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if(withs.length>0){//有伴插到ikey前既可
|
|
|
let withsAddP = addPoint(withs,0);
|
|
|
for(let j=0; j<withsAddP.length; j++){
|
|
|
- // let withsPos = labelIndx + j;
|
|
|
let withsPos = labelIndx +length + j;
|
|
|
arr.splice(withsPos,0,getTextLabel(withsAddP[j].id,withsAddP[j].name,2));
|
|
|
res.saveText[withsPos] = withsAddP[j].name;
|
|
@@ -229,9 +242,6 @@ export const confirm = (state,action) =>{
|
|
|
}
|
|
|
}
|
|
|
if(withs.length > 0){
|
|
|
- /*for(let k=1; k<withs.length; k++){
|
|
|
- withs[k].name = '、'+ withs[k].name;
|
|
|
- }*/
|
|
|
let withsAddP = addPoint(withs,1);
|
|
|
let newWiths = JSON.parse(JSON.stringify(withsAddP));
|
|
|
if(banText){
|
|
@@ -255,7 +265,6 @@ export const confirm = (state,action) =>{
|
|
|
if(withs.length>0){//有伴插到ikey前既可
|
|
|
let withsAddP = addPoint(withs,0);
|
|
|
for(let j=0; j<withsAddP.length; j++){
|
|
|
- // let withsPos = labelIndx + j;
|
|
|
let withsPos = labelIndx +length + j;
|
|
|
arr.splice(withsPos,0,getTextLabel(withsAddP[j].id,withsAddP[j].name,2));
|
|
|
res.saveText[withsPos] = withsAddP[j].name;
|
|
@@ -384,19 +393,22 @@ export const insertSearch = (state,action)=>{
|
|
|
if(index < 1){//前
|
|
|
if(data[focusIndex].value==searchStr){//为空标签则替换
|
|
|
res.data.splice(focusIndex,1,nText);
|
|
|
+ res.saveText.splice(focusIndex,1,searchData);
|
|
|
}else{
|
|
|
res.data.splice(focusIndex,0,nText);
|
|
|
+ res.saveText.splice(focusIndex,0,searchData);
|
|
|
res.data[focusIndex+1].value = value;
|
|
|
res.saveText[focusIndex+1] = value;
|
|
|
}
|
|
|
}else{
|
|
|
res.data.splice(focusIndex+1,0,nText);
|
|
|
+ res.saveText.splice(focusIndex+1,0,searchData);
|
|
|
res.data[focusIndex].value = value;
|
|
|
}
|
|
|
span.current.innerText?(span.current.innerText = value):(span.current.innerHTML=value);
|
|
|
res.mainIds.push(id);
|
|
|
}
|
|
|
- res.saveText = fullfillText(res.data).saveText;
|
|
|
+ // console.log(456,res,action);
|
|
|
res.update=Math.random();
|
|
|
return res;
|
|
|
}
|