|
@@ -978,7 +978,7 @@ function notTextLabel(label){
|
|
|
* 出参:newArr添加自由文本标签后的数据Array,
|
|
|
* saveText添加自由文本后对应的预览数据Array,
|
|
|
* */
|
|
|
-function fullfillText(arr,noPre=false,noEnd=false){
|
|
|
+function fullfillText(arr,noPre=false,noEnd=false,boxMark){
|
|
|
let newArr =[],
|
|
|
pre={},
|
|
|
textLabel={},
|
|
@@ -1000,11 +1000,13 @@ function fullfillText(arr,noPre=false,noEnd=false){
|
|
|
saveText.push('');
|
|
|
}
|
|
|
newArr.push(it);
|
|
|
- if(it.tagType != 3){ //非血压类组合标签
|
|
|
+ if(it.tagType == 6||it.tagType == 2){
|
|
|
+ tempText = getDefaultedSaveText(it,boxMark);
|
|
|
+ }else if(it.tagType == 3){
|
|
|
+ tempText = getSaveText(it);
|
|
|
+ }else{ //非血压类组合标签
|
|
|
tempText = value?it.labelPrefix+value+it.labelSuffix:'';
|
|
|
tempText = notText?tempText:it.value||it.name;
|
|
|
- }else{
|
|
|
- tempText = getSaveText(it);
|
|
|
}
|
|
|
saveText.push(tempText);
|
|
|
// 模板只有一个标签时第一项后面也要加空标签
|
|
@@ -1017,19 +1019,23 @@ function fullfillText(arr,noPre=false,noEnd=false){
|
|
|
//如果本身不是文本标签且前面一个也不是文本标签,该标签前面添加文本标签
|
|
|
if(notTextLabel(pre)&¬Text){
|
|
|
newArr.push(textLabel,it);
|
|
|
- if(it.tagType != 3) {
|
|
|
- tempText = value ? it.labelPrefix + value + it.labelSuffix : '';
|
|
|
- }else{
|
|
|
+ if(it.tagType == 6||it.tagType == 2){
|
|
|
+ tempText = getDefaultedSaveText(it,boxMark);
|
|
|
+ }else if(it.tagType == 3){
|
|
|
tempText = getSaveText(it);
|
|
|
+ }else{
|
|
|
+ tempText = value ? it.labelPrefix + value + it.labelSuffix : '';
|
|
|
}
|
|
|
saveText.push("",tempText);
|
|
|
}else{ //本身是或者前面是文本标签时,前面不添加文本标签
|
|
|
newArr.push(it);
|
|
|
- if(it.tagType != 3) {
|
|
|
+ if(it.tagType == 6||it.tagType == 2){
|
|
|
+ tempText = getDefaultedSaveText(it,boxMark);
|
|
|
+ }else if(it.tagType == 3){
|
|
|
+ tempText = getSaveText(it);
|
|
|
+ } else{
|
|
|
tempText = value ? it.labelPrefix + value + it.labelSuffix : '';
|
|
|
tempText = notText ? tempText : (it.value || it.value == "" ? it.value : it.name);
|
|
|
- }else{
|
|
|
- tempText = getSaveText(it);
|
|
|
}
|
|
|
saveText.push(tempText);
|
|
|
}
|
|
@@ -1043,6 +1049,23 @@ function fullfillText(arr,noPre=false,noEnd=false){
|
|
|
return {newArr,saveText};
|
|
|
};
|
|
|
|
|
|
+function getDefaultedSaveText(it,boxMark){
|
|
|
+ const state = store.getState();
|
|
|
+ const {readConfig,typeConfig}=state.typeConfig;
|
|
|
+ const hasReadMode = readConfig!==-1;
|
|
|
+ const curOtherMode =hasReadMode&&readConfig[2]!==null?readConfig[2]:typeConfig[2];
|
|
|
+ const curMode =hasReadMode&&readConfig[1]!==null?readConfig[1]:typeConfig[1];
|
|
|
+ const otherDefault=+curOtherMode===1;
|
|
|
+ const curDefault=+curMode===1;
|
|
|
+ const defaulted = (((boxMark=='2'&&curDefault)||(boxMark=='3'&&otherDefault)))&&it.selFlag=='1'&&it.value===undefined;
|
|
|
+ const ext = it.questionMapping.filter((i)=>{
|
|
|
+ return +i.exclusionType===1;
|
|
|
+ });
|
|
|
+ const text = ext.length>0&&defaulted?ext[0].questionDetailList[0].name:'';
|
|
|
+ //console.log(state);
|
|
|
+ return text;
|
|
|
+}
|
|
|
+
|
|
|
/*
|
|
|
* 查体添加自由文本标签函数
|
|
|
* 默认标签直接添加,
|