Filter.tsx 1.17 KB
import React from "react";
import { Button, Row, Input } from "antd";
import { PlusOutlined } from "@ant-design/icons";
import { useStore } from "../index";
import FeeweeFilterOption from "@/pages/notice/components/FeeweeFilterOption";

export default function Filter() {
  const { pagination, setOpen } = useStore();

  return (
    <Row justify="space-between" style={{ marginBottom: 10 }}>
      <div
        style={{
          display: "flex",
          flex: 1,
          justifyContent: "start",
          flexWrap: "wrap",
          gap: 10,
        }}
      >
        <FeeweeFilterOption title="关键字">
          <Input.Search
            style={{ minWidth: 260 }}
            allowClear
            placeholder="请输入关键字搜索"
            value={pagination.innerParams.keyWords}
            onChange={(e) => pagination.setParams({ keyWords: e.target.value })}
            onSearch={() => pagination.setParams({ current: 1 }, true)}
          />
        </FeeweeFilterOption>
      </div>
      <Button
        icon={<PlusOutlined />}
        type="primary"
        onClick={() => {
          setOpen(true);
        }}
      >
        新增
      </Button>
    </Row>
  );
}