#
luxiaotao1123
2024-03-13 df0d6900ef9a3826ddd5ce8eaa9be36ff67eebf1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
import React, { useState, useRef, useEffect } from 'react';
import { Col, Form, Input, Row, Checkbox, Slider, Select, Drawer, Space, Button, InputNumber, Card } from 'antd';
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 }) => {
 
})
 
const ConfigSettings = (props) => {
    const intl = useIntl();
    const { styles } = useStyles();
    const { curSprite, configForm: form } = props;
 
    useEffect(() => {
    }, []);
 
    const formValuesChange = (changeList) => {
        if (curSprite && changeList && changeList.length > 0) {
            changeList.forEach(change => {
                const { name: nameList, value } = change;
                nameList.forEach(name => {
                    console.log(name, value);
                    switch (name) {
                        default:
                            break;
                    }
                    Utils.removeSelectedEffect();
                    Utils.showSelectedEffect(curSprite);
                })
            })
        }
    }
 
    const onFinishFailed = (errorInfo) => {
    };
 
    const handleFinish = async (values) => {
        console.log(values); return
        props.onSubmit({ ...values });
    }
 
    return (
        <>
            <Form
                form={form}
                onFieldsChange={formValuesChange}
                initialValues={{
                }}
                onFinish={handleFinish}
                onFinishFailed={onFinishFailed}
                autoComplete="off"
                style={{
                    maxWidth: 600,
                }}
                size='default'    // small | default | large
                variant='filled'    // outlined | borderless | filled
                labelWrap   // label 换行
                disabled={false}
                layout='horizontal'
            >
 
                <Row gutter={[24, 16]}>
 
                    <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.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>
        </>
    )
}
 
export default ConfigSettings;