From d46b579b4bee0b7d4e7548e3637943618620eb96 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期一, 07 十月 2024 08:04:30 +0800 Subject: [PATCH] # --- zy-acs-flow/src/i18n/en.js | 9 +++++++++ zy-acs-flow/src/page/mission/MissionCard.jsx | 9 +++++---- zy-acs-flow/src/i18n/zh.js | 9 +++++++++ zy-acs-flow/src/page/action/Action.jsx | 8 ++++---- zy-acs-flow/src/page/mission/MissionShow.jsx | 13 ++++++------- 5 files changed, 33 insertions(+), 15 deletions(-) diff --git a/zy-acs-flow/src/i18n/en.js b/zy-acs-flow/src/i18n/en.js index e9c4ead..b2ea42f 100644 --- a/zy-acs-flow/src/i18n/en.js +++ b/zy-acs-flow/src/i18n/en.js @@ -526,6 +526,15 @@ errTime: "err time", errDesc: "error", }, + mission: { + backpack: 'Backpack', + code: 'Code', + task: 'Task', + lastSendDate: 'Last sending date', + actionCount: 'Action Count', + runPath: 'Run Path', + actions: 'Actions', + }, } }, page: { diff --git a/zy-acs-flow/src/i18n/zh.js b/zy-acs-flow/src/i18n/zh.js index 6329b2f..fea86a9 100644 --- a/zy-acs-flow/src/i18n/zh.js +++ b/zy-acs-flow/src/i18n/zh.js @@ -525,6 +525,15 @@ errTime: "寮傚父鏃堕棿", errDesc: "寮傚父", }, + mission: { + backpack: '鑳岀瘬', + code: '鍦伴潰鐮�', + task: '浠诲姟', + lastSendDate: '鏈�杩戜笅鍙戞椂闂�', + actionCount: '鍔ㄤ綔鏁伴噺', + runPath: '璧拌璺緞', + actions: '鍔ㄤ綔鍒楄〃', + }, } }, page: { diff --git a/zy-acs-flow/src/page/action/Action.jsx b/zy-acs-flow/src/page/action/Action.jsx index 632b3fb..40d30ae 100644 --- a/zy-acs-flow/src/page/action/Action.jsx +++ b/zy-acs-flow/src/page/action/Action.jsx @@ -74,28 +74,28 @@ variant="body2" color="textSecondary" > - task: {data.taskId$ || '-'} + {translate('table.field.action.taskId')}: {data.taskId$ || '-'} </Typography> <Divider orientation="vertical" flexItem sx={{ marginX: 1 }} /> <Typography variant="body2" color="textSecondary" > - code: {data.code || '-'} + {translate('table.field.action.code')}: {data.code || '-'} </Typography> <Divider orientation="vertical" flexItem sx={{ marginX: 1 }} /> <Typography variant="body2" color="textSecondary" > - val: {data.val || '-'} + {translate('table.field.action.val')}: {data.val || '-'} </Typography> <Divider orientation="vertical" flexItem sx={{ marginX: 1 }} /> <Typography variant="body2" color="textSecondary" > - param: {data.param || '-'} + {translate('table.field.action.params')}: {data.param || '-'} </Typography> </Stack> </Box> diff --git a/zy-acs-flow/src/page/mission/MissionCard.jsx b/zy-acs-flow/src/page/mission/MissionCard.jsx index 720eaca..2a7bdae 100644 --- a/zy-acs-flow/src/page/mission/MissionCard.jsx +++ b/zy-acs-flow/src/page/mission/MissionCard.jsx @@ -1,6 +1,6 @@ import { Draggable } from '@hello-pangea/dnd'; import { Box, Card, Typography, Avatar, Divider, Stack, Slider, useTheme } from '@mui/material'; -import { ReferenceField, useRedirect } from 'react-admin'; +import { ReferenceField, useRedirect, useTranslate } from 'react-admin'; import { blueGrey } from '@mui/material/colors'; import { styled } from '@mui/material/styles'; @@ -22,6 +22,7 @@ export const MissionCardContent = ({ provided, snapshot, mission, }) => { const theme = useTheme(); + const translate = useTranslate(); const redirect = useRedirect(); const handleClick = () => { redirect(`/mission/${mission.id}/show`, undefined, undefined, undefined, { @@ -64,16 +65,16 @@ <Box> <Stack direction="row" justifyContent="space-between" mb={1}> <Typography variant="caption" color="textSecondary"> - Backpack: {mission.backpack} + {translate('table.field.mission.backpack')} : {mission.backpack} </Typography> <Typography variant="caption" color="textPrimary"> - Code: {mission.currCode} + {translate('table.field.mission.code')}: {mission.currCode} </Typography> </Stack> <Divider orientation="horizontal" flexItem /> <Stack direction="row" justifyContent="space-between" > <Typography variant="overline"> - Task: [{mission.taskNos.join(',')}] + {translate('table.field.mission.task')}: [{mission.taskNos.join(',')}] </Typography> </Stack> <Stack pl={0.5} pr={0.5} direction="row" spacing={1} alignItems="center" mb={.6}> diff --git a/zy-acs-flow/src/page/mission/MissionShow.jsx b/zy-acs-flow/src/page/mission/MissionShow.jsx index 9c97700..8a6c6af 100644 --- a/zy-acs-flow/src/page/mission/MissionShow.jsx +++ b/zy-acs-flow/src/page/mission/MissionShow.jsx @@ -66,7 +66,6 @@ const record = useRecordContext(); const translate = useTranslate(); if (!record) return null; - console.log(record); return ( <> @@ -111,7 +110,7 @@ color="textSecondary" variant="caption" > - Last sending date + {translate('table.field.mission.lastSendDate')} </Typography> <Stack direction="row" @@ -129,7 +128,7 @@ color="textSecondary" variant="caption" > - Bus No + {translate('table.field.bus.busNo')} </Typography> <Typography variant="body2"> {record.busNo || '-'} @@ -153,7 +152,7 @@ color="textSecondary" variant="caption" > - Action Count + {translate('table.field.mission.actionCount')} </Typography> <Typography variant="body2"> {record.actionCount || 'unknown'} @@ -173,7 +172,7 @@ color="textSecondary" variant="caption" > - Tasks + {translate('table.field.mission.task')} </Typography> <ReferenceArrayField source="contact_ids" @@ -191,7 +190,7 @@ color="textSecondary" variant="caption" > - Run Path + {translate('table.field.mission.runPath')} </Typography> <Typography variant="body2" sx={{ whiteSpace: 'normal', overflow: 'hidden', display: 'flex', flexWrap: 'wrap' }}> [ {record.codeList.map((code, index) => ( @@ -210,7 +209,7 @@ color="textSecondary" variant="caption" > - Actions + {translate('table.field.mission.actions')} </Typography> <Divider /> <ActionsIterator actionIds={record.actionIds} /> -- Gitblit v1.9.1