|
@@ -63,12 +63,10 @@ export const setData = (state,action) =>{
|
|
res.symptomIds = JSON.parse(JSON.stringify(mainIds));
|
|
res.symptomIds = JSON.parse(JSON.stringify(mainIds));
|
|
const num = action.info.num;//点击了几次添加病情变化
|
|
const num = action.info.num;//点击了几次添加病情变化
|
|
const symptomFeature = action.info.symptomFeature;//分词
|
|
const symptomFeature = action.info.symptomFeature;//分词
|
|
- // const useEmpty = action.info.useEmpty;
|
|
|
|
let useEmpty,mainData;
|
|
let useEmpty,mainData;
|
|
- // let mainData = JSON.parse(JSON.stringify(action.info.mainData));//主诉模板数据
|
|
|
|
let mainModleData = JSON.parse(JSON.stringify(action.info.mainData));//主诉模板数据
|
|
let mainModleData = JSON.parse(JSON.stringify(action.info.mainData));//主诉模板数据
|
|
let moduleData = JSON.parse(JSON.stringify(res.moduleData));//现病史模板
|
|
let moduleData = JSON.parse(JSON.stringify(res.moduleData));//现病史模板
|
|
- let addModule = JSON.parse(JSON.stringify(res.addModule));//拷贝的模板
|
|
|
|
|
|
+ // let addModule = JSON.parse(JSON.stringify(res.addModule));//拷贝的模板
|
|
let current = JSON.parse(JSON.stringify(moduleData));
|
|
let current = JSON.parse(JSON.stringify(moduleData));
|
|
let newMain = [];
|
|
let newMain = [];
|
|
let mainLabelModule = res.mainLabelModule;//主诉选中的症状id获取到的模板
|
|
let mainLabelModule = res.mainLabelModule;//主诉选中的症状id获取到的模板
|
|
@@ -81,7 +79,7 @@ export const setData = (state,action) =>{
|
|
objToArr.push(mainLabelModule[m]);
|
|
objToArr.push(mainLabelModule[m]);
|
|
}*/
|
|
}*/
|
|
// 过滤掉没有mapping的数据
|
|
// 过滤掉没有mapping的数据
|
|
- let mainLabelModuleArr = objToArr;
|
|
|
|
|
|
+ let mainLabelModuleArr = objToArr;console.log(5,action,mainModleData,mainLabelModuleArr);
|
|
/*let mainLabelModuleArr = objToArr.filter((item)=>{
|
|
/*let mainLabelModuleArr = objToArr.filter((item)=>{
|
|
return item.questionMapping.length>0;
|
|
return item.questionMapping.length>0;
|
|
})*/
|
|
})*/
|
|
@@ -137,12 +135,8 @@ export const setData = (state,action) =>{
|
|
// 主症状添加tongYong标签选中文字
|
|
// 主症状添加tongYong标签选中文字
|
|
let tongYText = tongYong?{name:tongYong,value:tongYong,tagType:config.tagType}:'';
|
|
let tongYText = tongYong?{name:tongYong,value:tongYong,tagType:config.tagType}:'';
|
|
let mainCopy = JSON.parse(JSON.stringify(main));
|
|
let mainCopy = JSON.parse(JSON.stringify(main));
|
|
- /*if(tongYText){
|
|
|
|
- for(let j=0; j<mainCopy.length; j++){
|
|
|
|
- mainCopy[j].name = tongYong + (mainCopy[j].name).replace('、',"");
|
|
|
|
- mainCopy[j].value = tongYong + (mainCopy[j].value).replace('、',"");
|
|
|
|
- }
|
|
|
|
- }*/
|
|
|
|
|
|
+ let manInput = [];
|
|
|
|
+ // 去掉主诉添加的顿号
|
|
for(let j=0; j<mainCopy.length; j++){
|
|
for(let j=0; j<mainCopy.length; j++){
|
|
if(tongYText){
|
|
if(tongYText){
|
|
mainCopy[j].name = tongYong + (mainCopy[j].name).replace('、',"");
|
|
mainCopy[j].name = tongYong + (mainCopy[j].name).replace('、',"");
|
|
@@ -150,11 +144,18 @@ export const setData = (state,action) =>{
|
|
}else{
|
|
}else{
|
|
mainCopy[j].name = (mainCopy[j].name).replace('、',"");
|
|
mainCopy[j].name = (mainCopy[j].name).replace('、',"");
|
|
mainCopy[j].value = (mainCopy[j].value).replace('、',"");
|
|
mainCopy[j].value = (mainCopy[j].value).replace('、',"");
|
|
|
|
+ }
|
|
|
|
+ //查询是否有手动输入--输入的内容放到最后(3-27)
|
|
|
|
+ if(mainCopy[j].name != mainCopy[j].value){
|
|
|
|
+ const inputText = mainCopy[j].value.replace(mainCopy[j].name,"");
|
|
|
|
+ const textObj = Object.assign({},JSON.parse(config.textLabel),{name:inputText});
|
|
|
|
+ if(config.textReg.test(inputText)){//包含中英文或数字->即不全是标点符号才插入
|
|
|
|
+ manInput.push(textObj);
|
|
|
|
+ }
|
|
|
|
+ mainCopy[j].value = mainCopy[j].name;
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
// 将ids接口获取到的模板匹配到对应主症状后面
|
|
// 将ids接口获取到的模板匹配到对应主症状后面
|
|
// 主症状
|
|
// 主症状
|
|
let newMainCopy = JSON.parse(JSON.stringify(mainCopy));
|
|
let newMainCopy = JSON.parse(JSON.stringify(mainCopy));
|
|
@@ -193,15 +194,20 @@ export const setData = (state,action) =>{
|
|
}
|
|
}
|
|
// 伴随
|
|
// 伴随
|
|
// 去掉顿号
|
|
// 去掉顿号
|
|
- /* for(let b=0; b<withs.length; b++){
|
|
|
|
- withs[b].name = withs[b].name.replace('、',"");
|
|
|
|
- }*/
|
|
|
|
- // let newWiths = JSON.parse(JSON.stringify(withs));
|
|
|
|
let newWiths = [];
|
|
let newWiths = [];
|
|
|
|
+ let manWithInput = [];
|
|
if(withs.length>0){
|
|
if(withs.length>0){
|
|
for(let b=0; b<withs.length; b++){
|
|
for(let b=0; b<withs.length; b++){
|
|
withs[b].name = withs[b].name.replace('、',"");
|
|
withs[b].name = withs[b].name.replace('、',"");
|
|
withs[b].value = withs[b].value.replace('、',"");
|
|
withs[b].value = withs[b].value.replace('、',"");
|
|
|
|
+ if(withs[b].name != withs[b].value){
|
|
|
|
+ const inputText = withs[b].value.replace(withs[b].name,"");
|
|
|
|
+ const textObj = Object.assign({},JSON.parse(config.textLabel),{name:inputText});
|
|
|
|
+ if(config.textReg.test(inputText)){//包含中英文或数字->即不全是标点符号才插入
|
|
|
|
+ manWithInput.push(textObj);
|
|
|
|
+ }
|
|
|
|
+ withs[b].value = withs[b].name;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
newWiths = JSON.parse(JSON.stringify(withs));
|
|
newWiths = JSON.parse(JSON.stringify(withs));
|
|
let withInd = 0;
|
|
let withInd = 0;
|
|
@@ -237,7 +243,8 @@ export const setData = (state,action) =>{
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- let symptomArr = newMainCopy.concat(newWiths);
|
|
|
|
|
|
+ let symptomArr = newMainCopy.concat(manInput,newWiths,manWithInput);
|
|
|
|
+ console.log("组装好的数据:",symptomArr,manInput,manWithInput);
|
|
let newSymptomArr = JSON.parse(JSON.stringify(symptomArr));
|
|
let newSymptomArr = JSON.parse(JSON.stringify(symptomArr));
|
|
//组装好的主症状和伴随症状插入现病史模板(flag=4前)
|
|
//组装好的主症状和伴随症状插入现病史模板(flag=4前)
|
|
let insertIdx = null;
|
|
let insertIdx = null;
|