From d9307c239d0fbeb7d7901ed6b2a4d2247396ecee Mon Sep 17 00:00:00 2001 From: zzh <1368735060@qq.com> Date: Sun, 15 Nov 2026 21:58:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=A2=E6=88=B7=E4=BE=A7=E6=A0=8F?= =?UTF-8?q?=E6=8D=A2=E4=BB=93=E6=94=B9=E5=9B=9E=E4=B8=AD=E9=97=B4=E5=BC=B9?= =?UTF-8?q?=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 去掉侧栏 Popover,点击寄件仓仍打开 WarehouseAddressPeekModal。 Co-authored-by: Cursor --- src/components.d.ts | 1 - .../WarehouseSwitcherPopover.vue | 422 ------------------ src/components/customer-side-rail/index.vue | 89 +--- .../customer-side-rail/useWarehousePeek.ts | 25 +- 4 files changed, 37 insertions(+), 500 deletions(-) delete mode 100644 src/components/customer-side-rail/WarehouseSwitcherPopover.vue diff --git a/src/components.d.ts b/src/components.d.ts index 7c86478..b8cd11a 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -79,6 +79,5 @@ declare module 'vue' { UserEditDrawer: typeof import('./components/UserEditDrawer/index.vue')['default'] UserProfileFields: typeof import('./components/UserProfileFields/index.vue')['default'] WarehouseAddressPeekModal: typeof import('./components/customer-side-rail/WarehouseAddressPeekModal.vue')['default'] - WarehouseSwitcherPopover: typeof import('./components/customer-side-rail/WarehouseSwitcherPopover.vue')['default'] } } diff --git a/src/components/customer-side-rail/WarehouseSwitcherPopover.vue b/src/components/customer-side-rail/WarehouseSwitcherPopover.vue deleted file mode 100644 index 39f2afd..0000000 --- a/src/components/customer-side-rail/WarehouseSwitcherPopover.vue +++ /dev/null @@ -1,422 +0,0 @@ - - - - - diff --git a/src/components/customer-side-rail/index.vue b/src/components/customer-side-rail/index.vue index 06048f0..2e425c2 100644 --- a/src/components/customer-side-rail/index.vue +++ b/src/components/customer-side-rail/index.vue @@ -85,51 +85,22 @@
- - - - - - + + + + {{ t('nav.warehousePeek.shipLabel') }} + + {{ warehouseDockName }} + +
@@ -374,14 +342,9 @@ const warehouseDockTitle = computed(() => ) function openWarehouseAddressPeek() { - warehouseSwitcherVisible.value = false warehousePeekVisible.value = true } -watch(compactLayout, () => { - warehouseSwitcherVisible.value = false -}) - async function ensureWarehouseOptions() { try { const { items } = await getWarehouseList({ page: 1, pageSize: 100 }) @@ -931,15 +894,6 @@ onUnmounted(() => { border-color: color-mix(in srgb, var(--app-primary-color, #1d7281) 28%, transparent); } - &.is-open { - border-color: color-mix(in srgb, var(--app-primary-color, #1d7281) 40%, transparent); - box-shadow: 0 0 0 2px color-mix(in srgb, var(--app-primary-color, #1d7281) 12%, transparent); - - .customer-side-rail__warehouse-chip-chevron { - transform: rotate(180deg); - } - } - &.is-compact { width: 40px; height: 40px; @@ -980,13 +934,6 @@ onUnmounted(() => { color: var(--color-text-1); } - &__warehouse-chip-chevron { - flex-shrink: 0; - font-size: 12px; - color: var(--color-text-3); - transition: transform 0.16s ease; - } - /* 二级:头像 + 消息 + 打印 + 收起 */ &__toolbar { display: flex; @@ -1243,10 +1190,4 @@ onUnmounted(() => { } } -:global(.csr-warehouse-switcher-popup) { - padding: 0 !important; - border-radius: 10px !important; - overflow: hidden; - box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12) !important; -} diff --git a/src/components/customer-side-rail/useWarehousePeek.ts b/src/components/customer-side-rail/useWarehousePeek.ts index 6d8de3d..a3640cf 100644 --- a/src/components/customer-side-rail/useWarehousePeek.ts +++ b/src/components/customer-side-rail/useWarehousePeek.ts @@ -140,6 +140,20 @@ export function useWarehousePeek() { return true } + function applyStoreOptionsFallback() { + const opts = warehouseStore.options || [] + if (!opts.length) { + list.value = [] + return + } + list.value = opts.map((o) => + normalize({ + id: o.value, + warehouseName: o.label, + }), + ) + } + async function loadList() { loading.value = true try { @@ -147,10 +161,15 @@ export function useWarehousePeek() { getWarehouseList({ page: 1, pageSize: 100 }), loadCustomerCode(), ]) - list.value = (res.items ?? []).map(normalize).sort(compareWarehouseSort) - syncWarehouseOptions(list.value) + const rows = (res.items ?? []).map(normalize).sort(compareWarehouseSort) + if (rows.length) { + list.value = rows + syncWarehouseOptions(list.value) + } else { + applyStoreOptionsFallback() + } } catch { - list.value = [] + applyStoreOptionsFallback() } finally { loading.value = false }