From 99411967019bbf0d7b0b971eae0db2c2c58025f0 Mon Sep 17 00:00:00 2001
From: skyouc <958836976@qq.com>
Date: 星期六, 30 八月 2025 16:27:47 +0800
Subject: [PATCH] 修改任务状态
---
rsf-admin/src/page/components/DictionarySelect.jsx | 57 ++++++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 40 insertions(+), 17 deletions(-)
diff --git a/rsf-admin/src/page/components/DictionarySelect.jsx b/rsf-admin/src/page/components/DictionarySelect.jsx
index 0eb2fab..aa489d2 100644
--- a/rsf-admin/src/page/components/DictionarySelect.jsx
+++ b/rsf-admin/src/page/components/DictionarySelect.jsx
@@ -8,38 +8,61 @@
import request from '@/utils/request';
const DictionarySelect = (props) => {
- const { dictTypeCode, name, multiple = false, ...parmas } = props;
+ const {
+ dictTypeCode,
+ name,
+ group,
+ multiple = false,
+ perPage = 100, // 榛樿姣忛〉鏄剧ず100鏉℃暟鎹�
+ page = 1, // 榛樿绗竴椤�
+ ...parmas
+ } = props;
const translate = useTranslate();
const notify = useNotify();
- const [list, setList] = useState([])
+ const [list, setList] = useState([]);
+ const [loading, setLoading] = useState(false);
useEffect(() => {
- http()
- }, [dictTypeCode]);
+ http();
+ }, [dictTypeCode, page, perPage]);
const http = async () => {
- const res = await request.post('/dictData/page', { dictTypeCode });
- if (res?.data?.code === 200) {
-
- setList(res.data.data.records.map((item) => {
- return {
- id: item.value,
- name: item.label
- }
- }))
- } else {
- notify(res.data.msg);
+ setLoading(true);
+ try {
+ const res = await request.post('/dictData/page', {
+ dictTypeCode,
+ group,
+ current: page,
+ pageSize: perPage
+ });
+
+ if (res?.data?.code === 200) {
+ setList(res.data.data.records.map((item) => {
+ return {
+ id: item.value,
+ name: item.label
+ }
+ }));
+ } else {
+ notify(res.data.msg);
+ }
+ } catch (error) {
+ notify('鍔犺浇瀛楀吀鏁版嵁澶辫触', 'error');
+ console.error('鍔犺浇瀛楀吀鏁版嵁澶辫触:', error);
+ } finally {
+ setLoading(false);
}
- }
+ };
+
const InputComponent = multiple ? SelectArrayInput : SelectInput;
return (
<InputComponent
source={name}
choices={list}
+ isLoading={loading}
{...parmas}
/>
-
);
};
--
Gitblit v1.9.1