From 27684b724265258c45d587006fd464ad97397dfe Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 18 九月 2024 10:39:21 +0800
Subject: [PATCH] #
---
zy-acs-flow/src/page/action/ActionList.jsx | 208 +++++++++++
zy-acs-flow/src/i18n/en.js | 23 +
zy-acs-manager/src/main/java/com/zy/acs/manager/common/CodeBuilder.java | 4
zy-acs-flow/src/page/ResourceContent.js | 3
zy-acs-flow/src/page/action/ActionEdit.jsx | 233 ++++++++++++
zy-acs-flow/src/page/action/ActionPanel.jsx | 159 ++++++++
zy-acs-flow/src/i18n/zh.js | 23 +
zy-acs-flow/src/page/action/ActionCreate.jsx | 256 ++++++++++++++
zy-acs-flow/src/page/action/index.jsx | 18 +
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/ActionController.java | 111 ++++++
10 files changed, 1,032 insertions(+), 6 deletions(-)
diff --git a/zy-acs-flow/src/i18n/en.js b/zy-acs-flow/src/i18n/en.js
index e67fc31..a99f8a3 100644
--- a/zy-acs-flow/src/i18n/en.js
+++ b/zy-acs-flow/src/i18n/en.js
@@ -122,7 +122,7 @@
travel: 'Travel',
segment: 'Segment',
jam: 'Jam',
-
+ action: 'Action',
},
table: {
field: {
@@ -474,7 +474,26 @@
duration: "duration",
state: "state",
},
-
+ action: {
+ uuid: "uuid",
+ groupId: "group no",
+ busId: "bus",
+ taskId: "task",
+ seqNum: "seq num",
+ priority: "priority",
+ name: "name",
+ val: "val",
+ code: "code",
+ params: "params",
+ actionType: "action type",
+ actionSts: "action status",
+ agvId: "agv",
+ ioTime: "io time",
+ startTime: "start time",
+ endTime: "end time",
+ errTime: "err time",
+ errDesc: "error",
+ },
}
}
};
diff --git a/zy-acs-flow/src/i18n/zh.js b/zy-acs-flow/src/i18n/zh.js
index d987777..d8bcca2 100644
--- a/zy-acs-flow/src/i18n/zh.js
+++ b/zy-acs-flow/src/i18n/zh.js
@@ -122,7 +122,7 @@
travel: '琛岀▼绠$悊',
segment: '鍗曟浣滀笟',
jam: '浜ら�氶伩璁�',
-
+ action: '鍔ㄤ綔鍛戒护',
},
table: {
field: {
@@ -473,7 +473,26 @@
duration: "鎸佺画鏃堕暱",
state: "鐘舵��",
},
-
+ action: {
+ uuid: "缂栧彿",
+ groupId: "缁勭紪鍙�",
+ busId: "鎬荤嚎",
+ taskId: "浠诲姟",
+ seqNum: "鍔ㄤ綔鍙�",
+ priority: "浼樺厛绾�",
+ name: "鍚嶇О",
+ val: "鍔ㄤ綔鍊�",
+ code: "鍦伴潰鐮�",
+ params: "鍔ㄤ綔鍙傛暟",
+ actionType: "鍔ㄤ綔绫诲瀷",
+ actionSts: "鍔ㄤ綔鐘舵��",
+ agvId: "杞﹁締",
+ ioTime: "宸ヤ綔鏃堕棿",
+ startTime: "涓嬪彂鏃堕棿",
+ endTime: "瀹屾垚鏃堕棿",
+ errTime: "寮傚父鏃堕棿",
+ errDesc: "寮傚父",
+ },
}
}
};
diff --git a/zy-acs-flow/src/page/ResourceContent.js b/zy-acs-flow/src/page/ResourceContent.js
index 27c6e01..33a8348 100644
--- a/zy-acs-flow/src/page/ResourceContent.js
+++ b/zy-acs-flow/src/page/ResourceContent.js
@@ -39,6 +39,7 @@
import travel from './travel';
import segment from './segment';
import jam from './jam';
+import action from './action';
const ResourceContent = (node) => {
switch (node.component) {
@@ -112,6 +113,8 @@
return segment;
case 'jam':
return jam;
+ case 'action':
+ return action;
default:
return {
list: ListGuesser,
diff --git a/zy-acs-flow/src/page/action/ActionCreate.jsx b/zy-acs-flow/src/page/action/ActionCreate.jsx
new file mode 100644
index 0000000..fcdd286
--- /dev/null
+++ b/zy-acs-flow/src/page/action/ActionCreate.jsx
@@ -0,0 +1,256 @@
+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 ActionCreate = (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.action.uuid"
+ source="uuid"
+ parse={v => v}
+ autoFocus
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.action.groupId"
+ source="groupId"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <ReferenceInput
+ source="busId"
+ reference="bus"
+ >
+ <AutocompleteInput
+ label="table.field.action.busId"
+ optionText="seqNum"
+ filterToQuery={(val) => ({ seqNum: val })}
+ />
+ </ReferenceInput>
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <ReferenceInput
+ source="taskId"
+ reference="task"
+ >
+ <AutocompleteInput
+ label="table.field.action.taskId"
+ optionText="seqNum"
+ filterToQuery={(val) => ({ seqNum: val })}
+ />
+ </ReferenceInput>
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.action.seqNum"
+ source="seqNum"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <NumberInput
+ label="table.field.action.priority"
+ source="priority"
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.action.name"
+ source="name"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <NumberInput
+ label="table.field.action.val"
+ source="val"
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.action.code"
+ source="code"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.action.params"
+ source="params"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <ReferenceInput
+ source="actionType"
+ reference="actionType"
+ >
+ <AutocompleteInput
+ label="table.field.action.actionType"
+ optionText="name"
+ filterToQuery={(val) => ({ name: val })}
+ />
+ </ReferenceInput>
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <ReferenceInput
+ source="actionSts"
+ reference="actionSts"
+ >
+ <AutocompleteInput
+ label="table.field.action.actionSts"
+ 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.action.agvId"
+ optionText="uuid"
+ filterToQuery={(val) => ({ uuid: val })}
+ />
+ </ReferenceInput>
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <DateInput
+ label="table.field.action.ioTime"
+ source="ioTime"
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <DateInput
+ label="table.field.action.startTime"
+ source="startTime"
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <DateInput
+ label="table.field.action.endTime"
+ source="endTime"
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <DateInput
+ label="table.field.action.errTime"
+ source="errTime"
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.action.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 ActionCreate;
diff --git a/zy-acs-flow/src/page/action/ActionEdit.jsx b/zy-acs-flow/src/page/action/ActionEdit.jsx
new file mode 100644
index 0000000..62ed9b6
--- /dev/null
+++ b/zy-acs-flow/src/page/action/ActionEdit.jsx
@@ -0,0 +1,233 @@
+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 ActionEdit = () => {
+ 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.action.uuid"
+ source="uuid"
+ parse={v => v}
+ autoFocus
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <TextInput
+ label="table.field.action.groupId"
+ source="groupId"
+ parse={v => v}
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <ReferenceInput
+ source="busId"
+ reference="bus"
+ perPage={REFERENCE_INPUT_PAGESIZE}
+ >
+ <AutocompleteInput
+ label="table.field.action.busId"
+ optionText="seqNum"
+ filterToQuery={(val) => ({ seqNum: val })}
+ />
+ </ReferenceInput>
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <ReferenceInput
+ source="taskId"
+ reference="task"
+ perPage={REFERENCE_INPUT_PAGESIZE}
+ >
+ <AutocompleteInput
+ label="table.field.action.taskId"
+ optionText="seqNum"
+ filterToQuery={(val) => ({ seqNum: val })}
+ />
+ </ReferenceInput>
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <TextInput
+ label="table.field.action.seqNum"
+ source="seqNum"
+ parse={v => v}
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <NumberInput
+ label="table.field.action.priority"
+ source="priority"
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <TextInput
+ label="table.field.action.name"
+ source="name"
+ parse={v => v}
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <NumberInput
+ label="table.field.action.val"
+ source="val"
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <TextInput
+ label="table.field.action.code"
+ source="code"
+ parse={v => v}
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <TextInput
+ label="table.field.action.params"
+ source="params"
+ parse={v => v}
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <ReferenceInput
+ source="actionType"
+ reference="actionType"
+ perPage={REFERENCE_INPUT_PAGESIZE}
+ >
+ <AutocompleteInput
+ label="table.field.action.actionType"
+ optionText="name"
+ filterToQuery={(val) => ({ name: val })}
+ />
+ </ReferenceInput>
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <ReferenceInput
+ source="actionSts"
+ reference="actionSts"
+ perPage={REFERENCE_INPUT_PAGESIZE}
+ >
+ <AutocompleteInput
+ label="table.field.action.actionSts"
+ 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.action.agvId"
+ optionText="uuid"
+ filterToQuery={(val) => ({ uuid: val })}
+ />
+ </ReferenceInput>
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <DateInput
+ label="table.field.action.ioTime"
+ source="ioTime"
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <DateInput
+ label="table.field.action.startTime"
+ source="startTime"
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <DateInput
+ label="table.field.action.endTime"
+ source="endTime"
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <DateInput
+ label="table.field.action.errTime"
+ source="errTime"
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <TextInput
+ label="table.field.action.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 ActionEdit;
diff --git a/zy-acs-flow/src/page/action/ActionList.jsx b/zy-acs-flow/src/page/action/ActionList.jsx
new file mode 100644
index 0000000..024cd2b
--- /dev/null
+++ b/zy-acs-flow/src/page/action/ActionList.jsx
@@ -0,0 +1,208 @@
+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 ActionCreate from "./ActionCreate";
+import ActionPanel from "./ActionPanel";
+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-busId': {
+ maxWidth: '8em',
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
+ whiteSpace: 'nowrap',
+ },
+ '& .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.action.uuid" />,
+ <TextInput source="groupId" label="table.field.action.groupId" />,
+ <ReferenceInput source="busId" label="table.field.action.busId" reference="bus">
+ <AutocompleteInput label="table.field.action.busId" optionText="seqNum" filterToQuery={(val) => ({ seqNum: val })} />
+ </ReferenceInput>,
+ <ReferenceInput source="taskId" label="table.field.action.taskId" reference="task">
+ <AutocompleteInput label="table.field.action.taskId" optionText="seqNum" filterToQuery={(val) => ({ seqNum: val })} />
+ </ReferenceInput>,
+ <TextInput source="seqNum" label="table.field.action.seqNum" />,
+ <NumberInput source="priority" label="table.field.action.priority" />,
+ <TextInput source="name" label="table.field.action.name" />,
+ <NumberInput source="val" label="table.field.action.val" />,
+ <TextInput source="code" label="table.field.action.code" />,
+ <TextInput source="params" label="table.field.action.params" />,
+ <ReferenceInput source="actionType" label="table.field.action.actionType" reference="actionType">
+ <AutocompleteInput label="table.field.action.actionType" optionText="name" filterToQuery={(val) => ({ name: val })} />
+ </ReferenceInput>,
+ <ReferenceInput source="actionSts" label="table.field.action.actionSts" reference="actionSts">
+ <AutocompleteInput label="table.field.action.actionSts" optionText="name" filterToQuery={(val) => ({ name: val })} />
+ </ReferenceInput>,
+ <ReferenceInput source="agvId" label="table.field.action.agvId" reference="agv">
+ <AutocompleteInput label="table.field.action.agvId" optionText="uuid" filterToQuery={(val) => ({ uuid: val })} />
+ </ReferenceInput>,
+ <DateInput source="ioTime" label="table.field.action.ioTime" />,
+ <DateInput source="startTime" label="table.field.action.startTime" />,
+ <DateInput source="endTime" label="table.field.action.endTime" />,
+ <DateInput source="errTime" label="table.field.action.errTime" />,
+ <TextInput source="errDesc" label="table.field.action.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 ActionList = () => {
+ 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.action"}
+ empty={<EmptyData onClick={() => { setCreateDialog(true) }} />}
+ filters={filters}
+ sort={{ field: "create_time", order: "desc" }}
+ actions={(
+ <TopToolbar>
+ <FilterButton />
+ <MyCreateButton onClick={() => { setCreateDialog(true) }} />
+ <SelectColumnsButton preferenceKey='action' />
+ <MyExportButton />
+ </TopToolbar>
+ )}
+ perPage={25}
+ >
+ <StyledDatagrid
+ preferenceKey='action'
+ bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />}
+ rowClick={(id, resource, record) => false}
+ expand={() => <ActionPanel />}
+ expandSingle={true}
+ omit={['id', 'uuid', 'errTime', 'updateBy', 'updateTime', 'createTime', 'createBy', 'memo']}
+ >
+ <NumberField source="id" />
+ <TextField source="uuid" label="table.field.action.uuid" />
+ <TextField source="groupId" label="table.field.action.groupId" />
+ <ReferenceField source="busId" label="table.field.action.busId" reference="bus" link={false} sortable={false}>
+ <TextField source="seqNum" />
+ </ReferenceField>
+ <ReferenceField source="taskId" label="table.field.action.taskId" reference="task" link={false} sortable={false}>
+ <TextField source="seqNum" />
+ </ReferenceField>
+ {/* <TextField source="seqNum" label="table.field.action.seqNum" /> */}
+ <NumberField source="priority" label="table.field.action.priority" />
+ {/* <TextField source="name" label="table.field.action.name" /> */}
+ <NumberField source="val" label="table.field.action.val" />
+ <TextField source="code" label="table.field.action.code" />
+ <TextField source="params" label="table.field.action.params" />
+ <ReferenceField source="actionType" label="table.field.action.actionType" reference="actionType" link={false} sortable={false}>
+ <TextField source="name" />
+ </ReferenceField>
+ <ReferenceField source="actionSts" label="table.field.action.actionSts" reference="actionSts" link={false} sortable={false}>
+ <TextField source="name" />
+ </ReferenceField>
+ <ReferenceField source="agvId" label="table.field.action.agvId" reference="agv" link={false} sortable={false}>
+ <TextField source="uuid" />
+ </ReferenceField>
+ <DateField source="ioTime" label="table.field.action.ioTime" showTime />
+ {/* <DateField source="startTime" label="table.field.action.startTime" showTime /> */}
+ <DateField source="endTime" label="table.field.action.endTime" showTime />
+ <DateField source="errTime" label="table.field.action.errTime" showTime />
+ <TextField source="errDesc" label="table.field.action.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>
+ <ActionCreate
+ open={createDialog}
+ setOpen={setCreateDialog}
+ />
+ <PageDrawer
+ title='Action Detail'
+ drawerVal={drawerVal}
+ setDrawerVal={setDrawerVal}
+ >
+ </PageDrawer>
+ </Box>
+ )
+}
+
+export default ActionList;
diff --git a/zy-acs-flow/src/page/action/ActionPanel.jsx b/zy-acs-flow/src/page/action/ActionPanel.jsx
new file mode 100644
index 0000000..7a85f8c
--- /dev/null
+++ b/zy-acs-flow/src/page/action/ActionPanel.jsx
@@ -0,0 +1,159 @@
+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 ActionPanel = () => {
+ 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.action.name'))}: {record.name}
+ </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}> </Box>
+ <Grid container spacing={2}>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.action.uuid"
+ property={record.uuid}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.action.groupId"
+ property={record.groupId}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.action.busId"
+ property={record.busId$}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.action.taskId"
+ property={record.taskId$}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.action.seqNum"
+ property={record.seqNum}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.action.priority"
+ property={record.priority}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.action.name"
+ property={record.name}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.action.val"
+ property={record.val}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.action.code"
+ property={record.code}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.action.params"
+ property={record.params}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.action.actionType"
+ property={record.actionType$}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.action.actionSts"
+ property={record.actionSts$}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.action.agvId"
+ property={record.agvId$}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.action.ioTime"
+ property={record.ioTime$}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.action.startTime"
+ property={record.startTime$}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.action.endTime"
+ property={record.endTime$}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.action.errTime"
+ property={record.errTime$}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.action.errDesc"
+ property={record.errDesc}
+ />
+ </Grid>
+
+ </Grid>
+ </CardContent>
+ </Card >
+ </>
+ );
+};
+
+export default ActionPanel;
diff --git a/zy-acs-flow/src/page/action/index.jsx b/zy-acs-flow/src/page/action/index.jsx
new file mode 100644
index 0000000..1783582
--- /dev/null
+++ b/zy-acs-flow/src/page/action/index.jsx
@@ -0,0 +1,18 @@
+import React, { useState, useRef, useEffect, useMemo } from "react";
+import {
+ ListGuesser,
+ EditGuesser,
+ ShowGuesser,
+} from "react-admin";
+
+import ActionList from "./ActionList";
+import ActionEdit from "./ActionEdit";
+
+export default {
+ list: ActionList,
+ edit: ActionEdit,
+ show: ShowGuesser,
+ recordRepresentation: (record) => {
+ return `${record.name}`
+ }
+};
diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/common/CodeBuilder.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/common/CodeBuilder.java
index c3a75f5..7f02d91 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/common/CodeBuilder.java
+++ b/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_jam";
- generator.tableDesc="Jam";
+ generator.table="man_action";
+ generator.tableDesc="Action";
generator.packagePath="com.zy.acs.manager.manager";
generator.build();
diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/ActionController.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/ActionController.java
new file mode 100644
index 0000000..7560bae
--- /dev/null
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/ActionController.java
@@ -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.Action;
+import com.zy.acs.manager.manager.service.ActionService;
+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 ActionController extends BaseController {
+
+ @Autowired
+ private ActionService actionService;
+
+ @PreAuthorize("hasAuthority('manager:action:list')")
+ @PostMapping("/action/page")
+ public R page(@RequestBody Map<String, Object> map) {
+ BaseParam baseParam = buildParam(map, BaseParam.class);
+ PageParam<Action, BaseParam> pageParam = new PageParam<>(baseParam, Action.class);
+ return R.ok().add(actionService.page(pageParam, pageParam.buildWrapper(true)));
+ }
+
+ @PreAuthorize("hasAuthority('manager:action:list')")
+ @PostMapping("/action/list")
+ public R list(@RequestBody Map<String, Object> map) {
+ return R.ok().add(actionService.list());
+ }
+
+ @PreAuthorize("hasAuthority('manager:action:list')")
+ @PostMapping({"/action/many/{ids}", "/actions/many/{ids}"})
+ public R many(@PathVariable Long[] ids) {
+ return R.ok().add(actionService.listByIds(Arrays.asList(ids)));
+ }
+
+ @PreAuthorize("hasAuthority('manager:action:list')")
+ @GetMapping("/action/{id}")
+ public R get(@PathVariable("id") Long id) {
+ return R.ok().add(actionService.getById(id));
+ }
+
+ @PreAuthorize("hasAuthority('manager:action:save')")
+ @OperationLog("Create Action")
+ @PostMapping("/action/save")
+ public R save(@RequestBody Action action) {
+ action.setCreateBy(getLoginUserId());
+ action.setCreateTime(new Date());
+ action.setUpdateBy(getLoginUserId());
+ action.setUpdateTime(new Date());
+ if (!actionService.save(action)) {
+ return R.error("Save Fail");
+ }
+ return R.ok("Save Success").add(action);
+ }
+
+ @PreAuthorize("hasAuthority('manager:action:update')")
+ @OperationLog("Update Action")
+ @PostMapping("/action/update")
+ public R update(@RequestBody Action action) {
+ action.setUpdateBy(getLoginUserId());
+ action.setUpdateTime(new Date());
+ if (!actionService.updateById(action)) {
+ return R.error("Update Fail");
+ }
+ return R.ok("Update Success").add(action);
+ }
+
+ @PreAuthorize("hasAuthority('manager:action:remove')")
+ @OperationLog("Delete Action")
+ @PostMapping("/action/remove/{ids}")
+ public R remove(@PathVariable Long[] ids) {
+ if (!actionService.removeByIds(Arrays.asList(ids))) {
+ return R.error("Delete Fail");
+ }
+ return R.ok("Delete Success").add(ids);
+ }
+
+ @PreAuthorize("hasAuthority('manager:action:list')")
+ @PostMapping("/action/query")
+ public R query(@RequestParam(required = false) String condition) {
+ List<KeyValVo> vos = new ArrayList<>();
+ LambdaQueryWrapper<Action> wrapper = new LambdaQueryWrapper<>();
+ if (!Cools.isEmpty(condition)) {
+ wrapper.like(Action::getName, condition);
+ }
+ actionService.page(new Page<>(1, 30), wrapper).getRecords().forEach(
+ item -> vos.add(new KeyValVo(item.getId(), item.getName()))
+ );
+ return R.ok().add(vos);
+ }
+
+ @PreAuthorize("hasAuthority('manager:action:list')")
+ @PostMapping("/action/export")
+ public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception {
+ ExcelUtil.build(ExcelUtil.create(actionService.list(), Action.class), response);
+ }
+
+}
--
Gitblit v1.9.1