fix some bug
This commit is contained in:
@@ -23,6 +23,7 @@ import type {
|
||||
import type { Order } from '@/model/order'
|
||||
import type { Balance } from '@/model/product'
|
||||
import { usePrice } from '@core/utils/usePrice'
|
||||
import { DASHBOARD_RIAL_UNIT, formatDashboardAmount } from '@/pages/dashboard/dashboardFormat'
|
||||
import { toJalali } from '@core/utils/useDataTime'
|
||||
import { metalLabel } from '@/utils/adminMetalLabels'
|
||||
import { isMobile } from '@core/utils/is'
|
||||
@@ -278,11 +279,12 @@ export function useDashboardPage() {
|
||||
const sood = finance.value?.fullPriceSood ?? 0
|
||||
const karmozd = finance.value?.fullPriceKarmozd ?? finance.value?.fullPriceKaermozd ?? 0
|
||||
const gifts = finance.value?.GiftsPrise ?? 0
|
||||
const total = finance.value?.totalTradingProfit ?? sood + karmozd
|
||||
|
||||
return {
|
||||
...chartSurfaceOptions(),
|
||||
chart: { type: 'donut', fontFamily: 'inherit', offsetY: 4, foreColor: chartSurfaceOptions().chart.foreColor },
|
||||
labels: ['سود معامله', metalLabel.goldCommission(), metalLabel.goldGifts()],
|
||||
labels: ['سود اسپرد', 'کارمزد معامله', 'ارزش هدایا (گرم)'],
|
||||
colors: ['#10b981', '#f59e0b', '#8b5cf6'],
|
||||
legend: {
|
||||
position: 'bottom',
|
||||
@@ -300,15 +302,15 @@ export function useDashboardPage() {
|
||||
show: true,
|
||||
total: {
|
||||
show: true,
|
||||
label: 'درآمد خالص',
|
||||
formatter: () => usePrice(finance.value?.sumAll ?? 0, true, ''),
|
||||
label: 'جمع سود معاملات',
|
||||
formatter: () => `${formatDashboardAmount(total)} ${DASHBOARD_RIAL_UNIT}`,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
tooltip: {
|
||||
y: { formatter: (v: number) => usePrice(v, true, '') },
|
||||
y: { formatter: (v: number) => `${formatDashboardAmount(v)} ${DASHBOARD_RIAL_UNIT}` },
|
||||
},
|
||||
series: [sood, karmozd, gifts],
|
||||
}
|
||||
@@ -409,7 +411,7 @@ export function useDashboardPage() {
|
||||
},
|
||||
tooltip: {
|
||||
x: { format: tooltipDateFormat },
|
||||
y: { formatter: (v: number) => usePrice(v, true, '') },
|
||||
y: { formatter: (v: number) => `${formatDashboardAmount(v)} ${DASHBOARD_RIAL_UNIT}` },
|
||||
},
|
||||
series: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user