| | |
| | | const [autoIncrement, setAutoIncrement] = useState(false); |
| | | |
| | | useEffect(() => { |
| | | setAutoIncrement(false); |
| | | form.resetFields(); |
| | | if (curSprite && props) { |
| | | form.setFieldsValue({ |
| | |
| | | } |
| | | |
| | | const handleFinish = (values) => { |
| | | console.log({ |
| | | ...values |
| | | , ...props.values |
| | | , autoIncrement: autoIncrement |
| | | }); return |
| | | props.submit({ |
| | | ...values |
| | | , ...props.values |
| | | , autoIncrement: autoIncrement |
| | | , type: curSprite?.data?.type |
| | | }) |
| | | } |
| | | |
| | | const formValuesChange = (value) => { |
| | | console.log(value); |
| | | } |
| | | |
| | | return ( |
| | |
| | | > |
| | | <Form |
| | | form={form} |
| | | onFieldsChange={formValuesChange} |
| | | initialValues={{ |
| | | copyGap: 0, |
| | | autoIncrement: false, |
| | |
| | | options={[ |
| | | { |
| | | label: intl.formatMessage({ id: 'map.settings.sub.copy.ascend', defaultMessage: '升序' }), |
| | | value: 'Ascending' |
| | | value: 'ascending' |
| | | }, |
| | | { |
| | | label: intl.formatMessage({ id: 'map.settings.sub.copy.descend', defaultMessage: '降序' }), |
| | | value: 'Descending' |
| | | value: 'descending' |
| | | }, |
| | | ]} |
| | | onChange={(value) => { |
| | |
| | | setLastCopiedSprites([]); |
| | | for (let i = 0; i < values.copyCount; i++) { |
| | | const copiedSprite = Utils.copySprite(curSprite); |
| | | // auto-increment-value |
| | | if (values.autoIncrement && values.type) { |
| | | switch (values.type) { |
| | | case Utils.SENSOR_TYPE.SHELF: |
| | | console.log(values); |
| | | break; |
| | | case Utils.SENSOR_TYPE.AGV: |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | // graph copy |
| | | switch (values.copyDire) { |
| | | case 'left': |
| | | copiedSprite.position.x -= (i + 1) * (values.copyGap + copiedSprite.width); |
| | |
| | | </Form.Item> |
| | | <Form.Item> |
| | | <Button |
| | | type="link" |
| | | type="link" |
| | | onClick={() => { |
| | | if (lastCopiedSprites) { |
| | | lastCopiedSprites.forEach(copiedSprite => { |
| | |
| | | |
| | | export async function getRoutersInfo() { |
| | | return getRouters().then((res) => { |
| | | console.log(res); |
| | | if (res.code === 200) { |
| | | // return res.data; |
| | | const routersInfo = convertCompatRouters(res.data); |