|  |  |  | 
|---|
|  |  |  | '& .RaDatagrid-row': { | 
|---|
|  |  |  | cursor: 'auto' | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | '& .RaList-content': { | 
|---|
|  |  |  | '& .RaList-content': { | 
|---|
|  |  |  | width: '200px' | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | '& .RaList-main': { | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const filters = [ | 
|---|
|  |  |  | <SearchInput source="condition" alwaysOn />, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <TextInput source="name" label="table.field.matnr.name" alwaysOn />, | 
|---|
|  |  |  | <TextInput source="code" label="table.field.matnr.code" alwaysOn />, | 
|---|
|  |  |  | <ReferenceInput source="shipperId$" label="table.field.matnr.shipperId" reference="shipper"> | 
|---|
|  |  |  | 
|---|
|  |  |  | <NumberInput source="valid" label="table.field.matnr.valid" />, | 
|---|
|  |  |  | <NumberInput source="validWarn" label="table.field.matnr.validWarn" />, | 
|---|
|  |  |  | <NumberInput source="flagCheck" label="table.field.matnr.flagCheck" />, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <TextInput label="common.field.memo" source="memo" />, | 
|---|
|  |  |  | <SelectInput | 
|---|
|  |  |  | label="common.field.status" | 
|---|
|  |  |  | 
|---|
|  |  |  | const translate = useTranslate(); | 
|---|
|  |  |  | const notify = useNotify(); | 
|---|
|  |  |  | const { isLoading } = useListContext(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const [columns, setColumns] = useState([]); | 
|---|
|  |  |  | const refresh = useRefresh(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | useEffect(() => { | 
|---|
|  |  |  | getDynamicFields(); | 
|---|
|  |  |  | }, []); | 
|---|
|  |  |  | 
|---|
|  |  |  | if (code === 200) { | 
|---|
|  |  |  | const arr = [ | 
|---|
|  |  |  | <NumberField key="id" source="id" />, | 
|---|
|  |  |  | <TooltipField key="name" source="name" label="table.field.matnr.name" cellClassName="name" />, | 
|---|
|  |  |  | <TextField key="code" source="code" label="table.field.matnr.code" />, | 
|---|
|  |  |  | <TooltipField key="name" source="name" label="table.field.matnr.name" cellClassName="name" />, | 
|---|
|  |  |  | <TextField key="shipperId$" source="shipperId$" label="table.field.matnr.shipperId" />, | 
|---|
|  |  |  | <ReferenceField key="groupId" source="groupId" label="table.field.matnr.groupId" reference="matnrGroup" link={false} sortable={false}> | 
|---|
|  |  |  | <TextField source="name" /> | 
|---|
|  |  |  | 
|---|
|  |  |  | <PrintButton /> | 
|---|
|  |  |  | </WrapperField> | 
|---|
|  |  |  | setColumns([...arr, ...fields, opt]); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //filters添加过滤字段 | 
|---|
|  |  |  | data.map(el => { | 
|---|
|  |  |  | var i =0; | 
|---|
|  |  |  | filters.map((item) =>{ | 
|---|
|  |  |  | if(item.key === el.fields){ | 
|---|
|  |  |  | i = 1; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | i===0 && filters.push(<TextInput key={el.fields} source={el.fields} label={el.fieldsAlise} />) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | notify(msg); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | <BulkDeleteButton mutationMode={OPERATE_MODE} /> | 
|---|
|  |  |  | </>} | 
|---|
|  |  |  | rowClick={(id, resource, record) => false} | 
|---|
|  |  |  | omit={['id', 'shipperId', 'platCode', 'spec', 'model', 'weight', 'color', 'describle' | 
|---|
|  |  |  | , 'nromNum', 'unit', 'purchaseUnit', 'stockUnit', 'stockLeval', 'isLabelMange', 'safeQty' | 
|---|
|  |  |  | omit={['id', 'shipperId', 'platCode', 'model', 'weight', 'color', 'describle' | 
|---|
|  |  |  | , 'nromNum', 'unit', 'purchaseUnit', 'stockUnit', 'isLabelMange', 'safeQty' | 
|---|
|  |  |  | , 'minQty', 'maxQty', 'stagn', 'valid', 'validWarn', 'flagCheck', 'updateTime', 'updateBy' | 
|---|
|  |  |  | , 'createTime', 'createBy', 'memo', 'rglarId', 'groupId', 'stockLevel']} | 
|---|
|  |  |  | , 'createTime', 'createBy', 'memo', 'rglarId', 'groupId','statusBool', 'stockLeval$']} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | {columns.map((column) => column)} | 
|---|
|  |  |  | </StyledDatagrid>} | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const MatnrList = () => { | 
|---|
|  |  |  | const translate = useTranslate(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const [createDialog, setCreateDialog] = useState(false); | 
|---|
|  |  |  | const [drawerVal, setDrawerVal] = useState(false); | 
|---|
|  |  |  | const notify = useNotify(); | 
|---|
|  |  |  | 
|---|
|  |  |  | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | title={"menu.matnr"} | 
|---|
|  |  |  | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} | 
|---|
|  |  |  | empty={false} | 
|---|
|  |  |  | filters={filters} | 
|---|
|  |  |  | sort={{ field: "create_time", order: "desc" }} | 
|---|
|  |  |  | actions={( | 
|---|
|  |  |  | 
|---|
|  |  |  | const record = useRecordContext(); | 
|---|
|  |  |  | const notify = useNotify(); | 
|---|
|  |  |  | const refresh = useRefresh(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const [createDialog, setCreateDialog] = useState(false); | 
|---|
|  |  |  |  | 
|---|