| | |
| | | memo: 'memo', |
| | | opt: 'operate', |
| | | }, |
| | | list: { |
| | | empty: { |
| | | tip: 'No data to display', |
| | | } |
| | | }, |
| | | edit: { |
| | | title: { |
| | | main: 'Main', |
| | |
| | | memo: '备注', |
| | | opt: '操作', |
| | | }, |
| | | list: { |
| | | empty: { |
| | | tip: '没有可显示数据', |
| | | } |
| | | }, |
| | | edit: { |
| | | title: { |
| | | main: '主要', |
| | |
| | | ) |
| | | } |
| | | |
| | | const DetailTitle = ({ title }) => { |
| | | const DetailTitle = ({ title, ...rest }) => { |
| | | const translate = useTranslate(); |
| | | return ( |
| | | <Typography |
| | | color="textSecondary" |
| | | variant="caption" |
| | | {...rest} |
| | | > |
| | | {translate(title)} |
| | | </Typography> |
| | | ) |
| | | } |
| | | |
| | | const DetailValue = ({ value }) => { |
| | | const DetailValue = ({ value, fontBold = false }) => { |
| | | return ( |
| | | <Typography |
| | | variant="body2" |
| | | color={fontBold ? 'textSecondary' : 'textPrimary'} |
| | | width='80%' |
| | | sx={{ |
| | | wordWrap: 'break-word', |
| | | whiteSpace: 'normal', |
| | | fontWeight: fontBold && 'bold', |
| | | }} |
| | | > |
| | | {value} |
| | |
| | | <Grid container spacing={1} sx={{ maxWidth: GRID_CONTAINER_MAX_WIDTH }}> |
| | | <Grid item xs={ITEM_COL}> |
| | | <DetailTitle title='common.field.status' /> |
| | | <DetailValue value={record.agvDetail.statusDesc} /> |
| | | <DetailValue fontBold value={record.agvDetail.statusDesc} /> |
| | | </Grid> |
| | | <Grid item xs={ITEM_COL}> |
| | | <DetailTitle title='table.field.agvDetail.pos' /> |
| | |
| | | <Grid container spacing={1} sx={{ maxWidth: GRID_CONTAINER_MAX_WIDTH }}> |
| | | <Grid item xs={ITEM_COL}> |
| | | <DetailTitle title='table.field.agvModel.name' /> |
| | | <DetailValue value={record.agvModelData.name} /> |
| | | <DetailValue fontBold value={record.agvModelData.name} /> |
| | | </Grid> |
| | | <Grid item xs={ITEM_COL}> |
| | | <DetailTitle title='table.field.agvModel.length' /> |
| | |
| | | import request from '@/utils/request'; |
| | | import { useTheme } from '@mui/material/styles'; |
| | | import { getTaskStsColor } from '@/utils/common'; |
| | | import ListEmptyTip from "../../components/ListEmptyTip"; |
| | | |
| | | const TaskItem = ({ record, now }) => { |
| | | const translate = useTranslate(); |
| | | const theme = useTheme(); |
| | | console.log(record); |
| | | |
| | | return ( |
| | | <> |
| | |
| | | |
| | | ) |
| | | })} |
| | | |
| | | {currCount < total && ( |
| | | <Button |
| | | onClick={() => |
| | |
| | | </List> |
| | | </Box> |
| | | ) : ( |
| | | <Typography> |
| | | no data found |
| | | </Typography> |
| | | <ListEmptyTip /> |
| | | )} |
| | | |
| | | </> |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { |
| | | useTranslate, |
| | | } from 'react-admin'; |
| | | import { |
| | | Box, |
| | | Button, |
| | | Card, |
| | | CardContent, |
| | | Stack, |
| | | Typography, |
| | | } from '@mui/material'; |
| | | |
| | | const ListEmptyTip = (props) => { |
| | | const { tip, ...rest } = props; |
| | | const translate = useTranslate(); |
| | | |
| | | return ( |
| | | <> |
| | | <Box mt={3} ml={2}> |
| | | <Typography |
| | | variant="subtitle1" |
| | | color="textPrimary" |
| | | > |
| | | {tip || translate('common.list.empty.tip')} |
| | | </Typography> |
| | | </Box> |
| | | </> |
| | | ) |
| | | } |
| | | |
| | | export default ListEmptyTip; |