From 348c49787618fabd23a040c77c4db53e4301bc61 Mon Sep 17 00:00:00 2001 From: Charles7c Date: Tue, 18 Mar 2025 20:51:27 +0800 Subject: [PATCH] =?UTF-8?q?refactor(GiForm):=20=E4=BC=98=E5=8C=96=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E7=BB=84=E4=BB=B6=E7=9A=84=E5=AD=97=E6=95=B0=E9=99=90?= =?UTF-8?q?=E5=88=B6=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改了 GiForm 组件中 getComponentBindProps 方法,根据 props.search 的值决定是否显示字数限制 - 移除了 User 组件中冗余的 showWordLimit属性 --- src/components/GiForm/src/GiForm.vue | 6 +++--- src/views/system/user/index.vue | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/GiForm/src/GiForm.vue b/src/components/GiForm/src/GiForm.vue index 9d9b78b..00764f0 100644 --- a/src/components/GiForm/src/GiForm.vue +++ b/src/components/GiForm/src/GiForm.vue @@ -142,10 +142,10 @@ const dicData: Record = reactive({}) const getComponentBindProps = (item: ColumnItem) => { // 组件默认配置映射表 const ConfigMap = new Map>([ - ['input', { allowClear: true, placeholder: `请输入${item.label}`, maxLength: 255, showWordLimit: true }], - ['input-password', { placeholder: `请输入${item.label}` }], + ['input', { allowClear: true, placeholder: `请输入${item.label}`, maxLength: 255, showWordLimit: !props.search }], + ['input-password', { placeholder: `请输入${item.label}`, showWordLimit: !props.search }], ['input-number', { placeholder: `请输入${item.label}` }], - ['textarea', { allowClear: false, placeholder: `请输入${item.label}`, maxLength: 200, showWordLimit: true, autoSize: { minRows: 3, maxRows: 5 } }], + ['textarea', { allowClear: false, placeholder: `请输入${item.label}`, maxLength: 200, showWordLimit: !props.search, autoSize: { minRows: 3, maxRows: 5 } }], ['input-tag', { allowClear: true, placeholder: `请输入${item.label}` }], ['mention', { allowClear: true, placeholder: `请输入${item.label}` }], ['select', { allowClear: true, placeholder: `请选择${item.label}`, options: dicData[item.field] || [] }], diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 00c0146..3cffbf7 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -119,7 +119,6 @@ const queryFormColumns: ColumnItem[] = reactive([ }, props: { placeholder: '搜索用户名/昵称/描述', - showWordLimit: false, }, }, {