|
@@ -45,9 +45,9 @@ const store = new Vuex.Store({
|
|
|
state.allMoudles = param;
|
|
|
for(let k in param){
|
|
|
if(param[k].type == 2){
|
|
|
- state.diagnose.origin = param[k].moduleDetailDTOList
|
|
|
+ state.diagnose.origin = JSON.parse(JSON.stringify(param[k].moduleDetailDTOList))
|
|
|
}else if(param[k].type == 3){
|
|
|
- state.others.origin = param[k].moduleDetailDTOList
|
|
|
+ state.others.origin = JSON.parse(JSON.stringify(param[k].moduleDetailDTOList))
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -72,7 +72,17 @@ const store = new Vuex.Store({
|
|
|
}
|
|
|
break;
|
|
|
case 3:
|
|
|
-
|
|
|
+ let otherData = state.others.origin;
|
|
|
+ for(let i in otherData){
|
|
|
+ if(otherData[i].id == param.pId){
|
|
|
+ let questionMapping = otherData[i].questionMapping;
|
|
|
+ for(let k in questionMapping){
|
|
|
+ if(questionMapping[k].id == data.id){
|
|
|
+ questionMapping.splice(k,1,data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
break;
|
|
|
case 4:
|
|
|
|
|
@@ -85,12 +95,12 @@ const store = new Vuex.Store({
|
|
|
// ppId--每一道题的id;pId--每个选项的id
|
|
|
const type = parseInt(param.type);//console.log("存值:",param)
|
|
|
const data = param.data;
|
|
|
+ const ppId = param.ppId;
|
|
|
switch(type){
|
|
|
case 1:
|
|
|
state.symptom.datas = Object.assign({},state.symptom.datas,{[param.pId]:data});
|
|
|
break;
|
|
|
case 2: //诊疗情况
|
|
|
- const ppId = param.ppId;
|
|
|
let diagData = state.diagnose.origin;
|
|
|
for(let i in diagData){
|
|
|
if(diagData[i].id == ppId){
|
|
@@ -104,7 +114,17 @@ const store = new Vuex.Store({
|
|
|
}
|
|
|
break;
|
|
|
case 3:
|
|
|
-
|
|
|
+ let otherData = state.others.origin;
|
|
|
+ for(let i in otherData){
|
|
|
+ if(otherData[i].id == ppId){
|
|
|
+ let questionMapping = otherData[i].questionMapping;
|
|
|
+ for(let k in questionMapping){
|
|
|
+ if(questionMapping[k].id == data.id){
|
|
|
+ questionMapping[k].questionMapping = data.questionMapping;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
break;
|
|
|
case 4:
|
|
|
|
|
@@ -123,14 +143,13 @@ const store = new Vuex.Store({
|
|
|
let text = state.symptom.text;
|
|
|
if(text.length > 0){
|
|
|
for(let i in text){
|
|
|
+ // 点完成时才覆盖,单纯点开再关闭不覆盖
|
|
|
if(text[i].pId==param.pId){
|
|
|
- text.splice(i,1,param);
|
|
|
+ if(param.flag){
|
|
|
+ text.splice(i,1,param);
|
|
|
+ }
|
|
|
return
|
|
|
}
|
|
|
- /*else{
|
|
|
- text.push(param);
|
|
|
- break
|
|
|
- }*/
|
|
|
}
|
|
|
text.push(param);
|
|
|
}else{
|
|
@@ -142,7 +161,9 @@ const store = new Vuex.Store({
|
|
|
if(diaText.length > 0){
|
|
|
for(let i in diaText){
|
|
|
if(diaText[i].pId==param.pId){
|
|
|
- diaText.splice(i,1,param);
|
|
|
+ if(param.flag){
|
|
|
+ diaText.splice(i,1,param);
|
|
|
+ }
|
|
|
return
|
|
|
}
|
|
|
}
|
|
@@ -151,8 +172,21 @@ const store = new Vuex.Store({
|
|
|
diaText.push(param);
|
|
|
}
|
|
|
break;
|
|
|
- case 3:
|
|
|
-
|
|
|
+ case 3: //其他情况
|
|
|
+ let otherText = state.others.text;
|
|
|
+ if(otherText.length > 0){
|
|
|
+ for(let i in otherText){
|
|
|
+ if(otherText[i].pId==param.pId){
|
|
|
+ if(param.flag){
|
|
|
+ otherText.splice(i,1,param);
|
|
|
+ }
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ otherText.push(param);
|
|
|
+ }else{
|
|
|
+ otherText.push(param);
|
|
|
+ }
|
|
|
break;
|
|
|
case 4:
|
|
|
|
|
@@ -181,7 +215,12 @@ const store = new Vuex.Store({
|
|
|
}
|
|
|
break;
|
|
|
case 3:
|
|
|
-
|
|
|
+ let otherText = state.others.text;
|
|
|
+ for(let i in otherText){
|
|
|
+ if(otherText[i].pId==param.pId){
|
|
|
+ otherText.splice(i,1)
|
|
|
+ }
|
|
|
+ }
|
|
|
break;
|
|
|
case 4:
|
|
|
|