mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-10-01 14:57:11 +08:00
refactor(GiForm): 优化表单组件的字数限制逻辑
- 修改了 GiForm 组件中 getComponentBindProps 方法,根据 props.search 的值决定是否显示字数限制 - 移除了 User 组件中冗余的 showWordLimit属性
This commit is contained in:
@@ -142,10 +142,10 @@ const dicData: Record<string, any> = reactive({})
|
|||||||
const getComponentBindProps = (item: ColumnItem) => {
|
const getComponentBindProps = (item: ColumnItem) => {
|
||||||
// 组件默认配置映射表
|
// 组件默认配置映射表
|
||||||
const ConfigMap = new Map<ColumnItem['type'], Partial<ColumnItem['props'] & { placeholder: string }>>([
|
const ConfigMap = new Map<ColumnItem['type'], Partial<ColumnItem['props'] & { placeholder: string }>>([
|
||||||
['input', { allowClear: true, placeholder: `请输入${item.label}`, maxLength: 255, showWordLimit: true }],
|
['input', { allowClear: true, placeholder: `请输入${item.label}`, maxLength: 255, showWordLimit: !props.search }],
|
||||||
['input-password', { placeholder: `请输入${item.label}` }],
|
['input-password', { placeholder: `请输入${item.label}`, showWordLimit: !props.search }],
|
||||||
['input-number', { placeholder: `请输入${item.label}` }],
|
['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}` }],
|
['input-tag', { allowClear: true, placeholder: `请输入${item.label}` }],
|
||||||
['mention', { allowClear: true, placeholder: `请输入${item.label}` }],
|
['mention', { allowClear: true, placeholder: `请输入${item.label}` }],
|
||||||
['select', { allowClear: true, placeholder: `请选择${item.label}`, options: dicData[item.field] || [] }],
|
['select', { allowClear: true, placeholder: `请选择${item.label}`, options: dicData[item.field] || [] }],
|
||||||
|
@@ -119,7 +119,6 @@ const queryFormColumns: ColumnItem[] = reactive([
|
|||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
placeholder: '搜索用户名/昵称/描述',
|
placeholder: '搜索用户名/昵称/描述',
|
||||||
showWordLimit: false,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user