perf: 产品管理: form tooltip: new Product

perf/export-docx
Lei OT 11 months ago
parent d8cf4da101
commit ef8cda5002

@ -48,7 +48,7 @@
"OpenHours": "Open Hours", "OpenHours": "Open Hours",
"Duration": "Duration", "Duration": "Duration",
"KM": "KM", "KM": "KM",
"RecommendsRate": "RecommendsRate", "RecommendsRate": "Recommends Rate",
"OpenWeekdays": "Open Weekdays", "OpenWeekdays": "Open Weekdays",
"DisplayToC": "Display To C", "DisplayToC": "Display To C",
"Dept": "Dept", "Dept": "Dept",
@ -120,16 +120,59 @@
"Type": "Product Type", "Type": "Product Type",
"Title": "Title", "Title": "Title",
"Code": "Code", "Code": "Code",
"City": "City", "City": "起始城市,举例:北京",
"Dept": "Department", "Dept": "Department",
"Duration": "Duration", "Duration": "",
"RecommendsRate": "RecommendsRate", "RecommendsRate": "Recommends Rate",
"OpenHours": "Open Hours", "OpenHours": "Open Hours",
"OpenWeekdays": "Open Weekdays", "OpenWeekdays": "Open Weekdays",
"DisplayToC": "Display Type", "DisplayToC": "Display Type",
"KM": "KM", "KM": "往返",
"Description": "Description", "Description": "Description",
"Remarks": "Memo" "Remarks": "",
"NewTitle": {
"6": "",
"B": "A点-B点举例桂林-龙胜",
"J": "A点-B点时长车费举例张家界5晚6天车费",
"Q": "城市语种导游工资单位,举例:北京英文导游工资(元/天/团)",
"7": "官方景点名称,举例:陕西历史博物馆",
"R": "普通、豪华、特色餐标,举例:普通餐标",
"8": "举例:故宫导游门票",
"D": "城市A点-B点时间包含内容举例北京市区一日游车导"
},
"----Todo: 下面一组待定": "#",
"6": {
"Title": "",
"#": ""
},
"B": {
"Title": "A点-B点举例桂林-龙胜",
"#": ""
},
"J": {
"Title": "A点-B点时长车费举例张家界5晚6天车费",
"#": ""
},
"Q": {
"Title": "城市语种导游工资单位,举例:北京英文导游工资(元/天/团)",
"#": ""
},
"7": {
"Title": "官方景点名称,举例:陕西历史博物馆",
"#": ""
},
"R": {
"Title": "普通、豪华、特色餐标,举例:普通餐标",
"#": ""
},
"8": {
"Title": "举例:故宫导游门票",
"#": ""
},
"D": {
"Title": "城市A点-B点时间包含内容举例北京市区一日游车导",
"#": ""
}
}, },
"LgcModal": { "LgcModal": {

@ -104,20 +104,31 @@
"Weekdays": "周末", "Weekdays": "周末",
"Operation": "Operation" "Operation": "Operation"
}, },
"FormTooltop": {
"FormTooltip": {
"Type": "Product Type", "Type": "Product Type",
"Title": "Title", "Title": "Title",
"Code": "Code", "Code": "Code",
"City": "City", "City": "起始城市,举例:北京",
"dept": "Department", "Dept": "Department",
"Duration": "Duration", "Duration": "",
"RecommendsRate": "RecommendsRate", "RecommendsRate": "Recommends Rate",
"OpenHours": "Open Hours", "OpenHours": "Open Hours",
"OpenWeekdays": "Open Weekdays", "OpenWeekdays": "Open Weekdays",
"DisplayToC": "Display Type", "DisplayToC": "Display Type",
"KM": "KM", "KM": "往返",
"Description": "Description", "Description": "Description",
"Remarks": "Remarks" "Remarks": "",
"NewTitle": {
"6": "",
"B": "A点-B点举例桂林-龙胜",
"J": "A点-B点时长车费举例张家界5晚6天车费",
"Q": "城市语种导游工资单位,举例:北京英文导游工资(元/天/团)",
"7": "官方景点名称,举例:陕西历史博物馆",
"R": "普通、豪华、特色餐标,举例:普通餐标",
"8": "举例:故宫导游门票",
"D": "城市A点-B点时间包含内容举例北京市区一日游车导"
}
}, },
"LgcModal": { "LgcModal": {

@ -145,7 +145,7 @@ export const useNewProductRecord = () => {
'dept_id': 0, 'dept_id': 0,
'dept_name': '', 'dept_name': '',
'display_to_c': 0, 'display_to_c': 0,
'km': 0, 'km': undefined,
'city_id': 0, 'city_id': 0,
'city_name': '', 'city_name': '',
'open_hours': '', 'open_hours': '',

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

@ -25,10 +25,11 @@ const ProductInfoLgc = ({ editable, formInstance, ...props }) => {
forceRender: true, forceRender: true,
children: ( children: (
<Form.Item noStyle> <Form.Item noStyle>
<Form.Item name={['lgc_details_mapped', `${ele.lgc}`, 'title']} label={t('products:Title')} initialValue={ele.title} rules={[{ required: true }]} tooltip={t('FormTooltip.Title')}> <Form.Item name={['lgc_details_mapped', `${ele.lgc}`, 'title']} label={t('products:Title')} initialValue={ele.title} rules={[{ required: true }]} tooltip={t(`FormTooltip.NewTitle.${editingProduct?.info?.product_type_id}`)}>
<Input <Input
className={' !text-slate-600'} className={' !text-slate-600'}
allowClear allowClear
placeholder={t(`FormTooltip.NewTitle.${editingProduct?.info?.product_type_id}`)}
// onChange={(e) => handleChange('title', e.target.value)} // onChange={(e) => handleChange('title', e.target.value)}
// disabled={ignoreEditable ? false : (!isEmpty(ele.title) || !editable)} // disabled={ignoreEditable ? false : (!isEmpty(ele.title) || !editable)}
// disabled={ignoreEditable ? false : !editable} // disabled={ignoreEditable ? false : !editable}
@ -86,8 +87,8 @@ const ProductInfoLgc = ({ editable, formInstance, ...props }) => {
key: lgcItem.value, key: lgcItem.value,
children: ( children: (
<Form.Item noStyle> <Form.Item noStyle>
<Form.Item name={['lgc_details_mapped', `${lgcItem.value}`, 'title']} preserve={false} label={t('products:Title')} rules={[{ required: true }]} tooltip={t('FormTooltip.Title')}> <Form.Item name={['lgc_details_mapped', `${lgcItem.value}`, 'title']} preserve={false} label={t('products:Title')} rules={[{ required: true }]} tooltip={t(`FormTooltip.NewTitle.${editingProduct?.info?.product_type_id}`)}>
<Input allowClear /> <Input allowClear placeholder={t(`FormTooltip.NewTitle.${editingProduct?.info?.product_type_id}`)} />
</Form.Item> </Form.Item>
<Form.Item name={['lgc_details_mapped', `${lgcItem.value}`, 'description']} preserve={false} label={t('products:Description')} tooltip={t('FormTooltip.Description')}> <Form.Item name={['lgc_details_mapped', `${lgcItem.value}`, 'description']} preserve={false} label={t('products:Description')} tooltip={t('FormTooltip.Description')}>
<Input.TextArea rows={3} allowClear /> <Input.TextArea rows={3} allowClear />

Loading…
Cancel
Save