diff --git a/src/views/usergold/clientCountBalance.vue b/src/views/usergold/clientCountBalance.vue index ce4d2ba..5c33ec1 100644 --- a/src/views/usergold/clientCountBalance.vue +++ b/src/views/usergold/clientCountBalance.vue @@ -35,7 +35,9 @@ const getmarket = async () => { console.log('获取地区数据成功', result) // 假设后端返回的是字符串数组,转换为 { value, label } 格式 if (Array.isArray(result.data) && typeof result.data[0] === 'string') { - market.value = result.data.map(item => ({ value: item, label: item })); + market.value = result.data + .filter(item => item !== null && item !== undefined && item.trim() !== '') // 过滤空值 + .map(item => ({ value: item, label: item })); } else { market.value = result.data; } diff --git a/src/views/usergold/clientCountDetail.vue b/src/views/usergold/clientCountDetail.vue index 829c084..eee5735 100644 --- a/src/views/usergold/clientCountDetail.vue +++ b/src/views/usergold/clientCountDetail.vue @@ -101,7 +101,9 @@ const getArea = async () => { }); // 假设后端返回的是字符串数组,转换为 { value, label } 格式 if (Array.isArray(result.data) && typeof result.data[0] === 'string') { - market.value = result.data.map(item => ({ value: item, label: item })); + market.value = result.data + .filter(item => item !== null && item !== undefined && item.trim() !== '') // 过滤空值 + .map(item => ({ value: item, label: item })); } else { market.value = result.data; } diff --git a/src/views/workspace/index.vue b/src/views/workspace/index.vue index ff245f5..0652dc2 100644 --- a/src/views/workspace/index.vue +++ b/src/views/workspace/index.vue @@ -408,8 +408,12 @@ const processData = (data) => { dailyRefund.value = yesterdayRefund.toFixed(2) yearlyRechargeNum.value = summary.yearlyRechargeNum - sumWow.value = (summary.sumWow / length.value).toFixed(2) - sumDaily.value = (summary.sumDaily / length.value).toFixed(2) + + // // 周同比 + // sumWow.value = (marketCards.sumWow / length.value).toFixed(2) + // // 日环比 + // sumDaily.value = (marketCards.sumDaily / length.value).toFixed(2) + rechargeNum.value = summary.rechargeNum firstRecharge.value = summary.firstRecharge } @@ -712,6 +716,11 @@ const getCardData = async () => { try { const response = await API({ url: '/workbench/getCard', data: {} }) workDataUpdateTime.value = response.updateTime + // 周同比 + sumWow.value = response.sumWow .toFixed(2) + // 日环比 + sumDaily.value = response.sumDaily.toFixed(2) + if (response && response.data) { processData(response.data) } else if (Array.isArray(response?.marketCards)) {