|
|
|
@ -43,6 +43,12 @@ |
|
|
|
<el-input v-model="tableAccount" placeholder="请输入账号" style="width: 150px" /> |
|
|
|
<el-select v-model="tableRegion" placeholder="请选择所属地区" style="width: 150px"> |
|
|
|
<el-option label="全部" value="all" /> |
|
|
|
<el-option |
|
|
|
v-for="item in regionOptions" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
|
|
|
|
<el-date-picker |
|
|
|
@ -55,8 +61,8 @@ |
|
|
|
style="width: 240px" |
|
|
|
/> |
|
|
|
|
|
|
|
<el-button type="primary" class="search-btn-small">搜索</el-button> |
|
|
|
<el-button type="primary" class="reset-btn-small">重置</el-button> |
|
|
|
<el-button type="primary" class="search-btn-small" @click="handleTableSearch">搜索</el-button> |
|
|
|
<el-button type="primary" class="reset-btn-small" @click="handleTableReset">重置</el-button> |
|
|
|
<el-button type="danger" class="export-btn-small">数据导出</el-button> |
|
|
|
<el-button type="danger" class="export-list-btn">查看导出列表</el-button> |
|
|
|
</div> |
|
|
|
@ -69,19 +75,23 @@ |
|
|
|
<el-table-column prop="loginCount" label="登录次数" width="100" align="center" /> |
|
|
|
<el-table-column prop="totalDuration" label="总停留时长" min-width="150" align="center" /> |
|
|
|
<el-table-column prop="avgDuration" label="平均停留时长" min-width="150" align="center" /> |
|
|
|
<el-table-column prop="deepMate" label="DeepMate" min-width="150" align="center" /> |
|
|
|
<el-table-column prop="deepExplore" label="深度探索" min-width="150" align="center" /> |
|
|
|
<el-table-column prop="deepMate" label="DeepMate" min-width="100" align="center" /> |
|
|
|
<el-table-column prop="deepExplore" label="深度探索" min-width="100" align="center" /> |
|
|
|
<el-table-column prop="marketInfo" label="行情" min-width="100" align="center" /> |
|
|
|
<el-table-column prop="updateTime" label="更新日期" min-width="150" align="center" /> |
|
|
|
</el-table> |
|
|
|
|
|
|
|
<div class="pagination-container"> |
|
|
|
<div class="total-count">共400条</div> |
|
|
|
<div class="total-count">共{{ total }}条</div> |
|
|
|
<el-pagination |
|
|
|
background |
|
|
|
layout="sizes, prev, pager, next, jumper" |
|
|
|
:total="400" |
|
|
|
:total="total" |
|
|
|
:page-sizes="[10, 20, 50, 100]" |
|
|
|
v-model:current-page="currentPage" |
|
|
|
v-model:page-size="pageSize" |
|
|
|
@current-change="handlePageChange" |
|
|
|
@size-change="handleSizeChange" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -92,7 +102,7 @@ |
|
|
|
import { ref, onMounted, nextTick, watch } from 'vue'; |
|
|
|
import { useRoute, useRouter } from 'vue-router'; |
|
|
|
import * as echarts from 'echarts'; |
|
|
|
import { getUserDeepChartTrend } from '../../api/platformData'; |
|
|
|
import { getUserDeepChartTrend, getDeepChartActiveUserList, getRegionsList } from '../../api/platformData'; |
|
|
|
|
|
|
|
const route = useRoute(); |
|
|
|
const router = useRouter(); |
|
|
|
@ -256,21 +266,106 @@ const tableAccount = ref(''); |
|
|
|
const tableRegion = ref(''); |
|
|
|
const tableDateRange = ref(''); |
|
|
|
const currentPage = ref(1); |
|
|
|
const pageSize = ref(50); |
|
|
|
const pageSize = ref(10); |
|
|
|
const total = ref(0); |
|
|
|
const regionOptions = ref([]); |
|
|
|
|
|
|
|
// 获取地区列表 |
|
|
|
const fetchRegionOptions = async () => { |
|
|
|
try { |
|
|
|
const res = await getRegionsList(); |
|
|
|
console.log("获取地区列表响应:", res); |
|
|
|
const data = res.data || res; |
|
|
|
if (data && data.list) { |
|
|
|
regionOptions.value = data.list.map(region => ({ label: region, value: region })); |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
console.error('获取地区列表失败:', e); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
// 表格数据 |
|
|
|
const tableData = ref([ |
|
|
|
{ index: 1, account: 'DC900480004', name: 'Thea Elowen Hale', region: '中国', loginCount: 99, totalDuration: '99小时99分钟99秒', avgDuration: '99小时99分钟99秒', deepMate: '99小时99分钟99秒', deepExplore: '99小时99分钟99秒' }, |
|
|
|
{ index: 2, account: 'DC900480004', name: '欧帝三萃', region: '美国', loginCount: 99, totalDuration: '99小时99分钟99秒', avgDuration: '99小时99分钟99秒', deepMate: '99小时99分钟99秒', deepExplore: '99小时99分钟99秒' }, |
|
|
|
{ index: 3, account: 'DC900480004', name: 'Thea Elowen Hale', region: '新加坡', loginCount: 99, totalDuration: '99小时99分钟99秒', avgDuration: '99小时99分钟99秒', deepMate: '99小时99分钟99秒', deepExplore: '99小时99分钟99秒' }, |
|
|
|
{ index: 4, account: 'DC900480004', name: 'viên แก้ว หลาว', region: '泰国', loginCount: 99, totalDuration: '99小时99分钟99秒', avgDuration: '99小时99分钟99秒', deepMate: '99小时99分钟99秒', deepExplore: '99小时99分钟99秒' }, |
|
|
|
{ index: 5, account: 'DC900480004', name: 'viên แก้ว หลาว', region: '越南', loginCount: 99, totalDuration: '99小时99分钟99秒', avgDuration: '99小时99分钟99秒', deepMate: '99小时99分钟99秒', deepExplore: '99小时99分钟99秒' }, |
|
|
|
{ index: 6, account: 'DC900480004', name: 'Cien Yong Hao', region: '中国', loginCount: 9999, totalDuration: '99小时99分钟99秒', avgDuration: '99小时99分钟99秒', deepMate: '99小时99分钟99秒', deepExplore: '99小时99分钟99秒' }, |
|
|
|
{ index: 7, account: 'DC900480004', name: 'Cien Yong Hao', region: '美国', loginCount: 999, totalDuration: '99小时99分钟99秒', avgDuration: '99小时99分钟99秒', deepMate: '99小时99分钟99秒', deepExplore: '99小时99分钟99秒' }, |
|
|
|
{ index: 8, account: 'DC900480004', name: 'Tiên Linh Vinh Hảo', region: '新加坡', loginCount: 999, totalDuration: '99小时99分钟99秒', avgDuration: '99小时99分钟99秒', deepMate: '99小时99分钟99秒', deepExplore: '99小时99分钟99秒' }, |
|
|
|
{ index: 9, account: 'DC900480004', name: 'Tiên Linh Vinh Hảo', region: '新加坡', loginCount: 999, totalDuration: '99小时99分钟99秒', avgDuration: '99小时99分钟99秒', deepMate: '99小时99分钟99秒', deepExplore: '99小时99分钟99秒' }, |
|
|
|
{ index: 10, account: 'DC900480004', name: 'Tiên Linh Vinh Hảo', region: '香港', loginCount: 999, totalDuration: '99小时99分钟99秒', avgDuration: '99小时99分钟99秒', deepMate: '99小时99分钟99秒', deepExplore: '99小时99分钟99秒' }, |
|
|
|
]); |
|
|
|
const tableData = ref([]); |
|
|
|
|
|
|
|
const handleTableSearch = () => { |
|
|
|
currentPage.value = 1; |
|
|
|
fetchTableData(); |
|
|
|
}; |
|
|
|
|
|
|
|
const handleTableReset = () => { |
|
|
|
tableAccount.value = ''; |
|
|
|
tableRegion.value = ''; |
|
|
|
tableDateRange.value = ''; |
|
|
|
currentPage.value = 1; |
|
|
|
fetchTableData(); |
|
|
|
}; |
|
|
|
|
|
|
|
const handlePageChange = (page) => { |
|
|
|
currentPage.value = page; |
|
|
|
fetchTableData(); |
|
|
|
}; |
|
|
|
|
|
|
|
const handleSizeChange = (size) => { |
|
|
|
pageSize.value = size; |
|
|
|
currentPage.value = 1; |
|
|
|
fetchTableData(); |
|
|
|
}; |
|
|
|
|
|
|
|
const fetchTableData = async () => { |
|
|
|
const params = { |
|
|
|
page: currentPage.value, |
|
|
|
page_size: pageSize.value |
|
|
|
}; |
|
|
|
|
|
|
|
if (tableAccount.value) params.jwcode = tableAccount.value; |
|
|
|
if (tableRegion.value && tableRegion.value !== 'all') params.region = tableRegion.value; |
|
|
|
|
|
|
|
if (tableDateRange.value && tableDateRange.value.length === 2) { |
|
|
|
params.startTime = formatDate(tableDateRange.value[0]); |
|
|
|
params.endTime = formatDate(tableDateRange.value[1]); |
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
const res = await getDeepChartActiveUserList(params); |
|
|
|
console.log("获取DeepChart活跃用户明细响应:", res); |
|
|
|
const data = res.data || res; // 兼容处理 |
|
|
|
|
|
|
|
if (data && data.list) { |
|
|
|
tableData.value = data.list.map((item, index) => ({ |
|
|
|
index: (currentPage.value - 1) * pageSize.value + index + 1, |
|
|
|
account: item.jwcode, |
|
|
|
name: item.username, |
|
|
|
region: item.region, |
|
|
|
loginCount: item.login_count, |
|
|
|
totalDuration: formatDuration(item.stay_time), |
|
|
|
avgDuration: formatDuration(item.avg_stay_time), |
|
|
|
deepMate: item.deepmate_count, |
|
|
|
deepExplore: item.dive_seek_count, |
|
|
|
marketInfo: item.market_info_count, // 行情登录次数 |
|
|
|
updateTime: item.update_time // 使用 update_time |
|
|
|
})); |
|
|
|
total.value = data.total || 0; |
|
|
|
} else { |
|
|
|
tableData.value = []; |
|
|
|
total.value = 0; |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
console.error('获取DeepChart活跃用户明细失败:', e); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
// 格式化时长 (秒 -> 时分秒) |
|
|
|
const formatDuration = (seconds) => { |
|
|
|
if (!seconds) return '0秒'; |
|
|
|
const h = Math.floor(seconds / 3600); |
|
|
|
const m = Math.floor((seconds % 3600) / 60); |
|
|
|
const s = seconds % 60; |
|
|
|
let str = ''; |
|
|
|
if (h > 0) str += `${h}小时`; |
|
|
|
if (m > 0) str += `${m}分钟`; |
|
|
|
if (s > 0) str += `${s}秒`; |
|
|
|
return str || '0秒'; |
|
|
|
}; |
|
|
|
|
|
|
|
const headerCellStyle = { |
|
|
|
background: '#f5f7fa', |
|
|
|
@ -292,6 +387,8 @@ const initChart = () => { |
|
|
|
onMounted(() => { |
|
|
|
nextTick(() => { |
|
|
|
initChart(); |
|
|
|
fetchTableData(); |
|
|
|
fetchRegionOptions(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
</script> |
|
|
|
|