|
@@ -63,12 +63,10 @@ export const setData = (state,action) =>{
|
|
|
res.symptomIds = JSON.parse(JSON.stringify(mainIds));
|
|
|
const num = action.info.num;//点击了几次添加病情变化
|
|
|
const symptomFeature = action.info.symptomFeature;//分词
|
|
|
- // const useEmpty = action.info.useEmpty;
|
|
|
let useEmpty,mainData;
|
|
|
- // let mainData = 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 addModule = JSON.parse(JSON.stringify(res.addModule));//拷贝的模板
|
|
|
+ // let addModule = JSON.parse(JSON.stringify(res.addModule));//拷贝的模板
|
|
|
let current = JSON.parse(JSON.stringify(moduleData));
|
|
|
let newMain = [];
|
|
|
let mainLabelModule = res.mainLabelModule;//主诉选中的症状id获取到的模板
|
|
@@ -102,7 +100,7 @@ export const setData = (state,action) =>{
|
|
|
})
|
|
|
useEmpty = existData&&existData.length>0?false:true;
|
|
|
}
|
|
|
- // console.log(888,useEmpty);
|
|
|
+
|
|
|
if (useEmpty) {
|
|
|
// res.data = res.emptyData;
|
|
|
res.data = JSON.parse(JSON.stringify(res.emptyData));
|
|
@@ -137,12 +135,8 @@ export const setData = (state,action) =>{
|
|
|
// 主症状添加tongYong标签选中文字
|
|
|
let tongYText = tongYong?{name:tongYong,value:tongYong,tagType:config.tagType}:'';
|
|
|
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++){
|
|
|
if(tongYText){
|
|
|
mainCopy[j].name = tongYong + (mainCopy[j].name).replace('、',"");
|
|
@@ -150,11 +144,18 @@ export const setData = (state,action) =>{
|
|
|
}else{
|
|
|
mainCopy[j].name = (mainCopy[j].name).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接口获取到的模板匹配到对应主症状后面
|
|
|
// 主症状
|
|
|
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 manWithInput = [];
|
|
|
if(withs.length>0){
|
|
|
for(let b=0; b<withs.length; b++){
|
|
|
withs[b].name = withs[b].name.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));
|
|
|
let withInd = 0;
|
|
@@ -237,7 +243,7 @@ export const setData = (state,action) =>{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- let symptomArr = newMainCopy.concat(newWiths);
|
|
|
+ let symptomArr = newMainCopy.concat(manInput,newWiths,manWithInput);
|
|
|
let newSymptomArr = JSON.parse(JSON.stringify(symptomArr));
|
|
|
//组装好的主症状和伴随症状插入现病史模板(flag=4前)
|
|
|
let insertIdx = null;
|
|
@@ -363,16 +369,15 @@ export const confirm = (state,action) =>{
|
|
|
//普通多选确定事件-主诉通用特征、初为后为等
|
|
|
export const setCheckBox = (state,action)=>{
|
|
|
const res = Object.assign({},state);
|
|
|
- const {exists,labelInx,existsName} = action.data;
|
|
|
+ const {labelInx,excluName,existsName,nones,withsName,ban} = action.data;
|
|
|
// 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
|
|
|
- let names=existsName;
|
|
|
+ let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones||'');
|
|
|
let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
|
|
|
- if(pattern.test(existsName)){
|
|
|
- names = existsName.substr(0,existsName.length-1);
|
|
|
+ if(pattern.test(showText)){
|
|
|
+ showText = showText.substr(0,showText.length-1);
|
|
|
}
|
|
|
- let arr = res.data;
|
|
|
- arr[labelInx].value = names;
|
|
|
- res.saveText[labelInx] = names;
|
|
|
+ res.data[labelInx].value = showText;
|
|
|
+ res.saveText[labelInx] = showText;
|
|
|
res.selecteds[labelInx] = action.data;
|
|
|
res.update=Math.random();
|
|
|
return res;
|