cc26d1fc
张志伟
🎉 重新构建项目,解决项目过大的问题
|
1
|
import React, { useCallback } from "react";
|
7a03dbfa
zhaofeng
厂家票据启票账户样式调整
|
2
|
import { Button, Row, Select } from "antd";
|
cc26d1fc
张志伟
🎉 重新构建项目,解决项目过大的问题
|
3
4
5
6
7
8
9
10
11
12
|
import { useStore } from "../index";
const { Option } = Select;
export default function Filter() {
const { setVisible, dealerList, setDealerId, dealerId, brandList, brandLoading, brandId, setBrandId } = useStore();
const searchDealer = useCallback((dealerId) => {
setDealerId(dealerId);
}, []);
|
7a03dbfa
zhaofeng
厂家票据启票账户样式调整
|
13
|
|
cc26d1fc
张志伟
🎉 重新构建项目,解决项目过大的问题
|
14
15
16
17
18
|
const searchBrand = useCallback((brandId) => {
setBrandId(brandId);
}, []);
return (
|
7a03dbfa
zhaofeng
厂家票据启票账户样式调整
|
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
<Row justify="space-between" style={{ marginBottom: 10 }}>
<Row justify="start">
<Select
placeholder="请选择商家"
showSearch
optionFilterProp="children"
onChange={searchDealer}
style={{ width: 200 }}
>
{dealerList.map((dealer) => (
<Option value={dealer.id} key={dealer.id}>
{dealer.name}
</Option>
))}
</Select>
<Select
placeholder="请选择品牌"
loading={brandLoading}
allowClear
optionFilterProp="children"
onChange={searchBrand}
value={brandId && brandId > 0 ? brandId : undefined}
style={{ width: 200,marginLeft:100 }}
>
{brandList.map((brand) => (
<Option value={brand.id} key={brand.id}>
{brand.name}
</Option>
))}
</Select>
|
cc26d1fc
张志伟
🎉 重新构建项目,解决项目过大的问题
|
49
|
</Row>
|
7a03dbfa
zhaofeng
厂家票据启票账户样式调整
|
50
|
|
cc26d1fc
张志伟
🎉 重新构建项目,解决项目过大的问题
|
51
52
53
|
<Button type="primary" hidden={!dealerId} onClick={() => setVisible(true)}>
新增
</Button>
|
7a03dbfa
zhaofeng
厂家票据启票账户样式调整
|
54
|
</Row>
|
cc26d1fc
张志伟
🎉 重新构建项目,解决项目过大的问题
|
55
56
|
);
}
|