更新welcome

This commit is contained in:
云泽网
2025-05-19 22:38:27 +08:00
parent e65f150df7
commit 1840d6f8aa
5 changed files with 926 additions and 122 deletions
@@ -1,4 +1,4 @@
<?php /*a:3:{s:51:"E:\Demo\PHP\yunzer\app\admin\view\index\welcome.php";i:1747663514;s:51:"E:\Demo\PHP\yunzer\app\admin\view\public\header.php";i:1746890051;s:49:"E:\Demo\PHP\yunzer\app\admin\view\public\tail.php";i:1745855804;}*/ ?>
<?php /*a:3:{s:51:"E:\Demo\PHP\yunzer\app\admin\view\index\welcome.php";i:1747665416;s:51:"E:\Demo\PHP\yunzer\app\admin\view\public\header.php";i:1746890051;s:49:"E:\Demo\PHP\yunzer\app\admin\view\public\tail.php";i:1745855804;}*/ ?>
<!DOCTYPE html>
<html>
<head>
@@ -305,22 +305,22 @@
<div class="stats-container">
<div class="stat-card">
<div class="stat-title">用户总数</div>
<div class="stat-value"><?php echo htmlentities((string) number_format($stats['total_users'])); ?></div>
<div class="stat-value"><?php echo htmlentities((string) number_format($todayStats['total_users'])); ?></div>
<div class="stat-icon">👥</div>
</div>
<div class="stat-card">
<div class="stat-title">今日访问</div>
<div class="stat-value"><?php echo htmlentities((string) number_format($stats['daily_visits'])); ?></div>
<div class="stat-value"><?php echo htmlentities((string) number_format($todayStats['daily_visits'])); ?></div>
<div class="stat-icon">📊</div>
</div>
<div class="stat-card">
<div class="stat-title">文章总数</div>
<div class="stat-value"><?php echo htmlentities((string) number_format($stats['total_articles'])); ?></div>
<div class="stat-value"><?php echo htmlentities((string) number_format($todayStats['total_articles'])); ?></div>
<div class="stat-icon">📝</div>
</div>
<div class="stat-card">
<div class="stat-title">资源总数</div>
<div class="stat-value"><?php echo htmlentities((string) number_format($stats['total_resources'])); ?></div>
<div class="stat-value"><?php echo htmlentities((string) number_format($todayStats['total_resources'])); ?></div>
<div class="stat-icon">📦</div>
</div>
</div>
@@ -598,7 +598,6 @@ function initVisitTrend() {
// 用户增长图表
function initUserGrowth() {
var chart = echarts.init(document.getElementById('userGrowth'));
window.userChart = chart;
var option = {
tooltip: {
trigger: 'axis',
@@ -621,7 +620,7 @@ function initUserGrowth() {
xAxis: {
type: 'category',
boundaryGap: false,
data: []
data: <?php echo htmlentities((string) json_encode($chartData['userGrowth']['dates'])); ?>
},
yAxis: {
type: 'value'
@@ -630,7 +629,7 @@ function initUserGrowth() {
{
name: '新增用户',
type: 'bar',
data: [],
data: <?php echo htmlentities((string) json_encode($chartData['userGrowth']['newUsers'])); ?>,
itemStyle: {
color: '#3881fd'
}
@@ -639,7 +638,7 @@ function initUserGrowth() {
name: '总用户数',
type: 'line',
smooth: true,
data: [],
data: <?php echo htmlentities((string) json_encode($chartData['userGrowth']['totalUsers'])); ?>,
itemStyle: {
color: '#10b981'
},
@@ -655,7 +654,6 @@ function initUserGrowth() {
// 资源统计图表
function initResourceStats() {
var chart = echarts.init(document.getElementById('resourceStats'));
window.resourceChart = chart;
var option = {
tooltip: {
trigger: 'axis',
@@ -667,7 +665,7 @@ function initResourceStats() {
}
},
legend: {
data: ['新增资源', '总资源数']
data: ['新增资源', '总资源数', '下载量']
},
grid: {
left: '3%',
@@ -678,7 +676,7 @@ function initResourceStats() {
xAxis: {
type: 'category',
boundaryGap: false,
data: []
data: <?php echo htmlentities((string) json_encode($chartData['resourceStats']['dates'])); ?>
},
yAxis: {
type: 'value'
@@ -687,7 +685,7 @@ function initResourceStats() {
{
name: '新增资源',
type: 'bar',
data: [],
data: <?php echo htmlentities((string) json_encode($chartData['resourceStats']['newResources'])); ?>,
itemStyle: {
color: '#3881fd'
}
@@ -696,13 +694,25 @@ function initResourceStats() {
name: '总资源数',
type: 'line',
smooth: true,
data: [],
data: <?php echo htmlentities((string) json_encode($chartData['resourceStats']['totalResources'])); ?>,
itemStyle: {
color: '#10b981'
},
lineStyle: {
width: 3
}
},
{
name: '下载量',
type: 'line',
smooth: true,
data: <?php echo htmlentities((string) json_encode($chartData['resourceStats']['downloads'])); ?>,
itemStyle: {
color: '#f59e0b'
},
lineStyle: {
width: 3
}
}
]
};
@@ -712,7 +722,6 @@ function initResourceStats() {
// 文章统计图表
function initArticleStats() {
var chart = echarts.init(document.getElementById('articleStats'));
window.articleChart = chart;
var option = {
tooltip: {
trigger: 'axis',
@@ -724,7 +733,7 @@ function initArticleStats() {
}
},
legend: {
data: ['新增文章', '总文章数']
data: ['新增文章', '总文章数', '浏览量']
},
grid: {
left: '3%',
@@ -735,7 +744,7 @@ function initArticleStats() {
xAxis: {
type: 'category',
boundaryGap: false,
data: []
data: <?php echo htmlentities((string) json_encode($chartData['articleStats']['dates'])); ?>
},
yAxis: {
type: 'value'
@@ -744,7 +753,7 @@ function initArticleStats() {
{
name: '新增文章',
type: 'bar',
data: [],
data: <?php echo htmlentities((string) json_encode($chartData['articleStats']['newArticles'])); ?>,
itemStyle: {
color: '#3881fd'
}
@@ -753,13 +762,25 @@ function initArticleStats() {
name: '总文章数',
type: 'line',
smooth: true,
data: [],
data: <?php echo htmlentities((string) json_encode($chartData['articleStats']['totalArticles'])); ?>,
itemStyle: {
color: '#10b981'
},
lineStyle: {
width: 3
}
},
{
name: '浏览量',
type: 'line',
smooth: true,
data: <?php echo htmlentities((string) json_encode($chartData['articleStats']['views'])); ?>,
itemStyle: {
color: '#f59e0b'
},
lineStyle: {
width: 3
}
}
]
};
@@ -768,18 +789,32 @@ function initArticleStats() {
// 初始化所有图表
document.addEventListener('DOMContentLoaded', function() {
initVisitTrend();
initUserGrowth();
initResourceStats();
initArticleStats();
// 监听窗口大小变化,重绘图表
window.addEventListener('resize', function() {
var charts = document.querySelectorAll('.chart-container');
charts.forEach(function(chart) {
echarts.getInstanceByDom(chart)?.resize();
// 确保ECharts已加载
if (typeof echarts === 'undefined') {
console.error('ECharts未加载');
return;
}
// 初始化图表
try {
initVisitTrend();
initUserGrowth();
initResourceStats();
initArticleStats();
// 监听窗口大小变化,重绘图表
window.addEventListener('resize', function() {
var charts = document.querySelectorAll('.chart-container');
charts.forEach(function(chart) {
var instance = echarts.getInstanceByDom(chart);
if (instance) {
instance.resize();
}
});
});
});
} catch (error) {
console.error('初始化图表失败:', error);
}
});
</script>