#
luxiaotao1123
2024-09-18 d1e6d90c16c4b507d34ceddbe383ea32f4d95a17
#
4个文件已修改
6个文件已添加
1206 ■■■■■ 已修改文件
zy-acs-flow/src/i18n/en.js 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/i18n/zh.js 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/page/ResourceContent.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/page/task/TaskCreate.jsx 310 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/page/task/TaskEdit.jsx 292 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/page/task/TaskList.jsx 232 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/page/task/TaskPanel.jsx 183 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/page/task/index.jsx 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/java/com/zy/acs/manager/common/CodeBuilder.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/TaskController.java 111 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/i18n/en.js
@@ -113,7 +113,7 @@
        taskType: 'Task Type',
        vehFaultRec: 'Agv Fault',
        bus: 'Bus',
        task: 'Task',
    },
    table: {
        field: {
@@ -402,7 +402,30 @@
                busSts: "bus status",
                phase: "phase",
            },
            task: {
                uuid: "uuid",
                busId: "bus",
                seqNum: "seq num",
                priority: "priority",
                name: "name",
                taskSts: "task status",
                taskType: "task type",
                agvId: "agv",
                ioTime: "io time",
                startTime: "start time",
                endTime: "end time",
                errTime: "err time",
                oriSta: "origin station",
                oriLoc: "origin location",
                oriCode: "origin code",
                destSta: "destination station",
                destLoc: "destination location",
                destCode: "destination code",
                emptyMk: "empty mk",
                zpallet: "zpallet",
                phase: "phase",
                errDesc: "error desc",
            },
        }
    }
};
zy-acs-flow/src/i18n/zh.js
@@ -113,6 +113,7 @@
        taskType: '任务类型',
        vehFaultRec: '车辆故障',
        bus: '任务总线',
        task: '任务管理',
    },
    table: {
        field: {
@@ -400,7 +401,30 @@
                busSts: "总线状态",
                phase: "进度",
            },
            task: {
                uuid: "编号",
                busId: "总线",
                seqNum: "任务编号",
                priority: "优先级",
                name: "名称",
                taskSts: "任务状态",
                taskType: "任务类型",
                agvId: "车辆",
                ioTime: "工作时间",
                startTime: "开始时间",
                endTime: "结束时间",
                errTime: "异常时间",
                oriSta: "起始站点",
                oriLoc: "起始库位",
                oriCode: "起始地面码",
                destSta: "目标站点",
                destLoc: "目标库位",
                destCode: "目标地面码",
                emptyMk: "空料箱",
                zpallet: "料箱码",
                phase: "进度",
                errDesc: "异常描述",
            },
        }
    }
};
zy-acs-flow/src/page/ResourceContent.js
@@ -35,6 +35,7 @@
import taskType from './taskType';
import vehFaultRec from './vehFaultRec';
import bus from './bus';
import task from './task';
const ResourceContent = (node) => {
@@ -101,6 +102,8 @@
            return vehFaultRec;
        case 'bus':
            return bus;
        case 'task':
            return task;
        default:
            return {
                list: ListGuesser,
zy-acs-flow/src/page/task/TaskCreate.jsx
New file
@@ -0,0 +1,310 @@
import React, { useState, useRef, useEffect, useMemo } from "react";
import {
    CreateBase,
    useTranslate,
    TextInput,
    NumberInput,
    BooleanInput,
    DateInput,
    SaveButton,
    SelectInput,
    ReferenceInput,
    ReferenceArrayInput,
    AutocompleteInput,
    Toolbar,
    required,
    useDataProvider,
    useNotify,
    Form,
    useCreateController,
} from 'react-admin';
import {
    Dialog,
    DialogActions,
    DialogContent,
    DialogTitle,
    Stack,
    Grid,
    Box,
} from '@mui/material';
import DialogCloseButton from "../components/DialogCloseButton";
import StatusSelectInput from "../components/StatusSelectInput";
import MemoInput from "../components/MemoInput";
const TaskCreate = (props) => {
    const { open, setOpen } = props;
    const translate = useTranslate();
    const notify = useNotify();
    const handleClose = (event, reason) => {
        if (reason !== "backdropClick") {
            setOpen(false);
        }
    };
    const handleSuccess = async (data) => {
        setOpen(false);
        notify('common.response.success');
    };
    const handleError = async (data) => {
        notify('common.response.fail');
    };
    return (
        <>
            <CreateBase
                record={{}}
                transform={(data) => {
                    return data;
                }}
                mutationOptions={{ onSuccess: handleSuccess, onError: handleError }}
            >
                <Dialog
                    open={open}
                    onClose={handleClose}
                    aria-labelledby="form-dialog-title"
                    fullWidth
                    disableRestoreFocus
                    maxWidth="md"   // 'xs' | 'sm' | 'md' | 'lg' | 'xl'
                >
                    <Form>
                        <DialogTitle id="form-dialog-title" sx={{
                            position: 'sticky',
                            top: 0,
                            backgroundColor: 'background.paper',
                            zIndex: 1000
                        }}
                        >
                            {translate('create.title')}
                            <Box sx={{ position: 'absolute', top: 8, right: 8, zIndex: 1001 }}>
                                <DialogCloseButton onClose={handleClose} />
                            </Box>
                        </DialogTitle>
                        <DialogContent>
                            <Grid container rowSpacing={2} columnSpacing={2}>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <TextInput
                                        label="table.field.task.uuid"
                                        source="uuid"
                                        parse={v => v}
                                        autoFocus
                                    />
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <ReferenceInput
                                        source="busId"
                                        reference="bus"
                                    >
                                        <AutocompleteInput
                                            label="table.field.task.busId"
                                            optionText="seqNum"
                                            filterToQuery={(val) => ({ seqNum: val })}
                                        />
                                    </ReferenceInput>
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <TextInput
                                        label="table.field.task.seqNum"
                                        source="seqNum"
                                        parse={v => v}
                                    />
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <NumberInput
                                        label="table.field.task.priority"
                                        source="priority"
                                    />
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <TextInput
                                        label="table.field.task.name"
                                        source="name"
                                        parse={v => v}
                                    />
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <ReferenceInput
                                        source="taskSts"
                                        reference="taskSts"
                                    >
                                        <AutocompleteInput
                                            label="table.field.task.taskSts"
                                            optionText="name"
                                            filterToQuery={(val) => ({ name: val })}
                                        />
                                    </ReferenceInput>
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <ReferenceInput
                                        source="taskType"
                                        reference="taskType"
                                    >
                                        <AutocompleteInput
                                            label="table.field.task.taskType"
                                            optionText="name"
                                            filterToQuery={(val) => ({ name: val })}
                                        />
                                    </ReferenceInput>
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <ReferenceInput
                                        source="agvId"
                                        reference="agv"
                                    >
                                        <AutocompleteInput
                                            label="table.field.task.agvId"
                                            optionText="uuid"
                                            filterToQuery={(val) => ({ uuid: val })}
                                        />
                                    </ReferenceInput>
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <DateInput
                                        label="table.field.task.ioTime"
                                        source="ioTime"
                                    />
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <DateInput
                                        label="table.field.task.startTime"
                                        source="startTime"
                                    />
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <DateInput
                                        label="table.field.task.endTime"
                                        source="endTime"
                                    />
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <DateInput
                                        label="table.field.task.errTime"
                                        source="errTime"
                                    />
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <ReferenceInput
                                        source="oriSta"
                                        reference="sta"
                                    >
                                        <AutocompleteInput
                                            label="table.field.task.oriSta"
                                            optionText="staNo"
                                            filterToQuery={(val) => ({ staNo: val })}
                                        />
                                    </ReferenceInput>
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <ReferenceInput
                                        source="oriLoc"
                                        reference="loc"
                                    >
                                        <AutocompleteInput
                                            label="table.field.task.oriLoc"
                                            optionText="locNo"
                                            filterToQuery={(val) => ({ locNo: val })}
                                        />
                                    </ReferenceInput>
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <ReferenceInput
                                        source="oriCode"
                                        reference="code"
                                    >
                                        <AutocompleteInput
                                            label="table.field.task.oriCode"
                                            optionText="data"
                                            filterToQuery={(val) => ({ data: val })}
                                        />
                                    </ReferenceInput>
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <ReferenceInput
                                        source="destSta"
                                        reference="sta"
                                    >
                                        <AutocompleteInput
                                            label="table.field.task.destSta"
                                            optionText="staNo"
                                            filterToQuery={(val) => ({ staNo: val })}
                                        />
                                    </ReferenceInput>
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <ReferenceInput
                                        source="destLoc"
                                        reference="loc"
                                    >
                                        <AutocompleteInput
                                            label="table.field.task.destLoc"
                                            optionText="locNo"
                                            filterToQuery={(val) => ({ locNo: val })}
                                        />
                                    </ReferenceInput>
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <ReferenceInput
                                        source="destCode"
                                        reference="code"
                                    >
                                        <AutocompleteInput
                                            label="table.field.task.destCode"
                                            optionText="data"
                                            filterToQuery={(val) => ({ data: val })}
                                        />
                                    </ReferenceInput>
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <TextInput
                                        label="table.field.task.emptyMk"
                                        source="emptyMk"
                                        parse={v => v}
                                    />
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <TextInput
                                        label="table.field.task.zpallet"
                                        source="zpallet"
                                        parse={v => v}
                                    />
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <TextInput
                                        label="table.field.task.phase"
                                        source="phase"
                                        parse={v => v}
                                    />
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <TextInput
                                        label="table.field.task.errDesc"
                                        source="errDesc"
                                        parse={v => v}
                                    />
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <StatusSelectInput />
                                </Grid>
                                <Grid item xs={12} display="flex" gap={1}>
                                    <Stack direction="column" spacing={1} width={'100%'}>
                                        <MemoInput />
                                    </Stack>
                                </Grid>
                            </Grid>
                        </DialogContent>
                        <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}>
                            <Toolbar sx={{ width: '100%', justifyContent: 'space-between' }}  >
                                <SaveButton />
                            </Toolbar>
                        </DialogActions>
                    </Form>
                </Dialog>
            </CreateBase>
        </>
    )
}
export default TaskCreate;
zy-acs-flow/src/page/task/TaskEdit.jsx
New file
@@ -0,0 +1,292 @@
import React, { useState, useRef, useEffect, useMemo } from "react";
import {
    Edit,
    SimpleForm,
    FormDataConsumer,
    useTranslate,
    TextInput,
    NumberInput,
    BooleanInput,
    DateInput,
    SelectInput,
    ReferenceInput,
    ReferenceArrayInput,
    AutocompleteInput,
    SaveButton,
    Toolbar,
    Labeled,
    NumberField,
    required,
    useRecordContext,
    DeleteButton,
} from 'react-admin';
import { useWatch, useFormContext } from "react-hook-form";
import { Stack, Grid, Box, Typography } from '@mui/material';
import * as Common from '@/utils/common';
import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting';
import EditBaseAside from "../components/EditBaseAside";
import CustomerTopToolBar from "../components/EditTopToolBar";
import MemoInput from "../components/MemoInput";
import StatusSelectInput from "../components/StatusSelectInput";
const FormToolbar = () => {
    const { getValues } = useFormContext();
    return (
        <Toolbar sx={{ justifyContent: 'space-between' }}>
            <SaveButton />
            <DeleteButton mutationMode="optimistic" />
        </Toolbar>
    )
}
const TaskEdit = () => {
    const translate = useTranslate();
    return (
        <Edit
            redirect="list"
            mutationMode={EDIT_MODE}
            actions={<CustomerTopToolBar />}
            aside={<EditBaseAside />}
        >
            <SimpleForm
                shouldUnregister
                warnWhenUnsavedChanges
                toolbar={<FormToolbar />}
                mode="onTouched"
                defaultValues={{}}
            // validate={(values) => { }}
            >
                <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}>
                    <Grid item xs={12} md={8}>
                        <Typography variant="h6" gutterBottom>
                            {translate('common.edit.title.main')}
                        </Typography>
                        <Stack direction='row' gap={2}>
                            <TextInput
                                label="table.field.task.uuid"
                                source="uuid"
                                parse={v => v}
                                autoFocus
                            />
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <ReferenceInput
                                source="busId"
                                reference="bus"
                                perPage={REFERENCE_INPUT_PAGESIZE}
                            >
                                <AutocompleteInput
                                    label="table.field.task.busId"
                                    optionText="seqNum"
                                    filterToQuery={(val) => ({ seqNum: val })}
                                />
                            </ReferenceInput>
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <TextInput
                                label="table.field.task.seqNum"
                                source="seqNum"
                                parse={v => v}
                            />
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <NumberInput
                                label="table.field.task.priority"
                                source="priority"
                            />
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <TextInput
                                label="table.field.task.name"
                                source="name"
                                parse={v => v}
                            />
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <ReferenceInput
                                source="taskSts"
                                reference="taskSts"
                                perPage={REFERENCE_INPUT_PAGESIZE}
                            >
                                <AutocompleteInput
                                    label="table.field.task.taskSts"
                                    optionText="name"
                                    filterToQuery={(val) => ({ name: val })}
                                />
                            </ReferenceInput>
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <ReferenceInput
                                source="taskType"
                                reference="taskType"
                                perPage={REFERENCE_INPUT_PAGESIZE}
                            >
                                <AutocompleteInput
                                    label="table.field.task.taskType"
                                    optionText="name"
                                    filterToQuery={(val) => ({ name: val })}
                                />
                            </ReferenceInput>
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <ReferenceInput
                                source="agvId"
                                reference="agv"
                                perPage={REFERENCE_INPUT_PAGESIZE}
                            >
                                <AutocompleteInput
                                    label="table.field.task.agvId"
                                    optionText="uuid"
                                    filterToQuery={(val) => ({ uuid: val })}
                                />
                            </ReferenceInput>
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <DateInput
                                label="table.field.task.ioTime"
                                source="ioTime"
                            />
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <DateInput
                                label="table.field.task.startTime"
                                source="startTime"
                            />
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <DateInput
                                label="table.field.task.endTime"
                                source="endTime"
                            />
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <DateInput
                                label="table.field.task.errTime"
                                source="errTime"
                            />
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <ReferenceInput
                                source="oriSta"
                                reference="sta"
                                perPage={REFERENCE_INPUT_PAGESIZE}
                            >
                                <AutocompleteInput
                                    label="table.field.task.oriSta"
                                    optionText="staNo"
                                    filterToQuery={(val) => ({ staNo: val })}
                                />
                            </ReferenceInput>
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <ReferenceInput
                                source="oriLoc"
                                reference="loc"
                                perPage={REFERENCE_INPUT_PAGESIZE}
                            >
                                <AutocompleteInput
                                    label="table.field.task.oriLoc"
                                    optionText="locNo"
                                    filterToQuery={(val) => ({ locNo: val })}
                                />
                            </ReferenceInput>
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <ReferenceInput
                                source="oriCode"
                                reference="code"
                                perPage={REFERENCE_INPUT_PAGESIZE}
                            >
                                <AutocompleteInput
                                    label="table.field.task.oriCode"
                                    optionText="data"
                                    filterToQuery={(val) => ({ data: val })}
                                />
                            </ReferenceInput>
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <ReferenceInput
                                source="destSta"
                                reference="sta"
                                perPage={REFERENCE_INPUT_PAGESIZE}
                            >
                                <AutocompleteInput
                                    label="table.field.task.destSta"
                                    optionText="staNo"
                                    filterToQuery={(val) => ({ staNo: val })}
                                />
                            </ReferenceInput>
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <ReferenceInput
                                source="destLoc"
                                reference="loc"
                                perPage={REFERENCE_INPUT_PAGESIZE}
                            >
                                <AutocompleteInput
                                    label="table.field.task.destLoc"
                                    optionText="locNo"
                                    filterToQuery={(val) => ({ locNo: val })}
                                />
                            </ReferenceInput>
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <ReferenceInput
                                source="destCode"
                                reference="code"
                                perPage={REFERENCE_INPUT_PAGESIZE}
                            >
                                <AutocompleteInput
                                    label="table.field.task.destCode"
                                    optionText="data"
                                    filterToQuery={(val) => ({ data: val })}
                                />
                            </ReferenceInput>
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <TextInput
                                label="table.field.task.emptyMk"
                                source="emptyMk"
                                parse={v => v}
                            />
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <TextInput
                                label="table.field.task.zpallet"
                                source="zpallet"
                                parse={v => v}
                            />
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <TextInput
                                label="table.field.task.phase"
                                source="phase"
                                parse={v => v}
                            />
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <TextInput
                                label="table.field.task.errDesc"
                                source="errDesc"
                                parse={v => v}
                            />
                        </Stack>
                    </Grid>
                    <Grid item xs={12} md={4}>
                        <Typography variant="h6" gutterBottom>
                            {translate('common.edit.title.common')}
                        </Typography>
                        <StatusSelectInput />
                        <Box mt="2em" />
                        <MemoInput />
                    </Grid>
                </Grid>
            </SimpleForm>
        </Edit >
    )
}
export default TaskEdit;
zy-acs-flow/src/page/task/TaskList.jsx
New file
@@ -0,0 +1,232 @@
import React, { useState, useRef, useEffect, useMemo, useCallback } from "react";
import { useNavigate } from 'react-router-dom';
import {
    List,
    DatagridConfigurable,
    SearchInput,
    TopToolbar,
    SelectColumnsButton,
    EditButton,
    FilterButton,
    CreateButton,
    ExportButton,
    BulkDeleteButton,
    WrapperField,
    useRecordContext,
    useTranslate,
    useListContext,
    useCreatePath,
    TextField,
    NumberField,
    DateField,
    BooleanField,
    ReferenceField,
    TextInput,
    DateTimeInput,
    DateInput,
    SelectInput,
    NumberInput,
    ReferenceInput,
    ReferenceArrayInput,
    AutocompleteInput,
    DeleteButton,
} from 'react-admin';
import { Box, Typography, Card, Stack } from '@mui/material';
import { styled } from '@mui/material/styles';
import TaskCreate from "./TaskCreate";
import TaskPanel from "./TaskPanel";
import EmptyData from "../components/EmptyData";
import MyCreateButton from "../components/MyCreateButton";
import MyExportButton from '../components/MyExportButton';
import PageDrawer from "../components/PageDrawer";
import MyField from "../components/MyField";
import { PAGE_DRAWER_WIDTH, OPERATE_MODE } from '@/config/setting';
import * as Common from '@/utils/common';
const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
    '& .css-1vooibu-MuiSvgIcon-root': {
        height: '.9em'
    },
    '& .RaDatagrid-row': {
        cursor: 'auto'
    },
    '& .column-name': {
    },
    '& .opt': {
        width: 200
    },
}));
const filters = [
    <SearchInput source="condition" alwaysOn />,
    <DateInput label='common.time.after' source="timeStart" alwaysOn />,
    <DateInput label='common.time.before' source="timeEnd" alwaysOn />,
    <TextInput source="uuid" label="table.field.task.uuid" />,
    <ReferenceInput source="busId" label="table.field.task.busId" reference="bus">
        <AutocompleteInput label="table.field.task.busId" optionText="seqNum" filterToQuery={(val) => ({ seqNum: val })} />
    </ReferenceInput>,
    <TextInput source="seqNum" label="table.field.task.seqNum" />,
    <NumberInput source="priority" label="table.field.task.priority" />,
    <TextInput source="name" label="table.field.task.name" />,
    <ReferenceInput source="taskSts" label="table.field.task.taskSts" reference="taskSts">
        <AutocompleteInput label="table.field.task.taskSts" optionText="name" filterToQuery={(val) => ({ name: val })} />
    </ReferenceInput>,
    <ReferenceInput source="taskType" label="table.field.task.taskType" reference="taskType">
        <AutocompleteInput label="table.field.task.taskType" optionText="name" filterToQuery={(val) => ({ name: val })} />
    </ReferenceInput>,
    <ReferenceInput source="agvId" label="table.field.task.agvId" reference="agv">
        <AutocompleteInput label="table.field.task.agvId" optionText="uuid" filterToQuery={(val) => ({ uuid: val })} />
    </ReferenceInput>,
    <DateInput source="ioTime" label="table.field.task.ioTime" />,
    <DateInput source="startTime" label="table.field.task.startTime" />,
    <DateInput source="endTime" label="table.field.task.endTime" />,
    <DateInput source="errTime" label="table.field.task.errTime" />,
    <ReferenceInput source="oriSta" label="table.field.task.oriSta" reference="sta">
        <AutocompleteInput label="table.field.task.oriSta" optionText="staNo" filterToQuery={(val) => ({ staNo: val })} />
    </ReferenceInput>,
    <ReferenceInput source="oriLoc" label="table.field.task.oriLoc" reference="loc">
        <AutocompleteInput label="table.field.task.oriLoc" optionText="locNo" filterToQuery={(val) => ({ locNo: val })} />
    </ReferenceInput>,
    <ReferenceInput source="oriCode" label="table.field.task.oriCode" reference="code">
        <AutocompleteInput label="table.field.task.oriCode" optionText="data" filterToQuery={(val) => ({ data: val })} />
    </ReferenceInput>,
    <ReferenceInput source="destSta" label="table.field.task.destSta" reference="sta">
        <AutocompleteInput label="table.field.task.destSta" optionText="staNo" filterToQuery={(val) => ({ staNo: val })} />
    </ReferenceInput>,
    <ReferenceInput source="destLoc" label="table.field.task.destLoc" reference="loc">
        <AutocompleteInput label="table.field.task.destLoc" optionText="locNo" filterToQuery={(val) => ({ locNo: val })} />
    </ReferenceInput>,
    <ReferenceInput source="destCode" label="table.field.task.destCode" reference="code">
        <AutocompleteInput label="table.field.task.destCode" optionText="data" filterToQuery={(val) => ({ data: val })} />
    </ReferenceInput>,
    <TextInput source="emptyMk" label="table.field.task.emptyMk" />,
    <TextInput source="zpallet" label="table.field.task.zpallet" />,
    <TextInput source="phase" label="table.field.task.phase" />,
    <TextInput source="errDesc" label="table.field.task.errDesc" />,
    <TextInput label="common.field.memo" source="memo" />,
    <SelectInput
        label="common.field.status"
        source="status"
        choices={[
            { id: '1', name: 'common.enums.statusTrue' },
            { id: '0', name: 'common.enums.statusFalse' },
        ]}
    />,
]
const TaskList = () => {
    const translate = useTranslate();
    const [createDialog, setCreateDialog] = useState(false);
    const [drawerVal, setDrawerVal] = useState(false);
    return (
        <Box display="flex">
            <List
                sx={{
                    flexGrow: 1,
                    transition: (theme) =>
                        theme.transitions.create(['all'], {
                            duration: theme.transitions.duration.enteringScreen,
                        }),
                    marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0,
                }}
                title={"menu.task"}
                empty={<EmptyData onClick={() => { setCreateDialog(true) }} />}
                filters={filters}
                sort={{ field: "create_time", order: "desc" }}
                actions={(
                    <TopToolbar>
                        <FilterButton />
                        <MyCreateButton onClick={() => { setCreateDialog(true) }} />
                        <SelectColumnsButton preferenceKey='task' />
                        <MyExportButton />
                    </TopToolbar>
                )}
                perPage={25}
            >
                <StyledDatagrid
                    preferenceKey='task'
                    bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />}
                    rowClick={(id, resource, record) => false}
                    expand={() => <TaskPanel />}
                    expandSingle={true}
                    omit={['id', 'createTime', 'createBy', 'memo']}
                >
                    <NumberField source="id" />
                    <TextField source="uuid" label="table.field.task.uuid" />
                    <ReferenceField source="busId" label="table.field.task.busId" reference="bus" link={false} sortable={false}>
                        <TextField source="seqNum" />
                    </ReferenceField>
                    <TextField source="seqNum" label="table.field.task.seqNum" />
                    <NumberField source="priority" label="table.field.task.priority" />
                    <TextField source="name" label="table.field.task.name" />
                    <ReferenceField source="taskSts" label="table.field.task.taskSts" reference="taskSts" link={false} sortable={false}>
                        <TextField source="name" />
                    </ReferenceField>
                    <ReferenceField source="taskType" label="table.field.task.taskType" reference="taskType" link={false} sortable={false}>
                        <TextField source="name" />
                    </ReferenceField>
                    <ReferenceField source="agvId" label="table.field.task.agvId" reference="agv" link={false} sortable={false}>
                        <TextField source="uuid" />
                    </ReferenceField>
                    <DateField source="ioTime" label="table.field.task.ioTime" showTime />
                    <DateField source="startTime" label="table.field.task.startTime" showTime />
                    <DateField source="endTime" label="table.field.task.endTime" showTime />
                    <DateField source="errTime" label="table.field.task.errTime" showTime />
                    <ReferenceField source="oriSta" label="table.field.task.oriSta" reference="sta" link={false} sortable={false}>
                        <TextField source="staNo" />
                    </ReferenceField>
                    <ReferenceField source="oriLoc" label="table.field.task.oriLoc" reference="loc" link={false} sortable={false}>
                        <TextField source="locNo" />
                    </ReferenceField>
                    <ReferenceField source="oriCode" label="table.field.task.oriCode" reference="code" link={false} sortable={false}>
                        <TextField source="data" />
                    </ReferenceField>
                    <ReferenceField source="destSta" label="table.field.task.destSta" reference="sta" link={false} sortable={false}>
                        <TextField source="staNo" />
                    </ReferenceField>
                    <ReferenceField source="destLoc" label="table.field.task.destLoc" reference="loc" link={false} sortable={false}>
                        <TextField source="locNo" />
                    </ReferenceField>
                    <ReferenceField source="destCode" label="table.field.task.destCode" reference="code" link={false} sortable={false}>
                        <TextField source="data" />
                    </ReferenceField>
                    <TextField source="emptyMk" label="table.field.task.emptyMk" />
                    <TextField source="zpallet" label="table.field.task.zpallet" />
                    <TextField source="phase" label="table.field.task.phase" />
                    <TextField source="errDesc" label="table.field.task.errDesc" />
                    <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}>
                        <TextField source="nickname" />
                    </ReferenceField>
                    <DateField source="updateTime" label="common.field.updateTime" showTime />
                    <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}>
                        <TextField source="nickname" />
                    </ReferenceField>
                    <DateField source="createTime" label="common.field.createTime" showTime />
                    <BooleanField source="statusBool" label="common.field.status" sortable={false} />
                    <TextField source="memo" label="common.field.memo" sortable={false} />
                    <WrapperField cellClassName="opt" label="common.field.opt">
                        <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} />
                        <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} />
                    </WrapperField>
                </StyledDatagrid>
            </List>
            <TaskCreate
                open={createDialog}
                setOpen={setCreateDialog}
            />
            <PageDrawer
                title='Task Detail'
                drawerVal={drawerVal}
                setDrawerVal={setDrawerVal}
            >
            </PageDrawer>
        </Box>
    )
}
export default TaskList;
zy-acs-flow/src/page/task/TaskPanel.jsx
New file
@@ -0,0 +1,183 @@
import React, { useState, useRef, useEffect, useMemo } from "react";
import { Box, Card, CardContent, Grid, Typography, Tooltip } from '@mui/material';
import {
    useTranslate,
    useRecordContext,
} from 'react-admin';
import PanelTypography from "../components/PanelTypography";
import * as Common from '@/utils/common'
const TaskPanel = () => {
    const record = useRecordContext();
    if (!record) return null;
    const translate = useTranslate();
    return (
        <>
            <Card sx={{ width: { xs: 300, sm: 500, md: 600, lg: 800 }, margin: 'auto' }}>
                <CardContent>
                    <Grid container spacing={2}>
                        <Grid item xs={12} sx={{ display: 'flex', justifyContent: 'space-between' }}>
                            <Typography variant="h6" gutterBottom align="left" sx={{
                                maxWidth: { xs: '100px', sm: '180px', md: '260px', lg: '360px' },
                                whiteSpace: 'nowrap',
                                overflow: 'hidden',
                                textOverflow: 'ellipsis',
                            }}>
                                {Common.camelToPascalWithSpaces(translate('table.field.task.seqNum'))}: {record.seqNum}
                            </Typography>
                            {/*  inherit, primary, secondary, textPrimary, textSecondary, error */}
                            <Typography variant="h6" gutterBottom align="right" >
                                ID: {record.id}
                            </Typography>
                        </Grid>
                    </Grid>
                    <Grid container spacing={2}>
                        <Grid item xs={12} container alignContent="flex-end">
                            <Typography variant="caption" color="textSecondary" sx={{ wordWrap: 'break-word', wordBreak: 'break-all' }}>
                                {Common.camelToPascalWithSpaces(translate('common.field.memo'))}:{record.memo}
                            </Typography>
                        </Grid>
                    </Grid>
                    <Box height={20}>&nbsp;</Box>
                    <Grid container spacing={2}>
                        <Grid item xs={6}>
                            <PanelTypography
                                title="table.field.task.uuid"
                                property={record.uuid}
                            />
                        </Grid>
                        <Grid item xs={6}>
                            <PanelTypography
                                title="table.field.task.busId"
                                property={record.busId$}
                            />
                        </Grid>
                        <Grid item xs={6}>
                            <PanelTypography
                                title="table.field.task.seqNum"
                                property={record.seqNum}
                            />
                        </Grid>
                        <Grid item xs={6}>
                            <PanelTypography
                                title="table.field.task.priority"
                                property={record.priority}
                            />
                        </Grid>
                        <Grid item xs={6}>
                            <PanelTypography
                                title="table.field.task.name"
                                property={record.name}
                            />
                        </Grid>
                        <Grid item xs={6}>
                            <PanelTypography
                                title="table.field.task.taskSts"
                                property={record.taskSts$}
                            />
                        </Grid>
                        <Grid item xs={6}>
                            <PanelTypography
                                title="table.field.task.taskType"
                                property={record.taskType$}
                            />
                        </Grid>
                        <Grid item xs={6}>
                            <PanelTypography
                                title="table.field.task.agvId"
                                property={record.agvId$}
                            />
                        </Grid>
                        <Grid item xs={6}>
                            <PanelTypography
                                title="table.field.task.ioTime"
                                property={record.ioTime$}
                            />
                        </Grid>
                        <Grid item xs={6}>
                            <PanelTypography
                                title="table.field.task.startTime"
                                property={record.startTime$}
                            />
                        </Grid>
                        <Grid item xs={6}>
                            <PanelTypography
                                title="table.field.task.endTime"
                                property={record.endTime$}
                            />
                        </Grid>
                        <Grid item xs={6}>
                            <PanelTypography
                                title="table.field.task.errTime"
                                property={record.errTime$}
                            />
                        </Grid>
                        <Grid item xs={6}>
                            <PanelTypography
                                title="table.field.task.oriSta"
                                property={record.oriSta$}
                            />
                        </Grid>
                        <Grid item xs={6}>
                            <PanelTypography
                                title="table.field.task.oriLoc"
                                property={record.oriLoc$}
                            />
                        </Grid>
                        <Grid item xs={6}>
                            <PanelTypography
                                title="table.field.task.oriCode"
                                property={record.oriCode$}
                            />
                        </Grid>
                        <Grid item xs={6}>
                            <PanelTypography
                                title="table.field.task.destSta"
                                property={record.destSta$}
                            />
                        </Grid>
                        <Grid item xs={6}>
                            <PanelTypography
                                title="table.field.task.destLoc"
                                property={record.destLoc$}
                            />
                        </Grid>
                        <Grid item xs={6}>
                            <PanelTypography
                                title="table.field.task.destCode"
                                property={record.destCode$}
                            />
                        </Grid>
                        <Grid item xs={6}>
                            <PanelTypography
                                title="table.field.task.emptyMk"
                                property={record.emptyMk}
                            />
                        </Grid>
                        <Grid item xs={6}>
                            <PanelTypography
                                title="table.field.task.zpallet"
                                property={record.zpallet}
                            />
                        </Grid>
                        <Grid item xs={6}>
                            <PanelTypography
                                title="table.field.task.phase"
                                property={record.phase}
                            />
                        </Grid>
                        <Grid item xs={6}>
                            <PanelTypography
                                title="table.field.task.errDesc"
                                property={record.errDesc}
                            />
                        </Grid>
                    </Grid>
                </CardContent>
            </Card >
        </>
    );
};
export default TaskPanel;
zy-acs-flow/src/page/task/index.jsx
New file
@@ -0,0 +1,18 @@
import React, { useState, useRef, useEffect, useMemo } from "react";
import {
    ListGuesser,
    EditGuesser,
    ShowGuesser,
} from "react-admin";
import TaskList from "./TaskList";
import TaskEdit from "./TaskEdit";
export default {
    list: TaskList,
    edit: TaskEdit,
    show: ShowGuesser,
    recordRepresentation: (record) => {
        return `${record.seqNum}`
    }
};
zy-acs-manager/src/main/java/com/zy/acs/manager/common/CodeBuilder.java
@@ -22,8 +22,8 @@
//        generator.username="sa";
//        generator.password="Zoneyung@zy56$";
        generator.table="man_bus";
        generator.tableDesc="Bus";
        generator.table="man_task";
        generator.tableDesc="Task";
        generator.packagePath="com.zy.acs.manager.manager";
        generator.build();
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/TaskController.java
New file
@@ -0,0 +1,111 @@
package com.zy.acs.manager.manager.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zy.acs.framework.common.Cools;
import com.zy.acs.framework.common.R;
import com.zy.acs.manager.common.utils.ExcelUtil;
import com.zy.acs.manager.common.annotation.OperationLog;
import com.zy.acs.manager.common.domain.BaseParam;
import com.zy.acs.manager.common.domain.KeyValVo;
import com.zy.acs.manager.common.domain.PageParam;
import com.zy.acs.manager.manager.entity.Task;
import com.zy.acs.manager.manager.service.TaskService;
import com.zy.acs.manager.system.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
@RestController
@RequestMapping("/api")
public class TaskController extends BaseController {
    @Autowired
    private TaskService taskService;
    @PreAuthorize("hasAuthority('manager:task:list')")
    @PostMapping("/task/page")
    public R page(@RequestBody Map<String, Object> map) {
        BaseParam baseParam = buildParam(map, BaseParam.class);
        PageParam<Task, BaseParam> pageParam = new PageParam<>(baseParam, Task.class);
        return R.ok().add(taskService.page(pageParam, pageParam.buildWrapper(true)));
    }
    @PreAuthorize("hasAuthority('manager:task:list')")
    @PostMapping("/task/list")
    public R list(@RequestBody Map<String, Object> map) {
        return R.ok().add(taskService.list());
    }
    @PreAuthorize("hasAuthority('manager:task:list')")
    @PostMapping({"/task/many/{ids}", "/tasks/many/{ids}"})
    public R many(@PathVariable Long[] ids) {
        return R.ok().add(taskService.listByIds(Arrays.asList(ids)));
    }
    @PreAuthorize("hasAuthority('manager:task:list')")
    @GetMapping("/task/{id}")
    public R get(@PathVariable("id") Long id) {
        return R.ok().add(taskService.getById(id));
    }
    @PreAuthorize("hasAuthority('manager:task:save')")
    @OperationLog("Create Task")
    @PostMapping("/task/save")
    public R save(@RequestBody Task task) {
        task.setCreateBy(getLoginUserId());
        task.setCreateTime(new Date());
        task.setUpdateBy(getLoginUserId());
        task.setUpdateTime(new Date());
        if (!taskService.save(task)) {
            return R.error("Save Fail");
        }
        return R.ok("Save Success").add(task);
    }
    @PreAuthorize("hasAuthority('manager:task:update')")
    @OperationLog("Update Task")
    @PostMapping("/task/update")
    public R update(@RequestBody Task task) {
        task.setUpdateBy(getLoginUserId());
        task.setUpdateTime(new Date());
        if (!taskService.updateById(task)) {
            return R.error("Update Fail");
        }
        return R.ok("Update Success").add(task);
    }
    @PreAuthorize("hasAuthority('manager:task:remove')")
    @OperationLog("Delete Task")
    @PostMapping("/task/remove/{ids}")
    public R remove(@PathVariable Long[] ids) {
        if (!taskService.removeByIds(Arrays.asList(ids))) {
            return R.error("Delete Fail");
        }
        return R.ok("Delete Success").add(ids);
    }
    @PreAuthorize("hasAuthority('manager:task:list')")
    @PostMapping("/task/query")
    public R query(@RequestParam(required = false) String condition) {
        List<KeyValVo> vos = new ArrayList<>();
        LambdaQueryWrapper<Task> wrapper = new LambdaQueryWrapper<>();
        if (!Cools.isEmpty(condition)) {
            wrapper.like(Task::getSeqNum, condition);
        }
        taskService.page(new Page<>(1, 30), wrapper).getRecords().forEach(
                item -> vos.add(new KeyValVo(item.getId(), item.getSeqNum()))
        );
        return R.ok().add(vos);
    }
    @PreAuthorize("hasAuthority('manager:task:list')")
    @PostMapping("/task/export")
    public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception {
        ExcelUtil.build(ExcelUtil.create(taskService.list(), Task.class), response);
    }
}