mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 05:09:19 +08:00
fix(store-overview): 修复重命名后的类型报错
- shopComparisons 类型修正(ShopOverview 非数组) - Segmented options 移除 readonly约束 - 删除未使用的 toggleSort/sortIcon/route/useRoute - 修复 profitAfterTax 可能为 undefined 的比较 - 删除废弃的 product/overview/tabs/OverviewTab.vue
This commit is contained in:
+1
-1
@@ -53,7 +53,7 @@ const modeOptions = [
|
||||
{ label: '平台汇总', value: 'platform' },
|
||||
{ label: '店铺汇总', value: 'shop' },
|
||||
{ label: '品类汇总', value: 'category' },
|
||||
] as const;
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
+1
@@ -9,6 +9,7 @@ interface Props {
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
void props; // kept for template compatibility
|
||||
|
||||
const formatAmount = (amount: number) => {
|
||||
return `¥${amount.toLocaleString('zh-CN')}`;
|
||||
|
||||
+1
-13
@@ -85,19 +85,7 @@ const sortedData = computed(() => {
|
||||
});
|
||||
});
|
||||
|
||||
const toggleSort = (field: string) => {
|
||||
if (sortField.value === field) {
|
||||
sortOrder.value = sortOrder.value === 'desc' ? 'asc' : 'desc';
|
||||
} else {
|
||||
sortField.value = field;
|
||||
sortOrder.value = 'desc';
|
||||
}
|
||||
};
|
||||
|
||||
const sortIcon = (field: string) => {
|
||||
if (sortField.value !== field) return '';
|
||||
return sortOrder.value === 'desc' ? '↓' : '↑';
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -339,7 +327,7 @@ const sortIcon = (field: string) => {
|
||||
{{ totalData.roi !== undefined ? totalData.roi.toFixed(2) : '-' }}
|
||||
</td>
|
||||
<td class="bg-emerald-100 dark:bg-emerald-900/30 p-6 text-base"
|
||||
:class="totalData.profitAfterTax >= 0 ? 'text-emerald-600' : 'text-rose-600'"
|
||||
:class="(totalData.profitAfterTax ?? 0) >= 0 ? 'text-emerald-600' : 'text-rose-600'"
|
||||
>
|
||||
{{ totalData.profitAfterTax ? formatAmount(totalData.profitAfterTax) : '-' }}
|
||||
</td>
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
ref,
|
||||
watch,
|
||||
} from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
import { Page } from '@vben/common-ui';
|
||||
|
||||
@@ -31,7 +31,6 @@ defineOptions({ name: 'CompanyOverview' });
|
||||
|
||||
// 路由
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
// 响应式数据
|
||||
const loading = ref(false);
|
||||
@@ -356,12 +355,13 @@ const handleExportCompanyOverview = async () => {
|
||||
|
||||
let dataToExport: CompanyOverviewVO.ShopComparison[] = [];
|
||||
if (overviewData.value?.shopComparisons) {
|
||||
const shops = overviewData.value.shopComparisons.shops;
|
||||
dataToExport =
|
||||
selectedExportShopIds.value.length > 0
|
||||
? overviewData.value.shopComparisons.filter((s) =>
|
||||
? shops.filter((s) =>
|
||||
selectedExportShopIds.value.includes(s.shopId),
|
||||
)
|
||||
: overviewData.value.shopComparisons;
|
||||
: shops;
|
||||
}
|
||||
|
||||
let shopIds: number[] | undefined;
|
||||
|
||||
Reference in New Issue
Block a user