/*
|
* @Company: hugeInfo
|
* @Author: ldh
|
* @Date: 2022-08-09 15:52:45
|
* @LastEditTime: 2023-10-26 17:16:40
|
* @LastEditors: dminyi 1301963064@qq.com
|
* @Version: 1.0.0
|
* @Description: 搜索栏
|
*/
|
import React from 'react';
|
import { SearchOutlined, FilterOutlined } from 'dd-icons';
|
import './index.less';
|
|
/**
|
* onOpenSearch: func // 点击搜索回调
|
* onClickRightAction: func // 点击右侧按钮回调
|
* isRightActive: bool // 是否执行了右侧按钮
|
*/
|
const MySearch = ({ onOpenSearch, value, onClickRightAction, isRightActive = false, showButton = true,buttonTitle = '搜索',showFilterOutlined=false }) => {
|
|
return (
|
<div className="mySearchBar">
|
<div className="mySearchBar-search" onClick={onOpenSearch}>
|
<SearchOutlined />
|
<span>{value || '搜索'}</span>
|
</div>
|
{
|
showButton &&
|
<div style={{ marginLeft: '16px' }} className={`mySearchBar-scan ${isRightActive && 'mySearchBar-scan-active'}`} onClick={onClickRightAction}>
|
{
|
showFilterOutlined &&
|
<FilterOutlined className="mySearchBar-scan-icon" />
|
}
|
<span>{buttonTitle}</span>
|
</div>
|
}
|
|
</div>
|
);
|
};
|
|
export default MySearch;
|