feat: 投资资讯日报查询页 + 文档更新 + 拉取服务器最新内容

- 新增 charts/news_reports.php 报告查询导航页(列表+详情一体,fetch API 渲染)
- 新增 js/newsReports.js:AI 摘要/新闻联播/财经新闻/公告调研/数据总览固定模块,stats 归一化兼容多种格式
- index-2.php 研究报告卡片改为导航链接,移除 PHP 目录下拉框
- 更新 AGENTS.md/CLAUDE.md(路径、页面清单、数据模式等核实修正)
- 同步服务器拉取的文档:quant 使用手册、podcast-docs
- 生成 continuation.md 会话检查点
This commit is contained in:
2026-08-05 20:28:57 +08:00
parent 60fb1b95e1
commit 8ea9b48a9a
10 changed files with 1717 additions and 128 deletions
+5 -58
View File
@@ -144,55 +144,10 @@
</div>
<h3 class="text-lg font-semibold">研究报告</h3>
</div>
<p class="text-gray-600 text-sm mb-4">按日期查看研究报告</p>
<?php
$researchDir = __DIR__ . '/research';
$dateDirs = [];
foreach (glob($researchDir . '/*', GLOB_ONLYDIR) as $d) {
$bn = basename($d);
if (preg_match('/^\d{8}$/', $bn)) {
$dateDirs[] = $bn;
}
}
rsort($dateDirs);
if (empty($dateDirs)): ?>
<div class="p-4 border border-gray-200 rounded-lg text-gray-500 text-center">
<i class="fa-solid fa-inbox mr-2"></i>暂无日期归档的研究报告
</div>
<?php else: ?>
<div class="mb-4">
<select id="reportDate" name="reportDate"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50"
onchange="showReportGroup(this.value)">
<option value="">-- 选择日期 --</option>
<?php foreach ($dateDirs as $d): ?>
<option value="<?= $d ?>"><?= substr($d,0,4).'-'.substr($d,4,2).'-'.substr($d,6,2) ?></option>
<?php endforeach; ?>
</select>
</div>
<?php foreach ($dateDirs as $d):
$htmls = glob("$researchDir/$d/*.html");
if (empty($htmls)) continue;
?>
<div class="report-group" id="report-<?= $d ?>" style="display:none;">
<div class="text-xs text-gray-400 mb-2 font-medium"><?= substr($d,0,4).'-'.substr($d,4,2).'-'.substr($d,6,2) ?></div>
<div class="space-y-2">
<?php foreach ($htmls as $f):
$content = file_get_contents($f);
preg_match('/<title>(.*?)<\/title>/i', $content, $m);
$title = !empty($m[1]) ? $m[1] : basename($f);
$relPath = ltrim(str_replace(__DIR__, '', $f), '/');
?>
<a href="/<?= $relPath ?>" target="_blank"
class="flex items-center p-2 border border-gray-200 rounded-lg hover:bg-gray-50 transition-all text-sm">
<i class="fa-solid fa-file-lines text-indigo-500 w-5 mr-2"></i>
<span><?= htmlspecialchars($title) ?></span>
</a>
<?php endforeach; ?>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>
<p class="text-gray-600 text-sm mb-4">国内 / 国际投资资讯日报,按日期分模块查看,含 AI 摘要、新闻联播要闻、重要事件与数据总览</p>
<a href="/charts/news_reports.php" class="inline-flex items-center px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors text-sm font-medium">
查看报告 <i class="fa-solid fa-arrow-right ml-2"></i>
</a>
</div>
<!-- 宏观研究数据卡片 -->
<div class="bg-white rounded-xl shadow-md p-6 card-hover">
@@ -278,21 +233,13 @@
<script>
// 模拟打开链接的函数
function openurl(url) {
function openurl(url) {
let ts_code = $("#ts_code").val();
url = url + '?ts_code='+ ts_code;
console.log(url);
window.open(url);
}
function showReportGroup(date) {
document.querySelectorAll('.report-group').forEach(el => el.style.display = 'none');
if (date) {
const target = document.getElementById('report-' + date);
if (target) target.style.display = 'block';
}
}
// 股票搜索功能
document.getElementById('search-stock').addEventListener('click', function() {
const stockCode = document.getElementById('ts_code').value.trim();