From afbdbbdea8394aa15d107391060d1fe1d324b47b Mon Sep 17 00:00:00 2001 From: Odboy Date: Wed, 4 Mar 2026 19:26:43 +0800 Subject: [PATCH] =?UTF-8?q?feat(form):=20=E6=89=A9=E5=B1=95=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E7=BB=84=E4=BB=B6=E5=8A=9F=E8=83=BD=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=95=B0=E5=AD=97=E8=BE=93=E5=85=A5=E5=92=8C=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 IsNotBlank 和 IsBlank 工具函数用于字符串空值判断 - 添加数字输入框组件支持,包括最小值、最大值、步长、精度配置 - 集成文件拖拽上传功能,支持本地模式上传 - 优化表单验证规则,支持不同字段类型的精确验证 - 更新下拉选择框支持多选和过滤功能 - 修改表单容器样式增加内边距提升用户体验 - 修复字段禁用状态绑定错误问题 - 扩展表单类型定义文档,新增 number 和 upload 类型说明 --- cutejava-front/src/utils/KitUtil.js | 33 ++++--- .../components/advanced/CuteFormDialog.vue | 4 +- .../components/advanced/CuteFormDialogPro.vue | 91 ++++++++++++++----- .../components/advanced/CuteFormDrawer.vue | 4 +- .../components/advanced/CuteFormDrawerPro.vue | 89 ++++++++++++++---- .../components/advanced/CuteSearchFormPro.vue | 4 +- .../business/CuteFileDragUpload.vue | 2 +- .../advanced/CuteFormDialogProDemo.vue | 30 +++++- .../advanced/CuteFormDrawerProDemo.vue | 29 +++++- 9 files changed, 218 insertions(+), 68 deletions(-) diff --git a/cutejava-front/src/utils/KitUtil.js b/cutejava-front/src/utils/KitUtil.js index cad8e0c8..6c62e35d 100644 --- a/cutejava-front/src/utils/KitUtil.js +++ b/cutejava-front/src/utils/KitUtil.js @@ -254,19 +254,22 @@ export function FormatRowEnvStr(row, column, cellValue, index) { return '' } -export function IsEmpty(obj) { - if (obj === undefined) { - // console.error('is undefined') - return true - } - if (obj === '') { - // console.error('is ""') - return true - } - if (obj === 'undefined') { - // console.error('is "undefined"') - return true - } - // console.error('is null') - return obj === null +/** + * 判断字符串是否不是空白字符串 + * 功能等同于 Java Hutool 的 StrUtil.isNotBlank + * @param {string} str - 待检查的字符串 + * @returns {boolean} - 如果字符串不是空白则返回 true,否则返回 false + */ +export function IsNotBlank(str) { + return str != null && String(str).trim().length > 0 +} + +/** + * 判断字符串是否是空白字符串 + * 功能等同于 Java Hutool 的 StrUtil.isBlank + * @param {string} str - 待检查的字符串 + * @returns {boolean} - 如果字符串是空白则返回 true,否则返回 false + */ +export function IsBlank(str) { + return str == null || String(str).trim().length === 0 } diff --git a/cutejava-front/src/views/components/advanced/CuteFormDialog.vue b/cutejava-front/src/views/components/advanced/CuteFormDialog.vue index ea839faf..43022d99 100644 --- a/cutejava-front/src/views/components/advanced/CuteFormDialog.vue +++ b/cutejava-front/src/views/components/advanced/CuteFormDialog.vue @@ -110,7 +110,9 @@ export default { .container-form { overflow-y: scroll; /* 启用滚动 */ scrollbar-width: none; /* Firefox */ - padding-right: 20px; + padding-top: 10px; + padding-left: 15px; + padding-right: 15px; -ms-overflow-style: none; /* Internet Explorer 10+ */ max-height: calc(100vh - 200px); /* 调整高度以适应页头和底部按钮 */ } diff --git a/cutejava-front/src/views/components/advanced/CuteFormDialogPro.vue b/cutejava-front/src/views/components/advanced/CuteFormDialogPro.vue index 92202e84..0e3d30b1 100644 --- a/cutejava-front/src/views/components/advanced/CuteFormDialogPro.vue +++ b/cutejava-front/src/views/components/advanced/CuteFormDialogPro.vue @@ -14,28 +14,42 @@ :modal="false" >
- + + + + + @@ -88,9 +108,11 @@