From 014270352f8e19b51bbb4367ae2ff256050a30a2 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期二, 22 四月 2025 14:03:42 +0800 Subject: [PATCH] #修改优化 1. 字典优化修改 2. 编码规则优化 3. 出库单编码生成为空问题修复 --- rsf-admin/src/page/components/DictionarySelect.jsx | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/rsf-admin/src/page/components/DictionarySelect.jsx b/rsf-admin/src/page/components/DictionarySelect.jsx index 43dc811..0eb2fab 100644 --- a/rsf-admin/src/page/components/DictionarySelect.jsx +++ b/rsf-admin/src/page/components/DictionarySelect.jsx @@ -2,14 +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 { selectedIds } = useListContext(); + const { dictTypeCode, name, multiple = false, ...parmas } = props; const translate = useTranslate(); const notify = useNotify(); const [list, setList] = useState([]) @@ -25,20 +24,22 @@ setList(res.data.data.records.map((item) => { return { id: item.value, - name: item.value + name: item.label } })) } else { notify(res.data.msg); } } + const InputComponent = multiple ? SelectArrayInput : SelectInput; return ( - <SelectInput + <InputComponent source={name} choices={list} {...parmas} /> + ); }; -- Gitblit v1.9.1