From f36e2476321093505a760fced571a28fb7d3831c Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期二, 15 四月 2025 13:31:48 +0800
Subject: [PATCH] #列表选中提示中文修复
---
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