From f6a867094f9629de4357cdd571ff133ae06a77f6 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期一, 25 三月 2024 16:28:09 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/pages/map/batch/modify.jsx | 69 ++++++----------------------------
1 files changed, 12 insertions(+), 57 deletions(-)
diff --git a/zy-asrs-flow/src/pages/map/batch/modify.jsx b/zy-asrs-flow/src/pages/map/batch/modify.jsx
index d017796..e30a4cc 100644
--- a/zy-asrs-flow/src/pages/map/batch/modify.jsx
+++ b/zy-asrs-flow/src/pages/map/batch/modify.jsx
@@ -30,27 +30,13 @@
const [form] = Form.useForm();
const [currentStep, setCurrentStep] = useState(0);
- const [uuidsOfBatchSprites, setUuidsOfBatchSprites] = useState([]);
- const resetForm = () => {
+ useEffect(() => {
form.resetFields();
form.setFieldsValue({
shelfType: Utils.SHELF_TYPE.STORE
})
setCurrentStep(0);
- };
-
- useEffect(() => {
- resetForm();
- if (batchSprites?.length > 0) {
- setUuidsOfBatchSprites(batchSprites?.filter(item => {
- return item.data?.type === Utils.SENSOR_TYPE.SHELF
- }).map(item => {
- return item.data?.no;
- }));
- } else {
- setUuidsOfBatchSprites([]);
- }
}, [batchSprites]);
const handleOk = (values) => {
@@ -71,18 +57,9 @@
}
}
- useEffect(() => {
- if (currentStep === 1) {
- form.setFieldsValue({
- shelfType: Utils.SHELF_TYPE.STORE
- });
- }
- }, [currentStep]);
-
return (
<>
<StepsForm
- form={form}
current={currentStep}
onCurrentChange={setCurrentStep}
onFinish={async () => {
@@ -105,9 +82,6 @@
return props.step === 2 ? [] : dom;
},
}}
- initialValues={{
- shelfType: Utils.SHELF_TYPE.STORE
- }}
>
{/************************* first ****************************/}
<StepsForm.StepForm
@@ -119,7 +93,11 @@
>
<ProForm.Item>
<ShowJson
- data={uuidsOfBatchSprites}
+ data={batchSprites?.filter(item => {
+ return item.data?.type === Utils.SENSOR_TYPE.SHELF
+ }).map(item => {
+ return item.data?.no;
+ })}
height='500px'
jsonType={0}
/>
@@ -128,10 +106,11 @@
{/************************* second ****************************/}
<StepsForm.StepForm
name="checkbox"
+ form={form}
title={intl.formatMessage({ id: 'map.settings.batch.set.params', defaultMessage: '璁剧疆鍙傛暟' })}
onFinish={handleOk}
>
- {/* <ProForm.Item
+ <ProForm.Item
name='shelfType'
label={intl.formatMessage({ id: 'map.settings.shelf.type', defaultMessage: '绫诲瀷' })}
rules={[
@@ -145,44 +124,20 @@
options={[
{
label: intl.formatMessage({ id: 'map.settings.shelf.store', defaultMessage: '搴撲綅' }),
- value: 0
+ value: Utils.SHELF_TYPE.STORE
},
{
label: intl.formatMessage({ id: 'map.settings.shelf.track', defaultMessage: '杞ㄩ亾' }),
- value: 3
+ value: Utils.SHELF_TYPE.TRACK
},
{
label: intl.formatMessage({ id: 'map.settings.shelf.diable', defaultMessage: '绂佺敤' }),
- value: 1
+ value: Utils.SHELF_TYPE.DISABLE
},
]}
defaultValue={0}
/>
- </ProForm.Item> */}
- <ProFormSelect
- name='shelfType'
- label={intl.formatMessage({ id: 'map.settings.shelf.type', defaultMessage: '绫诲瀷' })}
- rules={[
- {
- required: true,
- },
- ]}
- 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.diable', defaultMessage: '绂佺敤' }),
- value: Utils.SHELF_TYPE.DISABLE
- },
- ]}
- />
+ </ProForm.Item>
<ProForm.Item
label={intl.formatMessage({ id: 'map.settings.shelf.space', defaultMessage: '闂磋窛' })}
>
--
Gitblit v1.9.1