From 34f2f83a5ede75609fb2001d7fdc98571c4315ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=9F=91=E8=9E=82?= Date: Sat, 23 May 2026 15:18:17 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BB=9F=E4=B8=80=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E5=8F=B0=E4=B8=8E=E6=A6=82=E8=A7=88=E9=A1=B5=E7=AD=9B=E9=80=89?= =?UTF-8?q?=E5=99=A8=EF=BC=8C=E5=95=86=E5=93=81=E6=A6=82=E8=A7=88=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=8C=89=E5=BA=97=E9=93=BA=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/dto/ProductOverviewQueryDTO.java | 6 + .../impl/ProductOverviewServiceImpl.java | 78 ++-- .../product-overview/types/types.dto.ts | 2 + .../web-antd/src/utils/overview-date-range.ts | 29 +- .../src/views/dashboard/workbench/index.vue | 353 ++++++++++++++---- .../overview/components/TimeRangeBar.vue | 141 ++++++- .../ecommerce/product/overview/index.vue | 229 +++++++++++- .../components/ProductComparisonTable.vue | 43 ++- .../shop/overview/components/TimeRangeBar.vue | 71 +++- .../views/ecommerce/shop/overview/index.vue | 97 ++++- .../styles/overview-header-select.css | 113 ++++++ 11 files changed, 1038 insertions(+), 124 deletions(-) create mode 100644 ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/styles/overview-header-select.css diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/product/overview/model/dto/ProductOverviewQueryDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/product/overview/model/dto/ProductOverviewQueryDTO.java index 0382311e..b89da711 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/product/overview/model/dto/ProductOverviewQueryDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/product/overview/model/dto/ProductOverviewQueryDTO.java @@ -35,6 +35,12 @@ public class ProductOverviewQueryDTO { @NotNull(message = "结束日期不能为空") private LocalDate endDate; + /** + * 店铺ID(可选;传入时仅统计该店铺下该商品的订单与推广费分摊) + */ + @Schema(description = "店铺ID(可选)", example = "1") + private Long shopId; + /** * 税率(默认0.04) */ diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/product/overview/service/impl/ProductOverviewServiceImpl.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/product/overview/service/impl/ProductOverviewServiceImpl.java index 593d1c5c..b5e2fe5a 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/product/overview/service/impl/ProductOverviewServiceImpl.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/product/overview/service/impl/ProductOverviewServiceImpl.java @@ -16,8 +16,10 @@ import top.xyquan.ecomdmbbackend.modules.ecom.product.overview.service.ProductOv import top.xyquan.ecomdmbbackend.modules.ecom.product.service.ProductService; import top.xyquan.ecomdmbbackend.modules.ecom.promotion.mapper.PromotionFeeMapper; import top.xyquan.ecomdmbbackend.modules.ecom.promotion.model.po.PromotionFeePO; +import top.xyquan.ecomdmbbackend.modules.ecom.shop.model.po.ShopPO; import top.xyquan.ecomdmbbackend.modules.ecom.shop.monthlytarget.mapper.ShopMonthlyTargetMapper; import top.xyquan.ecomdmbbackend.modules.ecom.shop.monthlytarget.model.po.ShopMonthlyTargetPO; +import top.xyquan.ecomdmbbackend.modules.ecom.shop.service.ShopService; import top.xyquan.ecomdmbbackend.utils.CurrentUserContext; import java.math.BigDecimal; @@ -41,6 +43,7 @@ public class ProductOverviewServiceImpl implements ProductOverviewService { private final ProductService productService; private final ProductSpecMapper productSpecMapper; private final ShopMonthlyTargetMapper shopMonthlyTargetMapper; + private final ShopService shopService; public ProductOverviewServiceImpl(CurrentUserContext currentUserContext, OrderMapper orderMapper, @@ -48,7 +51,8 @@ public class ProductOverviewServiceImpl implements ProductOverviewService { OrderStatusStatResolver orderStatusStatResolver, ProductService productService, ProductSpecMapper productSpecMapper, - ShopMonthlyTargetMapper shopMonthlyTargetMapper) { + ShopMonthlyTargetMapper shopMonthlyTargetMapper, + ShopService shopService) { this.currentUserContext = currentUserContext; this.orderMapper = orderMapper; this.promotionFeeMapper = promotionFeeMapper; @@ -56,6 +60,29 @@ public class ProductOverviewServiceImpl implements ProductOverviewService { this.productService = productService; this.productSpecMapper = productSpecMapper; this.shopMonthlyTargetMapper = shopMonthlyTargetMapper; + this.shopService = shopService; + } + + private void applyProductOverviewOrderScope(LambdaQueryWrapper wrapper, + Long companyId, + Long productId, + Long shopId, + LocalDateTime startDateTime, + LocalDateTime endDateTime, + List unionStatusIds) { + wrapper.eq(OrderPO::getCompanyId, companyId) + .apply("EXISTS (SELECT 1 FROM ec_product_spec s WHERE s.id = ec_order.product_spec_id AND s.product_id = {0})", + productId) + .ge(OrderPO::getOrderTime, startDateTime) + .le(OrderPO::getOrderTime, endDateTime); + if (shopId != null) { + wrapper.eq(OrderPO::getShopId, shopId); + } + if (!unionStatusIds.isEmpty()) { + wrapper.in(OrderPO::getStatusId, unionStatusIds); + } else { + wrapper.isNull(OrderPO::getId); + } } /** 税额 = max(0, 销售额 − 退款) × 税率,保留两位小数。 */ @@ -85,6 +112,14 @@ public class ProductOverviewServiceImpl implements ProductOverviewService { throw new BusinessException("开始日期不能晚于结束日期"); } + Long filterShopId = queryDTO.getShopId(); + if (filterShopId != null) { + ShopPO shop = shopService.getById(filterShopId); + if (shop == null || !shop.getCompanyId().equals(companyId)) { + throw new BusinessException("店铺不存在"); + } + } + LocalDate startDate = queryDTO.getStartDate(); LocalDate endDate = queryDTO.getEndDate(); LocalDateTime startDateTime = startDate.atStartOfDay(); @@ -100,24 +135,21 @@ public class ProductOverviewServiceImpl implements ProductOverviewService { // 查询订单数据 LambdaQueryWrapper orderWrapper = new LambdaQueryWrapper<>(); - orderWrapper.eq(OrderPO::getCompanyId, companyId) - .apply("EXISTS (SELECT 1 FROM ec_product_spec s WHERE s.id = ec_order.product_spec_id AND s.product_id = {0})", - queryDTO.getProductId()) - .ge(OrderPO::getOrderTime, startDateTime) - .le(OrderPO::getOrderTime, endDateTime); - if (!unionStatusIds.isEmpty()) { - orderWrapper.in(OrderPO::getStatusId, unionStatusIds); - } else { - orderWrapper.isNull(OrderPO::getId); - } + applyProductOverviewOrderScope(orderWrapper, companyId, queryDTO.getProductId(), filterShopId, + startDateTime, endDateTime, unionStatusIds); List orders = orderMapper.selectList(orderWrapper); - // 收集店铺ID列表 - List shopIds = orders.stream() - .map(OrderPO::getShopId) - .filter(Objects::nonNull) - .distinct() - .collect(Collectors.toList()); + // 推广费/达成率所用店铺:指定店铺时固定该店,否则取订单涉及店铺 + List shopIds; + if (filterShopId != null) { + shopIds = List.of(filterShopId); + } else { + shopIds = orders.stream() + .map(OrderPO::getShopId) + .filter(Objects::nonNull) + .distinct() + .collect(Collectors.toList()); + } // 查询推广费(相关店铺 + 日期) List promotionFees = new ArrayList<>(); @@ -154,16 +186,8 @@ public class ProductOverviewServiceImpl implements ProductOverviewService { LocalDateTime lastEndTime = lastEndDate.atTime(23, 59, 59); LambdaQueryWrapper lastPeriodWrapper = new LambdaQueryWrapper<>(); - lastPeriodWrapper.eq(OrderPO::getCompanyId, companyId) - .apply("EXISTS (SELECT 1 FROM ec_product_spec s WHERE s.id = ec_order.product_spec_id AND s.product_id = {0})", - queryDTO.getProductId()) - .ge(OrderPO::getOrderTime, lastStartTime) - .le(OrderPO::getOrderTime, lastEndTime); - if (!unionStatusIds.isEmpty()) { - lastPeriodWrapper.in(OrderPO::getStatusId, unionStatusIds); - } else { - lastPeriodWrapper.isNull(OrderPO::getId); - } + applyProductOverviewOrderScope(lastPeriodWrapper, companyId, queryDTO.getProductId(), filterShopId, + lastStartTime, lastEndTime, unionStatusIds); List lastPeriodOrders = orderMapper.selectList(lastPeriodWrapper); // ========== 构建返回对象 ========== diff --git a/ecom-dmb-frontend/apps/web-antd/src/api/ecommerce/product-overview/types/types.dto.ts b/ecom-dmb-frontend/apps/web-antd/src/api/ecommerce/product-overview/types/types.dto.ts index 1bdd9083..714a99a7 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/api/ecommerce/product-overview/types/types.dto.ts +++ b/ecom-dmb-frontend/apps/web-antd/src/api/ecommerce/product-overview/types/types.dto.ts @@ -3,6 +3,8 @@ export namespace ProductOverviewDTO { export interface Query { /** 商品ID */ productId: number; + /** 店铺ID(可选;仅统计该店铺下该商品的数据) */ + shopId?: number; /** 开始日期 */ startDate: string; /** 结束日期 */ diff --git a/ecom-dmb-frontend/apps/web-antd/src/utils/overview-date-range.ts b/ecom-dmb-frontend/apps/web-antd/src/utils/overview-date-range.ts index 71839db4..9bc8449f 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/utils/overview-date-range.ts +++ b/ecom-dmb-frontend/apps/web-antd/src/utils/overview-date-range.ts @@ -45,16 +45,37 @@ export function normalizeOverviewRangePickerChange( const START_Q = 'startDate'; const END_Q = 'endDate'; +const SHOP_Q = 'shopId'; -/** 概览页跳转(店铺/商品)时附带的 query,与全店概览一致 */ -export function buildOverviewRouteQuery(dateRange: [Dayjs, Dayjs]): { +export type OverviewRouteQuery = { startDate: string; endDate: string; -} { - return { + shopId?: string; +}; + +/** 概览页跳转(店铺/商品)时附带的 query,与全店概览一致 */ +export function buildOverviewRouteQuery( + dateRange: [Dayjs, Dayjs], + options?: { shopId?: number }, +): OverviewRouteQuery { + const query: OverviewRouteQuery = { startDate: dateRange[0].format('YYYY-MM-DD'), endDate: dateRange[1].format('YYYY-MM-DD'), }; + if (options?.shopId != null && options.shopId > 0) { + query.shopId = String(options.shopId); + } + return query; +} + +/** 从路由 query 解析工作台/概览带入的店铺 ID */ +export function parseOverviewShopIdFromQuery( + query: Record, +): number | undefined { + const raw = query[SHOP_Q]; + const s = Array.isArray(raw) ? raw[0] : raw; + const id = Number(s); + return Number.isFinite(id) && id > 0 ? id : undefined; } /** 从当前地址栏读取概览日期 query(含 replaceState 写入、未反映到 Vue Router 的情况) */ diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workbench/index.vue b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workbench/index.vue index d1bad7c1..5c14343e 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workbench/index.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workbench/index.vue @@ -8,10 +8,10 @@ import { createIconifyIcon } from '@vben/icons'; import { Button, DatePicker, InputNumber, message, Select, Spin, Tabs } from 'ant-design-vue'; import dayjs from 'dayjs'; -import { getActivePlatformsApi } from '#/api/ecommerce/platform/apis'; +import { getPlatformPageApi } from '#/api/ecommerce/platform/apis'; import type { PlatformVO } from '#/api/ecommerce/platform/types'; import { getShopPageApi } from '#/api/ecommerce/shop/apis'; -import type { ShopVO } from '#/api/ecommerce/shop/types'; +import type { ShopDTO, ShopVO } from '#/api/ecommerce/shop/types'; import { getWorkbenchSummaryApi } from '#/api/ecommerce/workbench/apis'; import type { WorkbenchDTO, WorkbenchVO } from '#/api/ecommerce/workbench/types'; import { $t } from '#/locales'; @@ -142,42 +142,198 @@ const parseTaxRate = (value: string | undefined) => { return Number.isFinite(num) ? Math.round((num / 100) * 1e12) / 1e12 : 0; }; +const FILTER_PAGE_SIZE = 20; + const platforms = ref([]); +const platformLoading = ref(false); +const platformPage = ref(1); +const platformTotal = ref(0); +const platformSearchKeyword = ref(''); +const selectedPlatformLabelCache = ref(''); + const shops = ref([]); -const metaLoaded = ref(false); +const shopLoading = ref(false); +const shopPage = ref(1); +const shopTotal = ref(0); +const shopSearchKeyword = ref(''); +const selectedShopLabelCache = ref(''); -const selectedPlatformSlug = ref('all'); -const selectedShopSlug = ref('all'); +/** 筛选元数据按需加载,不阻塞首屏 summary */ +const metaLoaded = ref(true); -const filteredShops = computed(() => { - if (selectedPlatformSlug.value === 'all') { - return shops.value; - } - const pid = Number(selectedPlatformSlug.value); - return shops.value.filter((s) => s.platformId === pid); -}); +/** 未选择时表示「全部」 */ +const selectedPlatformSlug = ref(undefined); +const selectedShopSlug = ref(undefined); -watch(filteredShops, (list) => { - if (selectedShopSlug.value === 'all') return; - const ok = list.some((s) => String(s.id) === selectedShopSlug.value); - if (!ok) selectedShopSlug.value = 'all'; -}); +let platformSearchTimer: ReturnType | undefined; +let shopSearchTimer: ReturnType | undefined; -const platformSelectOptions = computed(() => [ - { label: '全平台', value: 'all' }, - ...platforms.value.map((p) => ({ +function parseSelectedPlatformId(): number | undefined { + const slug = selectedPlatformSlug.value; + if (!slug) return undefined; + const id = Number(slug); + return Number.isFinite(id) && id > 0 ? id : undefined; +} + +function parseSelectedShopId(): number | undefined { + const slug = selectedShopSlug.value; + if (!slug) return undefined; + const id = Number(slug); + return Number.isFinite(id) && id > 0 ? id : undefined; +} + +const platformSelectOptions = computed(() => { + const opts = platforms.value.map((p) => ({ label: p.platformName, value: String(p.id), - })), -]); + })); + const slug = selectedPlatformSlug.value; + if (slug && !opts.some((o) => o.value === slug)) { + opts.unshift({ + label: selectedPlatformLabelCache.value || `平台 #${slug}`, + value: slug, + }); + } + return opts; +}); -const shopSelectOptions = computed(() => [ - { label: '全部门店', value: 'all' }, - ...filteredShops.value.map((s) => ({ +const shopSelectOptions = computed(() => { + const opts = shops.value.map((s) => ({ label: s.name, value: String(s.id), - })), -]); + })); + const slug = selectedShopSlug.value; + if (slug && !opts.some((o) => o.value === slug)) { + opts.unshift({ + label: selectedShopLabelCache.value || `店铺 #${slug}`, + value: slug, + }); + } + return opts; +}); + +watch(selectedPlatformSlug, (slug) => { + if (!slug) { + selectedPlatformLabelCache.value = ''; + } else { + const hit = platforms.value.find((p) => String(p.id) === slug); + if (hit) selectedPlatformLabelCache.value = hit.platformName; + } + selectedShopSlug.value = undefined; + selectedShopLabelCache.value = ''; + shops.value = []; + shopSearchKeyword.value = ''; +}); + +watch(selectedShopSlug, (slug) => { + if (!slug) { + selectedShopLabelCache.value = ''; + return; + } + const hit = shops.value.find((s) => String(s.id) === slug); + if (hit) selectedShopLabelCache.value = hit.name; +}); + +async function fetchPlatformList(page = 1, append = false) { + if (platformLoading.value) return; + platformLoading.value = true; + try { + const keyword = platformSearchKeyword.value.trim(); + const data = await getPlatformPageApi({ + page, + pageSize: FILTER_PAGE_SIZE, + filters: { + ...(keyword ? { platformName: keyword } : {}), + isActive: 1, + }, + }); + const records = data.records ?? []; + platforms.value = append ? [...platforms.value, ...records] : records; + platformTotal.value = data.total ?? 0; + platformPage.value = page; + } catch { + message.error('平台列表加载失败'); + } finally { + platformLoading.value = false; + } +} + +async function fetchShopList(page = 1, append = false) { + if (shopLoading.value) return; + shopLoading.value = true; + try { + const keyword = shopSearchKeyword.value.trim(); + const filters: ShopDTO.Filters = {}; + if (keyword) filters.name = keyword; + const platformId = parseSelectedPlatformId(); + if (platformId != null) { + filters.platformId = platformId; + } + const data = await getShopPageApi({ + page, + pageSize: FILTER_PAGE_SIZE, + filters, + }); + const records = data.records ?? []; + shops.value = append ? [...shops.value, ...records] : records; + shopTotal.value = data.total ?? 0; + shopPage.value = page; + } catch { + message.error('店铺列表加载失败'); + } finally { + shopLoading.value = false; + } +} + +function handlePlatformSearch(keyword: string) { + if (platformSearchTimer) clearTimeout(platformSearchTimer); + platformSearchTimer = setTimeout(() => { + platformSearchKeyword.value = keyword; + void fetchPlatformList(1, false); + }, 300); +} + +function handleShopSearch(keyword: string) { + if (shopSearchTimer) clearTimeout(shopSearchTimer); + shopSearchTimer = setTimeout(() => { + shopSearchKeyword.value = keyword; + void fetchShopList(1, false); + }, 300); +} + +function handlePlatformPopupScroll(e: Event) { + const target = e.target as HTMLElement; + const { scrollTop, scrollHeight, clientHeight } = target; + if (scrollHeight - scrollTop - clientHeight < 50) { + const hasMore = platformPage.value * FILTER_PAGE_SIZE < platformTotal.value; + if (hasMore && !platformLoading.value) { + void fetchPlatformList(platformPage.value + 1, true); + } + } +} + +function handleShopPopupScroll(e: Event) { + const target = e.target as HTMLElement; + const { scrollTop, scrollHeight, clientHeight } = target; + if (scrollHeight - scrollTop - clientHeight < 50) { + const hasMore = shopPage.value * FILTER_PAGE_SIZE < shopTotal.value; + if (hasMore && !shopLoading.value) { + void fetchShopList(shopPage.value + 1, true); + } + } +} + +function handlePlatformDropdownVisibleChange(open: boolean) { + if (!open) return; + platformSearchKeyword.value = ''; + void fetchPlatformList(1, false); +} + +function handleShopDropdownVisibleChange(open: boolean) { + if (!open) return; + shopSearchKeyword.value = ''; + void fetchShopList(1, false); +} const workbenchData = ref(null); const workbenchLoading = ref(false); @@ -202,12 +358,10 @@ const workbenchExportContext = computed(() => ({ dateRange.value[1].format('YYYY-MM-DD'), ], taxRate: taxRate.value, - ...(selectedPlatformSlug.value !== 'all' - ? { platformId: Number(selectedPlatformSlug.value) } - : {}), - ...(selectedShopSlug.value !== 'all' - ? { shopId: Number(selectedShopSlug.value) } + ...(parseSelectedPlatformId() != null + ? { platformId: parseSelectedPlatformId()! } : {}), + ...(parseSelectedShopId() != null ? { shopId: parseSelectedShopId()! } : {}), })); async function fetchWorkbenchSummary() { @@ -221,11 +375,13 @@ async function fetchWorkbenchSummary() { ], taxRate: taxRate.value, }; - if (selectedPlatformSlug.value !== 'all') { - query.platformId = Number(selectedPlatformSlug.value); + const platformId = parseSelectedPlatformId(); + if (platformId != null) { + query.platformId = platformId; } - if (selectedShopSlug.value !== 'all') { - query.shopId = Number(selectedShopSlug.value); + const shopId = parseSelectedShopId(); + if (shopId != null) { + query.shopId = shopId; } workbenchData.value = await getWorkbenchSummaryApi(query); } catch (e: unknown) { @@ -239,20 +395,6 @@ async function fetchWorkbenchSummary() { } } -async function loadShopAndPlatformMeta() { - try { - const [platList, shopRes] = await Promise.all([ - getActivePlatformsApi(), - getShopPageApi({ page: 1, pageSize: 500, filters: {} }), - ]); - platforms.value = platList ?? []; - shops.value = shopRes?.records ?? []; - } catch { - message.error('店铺或平台列表加载失败'); - } - metaLoaded.value = true; -} - const activeTab = ref('finance'); function handleShopNavigate(shopId: number) { @@ -263,9 +405,15 @@ function handleShopNavigate(shopId: number) { } function handleProductNavigate(productId: number) { + const shopId = parseSelectedShopId(); router.push({ path: `/ecom/product/overview/${productId}`, - query: buildOverviewRouteQuery(dateRange.value), + query: buildOverviewRouteQuery( + dateRange.value, + shopId != null && Number.isFinite(shopId) && shopId > 0 + ? { shopId } + : undefined, + ), }); } @@ -323,7 +471,6 @@ watch( let darkObserver: MutationObserver | null = null; onMounted(async () => { - await loadShopAndPlatformMeta(); await fetchWorkbenchSummary(); setTimeout(() => { void redrawActiveTabCharts(); @@ -338,6 +485,8 @@ onMounted(async () => { }); onUnmounted(() => { + if (platformSearchTimer) clearTimeout(platformSearchTimer); + if (shopSearchTimer) clearTimeout(shopSearchTimer); darkObserver?.disconnect(); darkObserver = null; }); @@ -403,7 +552,7 @@ onUnmounted(() => { class="workbench-filter-platform-shop w-full min-w-0 rounded-2xl border border-slate-200 bg-slate-200/50 p-1.5 sm:w-auto sm:max-w-[min(calc(100vw-2.5rem),56rem)] dark:border-[hsl(240deg_3.7%_22%)] dark:bg-[hsl(240deg_3.7%_15.9%/30%)]" >
{
{
@@ -566,16 +749,8 @@ onUnmounted(() => { ref="periodCompareTabRef" :active-tab="activeTab" :tax-rate="taxRate" - :platform-id=" - selectedPlatformSlug !== 'all' - ? Number(selectedPlatformSlug) - : undefined - " - :shop-id=" - selectedShopSlug !== 'all' - ? Number(selectedShopSlug) - : undefined - " + :platform-id="parseSelectedPlatformId()" + :shop-id="parseSelectedShopId()" /> @@ -645,6 +820,7 @@ onUnmounted(() => { min-height: 2.125rem !important; display: flex !important; align-items: center !important; + padding-inline: 10px 28px !important; background-color: rgb(255 255 255 / 0.92) !important; } @@ -662,7 +838,37 @@ onUnmounted(() => { color: rgb(15 23 42) !important; } +/* 搜索态:输入框与光标垂直居中(平台/店铺共用) */ +:deep(.workbench-header-select .ant-select-selection-wrap) { + position: relative !important; + display: flex !important; + align-items: center !important; + flex: 1 1 auto !important; + min-width: 0 !important; + min-height: 1.25rem; + align-self: center !important; +} +:deep(.workbench-header-select .ant-select-selection-search) { + position: absolute !important; + inset-inline-start: 10px !important; + inset-inline-end: 28px !important; + top: 50% !important; + bottom: auto !important; + transform: translateY(-50%) !important; + display: flex !important; + align-items: center !important; + height: 1.25rem !important; + margin-inline-start: 0 !important; +} + +:deep(.workbench-header-select .ant-select-selection-search-input) { + height: 1.25rem !important; + line-height: 1.25rem !important; + padding: 0 !important; + margin: 0 !important; + vertical-align: middle !important; +} /* 店铺:在通用样式之后覆盖,选中项可换行以显示完整店名 */ :deep(.workbench-header-select.workbench-shop-select.ant-select) { @@ -674,9 +880,15 @@ onUnmounted(() => { ) { height: auto !important; min-height: 2.125rem !important; - align-items: flex-start !important; - padding-top: 6px !important; - padding-bottom: 6px !important; + align-items: center !important; + padding-block: 6px !important; + padding-inline: 10px 28px !important; +} + +:deep(.workbench-header-select.workbench-shop-select .ant-select-arrow) { + top: 50% !important; + margin-top: 0 !important; + transform: translateY(-50%) !important; } :deep( @@ -694,6 +906,7 @@ onUnmounted(() => { overflow: visible !important; text-overflow: clip !important; line-height: 1.35 !important; + align-self: center !important; } :deep(.tax-rate-input .ant-input-number-input) { diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/product/overview/components/TimeRangeBar.vue b/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/product/overview/components/TimeRangeBar.vue index c6ebe17a..7b3f4cab 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/product/overview/components/TimeRangeBar.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/product/overview/components/TimeRangeBar.vue @@ -1,10 +1,17 @@ @@ -249,7 +452,21 @@ const pageTitle = computed(() => overviewData.value?.productName || '商品概 diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/shop/overview/components/ProductComparisonTable.vue b/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/shop/overview/components/ProductComparisonTable.vue index e0581e82..5a800531 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/shop/overview/components/ProductComparisonTable.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/shop/overview/components/ProductComparisonTable.vue @@ -1,11 +1,15 @@ diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/shop/overview/components/TimeRangeBar.vue b/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/shop/overview/components/TimeRangeBar.vue index 1e4c8406..eda8ebf9 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/shop/overview/components/TimeRangeBar.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/shop/overview/components/TimeRangeBar.vue @@ -1,10 +1,15 @@