Merge branch 'main' of github.com:hainatravel/GHHub

perf/export-docx
Jimmy Liow 11 months ago
commit 9b0427bc00

@ -116,5 +116,26 @@
"Weekdays": "Weekdays"
},
"FormTooltip": {
"Type": "Product Type",
"Title": "Title",
"Code": "Code",
"City": "City",
"Dept": "Department",
"Duration": "Duration",
"RecommendsRate": "RecommendsRate",
"OpenHours": "Open Hours",
"OpenWeekdays": "Open Weekdays",
"DisplayToC": "Display Type",
"KM": "KM",
"Description": "Description",
"Remarks": "Remarks"
},
"LgcModal": {
"title": "Add language",
"placeholder": "Pick a language"
},
"#": "Product"
}

@ -104,5 +104,25 @@
"Weekdays": "周末",
"Operation": "Operation"
},
"FormTooltop": {
"Type": "Product Type",
"Title": "Title",
"Code": "Code",
"City": "City",
"dept": "Department",
"Duration": "Duration",
"RecommendsRate": "RecommendsRate",
"OpenHours": "Open Hours",
"OpenWeekdays": "Open Weekdays",
"DisplayToC": "Display Type",
"KM": "KM",
"Description": "Description",
"Remarks": "Remarks"
},
"LgcModal": {
"title": "添加语种",
"placeholder": "选择语种"
},
"#": "产品"
}

