| | |
| | | VITE_BASE_IP=192.168.4.24 |
| | | # VITE_BASE_IP=47.76.147.249 |
| | | # VITE_BASE_IP=192.168.4.24 |
| | | VITE_BASE_IP=47.76.147.249 |
| | | VITE_BASE_PORT=8080 |
| | |
| | | "react-router": "^6.22.0", |
| | | "react-router-dom": "^6.26.1", |
| | | "react-syntax-highlighter": "^15.5.0", |
| | | "react-to-print": "^3.0.5", |
| | | "three": "^0.155.0", |
| | | "tweedle.js": "^2.1.0" |
| | | }, |
| | |
| | | react-syntax-highlighter: |
| | | specifier: ^15.5.0 |
| | | version: 15.6.1(react@18.3.1) |
| | | react-to-print: |
| | | specifier: ^3.0.5 |
| | | version: 3.0.5(react@18.3.1) |
| | | three: |
| | | specifier: ^0.155.0 |
| | | version: 0.155.0 |
| | |
| | | resolution: {integrity: sha512-OqJ2/vL7lEeV5zTJyG7kmARppUjiB9h9udl4qHQjjgEos66z00Ia0OckwYfRxCSFrW8RJIBnsBwQsHZbVPspqg==} |
| | | peerDependencies: |
| | | react: '>= 0.14.0' |
| | | |
| | | react-to-print@3.0.5: |
| | | resolution: {integrity: sha512-Z15MwMOzYCHWi26CZeFNwflAg7Nr8uWD6FTj+EkfIOjYyjr0MXGbI0c7rF4Fgrbj3XG9hFndb1ourxpPz2RAiA==} |
| | | peerDependencies: |
| | | react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ~19 |
| | | |
| | | react-transition-group@4.4.5: |
| | | resolution: {integrity: sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==} |
| | |
| | | react: 18.3.1 |
| | | refractor: 3.6.0 |
| | | |
| | | react-to-print@3.0.5(react@18.3.1): |
| | | dependencies: |
| | | react: 18.3.1 |
| | | |
| | | react-transition-group@4.4.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1): |
| | | dependencies: |
| | | '@babel/runtime': 7.26.9 |
| | |
| | | useCreateController, |
| | | useListContext, |
| | | useRefresh, |
| | | SelectArrayInput |
| | | } from 'react-admin'; |
| | | import { |
| | | Dialog, |
| | |
| | | TableCell, |
| | | Tooltip, |
| | | IconButton, |
| | | styled |
| | | styled, |
| | | |
| | | |
| | | |
| | | } from '@mui/material'; |
| | |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | |
| | | |
| | | |
| | | const InitModal = ({ open, setOpen }) => { |
| | | const refresh = useRefresh(); |
| | | const translate = useTranslate(); |
| | |
| | | const notify = useNotify(); |
| | | |
| | | const [formData, setFormData] = useState({ |
| | | "warehouseId": null, |
| | | "areaId": null, |
| | | "type": null, |
| | | 'status': null |
| | |
| | | |
| | | const reset = () => { |
| | | setFormData({ |
| | | "warehouseId": null, |
| | | "areaId": null, |
| | | "type": null, |
| | | "typeIds": null, |
| | | 'status': null |
| | | }) |
| | | } |
| | |
| | | ...prevData, |
| | | [name]: value |
| | | })); |
| | | refresh() |
| | | }; |
| | | |
| | | const removeEmptyKeys = (obj) => { |
| | |
| | | <Grid container spacing={2}> |
| | | <Grid item xs={4}> |
| | | <ReferenceInput |
| | | source="warehouseId" |
| | | reference="warehouse" |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.loc.warehouseId" |
| | | optionText="name" |
| | | onChange={(value) => handleChange(value, 'warehouseId')} |
| | | value={formData.warehouseId} |
| | | filterToQuery={(val) => ({ name: val })} |
| | | /> |
| | | </ReferenceInput> |
| | | |
| | | </Grid> |
| | | |
| | | <Grid item xs={4}> |
| | | <ReferenceInput |
| | | source="areaId" |
| | | reference="warehouseAreas" |
| | | filter={{ warehouseId: formData.warehouseId }} |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.loc.areaId" |
| | |
| | | </Grid> |
| | | |
| | | <Grid item xs={4}> |
| | | <DictionarySelect |
| | | {/* <DictionarySelect |
| | | label={translate("table.field.loc.type")} |
| | | name="type" |
| | | value={formData.type} |
| | | onChange={(e) => handleChange(e.target.value, 'type')} |
| | | size="small" |
| | | dictTypeCode="sys_loc_type" |
| | | /> |
| | | /> */} |
| | | <ReferenceArrayInput source="typeIds" reference="locType" > |
| | | <SelectArrayInput label="table.field.loc.type" onChange={(e) => handleChange(e.target.value, 'typeIds')} /> |
| | | </ReferenceArrayInput> |
| | | </Grid> |
| | | |
| | | <Grid item xs={4}> |
| | |
| | | useCreateController, |
| | | useListContext, |
| | | useRefresh, |
| | | SelectArrayInput |
| | | } from 'react-admin'; |
| | | import { |
| | | Dialog, |
| | |
| | | "startBay": undefined, |
| | | "startLev": undefined, |
| | | "startRow": undefined, |
| | | "type": "" |
| | | "type": "", |
| | | "typeIds": undefined, |
| | | }); |
| | | |
| | | const handleClose = (event, reason) => { |
| | |
| | | </Grid> |
| | | |
| | | <Grid item xs={4}> |
| | | <DictionarySelect |
| | | label={translate("table.field.loc.type")} |
| | | name="type" |
| | | value={formData.type} |
| | | onChange={(e) => handleChange(e.target.value, 'type')} |
| | | size="small" |
| | | validate={[required()]} |
| | | dictTypeCode="sys_loc_type" |
| | | /> |
| | | <ReferenceArrayInput source="typeIds" reference="locType" > |
| | | <SelectArrayInput label="table.field.loc.type" onChange={(e) => handleChange(e.target.value, 'typeIds')} /> |
| | | </ReferenceArrayInput> |
| | | </Grid> |
| | | |
| | | <Grid item xs={4}> |
| | |
| | | notify(error.message || 'common.response.fail', { type: 'error', messageArgs: { _: error.message } }); |
| | | }; |
| | | |
| | | const [warehouseId, setWrehouseId] = useState(); |
| | | |
| | | const warehouseChange = (val) => { |
| | | setWrehouseId(val) |
| | | } |
| | | |
| | | |
| | | return ( |
| | |
| | | label="table.field.loc.warehouseId" |
| | | optionText="name" |
| | | validate={[required()]} |
| | | onChange={warehouseChange} |
| | | filterToQuery={(val) => ({ name: val })} |
| | | /> |
| | | </ReferenceInput> |
| | |
| | | <ReferenceInput |
| | | source="areaId" |
| | | reference="warehouseAreas" |
| | | filter={{ warehouseId }} |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.loc.areaId" |
| | |
| | | const LocEdit = () => { |
| | | const translate = useTranslate(); |
| | | const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_loc_type')) || []; |
| | | const [warehouseId, setWrehouseId] = useState(); |
| | | |
| | | const warehouseChange = (val) => { |
| | | setWrehouseId(val) |
| | | } |
| | | |
| | | return ( |
| | | <Edit |
| | |
| | | label="table.field.loc.warehouseId" |
| | | optionText="name" |
| | | validate={[required()]} |
| | | onChange={warehouseChange} |
| | | filterToQuery={(val) => ({ name: val })} |
| | | /> |
| | | </ReferenceInput> |
| | |
| | | <ReferenceInput |
| | | source="areaId" |
| | | reference="warehouseAreas" |
| | | filter={{ warehouseId }} |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.loc.areaId" |
| | |
| | | import { DataGrid } from '@mui/x-data-grid'; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | |
| | | |
| | | |
| | | const InitModal = ({ open, setOpen }) => { |
| | | const refresh = useRefresh(); |
| | | const translate = useTranslate(); |
| | |
| | | TextField, |
| | | Box, |
| | | Button, |
| | | Paper, |
| | | TableContainer, |
| | | Table, |
| | | TableHead, |
| | | TableBody, |
| | | Radio, |
| | | RadioGroup, |
| | | FormControlLabel, |
| | | FormControl, |
| | | FormLabel, |
| | | TableRow, |
| | | TableCell, |
| | | Tooltip, |
| | |
| | | import { DataGrid } from '@mui/x-data-grid'; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | |
| | | |
| | | import { useReactToPrint } from "react-to-print"; |
| | | |
| | | const InitModal = ({ open, setOpen }) => { |
| | | const refresh = useRefresh(); |
| | | const translate = useTranslate(); |
| | | |
| | | |
| | | const notify = useNotify(); |
| | | |
| | | const contentRef = useRef(null); |
| | | const reactToPrintFn = useReactToPrint({ contentRef }); |
| | | |
| | | const handleClose = (event, reason) => { |
| | | if (reason !== "backdropClick") { |
| | |
| | | } |
| | | }; |
| | | |
| | | const [value, setValue] = useState('temp1'); |
| | | |
| | | const handleChange = (event) => { |
| | | setValue(event.target.value); |
| | | }; |
| | | |
| | | const handlePrint = () => { |
| | | // handleClose() |
| | | reactToPrintFn() |
| | | }; |
| | | |
| | | return ( |
| | | <Dialog open={open} maxWidth="sm" fullWidth> |
| | | <DialogCloseButton onClose={handleClose} /> |
| | | <DialogTitle>{translate('toolbar.print')}</DialogTitle> |
| | | <DialogContent sx={{ mt: 2 }}> |
| | | 1 |
| | | <DialogContent > |
| | | <FormControl > |
| | | <RadioGroup |
| | | row |
| | | aria-labelledby="demo-controlled-radio-buttons-group" |
| | | name="controlled-radio-buttons-group" |
| | | value={value} |
| | | onChange={handleChange} |
| | | size="small" |
| | | sx={{ justifyContent: 'center' }} |
| | | > |
| | | <FormControlLabel value="temp1" control={<Radio />} label="模板1" size="small" /> |
| | | </RadioGroup> |
| | | </FormControl> |
| | | |
| | | <Box> |
| | | <div ref={contentRef}>11</div> |
| | | </Box> |
| | | </DialogContent> |
| | | <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}> |
| | | <Box sx={{ width: '100%', display: 'flex', justifyContent: 'space-between' }}> |
| | | <Button onClick={handleClose} variant="contained" startIcon={<SaveIcon />}> |
| | | <Button onClick={handlePrint} variant="contained" startIcon={<SaveIcon />}> |
| | | {translate('toolbar.confirm')} |
| | | </Button> |
| | | </Box> |
| | |
| | | <AutocompleteInput |
| | | label="table.field.warehouseAreas.wareId" |
| | | optionText="name" |
| | | validate={[required()]} |
| | | filterToQuery={(val) => ({ name: val })} |
| | | /> |
| | | </ReferenceInput> |
| | |
| | | <AutocompleteInput |
| | | label="table.field.warehouseAreas.wareId" |
| | | optionText="name" |
| | | validate={[required()]} |
| | | filterToQuery={(val) => ({ name: val })} |
| | | /> |
| | | </ReferenceInput> |