|
@@ -1,6 +1,7 @@
|
|
import {getLabelIndex,fullfillText,getIds} from '@common/js/func.js';
|
|
import {getLabelIndex,fullfillText,getIds} from '@common/js/func.js';
|
|
import config from '@config/index.js';
|
|
import config from '@config/index.js';
|
|
import {getInitModules} from '@store/async-actions/homePage.js';
|
|
import {getInitModules} from '@store/async-actions/homePage.js';
|
|
|
|
+import {formatContinueDots} from '@utils/tools';
|
|
|
|
|
|
//插入病程变化模板
|
|
//插入病程变化模板
|
|
function insertPro(data,processModule){
|
|
function insertPro(data,processModule){
|
|
@@ -83,7 +84,7 @@ export const setData = (state,action) =>{
|
|
let newMain = [];
|
|
let newMain = [];
|
|
let mainLabelModule = res.mainLabelModule;//主诉选中的症状id获取到的模板
|
|
let mainLabelModule = res.mainLabelModule;//主诉选中的症状id获取到的模板
|
|
let objToArr = [];
|
|
let objToArr = [];
|
|
- let keyArr = Object.keys(mainLabelModule);
|
|
|
|
|
|
+ let keyArr = Object.keys(mainLabelModule);
|
|
for(let i=0; i<keyArr.length; i++){
|
|
for(let i=0; i<keyArr.length; i++){
|
|
objToArr.push(mainLabelModule[JSON.parse(keyArr[i])]);
|
|
objToArr.push(mainLabelModule[JSON.parse(keyArr[i])]);
|
|
}
|
|
}
|
|
@@ -256,7 +257,7 @@ export const setData = (state,action) =>{
|
|
}
|
|
}
|
|
|
|
|
|
let symptomArr = newMainCopy.concat(manInput,newWiths,manWithInput);
|
|
let symptomArr = newMainCopy.concat(manInput,newWiths,manWithInput);
|
|
- let newSymptomArr = JSON.parse(JSON.stringify(symptomArr));
|
|
|
|
|
|
+ let newSymptomArr = formatContinueDots(JSON.parse(JSON.stringify(symptomArr))); //过来连续标点
|
|
//组装好的主症状和伴随症状插入现病史模板(flag=4前)
|
|
//组装好的主症状和伴随症状插入现病史模板(flag=4前)
|
|
let insertIdx = null;
|
|
let insertIdx = null;
|
|
for(let j=0; j<current.length; j++){
|
|
for(let j=0; j<current.length; j++){
|
|
@@ -488,8 +489,13 @@ export function setRadioValue(state,action){
|
|
export const setRadioInputValue = (state,action)=>{
|
|
export const setRadioInputValue = (state,action)=>{
|
|
const res = Object.assign({},state);
|
|
const res = Object.assign({},state);
|
|
const {ikey,values,id} = action.data;
|
|
const {ikey,values,id} = action.data;
|
|
- const item = res.data[ikey];
|
|
|
|
- let str='',temp='',obj=res.data[ikey].questionDetailList;
|
|
|
|
|
|
+ let index = getLabelIndex(ikey);
|
|
|
|
+ let innerInx = ikey.substr(ikey.length-1);
|
|
|
|
+ let item = res.data[index];
|
|
|
|
+ if(item.tagType!=1){ //在组合项中
|
|
|
|
+ item = res.data[index].questionMapping[innerInx];
|
|
|
|
+ }
|
|
|
|
+ let str='',temp='',obj=item.questionDetailList;
|
|
if(!values){ //清空
|
|
if(!values){ //清空
|
|
let sld=obj.find((item)=>{
|
|
let sld=obj.find((item)=>{
|
|
return item.selected==true;
|
|
return item.selected==true;
|
|
@@ -497,7 +503,18 @@ export const setRadioInputValue = (state,action)=>{
|
|
sld?sld.selected=false:'';
|
|
sld?sld.selected=false:'';
|
|
item.vals = null;
|
|
item.vals = null;
|
|
item.value = '';
|
|
item.value = '';
|
|
- res.saveText[ikey] = '';
|
|
|
|
|
|
+ if(res.data[index].tagType!=1){
|
|
|
|
+ let hasValue = false;
|
|
|
|
+ const sub = res.data[index].questionMapping.map((it)=>{
|
|
|
|
+ if(it.value){ //至少有一个子值才黑显
|
|
|
|
+ hasValue = true;
|
|
|
|
+ }
|
|
|
|
+ return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
|
|
|
|
+ });
|
|
|
|
+ res.saveText[index] = hasValue?sub.join(''):'';
|
|
|
|
+ }else{
|
|
|
|
+ res.saveText[index] = '';
|
|
|
|
+ }
|
|
res.update = Math.random();
|
|
res.update = Math.random();
|
|
return res;
|
|
return res;
|
|
}
|
|
}
|
|
@@ -521,7 +538,15 @@ export const setRadioInputValue = (state,action)=>{
|
|
}
|
|
}
|
|
item.vals = values;
|
|
item.vals = values;
|
|
item.value = str;
|
|
item.value = str;
|
|
- res.saveText[ikey] = str;
|
|
|
|
|
|
+ if(res.data[index].tagType!=1){
|
|
|
|
+ let hasValue = false;
|
|
|
|
+ const sub = res.data[index].questionMapping.map((it)=>{
|
|
|
|
+ return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
|
|
|
|
+ });
|
|
|
|
+ res.saveText[index] = sub.join('');
|
|
|
|
+ }else {
|
|
|
|
+ res.saveText[ikey] = str;
|
|
|
|
+ }
|
|
res.update = Math.random();
|
|
res.update = Math.random();
|
|
return res;
|
|
return res;
|
|
}
|
|
}
|
|
@@ -841,10 +866,12 @@ export function backspaceText(state,action){
|
|
// data[delIndex].value = text;
|
|
// data[delIndex].value = text;
|
|
}else if(data[delIndex-1].tagType==8){
|
|
}else if(data[delIndex-1].tagType==8){
|
|
data.splice(delIndex,1);
|
|
data.splice(delIndex,1);
|
|
|
|
+ res.selecteds.splice(delIndex,1); //杂音类样式选中状态对应
|
|
res.saveText.splice(delIndex,1);
|
|
res.saveText.splice(delIndex,1);
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
data.splice(delIndex-1,2);
|
|
data.splice(delIndex-1,2);
|
|
|
|
+ res.selecteds.splice(delIndex-1,2); //杂音类样式选中状态对应
|
|
res.saveText.splice(delIndex-1,2);
|
|
res.saveText.splice(delIndex-1,2);
|
|
}
|
|
}
|
|
// res.saveText = fullfillText(data).saveText;
|
|
// res.saveText = fullfillText(data).saveText;
|