From 9fe1ec3afe8696c628d076d1f76686c4efc3012e Mon Sep 17 00:00:00 2001
From: zc <zyzc>
Date: 星期二, 21 十月 2025 10:49:55 +0800
Subject: [PATCH] 容器初始化功能优化
---
rsf-admin/src/page/work/components/StaSelect.jsx | 30 +++++++++++++++++++-----------
1 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/rsf-admin/src/page/work/components/StaSelect.jsx b/rsf-admin/src/page/work/components/StaSelect.jsx
index 5971aa6..d033b5f 100644
--- a/rsf-admin/src/page/work/components/StaSelect.jsx
+++ b/rsf-admin/src/page/work/components/StaSelect.jsx
@@ -29,19 +29,27 @@
const http = async () => {
setLoading(true);
try {
- const res = await request.post('/selectStaList/page', {
- type: type,
- current: page,
- pageSize: perPage
+ const res = await request.post('/selectStaList/list', {
+ type: type
});
if (res?.data?.code === 200) {
- setList(res.data.data.records.map((item) => {
- return {
- id: item.site,
- name: item.site
- }
- }));
+ // 浣跨敤Set鏉ヨ繃婊ら噸澶嶇殑site鍊�
+ const uniqueSites = new Set();
+ setList(res.data.data
+ .filter(item => {
+ if (uniqueSites.has(item.site)) {
+ return false;
+ }
+ uniqueSites.add(item.site);
+ return true;
+ })
+ .map((item) => {
+ return {
+ id: item.site,
+ name: item.site
+ }
+ }));
} else {
notify(res.data.msg);
}
@@ -60,7 +68,7 @@
source={name}
choices={list}
isLoading={loading}
- optionValue='id'
+ optionValue='name'
optionText='name'
{...parmas}
/>
--
Gitblit v1.9.1