|
@@ -1,6 +1,6 @@
|
|
|
import Vue from 'vue';
|
|
|
import Vuex from 'vuex';
|
|
|
-import {deepClone,getAllStr} from '@utils/tools.js'
|
|
|
+import {deepClone,getAllStr,moduleCP} from '@utils/tools.js'
|
|
|
Vue.use(Vuex);
|
|
|
|
|
|
const store = new Vuex.Store({
|
|
@@ -74,10 +74,10 @@ const store = new Vuex.Store({
|
|
|
saveAll(state,param){
|
|
|
state.allMoudles = param;
|
|
|
for(let k in param){
|
|
|
- if(param[k].type == 51){
|
|
|
+ if(param[k].type == moduleCP['diagT']){
|
|
|
state.diagnose.origin = JSON.parse(JSON.stringify(param[k].moduleDetailDTOList))
|
|
|
state.diagnose.datas = JSON.parse(JSON.stringify(param[k].moduleDetailDTOList))
|
|
|
- }else if(param[k].type == 3){
|
|
|
+ }else if(param[k].type == moduleCP['other']){
|
|
|
state.others.origin = JSON.parse(JSON.stringify(param[k].moduleDetailDTOList))
|
|
|
state.others.datas = JSON.parse(JSON.stringify(param[k].moduleDetailDTOList))
|
|
|
}
|
|
@@ -87,10 +87,10 @@ const store = new Vuex.Store({
|
|
|
const type = parseInt(param.type);
|
|
|
const data = param.data;
|
|
|
switch(type){
|
|
|
- case 1: //症状情况
|
|
|
+ case moduleCP['symp']: //症状情况
|
|
|
state.symptom.origin = Object.assign({},state.symptom.origin,{[data.id]:data});
|
|
|
break;
|
|
|
- case 51: //诊疗情况
|
|
|
+ case moduleCP['diagT']: //诊疗情况
|
|
|
let diagData = state.diagnose.origin;
|
|
|
for(let i in diagData){
|
|
|
if(diagData[i].id == param.pId){
|
|
@@ -103,7 +103,7 @@ const store = new Vuex.Store({
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
- case 3:
|
|
|
+ case moduleCP['other']:
|
|
|
let otherData = state.others.origin;
|
|
|
for(let i in otherData){
|
|
|
if(otherData[i].id == param.pId){
|
|
@@ -116,7 +116,7 @@ const store = new Vuex.Store({
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
- case 52:
|
|
|
+ case moduleCP['suplement']:
|
|
|
|
|
|
break;
|
|
|
default:
|
|
@@ -129,10 +129,10 @@ const store = new Vuex.Store({
|
|
|
const data = param.data;
|
|
|
const ppId = param.ppId;
|
|
|
switch(type){
|
|
|
- case 1:
|
|
|
+ case moduleCP['symp']:
|
|
|
state.symptom.datas = Object.assign({},state.symptom.datas,{[param.pId]:data});
|
|
|
break;
|
|
|
- case 51: //诊疗情况
|
|
|
+ case moduleCP['diagT']: //诊疗情况
|
|
|
let diagData = state.diagnose.datas;
|
|
|
for(let i in diagData){
|
|
|
if(diagData[i].id == ppId){
|
|
@@ -146,7 +146,7 @@ const store = new Vuex.Store({
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
- case 3:
|
|
|
+ case moduleCP['other']:
|
|
|
let otherData = state.others.datas;
|
|
|
for(let i in otherData){
|
|
|
if(otherData[i].id == ppId){
|
|
@@ -159,7 +159,7 @@ const store = new Vuex.Store({
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
- case 52:
|
|
|
+ case moduleCP['suplement']:
|
|
|
|
|
|
break;
|
|
|
default:
|
|
@@ -170,7 +170,7 @@ const store = new Vuex.Store({
|
|
|
setText(state,param){
|
|
|
const type = parseInt(param.type);
|
|
|
switch(type){
|
|
|
- case 1:
|
|
|
+ case moduleCP['symp']:
|
|
|
// 对象易更新但顺序无法控制
|
|
|
// state.symptom.text = Object.assign({},state.symptom.text,{[param.pId]:param.text});
|
|
|
let text = state.symptom.text;
|
|
@@ -189,7 +189,7 @@ const store = new Vuex.Store({
|
|
|
text.push(param);
|
|
|
}
|
|
|
break;
|
|
|
- case 51: //诊疗情况
|
|
|
+ case moduleCP['diagT']: //诊疗情况
|
|
|
let diaText = state.diagnose.text;
|
|
|
if(diaText.length > 0){
|
|
|
for(let i in diaText){
|
|
@@ -205,7 +205,7 @@ const store = new Vuex.Store({
|
|
|
diaText.push(param);
|
|
|
}
|
|
|
break;
|
|
|
- case 3: //其他情况
|
|
|
+ case moduleCP['other']: //其他情况
|
|
|
let otherText = state.others.text;
|
|
|
if(otherText.length > 0){
|
|
|
for(let i in otherText){
|
|
@@ -221,7 +221,7 @@ const store = new Vuex.Store({
|
|
|
otherText.push(param);
|
|
|
}
|
|
|
break;
|
|
|
- case 52:
|
|
|
+ case moduleCP['suplement']:
|
|
|
let addText = state.addContent.txt
|
|
|
state.addContent.origin = param.data
|
|
|
state.addContent.txt = getAllStr(param)
|
|
@@ -233,7 +233,7 @@ const store = new Vuex.Store({
|
|
|
delText(state,param){
|
|
|
const type = parseInt(param.type);
|
|
|
switch(type){
|
|
|
- case 1:
|
|
|
+ case moduleCP['symp']:
|
|
|
let text = state.symptom.text;
|
|
|
for(let i in text){
|
|
|
if(text[i].pId==param.pId){
|
|
@@ -241,7 +241,7 @@ const store = new Vuex.Store({
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
- case 51: //诊疗情况
|
|
|
+ case moduleCP['diagT']: //诊疗情况
|
|
|
let diaText = state.diagnose.text;
|
|
|
for(let i in diaText){
|
|
|
if(diaText[i].pId==param.pId){
|
|
@@ -249,7 +249,7 @@ const store = new Vuex.Store({
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
- case 3:
|
|
|
+ case moduleCP['other']:
|
|
|
let otherText = state.others.text;
|
|
|
for(let i in otherText){
|
|
|
if(otherText[i].pId==param.pId){
|
|
@@ -257,7 +257,7 @@ const store = new Vuex.Store({
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
- case 52:
|
|
|
+ case moduleCP['suplement']:
|
|
|
|
|
|
break;
|
|
|
default:
|
|
@@ -270,16 +270,16 @@ const store = new Vuex.Store({
|
|
|
setImgFile(state,param){//区别模块
|
|
|
const type = parseInt(param.type);
|
|
|
switch(type){
|
|
|
- case 1:
|
|
|
+ case moduleCP['symp']:
|
|
|
|
|
|
break;
|
|
|
- case 51: //诊疗情况
|
|
|
+ case moduleCP['diagT']: //诊疗情况
|
|
|
state.diagnose.imgFile.push(param);
|
|
|
break;
|
|
|
- case 3:
|
|
|
+ case moduleCP['other']:
|
|
|
|
|
|
break;
|
|
|
- case 52:
|
|
|
+ case moduleCP['suplement']:
|
|
|
|
|
|
break;
|
|
|
default:
|
|
@@ -292,16 +292,16 @@ const store = new Vuex.Store({
|
|
|
const src = param.src;
|
|
|
const type = parseInt(param.type);
|
|
|
switch(type){
|
|
|
- case 1:
|
|
|
+ case moduleCP['symp']:
|
|
|
|
|
|
break;
|
|
|
- case 51:
|
|
|
+ case moduleCP['diagT']:
|
|
|
state.diagnose.imgSrc = Object.assign({},state.diagnose.imgSrc,{[key]:src});
|
|
|
break;
|
|
|
- case 3:
|
|
|
+ case moduleCP['other']:
|
|
|
|
|
|
break;
|
|
|
- case 52:
|
|
|
+ case moduleCP['suplement']:
|
|
|
|
|
|
break;
|
|
|
default:
|
|
@@ -313,10 +313,10 @@ const store = new Vuex.Store({
|
|
|
const key = param.key;
|
|
|
const type = parseInt(param.type);
|
|
|
switch(type){
|
|
|
- case 1:
|
|
|
+ case moduleCP['symp']:
|
|
|
|
|
|
break;
|
|
|
- case 51:
|
|
|
+ case moduleCP['diagT']:
|
|
|
let data = state.diagnose.imgFile;
|
|
|
for(let i=0; i<data.length;i++){
|
|
|
if(data[i].key==key){
|
|
@@ -324,10 +324,10 @@ const store = new Vuex.Store({
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
- case 3:
|
|
|
+ case moduleCP['other']:
|
|
|
|
|
|
break;
|
|
|
- case 52:
|
|
|
+ case moduleCP['suplement']:
|
|
|
|
|
|
break;
|
|
|
default:
|
|
@@ -339,19 +339,19 @@ const store = new Vuex.Store({
|
|
|
const key = param.key;
|
|
|
const type = parseInt(param.type);
|
|
|
switch(type){
|
|
|
- case 1:
|
|
|
+ case moduleCP['symp']:
|
|
|
|
|
|
break;
|
|
|
- case 51:
|
|
|
+ case moduleCP['diagT']:
|
|
|
let data = state.diagnose.imgFile;
|
|
|
let obj = state.diagnose.imgSrc;
|
|
|
delete(obj[key]);
|
|
|
state.diagnose.imgSrc = Object.assign({},obj);
|
|
|
break;
|
|
|
- case 3:
|
|
|
+ case moduleCP['other']:
|
|
|
|
|
|
break;
|
|
|
- case 52:
|
|
|
+ case moduleCP['suplement']:
|
|
|
|
|
|
break;
|
|
|
default:
|