|  |  |  | 
|---|
|  |  |  | fields: { | 
|---|
|  |  |  | fields: "字段", | 
|---|
|  |  |  | fieldsAlise: "字段别名", | 
|---|
|  |  |  | unique: "索引字段", | 
|---|
|  |  |  | unique: "是否必填", | 
|---|
|  |  |  | flagEnable: "启用", | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | fieldsItem: { | 
|---|
|  |  |  | 
|---|
|  |  |  | minWidth: 100, | 
|---|
|  |  |  | flex: 1, | 
|---|
|  |  |  | editable: true, | 
|---|
|  |  |  | // preProcessEditCellProps: (params) => { | 
|---|
|  |  |  | //     const hasError = params.props.value.length !== ''; | 
|---|
|  |  |  | //     return { ...params.props, error: hasError }; | 
|---|
|  |  |  | // }, | 
|---|
|  |  |  | valueFormatter: (val) => val < 0 ? 0 : val | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | field: 'splrCode', | 
|---|
|  |  |  | 
|---|
|  |  |  | disableColumnSorting | 
|---|
|  |  |  | disableMultipleColumnsSorting | 
|---|
|  |  |  | processRowUpdate={processRowUpdate} | 
|---|
|  |  |  | autoPageSize | 
|---|
|  |  |  | pageSizeOptions={[25, 50, 100]} | 
|---|
|  |  |  | paginationModel={{ pageSize: 50, page: 0 }} | 
|---|
|  |  |  | editMode="row" | 
|---|
|  |  |  | checkboxSelection | 
|---|
|  |  |  | onRowSelectionModelChange={handleSelectionChange} | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | <Box sx={{ | 
|---|
|  |  |  | position: 'relative', | 
|---|
|  |  |  | padding: '5px 10px' | 
|---|
|  |  |  | }}> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '4px', alignItems: 'center' }}> | 
|---|
|  |  |  | <TextField value={maktx} onChange={(e) => maktxChange(e.target.value)} label="搜索物料" variant="outlined" sx={{ width: '300px' }} size="small" /> | 
|---|
|  |  |  | <TextField value={maktx} onChange={(e) => maktxChange(e.target.value)} label="搜索物料" sx={{ width: '300px' }} size="small" /> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <div style={{ display: 'flex', gap: '10px' }}> | 
|---|
|  |  |  | <PrintsButton rows={selectedRows} /> | 
|---|
|  |  |  | 
|---|
|  |  |  | disableColumnMenu={true} | 
|---|
|  |  |  | disableColumnSorting | 
|---|
|  |  |  | disableMultipleColumnsSorting | 
|---|
|  |  |  | columnHeaderHeight={40} | 
|---|
|  |  |  | rowHeight={42} | 
|---|
|  |  |  | paginationModel={{ pageSize: 10, page: 1 }} | 
|---|
|  |  |  | pageSizeOptions={[10, 25, 50, 100]} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Box > | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | label="table.field.fields.fields" | 
|---|
|  |  |  | source="fields" | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | validate={required()} | 
|---|
|  |  |  | autoFocus | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Grid> | 
|---|
|  |  |  | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.fields.fieldsAlise" | 
|---|
|  |  |  | source="fieldsAlise" | 
|---|
|  |  |  | validate={required()} | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Grid> | 
|---|
|  |  |  | 
|---|
|  |  |  | label="table.field.fields.unique" | 
|---|
|  |  |  | source="unique" | 
|---|
|  |  |  | choices={[ | 
|---|
|  |  |  | { id: 0, name: ' 非唯一' }, | 
|---|
|  |  |  | { id:   1, name: '  唯一' }, | 
|---|
|  |  |  | { id: 0, name: ' 非必填' }, | 
|---|
|  |  |  | { id: 1, name: '  必填' }, | 
|---|
|  |  |  | ]} | 
|---|
|  |  |  | validate={required()} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Grid> | 
|---|
|  |  |  | <Grid item xs={6} display="flex" gap={1}> | 
|---|
|  |  |  | 
|---|
|  |  |  | source="flagEnable" | 
|---|
|  |  |  | choices={[ | 
|---|
|  |  |  | { id: 0, name: ' 不启用' }, | 
|---|
|  |  |  | { id:  1, name: ' 启用' }, | 
|---|
|  |  |  | { id: 1, name: ' 启用' }, | 
|---|
|  |  |  | ]} | 
|---|
|  |  |  | validate={required()} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Grid> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | source="fields" | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | autoFocus | 
|---|
|  |  |  | validate={required()} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | 
|---|
|  |  |  | label="table.field.fields.fieldsAlise" | 
|---|
|  |  |  | source="fieldsAlise" | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | validate={required()} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | 
|---|
|  |  |  | label="table.field.fields.unique" | 
|---|
|  |  |  | source="unique" | 
|---|
|  |  |  | choices={[ | 
|---|
|  |  |  | { id: 0, name: ' 非唯一' }, | 
|---|
|  |  |  | { id:   1, name: '  唯一' }, | 
|---|
|  |  |  | { id: 0, name: ' 非必填' }, | 
|---|
|  |  |  | { id: 1, name: '  必填' }, | 
|---|
|  |  |  | ]} | 
|---|
|  |  |  | validate={required()} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | 
|---|
|  |  |  | source="flagEnable" | 
|---|
|  |  |  | choices={[ | 
|---|
|  |  |  | { id: 0, name: ' 不启用' }, | 
|---|
|  |  |  | { id:  1, name: ' 启用' }, | 
|---|
|  |  |  | { id: 1, name: ' 启用' }, | 
|---|
|  |  |  | ]} | 
|---|
|  |  |  | validate={required()} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const filters = [ | 
|---|
|  |  |  | <SearchInput source="condition" alwaysOn />, | 
|---|
|  |  |  | <DateInput label='common.time.after' source="timeStart" alwaysOn />, | 
|---|
|  |  |  | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <TextInput source="fields" label="table.field.fields.fields" />, | 
|---|
|  |  |  | <TextInput source="fieldsAlise" label="table.field.fields.fieldsAlise" />, | 
|---|
|  |  |  | <SelectInput source="unique" label="table.field.fields.unique" | 
|---|
|  |  |  | choices={[ | 
|---|
|  |  |  | { id: 0, name: ' 非唯一' }, | 
|---|
|  |  |  | { id: 1, name: '  唯一' }, | 
|---|
|  |  |  | { id: 0, name: ' 非必填' }, | 
|---|
|  |  |  | { id: 1, name: '  必填' }, | 
|---|
|  |  |  | ]} | 
|---|
|  |  |  | />, | 
|---|
|  |  |  | <SelectInput source="flagEnable" label="table.field.fields.flagEnable" | 
|---|