From 49f8eeef1dfbc4ba1eb3a4cc413e4a78eba0357c Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期六, 07 二月 2026 09:47:54 +0800
Subject: [PATCH] #取消页面缓存和更新页面组件

---
 rsf-admin/src/page/basicInfo/loc/LocList.jsx |   95 +++++++++++++++++++++--------------------------
 1 files changed, 43 insertions(+), 52 deletions(-)

diff --git a/rsf-admin/src/page/basicInfo/loc/LocList.jsx b/rsf-admin/src/page/basicInfo/loc/LocList.jsx
index 3b945f5..5e57c80 100644
--- a/rsf-admin/src/page/basicInfo/loc/LocList.jsx
+++ b/rsf-admin/src/page/basicInfo/loc/LocList.jsx
@@ -5,7 +5,7 @@
     DatagridConfigurable,
     SearchInput,
     TopToolbar,
-    SelectColumnsButton,
+    ColumnsButton,
     EditButton,
     FilterButton,
     CreateButton,
@@ -35,26 +35,27 @@
     Button,
     useList,
 } from 'react-admin';
+import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting';
 import { Box, Typography, Card, Stack } from '@mui/material';
-import { styled } from '@mui/material/styles';
-import LocCreate from "./LocCreate";
-import BindModal from "./BindModal";
-import EmptyData from "../../components/EmptyData";
-import DynamicField from "../../components/DynamicField";
 import MyCreateButton from "../../components/MyCreateButton";
 import MyExportButton from '../../components/MyExportButton';
+import DashboardIcon from '@mui/icons-material/Dashboard';
+import DynamicField from "../../components/DynamicField";
+import DiscountIcon from '@mui/icons-material/Discount';
+import PageDrawer from "../../components/PageDrawer";
+import EmptyData from "../../components/EmptyData";
+import EditIcon from '@mui/icons-material/Edit';
+import LinkIcon from '@mui/icons-material/Link';
+import { styled } from '@mui/material/styles';
+import SubzoneModal from './SubzoneModal';
+import LocListAside from "./LocListAside";
 import InitButton from './InitButton';
 import BatchModal from './BatchModal';
-import SubzoneModal from './SubzoneModal';
-import PageDrawer from "../../components/PageDrawer";
-import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting';
-import DashboardIcon from '@mui/icons-material/Dashboard';
-import EditIcon from '@mui/icons-material/Edit';
 import request from '@/utils/request';
-import DiscountIcon from '@mui/icons-material/Discount';
-import LinkIcon from '@mui/icons-material/Link';
+import LocCreate from "./LocCreate";
+import BindModal from "./BindModal";
 import InitModal from "./InitModal";
-import LocListAside from "./LocListAside";
+import StickyDataTable from "@/page/components/StickyDataTable";
 
 const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
     '& .css-1vooibu-MuiSvgIcon-root': {
@@ -83,16 +84,14 @@
     },
 }));
 
