verou
2025-03-27 8843117cb805ed5d4d5476c041e7e373bbc6232f
rsf-admin/src/page/components/DictionarySelect.jsx
@@ -2,13 +2,13 @@
import { useState, useEffect } from 'react';
import {
    Button, useListContext, SelectInput,
    required,
    required, SelectArrayInput,
    useTranslate, useNotify
} from 'react-admin';
import request from '@/utils/request';
const DictionarySelect = (props) => {
    const { dictTypeCode, name, ...parmas } = props;
    const { dictTypeCode, name, multiple = false, ...parmas } = props;
    const translate = useTranslate();
    const notify = useNotify();
    const [list, setList] = useState([])
@@ -31,14 +31,15 @@
            notify(res.data.msg);
        }
    }
    const InputComponent = multiple ? SelectArrayInput : SelectInput;
    return (
        <SelectInput
        <InputComponent
            source={name}
            choices={list}
            {...parmas}
        />
    );
};