From 8473d57f551e88176e1a7b9e8ea50648ce918f17 Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期一, 03 三月 2025 07:55:56 +0800
Subject: [PATCH] #
---
rsf-admin/src/page/basicInfo/whMat/index.jsx | 15 +
rsf-admin/src/page/basicInfo/whMat/mySearchInput.jsx | 21 +
rsf-admin/src/page/basicInfo/whMat/WhMatList.jsx | 237 ++++++++++++++++++
rsf-admin/src/page/basicInfo/whMat/whMatCreate.jsx | 327 +++++++++++++++++++++++++
rsf-admin/src/i18n/zh.js | 10
rsf-admin/src/i18n/en.js | 8
rsf-admin/src/page/ResourceContent.js | 3
rsf-admin/src/page/basicInfo/whMat/WhMatListAside.jsx | 86 ++++++
rsf-admin/src/page/basicInfo/whMat/warehouse.jsx | 34 ++
rsf-admin/src/page/loc/LocList.jsx | 2
10 files changed, 738 insertions(+), 5 deletions(-)
diff --git a/rsf-admin/src/i18n/en.js b/rsf-admin/src/i18n/en.js
index 78925e2..6d08aaa 100644
--- a/rsf-admin/src/i18n/en.js
+++ b/rsf-admin/src/i18n/en.js
@@ -135,7 +135,7 @@
companys: 'Companys',
serialRuleItem: 'SerialRuleItem',
serialRule: 'SerialRule',
-
+ whMat: 'Warehouse Mat',
},
table: {
field: {
@@ -450,7 +450,11 @@
batchRole: 'batch role',
}
},
-
+ whMat: {
+ title: {
+ add: 'add',
+ }
+ },
},
form: {
matnr: {
diff --git a/rsf-admin/src/i18n/zh.js b/rsf-admin/src/i18n/zh.js
index 071f90f..c33f935 100644
--- a/rsf-admin/src/i18n/zh.js
+++ b/rsf-admin/src/i18n/zh.js
@@ -135,7 +135,7 @@
companys: '寰�鏉ヤ紒涓�',
serialRuleItem: '缂栫爜瑙勫垯瀛愯〃',
serialRule: '缂栫爜瑙勫垯',
-
+ whMat: '搴撳尯鐗╂枡鍏崇郴',
},
table: {
field: {
@@ -388,6 +388,7 @@
currValue: "褰撳墠娴佹按鍙�",
lastCode: "鏈�杩戠敓鎴愮紪鐮�",
},
+
}
},
page: {
@@ -450,7 +451,12 @@
control: '鎺у埗灞炴��',
batchRole: '鎵规瑙勫垯',
}
- }
+ },
+ whMat: {
+ title: {
+ add: '娣诲姞',
+ }
+ },
},
form: {
matnr: {
diff --git a/rsf-admin/src/page/ResourceContent.js b/rsf-admin/src/page/ResourceContent.js
index 5a97f65..d8753d0 100644
--- a/rsf-admin/src/page/ResourceContent.js
+++ b/rsf-admin/src/page/ResourceContent.js
@@ -26,6 +26,7 @@
import companys from './basicInfo/companys';
import serialRuleItem from './serialRuleItem';
import serialRule from './serialRule';
+import whMat from './basicInfo/whMat';
const ResourceContent = (node) => {
@@ -74,6 +75,8 @@
return serialRuleItem;
case 'serialRule':
return serialRule;
+ case 'whMat':
+ return whMat;
default:
return {
list: ListGuesser,
diff --git a/rsf-admin/src/page/basicInfo/whMat/WhMatList.jsx b/rsf-admin/src/page/basicInfo/whMat/WhMatList.jsx
new file mode 100644
index 0000000..1085ed2
--- /dev/null
+++ b/rsf-admin/src/page/basicInfo/whMat/WhMatList.jsx
@@ -0,0 +1,237 @@
+import React, { useState, useRef, useEffect, useMemo } from "react";
+import { Box, Card, CardContent, LinearProgress, TextField, Button, Typography } from "@mui/material";
+import * as Icons from '@mui/icons-material';
+import { List, useTranslate, useListContext, Title, } from "react-admin";
+import WhMatListAside from "./WhMatListAside";
+import { RichTreeView } from "@mui/x-tree-view/RichTreeView";
+import { TreeItem2 } from "@mui/x-tree-view/TreeItem2";
+import request from '@/utils/request';
+import { Add, Edit, Delete, Padding, Save } from '@mui/icons-material';
+import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
+import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight';
+import RefreshIcon from '@mui/icons-material/Refresh';
+import { useTreeItem2Utils } from '@mui/x-tree-view/hooks';
+import WhMatCreate from "./whMatCreate";
+
+// const RESOURCE = 'dept';
+const TITLE = 'menu.whMat';
+
+const WhMatListContent = () => {
+ const translate = useTranslate();
+ const [searchVal, setSearchVal] = useState('');
+ const [createDialog, setCreateDialog] = React.useState(false);
+ const [editRecord, setEditRecord] = React.useState(null);
+ const treeData = [
+ {
+ id: '19',
+ label: '鍗婃垚鍝�',
+ secondaryLabel: 'RM001',
+ editable: true,
+ children: [
+ {
+ id: 'grid-community', primaryText: '鍗婃垚鍝�',
+ secondaryText: 'RM001', label: '@mui/x-data-grid', editable: true, children: [
+ {
+ id: 'grid-community22', primaryText: '鍗婃垚鍝�',
+ secondaryText: 'RM001', label: '@mui/x-data-grid', editable: true
+ },]
+ },
+ {
+ id: 'grid-pro', primaryText: '鍗婃垚鍝�',
+ secondaryText: 'RM001', label: '@mui/x-data-grid-pro', editable: true
+ },
+ {
+ id: 'grid-premium', primaryText: '鍗婃垚鍝�',
+ secondaryText: 'RM001', label: '@mui/x-data-grid-premium', editable: true
+ },
+ ],
+ },
+ {
+ id: '18',
+ label: '鍘熸潗鏂�',
+ primaryText: '鍗婃垚鍝�',
+ secondaryText: 'RM001',
+ },
+ {
+ id: 'charts',
+ label: 'Charts',
+ primaryText: '鍗婃垚鍝�',
+ secondaryText: 'RM001',
+ children: [{
+ id: 'charts-community', primaryText: '鍗婃垚鍝�',
+ secondaryText: 'RM001', label: '@mui/x-charts'
+ }],
+ },
+ {
+ id: 'tree-view',
+ label: 'Tree View',
+ primaryText: '鍗婃垚鍝�',
+ secondaryLabel: 'RM001',
+ children: [{
+ id: 'tree-view-community', primaryText: '鍗婃垚鍝�',
+ secondaryText: 'RM001', label: '@mui/x-tree-view'
+ }],
+ },
+ {
+ id: 'tree-view2',
+ label: 'Tree View3',
+ primaryText: '鍗婃垚鍝�',
+ secondaryText: 'RM001',
+ children: [{
+ id: 'tree-view-community1', primaryText: '鍗婃垚鍝�',
+ secondaryText: 'RM001', label: '@mui/x-tree-view'
+ }],
+ },
+ ];
+ const handleNodeSelect = (event, nodeId) => {
+ console.log('Selected Node ID:', nodeId);
+ // 鍦ㄨ繖閲屽彲浠ユ牴鎹� nodeId 鏇存柊涓诲唴瀹瑰尯鍩�
+ };
+ const handleSearch = () => {
+ console.log('Search Input:', selectedOption);
+ };
+
+
+ const CustomCheckbox = React.forwardRef(function CustomCheckbox(props, ref) {
+ return <input type="checkbox" ref={ref} {...props} />;
+ });
+ function CustomLabel({ children, className, secondaryLabel }) {
+ return (
+ <Box display={"flex"} alignItems={"end"}>
+ <Typography fontWeight={500}>{children}</Typography>
+ <Box width={10}></Box>
+ {secondaryLabel && (
+ <Typography variant="caption" color="secondary">
+ {secondaryLabel}
+ </Typography>
+ )}
+ </Box>
+ );
+ }
+ const CustomTreeItem = React.forwardRef(function CustomTreeItem(props, ref) {
+ const { publicAPI } = useTreeItem2Utils({
+ itemId: props.itemId,
+ children: props.children,
+ });
+
+ const item = publicAPI.getItem(props.itemId);
+
+ return (
+ <TreeItem2
+ {...props}
+ ref={ref}
+ slots={{
+ label: CustomLabel,
+ }}
+ slotProps={{
+ label: { secondaryLabel: item?.secondaryLabel || '' },
+ }}
+
+ />
+ );
+ });
+
+ const isLoading = false;
+
+ React.useEffect(() => {
+ request.post('/matnrGroup/tree', {})
+ .then(res => {
+ if (res?.data?.code === 200) {
+ let data = res.data.data;
+ console.log(data);
+
+ } else {
+ notify(res.data.msg);
+ }
+ })
+ .catch(error => {
+ notify('Error fetching tree data');
+ });
+ }, [searchVal])
+
+ const handleAdd = () => {
+ setCreateDialog(true);
+ };
+
+ return (
+ <>
+ <Box sx={{ mt: 1, mr: 3, display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
+ <WhMatCreate
+ editRecord={editRecord}
+ open={createDialog}
+ setOpen={setCreateDialog}
+ />
+ <Box
+ width={300}
+ mb={1}
+ >
+ <TextField
+ label={translate('ra.action.search')}
+ value={searchVal}
+ onChange={(e) => handleInput(e.target.value)}
+ />
+ </Box>
+ <Box>
+ <Button
+ variant="outlined"
+ color="primary"
+ startIcon={<Add />}
+ onClick={handleAdd}
+ >
+ {translate('ra.action.add')}
+ </Button>
+ <Button
+ variant="outlined"
+ color="error"
+ startIcon={<Delete />}
+ sx={{ ml: 1 }}
+ >
+ {translate('ra.action.delete')}
+ </Button>
+ <Button
+ variant="outlined"
+ color="primary"
+ sx={{ ml: 1 }}
+ startIcon={<Save />}
+ >
+ {translate('ra.action.save')}
+ </Button>
+ </Box>
+ </Box>
+
+ <Card>
+ <CardContent>
+ <RichTreeView
+ defaultExpandedItems={['grid', 'pickers']}
+ checkboxSelection
+ items={treeData}
+ slots={{ item: CustomTreeItem }}
+ onItemClick={handleNodeSelect} // 鐩戝惉鑺傜偣鐐瑰嚮浜嬩欢
+ />
+ </CardContent>
+ </Card>
+ </>
+ )
+}
+
+const WhMatList = () => {
+ const translate = useTranslate();
+ return (
+ <>
+ <Box sx={{
+ display: 'flex',
+ marginBottom: 24
+ }}>
+ <Title title={TITLE} />
+ <Box>
+ <WhMatListAside />
+ </Box>
+ <Box sx={{ flexGrow: 1 }}>
+ <WhMatListContent />
+ </Box>
+ </Box>
+ </>
+
+ )
+}
+export default WhMatList;
\ No newline at end of file
diff --git a/rsf-admin/src/page/basicInfo/whMat/WhMatListAside.jsx b/rsf-admin/src/page/basicInfo/whMat/WhMatListAside.jsx
new file mode 100644
index 0000000..fc0c510
--- /dev/null
+++ b/rsf-admin/src/page/basicInfo/whMat/WhMatListAside.jsx
@@ -0,0 +1,86 @@
+import React, { useState, useRef, useEffect, useMemo, useCallback } from "react";
+import { Card, useTheme, List, CardContent, Input, InputAdornment, IconButton, TextField } from "@mui/material";
+import { useForm } from 'react-hook-form';
+import Warehouse from "./warehouse";
+import { Filter, SearchInput, useListContext,useTranslate } from 'react-admin';
+import request from '@/utils/request';
+
+const WhMatListAside = () => {
+ const theme = useTheme();
+ const translate = useTranslate();
+ const [searchVal, setSearchVal] = useState('');
+ const { control, getValues } = useForm();
+ const [map, setMap] = useState([
+ {
+ id: 1,
+ name: '浠撳簱1',
+ code: 'WH1',
+ icon: 'Warehouse',
+ locCount: 350,
+ },
+ {
+ id: 2,
+ name: '浠撳簱2',
+ code: 'WH1',
+ icon: 'Warehouse',
+ locCount: 237,
+ },
+ {
+ id: 3,
+ name: '浠撳簱3',
+ code: 'WH1',
+ icon: 'Warehouse',
+ locCount: 590,
+ }
+ ]);
+
+ const handleInput = (value) => {
+ console.log(value);
+ setSearchVal(value);
+ }
+ React.useEffect(() => {
+ request.post('/matnrGroup/tree', {})
+ .then(res => {
+ if (res?.data?.code === 200) {
+ let data = res.data.data;
+ console.log(data);
+
+ } else {
+ notify(res.data.msg);
+ }
+ })
+ .catch(error => {
+ notify('Error fetching tree data');
+ });
+ }, [searchVal])
+
+ return (
+ <Card
+ sx={{
+ order: -1,
+ mr: 2,
+ mt: 4,
+ width: 250
+ }}
+ >
+ <CardContent>
+ <div>
+ <TextField
+ label={translate('ra.action.search')}
+ value={searchVal}
+ onChange={(e) => handleInput(e.target.value)}
+
+ />
+ </div>
+ <List>
+ {map.map(record => (
+ <Warehouse key={record.id} record={record} />
+ ))}
+ </List>
+ </CardContent>
+
+ </Card>
+ )
+}
+
+export default WhMatListAside;
\ No newline at end of file
diff --git a/rsf-admin/src/page/basicInfo/whMat/index.jsx b/rsf-admin/src/page/basicInfo/whMat/index.jsx
new file mode 100644
index 0000000..c8034ce
--- /dev/null
+++ b/rsf-admin/src/page/basicInfo/whMat/index.jsx
@@ -0,0 +1,15 @@
+import React, { useState, useRef, useEffect, useMemo } from "react";
+import {
+ ListGuesser,
+ EditGuesser,
+ ShowGuesser,
+} from "react-admin";
+
+import WhMatList from "./WhMatList";
+
+export default {
+ list: WhMatList,
+ recordRepresentation: (record) => {
+ return `${record.name}`
+ }
+};
\ No newline at end of file
diff --git a/rsf-admin/src/page/basicInfo/whMat/mySearchInput.jsx b/rsf-admin/src/page/basicInfo/whMat/mySearchInput.jsx
new file mode 100644
index 0000000..92e46b1
--- /dev/null
+++ b/rsf-admin/src/page/basicInfo/whMat/mySearchInput.jsx
@@ -0,0 +1,21 @@
+import React, { useState, useRef, useEffect, useMemo, useCallback } from "react";
+import { Card, useTheme, List, CardContent, Input, InputAdornment, IconButton, TextField } from "@mui/material";
+import { useForm } from 'react-hook-form';
+import Warehouse from "./warehouse";
+import { Filter, SearchInput } from 'react-admin';
+
+
+export const MySearchInput = (props) => {
+ const [searchTerm, setSearchTerm] = useState('');
+
+ return (
+ <>
+ <TextField
+ label="Search"
+ value={searchTerm}
+ onChange={(e) => setSearchTerm(e.target.value)}
+ />
+ {/* <Button onClick={handleSearch}>Search</Button> */}
+ </>
+ )
+}
\ No newline at end of file
diff --git a/rsf-admin/src/page/basicInfo/whMat/warehouse.jsx b/rsf-admin/src/page/basicInfo/whMat/warehouse.jsx
new file mode 100644
index 0000000..25494bc
--- /dev/null
+++ b/rsf-admin/src/page/basicInfo/whMat/warehouse.jsx
@@ -0,0 +1,34 @@
+import { ListItem, ListItemIcon, ListItemText, ListItemButton, Box, ListItemSecondaryAction } from "@mui/material";
+import React, { useState, useRef, useEffect, useMemo } from "react";
+import * as Icons from '@mui/icons-material';
+
+const Warehouse = (props) => {
+ const { record } = props;
+ const IconComponent = Icons[record.icon];
+ return (
+ <Box sx={{padding: '5px'}}>
+ <ListItem disablePadding>
+ <ListItemButton >
+ <ListItemIcon sx={{ minWidth: '30px' }}>
+ <IconComponent />
+ </ListItemIcon>
+ <ListItemText primary={record.name} />
+ <ListItemSecondaryAction>
+ <Box
+ component="span"
+ sx={{
+ marginRight: '1em',
+ color: 'text.primary',
+ }}
+ >
+ {record.locCount}
+ </Box>
+ </ListItemSecondaryAction>
+ </ListItemButton>
+ </ListItem>
+ </Box>
+ )
+}
+
+
+export default Warehouse;
\ No newline at end of file
diff --git a/rsf-admin/src/page/basicInfo/whMat/whMatCreate.jsx b/rsf-admin/src/page/basicInfo/whMat/whMatCreate.jsx
new file mode 100644
index 0000000..9276214
--- /dev/null
+++ b/rsf-admin/src/page/basicInfo/whMat/whMatCreate.jsx
@@ -0,0 +1,327 @@
+import React, { useState, useRef, useEffect, useMemo } from "react";
+import {
+ CreateBase,
+ Form,
+ useTranslate,
+ Toolbar,
+ SaveButton,
+ TextInput,
+ required,
+ NumberInput,
+} from 'react-admin';
+import {
+ Dialog,
+ DialogActions,
+ DialogContent,
+ DialogTitle,
+ Stack,
+ Grid,
+ Box,
+ TableRow,
+ IconButton,
+ Table,
+ TableBody,
+ TableCell,
+ TableContainer,
+ TableHead,
+ Paper,
+ Checkbox
+} from '@mui/material';
+import DialogCloseButton from "@/page/components/DialogCloseButton";
+import { styled } from '@mui/material/styles';
+import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
+import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight';
+
+
+const columns = [
+ {
+ id: 'checkbox',
+ label: 1,
+ align: 'center',
+ minWidth: 50,
+ },
+ {
+ id: 'name',
+ label: 'table.field.dept.name',
+ minWidth: 170,
+ },
+ {
+ id: 'fullName',
+ label: 'table.field.dept.fullName',
+ minWidth: 170,
+ },
+ {
+ id: 'leader',
+ label: 'table.field.dept.leader',
+ minWidth: 170,
+ },
+ {
+ id: 'updateTime',
+ label: 'common.field.updateTime',
+ minWidth: 170,
+ format: (val) => {
+ return new Date(val).toLocaleString();
+ }
+ },
+];
+
+const WhMatCreate = (props) => {
+ const translate = useTranslate();
+ const { editRecord, open, setOpen, callback, resource } = props;
+
+ const handleClose = (event, reason) => {
+ if (reason !== "backdropClick") {
+ setOpen(false);
+ }
+ };
+
+ const onSubmit = (data) => {
+ const _params = { ...data };
+ };
+
+ return (
+ <>
+ <CreateBase>
+ <Dialog
+ open={open}
+ onClose={handleClose}
+ aria-labelledby="form-dialog-title"
+ fullWidth
+ disableRestoreFocus
+ maxWidth="lg" // 'xs' | 'sm' | 'md' | 'lg' | 'xl'
+ >
+ <Form record={editRecord} onSubmit={onSubmit}>
+ <DialogTitle id="form-dialog-title" sx={{
+ position: 'sticky',
+ top: 0,
+ backgroundColor: 'background.paper',
+ zIndex: 1000
+ }}
+ >
+ {editRecord ? translate('update.title') : translate('create.title')}
+ <Box sx={{ position: 'absolute', top: 8, right: 8, zIndex: 1001 }}>
+ <DialogCloseButton onClose={handleClose} />
+ </Box>
+ </DialogTitle>
+ <DialogContent sx={{ mt: 2 }}>
+ <WhMatCreateContent />
+ </DialogContent>
+ <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}>
+ <Toolbar sx={{ width: '100%', justifyContent: 'space-between' }} >
+ <SaveButton />
+ </Toolbar>
+ </DialogActions>
+ </Form>
+ </Dialog>
+ </CreateBase>
+ </>
+ );
+};
+const StyledTableRow = styled(TableRow)(({ theme }) => ({
+ '& .MuiButtonBase-root': {
+ padding: '0px 8px'
+ }
+}));
+
+const StyledTableCell = styled(TableCell)(({ theme }) => ({
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
+ whiteSpace: 'nowrap',
+ maxWidth: 600,
+}));
+
+const TreeTableRow = (props) => {
+ const { row, depth = 0, openNodes, setOpenNodes, onEdit, onDelete } = props;
+ const isOpen = openNodes[row.id] || false;
+ const [checked, setChecked] = useState(false);
+ const toggleNode = (id) => {
+ setOpenNodes(prevState => ({ ...prevState, [id]: !prevState[id] }));
+ };
+ return (
+ <React.Fragment>
+ <StyledTableRow hover tabIndex={-1} key={row.id}>
+ <StyledTableCell sx={{ padding: 0, width: 60 }}>
+ {row.children && (
+ <IconButton
+ aria-label="expand row"
+ size="small"
+ style={{ paddingLeft: (depth * 16) }}
+ onClick={() => toggleNode(row.id)}
+ >
+ {isOpen ? <KeyboardArrowDownIcon /> : <KeyboardArrowRightIcon />}
+ </IconButton>
+ )}
+ </StyledTableCell>
+ <StyledTableCell key="checkbox" align="center" style={{ paddingLeft: (depth * 16 + 16) }}>
+ <Checkbox
+ checked={row.checked}
+ onChange={() => {row.checked = !row.checked;}}
+ />
+ </StyledTableCell>
+ {columns.map((column, idx) => {
+ if (column.id !== 'actions' && column.id !== 'checkbox') {
+ const value = row[column.id];
+ return (
+ <>
+ <StyledTableCell
+ key={column.id}
+ align={column.align || 'left'}
+ style={{ paddingLeft: idx === 0 && (depth * 16 + 16) }}
+ onClick={() => toggleNode(row.id)}
+ >
+ {column.format ? column.format(value) : value}
+ </StyledTableCell>
+ </>
+
+ )
+ }
+ })}
+ {/* <StyledTableCell>
+ <Tooltip title="Edit">
+ <IconButton onClick={() => onEdit(row)}>
+ <Edit />
+ </IconButton>
+ </Tooltip>
+ <Tooltip title="Delete">
+ <IconButton onClick={() => onDelete(row)}>
+ <Delete />
+ </IconButton>
+ </Tooltip>
+ </StyledTableCell> */}
+ </StyledTableRow>
+ {row.children && isOpen && (
+ row.children.map((child) => (
+ <TreeTableRow
+ key={child.id}
+ row={child}
+ depth={depth + 1}
+ openNodes={openNodes}
+ setOpenNodes={setOpenNodes}
+ />
+ ))
+ )}
+ </React.Fragment>
+ );
+};
+
+const WhMatCreateContent = (props) => {
+ const translate = useTranslate();
+ const [treeData, setTreeData] = useState([
+ {
+ id: 1, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, checked: false, children: [
+ {
+ id: 29, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: [
+ { id: 30, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 31, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 32, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 33, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 34, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 35, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ ]
+ },
+ { id: 24, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 25, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 26, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 27, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 28, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+
+ ]
+ },
+ { id: 2, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 3, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 4, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 5, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 6, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 7, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 8, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 9, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 10, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 11, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 12, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 13, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 14, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 15, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 16, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 17, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 18, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 19, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 20, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 21, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 22, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+ { id: 23, name: 'root', fullName: '鏍硅妭鐐�', leader: 'admin', sort: 1, children: null },
+
+
+ ]);
+ const [openNodes, setOpenNodes] = React.useState({});
+
+ return (
+ <>
+ <Grid container rowSpacing={2} columnSpacing={2}>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.dept.name"
+ source="name"
+ parse={v => v}
+ validate={required()}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.dept.fullName"
+ source="fullName"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.dept.leader"
+ source="leader"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <NumberInput
+ label="table.field.dept.sort"
+ source="sort"
+ />
+ </Grid>
+
+ </Grid>
+ <TableContainer component={Paper}>
+ <Table size="small">
+ <TableHead>
+ <TableRow>
+ <StyledTableCell sx={{ padding: 0, width: 60 }} />
+ {columns.map((column, idx) => (
+ <StyledTableCell
+ key={idx}
+ align={column.align || 'left'}
+ style={{
+ minWidth: column.minWidth
+ }}
+ >
+ {typeof column.label === 'string' ? translate(column.label) : <Checkbox />}
+ </StyledTableCell>
+ ))}
+ </TableRow>
+ </TableHead>
+ <TableBody>
+ {treeData && treeData.length > 0 && (
+ treeData.map((row) => (
+ <TreeTableRow
+ key={row.id}
+ row={row}
+ openNodes={openNodes}
+ setOpenNodes={setOpenNodes}
+ />
+ ))
+ )}
+ </TableBody>
+ </Table>
+ </TableContainer>
+ </>
+
+ );
+};
+
+export default WhMatCreate;
\ No newline at end of file
diff --git a/rsf-admin/src/page/loc/LocList.jsx b/rsf-admin/src/page/loc/LocList.jsx
index cb58548..1392d7d 100644
--- a/rsf-admin/src/page/loc/LocList.jsx
+++ b/rsf-admin/src/page/loc/LocList.jsx
@@ -134,7 +134,7 @@
omit={['id', 'createTime', 'createBy', 'memo']}
>
<NumberField source="id" />
- <NumberField source="warehouseId$" label="table.field.loc.warehouseId" />,
+ <NumberField source="warehouseId$" label="table.field.loc.warehouseId" />
<NumberField source="areaId$" label="table.field.loc.areaId" />
<TextField source="code" label="table.field.loc.code" />
<TextField source="type" label="table.field.loc.type" />
--
Gitblit v1.9.1