| | |
| | | |
| | | const [form] = Form.useForm(); |
| | | const [currentStep, setCurrentStep] = useState(0); |
| | | const [uuidsOfBatchSprites, setUuidsOfBatchSprites] = useState([]); |
| | | |
| | | const resetForm = () => { |
| | | useEffect(() => { |
| | | form.resetFields(); |
| | | form.setFieldsValue({ |
| | | shelfType: Utils.SHELF_TYPE.STORE |
| | | }) |
| | | setCurrentStep(0); |
| | | }; |
| | | |
| | | useEffect(() => { |
| | | resetForm(); |
| | | if (batchSprites?.length > 0) { |
| | | setUuidsOfBatchSprites(batchSprites?.filter(item => { |
| | | return item.data?.type === Utils.SENSOR_TYPE.SHELF |
| | | }).map(item => { |
| | | return item.data?.no; |
| | | })); |
| | | } else { |
| | | setUuidsOfBatchSprites([]); |
| | | } |
| | | }, [batchSprites]); |
| | | |
| | | const handleOk = (values) => { |
| | |
| | | } |
| | | } |
| | | |
| | | useEffect(() => { |
| | | if (currentStep === 1) { |
| | | form.setFieldsValue({ |
| | | shelfType: Utils.SHELF_TYPE.STORE |
| | | }); |
| | | } |
| | | }, [currentStep]); |
| | | |
| | | return ( |
| | | <> |
| | | <StepsForm |
| | | form={form} |
| | | current={currentStep} |
| | | onCurrentChange={setCurrentStep} |
| | | onFinish={async () => { |
| | |
| | | return props.step === 2 ? [] : dom; |
| | | }, |
| | | }} |
| | | initialValues={{ |
| | | shelfType: Utils.SHELF_TYPE.STORE |
| | | }} |
| | | > |
| | | {/************************* first ****************************/} |
| | | <StepsForm.StepForm |
| | |
| | | > |
| | | <ProForm.Item> |
| | | <ShowJson |
| | | data={uuidsOfBatchSprites} |
| | | data={batchSprites?.filter(item => { |
| | | return item.data?.type === Utils.SENSOR_TYPE.SHELF |
| | | }).map(item => { |
| | | return item.data?.no; |
| | | })} |
| | | height='500px' |
| | | jsonType={0} |
| | | /> |
| | |
| | | {/************************* second ****************************/} |
| | | <StepsForm.StepForm |
| | | name="checkbox" |
| | | form={form} |
| | | title={intl.formatMessage({ id: 'map.settings.batch.set.params', defaultMessage: '设置参数' })} |
| | | onFinish={handleOk} |
| | | > |
| | | {/* <ProForm.Item |
| | | <ProForm.Item |
| | | name='shelfType' |
| | | label={intl.formatMessage({ id: 'map.settings.shelf.type', defaultMessage: '类型' })} |
| | | rules={[ |
| | |
| | | options={[ |
| | | { |
| | | label: intl.formatMessage({ id: 'map.settings.shelf.store', defaultMessage: '库位' }), |
| | | value: 0 |
| | | value: Utils.SHELF_TYPE.STORE |
| | | }, |
| | | { |
| | | label: intl.formatMessage({ id: 'map.settings.shelf.track', defaultMessage: '轨道' }), |
| | | value: 3 |
| | | value: Utils.SHELF_TYPE.TRACK |
| | | }, |
| | | { |
| | | label: intl.formatMessage({ id: 'map.settings.shelf.diable', defaultMessage: '禁用' }), |
| | | value: 1 |
| | | value: Utils.SHELF_TYPE.DISABLE |
| | | }, |
| | | ]} |
| | | defaultValue={0} |
| | | /> |
| | | </ProForm.Item> */} |
| | | <ProFormSelect |
| | | name='shelfType' |
| | | label={intl.formatMessage({ id: 'map.settings.shelf.type', defaultMessage: '类型' })} |
| | | rules={[ |
| | | { |
| | | required: true, |
| | | }, |
| | | ]} |
| | | style={{ width: 120 }} |
| | | options={[ |
| | | { |
| | | label: intl.formatMessage({ id: 'map.settings.shelf.store', defaultMessage: '库位' }), |
| | | value: Utils.SHELF_TYPE.STORE |
| | | }, |
| | | { |
| | | label: intl.formatMessage({ id: 'map.settings.shelf.track', defaultMessage: '轨道' }), |
| | | value: Utils.SHELF_TYPE.TRACK |
| | | }, |
| | | { |
| | | label: intl.formatMessage({ id: 'map.settings.shelf.diable', defaultMessage: '禁用' }), |
| | | value: Utils.SHELF_TYPE.DISABLE |
| | | }, |
| | | ]} |
| | | /> |
| | | </ProForm.Item> |
| | | <ProForm.Item |
| | | label={intl.formatMessage({ id: 'map.settings.shelf.space', defaultMessage: '间距' })} |
| | | > |