From 9fef49263b5c2bb75d1fae415aa819a3e4024097 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Fri, 7 Jun 2024 14:56:26 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=90=9C=E7=B4=A2=E7=BB=84=E4=BB=B6:?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E5=B1=9E=E6=80=A7=E5=90=8D:=20fieldsConfi?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SearchForm.jsx | 2 +- src/views/feedback/Index.jsx | 2 +- src/views/invoice/Index.jsx | 2 +- src/views/invoice/Paid.jsx | 2 +- src/views/report/Index.jsx | 2 +- src/views/reservation/Newest.jsx | 8 ++++---- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/SearchForm.jsx b/src/components/SearchForm.jsx index b9dafc8..24ef907 100644 --- a/src/components/SearchForm.jsx +++ b/src/components/SearchForm.jsx @@ -21,7 +21,7 @@ const SearchForm = ({ initialValue, onSubmit, onReset, ...props }) => { fieldComProps: '', hides: [], shows: [], - ...props.defaultValue, + ...props.fieldsConfig, }; const { confirmText } = props; const readValues = { ...initialValue, ...formValues }; diff --git a/src/views/feedback/Index.jsx b/src/views/feedback/Index.jsx index 3e8a5f0..e788887 100644 --- a/src/views/feedback/Index.jsx +++ b/src/views/feedback/Index.jsx @@ -71,7 +71,7 @@ function Index() { initialValue={{ dates: [dayjs().subtract(2, 'M').startOf('M'), dayjs().endOf('M')], }} - defaultValue={{ + fieldsConfig={{ shows: ['referenceNo', 'dates'], fieldProps: { dates: { label: t('group:ArrivalDate') }, diff --git a/src/views/invoice/Index.jsx b/src/views/invoice/Index.jsx index a90b5d4..e77dd13 100644 --- a/src/views/invoice/Index.jsx +++ b/src/views/invoice/Index.jsx @@ -88,7 +88,7 @@ function Index() { initialValue={{ dates: [dayjs().subtract(2, 'M').startOf('M'), dayjs().endOf('M')], }} - defaultValue={{ + fieldsConfig={{ shows: ['referenceNo', 'invoiceStatus', 'dates'], fieldProps: { referenceNo: { col: 5}, diff --git a/src/views/invoice/Paid.jsx b/src/views/invoice/Paid.jsx index c036e3a..3b32fb6 100644 --- a/src/views/invoice/Paid.jsx +++ b/src/views/invoice/Paid.jsx @@ -76,7 +76,7 @@ function Paid() { initialValue={{ dates: [dayjs().subtract(2, 'M').startOf('M'), dayjs().endOf('M')], }} - defaultValue={{ + fieldsConfig={{ shows: ['referenceNo', 'dates'], fieldProps: { referenceNo: { col: 5 }, diff --git a/src/views/report/Index.jsx b/src/views/report/Index.jsx index a96a3c0..b369805 100644 --- a/src/views/report/Index.jsx +++ b/src/views/report/Index.jsx @@ -283,7 +283,7 @@ function Index() { initialValue={{ dates: [dayjs().startOf('year'), dayjs().endOf('year')], }} - defaultValue={{ + fieldsConfig={{ shows: ['dates'], fieldProps: { dates: { label: 'Select Date', col: 12 }, diff --git a/src/views/reservation/Newest.jsx b/src/views/reservation/Newest.jsx index 6857b17..4e3d7f3 100644 --- a/src/views/reservation/Newest.jsx +++ b/src/views/reservation/Newest.jsx @@ -106,7 +106,7 @@ function Newest() { const [dataLoading, setDataLoading] = useState(false) const [guideSelectOptions, setGuideSelectOptions] = useState([]) - const formValues = useFormStore((state) => state.formValues) + const formValuesToSub = useFormStore((state) => state.formValuesToSub) const [fetchAllGuideList, fetchReservationList, reservationList, reservationPage, cityList, selectReservation, getCityListByReservationId] = useReservationStore((state) => @@ -163,7 +163,7 @@ function Newest() { // 默认重新搜索第一页,所有状态的计划 const onSearchClick = (current=1, status=null) => { setDataLoading(true) - fetchReservationList(formValues, current) + fetchReservationList(formValuesToSub, current) .catch(ex => { notification.error({ message: `Notification`, @@ -216,7 +216,7 @@ function Newest() { // { // } // } - defaultValue={{ + fieldsConfig={{ shows: ['referenceNo', 'dates'], fieldProps: { dates: { label: t('group:ArrivalDate') }, @@ -224,7 +224,7 @@ function Newest() { }} onSubmit={(err, formVal, filedsVal) => { setDataLoading(true) - fetchReservationList(travelAgencyId, formVal) + fetchReservationList(formVal) .catch(ex => { notification.error({ message: 'Notification',