feat(component-env): 添加环境搜索功能

- 新增搜索文本状态管理
- 实现搜索输入框和按钮
- 集成搜索功能到环境列表获取逻辑
- 优化搜索按钮样式和间距
master
钟良源 3 months ago
parent 81c687dd5b
commit 694b226de9

@ -16,6 +16,7 @@ const ComponentEnv = () => {
const [editingRecord, setEditingRecord] = useState(null);
const [selectedEnvType, setSelectedEnvType] = useState(null); // 选中的环境类型
const [selectedArch, setSelectedArch] = useState(null); // 选中的架构类型
const [searchText, setSearchText] = useState(''); // 搜索文本
const columns: TableColumnProps[] = [
{
@ -119,6 +120,7 @@ const ComponentEnv = () => {
});
};
// 获取环境列表,根据选择的类型和架构进行过滤
const getEnvList = async (extraValue?: string, type?: string) => {
// 构造查询参数
@ -191,11 +193,22 @@ const ComponentEnv = () => {
<div className={styles['component-env-header-right']}>
<Space split={<Divider type="vertical" />}>
<div>
<Input
prefix={<IconSearch />}
placeholder={'搜索'}
style={{ width: 236 }}
style={{ width: 236, marginRight: 5 }}
value={searchText}
onChange={(value) => setSearchText(value)}
/>
<Button
type="primary"
style={{ borderRadius: 4 }}
onClick={() => getEnvList(searchText, 'name')}
>
</Button>
</div>
<Button
type="primary"
style={{ borderRadius: 4 }}
@ -227,9 +240,3 @@ const ComponentEnv = () => {
};
export default ComponentEnv;

Loading…
Cancel
Save