From a4093814b51bba7eae9530cfa076f6242df3f5f8 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期一, 17 二月 2025 14:59:43 +0800
Subject: [PATCH] #移库任务
---
zy-asrs-flow/src/pages/map/components/configSettings.jsx | 287 ++++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 254 insertions(+), 33 deletions(-)
diff --git a/zy-asrs-flow/src/pages/map/components/configSettings.jsx b/zy-asrs-flow/src/pages/map/components/configSettings.jsx
index 01697ee..46d132c 100644
--- a/zy-asrs-flow/src/pages/map/components/configSettings.jsx
+++ b/zy-asrs-flow/src/pages/map/components/configSettings.jsx
@@ -3,7 +3,6 @@
import { FormattedMessage, useIntl, useModel } from '@umijs/max';
import { createStyles } from 'antd-style';
import * as Utils from '../utils'
-import * as PIXI from 'pixi.js';
const useStyles = createStyles(({ token, css }) => {
@@ -14,16 +13,18 @@
const { styles } = useStyles();
const { curSprite, configForm: form } = props;
+ const [showLiftNoItem, setShowLiftNoItem] = React.useState(false);
+ const [showConveyorNoItem, setShowConveyorNoItem] = React.useState(false);
+
useEffect(() => {
form.resetFields();
if (curSprite) {
form.setFieldsValue({
-
- // shelf
- row: curSprite?.data?.row,
- bay: curSprite?.data?.bay,
- no: curSprite?.data?.no,
+ shelfType: Utils.SHELF_TYPE.STORE,
+ ...curSprite.data
})
+ setShowLiftNoItem(form.getFieldValue('shelfType') === Utils.SHELF_TYPE.LIFT);
+ setShowConveyorNoItem(form.getFieldValue('shelfType') === Utils.SHELF_TYPE.CONVEYOR);
}
}, [props, form]);
@@ -81,6 +82,11 @@
});
}
break;
+ case 'shelfType':
+ const shelfType = form.getFieldValue('shelfType');
+ setShowLiftNoItem(shelfType === Utils.SHELF_TYPE.LIFT);
+ setShowConveyorNoItem(shelfType === Utils.SHELF_TYPE.CONVEYOR);
+ break;
default:
break;
}
@@ -98,27 +104,13 @@
// execute where the form was finished
const confirmSettings = () => {
if (curSprite && curSprite?.data?.type) {
- switch (curSprite.data.type) {
- case Utils.SENSOR_TYPE.SHELF:
- curSprite.data.no = values.no; // *
- curSprite.data.row = values.row;
- curSprite.data.bay = values.bay;
- break;
- case Utils.SENSOR_TYPE.POINT:
- curSprite.data.no = values.no; // *
- curSprite.data.horizontal = values.horizontal;
- curSprite.data.vertical = values.vertical;
- break;
- case Utils.SENSOR_TYPE.AGV:
- curSprite.data.no = values.no; // *
- break;
- default:
- break;
- }
+ curSprite.data = { ...curSprite.data, ...values };
+ Utils.showSheflType(curSprite);
}
message.success(intl.formatMessage({ id: 'common.success', defaultMessage: '鎿嶄綔鎴愬姛' }));
}
+ console.log(values);
props.onSubmit({ ...values }, confirmSettings);
}
@@ -141,10 +133,10 @@
disabled={false}
layout='horizontal'
labelCol={{
- span: 4,
+ span: 5,
}}
wrapperCol={{
- span: 20,
+ span: 19,
}}
>
<br />
@@ -155,7 +147,7 @@
<span>{curSprite?.data?.type}</span>
</Form.Item>
<Form.Item
- label={intl.formatMessage({ id: 'map.settings.uuid', defaultMessage: '鍦板浘鍙�' })}
+ label={intl.formatMessage({ id: 'map.settings.uuid', defaultMessage: '鍥惧彿' })}
>
<span>{curSprite?.data?.uuid}</span>
</Form.Item>
@@ -166,29 +158,258 @@
</>
)}
+ {curSprite?.data?.type === Utils.SENSOR_TYPE.SHUTTLE && (
+ <>
+
+ </>
+ )}
+
{curSprite?.data?.type === Utils.SENSOR_TYPE.SHELF && (
<>
<Form.Item
- name='row'
- label={intl.formatMessage({ id: 'map.settings.shelf.row', defaultMessage: '鎺�' })}
+ label={intl.formatMessage({ id: 'map.settings.shelf.location', defaultMessage: '搴撲綅' })}
+ >
+ <Space.Compact>
+ <Form.Item
+ name='row'
+ noStyle
+ rules={[
+ {
+ required: false,
+ },
+ ]}
+ >
+ <InputNumber
+ addonBefore={<Space.Compact><FormattedMessage id='map.settings.shelf.row' defaultMessage='鎺�' /></Space.Compact>}
+ style={{
+ width: '50%',
+ }}
+ />
+ </Form.Item>
+ <Form.Item
+ name='bay'
+ noStyle
+ rules={[
+ {
+ required: false,
+ },
+ ]}
+ >
+ <InputNumber
+ addonBefore={<Space.Compact><FormattedMessage id='map.settings.shelf.bay' defaultMessage='鍒�' /></Space.Compact>}
+ style={{
+ width: '50%',
+ }}
+ />
+ </Form.Item>
+ </Space.Compact>
+ </Form.Item>
+ <Form.Item
+ name='shelfType'
+ label={intl.formatMessage({ id: 'map.settings.shelf.type', defaultMessage: '绫诲瀷' })}
rules={[
{
- required: false,
+ required: true,
},
]}
>
- <InputNumber
+ <Select
+ style={{ width: 120 }}
+ options={[
+ {
+ label: intl.formatMessage({ id: 'map.settings.shelf.store', defaultMessage: '搴撲綅' }),
+ value: Utils.SHELF_TYPE.STORE
+ },
+ {
+ label: intl.formatMessage({ id: 'map.settings.shelf.track', defaultMessage: '杞ㄩ亾' }),
+ value: Utils.SHELF_TYPE.TRACK
+ },
+ {
+ label: intl.formatMessage({ id: 'map.settings.shelf.lift', defaultMessage: '鎻愬崌鏈�' }),
+ value: Utils.SHELF_TYPE.LIFT
+ },
+ {
+ label: intl.formatMessage({ id: 'map.settings.shelf.charge', defaultMessage: '鍏呯數绔�' }),
+ value: Utils.SHELF_TYPE.CHARGE
+ },
+ {
+ label: intl.formatMessage({ id: 'map.settings.shelf.conveyor', defaultMessage: '杈撻�佺嚎' }),
+ value: Utils.SHELF_TYPE.CONVEYOR
+ },
+ {
+ label: intl.formatMessage({ id: 'map.settings.shelf.diable', defaultMessage: '绂佺敤' }),
+ value: Utils.SHELF_TYPE.DISABLE
+ },
+ ]}
+ />
+ </Form.Item>
+
+ {showLiftNoItem && (
+ <>
+ <Form.Item
+ name='liftNo'
+ label={intl.formatMessage({ id: 'map.settings.lift.no', defaultMessage: '鎻愬崌鏈虹紪鍙�' })}
+ rules={[
+ {
+ required: true,
+ },
+ ]}
+ >
+ <InputNumber
+ style={{
+ width: '50%',
+ }}
+ />
+ </Form.Item>
+ </>
+ )}
+
+ {showConveyorNoItem && (
+ <>
+ <Form.Item
+ name='conveyorNo'
+ label={intl.formatMessage({ id: 'map.settings.conveyor.no', defaultMessage: '杈撻�佺珯鍙�' })}
+ rules={[
+ {
+ required: true,
+ },
+ ]}
+ >
+ <InputNumber
+ style={{
+ width: '50%',
+ }}
+ />
+ </Form.Item>
+ <Form.Item
+ name='conveyorHasGo'
+ label={intl.formatMessage({ id: 'map.settings.conveyor.hasGo', defaultMessage: '灏忚溅鍙蛋' })}
+ valuePropName="checked"
+ >
+ <Checkbox
+ style={{
+ width: '50%',
+ }}
+ />
+ </Form.Item>
+ </>
+ )}
+
+ <Form.Item
+ label={intl.formatMessage({ id: 'map.settings.shelf.space', defaultMessage: '闂磋窛' })}
+ >
+ <Space.Compact>
+ <Form.Item
+ name='top'
+ noStyle
+ >
+ <InputNumber
+ addonBefore={<Space.Compact><FormattedMessage id='map.settings.shelf.top' defaultMessage='涓�' /></Space.Compact>}
+ style={{
+ width: '50%',
+ }}
+ />
+ </Form.Item>
+ <Form.Item
+ name='bottom'
+ noStyle
+ >
+ <InputNumber
+ addonBefore={<Space.Compact><FormattedMessage id='map.settings.shelf.bottom' defaultMessage='涓�' /></Space.Compact>}
+ style={{
+ width: '50%',
+ }}
+ />
+ </Form.Item>
+ </Space.Compact>
+ </Form.Item>
+ <Form.Item
+ label={' '}
+ >
+ <Space.Compact>
+ <Form.Item
+ name='left'
+ noStyle
+ >
+ <InputNumber
+ addonBefore={<Space.Compact><FormattedMessage id='map.settings.shelf.left' defaultMessage='宸�' /></Space.Compact>}
+ style={{
+ width: '50%',
+ }}
+ />
+ </Form.Item>
+ <Form.Item
+ name='right'
+ noStyle
+ >
+ <InputNumber
+ addonBefore={<Space.Compact><FormattedMessage id='map.settings.shelf.right' defaultMessage='鍙�' /></Space.Compact>}
+ style={{
+ width: '50%',
+ }}
+ />
+ </Form.Item>
+ </Space.Compact>
+ </Form.Item>
+ <Form.Item
+ label={intl.formatMessage({ id: 'map.settings.shelf.reference', defaultMessage: '鍩哄噯鍊�' })}
+ >
+ <Space.Compact>
+ <Form.Item
+ name='refx'
+ noStyle
+ rules={[
+ {
+ required: false,
+ },
+ ]}
+ >
+ <InputNumber
+ addonBefore={<Space.Compact><FormattedMessage id='map.x' defaultMessage='x' /></Space.Compact>}
+ style={{
+ width: '50%',
+ }}
+ />
+ </Form.Item>
+ <Form.Item
+ name='refy'
+ noStyle
+ rules={[
+ {
+ required: false,
+ },
+ ]}
+ >
+ <InputNumber
+ addonBefore={<Space.Compact><FormattedMessage id='map.y' defaultMessage='y' /></Space.Compact>}
+ style={{
+ width: '50%',
+ }}
+ />
+ </Form.Item>
+ </Space.Compact>
+ </Form.Item>
+ <Form.Item
+ name='value'
+ label={intl.formatMessage({ id: 'map.settings.shelf.value', defaultMessage: '鍦板浘鍊�' })}
+ >
+ <Input
style={{
width: '50%',
}}
/>
</Form.Item>
+ </>
+ )}
+
+ {curSprite?.data?.type === Utils.SENSOR_TYPE.CONVEYOR && (
+ <>
<Form.Item
- name='bay'
- label={intl.formatMessage({ id: 'map.settings.shelf.bay', defaultMessage: '鍒�' })}
+ name='plcNo'
+ label={intl.formatMessage({ id: 'map.settings.conveyor.plc.no', defaultMessage: 'PLC缂栧彿' })}
rules={[
{
- required: false,
+ required: true,
},
]}
>
--
Gitblit v1.9.1