#
vincentlu
1 天以前 c01d9b053852b12e7d3ced66367babb4d499b14b
zy-acs-flow/src/page/guarantee/GuaranteePanel.jsx
@@ -6,11 +6,23 @@
} from 'react-admin';
import PanelTypography from "../components/PanelTypography";
import * as Common from '@/utils/common'
import { describeCronExpression } from "./cronUtils";
import { DEFAULT_SCOPE_TYPE, getScopeLabel } from "./guaranteeConstants";
const GuaranteePanel = () => {
    const record = useRecordContext();
    if (!record) return null;
    const translate = useTranslate();
    const scopeTypeLabel = getScopeLabel(record.scopeType, translate);
    const scopeValueLabel = record.scopeValue
        ? record.scopeValue
        : record.scopeType === DEFAULT_SCOPE_TYPE
            ? translate('page.guarantee.scope.globalHelper')
            : translate('common.enums.na');
    const cronDesc = record.cronExpr
        ? `${describeCronExpression(record.cronExpr, translate)} (${record.cronExpr})`
        : translate('common.enums.na');
    return (
        <>
            <Card sx={{ width: { xs: 300, sm: 500, md: 600, lg: 800 }, margin: 'auto' }}>
@@ -55,19 +67,19 @@
                        <Grid item xs={6}>
                            <PanelTypography
                                title="table.field.guarantee.scopeType" 
                                property={record.scopeType}
                                property={scopeTypeLabel}
                            />
                        </Grid>
                        <Grid item xs={6}>
                            <PanelTypography
                                title="table.field.guarantee.scopeValue" 
                                property={record.scopeValue}
                                property={scopeValueLabel}
                            />
                        </Grid>
                        <Grid item xs={6}>
                            <PanelTypography
                                title="table.field.guarantee.cronExpr" 
                                property={record.cronExpr}
                                property={cronDesc}
                            />
                        </Grid>
                        <Grid item xs={6}>