From 3fa7cdec6ce44f07a0dc7e1910511ead606990f3 Mon Sep 17 00:00:00 2001 From: zhang <zc857179121@qq.com> Date: 星期四, 11 九月 2025 08:19:53 +0800 Subject: [PATCH] 1 --- zy-acs-flow/src/page/route/RouteList.jsx | 25 ++++++++++++++++++++----- 1 files changed, 20 insertions(+), 5 deletions(-) diff --git a/zy-acs-flow/src/page/route/RouteList.jsx b/zy-acs-flow/src/page/route/RouteList.jsx index 78159aa..6175fa1 100644 --- a/zy-acs-flow/src/page/route/RouteList.jsx +++ b/zy-acs-flow/src/page/route/RouteList.jsx @@ -30,6 +30,7 @@ ReferenceArrayInput, AutocompleteInput, DeleteButton, + FunctionField, } from 'react-admin'; import { Box, Typography, Card, Stack } from '@mui/material'; import { styled } from '@mui/material/styles'; @@ -79,9 +80,9 @@ <TextInput source="codeDataArr" label="table.field.route.codeDataArr" />, <SelectInput source="direction" label="table.field.route.direction" choices={[ - { id: 0, name: '鏃犲簭' }, - { id: 1, name: '姝e悜' }, - { 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 />, @@ -148,8 +149,22 @@ </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> -- Gitblit v1.9.1