mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 19:49:28 +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 {
|
interface Emits {
|
||||||
(e: 'export'): void;
|
(e: 'export'): void;
|
||||||
(e: 'exportAll'): void;
|
(e: 'exportAll'): void;
|
||||||
(e: 'exportToggle'): void;
|
(e: 'exportToggle', enabled: boolean): void;
|
||||||
(e: 'categorySelectAll'): void;
|
(e: 'categorySelectAll', event: Event): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps<Props>();
|
const props = defineProps<Props>();
|
||||||
@@ -41,7 +41,7 @@ watch(activeMode, (val) => localStorage.setItem(STORAGE_KEY, val));
|
|||||||
const modeOptions = [
|
const modeOptions = [
|
||||||
{ label: '商品汇总', value: 'product' },
|
{ label: '商品汇总', value: 'product' },
|
||||||
{ label: '品类汇总', value: 'category' },
|
{ label: '品类汇总', value: 'category' },
|
||||||
] as const;
|
];
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -70,8 +70,8 @@ const modeOptions = [
|
|||||||
:selected-export-category-ids="props.selectedExportCategoryIds"
|
:selected-export-category-ids="props.selectedExportCategoryIds"
|
||||||
:category-export-loading="props.categoryExportLoading"
|
:category-export-loading="props.categoryExportLoading"
|
||||||
@export-all="emit('exportAll')"
|
@export-all="emit('exportAll')"
|
||||||
@export-toggle="emit('exportToggle')"
|
@export-toggle="(enabled) => emit('exportToggle', enabled)"
|
||||||
@category-select-all="emit('categorySelectAll')"
|
@category-select-all="(event) => emit('categorySelectAll', event)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
ref,
|
ref,
|
||||||
watch,
|
watch,
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
import { Page } from '@vben/common-ui';
|
import { Page } from '@vben/common-ui';
|
||||||
import { message, Spin, Tag } from 'ant-design-vue';
|
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 StatCards from './components/StatCards.vue';
|
||||||
import SalesTrendChart from './components/SalesTrendChart.vue';
|
import SalesTrendChart from './components/SalesTrendChart.vue';
|
||||||
import FinancialPanel from './components/FinancialPanel.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';
|
import ProductCategorySwitcher from './components/ProductCategorySwitcher.vue';
|
||||||
|
|
||||||
defineOptions({ name: 'ShopOverview' });
|
defineOptions({ name: 'ShopOverview' });
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
// 店铺ID(从路由参数获取)
|
// 店铺ID(从路由参数获取)
|
||||||
const shopId = computed(() => {
|
const shopId = computed(() => {
|
||||||
@@ -285,7 +282,7 @@ const handleCategorySelectAllChange = (event: Event) => {
|
|||||||
const target = event.target as HTMLInputElement | null;
|
const target = event.target as HTMLInputElement | null;
|
||||||
if (!target) return;
|
if (!target) return;
|
||||||
selectedExportCategoryIds.value = target.checked
|
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