From 834f244814f54ad855521fdb817e1b2b48f3c195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=9F=91=E8=9E=82?= Date: Fri, 17 Apr 2026 17:42:57 +0800 Subject: [PATCH] =?UTF-8?q?fix(ecom-dmb):=20=E5=95=86=E5=93=81=E7=B1=BB?= =?UTF-8?q?=E7=9B=AE=E9=80=89=E6=8B=A9=E5=99=A8=E6=94=B9=E4=B8=BA=20TreeSe?= =?UTF-8?q?lect=20=E6=94=AF=E6=8C=81=E9=80=89=E6=8B=A9=E4=BB=BB=E6=84=8F?= =?UTF-8?q?=E5=B1=82=E7=BA=A7=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../product/components/ProductFormModal.vue | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/product/components/ProductFormModal.vue b/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/product/components/ProductFormModal.vue index 82b4e930..0851ce3c 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/product/components/ProductFormModal.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/product/components/ProductFormModal.vue @@ -13,9 +13,9 @@ import { Input, InputNumber, message, - Select, Space, Table, + TreeSelect, } from 'ant-design-vue'; import dayjs from 'dayjs'; @@ -25,7 +25,7 @@ import { getProductSpecsByIdsApi, } from '#/api/ecommerce/product-spec/apis'; import type { ProductSpecVO } from '#/api/ecommerce/product-spec/types'; -import { getCategoryListApi } from '#/api/ecommerce/category'; +import { getCategoryTreeApi } from '#/api/ecommerce/category'; import { uploadFileToOss } from '#/utils/oss-upload'; interface Emits { @@ -134,7 +134,7 @@ const formData = ref({ }); // 类目选项列表 -const categoryOptions = ref<{ label: string; value: number }[]>([]); +const categoryOptions = ref([]); // 规格数据 - 支持创建和更新 const specs = ref>([]); @@ -310,8 +310,8 @@ async function open( // 加载类目选项 try { - const list = await getCategoryListApi(); - categoryOptions.value = (list ?? []).map((c) => ({ label: c.name, value: c.id })); + const list = await getCategoryTreeApi(); + categoryOptions.value = list ?? []; } catch (error) { console.error('加载类目列表失败:', error); } @@ -690,11 +690,13 @@ onUnmounted(() => { -