From e0351f5e0d75ab4f1da19696b55a1d3cd70b0a68 Mon Sep 17 00:00:00 2001
From: verou <857149855@qq.com>
Date: 星期二, 25 三月 2025 16:43:06 +0800
Subject: [PATCH] feat:库区批量
---
rsf-admin/src/page/basicInfo/matnr/MatnrListAside.jsx | 31 +++++++++++++++++++------------
1 files changed, 19 insertions(+), 12 deletions(-)
diff --git a/rsf-admin/src/page/basicInfo/matnr/MatnrListAside.jsx b/rsf-admin/src/page/basicInfo/matnr/MatnrListAside.jsx
index 3a836ee..dd93b57 100644
--- a/rsf-admin/src/page/basicInfo/matnr/MatnrListAside.jsx
+++ b/rsf-admin/src/page/basicInfo/matnr/MatnrListAside.jsx
@@ -4,10 +4,11 @@
SavedQueriesList,
FilterLiveSearch,
useNotify,
- useListContext
+ useListContext,
+ SearchInput
} from 'react-admin';
import BookmarkIcon from '@mui/icons-material/BookmarkBorder';
-import { Box, Typography, Card, CardContent, useTheme, TextField } from '@mui/material';
+import { Box, Typography, Card, CardContent, useTheme, Input } from '@mui/material';
import { RichTreeView } from "@mui/x-tree-view/RichTreeView";
import { TreeItem2 } from "@mui/x-tree-view/TreeItem2";
@@ -18,7 +19,8 @@
const { setFilters } = useListContext(); // 鑾峰彇鍒楄〃涓婁笅鏂�
const [selectedOption, setSelectedOption] = useState(null);
const [treeData, setTreeData] = useState([]);
- const [defaultIds, setDefaultIds] = useState(['29']);
+ const [defaultIds, setDefaultIds] = useState(['65']);
+ const [condition, setCondition] = useState('');
const haveChildren = (item) => {
if (Array.isArray(item)) {
@@ -38,15 +40,17 @@
return item;
};
useEffect(() => {
- request.post('/matnrGroup/tree')
+ http()
+ }, [condition]);
+
+ const http = () => {
+ request.post('/matnrGroup/tree', { condition })
.then(res => {
if (res?.data?.code === 200) {
let data = res.data.data;
let items = haveChildren(data)
-
setTreeData(items)
setDefaultIds([items.at(0).id])
-
} else {
notify(res.data.msg);
@@ -56,12 +60,12 @@
notify('Error fetching tree data');
});
- }, []);
+ }
const handleNodeSelect = (event, nodeId) => {
setFilters({ groupId: nodeId });
};
- const handleSearch = () => {
- console.log('Search Input:', selectedOption);
+ const handleSearch = (e) => {
+ setCondition(e.target.value)
};
@@ -92,12 +96,15 @@
border: theme.palette.mode === 'light' && '1px solid #e0e0e3',
width: 250,
minWidth: 150,
- height: `calc(100% - 120px)`,
+ height: `100%`,
}}
>
<CardContent>
- <SavedQueriesList icon={<BookmarkIcon />} />
- <FilterLiveSearch source="condition" />
+ <Input
+ placeholder="鎼滅储鐗╂枡鍒嗙粍"
+ sx={{ '--Input-focused': 1, marginBottom: '10px' }}
+ onChange={handleSearch}
+ />
<RichTreeView
defaultExpandedItems={defaultIds}
expansionTrigger="iconContainer"
--
Gitblit v1.9.1