From c101d6660cdcdaf81764955f5e1777a6e6885007 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Mon, 12 Aug 2024 16:16:14 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BA=A7=E5=93=81=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E7=BC=96=E8=BE=91:=20=E5=88=9D=E5=A7=8B=E5=8C=96=E7=A9=BA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=90=8E=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/products/Detail.jsx | 40 +++++++++++----------------- src/views/products/Detail/Header.jsx | 2 +- 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/src/views/products/Detail.jsx b/src/views/products/Detail.jsx index 5967b20..e28175e 100644 --- a/src/views/products/Detail.jsx +++ b/src/views/products/Detail.jsx @@ -12,12 +12,12 @@ import ProductInfo from './Detail/ProductInfo'; import NewProductModal from './Detail/NewProductModal'; function Detail() { - const { notification, modal } = App.useApp() + const { notification, modal } = App.useApp(); const { travel_agency_id, audit_state, use_year } = useParams(); const [addProductVisible, setAddProductVisible] = useState(false); const [agencyProducts, switchParams] = useProductsStore((state) => [state.agencyProducts, state.switchParams]); const [getAgencyProducts, activeAgency] = useProductsStore((state) => [state.getAgencyProducts, state.activeAgency]); - const [loading, setLoading] = useProductsStore(state => [state.loading, state.setLoading]); + const [loading, setLoading] = useProductsStore((state) => [state.loading, state.setLoading]); const { travelAgencyId } = usingStorage(); const handleGetAgencyProducts = ({ pick_year, pick_agency, pick_state } = {}) => { @@ -26,14 +26,14 @@ function Detail() { const state = pick_state ?? audit_state; const param = { travel_agency_id: agency, use_year: year, audit_state: state }; // setEditingProduct({}); - getAgencyProducts(param).catch(ex => { + getAgencyProducts(param).catch((ex) => { setLoading(false); notification.error({ message: 'Notification', description: ex.message, placement: 'top', duration: 4, - }) + }); }); }; @@ -41,27 +41,17 @@ function Detail() { setAddProductVisible(true)} - /> - }> - {isEmpty(agencyProducts) ? ( - - ) : ( - <> - - {/* onNodeSelect={handleNodeSelect} */} - - -
- -
-
- - )} + header={
setAddProductVisible(true)} />}> + <> + + {/* onNodeSelect={handleNodeSelect} */} + + +
+ +
+
+ ); } diff --git a/src/views/products/Detail/Header.jsx b/src/views/products/Detail/Header.jsx index 6b34edd..debeba0 100644 --- a/src/views/products/Detail/Header.jsx +++ b/src/views/products/Detail/Header.jsx @@ -143,7 +143,7 @@ const Header = ({ refresh, ...props }) => { {/* {(use_year || '').replace('all', '')} */} -