|
@@ -6,12 +6,12 @@ import styles from './style.module.less'
|
|
|
export default function SearchHeader(props) {
|
|
|
const { searchList, valueData, onChange, onSearch, onReset, handle, btnWidth = '88px' } = props
|
|
|
const [ showMore, setShowMore ] = useState(false)
|
|
|
- function drawLine(list) {
|
|
|
+ function drawLine(list, type) {
|
|
|
if(Object.prototype.toString.call(list[0]) === "[object Object]") {
|
|
|
return <FromChooseItem
|
|
|
renderFormList={list}
|
|
|
valueData={valueData}
|
|
|
- onChange={(key, e) => onChange(key, e, true)}
|
|
|
+ onChange={(key, e) => onChange(key, e, type === 'default')}
|
|
|
/>
|
|
|
} else {
|
|
|
return list.map((t, idx) => <FromChooseItem
|
|
@@ -19,7 +19,7 @@ export default function SearchHeader(props) {
|
|
|
renderFormList={t}
|
|
|
vsToFormLineTop={idx}
|
|
|
valueData={valueData}
|
|
|
- onChange={(key, e) => onChange(key, e, true)}
|
|
|
+ onChange={(key, e) => onChange(key, e, type === 'default')}
|
|
|
/>
|
|
|
)
|
|
|
}
|
|
@@ -29,7 +29,7 @@ export default function SearchHeader(props) {
|
|
|
<div className={clsx(styles.defaultBox, styles.spaceBetween)}>
|
|
|
<div className={styles.content}>
|
|
|
{/* */}
|
|
|
- {drawLine(searchList.default)}
|
|
|
+ {drawLine(searchList.default, 'default')}
|
|
|
</div>
|
|
|
<div className={styles.btn} style={{ width: btnWidth }}>
|
|
|
{searchList.adv &&
|
|
@@ -49,7 +49,7 @@ export default function SearchHeader(props) {
|
|
|
valueData={valueData}
|
|
|
onChange={(key, e) => onChange(key, e)}
|
|
|
/> */}
|
|
|
- {drawLine(searchList.adv)}
|
|
|
+ {drawLine(searchList.adv, 'adv')}
|
|
|
</div>
|
|
|
<div className={styles.btnList}>
|
|
|
<Button type="primary" onClick={() => onSearch()}>
|