feat: 重要事件聚合视图 + stats 英文键格式加固
- normalizeKV 显式识别 intl 英文键格式(importance/count、event_type/count、source/count),不再依赖键顺序 - 新增"重要事件"视图 Tab:跨日报聚合(/api/news/events/),支持 天数/重要度/类型 筛选,复用事件行渲染 - 兼容文档 v1.1:intl sentiment 对象格式、finance news.event_types 对象格式
This commit is contained in:
+34
-1
@@ -35,7 +35,7 @@
|
||||
.badge-neg { @apply bg-red-100 text-red-700; }
|
||||
.badge-neu { @apply bg-gray-200 text-gray-600; }
|
||||
|
||||
.type-tab {
|
||||
.type-tab, .view-tab {
|
||||
@apply px-4 py-2 rounded-lg text-sm font-medium text-gray-500 hover:text-primary hover:bg-primary/5 transition-colors cursor-pointer;
|
||||
}
|
||||
.tab-active { @apply bg-primary text-white hover:text-white hover:bg-primary shadow-sm; }
|
||||
@@ -148,6 +148,10 @@
|
||||
<!-- 筛选栏 -->
|
||||
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-4 mb-6">
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
<div class="flex bg-gray-100 rounded-lg p-1">
|
||||
<span class="view-tab tab-active" data-view="list">日报列表</span>
|
||||
<span class="view-tab" data-view="events">重要事件</span>
|
||||
</div>
|
||||
<div class="flex bg-gray-100 rounded-lg p-1">
|
||||
<span class="type-tab tab-active" data-type="">全部</span>
|
||||
<span class="type-tab" data-type="finance">国内</span>
|
||||
@@ -169,6 +173,35 @@
|
||||
<div id="reportList" class="space-y-4"></div>
|
||||
</div>
|
||||
|
||||
<!-- 重要事件聚合视图 -->
|
||||
<div id="eventsView" class="hidden">
|
||||
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-4 mb-4">
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
<span class="text-sm text-gray-500">近</span>
|
||||
<select id="evDays" class="filter-input">
|
||||
<option value="7" selected>7</option>
|
||||
<option value="14">14</option>
|
||||
<option value="30">30</option>
|
||||
</select>
|
||||
<span class="text-sm text-gray-500">天 · 重要度 ≥</span>
|
||||
<select id="evImportance" class="filter-input">
|
||||
<option value="4" selected>4</option>
|
||||
<option value="5">5</option>
|
||||
<option value="3">3</option>
|
||||
</select>
|
||||
<span class="text-sm text-gray-500">类型</span>
|
||||
<select id="evType" class="filter-input">
|
||||
<option value="">全部</option>
|
||||
<option value="finance">国内</option>
|
||||
<option value="intl">国际</option>
|
||||
</select>
|
||||
<button id="btnEvQuery" class="btn-primary"><i class="fa-solid fa-magnifying-glass mr-1"></i>查询</button>
|
||||
</div>
|
||||
<div class="mt-3 text-sm text-gray-400" id="eventsInfo"></div>
|
||||
</div>
|
||||
<div id="eventsList"></div>
|
||||
</div>
|
||||
|
||||
<!-- 详情视图 -->
|
||||
<div id="detailView" class="hidden">
|
||||
<div class="flex items-center justify-between mb-4 flex-wrap gap-2">
|
||||
|
||||
Reference in New Issue
Block a user