Browse Source

增大宽度

qin_s3
herenshan112 1 month ago
parent
commit
3c9000a858
  1. 24
      src/components/DesignForm/public/form/childTable.vue

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

@ -103,7 +103,7 @@ onMounted(()=>{
setTimeout(()=>{ setTimeout(()=>{
if(preFillFlag.value==1){ if(preFillFlag.value==1){
let i = 0; let i = 0;
props.data.control.preFill.ids.forEach((element:any) => { props.data.control.preFill?.ids.forEach((element:any) => {
addColumn() addColumn()
//console.log(element) //console.log(element)
@ -340,6 +340,25 @@ function optionsValue3Get1(data: any, fieldName: string) {
console.log(props.data.name) */ console.log(props.data.name) */
emits("optionsValue3GetTable", data, fieldName); emits("optionsValue3GetTable", data, fieldName);
} }
/**
@ 作者: 秦东
@ 时间: 2026-02-11 15:52:08
@ 功能: 计算宽度
*/
const jisuanTableWidth = (data: any) => {
let width = 0;
console.log("jisuanTableWidth--->计算宽度",data.item.label.length,"---------->",data)
// data.item.label.forEach((item: any) => {
// // width += item.item.span?item.item.span:120;
// });
if (data.item.label && data.item.label.length > 0) {
width = data.item.label.length * 30+90;
}
if (width < 100) {
width = 120;
}
return width;
}
</script> </script>
@ -354,9 +373,10 @@ function optionsValue3Get1(data: any, fieldName: string) {
:key="index" :key="index"
:prop="item.name" :prop="item.name"
:label="item.item.label" :label="item.item.label"
:width="item.item.span" :width="jisuanTableWidth(item)"
> >
<template #default="scope"> <template #default="scope">
<span v-if="item.type === 'index'">{{ scope.$index + 1 }}</span> <span v-if="item.type === 'index'">{{ scope.$index + 1 }}</span>
<div v-if="type === 4 || editDisabled"> <div v-if="type === 4 || editDisabled">
<LokOrgCentent <LokOrgCentent

Loading…
Cancel
Save