From 0f375dcd0475eaa129d35b219fdb5326829762ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E8=87=AA=E8=BE=BE?= <980324341@qq.com> Date: Tue, 17 Nov 2026 18:30:09 +0800 Subject: [PATCH] =?UTF-8?q?feat(jd):=20=E9=87=87=E9=9B=86=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E6=8D=A2=20el-select=20=E4=B8=8B=E6=8B=89=E5=A4=9A?= =?UTF-8?q?=E9=80=89=EF=BC=882026-11-17=20=E5=AE=A2=E6=88=B7=E5=8F=A3?= =?UTF-8?q?=E5=BE=84=E3=80=8C=E4=B8=8D=E8=A6=81=E5=85=A8=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E5=87=BA=E6=9D=A5=EF=BC=8C=E5=BC=84=E4=B8=AA=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E5=BC=8F=E5=A4=9A=E9=80=89=E3=80=8D=EF=BC=89=E2=80=94=E2=80=94?= =?UTF-8?q?9=20=E8=A1=8C=E5=A4=8D=E9=80=89=E5=88=97=E8=A1=A8=E6=94=B6?= =?UTF-8?q?=E8=BF=9B=20collapse-tags=20=E4=B8=8B=E6=8B=89=EF=BC=88+N=20?= =?UTF-8?q?=E5=BE=BD=E6=A0=87=EF=BC=89=EF=BC=8C=E9=80=89=E6=8B=A9=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E6=94=B9=20id=20=E6=95=B0=E7=BB=84=E3=80=81=E5=8F=8C?= =?UTF-8?q?=E9=94=AE=E6=8C=89=E5=BF=AB=E7=85=A7=E5=8E=9F=E5=BA=8F=E5=90=8C?= =?UTF-8?q?=E6=BA=90=E5=8F=8D=E6=9F=A5=EF=BC=88=E7=82=B9=E9=80=89=E5=85=88?= =?UTF-8?q?=E5=90=8E=E4=B8=8D=E8=BF=9B=E8=AF=B7=E6=B1=82=E4=BD=93=EF=BC=89?= =?UTF-8?q?=EF=BC=9B=E6=9A=97=E8=89=B2=E4=B8=BB=E9=A2=98=E5=A5=97=E5=A3=B3?= =?UTF-8?q?=E3=80=82=E5=88=A4=E6=8D=AE=EF=BC=9A=E7=BA=AF=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E9=92=89=20el-select=20multiple=20=E5=9C=A8=E5=86=8C=EF=BC=8Bs?= =?UTF-8?q?hop-cat-list=20=E6=97=A7=E5=BD=A2=E7=8A=B6=E5=8F=8D=E5=90=91?= =?UTF-8?q?=E9=92=89=EF=BC=9B=E6=8C=82=E8=BD=BD=E4=B8=A4=E6=A0=BC=E6=94=B9?= =?UTF-8?q?=E7=94=A8=E7=9C=9F=E5=AE=9E=20ElementPlus=20=E7=BB=8F=20update:?= =?UTF-8?q?modelValue=20=E6=A8=A1=E6=8B=9F=E7=82=B9=E9=80=89=EF=BC=88?= =?UTF-8?q?=E8=BD=AE=E8=AF=A2=E6=A0=BC=E4=BF=9D=E6=8C=81=E8=BD=BB=E9=87=8F?= =?UTF-8?q?=E6=A1=A9=E2=80=94=E2=80=94=E7=9C=9F=E4=BB=B6=E5=9C=A8=20fake?= =?UTF-8?q?=20timers=20=E4=B8=8B=E4=BC=9A=E6=89=93=E6=96=AD=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E9=9D=A2=E6=9D=BF=E8=BD=AE=E8=AF=A2=E9=93=BE=EF=BC=8C?= =?UTF-8?q?=E5=AE=9E=E6=B5=8B=E6=95=99=E8=AE=AD=E5=86=99=E8=BF=9B=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=EF=BC=89=E3=80=82node=20--test=209=20=E4=BE=8B?= =?UTF-8?q?=EF=BC=8Bvitest=20=E6=8C=82=E8=BD=BD=2010=20=E4=BE=8B=EF=BC=8Bv?= =?UTF-8?q?ue-tsc=20rc=3D0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend-vue/src/pages/jd/JdCollectTab.vue | 90 +++++++------------ frontend-vue/tests/jd-collect-tab.test.ts | 4 + .../mount/jd-collect-progress.mount.test.ts | 69 +++++++++----- 3 files changed, 81 insertions(+), 82 deletions(-) diff --git a/frontend-vue/src/pages/jd/JdCollectTab.vue b/frontend-vue/src/pages/jd/JdCollectTab.vue index 978d69a46..cd21b6dad 100644 --- a/frontend-vue/src/pages/jd/JdCollectTab.vue +++ b/frontend-vue/src/pages/jd/JdCollectTab.vue @@ -21,7 +21,7 @@ import { userNotice } from '@/shared/utils/user-notice' import { formatDateTime } from '@/shared/utils/datetime' import { useLiveTaskBoard } from '@/shared/composables/useLiveTaskBoard' import NotificationBell from '@/shared/components/NotificationBell.vue' -import { JD_SHOP_CATEGORY_SNAPSHOT, type JdShopCategory } from './jd-shop-category.ts' +import { JD_SHOP_CATEGORY_SNAPSHOT } from './jd-shop-category.ts' /** 京东「获取店铺数据」(v1.5):一键建单 → 推送本机客户端 → 右侧任务面板实时进度。 * @@ -55,23 +55,23 @@ const submitting = ref(false) const errorMessage = ref('') const successMessage = ref('') -// ---- 采集分类(可选,多选;空=全店采集)---- +// ---- 采集分类(可选,下拉多选;空=全店采集)---- /** 选项集=京麦「店内分类」快照(getShopCategoryList,2026-11-16 真机取证 9 个; - * 京麦侧改分类后按取证路重抓,见 jd-shop-category.ts 头注释——快照不会自动过期告警)。 */ + * 京麦侧改分类后按取证路重抓,见 jd-shop-category.ts 头注释——快照不会自动过期告警)。 + * 2026-11-17 客户口径「不要全展示出来,弄个下拉式多选」:复选列表换 el-select 多选 + * (collapse-tags 折叠成「+N」徽标),选择模型改存分类 id 数组,label/id 双键从快照反查。 */ const shopCategoryOptions = JD_SHOP_CATEGORY_SNAPSHOT -const selectedShopCategories = ref([]) - -function toggleShopCategory(category: JdShopCategory) { - const hit = selectedShopCategories.value.find((item) => item.value === category.value) - selectedShopCategories.value = hit - ? selectedShopCategories.value.filter((item) => item.value !== category.value) - : [...selectedShopCategories.value, category] -} +const selectedShopCategoryValues = ref([]) function clearShopCategories() { - selectedShopCategories.value = [] + selectedShopCategoryValues.value = [] } +/** 选中项按快照原序反查回对象(下拉里点选的先后不进请求体——双键顺序恒等于快照序)。 */ +const selectedShopCategories = computed(() => + shopCategoryOptions.filter((item) => selectedShopCategoryValues.value.includes(item.value)), +) + /** 建单/推送载荷的选中值:label 与 id 双键同发(行级填充形状未取证,任一键命中即命中)。 */ const selectedShopCategoryNames = computed(() => selectedShopCategories.value.map((item) => item.label)) const selectedShopCategoryIds = computed(() => selectedShopCategories.value.map((item) => item.value)) @@ -413,22 +413,17 @@ onUnmounted(() => {