| | |
| | | 'map.settings.sub.copy.count': 'Count', |
| | | 'map.settings.sub.copy.gap': 'Gap', |
| | | 'map.settings.sub.copy.id': 'ID', |
| | | 'map.settings.sub.copy.shelf.auto-increment-value': 'Increment Value', |
| | | 'map.settings.sub.copy.shelf.auto-increment': 'Auto Increment', |
| | | 'map.settings.sub.copy.shelf.increment-value': 'Increment Value', |
| | | 'map.settings.sub.copy.increment.mode': 'Increment Mode', |
| | | 'map.settings.sub.copy.ascend': 'Ascending', |
| | | 'map.settings.sub.copy.descend': 'Descending', |
| | |
| | | import React, { useState, useRef, useEffect } from 'react'; |
| | | import { Col, Form, Input, Row, Checkbox, Slider, Select, Drawer, Space, Button, InputNumber, Segmented } from 'antd'; |
| | | import { Col, Form, Input, Row, Switch, Slider, Select, Drawer, Space, Button, InputNumber, Segmented } from 'antd'; |
| | | import { FormattedMessage, useIntl, useModel } from '@umijs/max'; |
| | | import { createStyles } from 'antd-style'; |
| | | import * as Utils from '../utils' |
| | |
| | | if (curSprite && props) { |
| | | form.setFieldsValue({ |
| | | ...props.values, |
| | | copyGap: 0 |
| | | }); |
| | | } |
| | | }, [form, props]); |
| | |
| | | } |
| | | |
| | | const handleFinish = (values) => { |
| | | console.log(values); return |
| | | props.submit({ ...values, ...props.values }) |
| | | } |
| | | |
| | | const formValuesChange = () => { |
| | | |
| | | const formValuesChange = (value) => { |
| | | console.log(value); |
| | | } |
| | | |
| | | return ( |
| | |
| | | form={form} |
| | | onFieldsChange={formValuesChange} |
| | | initialValues={{ |
| | | copyGap: 0, |
| | | autoIncrement: false, |
| | | incrementValue: 'row', |
| | | incrementMode: 'Ascending', |
| | | }} |
| | | onFinish={handleFinish} |
| | | autoComplete="off" |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | |
| | | {curSprite?.data?.type === Utils.SENSOR_TYPE.AGV && ( |
| | | <Col span={24}> |
| | | <Form.Item |
| | | name='autoIncrement' |
| | | label={intl.formatMessage({ id: 'map.settings.sub.copy.shelf.auto-increment', defaultMessage: '自增长' })} |
| | | labelCol={{ span: 8 }} |
| | | > |
| | | <Switch /> |
| | | </Form.Item> |
| | | </Col> |
| | | |
| | | {form.getFieldValue('autoIncrement') === true && curSprite?.data?.type === Utils.SENSOR_TYPE.AGV && ( |
| | | <> |
| | | <Col span={24}> |
| | | <Form.Item |
| | |
| | | </> |
| | | )} |
| | | |
| | | {curSprite?.data?.type === Utils.SENSOR_TYPE.SHELF && ( |
| | | {form.getFieldValue('autoIncrement') === true && curSprite?.data?.type === Utils.SENSOR_TYPE.SHELF && ( |
| | | <> |
| | | <Col span={24}> |
| | | <Form.Item |
| | | label={intl.formatMessage({ id: 'map.settings.sub.copy.shelf.auto-increment-value', defaultMessage: '自增长值' })} |
| | | name='incrementValue' |
| | | label={intl.formatMessage({ id: 'map.settings.sub.copy.shelf.increment-value', defaultMessage: '自增长值' })} |
| | | labelCol={{ span: 8 }} |
| | | > |
| | | <Segmented |
| | |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item |
| | | name='incrementMode' |
| | | label={intl.formatMessage({ id: 'map.settings.sub.copy.increment.mode', defaultMessage: '增长方式' })} |
| | | labelCol={{ span: 8 }} |
| | | > |