From 851cb467145b5814e62eff9537d5fc372bfa2d86 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期三, 09 四月 2025 14:04:13 +0800
Subject: [PATCH] no message
---
/dev/null | 18 --
rsf-admin/src/page/taskLog/TaskLogEdit.jsx | 249 +++++++++++++----------------------
rsf-admin/src/page/taskLog/TaskLogList.jsx | 50 ++----
rsf-admin/src/page/ResourceContent.js | 6
rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/TaskLog.java | 34 ++++
rsf-server/src/main/resources/application-dev.yml | 8
6 files changed, 151 insertions(+), 214 deletions(-)
diff --git a/rsf-admin/src/page/ResourceContent.js b/rsf-admin/src/page/ResourceContent.js
index daf5821..3b244fe 100644
--- a/rsf-admin/src/page/ResourceContent.js
+++ b/rsf-admin/src/page/ResourceContent.js
@@ -47,7 +47,7 @@
import asnOrderLog from './asnOrderLog';
import asnOrderItemLog from './asnOrderItemLog';
import task from './task';
-import taskItem from './taskItem';
+// import taskItem from './taskItem';
import taskLog from './taskLog';
import taskItemLog from './taskItemLog';
@@ -140,8 +140,8 @@
return waitPakinItemLog;
case 'task':
return task;
- case 'taskItem':
- return taskItem;
+ // case 'taskItem':
+ // return taskItem;
case 'taskLog':
return taskLog;
case 'taskItemLog':
diff --git a/rsf-admin/src/page/taskItem/TaskItemCreate.jsx b/rsf-admin/src/page/taskItem/TaskItemCreate.jsx
deleted file mode 100644
index 02bdbd1..0000000
--- a/rsf-admin/src/page/taskItem/TaskItemCreate.jsx
+++ /dev/null
@@ -1,190 +0,0 @@
-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 TaskItemCreate = (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 (error) => {
- notify(error.message || 'common.response.fail', { type: 'error', messageArgs: { _: error.message } });
- };
-
- 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 sx={{ mt: 2 }}>
- <Grid container rowSpacing={2} columnSpacing={2}>
- <Grid item xs={6} display="flex" gap={1}>
- <NumberInput
- label="table.field.taskItem.taskId"
- source="taskId"
- autoFocus
- />
- </Grid>
- <Grid item xs={6} display="flex" gap={1}>
- <NumberInput
- label="table.field.taskItem.orderId"
- source="orderId"
- />
- </Grid>
- <Grid item xs={6} display="flex" gap={1}>
- <NumberInput
- label="table.field.taskItem.orderType"
- source="orderType"
- />
- </Grid>
- <Grid item xs={6} display="flex" gap={1}>
- <NumberInput
- label="table.field.taskItem.orderItemId"
- source="orderItemId"
- />
- </Grid>
- <Grid item xs={6} display="flex" gap={1}>
- <NumberInput
- label="table.field.taskItem.matnrId"
- source="matnrId"
- />
- </Grid>
- <Grid item xs={6} display="flex" gap={1}>
- <TextInput
- label="table.field.taskItem.maktx"
- source="maktx"
- parse={v => v}
- />
- </Grid>
- <Grid item xs={6} display="flex" gap={1}>
- <TextInput
- label="table.field.taskItem.matnrCode"
- source="matnrCode"
- parse={v => v}
- />
- </Grid>
- <Grid item xs={6} display="flex" gap={1}>
- <TextInput
- label="table.field.taskItem.unit"
- source="unit"
- parse={v => v}
- />
- </Grid>
- <Grid item xs={6} display="flex" gap={1}>
- <NumberInput
- label="table.field.taskItem.anfme"
- source="anfme"
- />
- </Grid>
- <Grid item xs={6} display="flex" gap={1}>
- <TextInput
- label="table.field.taskItem.batch"
- source="batch"
- parse={v => v}
- />
- </Grid>
- <Grid item xs={6} display="flex" gap={1}>
- <TextInput
- label="table.field.taskItem.spec"
- source="spec"
- parse={v => v}
- />
- </Grid>
- <Grid item xs={6} display="flex" gap={1}>
- <TextInput
- label="table.field.taskItem.model"
- source="model"
- 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 TaskItemCreate;
diff --git a/rsf-admin/src/page/taskItem/TaskItemEdit.jsx b/rsf-admin/src/page/taskItem/TaskItemEdit.jsx
deleted file mode 100644
index df2b7b6..0000000
--- a/rsf-admin/src/page/taskItem/TaskItemEdit.jsx
+++ /dev/null
@@ -1,161 +0,0 @@
-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 TaskItemEdit = () => {
- 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}>
- <NumberInput
- label="table.field.taskItem.taskId"
- source="taskId"
- autoFocus
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <NumberInput
- label="table.field.taskItem.orderId"
- source="orderId"
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <NumberInput
- label="table.field.taskItem.orderType"
- source="orderType"
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <NumberInput
- label="table.field.taskItem.orderItemId"
- source="orderItemId"
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <NumberInput
- label="table.field.taskItem.matnrId"
- source="matnrId"
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <TextInput
- label="table.field.taskItem.maktx"
- source="maktx"
- parse={v => v}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <TextInput
- label="table.field.taskItem.matnrCode"
- source="matnrCode"
- parse={v => v}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <TextInput
- label="table.field.taskItem.unit"
- source="unit"
- parse={v => v}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <NumberInput
- label="table.field.taskItem.anfme"
- source="anfme"
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <TextInput
- label="table.field.taskItem.batch"
- source="batch"
- parse={v => v}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <TextInput
- label="table.field.taskItem.spec"
- source="spec"
- parse={v => v}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <TextInput
- label="table.field.taskItem.model"
- source="model"
- 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 TaskItemEdit;
diff --git a/rsf-admin/src/page/taskItem/TaskItemList.jsx b/rsf-admin/src/page/taskItem/TaskItemList.jsx
deleted file mode 100644
index e137031..0000000
--- a/rsf-admin/src/page/taskItem/TaskItemList.jsx
+++ /dev/null
@@ -1,162 +0,0 @@
-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,
- useNotify,
- useListContext,
- FunctionField,
- 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 PageDrawer from "../components/PageDrawer";
-import MyField from "../components/MyField";
-import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting';
-import * as Common from '@/utils/common';
-import MyCreateButton from "../components/MyCreateButton";
-import TaskItemCreate from "../task/TaskItemCreate";
-
-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 />,
- <NumberInput source="taskId" label="table.field.taskItem.taskId" />,
- <NumberInput source="orderId" label="table.field.taskItem.orderId" />,
- <NumberInput source="orderType" label="table.field.taskItem.orderType" />,
- <NumberInput source="orderItemId" label="table.field.taskItem.orderItemId" />,
- <NumberInput source="matnrId" label="table.field.taskItem.matnrId" />,
- <TextInput source="maktx" label="table.field.taskItem.maktx" />,
- <TextInput source="matnrCode" label="table.field.taskItem.matnrCode" />,
- <TextInput source="unit" label="table.field.taskItem.unit" />,
- <NumberInput source="anfme" label="table.field.taskItem.anfme" />,
- <TextInput source="batch" label="table.field.taskItem.batch" />,
- <TextInput source="spec" label="table.field.taskItem.spec" />,
- <TextInput source="model" label="table.field.taskItem.model" />,
- <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' },
- ]}
- resettable
- />,
-]
-
-const TaskItemList = () => {
- 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.taskItem"}
- empty={false}
- filters={filters}
- sort={{ field: "create_time", order: "desc" }}
- actions={(
- <TopToolbar>
- <FilterButton />
- <MyCreateButton onClick={() => { setCreateDialog(true) }} />
- <SelectColumnsButton preferenceKey='taskItem' />
- {/* <MyExportButton /> */}
- </TopToolbar>
- )}
- perPage={DEFAULT_PAGE_SIZE}
- >
- <StyledDatagrid
- preferenceKey='taskItem'
- // bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />}
- rowClick={(id, resource, record) => false}
- // expand={() => <TaskItemPanel />}
- expandSingle={true}
- omit={['id', 'createTime', 'createBy', 'memo', 'taskId', 'orderId', 'orderItemId', 'matnrId']}
- >
- <NumberField source="id" />
- <NumberField source="taskId" label="table.field.taskItem.taskId" />
- <NumberField source="orderId" label="table.field.taskItem.orderId" />
- <NumberField source="orderType$" label="table.field.taskItem.orderType" />
- <NumberField source="orderItemId" label="table.field.taskItem.orderItemId" />
- <NumberField source="matnrId" label="table.field.taskItem.matnrId" />
- <TextField source="maktx" label="table.field.taskItem.maktx" />
- <TextField source="matnrCode" label="table.field.taskItem.matnrCode" />
- <TextField source="unit" label="table.field.taskItem.unit" />
- <NumberField source="anfme" label="table.field.taskItem.anfme" />
- <TextField source="batch" label="table.field.taskItem.batch" />
- <TextField source="spec" label="table.field.taskItem.spec" />
- <TextField source="model" label="table.field.taskItem.model" />
- <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} />
- </StyledDatagrid>
- </List>
- <TaskItemCreate
- open={createDialog}
- setOpen={setCreateDialog} />
- <PageDrawer
- title='TaskItem Detail'
- drawerVal={drawerVal}
- setDrawerVal={setDrawerVal}
- >
- </PageDrawer>
- </Box>
- )
-}
-
-export default TaskItemList;
diff --git a/rsf-admin/src/page/taskItem/TaskItemPanel.jsx b/rsf-admin/src/page/taskItem/TaskItemPanel.jsx
deleted file mode 100644
index 9bc1f7a..0000000
--- a/rsf-admin/src/page/taskItem/TaskItemPanel.jsx
+++ /dev/null
@@ -1,123 +0,0 @@
-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 TaskItemPanel = () => {
- 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.taskItem.id'))}: {record.id}
- </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.taskItem.taskId"
- property={record.taskId}
- />
- </Grid>
- <Grid item xs={6}>
- <PanelTypography
- title="table.field.taskItem.orderId"
- property={record.orderId}
- />
- </Grid>
- <Grid item xs={6}>
- <PanelTypography
- title="table.field.taskItem.orderType"
- property={record.orderType}
- />
- </Grid>
- <Grid item xs={6}>
- <PanelTypography
- title="table.field.taskItem.orderItemId"
- property={record.orderItemId}
- />
- </Grid>
- <Grid item xs={6}>
- <PanelTypography
- title="table.field.taskItem.matnrId"
- property={record.matnrId}
- />
- </Grid>
- <Grid item xs={6}>
- <PanelTypography
- title="table.field.taskItem.maktx"
- property={record.maktx}
- />
- </Grid>
- <Grid item xs={6}>
- <PanelTypography
- title="table.field.taskItem.matnrCode"
- property={record.matnrCode}
- />
- </Grid>
- <Grid item xs={6}>
- <PanelTypography
- title="table.field.taskItem.unit"
- property={record.unit}
- />
- </Grid>
- <Grid item xs={6}>
- <PanelTypography
- title="table.field.taskItem.anfme"
- property={record.anfme}
- />
- </Grid>
- <Grid item xs={6}>
- <PanelTypography
- title="table.field.taskItem.batch"
- property={record.batch}
- />
- </Grid>
- <Grid item xs={6}>
- <PanelTypography
- title="table.field.taskItem.spec"
- property={record.spec}
- />
- </Grid>
- <Grid item xs={6}>
- <PanelTypography
- title="table.field.taskItem.model"
- property={record.model}
- />
- </Grid>
-
- </Grid>
- </CardContent>
- </Card >
- </>
- );
-};
-
-export default TaskItemPanel;
diff --git a/rsf-admin/src/page/taskItem/index.jsx b/rsf-admin/src/page/taskItem/index.jsx
deleted file mode 100644
index da6cff0..0000000
--- a/rsf-admin/src/page/taskItem/index.jsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import React, { useState, useRef, useEffect, useMemo } from "react";
-import {
- ListGuesser,
- EditGuesser,
- ShowGuesser,
-} from "react-admin";
-
-import TaskItemList from "./TaskItemList";
-import TaskItemEdit from "./TaskItemEdit";
-
-export default {
- list: TaskItemList,
- edit: TaskItemEdit,
- show: ShowGuesser,
- recordRepresentation: (record) => {
- return `${record.id}`
- }
-};
diff --git a/rsf-admin/src/page/taskLog/TaskLogEdit.jsx b/rsf-admin/src/page/taskLog/TaskLogEdit.jsx
index ec5c658..6c366fc 100644
--- a/rsf-admin/src/page/taskLog/TaskLogEdit.jsx
+++ b/rsf-admin/src/page/taskLog/TaskLogEdit.jsx
@@ -2,187 +2,122 @@
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 { useWatch, useFormContext, useForm } from "react-hook-form";
+import { Stack, Grid, Box, Typography, Card } 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";
+import TaskItemLogList from "./TaskItemLogList";
const FormToolbar = () => {
const { getValues } = useFormContext();
-
return (
- <Toolbar sx={{ justifyContent: 'space-between' }}>
+ <Toolbar sx={{ justifyContent: 'end' }}>
<SaveButton />
- <DeleteButton mutationMode="optimistic" />
+ {/* <DeleteButton mutationMode="optimistic" /> */}
</Toolbar>
)
}
-const TaskLogEdit = () => {
+const TaskItemLog = () => {
const translate = useTranslate();
-
return (
- <Edit
- redirect="list"
- mutationMode={EDIT_MODE}
- actions={<CustomerTopToolBar />}
- aside={<EditBaseAside />}
- >
- <SimpleForm
- shouldUnregister
- warnWhenUnsavedChanges
- toolbar={<FormToolbar />}
- mode="onTouched"
- defaultValues={{}}
- // validate={(values) => { }}
+ <>
+ <Edit
+ redirect="list"
+ mutationMode={EDIT_MODE}
+ actions={<CustomerTopToolBar />}
+ aside={<EditBaseAside />}
>
- <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}>
- <NumberInput
- label="table.field.taskLog.taskId"
- source="taskId"
- autoFocus
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <TextInput
- label="table.field.taskLog.taskCode"
- source="taskCode"
- parse={v => v}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <NumberInput
- label="table.field.taskLog.taskStatus"
- source="taskStatus"
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <NumberInput
- label="table.field.taskLog.taskType"
- source="taskType"
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <TextInput
- label="table.field.taskLog.orgLoc"
- source="orgLoc"
- parse={v => v}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <TextInput
- label="table.field.taskLog.orgSite"
- source="orgSite"
- parse={v => v}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <TextInput
- label="table.field.taskLog.targLoc"
- source="targLoc"
- parse={v => v}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <TextInput
- label="table.field.taskLog.targSite"
- source="targSite"
- parse={v => v}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <TextInput
- label="table.field.taskLog.barcode"
- source="barcode"
- parse={v => v}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <TextInput
- label="table.field.taskLog.robotCode"
- source="robotCode"
- parse={v => v}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <NumberInput
- label="table.field.taskLog.exceStatus"
- source="exceStatus"
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <TextInput
- label="table.field.taskLog.expDesc"
- source="expDesc"
- parse={v => v}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <NumberInput
- label="table.field.taskLog.sort"
- source="sort"
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <TextInput
- label="table.field.taskLog.expCode"
- source="expCode"
- parse={v => v}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <DateInput
- label="table.field.taskLog.startTime"
- source="startTime"
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <DateInput
- label="table.field.taskLog.endTime"
- source="endTime"
- />
- </Stack>
-
+ <SimpleForm
+ shouldUnregister
+ warnWhenUnsavedChanges
+ toolbar={<FormToolbar />}
+ mode="onTouched"
+ defaultValues={{}}
+ >
+ <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}>
+ <Grid item xs={24} md={16}>
+ <Typography variant="h6" gutterBottom>
+ {translate('common.edit.title.main')}
+ </Typography>
+ <Stack direction='row' gap={2}>
+ <TextInput
+ label="table.field.task.taskCode"
+ source="taskCode"
+ readOnly
+ parse={v => v}
+ autoFocus
+ />
+ <TextInput
+ label="table.field.task.taskStatus"
+ readOnly
+ source="taskStatus$"
+ />
+ <TextInput
+ label="table.field.task.taskType"
+ source="taskType$"
+ readOnly
+ />
+ <TextInput
+ label="table.field.task.orgLoc"
+ source="orgLoc"
+ readOnly
+ parse={v => v}
+ />
+ <TextInput
+ label="table.field.task.targLoc"
+ source="targLoc"
+ readOnly
+ parse={v => v}
+ />
+ <TextInput
+ label="table.field.task.orgSite"
+ source="orgSite"
+ readOnly
+ parse={v => v}
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <TextInput
+ label="table.field.task.targSite"
+ source="targSite"
+ readOnly
+ parse={v => v}
+ />
+ <TextInput
+ label="table.field.task.barcode"
+ source="barcode"
+ readOnly
+ parse={v => v}
+ />
+ <NumberInput
+ label="table.field.task.sort"
+ readOnly
+ source="sort"
+ />
+ </Stack>
+ </Grid>
</Grid>
- <Grid item xs={12} md={4}>
- <Typography variant="h6" gutterBottom>
- {translate('common.edit.title.common')}
- </Typography>
- <StatusSelectInput />
- <Box mt="2em" />
- <MemoInput />
- </Grid>
+ </SimpleForm>
+ </Edit >
+ <Card sx={{ marginTop: '1em', }}>
+ <Grid item xs={24} md={16} sx={{ margin: '1em' }}>
+ <Typography variant="h6" gutterBottom >
+ {translate('common.edit.title.common')}
+ </Typography>
+ <TaskItemLogList />
</Grid>
- </SimpleForm>
- </Edit >
+ </Card>
+ </>
)
}
-export default TaskLogEdit;
+export default TaskItemLog;
diff --git a/rsf-admin/src/page/taskLog/TaskLogList.jsx b/rsf-admin/src/page/taskLog/TaskLogList.jsx
index 5ffad18..fd93f6e 100644
--- a/rsf-admin/src/page/taskLog/TaskLogList.jsx
+++ b/rsf-admin/src/page/taskLog/TaskLogList.jsx
@@ -54,7 +54,7 @@
'& .column-name': {
},
'& .opt': {
- width: 200
+ width: 250
},
}));
@@ -125,43 +125,31 @@
<StyledDatagrid
preferenceKey='taskLog'
bulkActionButtons={false}
- rowClick={(id, resource, record) => false}
- expand={() => <TaskLogPanel />}
+ rowClick={'edit'}
+ expand={false}
expandSingle={true}
omit={['id', 'createTime', 'createBy', 'memo', 'taskId', 'robotCode', 'exceStatus', 'sort', 'expCode']}
>
<NumberField source="id" />
- <NumberField source="taskId" label="table.field.taskLog.taskId" />
- <TextField source="taskCode" label="table.field.taskLog.taskCode" />
- <NumberField source="taskStatus" label="table.field.taskLog.taskStatus" />
- <NumberField source="taskType" label="table.field.taskLog.taskType" />
- <TextField source="orgLoc" label="table.field.taskLog.orgLoc" />
- <TextField source="orgSite" label="table.field.taskLog.orgSite" />
- <TextField source="targLoc" label="table.field.taskLog.targLoc" />
- <TextField source="targSite" label="table.field.taskLog.targSite" />
- <TextField source="barcode" label="table.field.taskLog.barcode" />
- <TextField source="robotCode" label="table.field.taskLog.robotCode" />
- <NumberField source="exceStatus" label="table.field.taskLog.exceStatus" />
- <TextField source="expDesc" label="table.field.taskLog.expDesc" />
- <NumberField source="sort" label="table.field.taskLog.sort" />
- <TextField source="expCode" label="table.field.taskLog.expCode" />
- <DateField source="startTime" label="table.field.taskLog.startTime" showTime />
- <DateField source="endTime" label="table.field.taskLog.endTime" showTime />
-
- <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}>
- <TextField source="nickname" />
- </ReferenceField>
+ <TextField source="taskCode" label="table.field.task.taskCode" />
+ <NumberField source="taskStatus$" label="table.field.task.taskStatus" />
+ <NumberField source="taskType$" label="table.field.task.taskType" />
+ <TextField source="orgLoc" label="table.field.task.orgLoc" />
+ <TextField source="orgSite" label="table.field.task.orgSite" />
+ <TextField source="targLoc" label="table.field.task.targLoc" />
+ <TextField source="targSite" label="table.field.task.targSite" />
+ <TextField source="barcode" label="table.field.task.barcode" />
+ <TextField source="robotCode" label="table.field.task.robotCode" />
+ <NumberField source="exceStatus" label="table.field.task.exceStatus" />
+ <TextField source="expDesc" label="table.field.task.expDesc" />
+ <NumberField source="sort" label="table.field.task.sort" />
+ <TextField source="expCode" label="table.field.task.expCode" />
+ <TextField source="updateBy$" label="common.field.updateBy" />
+ <TextField source="createBy$" label="common.field.createBy" />
<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} />
+ {/* <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>
{/* <TaskLogCreate
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/TaskLog.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/TaskLog.java
index 22db504..606c1b7 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/TaskLog.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/TaskLog.java
@@ -1,8 +1,12 @@
package com.vincent.rsf.server.manager.entity;
import java.text.SimpleDateFormat;
-import java.util.Date;
+import java.util.*;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.vincent.rsf.server.system.constant.DictTypeCode;
+import com.vincent.rsf.server.system.entity.DictData;
+import com.vincent.rsf.server.system.service.DictDataService;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.text.SimpleDateFormat;
@@ -230,6 +234,34 @@
// null // 澶囨敞
// );
+ public String getTaskStatus$(){
+ if (Cools.isEmpty(this.taskStatus)) {
+ return null;
+ }
+ DictDataService dictDataService = SpringUtils.getBean(DictDataService.class);
+ DictData dictDatas = dictDataService.getOne(new LambdaQueryWrapper<DictData>()
+ .eq(DictData::getDictTypeCode, DictTypeCode.DICT_SYS_TASK_STATUS)
+ .eq(DictData::getValue, this.taskStatus));
+ if (Objects.isNull(dictDatas) || Objects.isNull(dictDatas.getLabel())) {
+ return null;
+ }
+ return dictDatas.getLabel();
+ }
+
+ public String getTaskType$() {
+ if (Cools.isEmpty(this.taskType)) {
+ return null;
+ }
+ DictDataService dictDataService = SpringUtils.getBean(DictDataService.class);
+ DictData dictDatas = dictDataService.getOne(new LambdaQueryWrapper<DictData>()
+ .eq(DictData::getDictTypeCode, DictTypeCode.DICT_SYS_TASK_TYPE)
+ .eq(DictData::getValue, this.taskType));
+ if (Objects.isNull(dictDatas) || Objects.isNull(dictDatas.getLabel())) {
+ return null;
+ }
+ return dictDatas.getLabel();
+ }
+
public String getStartTime$(){
if (Cools.isEmpty(this.startTime)){
return "";
diff --git a/rsf-server/src/main/resources/application-dev.yml b/rsf-server/src/main/resources/application-dev.yml
index 2fa0bcc..93d6e25 100644
--- a/rsf-server/src/main/resources/application-dev.yml
+++ b/rsf-server/src/main/resources/application-dev.yml
@@ -12,10 +12,10 @@
matching-strategy: ANT_PATH_MATCHER
datasource:
driver-class-name: com.mysql.jdbc.Driver
- url: jdbc:mysql://47.76.147.249:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
-# username: root
-# url: jdbc:mysql://192.168.4.24:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
- username: rsf
+# url: jdbc:mysql://47.76.147.249:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
+ username: root
+ url: jdbc:mysql://192.168.4.24:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
+# username: rsf
password: 34821015
type: com.alibaba.druid.pool.DruidDataSource
druid:
--
Gitblit v1.9.1