|  |  |  | 
|---|
|  |  |  | import { Box, Typography, Card, Stack } from '@mui/material'; | 
|---|
|  |  |  | import { styled } from '@mui/material/styles'; | 
|---|
|  |  |  | import DictTypeCreate from "./DictTypeCreate"; | 
|---|
|  |  |  | import DictTypePanel from "./DictTypePanel"; | 
|---|
|  |  |  | import EmptyData from "../../../components/EmptyData"; | 
|---|
|  |  |  | import MyCreateButton from "../../../components/MyCreateButton"; | 
|---|
|  |  |  | import MyExportButton from '../../../components/MyExportButton'; | 
|---|
|  |  |  | import PageDrawer from "../../../components/PageDrawer"; | 
|---|
|  |  |  | import MyField from "../../../components/MyField"; | 
|---|
|  |  |  | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; | 
|---|
|  |  |  | import * as Common from '@/utils/common'; | 
|---|
|  |  |  | import { width } from "@mui/system"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ | 
|---|
|  |  |  | '& .css-1vooibu-MuiSvgIcon-root': { | 
|---|
|  |  |  | 
|---|
|  |  |  | '& .opt': { | 
|---|
|  |  |  | width: 200 | 
|---|
|  |  |  | }, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | '& .MuiTableCell-root': { | 
|---|
|  |  |  | whiteSpace: 'nowrap', | 
|---|
|  |  |  | overflow: 'visible', | 
|---|
|  |  |  | textOverflow: 'unset' | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | '& .column-description': { | 
|---|
|  |  |  | maxWidth: '25em', | 
|---|
|  |  |  | overflow: 'hidden', | 
|---|
|  |  |  | textOverflow: 'ellipsis', | 
|---|
|  |  |  | whiteSpace: 'nowrap', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | })); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const filters = [ | 
|---|
|  |  |  | <SearchInput source="condition" alwaysOn />, | 
|---|
|  |  |  | <DateInput label='common.time.after' source="timeStart" alwaysOn />, | 
|---|
|  |  |  | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <TextInput source="code" label="table.field.dictType.code" />, | 
|---|
|  |  |  | <TextInput source="name" label="table.field.dictType.name" />, | 
|---|
|  |  |  | <TextInput source="description" label="table.field.dictType.description" />, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <TextInput label="common.field.memo" source="memo" />, | 
|---|
|  |  |  | <SelectInput | 
|---|
|  |  |  | label="common.field.status" | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const DictTypeList = () => { | 
|---|
|  |  |  | const translate = useTranslate(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const [createDialog, setCreateDialog] = useState(false); | 
|---|
|  |  |  | const [drawerVal, setDrawerVal] = useState(false); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const navigate = useNavigate(); | 
|---|
|  |  |  | const assign = (record) => { | 
|---|
|  |  |  | navigate(`/dictData?dictTypeId=${record.id}&code=${record.code}`); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | <Box display="flex"> | 
|---|
|  |  |  | <List | 
|---|
|  |  |  | 
|---|
|  |  |  | <StyledDatagrid | 
|---|
|  |  |  | preferenceKey='dictType' | 
|---|
|  |  |  | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} | 
|---|
|  |  |  | rowClick={(id, resource, record) => false} | 
|---|
|  |  |  | omit={['id', 'createTime', 'createBy', 'memo']} | 
|---|
|  |  |  | rowClick={'edit'} | 
|---|
|  |  |  | omit={['id', 'createTime', 'createBy$', 'memo','statusBool']} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <NumberField source="id" /> | 
|---|
|  |  |  | <MyField source="code" label="table.field.dictType.code" | 
|---|
|  |  |  | onClick={(event, record, val) => { | 
|---|
|  |  |  | event.stopPropagation(); | 
|---|
|  |  |  | assign(record); | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | <TextField source="code" label="table.field.dictType.code" | 
|---|
|  |  |  | // onClick={(event, record, val) => { | 
|---|
|  |  |  | //     event.stopPropagation(); | 
|---|
|  |  |  | //     assign(record); | 
|---|
|  |  |  | // }} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <TextField source="name" label="table.field.dictType.name" /> | 
|---|
|  |  |  | <TextField source="description" label="table.field.dictType.description" /> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> | 
|---|
|  |  |  | <TextField source="nickname" /> | 
|---|
|  |  |  | </ReferenceField> | 
|---|
|  |  |  | <TextField source="updateBy$" label="common.field.updateBy" /> | 
|---|
|  |  |  | <DateField source="updateTime" label="common.field.updateTime" showTime /> | 
|---|
|  |  |  | <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}> | 
|---|
|  |  |  | <TextField source="nickname" /> | 
|---|
|  |  |  | </ReferenceField> | 
|---|
|  |  |  | <TextField source="createBy$" label="common.field.createBy" /> | 
|---|
|  |  |  | <DateField source="createTime" label="common.field.createTime" showTime /> | 
|---|
|  |  |  | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> | 
|---|
|  |  |  | <TextField source="memo" label="common.field.memo" sortable={false} /> | 
|---|