From c4c29d91cccfccf457594b87d09c0181f8810ba2 Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期一, 25 三月 2024 11:18:36 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/Four-Way-Rack' into Four-Way-Rack

---
 zy-asrs-flow/src/pages/map/batch/modify.jsx |  223 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 223 insertions(+), 0 deletions(-)

diff --git a/zy-asrs-flow/src/pages/map/batch/modify.jsx b/zy-asrs-flow/src/pages/map/batch/modify.jsx
new file mode 100644
index 0000000..5b0347f
--- /dev/null
+++ b/zy-asrs-flow/src/pages/map/batch/modify.jsx
@@ -0,0 +1,223 @@
+import React, { useState, useRef, useEffect } from 'react';
+import { Drawer, Space, Button, Card, Select, InputNumber, Input, Result, Form } from 'antd';
+import {
+    ProForm,
+    StepsForm,
+} from '@ant-design/pro-components';
+import { FormattedMessage, useIntl, useModel } from '@umijs/max';
+import { createStyles } from 'antd-style';
+import * as Utils from '../utils'
+import ShowJson from '../drawer/showJson';
+
+const waitTime = (time = 100) => {
+    return new Promise((resolve) => {
+        setTimeout(() => {
+            resolve(true);
+        }, time);
+    });
+};
+
+const useStyles = createStyles(({ token, css }) => {
+    return {
+    }
+})
+
+const BatchModify = (props) => {
+    const intl = useIntl();
+    const { styles } = useStyles();
+    const { batchSprites } = props;
+
+    const [form] = Form.useForm();
+    const [currentStep, setCurrentStep] = useState(0);
+
+    const resetForm = () => {
+        form.resetFields();
+        setCurrentStep(0);
+    };
+
+    useEffect(() => {
+        console.log(batchSprites);
+        resetForm();
+    }, [props]);
+
+    useEffect(() => {
+        console.log(currentStep);
+    }, [currentStep]);
+
+    return (
+        <>
+            <StepsForm
+                form={form}
+                current={currentStep}
+                onCurrentChange={setCurrentStep}
+                onFinish={async () => {
+                    await waitTime(1000);
+                    message.success('鎻愪氦鎴愬姛');
+                }}
+                formProps={{
+                    variant: 'filled',
+                    layout: 'horizontal',
+                    labelCol: {
+                        span: 4,
+                    },
+                    wrapperCol: {
+                        span: 20,
+                    },
+                    labelWrap: true
+                }}
+                submitter={{
+                    render: (props, dom) => {
+                        return props.step === 2 ? [] : dom;
+                    },
+                }}
+            >
+                {/************************* first ****************************/}
+                <StepsForm.StepForm
+                    name="base"
+                    title={intl.formatMessage({ id: 'map.settings.batch.select.shelf', defaultMessage: '閫夋嫨璐ф灦' })}
+                    onFinish={() => {
+                        return true;
+                    }}
+                >
+                    <ProForm.Item
+                    >
+                        <ShowJson
+                            data={
+                                batchSprites?.filter(item => {
+                                    return item.data?.type === Utils.SENSOR_TYPE.SHELF
+                                }).map(item => {
+                                    return item.data?.no;
+                                })
+                            }
+                            height='500px'
+                            jsonType={0}
+                        />
+                    </ProForm.Item>
+                </StepsForm.StepForm>
+                {/************************* second ****************************/}
+                <StepsForm.StepForm
+                    name="checkbox"
+                    title={intl.formatMessage({ id: 'map.settings.batch.set.params', defaultMessage: '璁剧疆鍙傛暟' })}
+                    onFinish={(values) => {
+                        console.log(values);
+                        return true;
+                    }}
+                >
+                    <ProForm.Item
+                        name='shelfType'
+                        label={intl.formatMessage({ id: 'map.settings.shelf.type', defaultMessage: '绫诲瀷' })}
+                        rules={[
+                            {
+                                required: true,
+                            },
+                        ]}
+                    >
+                        <Select
+                            style={{ width: 120 }}
+                            options={[
+                                {
+                                    label: intl.formatMessage({ id: 'map.settings.shelf.store', defaultMessage: '搴撲綅' }),
+                                    value: 0
+                                },
+                                {
+                                    label: intl.formatMessage({ id: 'map.settings.shelf.track', defaultMessage: '杞ㄩ亾' }),
+                                    value: 3
+                                },
+                                {
+                                    label: intl.formatMessage({ id: 'map.settings.shelf.diable', defaultMessage: '绂佺敤' }),
+                                    value: 1
+                                },
+                            ]}
+                            defaultValue={0}
+                        />
+                    </ProForm.Item>
+                    <ProForm.Item
+                        label={intl.formatMessage({ id: 'map.settings.shelf.space', defaultMessage: '闂磋窛' })}
+                    >
+                        <Space.Compact>
+                            <ProForm.Item
+                                name='top'
+                                noStyle
+                            >
+                                <InputNumber
+                                    addonBefore={<Space.Compact><FormattedMessage id='map.settings.shelf.top' defaultMessage='涓�' /></Space.Compact>}
+                                    style={{
+                                        width: '50%',
+                                    }}
+                                />
+                            </ProForm.Item>
+                            <ProForm.Item
+                                name='bottom'
+                                noStyle
+                            >
+                                <InputNumber
+                                    addonBefore={<Space.Compact><FormattedMessage id='map.settings.shelf.bottom' defaultMessage='涓�' /></Space.Compact>}
+                                    style={{
+                                        width: '50%',
+                                    }}
+                                />
+                            </ProForm.Item>
+                        </Space.Compact>
+                    </ProForm.Item>
+                    <ProForm.Item
+                        label={' '}
+                    >
+                        <Space.Compact>
+                            <ProForm.Item
+                                name='left'
+                                noStyle
+                            >
+                                <InputNumber
+                                    addonBefore={<Space.Compact><FormattedMessage id='map.settings.shelf.left' defaultMessage='宸�' /></Space.Compact>}
+                                    style={{
+                                        width: '50%',
+                                    }}
+                                />
+                            </ProForm.Item>
+                            <ProForm.Item
+                                name='right'
+                                noStyle
+                            >
+                                <InputNumber
+                                    addonBefore={<Space.Compact><FormattedMessage id='map.settings.shelf.right' defaultMessage='鍙�' /></Space.Compact>}
+                                    style={{
+                                        width: '50%',
+                                    }}
+                                />
+                            </ProForm.Item>
+                        </Space.Compact>
+                    </ProForm.Item>
+                    <ProForm.Item
+                        name='value'
+                        label={intl.formatMessage({ id: 'map.settings.shelf.value', defaultMessage: '鍦板浘鍊�' })}
+                    >
+                        <Input
+                            style={{
+                                width: '50%',
+                            }}
+                        />
+                    </ProForm.Item>
+                </StepsForm.StepForm>
+                {/************************* third ****************************/}
+                <StepsForm.StepForm
+                    name="time"
+                    title={intl.formatMessage({ id: 'map.settings.batch.result', defaultMessage: '缁撴灉' })}
+                    submitter={false}
+                >
+                    <Result
+                        status="success"
+                        title={intl.formatMessage({ id: 'map.settings.batch.result.title', defaultMessage: '鎵归噺璁剧疆鎴愬姛' })}
+                        subTitle=""
+                        extra={[
+                            <Button type="primary" key="console" onClick={props.handleCancel}>
+                                <FormattedMessage id='common.confirm' defaultMessage='纭畾' />
+                            </Button>,
+                        ]}
+                    />
+                </StepsForm.StepForm>
+            </StepsForm >
+        </>
+    )
+}
+
+export default BatchModify;
\ No newline at end of file

--
Gitblit v1.9.1