From 3ba41a836d73a2c6c478f5fbf4fb5d150c5d498d Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期六, 21 九月 2024 11:41:52 +0800
Subject: [PATCH] #
---
zy-acs-flow/src/page/loc/LocList.jsx | 20 +++++++++++++++++---
1 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/zy-acs-flow/src/page/loc/LocList.jsx b/zy-acs-flow/src/page/loc/LocList.jsx
index 92a319e..ee5d890 100644
--- a/zy-acs-flow/src/page/loc/LocList.jsx
+++ b/zy-acs-flow/src/page/loc/LocList.jsx
@@ -30,6 +30,7 @@
ReferenceArrayInput,
AutocompleteInput,
DeleteButton,
+ Button,
} from 'react-admin';
import { Box, Typography, Card, Stack } from '@mui/material';
import { styled } from '@mui/material/styles';
@@ -42,6 +43,9 @@
import MyField from "../components/MyField";
import { PAGE_DRAWER_WIDTH, OPERATE_MODE } from '@/config/setting';
import * as Common from '@/utils/common';
+import CorporateFareIcon from '@mui/icons-material/CorporateFare';
+import LocInit from "./LocInit";
+import rowSx from "./rowSx";
const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
'& .css-1vooibu-MuiSvgIcon-root': {
@@ -50,7 +54,8 @@
'& .RaDatagrid-row': {
cursor: 'auto'
},
- '& .column-name': {
+ '& .column-locNo': {
+ minWidth: 180
},
'& .opt': {
width: 200
@@ -100,6 +105,7 @@
const [createDialog, setCreateDialog] = useState(false);
const [drawerVal, setDrawerVal] = useState(false);
+ const [initDialog, setInitDialog] = useState(false);
return (
<Box display="flex">
@@ -119,6 +125,9 @@
actions={(
<TopToolbar>
<FilterButton />
+ <Button label='page.loc.init' onClick={(event) => {
+ setInitDialog(true);
+ }}><CorporateFareIcon /></Button>
<MyCreateButton onClick={() => { setCreateDialog(true) }} />
<SelectColumnsButton preferenceKey='loc' />
<MyExportButton />
@@ -133,6 +142,7 @@
expand={() => <LocPanel />}
expandSingle={true}
omit={['id', 'locType', 'uuid', 'statusBool', 'updateBy', 'createTime', 'createBy', 'memo']}
+ rowSx={rowSx(drawerVal || null)}
>
<NumberField source="id" />
<TextField source="locNo" label="table.field.loc.locNo" />
@@ -146,7 +156,7 @@
<TextField source="data" />
</ReferenceField>
{/* <TextField source="compDirect$" label="table.field.loc.compDirect" sortable={false} /> */}
- <ReferenceField source="locSts" label="table.field.loc.locSts" reference="locSts" link={false} sortable={false}>
+ <ReferenceField source="locSts" label="table.field.loc.locSts" reference="locSts" link={false} sortable={true}>
<TextField source="name" />
</ReferenceField>
<NumberField source="row" label="table.field.loc.row" />
@@ -171,7 +181,7 @@
<TextField source="memo" label="common.field.memo" sortable={false} />
<WrapperField cellClassName="opt" label="common.field.opt">
<EditButton sx={{ padding: '1px', fontSize: '.75rem' }} />
- <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} />
+ <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={'optimistic'} />
</WrapperField>
</StyledDatagrid>
</List>
@@ -185,6 +195,10 @@
setDrawerVal={setDrawerVal}
>
</PageDrawer>
+ <LocInit
+ open={initDialog}
+ setOpen={setInitDialog}
+ />
</Box>
)
}
--
Gitblit v1.9.1