skyouc
2025-05-15 c46d1d8c3b9875f051a6ec3c4a1d3fa7bd32e5db
rsf-admin/src/page/components/DictSelect.jsx
@@ -1,12 +1,12 @@
import { useState, useEffect } from 'react';
import {
    useTranslate, useNotify
    useTranslate, useNotify, required
} from 'react-admin';
import request from '@/utils/request';
import { Select, MenuItem, FormControl, InputLabel } from '@mui/material';
const DictSelect = (props) => {
    const { dictTypeCode, label, value, onChange, ...params } = props;
    const { dictTypeCode, label, group, value, onChange, ...params } = props;
    const translate = useTranslate();
    const notify = useNotify();
    const [list, setList] = useState([]);
@@ -16,7 +16,7 @@
    }, [dictTypeCode]);
    const http = async () => {
        const res = await request.post('/dictData/page', { dictTypeCode });
        const res = await request.post('/dictData/page', { dictTypeCode, group });
        if (res?.data?.code === 200) {
            setList(res.data.data.records.map((item) => {
                return {
@@ -44,8 +44,10 @@
            <Select
                labelId="demo-select-small-label"
                value={validValue}
                variant="filled"
                onChange={handleChange}
                size='small'
            >
                {list.map((item) => (
                    <MenuItem key={item.value} value={item.value}>