| | |
| | | const { styles } = useStyles(); |
| | | const { curSprite } = props; |
| | | const [form] = Form.useForm(); |
| | | const [autoIncrement, setAutoIncrement] = useState(false); |
| | | |
| | | useEffect(() => { |
| | | form.resetFields(); |
| | |
| | | } |
| | | |
| | | const handleFinish = (values) => { |
| | | console.log(values); return |
| | | props.submit({ ...values, ...props.values }) |
| | | console.log({ |
| | | ...values |
| | | , ...props.values |
| | | , autoIncrement: autoIncrement |
| | | }); return |
| | | props.submit({ |
| | | ...values |
| | | , ...props.values |
| | | , autoIncrement: autoIncrement |
| | | }) |
| | | } |
| | | |
| | | const formValuesChange = (value) => { |
| | |
| | | </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 |
| | |
| | | </> |
| | | )} |
| | | |
| | | {form.getFieldValue('autoIncrement') === true && curSprite?.data?.type === Utils.SENSOR_TYPE.SHELF && ( |
| | | {autoIncrement && curSprite?.data?.type === Utils.SENSOR_TYPE.SHELF && ( |
| | | <> |
| | | <Col span={24}> |
| | | <Form.Item |