Browse Source

修改文本提示内容

lwx_v11
hreenshan112 1 year ago
parent
commit
3f4f889d4d
  1. 2
      src/components/DesignForm/public/expand/user.vue
  2. 89
      src/components/DesignForm/public/form/childTable.vue

2
src/components/DesignForm/public/expand/user.vue

@ -69,7 +69,7 @@ onMounted(() => {
</script>
<template>
<el-input
placeholder="请选择用户或输入用户名称"
placeholder="请选择用户"
v-bind="$props"
v-model="value"
@click="openDialog"

89
src/components/DesignForm/public/form/childTable.vue

@ -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
}
</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>
<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 v-else>{{ getText(scope.row[item.name],scope.row,item.name) }}</div>
</div>

Loading…
Cancel
Save