|
@@ -338,9 +338,20 @@ 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;
|
|
|
|
|
|
+ const {nones,exists,withs,ikey,exclusion,excluName,ban,noneIds,tagType} = action.data;
|
|
let existConpId = [];
|
|
let existConpId = [];
|
|
let withConpId = [];
|
|
let withConpId = [];
|
|
|
|
+
|
|
|
|
+ const items = [...exists||[],...withs||[]];//既往史清空选项
|
|
|
|
+ if((!exists||!withs||items.length==0)&&!nones&&!exclusion){ //取消无殊的选中,空白提交
|
|
|
|
+ arr[ikey].value = '';
|
|
|
|
+ arr[ikey].selecteds = {};
|
|
|
|
+ }
|
|
|
|
+ //既往史选中互斥项
|
|
|
|
+ if(exclusion){
|
|
|
|
+ arr[ikey].value = excluName;
|
|
|
|
+ arr[ikey].selecteds = action.data;
|
|
|
|
+ }
|
|
exists.map((v,i)=>{
|
|
exists.map((v,i)=>{
|
|
existConpId.push(v.conceptId);
|
|
existConpId.push(v.conceptId);
|
|
})
|
|
})
|
|
@@ -350,32 +361,45 @@ export const confirm = (state,action) =>{
|
|
res.symptomIds = res.symptomIds.concat(existConpId,withConpId,noneIds);//搜索去重
|
|
res.symptomIds = res.symptomIds.concat(existConpId,withConpId,noneIds);//搜索去重
|
|
// 伴 标签
|
|
// 伴 标签
|
|
const banText = JSON.stringify(ban)=='{}'?'':{id:ban.id,name:ban.name,value:ban.name,tagType:config.tagType};
|
|
const banText = JSON.stringify(ban)=='{}'?'':{id:ban.id,name:ban.name,value:ban.name,tagType:config.tagType};
|
|
-
|
|
|
|
// 处理主症状标签及尾巴展开symptomType=1
|
|
// 处理主症状标签及尾巴展开symptomType=1
|
|
if(exists && exists.length>0){
|
|
if(exists && exists.length>0){
|
|
let tempArr = [];
|
|
let tempArr = [];
|
|
for(let i=0;i<exists.length; i++){
|
|
for(let i=0;i<exists.length; i++){
|
|
- tempArr.push(getLabel(exists[i].id,exists[i].questionMapping && exists[i].questionMapping.length==0?exists[i].name+',':exists[i].name),...(exists[i].questionMapping && exists[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==1;})));
|
|
|
|
|
|
+ if(tagType == 6){
|
|
|
|
+ tempArr.push(...(exists[i].questionMapping && exists[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==1;})));
|
|
|
|
+ }else{
|
|
|
|
+ tempArr.push(getLabel(exists[i].id,exists[i].questionMapping && exists[i].questionMapping.length==0?exists[i].name+',':exists[i].name),...(exists[i].questionMapping && exists[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==1;})));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
arr.splice(ikey,0,...formatContinueDots(tempArr));
|
|
arr.splice(ikey,0,...formatContinueDots(tempArr));
|
|
}
|
|
}
|
|
-
|
|
|
|
let length = arr.length - length1;
|
|
let length = arr.length - length1;
|
|
let withsArr = JSON.parse(JSON.stringify(arr));
|
|
let withsArr = JSON.parse(JSON.stringify(arr));
|
|
// 伴 伴随症状标签及尾巴展开symptomType=2
|
|
// 伴 伴随症状标签及尾巴展开symptomType=2
|
|
if(withs && withs.length>0){
|
|
if(withs && withs.length>0){
|
|
let tempArr = [];
|
|
let tempArr = [];
|
|
for(let i=0;i<withs.length; i++){
|
|
for(let i=0;i<withs.length; i++){
|
|
- tempArr.push(banText,getLabel(withs[i].id,withs[i].questionMapping && withs[i].questionMapping.length==0?(withs[i].name+','):(withs[i].name)),...(withs[i].questionMapping&&withs[i].questionMapping.length>0?withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;}):[]));
|
|
|
|
|
|
+ if(tagType == 6){
|
|
|
|
+ tempArr.push(banText,...(withs[i].questionMapping&&withs[i].questionMapping.length>0?withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;}):[]));
|
|
|
|
+ }else{
|
|
|
|
+ tempArr.push(banText,getLabel(withs[i].id,withs[i].questionMapping && withs[i].questionMapping.length==0?(withs[i].name+','):(withs[i].name)),...(withs[i].questionMapping&&withs[i].questionMapping.length>0?withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;}):[]));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
withsArr.splice(parseInt(ikey)+length,0,...formatContinueDots(tempArr));
|
|
withsArr.splice(parseInt(ikey)+length,0,...formatContinueDots(tempArr));
|
|
}
|
|
}
|
|
-
|
|
|
|
// 无 不用展开
|
|
// 无 不用展开
|
|
|
|
+
|
|
let lengthN = withsArr.length - length1;
|
|
let lengthN = withsArr.length - length1;
|
|
let noneArr = JSON.parse(JSON.stringify(withsArr));
|
|
let noneArr = JSON.parse(JSON.stringify(withsArr));
|
|
if(nones.length>1){//只点无不上去
|
|
if(nones.length>1){//只点无不上去
|
|
- const nonesName = nones.slice(0,nones.length-1)+',';
|
|
|
|
|
|
+ let nonesName = ""
|
|
|
|
+ if(tagType == 6){
|
|
|
|
+ nonesName = nones
|
|
|
|
+ noneArr[ikey].value = '';
|
|
|
|
+ noneArr[ikey].selecteds = {};
|
|
|
|
+ }else{
|
|
|
|
+ nonesName = nones.slice(0,nones.length-1)+','
|
|
|
|
+ }
|
|
const noneObj = Object.assign({},JSON.parse(config.textLabel),{name:nonesName,value:nonesName});
|
|
const noneObj = Object.assign({},JSON.parse(config.textLabel),{name:nonesName,value:nonesName});
|
|
const none = nones?noneObj:'';
|
|
const none = nones?noneObj:'';
|
|
noneArr.splice(parseInt(ikey)+lengthN,0,none);
|
|
noneArr.splice(parseInt(ikey)+lengthN,0,none);
|