skyouc
2025-03-31 43c6e4ca1e4a7db22c1c2da4a40d90b0535c1c5c
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,13 +31,15 @@
            notify(res.data.msg);
        }
    }
    const InputComponent = multiple ? SelectArrayInput : SelectInput;
    return (
        <SelectInput
        <InputComponent
            source={name}
            choices={list}
            {...parmas}
        />
    );
};