+
+
{{
scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
@@ -340,75 +289,50 @@ const handleCurrentChange = function (val) {
-
+
{{
(scope.row.currentPermanentGold +
scope.row.currentFreeJune +
scope.row.currentFreeDecember +
- scope.row.currentTaskGold) /100
+ scope.row.currentTaskGold) / 100
}}
-
+
- {{ Math.abs(scope.row.currentPermanentGold) /100 }}
+ {{ Math.abs(scope.row.currentPermanentGold) / 100 }}
-
+
- {{ scope.row.currentFreeJune /100 }}
+ {{ scope.row.currentFreeJune / 100 }}
-
+
- {{ scope.row.currentFreeDecember /100 }}
+ {{ scope.row.currentFreeDecember / 100 }}
-
+
- {{ Math.abs(scope.row.currentTaskGold) /100 }}
+ {{ Math.abs(scope.row.currentTaskGold) / 100 }}
- {{
- (scope.row.sumPermanentGold || 0) +
- (scope.row.sumFreeJune || 0) +
- (scope.row.sumFreeDecember || 0) +
- (scope.row.sumTaskGold || 0) /100
+ {{
+ (scope.row.sumPermanentGold || 0) +
+ (scope.row.sumFreeJune || 0) +
+ (scope.row.sumFreeDecember || 0) +
+ (scope.row.sumTaskGold || 0) / 100
}}
- {{ Math.abs(scope.row.sumConsume) /100 }}
+ {{ Math.abs(scope.row.sumConsume) / 100 }}
@@ -416,20 +340,14 @@ const handleCurrentChange = function (val) {
-
+
diff --git a/src/views/workspace/index.vue b/src/views/workspace/index.vue
index 9423cd7..b1d5bb5 100644
--- a/src/views/workspace/index.vue
+++ b/src/views/workspace/index.vue
@@ -9,7 +9,14 @@
@@ -93,7 +100,7 @@
@change="handleDateRangeChange"
value-format="YYYY-MM-DD HH:mm:ss"
/>
- 查询
+ 查询
@@ -134,12 +141,12 @@ import * as echarts from 'echarts'
import { ref, onMounted, nextTick, watch } from 'vue'
import API from '@/util/http'
import { ElMessage } from 'element-plus'
-
+import { Top, Bottom, SemiSelect } from '@element-plus/icons-vue'
// 地区数据
const markets = ref([])
// 图表相关
const activeTab = ref('recharge')
-const timeRange = ref('day')
+const timeRange = ref('')
const dateRange = ref([])
const selectedType = ref('all')
const tableData = ref([])
@@ -206,9 +213,9 @@ const processData = (data) => {
// 遍历市场
data.marketCards.forEach(market => {
- for (const key in summary) {
- if (market[key] !== undefined && market[key] !== null) { // 还应该卡一个number
- summary[key] += market[key]
+ for (const i in summary) {
+ if (market[i] !== undefined && market[i] !== null) { // 其实还应该卡一个number
+ summary[i] += market[i]
}
}
})
@@ -454,7 +461,7 @@ const updateChart = (chartData) => {
// 处理标签切换
const handleTabChange = () => {
- loadChart()
+ getChartData()
}
// 处理时间范围变化
@@ -468,7 +475,7 @@ const handleTimeRangeChange = () => {
endDate = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59)
} else if (timeRange.value === 'week') {
const day = now.getDay()
- const diff = now.getDate() - day + (day === 0 ? -6 : 1) // 调整到本周一
+ const diff = now.getDate() - day + (day === 0 ? -6 : 1)
startDate = new Date(now.setDate(diff))
startDate.setHours(0, 0, 0, 0)
endDate = new Date(now)
@@ -478,9 +485,10 @@ const handleTimeRangeChange = () => {
startDate = new Date(now.getFullYear(), now.getMonth(), 1)
endDate = new Date(now.getFullYear(), now.getMonth() + 1, 0)
endDate.setHours(23, 59, 59, 0)
- } else { // year
- startDate = '2025-01-01 00:00:00'
- endDate = '2025-12-31 23:59:59'
+ } else {
+ startDate = new Date(now.getFullYear(), 0, 1)
+ endDate = new Date(now.getFullYear(), 11, 31)
+ endDate.setHours(23, 59, 59, 0)
}
dateRange.value = [
@@ -488,7 +496,7 @@ const handleTimeRangeChange = () => {
formatDate(endDate)
]
- loadChart()
+ getChartData()
}
// 格式化日期为字符串
@@ -506,7 +514,7 @@ const formatDate = (date) => {
// 处理日期范围变化
const handleDateRangeChange = () => {
timeRange.value = 'custom'
- loadChart()
+ getChartData()
}
const getAdminData = async function () {
try {
@@ -517,11 +525,6 @@ const getAdminData = async function () {
console.log('请求失败', error)
}
}
-// 加载图表数据
-const loadChart = () => {
- getChartData()
-}
-
// 获取卡片数据
const getCardData = async () => {
try {
@@ -542,6 +545,7 @@ onMounted(async () => {
await getAdminData()
await getCardData()
await getMarkets()
+ await getChartData()
handleTimeRangeChange() // 初始化时间范围
})
diff --git a/stats.html b/stats.html
index 0886060..b131311 100644
--- a/stats.html
+++ b/stats.html
@@ -4929,7 +4929,7 @@ var drawChart = (function (exports) {