#
luxiaotao1123
2024-02-15 b8fe12c5ff7dc2ce750af72c78d4043e836ad9ab
#
2个文件已修改
77 ■■■■■ 已修改文件
zy-asrs-flow/src/components/TableSearch/index.jsx 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/system/role/index.jsx 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/components/TableSearch/index.jsx
@@ -1,5 +1,5 @@
import React from 'react';
import { Input, Button, Space } from 'antd';
import { Input, Button, Space, Select } from 'antd';
const TextFilter = (props) => {
    return (
@@ -39,4 +39,50 @@
    );
}
export { TextFilter };
const SelectFilter = (props) => {
    return (
        <div style={{ padding: 8 }}>
            <Select
                style={{ width: 188, marginBottom: 8 }}
                placeholder="选择一个选项"
                value={props.selectedKeys[0]}
                onChange={value => props.setSelectedKeys(value ? [value] : [])}
            >
                {props.data.map(item => (
                    <Select.Option key={item.value} value={item.value}>
                        {item.label}
                    </Select.Option>
                ))}
            </Select>
            <Space>
                <Button
                    type="primary"
                    onClick={() => {
                        props.confirm();
                        props.setSearchParam(prevState => ({
                            ...prevState,
                            [props.name]: props.selectedKeys[0]
                        }));
                        props.actionRef.current?.reload();
                    }}
                    size="small"
                    style={{ width: 90 }}
                >
                    确定
                </Button>
                <Button
                    onClick={() => {
                        setSelectedKeys([]);
                        clearFilters();
                    }}
                    size="small"
                    style={{ width: 90 }}
                >
                    重置
                </Button>
            </Space>
        </div>
    );
}
export { TextFilter, SelectFilter };
zy-asrs-flow/src/pages/system/role/index.jsx
@@ -11,7 +11,7 @@
import { PlusOutlined, ExportOutlined } from '@ant-design/icons';
import Http from '@/utils/http';
import Edit from './components/edit'
import { TextFilter } from '@/components/TableSearch'
import { TextFilter, SelectFilter } from '@/components/TableSearch'
const handleSave = async (val) => {
    const hide = message.loading('正在添加');
@@ -112,13 +112,23 @@
            dataIndex: 'name',
            valueType: 'text',
            copyable: true,
            filterDropdown: (props) => <TextFilter name='name' {...props} actionRef={actionRef} setSearchParam={setSearchParam} />,
            filterDropdown: (props) => <TextFilter
                name='name'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
        },
        {
            title: '标识',
            dataIndex: 'code',
            valueType: 'text',
            filterDropdown: (props) => <TextFilter name='code' {...props} actionRef={actionRef} setSearchParam={setSearchParam} />,
            filterDropdown: (props) => <TextFilter
                name='code'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
        },
        {
            title: '公司',
@@ -129,6 +139,17 @@
            title: '状态',
            dataIndex: 'status$',
            valueType: 'text',
            filterDropdown: (props) => <SelectFilter
                name='status'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
                data={[
                    { label: '正常', value: 1 },
                    { label: '禁用', value: 0 },
                ]}
            />,
        },
        {
            title: '修改时间',