|
|
|
@ -17,15 +17,21 @@ export const NewProductsForm = ({ initialValues, onFormInstanceReady, ...props }
|
|
|
|
|
onFormInstanceReady(form);
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
const onValuesChange = (changeValues, allValues) => {};
|
|
|
|
|
const [pickType, setPickType] = useState({ value: "6"});
|
|
|
|
|
const onValuesChange = (changeValues, allValues) => {
|
|
|
|
|
if ('products_type' in changeValues) {
|
|
|
|
|
setPickType(changeValues.products_type);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Form layout='horizontal' form={form} name='new_product_in_modal' initialValues={initialValues} onValuesChange={onValuesChange}>
|
|
|
|
|
<Form.Item name={`products_type`} label={t('products:ProductType')} rules={[{ required: true }]} tooltip={t('FormTooltip.Type')}>
|
|
|
|
|
<ProductsTypesSelector maxTagCount={1} mode={null} placeholder={t('All')} />
|
|
|
|
|
<Form.Item name={`products_type`} label={t('products:ProductType')} rules={[{ required: true }]} tooltip={false}>
|
|
|
|
|
<ProductsTypesSelector maxTagCount={1} mode={null} placeholder={t('common:All')} />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item name={`title`} label={t('products:Title')} rules={[{ required: true }]} tooltip={t('FormTooltip.Title')}>
|
|
|
|
|
<Input />
|
|
|
|
|
<Form.Item name={`title`} label={t('products:Title')} rules={[{ required: true }]} tooltip={t(`FormTooltip.NewTitle.${pickType.value}`)} dependencies={['products_type']}>
|
|
|
|
|
{/* ${pickType.value} */}
|
|
|
|
|
<Input placeholder={t(`FormTooltip.NewTitle.${pickType.value}`)} />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Form>
|
|
|
|
|
);
|
|
|
|
@ -84,7 +90,7 @@ export const NewProductModal = ({ source, action = '#' | 'o', open, onSubmit, on
|
|
|
|
|
<Modal
|
|
|
|
|
width={600}
|
|
|
|
|
open={open}
|
|
|
|
|
title={`${t('New')}${t('products:#')}`}
|
|
|
|
|
title={`${t('common:New')}${t('products:#')}`}
|
|
|
|
|
okButtonProps={{
|
|
|
|
|
autoFocus: true,
|
|
|
|
|
}}
|
|
|
|
|