@ -166,7 +166,7 @@ export const useNewProductRecord = () => {
'id': '',
'adult_cost': 0,
'child_cost': 0,
'currency': 'CNY',
'currency': 'RMB',
'unit_id': '1',
'unit_name': '每团',
'group_size_min': 1,

@ -48,7 +48,7 @@ export const CopyProductsForm = ({ action, initialValues, onFormInstanceReady, s
{/* disabledDate={(current) => current <= dayjs([source.sourceYear, 12, 31])} */}
</Form.Item>
<Form.Item name={'with_quote'} label={`${t('products:CopyFormMsg.withQuote')}`}>
<Switch checkedChildren={t('Yes')} unCheckedChildren={t('No')} />
<Switch checkedChildren={'含报价金额'} unCheckedChildren={'仅人等+日期'} />
</Form.Item>
</Form>
);

@ -10,7 +10,7 @@ import { useDefaultLgc } from '@/i18n/LanguageSwitcher';
import dayjs from 'dayjs'
export const NewProductsForm = ({ initialValues, onFormInstanceReady, ...props }) => {
const { t } = useTranslation();
const { t } = useTranslation('products');
const [form] = Form.useForm();
useEffect(() => {
@ -21,10 +21,10 @@ export const NewProductsForm = ({ initialValues, onFormInstanceReady, ...props }
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 }]}>
<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>
<Form.Item name={`title`} label={t('products:Title')} rules={[{ required: true }]} >
<Form.Item name={`title`} label={t('products:Title')} rules={[{ required: true }]} tooltip={t('FormTooltip.Title')}>
<Input />
</Form.Item>
</Form>

@ -178,7 +178,7 @@ function getFields(props) {
item(
'title',
99,
<Form.Item name='title' label={t('Title')} {...fieldProps.title} rules={[{ required: true }]}>
<Form.Item name='title' label={t('Title')} {...fieldProps.title} rules={[{ required: true }]} tooltip={t('FormTooltip.Title')}>
<Input allowClear {...fieldComProps.title} {...styleProps} {...editableProps('title')} />
</Form.Item>,
fieldProps?.title?.col || midCol
@ -186,7 +186,7 @@ function getFields(props) {
item(
'code',
99,
<Form.Item name='code' label={t('Code')} {...fieldProps.code} rules={[{ required: true }]}>
<Form.Item name='code' label={t('Code')} {...fieldProps.code} rules={[{ required: true }]} tooltip={t('FormTooltip.Code')}>
<Input allowClear {...fieldComProps.code} {...styleProps} {...editableProps('code')} />
</Form.Item>,
fieldProps?.code?.col || midCol
@ -194,7 +194,7 @@ function getFields(props) {
item(
'city',
99,
<Form.Item name='city' label={t('City')} {...fieldProps.city}>
<Form.Item name='city' label={t('City')} {...fieldProps.city} tooltip={t('FormTooltip.City')}>
<CitySelector {...styleProps} {...editableProps('city_id')} />
</Form.Item>,
fieldProps?.city?.col || midCol
@ -210,7 +210,7 @@ function getFields(props) {
item(
'duration',
99,
<Form.Item name='duration' label={t('Duration')} {...fieldProps.duration}>
<Form.Item name='duration' label={t('Duration')} {...fieldProps.duration} tooltip={t('FormTooltip.Duration')}>
<InputNumber suffix={'H'} max={24} {...styleProps} {...editableProps('duration')} />
{/* <Input allowClear {...fieldComProps.duration} suffix={'H'} /> */}
</Form.Item>,
@ -219,7 +219,7 @@ function getFields(props) {
item(
'km',
99,
<Form.Item name='km' label={t('KM')} {...fieldProps.km}>
<Form.Item name='km' label={t('KM')} {...fieldProps.km} tooltip={t('FormTooltip.KM')}>
<InputNumber suffix={'KM'} min={0.1} {...styleProps} {...editableProps('km')} />
</Form.Item>,
fieldProps?.km?.col || midCol
@ -227,7 +227,7 @@ function getFields(props) {
item(
'recommends_rate',
99,
<Form.Item name='recommends_rate' label={t('RecommendsRate')} {...fieldProps.recommends_rate}>
<Form.Item name='recommends_rate' label={t('RecommendsRate')} {...fieldProps.recommends_rate} tooltip={t('FormTooltip.RecommendsRate')}>
{/* <Input placeholder={t('RecommendsRate')} allowClear /> */}
<Select
{...styleProps}
@ -252,6 +252,7 @@ function getFields(props) {
name='display_to_c'
label={t('DisplayToC')}
{...fieldProps.display_to_c}
tooltip={t('FormTooltip.DisplayToC')}
// rules={[
// () => ({
// validator(_, value) {
@ -285,7 +286,7 @@ function getFields(props) {
item(
'open_weekdays',
99,
<Form.Item name='open_weekdays' label={t('OpenWeekdays')} {...fieldProps.open_weekdays}>
<Form.Item name='open_weekdays' label={t('OpenWeekdays')} {...fieldProps.open_weekdays} tooltip={t('FormTooltip.OpenWeekdays')}>
<Checkbox.Group options={dataSets.weekdays} {...styleProps} {...editableProps('open_weekdays')} />
</Form.Item>,
fieldProps?.open_weekdays?.col || 24
@ -293,7 +294,7 @@ function getFields(props) {
item(
'remarks',
99,
<Form.Item name='remarks' label={t('Remarks')} {...fieldProps.remarks}>
<Form.Item name='remarks' label={t('Remarks')} {...fieldProps.remarks} tooltip={t('FormTooltip.Remarks')}>
<Input.TextArea allowClear rows={2} maxLength={2000} {...fieldComProps.remarks} {...styleProps} {...editableProps('remarks')} />
</Form.Item>,
fieldProps?.remarks?.col || 24
@ -406,8 +407,8 @@ const formValuesMapper = (values) => {
}
// omit empty
// Object.keys(dest).forEach((key) => (dest[key] == null || dest[key] === '' || dest[key].length === 0) && delete dest[key]);
const { lgc_details, lgc_details_mapped, quotation, ...info } = dest; // quotation
return { info, lgc_details, lgc_details_mapped, quotation }; // quotation
const { lgc_details, lgc_details_mapped, quotation, ...info } = dest;
return { info, lgc_details, lgc_details_mapped, quotation };
};
export default InfoForm;

@ -7,7 +7,7 @@ import { useDefaultLgc } from '@/i18n/LanguageSwitcher';
import { cloneDeep, isEmpty, isNotEmpty } from '@/utils/commons';
const ProductInfoLgc = ({ editable, formInstance, ...props }) => {
const { t } = useTranslation();
const { t } = useTranslation('products');
const { language: languageHT } = useDefaultLgc();
const HTLanguageSetsMapVal = useHTLanguageSetsMapVal();
const allLgcOptions = useHTLanguageSets();
@ -25,7 +25,7 @@ const ProductInfoLgc = ({ editable, formInstance, ...props }) => {
forceRender: true,
children: (
<Form.Item noStyle>
<Form.Item name={['lgc_details_mapped', `${ele.lgc}`, 'title']} label={t('products:Title')} initialValue={ele.title} rules={[{ required: true }]}>
<Form.Item name={['lgc_details_mapped', `${ele.lgc}`, 'title']} label={t('products:Title')} initialValue={ele.title} rules={[{ required: true }]} tooltip={t('FormTooltip.Title')}>
<Input
className={' !text-slate-600'}
allowClear
@ -35,7 +35,7 @@ const ProductInfoLgc = ({ editable, formInstance, ...props }) => {
disabled={!editable}
/>
</Form.Item>
<Form.Item name={['lgc_details_mapped', `${ele.lgc}`, 'description']} label={t('products:Description')} initialValue={ele.descriptions}>
<Form.Item name={['lgc_details_mapped', `${ele.lgc}`, 'description']} label={t('products:Description')} initialValue={ele.descriptions} tooltip={t('FormTooltip.Description')}>
<Input.TextArea
className={'!text-slate-600'}
rows={3}
@ -86,10 +86,10 @@ const ProductInfoLgc = ({ editable, formInstance, ...props }) => {
key: lgcItem.value,
children: (
<Form.Item noStyle>
<Form.Item name={['lgc_details_mapped', `${lgcItem.value}`, 'title']} preserve={false} label={t('products:Title')} rules={[{ required: true }]}>
<Form.Item name={['lgc_details_mapped', `${lgcItem.value}`, 'title']} preserve={false} label={t('products:Title')} rules={[{ required: true }]} tooltip={t('FormTooltip.Title')}>
<Input allowClear />
</Form.Item>
<Form.Item name={['lgc_details_mapped', `${lgcItem.value}`, 'description']} preserve={false} label={t('products: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 />
</Form.Item>
<Form.Item hidden name={['lgc_details_mapped', `${lgcItem.value}`, 'lgc']} preserve={false} initialValue={lgcItem.value}>
@ -159,12 +159,12 @@ const ProductInfoLgc = ({ editable, formInstance, ...props }) => {
hideAdd={isEmpty(lgcOptions) || !editable}
tabPosition='top'
/>
<Modal title={'选择语言'} open={newLgcModalVisible} onOk={handleOk} onCancel={() => setNewLgcModalVisible(false)}>
<Modal title={t('LgcModal.title')} open={newLgcModalVisible} onOk={handleOk} onCancel={() => setNewLgcModalVisible(false)} destroyOnClose>
<Select
showSearch
labelInValue
style={{ width: '80%' }}
placeholder='选择语言'
placeholder={t('LgcModal.placeholder')}
optionFilterProp='children'
options={lgcOptions}
onChange={onSelectNewLgc}

Loading…
Cancel
Save