From c6c11cb039799afa90089bfd9c6ad8dd99198a66 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 13 三月 2024 14:09:56 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/pages/map/components/configSettings.jsx | 167 ++++++++++++++++++++++++++++++++-----------------------
zy-asrs-flow/src/pages/map/utils.js | 8 ++
2 files changed, 104 insertions(+), 71 deletions(-)
diff --git a/zy-asrs-flow/src/pages/map/components/configSettings.jsx b/zy-asrs-flow/src/pages/map/components/configSettings.jsx
index 83f2b3a..14b35d4 100644
--- a/zy-asrs-flow/src/pages/map/components/configSettings.jsx
+++ b/zy-asrs-flow/src/pages/map/components/configSettings.jsx
@@ -22,8 +22,31 @@
changeList.forEach(change => {
const { name: nameList, value } = change;
nameList.forEach(name => {
- console.log(name, value);
switch (name) {
+ case 'row':
+ const bay = form.getFieldValue('bay')
+ if (value && bay) {
+ form.setFieldsValue({
+ shelfNo: Utils.pureNumStr(value) + '-' + Utils.pureNumStr(bay)
+ });
+ } else {
+ form.setFieldsValue({
+ shelfNo: ''
+ });
+ }
+ break;
+ case 'bay':
+ const row = form.getFieldValue('row')
+ if (value && row) {
+ form.setFieldsValue({
+ shelfNo: Utils.pureNumStr(row) + '-' + Utils.pureNumStr(value)
+ });
+ } else {
+ form.setFieldsValue({
+ shelfNo: ''
+ });
+ }
+ break;
default:
break;
}
@@ -38,7 +61,6 @@
};
const handleFinish = async (values) => {
- console.log(values); return
props.onSubmit({ ...values });
}
@@ -55,85 +77,88 @@
style={{
maxWidth: 600,
}}
- size='default' // small | default | large
+ size='defalargeult' // small | default | large
variant='filled' // outlined | borderless | filled
labelWrap // label 鎹㈣
disabled={false}
layout='horizontal'
+ labelCol={{
+ span: 4,
+ }}
+ wrapperCol={{
+ span: 14,
+ }}
>
- <Row gutter={[24, 16]}>
+ <Form.Item
+ label={intl.formatMessage({ id: 'map.settings.type', defaultMessage: '绫诲瀷' })}
+ >
+ <span>{curSprite?.data?.type}</span>
+ </Form.Item>
+ <Form.Item
+ label={intl.formatMessage({ id: 'map.settings.uuid', defaultMessage: '缂栧彿' })}
+ >
+ <span>{curSprite?.data?.uuid}</span>
+ </Form.Item>
- <Col span={24}>
- <Row gutter={24}>
- <Col span={12}>
- <Form.Item
- label={intl.formatMessage({ id: 'map.settings.type', defaultMessage: '绫诲瀷' })}
- labelCol={{ span: 6 }}
- >
- <span>{curSprite?.data?.type}</span>
- </Form.Item>
- </Col>
- <Col span={12}>
- <Form.Item
- label={intl.formatMessage({ id: 'map.settings.uuid', defaultMessage: '缂栧彿' })}
- labelCol={{ span: 6 }}
- >
- <span>{curSprite?.data?.uuid}</span>
- </Form.Item>
- </Col>
- </Row>
- </Col>
+ {curSprite?.data?.type === Utils.SENSOR_TYPE.AGV && (
+ <>
- {curSprite?.data?.type === Utils.SENSOR_TYPE.AGV && (
- <>
+ </>
+ )}
- </>
- )}
+ {curSprite?.data?.type === Utils.SENSOR_TYPE.SHELF && (
+ <>
+ <Form.Item
+ name='shelfNo'
+ label={intl.formatMessage({ id: 'map.settings.shelf.no', defaultMessage: '璐ф灦鍙�' })}
+ rules={[
+ {
+ required: true,
+ },
+ ]}
+ >
+ <Input
+ style={{
+ width: '50%',
+ }}
+ disabled
+ />
+ </Form.Item>
+ <Form.Item
+ name='row'
+ label={intl.formatMessage({ id: 'map.settings.shelf.row', defaultMessage: '鎺�' })}
+ rules={[
+ {
+ required: true,
+ },
+ ]}
+ >
+ <InputNumber
+ style={{
+ width: '50%',
+ }}
+ />
+ </Form.Item>
+ <Form.Item
+ name='bay'
+ label={intl.formatMessage({ id: 'map.settings.shelf.bay', defaultMessage: '鍒�' })}
+ rules={[
+ {
+ required: true,
+ },
+ ]}
+ >
+ <InputNumber
+ style={{
+ width: '50%',
+ }}
+ />
+ </Form.Item>
+ </>
+ )}
- {curSprite?.data?.type === Utils.SENSOR_TYPE.SHELF && (
- <>
- <Col span={24}>
- <Form.Item
- name='shelfNo'
- label={intl.formatMessage({ id: 'map.settings.shelf.no', defaultMessage: '璐ф灦鍙�' })}
- >
- <Input
- style={{
- width: '50%',
- }}
- />
- </Form.Item>
- </Col>
- <Col span={24}>
- <Form.Item
- name='row'
- label={intl.formatMessage({ id: 'map.settings.shelf.row', defaultMessage: '鎺�' })}
- >
- <InputNumber
- style={{
- width: '50%',
- }}
- />
- </Form.Item>
- </Col>
- <Col span={24}>
- <Form.Item
- name='bay'
- label={intl.formatMessage({ id: 'map.settings.shelf.bay', defaultMessage: '鍒�' })}
- >
- <InputNumber
- style={{
- width: '50%',
- }}
- />
- </Form.Item>
- </Col>
- </>
- )}
-
- </Row>
- </Form>
+ </Form >
</>
)
}
diff --git a/zy-asrs-flow/src/pages/map/utils.js b/zy-asrs-flow/src/pages/map/utils.js
index eb57314..a1ca052 100644
--- a/zy-asrs-flow/src/pages/map/utils.js
+++ b/zy-asrs-flow/src/pages/map/utils.js
@@ -240,4 +240,12 @@
export const deepCopy = (data) => {
return JSON.parse(JSON.stringify(data));
+}
+
+export const pureNumStr = (param) => {
+ if (param) {
+ return Number(param);
+ } else {
+ return '';
+ }
}
\ No newline at end of file
--
Gitblit v1.9.1