|  |  |  | 
|---|
|  |  |  | ReferenceArrayInput, | 
|---|
|  |  |  | AutocompleteInput, | 
|---|
|  |  |  | DeleteButton, | 
|---|
|  |  |  | FunctionField, | 
|---|
|  |  |  | } from 'react-admin'; | 
|---|
|  |  |  | import { Box, Typography, Card, Stack } from '@mui/material'; | 
|---|
|  |  |  | import { styled } from '@mui/material/styles'; | 
|---|
|  |  |  | 
|---|
|  |  |  | import MyExportButton from '../components/MyExportButton'; | 
|---|
|  |  |  | import PageDrawer from "../components/PageDrawer"; | 
|---|
|  |  |  | import MyField from "../components/MyField"; | 
|---|
|  |  |  | import { PAGE_DRAWER_WIDTH, OPERATE_MODE } from '@/config/setting'; | 
|---|
|  |  |  | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; | 
|---|
|  |  |  | import * as Common from '@/utils/common'; | 
|---|
|  |  |  | import ImportButton from '../components/ImportButton' | 
|---|
|  |  |  | import { useRouteImport } from './useRouteImport'; | 
|---|
|  |  |  | 
|---|
|  |  |  | <TextInput source="codeDataArr" label="table.field.route.codeDataArr" />, | 
|---|
|  |  |  | <SelectInput source="direction" label="table.field.route.direction" | 
|---|
|  |  |  | choices={[ | 
|---|
|  |  |  | { id: 0, name: '无序' }, | 
|---|
|  |  |  | { id: 1, name: '正向' }, | 
|---|
|  |  |  | { id: 2, name: '反向' }, | 
|---|
|  |  |  | { id: 0, name: 'page.route.enums.direction.unordered' }, | 
|---|
|  |  |  | { id: 1, name: 'page.route.enums.direction.forward' }, | 
|---|
|  |  |  | { id: 2, name: 'page.route.enums.direction.reverse' }, | 
|---|
|  |  |  | ]} | 
|---|
|  |  |  | alwaysOn | 
|---|
|  |  |  | />, | 
|---|
|  |  |  | 
|---|
|  |  |  | <MyExportButton /> | 
|---|
|  |  |  | </TopToolbar> | 
|---|
|  |  |  | )} | 
|---|
|  |  |  | perPage={25} | 
|---|
|  |  |  | perPage={DEFAULT_PAGE_SIZE} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <StyledDatagrid | 
|---|
|  |  |  | preferenceKey='route' | 
|---|
|  |  |  | 
|---|
|  |  |  | </ReferenceField> | 
|---|
|  |  |  | <TextField source="codeArr" label="table.field.route.codeArr" /> | 
|---|
|  |  |  | <TextField source="codeDataArr" label="table.field.route.codeDataArr" /> | 
|---|
|  |  |  | <TextField source="direction$" label="table.field.route.direction" sortable={false} /> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <FunctionField | 
|---|
|  |  |  | label="table.field.route.direction" | 
|---|
|  |  |  | sortable={false} | 
|---|
|  |  |  | render={(record) => { | 
|---|
|  |  |  | switch (record.direction) { | 
|---|
|  |  |  | case 0: | 
|---|
|  |  |  | return translate('page.route.enums.direction.unordered'); | 
|---|
|  |  |  | case 1: | 
|---|
|  |  |  | return translate('page.route.enums.direction.forward'); | 
|---|
|  |  |  | case 2: | 
|---|
|  |  |  | return translate('page.route.enums.direction.reverse'); | 
|---|
|  |  |  | default: | 
|---|
|  |  |  | return ''; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> | 
|---|
|  |  |  | <TextField source="nickname" /> | 
|---|
|  |  |  | </ReferenceField> | 
|---|