|
@@ -86,7 +86,11 @@
|
|
|
const result = res.data;
|
|
|
if (result.code == 0&&result.data) {
|
|
|
const syms = result.data.symptom;
|
|
|
- const none={
|
|
|
+ if((!syms||syms.length===0)&&this.extSyms.length===0){
|
|
|
+ this.$emit('warning',"数据异常,请退出重新进入~");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ /*const none={
|
|
|
conceptId: 0,
|
|
|
name: "没有了",
|
|
|
tagName: "没有了",
|
|
@@ -97,11 +101,11 @@
|
|
|
exclusion:1,
|
|
|
hasExplain: 0,
|
|
|
explains: null,
|
|
|
- };
|
|
|
+ };*/
|
|
|
//没有了与其他互斥
|
|
|
- const hasNone = symptoms.indexOf("没有了")!==-1;
|
|
|
+ //const hasNone = symptoms.indexOf("没有了")!==-1;
|
|
|
const selecteds = this.selecteds;
|
|
|
- const exts=JSON.parse(JSON.stringify(this.extSyms));
|
|
|
+ const exts=this.getPushExts();
|
|
|
const newSyms = delResymptoms(exts,syms);
|
|
|
const newSymsCopy=JSON.parse(JSON.stringify(newSyms));
|
|
|
const newExt =selecteds.length>0?newSymsCopy.reduce((total,it)=>{
|
|
@@ -110,19 +114,51 @@
|
|
|
}
|
|
|
return total;
|
|
|
},[]):newSyms;
|
|
|
- if(hasNone){
|
|
|
+ //if(hasNone){
|
|
|
this.symptoms = [...newExt];
|
|
|
- }else{
|
|
|
+ /*}else{
|
|
|
this.symptoms = [none,...newExt];
|
|
|
- }
|
|
|
+ }*/
|
|
|
this.symptoms.length=this.symptoms.length>10?10:this.symptoms.length;
|
|
|
- //this.getSymptomLisCom(result)
|
|
|
}else{
|
|
|
- //this.getSymptomLisCom()
|
|
|
+ this.setErrorSymps();
|
|
|
}
|
|
|
}).catch((err)=>{
|
|
|
-
|
|
|
- })
|
|
|
+ this.setErrorSymps();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ setErrorSymps(){
|
|
|
+ const symps = this.getPushExts();
|
|
|
+ const selecteds = this.selecteds;
|
|
|
+ const newExt1 =selecteds.length>0?symps.reduce((total,it)=>{
|
|
|
+ if(selecteds.findIndex((i)=>i.name===it.name)===-1){
|
|
|
+ total.push(it);
|
|
|
+ }
|
|
|
+ return total;
|
|
|
+ },[]):symps;
|
|
|
+ this.symptoms = newExt1;
|
|
|
+ this.symptoms.length=this.symptoms.length>10?10:this.symptoms.length;
|
|
|
+ },
|
|
|
+ getPushExts(){
|
|
|
+ let syms = [];
|
|
|
+ const none={
|
|
|
+ conceptId: 0,
|
|
|
+ name: "没有了",
|
|
|
+ tagName: "没有了",
|
|
|
+ libType: 1,
|
|
|
+ id: 0,
|
|
|
+ type: 1,
|
|
|
+ description: "",
|
|
|
+ exclusion:1,
|
|
|
+ hasExplain: 0,
|
|
|
+ explains: null,
|
|
|
+ };
|
|
|
+ const exts=JSON.parse(JSON.stringify(this.extSyms));
|
|
|
+ if(exts.length===0){
|
|
|
+ return [none];
|
|
|
+ }
|
|
|
+ syms = [none,...exts];
|
|
|
+ return syms;
|
|
|
},
|
|
|
showExplain(it){
|
|
|
if(it.explains){
|
|
@@ -208,7 +244,7 @@
|
|
|
}
|
|
|
},
|
|
|
components:{
|
|
|
- Tiptoast
|
|
|
+ Tiptoast,
|
|
|
}
|
|
|
};
|
|
|
</script>
|