Skip to content

Commit 92fb1d6

Browse files
ba1q1fit2-zhao
authored andcommitted
fix: subTable upload width
1 parent 06ecd1f commit 92fb1d6

File tree

1 file changed

+10
-2
lines changed
  • frontend/packages/web/src/components/business/crm-sub-table

1 file changed

+10
-2
lines changed

frontend/packages/web/src/components/business/crm-sub-table/index.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
title: field.showLabel ? field.name : '',
204204
width:
205205
maxPictureCountMap.value[field.id] > 0 && field.type === FieldTypeEnum.PICTURE
206-
? maxPictureCountMap.value[field.id] * 118
206+
? maxPictureCountMap.value[field.id] * 108
207207
: 120,
208208
key,
209209
fieldId: key,
@@ -433,9 +433,17 @@
433433
};
434434
}
435435
if (field.type === FieldTypeEnum.PICTURE) {
436+
let finalPictureColWidth = 0;
437+
if (maxPictureCountMap.value[field.id]) {
438+
if (field.uploadLimit && maxPictureCountMap.value[field.id] >= field.uploadLimit) {
439+
finalPictureColWidth = field.uploadLimit * 108;
440+
} else {
441+
finalPictureColWidth = maxPictureCountMap.value[field.id] * 108 + 32;
442+
}
443+
}
436444
return {
437445
title,
438-
width: maxPictureCountMap.value[field.id] > 0 ? maxPictureCountMap.value[field.id] * 118 + 32 : 150, // 每个卡片 110px + 8px间距 + 上传按钮宽度 32px
446+
width: finalPictureColWidth || 150, // 每个卡片 100px + 8px间距 + 上传按钮宽度 32px
439447
key,
440448
fieldId: key,
441449
render: (row: any, rowIndex: number) =>

0 commit comments

Comments
 (0)