mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 07:09:20 +08:00
fix(shop-overview): 修复品类汇总全选及类型定义问题
- ProductCategorySwitcher 修复 emit 类型声明,exportToggle / categorySelectAll 正确传递参数 - 修复 categoryComparisons 路径为 categoryOverview.categories - 移除未使用的 import 和变量引用
This commit is contained in:
+5
-5
@@ -22,8 +22,8 @@ interface Props {
|
||||
interface Emits {
|
||||
(e: 'export'): void;
|
||||
(e: 'exportAll'): void;
|
||||
(e: 'exportToggle'): void;
|
||||
(e: 'categorySelectAll'): void;
|
||||
(e: 'exportToggle', enabled: boolean): void;
|
||||
(e: 'categorySelectAll', event: Event): void;
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
@@ -41,7 +41,7 @@ watch(activeMode, (val) => localStorage.setItem(STORAGE_KEY, val));
|
||||
const modeOptions = [
|
||||
{ label: '商品汇总', value: 'product' },
|
||||
{ label: '品类汇总', value: 'category' },
|
||||
] as const;
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -70,8 +70,8 @@ const modeOptions = [
|
||||
:selected-export-category-ids="props.selectedExportCategoryIds"
|
||||
:category-export-loading="props.categoryExportLoading"
|
||||
@export-all="emit('exportAll')"
|
||||
@export-toggle="emit('exportToggle')"
|
||||
@category-select-all="emit('categorySelectAll')"
|
||||
@export-toggle="(enabled) => emit('exportToggle', enabled)"
|
||||
@category-select-all="(event) => emit('categorySelectAll', event)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
ref,
|
||||
watch,
|
||||
} from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
import { Page } from '@vben/common-ui';
|
||||
import { message, Spin, Tag } from 'ant-design-vue';
|
||||
@@ -29,14 +29,11 @@ import TimeRangeBar from './components/TimeRangeBar.vue';
|
||||
import StatCards from './components/StatCards.vue';
|
||||
import SalesTrendChart from './components/SalesTrendChart.vue';
|
||||
import FinancialPanel from './components/FinancialPanel.vue';
|
||||
import ProductComparisonTable from './components/ProductComparisonTable.vue';
|
||||
import CategoryComparisonTable from './components/CategoryComparisonTable.vue';
|
||||
import ProductCategorySwitcher from './components/ProductCategorySwitcher.vue';
|
||||
|
||||
defineOptions({ name: 'ShopOverview' });
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
// 店铺ID(从路由参数获取)
|
||||
const shopId = computed(() => {
|
||||
@@ -285,7 +282,7 @@ const handleCategorySelectAllChange = (event: Event) => {
|
||||
const target = event.target as HTMLInputElement | null;
|
||||
if (!target) return;
|
||||
selectedExportCategoryIds.value = target.checked
|
||||
? (overviewData.value?.categoryComparisons?.map((c) => c.categoryId) ?? [])
|
||||
? (overviewData.value?.categoryOverview?.categories?.map((c: ShopVO.CategoryComparison) => c.categoryId) ?? [])
|
||||
: [];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user