|
@@ -80,100 +80,6 @@ export const confirm = (state,action) =>{
|
|
|
res.update=Math.random(); //用于触发组件更新(data变化了因在对象中无法被组件检测到)
|
|
|
return res;
|
|
|
};
|
|
|
-//查体中数字键盘选中事件
|
|
|
-export function setNumberValue(state,action){
|
|
|
- let res = Object.assign({},state);
|
|
|
- const param = action.params;
|
|
|
- const ikey = param.ikey;
|
|
|
- let labelInx = getLabelIndex(ikey);
|
|
|
- // const subInx = ikey.substr(ikey.length-1);
|
|
|
- const subInx = ikey.split("-")[2];
|
|
|
- let item = res.data[labelInx];
|
|
|
- if(+item.tagType===1){ //独立数字键盘组件
|
|
|
- item.value = param.text;
|
|
|
- res.saveText[labelInx] = param.text?item.labelPrefix+param.text+item.labelSuffix:'';
|
|
|
- }else{ //内嵌血压类型组件的数字键盘组件
|
|
|
- item.questionMapping[subInx].value = param.text;
|
|
|
- let hasValue = false;
|
|
|
- const sub = item.questionMapping.map((it)=>{
|
|
|
- if(it.value){ //至少有一个子值才黑显
|
|
|
- hasValue = true;
|
|
|
- }
|
|
|
- if(it.tagType===8){
|
|
|
- return it.name;
|
|
|
- }else{
|
|
|
- if(!it.value){
|
|
|
- return '';
|
|
|
- }
|
|
|
- return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
|
|
|
- }
|
|
|
-
|
|
|
- });
|
|
|
- res.saveText[labelInx] = hasValue?sub.join(''):'';
|
|
|
- }
|
|
|
- // res.saveText = fullfillText(res.data).saveText;
|
|
|
- res.update = Math.random();
|
|
|
- return res;
|
|
|
-}
|
|
|
-
|
|
|
-//查体单选下拉选中
|
|
|
-export function setRadioValue(state,action){
|
|
|
- let res = Object.assign({},state);
|
|
|
- const {ikey,id,text} = action;
|
|
|
- let labelInx = getLabelIndex(ikey);
|
|
|
- const subInx = ikey.split("-")[2];
|
|
|
- let item = res.data[labelInx];
|
|
|
- if(typeof text != 'string'){ //需要展开项--有无治疗类型
|
|
|
- const len = +item.copyType === 0?1:0;
|
|
|
- res.data.splice(labelInx,len,text);
|
|
|
- return res;
|
|
|
- }
|
|
|
- if(+item.tagType===1){ //独立单选组件
|
|
|
- item.value = text;
|
|
|
- const exist = JSON.parse(localStorage.getItem('radio'+item.id)||null);
|
|
|
- if(exist){ //选中状态处理
|
|
|
- exist[0].selected=exist[0].id==id;
|
|
|
- localStorage.setItem('radio'+item.id,JSON.stringify(exist));
|
|
|
- }
|
|
|
- item.questionDetailList.map((its)=>{
|
|
|
- if(its.id === id){
|
|
|
- its.selected = true;
|
|
|
- }else{
|
|
|
- its.selected = false;
|
|
|
- }
|
|
|
- });
|
|
|
- res.saveText[labelInx] = text; //单选没有前后缀
|
|
|
- }else{ //组合组件中的单选组件
|
|
|
- item.questionMapping[subInx].value = text;
|
|
|
- let hasValue = false;
|
|
|
- const sub = item.questionMapping.map((it)=>{
|
|
|
- //添加选中状态
|
|
|
- it.questionDetailList.map((its)=>{
|
|
|
- if(its.id === id){
|
|
|
- its.selected = true;
|
|
|
- }else{
|
|
|
- its.selected = false;
|
|
|
- }
|
|
|
- });
|
|
|
- if(it.value){ //至少有一个子值才黑显
|
|
|
- hasValue = true;
|
|
|
- }
|
|
|
- if(it.tagType===8){
|
|
|
- return it.name;
|
|
|
- }else {
|
|
|
- if(!it.value){
|
|
|
- return '';
|
|
|
- }
|
|
|
- return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
|
|
|
- }
|
|
|
-
|
|
|
- });
|
|
|
- res.saveText[labelInx] = hasValue?sub.join(''):'';
|
|
|
- }
|
|
|
- // res.saveText = fullfillText(res.data).saveText;
|
|
|
- res.update = Math.random();
|
|
|
- return res;
|
|
|
-}
|
|
|
|
|
|
//复制标签(如血压)事件
|
|
|
export function addLabelItem(state,action){
|