统计:修复错误

(cherry picked from commit 661e72bcfd)
This commit is contained in:
owen 2023-10-16 13:15:17 +08:00 committed by shizhong
parent 3c51e98682
commit eddac7c9be
2 changed files with 10 additions and 11 deletions

View File

@ -145,7 +145,7 @@ const summary = ref<MemberSummaryRespVO>() // 会员统计数据
const areaStatisticsList = shallowRef<MemberAreaStatisticsRespVO[]>() // const areaStatisticsList = shallowRef<MemberAreaStatisticsRespVO[]>() //
// //
echarts?.registerMap('china', china!) echarts?.registerMap('china', china as any)
/** 会员终端统计图配置 */ /** 会员终端统计图配置 */
const terminalChartOptions = reactive<EChartsOption>({ const terminalChartOptions = reactive<EChartsOption>({
@ -207,8 +207,8 @@ const areaChartOptions = reactive<EChartsOption>({
formatter: (params: any) => { formatter: (params: any) => {
return `${params?.data?.areaName || params?.name}<br/> return `${params?.data?.areaName || params?.name}<br/>
会员数量${params?.data?.userCount || 0}<br/> 会员数量${params?.data?.userCount || 0}<br/>
订单创建数量${params?.data?.orderCreateCount || 0}<br/> 订单创建数量${params?.data?.orderCreateUserCount || 0}<br/>
订单支付数量${params?.data?.orderPayCount || 0}<br/> 订单支付数量${params?.data?.orderPayUserCount || 0}<br/>
订单支付金额${fenToYuan(params?.data?.orderPayPrice || 0)}` 订单支付金额${fenToYuan(params?.data?.orderPayPrice || 0)}`
} }
}, },
@ -254,20 +254,20 @@ const getMemberAreaStatisticsList = async () => {
}) })
let min = 0 let min = 0
let max = 0 let max = 0
areaChartOptions.series[0].data = areaStatisticsList.value.map((item) => { areaChartOptions.series![0].data = areaStatisticsList.value.map((item) => {
min = Math.min(min, item.orderPayCount) min = Math.min(min, item.orderPayUserCount || 0)
max = Math.max(max, item.orderPayCount) max = Math.max(max, item.orderPayUserCount || 0)
return { ...item, name: item.areaName, value: item.orderPayCount || 0 } return { ...item, name: item.areaName, value: item.orderPayUserCount || 0 }
}) })
areaChartOptions.visualMap.min = min areaChartOptions.visualMap!['min'] = min
areaChartOptions.visualMap.max = max areaChartOptions.visualMap!['max'] = max
} }
/** 按照性别,查询会员统计列表 */ /** 按照性别,查询会员统计列表 */
const getMemberSexStatisticsList = async () => { const getMemberSexStatisticsList = async () => {
const list = await MemberStatisticsApi.getMemberSexStatisticsList() const list = await MemberStatisticsApi.getMemberSexStatisticsList()
const dictDataList = getIntDictOptions(DICT_TYPE.SYSTEM_USER_SEX) const dictDataList = getIntDictOptions(DICT_TYPE.SYSTEM_USER_SEX)
sexChartOptions.series[0].data = dictDataList.map((dictData: DictDataType) => { sexChartOptions.series![0].data = dictDataList.map((dictData: DictDataType) => {
const userCount = list.find((item: MemberSexStatisticsRespVO) => item.sex === dictData.value) const userCount = list.find((item: MemberSexStatisticsRespVO) => item.sex === dictData.value)
?.userCount ?.userCount
return { return {

View File

@ -225,7 +225,6 @@ defineOptions({ name: 'TradeStatistics' })
const message = useMessage() // const message = useMessage() //
const loading = ref(true) //
const trendLoading = ref(true) // const trendLoading = ref(true) //
const exportLoading = ref(false) // const exportLoading = ref(false) //
const summary = ref<DataComparisonRespVO<TradeSummaryRespVO>>() // const summary = ref<DataComparisonRespVO<TradeSummaryRespVO>>() //