mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 02:39:19 +08:00
refactor(workbench): 将工具函数移至utils/目录,修复税率浮点精度,调整趋势图与饼图宽度比例
This commit is contained in:
+1
-1
@@ -19,7 +19,7 @@ import {
|
||||
salesTaxColumnHint,
|
||||
} from '#/utils/overview-table-hints';
|
||||
|
||||
import { formatYuanDetail, yuanToWanNum } from '../../workbench-money';
|
||||
import { formatYuanDetail, yuanToWanNum } from '../../utils/money';
|
||||
|
||||
defineOptions({ name: 'WorkbenchPeriodCompareTab' });
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import { nextTick, onMounted, ref, watch } from 'vue';
|
||||
|
||||
import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
|
||||
|
||||
import { formatWanShort, formatYuanDetail } from '../../../workbench-money';
|
||||
import { formatWanShort, formatYuanDetail } from '../../../utils/money';
|
||||
|
||||
defineOptions({ name: 'WorkbenchFinanceCostPieChart' });
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ import type { WorkbenchVO } from '#/api/ecommerce/workbench/types';
|
||||
|
||||
import { Tooltip } from 'ant-design-vue';
|
||||
|
||||
import { formatWanShort, formatYuanDetail } from '../../../workbench-money';
|
||||
import { formatWanShort, formatYuanDetail } from '../../../utils/money';
|
||||
|
||||
defineOptions({ name: 'WorkbenchFinanceKpiGrid' });
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import { nextTick, onMounted, ref, watch } from 'vue';
|
||||
|
||||
import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
|
||||
|
||||
import { formatWanWithYuanDetail, yuanToWanNum } from '../../../workbench-money';
|
||||
import { formatWanWithYuanDetail, yuanToWanNum } from '../../../utils/money';
|
||||
|
||||
defineOptions({ name: 'WorkbenchFinanceTrendChart' });
|
||||
|
||||
|
||||
+3
-2
@@ -13,7 +13,7 @@ import {
|
||||
buildCategoryOverviewFromDimRows,
|
||||
buildPlatformOverviewFromDimRows,
|
||||
buildShopOverviewFromDimRows,
|
||||
} from '../../workbench-overview-bridge';
|
||||
} from '../../utils/overview-bridge';
|
||||
|
||||
defineOptions({ name: 'WorkbenchFinanceTab' });
|
||||
|
||||
@@ -76,10 +76,11 @@ defineExpose({ redraw });
|
||||
:yoy-compare-date-start="finance.yoyCompareDateStart"
|
||||
:yoy-compare-date-end="finance.yoyCompareDateEnd"
|
||||
/>
|
||||
<div class="grid grid-cols-1 gap-6 xl:grid-cols-2">
|
||||
<div class="grid grid-cols-1 gap-6 xl:grid-cols-3">
|
||||
<FinanceTrendChart
|
||||
ref="trendChartRef"
|
||||
:trend="finance.gmvTrend"
|
||||
class="xl:col-span-2"
|
||||
/>
|
||||
<FinanceCostPieChart
|
||||
ref="costPieRef"
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import {
|
||||
formatWanShort,
|
||||
formatYuanDetail,
|
||||
yuanToWanNum,
|
||||
} from '../../../workbench-money';
|
||||
} from '../../../utils/money';
|
||||
|
||||
defineOptions({ name: 'WorkbenchDimChartsCard' });
|
||||
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ const formatTaxRate = (value: null | number | string | undefined) => {
|
||||
if (value === null || value === undefined || value === '') return '';
|
||||
const num = Number(value);
|
||||
if (!Number.isFinite(num)) return '';
|
||||
return `${num * 100}%`;
|
||||
return `${Math.round(num * 100 * 1e10) / 1e10}%`;
|
||||
};
|
||||
|
||||
const parseTaxRate = (value: string | undefined) => {
|
||||
|
||||
Reference in New Issue
Block a user