-
-
 const LocList = () => {
-    const translate = useTranslate();
-    const notify = useNotify();
-    const refresh = useRefresh();
-    const [createDialog, setCreateDialog] = useState(false);
-    const [drawerVal, setDrawerVal] = useState(false);
-    const [initDialog, setInitDialog] = useState(false);
     const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_loc_use_stas')) || [];
+    const [createDialog, setCreateDialog] = useState(false);
+    const [initDialog, setInitDialog] = useState(false);
+    const [drawerVal, setDrawerVal] = useState(false);
+    const translate = useTranslate();
+    const refresh = useRefresh();
+    const notify = useNotify();
 
     const filters = [
         <SearchInput source="condition" alwaysOn />,
@@ -111,11 +110,14 @@
             source="areaId"
             label="table.field.loc.areaId"
             reference="warehouseAreas"
+            sort={{ field: 'sort', order: 'ASC' }}
         >
             <AutocompleteInput
                 label="table.field.loc.areaId"
                 optionText="name"
                 filterToQuery={(val) => ({ name: val })}
+                sx={{ minWidth: 260 }}
+
             />
         </ReferenceInput>,
         <AutocompleteInput
@@ -157,7 +159,11 @@
     ]
 
     return (
-        <Box display="flex">
+        <Box display="flex" sx={{
+            '& .MuiTableCell-root': {
+                whiteSpace: 'nowrap',
+            }
+        }}>
             <List
                 sx={{
                     flexGrow: 1,
@@ -195,22 +201,23 @@
                     }
                     onClick={() => { }} />}
                 filters={filters}
-                sort={{ field: "create_time", order: "desc" }}
+                sort={{ field: "'row'" }}
                 actions={(
                     <TopToolbar>
                         <FilterButton />
                         <InitButton />
                         <MyCreateButton onClick={() => { setCreateDialog(true) }} />
-                        <SelectColumnsButton preferenceKey='loc' />
+                        <ColumnsButton storeKey='loc' />
                         <MyExportButton />
                     </TopToolbar>
                 )}
                 perPage={DEFAULT_PAGE_SIZE}
                 aside={<LocListAside />}
             >
-                <StyledDatagrid
-                    preferenceKey='loc'
+                <StickyDataTable
+                    storeKey='loc'
                     align="left"
+                    stickyRight={['opt']}
                     bulkActionButtons={
                         <>
                             <BatchWateButton />
@@ -223,45 +230,29 @@
                         </>
                     }
                     rowClick={() => false}
-                    omit={['id', 'createTime', 'createBy', 'memo', 'updateTime', 'updateBy']}
+                    hiddenColumns={['id', 'createTime', 'createBy', 'memo', 'updateTime', 'updateBy', 'length', 'width', 'height', 'statusBool', 'updateBy$', 'createBy$']}
                 >
                     <NumberField source="id" />
+                    <TextField source="code" label="table.field.loc.code" />
                     <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="typeIds$" label="table.field.loc.type" cellClassName="type" />
-                    {/* <TextField source="name" label="table.field.loc.name" /> */}
-                    {/* <NumberField source="flagLogic" label="table.field.loc.flagLogic" />
-                    <TextField source="fucAtrrs" label="table.field.loc.fucAtrrs" />
-                    */}
-                    {/* <TextField source="unit" label="table.field.loc.unit" /> */}
-                    <TextField source="barcode" label="table.field.loc.barcode" />
-                    <TextField source="length" label="table.field.loc.length" />
-                    <TextField source="width" label="table.field.loc.width" />
-                    <TextField source="height" label="table.field.loc.height" />
+
                     <NumberField source="row" label="table.field.loc.row" />
                     <NumberField source="col" label="table.field.loc.col" />
                     <NumberField source="lev" label="table.field.loc.lev" />
                     <NumberField source="channel" label="table.field.loc.channel" />
-                    {/* <NumberField source="channel" label="table.field.loc.channel" />
-                    <NumberField source="maxParts" label="table.field.loc.maxParts" />
-                    <NumberField source="maxPack" label="table.field.loc.maxPack" />
-                    <NumberField source="flagLabelMange" label="table.field.loc.flagLabelMange" />
-                    <TextField source="locAttrs" label="table.field.loc.locAttrs" /> */}
+
                     <TextField source="useStatus$" label="table.field.loc.useStatus" />
-                    <TextField source="updateBy$" label="common.field.updateBy" />
-                    <DateField source="updateTime" label="common.field.updateTime" showTime align="left" />
-                    <TextField source="createBy$" label="common.field.createBy" />
-                    <DateField source="createTime" label="common.field.createTime" showTime align="left" />
+                    <TextField source="barcode" label="table.field.loc.barcode" />
+
                     <BooleanField source="statusBool" label="common.field.status" sortable={false} align="left" />
-                    <TextField source="memo" label="common.field.memo" sortable={false} />
-                    <WrapperField cellClassName="opt" label="common.field.opt">
+                    <WrapperField source="opt" cellClassName="opt" label="common.field.opt">
                         <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} />
-                        {/* <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> */}
                         <EnableButton />
                     </WrapperField>
 
-                </StyledDatagrid>
+                </StickyDataTable>
                 <InitModal
                     open={initDialog}
                     setOpen={setInitDialog}
@@ -450,4 +441,4 @@
         </>
 
     )
-}
\ No newline at end of file
+}

--
Gitblit v1.9.1