From 41a42d3a426869671fcba080c173bff7f5d49d03 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 26 九月 2024 16:25:09 +0800
Subject: [PATCH] #

---
 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