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;
|