| | |
| | | const { curSprite } = props; |
| | | const [form] = Form.useForm(); |
| | | const [autoIncrement, setAutoIncrement] = useState(false); |
| | | const [autoIncrementError, setAutoIncrementError] = useState(null); |
| | | |
| | | useEffect(() => { |
| | | setAutoIncrement(false); |
| | |
| | | case Utils.SENSOR_TYPE.SHELF: |
| | | console.log(1); |
| | | if (!curSprite.data?.row || !curSprite.data?.bay) { |
| | | message.warning(intl.formatMessage({ id: 'map.settings.sub.copy.warn.config.shelf', defaultMessage: '请先设置货架参数!' })) |
| | | setAutoIncrementError(intl.formatMessage({ id: 'map.settings.sub.copy.warn.config.shelf', defaultMessage: '请先设置货架参数!' })); |
| | | } else { |
| | | setAutoIncrementError(null); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | } else { |
| | | setAutoIncrementError(null); |
| | | } |
| | | }, [autoIncrement]) |
| | | |
| | |
| | | <Form.Item |
| | | label={intl.formatMessage({ id: 'map.settings.sub.copy.shelf.auto-increment', defaultMessage: '自增长' })} |
| | | labelCol={{ span: 8 }} |
| | | help={autoIncrementError} |
| | | validateStatus={autoIncrementError ? "error" : null} |
| | | > |
| | | <Switch value={autoIncrement} onChange={setAutoIncrement} /> |
| | | </Form.Item> |