From 36200767999d31f2401612dadf75bc78ce563cd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=89=AF=28004796=29?= Date: Tue, 27 Feb 2024 19:35:28 +0800 Subject: [PATCH 1/2] init --- src/views/dashboard/PanelGroup.vue | 68 ++++++++++++++++-------------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/src/views/dashboard/PanelGroup.vue b/src/views/dashboard/PanelGroup.vue index 06581a1..9edb949 100644 --- a/src/views/dashboard/PanelGroup.vue +++ b/src/views/dashboard/PanelGroup.vue @@ -101,6 +101,7 @@ import CountTo from 'vue-count-to' import RankList from '@/views/components/rankList' import LineChart from '../dashboard/LineChart' +import { staticIndex } from '@/api/cai/static' const chartSelect = [ { label: '最近一周', key: '1' }, @@ -210,7 +211,6 @@ export default { handleDatePickerChange(value) { console.log('----value:', value); }, - handleChartTimeChange(val) { // todo }, @@ -219,40 +219,44 @@ export default { }, getTodayStatistics() { // todo fetch - const { - todayLoginNum, - todayLoginDiffLast, - anchorNum, - todayRechargeAmountNum, - todayRechargeNum, - todayRechargeAmountDiffLast, - todayWithdrawAmount, - todayWithdrawNum, - todayWithdrawAmountDiffLast - } = { - todayLoginNum: 100, - todayLoginDiffLast: 8.6, - anchorNum: 58, - todayRechargeAmountNum: 200, - todayRechargeNum: 10, - todayRechargeAmountDiffLast: 5.6, - todayWithdrawAmount: 500, - todayWithdrawNum: 1, - todayWithdrawAmountDiffLast: 5.9 - } - this.loginModel.count = todayLoginNum - this.loginModel.trendDirection = 1 // 增加还是减少 - this.loginModel.trendNum = todayLoginDiffLast + staticIndex().then(response => { + const { + todayLoginNum, + todayLoginDiffLast, + anchorNum, + todayRechargeAmountNum, + todayRechargeNum, + todayRechargeAmountDiffLast, + todayWithdrawAmount, + todayWithdrawNum, + todayWithdrawAmountDiffLast + } = response.data + /* { + todayLoginNum: 100, + todayLoginDiffLast: 8.6, + anchorNum: 58, + todayRechargeAmountNum: 200, + todayRechargeNum: 10, + todayRechargeAmountDiffLast: 5.6, + todayWithdrawAmount: 500, + todayWithdrawNum: 1, + todayWithdrawAmountDiffLast: 5.9 + } */ - this.topUpModel.count = anchorNum // 主播人数 + this.loginModel.count = todayLoginNum + this.loginModel.trendDirection = 1 // 增加还是减少 + this.loginModel.trendNum = todayLoginDiffLast - this.withdrawDepositModel.count = todayRechargeAmountNum // 充值金额 - this.withdrawDepositModel.money = todayRechargeNum - this.withdrawDepositModel.trendNum = todayRechargeAmountDiffLast // 与昨日相比 + this.topUpModel.count = anchorNum // 主播人数 - this.anchorModel.count = todayWithdrawAmount - this.anchorModel.money = todayWithdrawNum - this.anchorModel.trendNum = todayWithdrawAmountDiffLast + this.withdrawDepositModel.count = todayRechargeAmountNum // 充值金额 + this.withdrawDepositModel.money = todayRechargeNum + this.withdrawDepositModel.trendNum = todayRechargeAmountDiffLast // 与昨日相比 + + this.anchorModel.count = todayWithdrawAmount + this.anchorModel.money = todayWithdrawNum + this.anchorModel.trendNum = todayWithdrawAmountDiffLast + }) } } } From 818d8eb8cb6a42da252843e36b8e92daf711c2df Mon Sep 17 00:00:00 2001 From: dute7liang <383200134@qq.com> Date: Tue, 27 Feb 2024 21:03:01 +0800 Subject: [PATCH 2/2] init --- src/api/cai/static.js | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/api/cai/static.js b/src/api/cai/static.js index 09b9e4e..74965db 100644 --- a/src/api/cai/static.js +++ b/src/api/cai/static.js @@ -1,5 +1,9 @@ import request from '@/utils/request' +/** + * 基础统计 + * @returns {*} + */ export function staticIndex() { return request({ url: '/cai/home/static/index', @@ -7,6 +11,20 @@ export function staticIndex() { }) } +/** + * 排行榜 + * @param rankType 类型 1-魅力榜 2-邀请榜 3-充值榜 4-提现榜 + * @param rankTime 时间统计 Day-日榜 Week-周榜 Month-月榜 Total-总榜 + * @returns 返回值 + * @Schema(description = "头像") + * private String avatar; + * @Schema(description = "昵称") + * private String nickname; + * @Schema(description = "蜜瓜号") + * private String usercode; + * @Schema(description = "数值") + * private Number value; + */ export function staticRank(rankType,rankTime) { return request({ url: '/cai/home/static/rank', @@ -17,6 +35,30 @@ export function staticRank(rankType,rankTime) { }) } +/** + * 折线图 + * @param beginDate 开始时间 yyyy-MM-dd + * @param endDate 结束时间 yyyy-MM-dd + * @returns {*} + * // x坐标 + * private List x = new ArrayList<>(); + * @Schema(description = "充值金额") + * private List expInMoneyData = new ArrayList<>(); + * @Schema(description = "充值订单数") + * private List orderCountData = new ArrayList<>(); + * @Schema(description = "提现金额") + * private List outMoneyData = new ArrayList<>(); + * @Schema(description = "提现数量") + * private List cashCountData = new ArrayList<>(); + * @Schema(description = "手工减少余额数") + * private List modifyCoinSubData = new ArrayList<>(); + * @Schema(description = "手工新增余额数") + * private List modifyCoinAddData = new ArrayList<>(); + * @Schema(description = "手工减少收益数") + * private List modifyIncomeSubData = new ArrayList<>(); + * @Schema(description = "手工新增余额数") + * private List modifyIncomeAddData = new ArrayList<>(); + */ export function staticAmountLine(beginDate,endDate) { return request({ url: '/cai/home/static/amountLine',