feat: Studio 概览/分析补上阅读量 + 详情页 meta 行改版
- StudioOverview 新增 TotalViews 字段,GetOverviewByUserID 查询含 SUM(views_count) - 新增 ViewTrendStore 接口和 AggregateViewsByAuthor,UNION ALL 合并已登录+访客阅读日志按日期聚合 - 数据分析页面新增阅读量趋势折线图(绿色,Chart.js) - 概览和数据分析页面新增总阅读量统计卡片 - 详情页 meta 行改为标签格式:作者/阅读/点赞/收藏/评论/发布时间 - 移除详情页公开状态徽章,已锁定+理由仅作者可见
This commit is contained in:
@ -37,6 +37,13 @@
|
||||
<span class="stat-card-label">草稿</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-card-icon">👁</div>
|
||||
<div class="stat-card-body">
|
||||
<span class="stat-card-value">{{.Overview.TotalViews}}</span>
|
||||
<span class="stat-card-label">总阅读量</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="studio-section">
|
||||
@ -78,6 +85,13 @@
|
||||
</div>
|
||||
<div class="trends-loading" id="favoritesLoading">加载中...</div>
|
||||
</div>
|
||||
<div class="trends-card">
|
||||
<h3 class="trends-card-title">阅读量</h3>
|
||||
<div class="trends-chart-wrap">
|
||||
<canvas id="viewsChart"></canvas>
|
||||
</div>
|
||||
<div class="trends-loading" id="viewsLoading">加载中...</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
@ -98,7 +112,8 @@
|
||||
energy: { border: '#f59e0b', bg: 'rgba(245, 158, 11, 0.1)' },
|
||||
comments: { border: '#3b82f6', bg: 'rgba(59, 130, 246, 0.1)' },
|
||||
likes: { border: '#ef4444', bg: 'rgba(239, 68, 68, 0.1)' },
|
||||
favorites: { border: '#8b5cf6', bg: 'rgba(139, 92, 246, 0.1)' }
|
||||
favorites: { border: '#8b5cf6', bg: 'rgba(139, 92, 246, 0.1)' },
|
||||
views: { border: '#10b981', bg: 'rgba(16, 185, 129, 0.1)' }
|
||||
};
|
||||
|
||||
function fillDates(points, days) {
|
||||
@ -193,8 +208,9 @@
|
||||
showLoading('commentsLoading');
|
||||
showLoading('likesLoading');
|
||||
showLoading('favoritesLoading');
|
||||
showLoading('viewsLoading');
|
||||
|
||||
var canvasIds = ['energyChart', 'commentsChart', 'likesChart', 'favoritesChart'];
|
||||
var canvasIds = ['energyChart', 'commentsChart', 'likesChart', 'favoritesChart', 'viewsChart'];
|
||||
canvasIds.forEach(function (id) {
|
||||
var canvas = document.getElementById(id);
|
||||
canvas.style.display = 'none';
|
||||
@ -217,7 +233,8 @@
|
||||
{ id: 'energyChart', key: 'energy', color: chartColors.energy, label: '赋能值', loading: 'energyLoading' },
|
||||
{ id: 'commentsChart', key: 'comments', color: chartColors.comments, label: '评论', loading: 'commentsLoading' },
|
||||
{ id: 'likesChart', key: 'likes', color: chartColors.likes, label: '点赞', loading: 'likesLoading' },
|
||||
{ id: 'favoritesChart', key: 'favorites', color: chartColors.favorites, label: '收藏', loading: 'favoritesLoading' }
|
||||
{ id: 'favoritesChart', key: 'favorites', color: chartColors.favorites, label: '收藏', loading: 'favoritesLoading' },
|
||||
{ id: 'viewsChart', key: 'views', color: chartColors.views, label: '阅读', loading: 'viewsLoading' }
|
||||
];
|
||||
|
||||
maps.forEach(function (m) {
|
||||
|
||||
Reference in New Issue
Block a user