From 4797b16426fe7d784b46bf93ddc360e7278c72f1 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 13 三月 2024 16:27:06 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/pages/map/components/mapCopySettings.jsx | 29 +++++++++++++++--------------
1 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/zy-asrs-flow/src/pages/map/components/mapCopySettings.jsx b/zy-asrs-flow/src/pages/map/components/mapCopySettings.jsx
index 1820264..f81fb2c 100644
--- a/zy-asrs-flow/src/pages/map/components/mapCopySettings.jsx
+++ b/zy-asrs-flow/src/pages/map/components/mapCopySettings.jsx
@@ -14,8 +14,10 @@
const { styles } = useStyles();
const { curSprite } = props;
const [form] = Form.useForm();
+ const [autoIncrement, setAutoIncrement] = useState(false);
useEffect(() => {
+ setAutoIncrement(false);
form.resetFields();
if (curSprite && props) {
form.setFieldsValue({
@@ -33,12 +35,12 @@
}
const handleFinish = (values) => {
- console.log(values); return
- props.submit({ ...values, ...props.values })
- }
-
- const formValuesChange = (value) => {
- console.log(value);
+ props.submit({
+ ...values
+ , ...props.values
+ , autoIncrement: autoIncrement
+ , type: curSprite?.data?.type
+ })
}
return (
@@ -64,12 +66,11 @@
>
<Form
form={form}
- onFieldsChange={formValuesChange}
initialValues={{
copyGap: 0,
autoIncrement: false,
incrementValue: 'row',
- incrementMode: 'Ascending',
+ incrementMode: 'ascending',
}}
onFinish={handleFinish}
autoComplete="off"
@@ -117,17 +118,17 @@
</Form.Item>
</Col>
+ {/* switch auto increment */}
<Col span={24}>
<Form.Item
- name='autoIncrement'
label={intl.formatMessage({ id: 'map.settings.sub.copy.shelf.auto-increment', defaultMessage: '鑷闀�' })}
labelCol={{ span: 8 }}
>
- <Switch />
+ <Switch value={autoIncrement} onChange={setAutoIncrement} />
</Form.Item>
</Col>
- {form.getFieldValue('autoIncrement') === true && curSprite?.data?.type === Utils.SENSOR_TYPE.AGV && (
+ {autoIncrement && curSprite?.data?.type === Utils.SENSOR_TYPE.AGV && (
<>
<Col span={24}>
<Form.Item
@@ -146,7 +147,7 @@
</>
)}
- {form.getFieldValue('autoIncrement') === true && curSprite?.data?.type === Utils.SENSOR_TYPE.SHELF && (
+ {autoIncrement && curSprite?.data?.type === Utils.SENSOR_TYPE.SHELF && (
<>
<Col span={24}>
<Form.Item
@@ -182,11 +183,11 @@
options={[
{
label: intl.formatMessage({ id: 'map.settings.sub.copy.ascend', defaultMessage: '鍗囧簭' }),
- value: 'Ascending'
+ value: 'ascending'
},
{
label: intl.formatMessage({ id: 'map.settings.sub.copy.descend', defaultMessage: '闄嶅簭' }),
- value: 'Descending'
+ value: 'descending'
},
]}
onChange={(value) => {
--
Gitblit v1.9.1