diff --git a/public/locales/en/vendor.json b/public/locales/en/vendor.json new file mode 100644 index 0000000..52f97fe --- /dev/null +++ b/public/locales/en/vendor.json @@ -0,0 +1,5 @@ +{ + "report": { + "GetReport": "Get Report" + } +} diff --git a/public/locales/zh/vendor.json b/public/locales/zh/vendor.json new file mode 100644 index 0000000..678650f --- /dev/null +++ b/public/locales/zh/vendor.json @@ -0,0 +1,5 @@ +{ + "report": { + "GetReport": "获取报告" + } +} diff --git a/src/components/BackBtn.jsx b/src/components/BackBtn.jsx new file mode 100644 index 0000000..26068e0 --- /dev/null +++ b/src/components/BackBtn.jsx @@ -0,0 +1,16 @@ +import { createContext, useContext, useEffect, useState } from 'react'; +import { Link, useNavigate } from 'react-router-dom'; +import { useTranslation } from 'react-i18next'; +import { Button } from 'antd'; +import { isNotEmpty } from '@/utils/commons'; + +const BackBtn = ({to, ...props}) => { + const { t } = useTranslation(); + const navigate = useNavigate(); + return ( + <> + {isNotEmpty(to) ? {t('Back')} : } + > + ); +}; +export default BackBtn; diff --git a/src/components/SearchForm.jsx b/src/components/SearchForm.jsx index c116dd8..b9dafc8 100644 --- a/src/components/SearchForm.jsx +++ b/src/components/SearchForm.jsx @@ -14,10 +14,11 @@ const SearchForm = ({ initialValue, onSubmit, onReset, ...props }) => { const [formValues, setFormValues] = useFormStore((state) => [state.formValues, state.setFormValues]); const [formValuesToSub, setFormValuesToSub] = useFormStore((state) => [state.formValuesToSub, state.setFormValuesToSub]); const [form] = Form.useForm(); - const { sort, hides, shows, fieldProps } = { + const { sort, hides, shows, fieldProps, fieldComProps } = { sort: '', // initialValue: '', fieldProps: '', + fieldComProps: '', hides: [], shows: [], ...props.defaultValue, @@ -87,7 +88,7 @@ const SearchForm = ({ initialValue, onSubmit, onReset, ...props }) => {