From 420e8a84e521b12bafaedf78d2b4d1b9fa634c13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B0=E9=A6=99=E7=90=AA?= <624506849@qq.com> Date: Thu, 13 Aug 2026 16:37:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(goodsOperationSec):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=95=86=E5=93=81=E7=BC=96=E8=BE=91=E9=A1=B5=E5=BA=97=E5=86=85?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E6=97=A0=E6=B3=95=E5=9B=9E=E5=A1=AB=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 初始化店内分类 ID 列表时过滤空值 - 分类树数据加载完成后调用 setCheckedKeys 回填勾选状态 - 使用 const 声明 shopCategories 提升可读性 --- .../src/views/goods/goods-seller/goodsOperationSec.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/seller/src/views/goods/goods-seller/goodsOperationSec.vue b/seller/src/views/goods/goods-seller/goodsOperationSec.vue index bd110fd1..26b09cdf 100644 --- a/seller/src/views/goods/goods-seller/goodsOperationSec.vue +++ b/seller/src/views/goods/goods-seller/goodsOperationSec.vue @@ -1341,22 +1341,24 @@ export default { GET_ShopGoodsLabel() { API_GOODS.getShopGoodsLabelListSeller().then((res) => { if (res.success) { - let shopCategories = !this.baseInfoForm.storeCategoryPath + const shopCategories = !this.baseInfoForm.storeCategoryPath ? [] - : this.baseInfoForm.storeCategoryPath.split(","); + : this.baseInfoForm.storeCategoryPath.split(",").filter(Boolean); this.shopCategory = res.result.map((i) => { i.title = i.labelName; i.expand = false; - i.checked = shopCategories.some((o) => o === i.id); i.children = i.children.map((j) => { j.title = j.labelName; j.expand = false; - j.checked = shopCategories.some((o) => o === j.id); return j; }); return i; }); + + this.$nextTick(() => { + this.$refs.tree?.setCheckedKeys(shopCategories); + }); } }); },