Commit cf57df71 by chenwq

```

fix(SearchForm): 移除多余的size属性配置

移除了SearchForm组件中不必要的size属性配置,包括:
- 移除common对象中的默认size: 'small'配置
- 移除UDatePicker.RangePicker组件上的size属性
- 移除重置按钮和查询按钮上的size: "small"属性

这些更改使组件样式更加一致,并依赖于组件的默认尺寸配置。
```
1 parent 57cfc0b6
Pipeline #323 for cf57df71 failed in 0 seconds
...@@ -35,7 +35,6 @@ export function SearchForm<T extends Record<string, unknown>>({ ...@@ -35,7 +35,6 @@ export function SearchForm<T extends Record<string, unknown>>({
const common = { const common = {
disabled: typeof field.disabled === 'boolean' ? field.disabled : false, disabled: typeof field.disabled === 'boolean' ? field.disabled : false,
placeholder: field.placeholder, placeholder: field.placeholder,
size: 'small' as const,
}; };
const width = field.width ?? '100%'; const width = field.width ?? '100%';
if (field.type === 'select' || field.type === 'selectMultiple') if (field.type === 'select' || field.type === 'selectMultiple')
...@@ -52,9 +51,7 @@ export function SearchForm<T extends Record<string, unknown>>({ ...@@ -52,9 +51,7 @@ export function SearchForm<T extends Record<string, unknown>>({
return <UCascader {...common} style={{ width }} options={field.options} allowClear={false} />; return <UCascader {...common} style={{ width }} options={field.options} allowClear={false} />;
if (field.type === 'date') return <UDatePicker {...common} style={{ width }} />; if (field.type === 'date') return <UDatePicker {...common} style={{ width }} />;
if (field.type === 'dateRange') if (field.type === 'dateRange')
return ( return <UDatePicker.RangePicker disabled={common.disabled} style={{ width }} />;
<UDatePicker.RangePicker disabled={common.disabled} size={common.size} style={{ width }} />
);
if (field.type === 'radio') return <URadio.Group {...common} options={field.options} />; if (field.type === 'radio') return <URadio.Group {...common} options={field.options} />;
return field.type === 'textarea' ? ( return field.type === 'textarea' ? (
<UInput.TextArea {...common} style={{ width }} /> <UInput.TextArea {...common} style={{ width }} />
...@@ -84,7 +81,6 @@ export function SearchForm<T extends Record<string, unknown>>({ ...@@ -84,7 +81,6 @@ export function SearchForm<T extends Record<string, unknown>>({
<UFormItem style={searchActionsStyle}> <UFormItem style={searchActionsStyle}>
<UButton <UButton
type="default" type="default"
size="small"
onClick={() => { onClick={() => {
const resetValues = fields.reduce<Record<string, unknown>>((values, field) => { const resetValues = fields.reduce<Record<string, unknown>>((values, field) => {
const initialValue = initialValues?.[field.name]; const initialValue = initialValues?.[field.name];
...@@ -99,7 +95,7 @@ export function SearchForm<T extends Record<string, unknown>>({ ...@@ -99,7 +95,7 @@ export function SearchForm<T extends Record<string, unknown>>({
> >
重置 重置
</UButton> </UButton>
<UButton htmlType="submit" size="small" style={{ marginLeft: 8 }}> <UButton htmlType="submit" style={{ marginLeft: 8 }}>
查询 查询
</UButton> </UButton>
</UFormItem> </UFormItem>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!