|
@@ -79,11 +79,13 @@ function notTextLabel(label){
|
|
|
* 入参:arr源数组,
|
|
|
* noPre是否不添加前置文本标签,默认false即添加
|
|
|
* noEnd是否不添加后置文本标签,默认false即添加
|
|
|
+* ifEmpty是否添加空标签,默认true即添加,传false添加逗号,如查体
|
|
|
* */
|
|
|
-export const fullfillText = (arr,noPre=false,noEnd=false)=>{
|
|
|
+export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
|
|
|
let newArr =[],
|
|
|
pre={},
|
|
|
textLabel={},
|
|
|
+ _textLabel={},
|
|
|
notText = true,
|
|
|
saveText=[],
|
|
|
tempText = '',
|
|
@@ -92,6 +94,7 @@ export const fullfillText = (arr,noPre=false,noEnd=false)=>{
|
|
|
notText = notTextLabel(it);
|
|
|
value = it.value||'';
|
|
|
textLabel = JSON.parse(config.textLabel);
|
|
|
+ _textLabel = JSON.parse(config._textLabel);
|
|
|
if(i===0){
|
|
|
//第一个标签不是文本标签时在前面添加文本标签
|
|
|
if(!noPre&¬Text){
|
|
@@ -106,7 +109,8 @@ export const fullfillText = (arr,noPre=false,noEnd=false)=>{
|
|
|
pre = arr[i-1];
|
|
|
//如果本身不是文本标签且前面一个也不是文本标签,该标签前面添加文本标签
|
|
|
if(notTextLabel(pre)&¬Text){
|
|
|
- newArr.push(textLabel,it);
|
|
|
+ // newArr.push(textLabel,it);
|
|
|
+ ifEmpty?newArr.push(textLabel,it):newArr.push(_textLabel,it);
|
|
|
tempText = value?it.labelPrefix+value+it.labelSuffix:'';
|
|
|
saveText.push("",tempText);
|
|
|
//最后一个非文本标签,后面添加一个文本标签
|
|
@@ -130,6 +134,7 @@ export const fullfillText = (arr,noPre=false,noEnd=false)=>{
|
|
|
return {newArr,saveText};
|
|
|
};
|
|
|
|
|
|
+
|
|
|
//获取标签index,入参:病例项index+标签index+标签内index
|
|
|
export const getLabelIndex = (index)=>{
|
|
|
let ikey = '';
|