|
|
@ -179,6 +179,86 @@ const timeToString = (timeVal:any,types:int) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return timeStr |
|
|
|
|
|
} |
|
|
|
|
|
/** |
|
|
|
|
|
@ 作者: 秦东 |
|
|
|
|
|
@ 时间: 2024-10-11 14:49:23 |
|
|
|
|
|
@ 功能: 计算有options属性的结果 |
|
|
|
|
|
*/ |
|
|
|
|
|
const optToString = (timeVal:any,item:any) => { |
|
|
|
|
|
let timeStr = "" |
|
|
|
|
|
if(item.options && Array.isArray(item.options)){ |
|
|
|
|
|
if(Array.isArray(timeVal)){ |
|
|
|
|
|
let strArt = new Array |
|
|
|
|
|
switch(item.type){ |
|
|
|
|
|
case "radio": |
|
|
|
|
|
timeVal.forEach((tim:any)=>{ |
|
|
|
|
|
item.options.forEach((it:any)=>{ |
|
|
|
|
|
if(it.value == tim){ |
|
|
|
|
|
strArt.push(it.label) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
break; |
|
|
|
|
|
case "checkbox": |
|
|
|
|
|
timeVal.forEach((tim:any)=>{ |
|
|
|
|
|
item.options.forEach((it:any)=>{ |
|
|
|
|
|
if(it.value == tim){ |
|
|
|
|
|
strArt.push(it.label) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
break; |
|
|
|
|
|
case "select": |
|
|
|
|
|
timeVal.forEach((tim:any)=>{ |
|
|
|
|
|
item.options.forEach((it:any)=>{ |
|
|
|
|
|
if(it.value == tim){ |
|
|
|
|
|
strArt.push(it.label) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
break; |
|
|
|
|
|
default: |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
if(strArt.length > 0){ |
|
|
|
|
|
timeStr = strArt.toString() |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
let strArt = new Array |
|
|
|
|
|
switch(item.type){ |
|
|
|
|
|
case "radio": |
|
|
|
|
|
item.options.forEach((it:any)=>{ |
|
|
|
|
|
if(it.value == timeVal){ |
|
|
|
|
|
strArt.push(it.label) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
break; |
|
|
|
|
|
case "checkbox": |
|
|
|
|
|
item.options.forEach((it:any)=>{ |
|
|
|
|
|
if(it.value == timeVal){ |
|
|
|
|
|
strArt.push(it.label) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
break; |
|
|
|
|
|
case "select": |
|
|
|
|
|
item.options.forEach((it:any)=>{ |
|
|
|
|
|
if(it.value == timeVal){ |
|
|
|
|
|
strArt.push(it.label) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
break; |
|
|
|
|
|
default: |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
if(strArt.length > 0){ |
|
|
|
|
|
timeStr = strArt.toString() |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return timeStr |
|
|
return timeStr |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
@ -212,6 +292,15 @@ const timeToString = (timeVal:any,types:int) => { |
|
|
<div v-else-if="item.type=='datePicker'" v-html="timeToString(scope.row[item.name],item.control.type)"> |
|
|
<div v-else-if="item.type=='datePicker'" v-html="timeToString(scope.row[item.name],item.control.type)"> |
|
|
</div> |
|
|
</div> |
|
|
<div v-else-if="item.type=='timePicker'" v-html="timeToString(scope.row[item.name],item.type)"> |
|
|
<div v-else-if="item.type=='timePicker'" v-html="timeToString(scope.row[item.name],item.type)"> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div v-else-if="item.type=='radio'" v-html="optToString(scope.row[item.name],item)"> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
<div v-else-if="item.type=='checkbox'" v-html="optToString(scope.row[item.name],item)"> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
<div v-else-if="item.type=='select'" v-html="optToString(scope.row[item.name],item)"> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div v-else>{{ getText(scope.row[item.name],scope.row,item.name) }}</div> |
|
|
<div v-else>{{ getText(scope.row[item.name],scope.row,item.name) }}</div> |
|
|
</div> |
|
|
</div> |
|
|
|