diff --git a/common/css/page.css b/common/css/page.css index 36d63efe..6d58ee38 100644 --- a/common/css/page.css +++ b/common/css/page.css @@ -858,6 +858,18 @@ button[disabled].bg-grey { overflow-wrap: break-word; word-wrap: break-word; } +.text-line-3 { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 3; + /* 添加标准属性以增加兼容性 */ + line-clamp: 3; + -webkit-box-orient: vertical; + word-break: break-word; + overflow-wrap: break-word; + word-wrap: break-word; +} /** * 文字超出部分换行 */ diff --git a/components/diy/modules/custom/data-group-rendering.vue b/components/diy/modules/custom/data-group-rendering.vue index e5a9e423..b754c56b 100644 --- a/components/diy/modules/custom/data-group-rendering.vue +++ b/components/diy/modules/custom/data-group-rendering.vue @@ -134,8 +134,8 @@ export default { if (typeof max_size === 'number' && max_size >= 0) { const scaledMaxSize = max_size * this.propScale; const autoStyle = 'auto;'; - const maxSizeStyle = ` max-${type}: ${scaledMaxSize}px;`; - const whiteSpaceStyle = type === 'width' ? ' white-space:nowrap;' : ''; + const maxSizeStyle = scaledMaxSize > 0 ? ` max-${type}: ${scaledMaxSize}px;` : ''; + const whiteSpaceStyle = type === 'width' && scaledMaxSize <= 0 ? ' white-space:nowrap;' : ''; return `${ autoStyle }${ maxSizeStyle }${ whiteSpaceStyle }`; } else { return 'auto;'; diff --git a/components/diy/modules/custom/data-rendering.vue b/components/diy/modules/custom/data-rendering.vue index 4ffa05a3..8cba5994 100644 --- a/components/diy/modules/custom/data-rendering.vue +++ b/components/diy/modules/custom/data-rendering.vue @@ -145,8 +145,8 @@ export default { if (typeof max_size === 'number' && max_size >= 0) { const scaledMaxSize = max_size * this.propScale; const autoStyle = 'auto;'; - const maxSizeStyle = ` max-${type}: ${scaledMaxSize}px;`; - const whiteSpaceStyle = type === 'width' ? ' white-space:nowrap;' : ''; + const maxSizeStyle = scaledMaxSize > 0 ? ` max-${type}: ${scaledMaxSize}px;` : ''; + const whiteSpaceStyle = type === 'width' && scaledMaxSize <= 0 ? ' white-space:nowrap;' : ''; return `${ autoStyle }${ maxSizeStyle }${ whiteSpaceStyle }`; } else { return 'auto;'; diff --git a/components/diy/modules/custom/model-text.vue b/components/diy/modules/custom/model-text.vue index 58e4481d..bb93ff7e 100644 --- a/components/diy/modules/custom/model-text.vue +++ b/components/diy/modules/custom/model-text.vue @@ -1,6 +1,6 @@