完善规则配置页交互细节

This commit is contained in:
2026-04-29 18:09:56 +08:00
committed by wren
parent 2eb40e8af6
commit 9e0909ab35
5 changed files with 195 additions and 55 deletions
+6 -3
View File
@@ -13,12 +13,14 @@ interface FilterSelectProps {
options: FilterOption[];
onChange: (e: React.ChangeEvent<HTMLSelectElement>) => void;
className?: string;
disabled?: boolean;
placeholder?: string;
}
/**
* 筛选下拉选择框组件
*/
const FilterSelect = ({ label, name, value, options, onChange, className = '' }: FilterSelectProps) => (
const FilterSelect = ({ label, name, value, options, onChange, className = '', disabled = false, placeholder = '全部' }: FilterSelectProps) => (
<div className={`filter-item ${className}`}>
<label className="filter-label">{label}</label>
<select
@@ -26,8 +28,9 @@ const FilterSelect = ({ label, name, value, options, onChange, className = '' }:
name={name}
value={value}
onChange={onChange}
disabled={disabled}
>
<option value=""></option>
<option value="">{placeholder}</option>
{options.map(option => (
<option key={option.value} value={option.value}>{option.label}</option>
))}
@@ -201,4 +204,4 @@ export function DateRangeFilter({
}
// 导出筛选下拉框组件和日期范围筛选组件
export { FilterSelect };
export { FilterSelect };