| import React, { useState, useRef, useEffect, useMemo } from "react"; | 
| import { Box } from '@mui/material'; | 
| import { | 
|     List, | 
|     DatagridConfigurable, | 
|     useRecordContext, | 
|     useTranslate, | 
|     TextField, | 
|     NumberField, | 
|     DateField, | 
|     BooleanField, | 
|     ReferenceField, | 
| } from 'react-admin'; | 
| import { styled } from '@mui/material/styles'; | 
| import PageDrawer from "../components/PageDrawer"; | 
| import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; | 
| import * as Common from '@/utils/common'; | 
|   | 
| const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ | 
|     '& .css-1vooibu-MuiSvgIcon-root': { | 
|         height: '.9em' | 
|     }, | 
|     '& .RaDatagrid-row': { | 
|         cursor: 'auto' | 
|     }, | 
|     '& .column-name': { | 
|     }, | 
|     '& .opt': { | 
|         width: 200 | 
|     }, | 
| })); | 
|   | 
| const TaskPanel = () => { | 
|     const record = useRecordContext(); | 
|     const translate = useTranslate(); | 
|     const [createDialog, setCreateDialog] = useState(false); | 
|     const [drawerVal, setDrawerVal] = useState(false); | 
|     return ( | 
|         <> | 
|             <Box display="flex"> | 
|                 <List resource="taskItem" | 
|                     sx={{ | 
|                         flexGrow: 1, | 
|                         transition: (theme) => | 
|                             theme.transitions.create(['all'], { | 
|                                 duration: theme.transitions.duration.enteringScreen, | 
|                             }), | 
|                         marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, | 
|                     }} | 
|                     filter={{ taskId: record.id }} | 
|                     // title={"menu.taskItem"} | 
|                     pagination={false} | 
|                     empty={false} | 
|                     actions={false} | 
|                 > | 
|                     <StyledDatagrid | 
|                         preferenceKey='taskItem' | 
|                         bulkActionButtons={false} | 
|                         rowClick={false} | 
|                         expandSingle | 
|                         omit={['id', 'createTime', 'createBy$', 'memo', 'taskId', 'orderId', 'orderItemId', 'matnrId']} | 
|                     > | 
|                         <NumberField source="id" /> | 
|                         <NumberField source="taskId" label="table.field.taskItem.taskId" /> | 
|                         <NumberField source="orderId" label="table.field.taskItem.orderId" /> | 
|                         <NumberField source="orderType$" label="table.field.taskItem.orderType" /> | 
|                         <TextField source="sourceCode" label="table.field.taskItem.sourceCode" /> | 
|                         <NumberField source="orderItemId" label="table.field.taskItem.orderItemId" /> | 
|                         <NumberField source="matnrId" label="table.field.taskItem.matnrId" /> | 
|                         <TextField source="maktx" label="table.field.taskItem.maktx" /> | 
|                         <TextField source="matnrCode" label="table.field.taskItem.matnrCode" /> | 
|                         <TextField source="unit" label="table.field.taskItem.unit" /> | 
|                         <NumberField source="anfme" label="table.field.taskItem.anfme" /> | 
|                         <TextField source="batch" label="table.field.taskItem.batch" /> | 
|                         <TextField source="spec" label="table.field.taskItem.spec" /> | 
|                         <TextField source="model" label="table.field.taskItem.model" /> | 
|                         <TextField source="updateBy$" label="common.field.updateBy"/> | 
|                         <TextField source="createBy$" label="common.field.createBy"/> | 
|                         <DateField source="updateTime" label="common.field.updateTime" showTime /> | 
|                         <DateField source="createTime" label="common.field.createTime" showTime /> | 
|                         <TextField source="memo" label="common.field.memo" sortable={false} /> | 
|                     </StyledDatagrid> | 
|                 </List> | 
|             </Box> | 
|         </> | 
|     ); | 
| }; | 
|   | 
| export default TaskPanel; |