From 3a592a640d3b98341564556ad18c989e5c7e9e82 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Mon, 22 Jul 2024 16:00:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E9=A1=B5:=20=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/Products/Index.js | 12 +++++++----- src/views/products/Audit.jsx | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/stores/Products/Index.js b/src/stores/Products/Index.js index 2fd935c..1a79d56 100644 --- a/src/stores/Products/Index.js +++ b/src/stores/Products/Index.js @@ -102,11 +102,11 @@ export const postProductsSave = async (products) => { const initialState = { loading: false, - searchValues: {}, - agencyList: [], - activeAgency: {}, - agencyProducts: {}, - editingProduct: {}, + searchValues: {}, // 客服首页: 搜索条件 + agencyList: [], // 客服首页: 搜索结果 + activeAgency: {}, // 审核/编辑 页: 当前的供应商 + agencyProducts: {}, // 审核/编辑 页: 供应商产品列表 + editingProduct: {}, // 编辑页: 当前编辑的产品 }; export const useProductsStore = create( devtools((set, get) => ({ @@ -135,7 +135,9 @@ export const useProductsStore = create( getAgencyProducts: async (param) => { const { setLoading, setActiveAgency, setAgencyProducts } = get(); setLoading(true); + setAgencyProducts({}); const res = await getAgencyProductsAction(param); + const productsData = groupBy(res.products, (row) => row.info.product_type_id); setAgencyProducts(productsData); setActiveAgency(res.agency); diff --git a/src/views/products/Audit.jsx b/src/views/products/Audit.jsx index 35fd4e3..f426b6a 100644 --- a/src/views/products/Audit.jsx +++ b/src/views/products/Audit.jsx @@ -91,7 +91,7 @@ const Header = ({ refresh, ...props }) => {

{isPermitted(PERM_PRODUCTS_OFFER_AUDIT) ? (