|
@@ -145,7 +145,8 @@ export const setData = (state,action) =>{
|
|
}
|
|
}
|
|
|
|
|
|
if (useEmpty) {
|
|
if (useEmpty) {
|
|
- res.data = res.emptyData&&res.emptyData.length>0?JSON.parse(JSON.stringify(res.emptyData)):moduleData;
|
|
|
|
|
|
+ const data = res.emptyData?JSON.parse(JSON.stringify(res.emptyData)):[];
|
|
|
|
+ res.data = fullfillText(data).newArr;
|
|
} else {
|
|
} else {
|
|
if(mainData&&mainData.length>0){//主诉使用模板
|
|
if(mainData&&mainData.length>0){//主诉使用模板
|
|
// 目前只需要将第一个主诉病程移植到现病史
|
|
// 目前只需要将第一个主诉病程移植到现病史
|
|
@@ -261,18 +262,21 @@ export const setData = (state,action) =>{
|
|
}
|
|
}
|
|
|
|
|
|
let symptomArr = newMainCopy.concat(manInput,newWiths,manWithInput);
|
|
let symptomArr = newMainCopy.concat(manInput,newWiths,manWithInput);
|
|
- let newSymptomArr = formatContinueDots(JSON.parse(JSON.stringify(symptomArr))); //过来连续标点
|
|
|
|
- //组装好的主症状和伴随症状插入现病史模板(flag=4前)
|
|
|
|
- let insertIdx = null;
|
|
|
|
- current.map((item,i)=>{
|
|
|
|
- if(item.flag&& item.flag==4){
|
|
|
|
- insertIdx = i;
|
|
|
|
|
|
+ let newSymptomArr = formatContinueDots(JSON.parse(JSON.stringify(symptomArr))); //过滤连续标点
|
|
|
|
+ //组装好的主症状和伴随症状插入现病史模板(flag=4前)--现病史是否有模板
|
|
|
|
+ if(moduleData&&moduleData.length>0){
|
|
|
|
+ let insertIdx = null;
|
|
|
|
+ for(let j=0; j<current.length; j++){
|
|
|
|
+ if(current[j].flag && current[j].flag==4){
|
|
|
|
+ insertIdx = j;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- })
|
|
|
|
-
|
|
|
|
- for(let k=0; k<newSymptomArr.length; k++){
|
|
|
|
- let pos = insertIdx+k;
|
|
|
|
- current.splice(pos,0,newSymptomArr[k]);
|
|
|
|
|
|
+ for(let k=0; k<newSymptomArr.length; k++){
|
|
|
|
+ let pos = insertIdx+k;
|
|
|
|
+ current.splice(pos,0,newSymptomArr[k]);
|
|
|
|
+ }
|
|
|
|
+ }else{//现病史没有模板
|
|
|
|
+ current = newSymptomArr;
|
|
}
|
|
}
|
|
let currentData = JSON.parse(JSON.stringify(current));
|
|
let currentData = JSON.parse(JSON.stringify(current));
|
|
res.data = fullfillText(currentData).newArr;
|
|
res.data = fullfillText(currentData).newArr;
|
|
@@ -307,16 +311,19 @@ export const setData = (state,action) =>{
|
|
}
|
|
}
|
|
//组装好的主症状和伴随症状插入现病史模板(flag=4前)
|
|
//组装好的主症状和伴随症状插入现病史模板(flag=4前)
|
|
let endFeatureData = JSON.parse(JSON.stringify(featureData));
|
|
let endFeatureData = JSON.parse(JSON.stringify(featureData));
|
|
- let insertIdx = null;
|
|
|
|
- for(let j=0; j<current.length; j++){
|
|
|
|
|
|
+ if(moduleData&&moduleData.length>0){
|
|
|
|
+ let insertIdx = null;
|
|
|
|
+ for(let j=0; j<current.length; j++){
|
|
if(current[j].flag && current[j].flag==4){
|
|
if(current[j].flag && current[j].flag==4){
|
|
insertIdx = j;
|
|
insertIdx = j;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- for(let k=0; k<endFeatureData.length; k++){
|
|
|
|
- let pos = insertIdx+k;
|
|
|
|
- current.splice(pos,0,endFeatureData[k]);
|
|
|
|
|
|
+ for(let k=0; k<endFeatureData.length; k++){
|
|
|
|
+ let pos = insertIdx+k;
|
|
|
|
+ current.splice(pos,0,endFeatureData[k]);
|
|
|
|
+ }
|
|
|
|
+ }else{//现病史没有模板
|
|
|
|
+ current = endFeatureData;
|
|
}
|
|
}
|
|
let currentData = JSON.parse(JSON.stringify(current));
|
|
let currentData = JSON.parse(JSON.stringify(current));
|
|
res.data = fullfillText(currentData).newArr;
|
|
res.data = fullfillText(currentData).newArr;
|
|
@@ -338,7 +345,7 @@ export const confirm = (state,action) =>{
|
|
let res = Object.assign({},state);
|
|
let res = Object.assign({},state);
|
|
let length1 = res.data.length;
|
|
let length1 = res.data.length;
|
|
let arr = JSON.parse(JSON.stringify(res.data));
|
|
let arr = JSON.parse(JSON.stringify(res.data));
|
|
- const {nones,exists,withs,ikey,exclusion,excluName,ban,noneIds} = action.data;console.log(111,action)
|
|
|
|
|
|
+ const {nones,exists,withs,ikey,exclusion,excluName,ban,noneIds} = action.data;
|
|
let existsId = exists && exists.length>0?getIds(exists):[];
|
|
let existsId = exists && exists.length>0?getIds(exists):[];
|
|
let withsId = withs && withs.length>0?getIds(withs):[];
|
|
let withsId = withs && withs.length>0?getIds(withs):[];
|
|
res.symptomIds = res.symptomIds.concat(existsId,withsId,noneIds);//搜索去重
|
|
res.symptomIds = res.symptomIds.concat(existsId,withsId,noneIds);//搜索去重
|
|
@@ -594,7 +601,10 @@ export const changeLabelVal = (state,action)=>{
|
|
localStorage.setItem('radio'+item.id,JSON.stringify([li]));
|
|
localStorage.setItem('radio'+item.id,JSON.stringify([li]));
|
|
}
|
|
}
|
|
//取消原选中状态
|
|
//取消原选中状态
|
|
- item.questionDetailList.find((it)=>it.selected==true).selected=false;
|
|
|
|
|
|
+ const seld = item.questionDetailList.find((it)=>it.selected==true);
|
|
|
|
+ if(seld){
|
|
|
|
+ seld.selected=false;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
item.labelPrefix = prefix||'';
|
|
item.labelPrefix = prefix||'';
|
|
item.labelSuffix = suffix||'';
|
|
item.labelSuffix = suffix||'';
|
|
@@ -603,7 +613,8 @@ export const changeLabelVal = (state,action)=>{
|
|
}else{//删除完标签内容则删除该标签
|
|
}else{//删除完标签内容则删除该标签
|
|
const num = nextIsDot?2:1;
|
|
const num = nextIsDot?2:1;
|
|
res.data.splice(index,num);
|
|
res.data.splice(index,num);
|
|
- res.saveText = fullfillText(res.data).saveText;
|
|
|
|
|
|
+ res.saveText.splice(index,num);
|
|
|
|
+ // res.saveText = fullfillText(res.data).saveText;
|
|
}
|
|
}
|
|
res.update = Math.random();
|
|
res.update = Math.random();
|
|
return res;
|
|
return res;
|
|
@@ -634,7 +645,8 @@ export const changeNumLabelVal = (state,action)=>{
|
|
}else{//删除完标签内容则删除该标签
|
|
}else{//删除完标签内容则删除该标签
|
|
const num = nextIsDot?2:1;
|
|
const num = nextIsDot?2:1;
|
|
res.data.splice(index,num);
|
|
res.data.splice(index,num);
|
|
- res.saveText = fullfillText(res.data).saveText;
|
|
|
|
|
|
+ res.saveText.splice(index,num);
|
|
|
|
+ // res.saveText = fullfillText(res.data).saveText;
|
|
}
|
|
}
|
|
res.update = Math.random();
|
|
res.update = Math.random();
|
|
return res;
|
|
return res;
|
|
@@ -729,7 +741,7 @@ export function insertLabelData(state,action){
|
|
let resData = JSON.parse(JSON.stringify(res.data));
|
|
let resData = JSON.parse(JSON.stringify(res.data));
|
|
resData.splice(focusIndex,1,text,...(FilteredDotMapping2));
|
|
resData.splice(focusIndex,1,text,...(FilteredDotMapping2));
|
|
res.data = fullfillText(resData).newArr;
|
|
res.data = fullfillText(resData).newArr;
|
|
- res.saveText[focusIndex] = searchData;
|
|
|
|
|
|
+ res.saveText = fullfillText(res.data).saveText;
|
|
}else{
|
|
}else{
|
|
let resData;
|
|
let resData;
|
|
const searchStr = res.searchStr;
|
|
const searchStr = res.searchStr;
|
|
@@ -898,7 +910,6 @@ export function removeId(state,action){
|
|
data[index].name = text;
|
|
data[index].name = text;
|
|
data[index].value = text;
|
|
data[index].value = text;
|
|
}
|
|
}
|
|
- //console.log(345,action,res);
|
|
|
|
res.update = Math.random();
|
|
res.update = Math.random();
|
|
return res;
|
|
return res;
|
|
}
|
|
}
|
|
@@ -907,7 +918,7 @@ export function removeId(state,action){
|
|
export function multipleComfirn(state,action){
|
|
export function multipleComfirn(state,action){
|
|
let res = Object.assign({},state);
|
|
let res = Object.assign({},state);
|
|
const {ikey,seleData,fullIkey} = action.data;
|
|
const {ikey,seleData,fullIkey} = action.data;
|
|
- let data = res.data;//console.log(action,data[ikey])
|
|
|
|
|
|
+ let data = res.data;
|
|
let index = fullIkey.substr(fullIkey.length-1,1);
|
|
let index = fullIkey.substr(fullIkey.length-1,1);
|
|
if(data[ikey].tagType==3){ //在组合项中
|
|
if(data[ikey].tagType==3){ //在组合项中
|
|
let item = data[ikey].questionMapping;
|
|
let item = data[ikey].questionMapping;
|