Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7586f9c63 |
No files matched your search
+3
-1
@@ -32,4 +32,6 @@ coverage
|
||||
/playwright-report/
|
||||
/playwright/.cache/
|
||||
# Webkit with playwright creates a salt file
|
||||
salt
|
||||
salt
|
||||
# 本地离线构建用(基于已有镜像,非仓库产物)
|
||||
Dockerfile.offline
|
||||
@@ -2,6 +2,15 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
## Version 2026.10.16-it-tools-pro
|
||||
|
||||
### 📈 「当天最热股票」改为「AI 最热股票」
|
||||
- 股票列选项卡「最热」→「AI最热」,列标题 → 「AI最热股票」
|
||||
- 数据源从「全市场涨幅榜」改为**聚合 12 个 AI 概念板块**(人工智能、AI 芯片、算力概念、AI 应用、AI 智能体、多模态 AI、AIGC 概念、CPO 概念、智谱 AI 概念、AI 语料、国产芯片、存储芯片),约 580 只成分股去重
|
||||
- **按成交额降序**取最热 10 只(涨幅榜常年被小盘股占据,成交额榜才是资金真正关注的主线龙头),行内显示「现价 · 成交额」
|
||||
- 交易时段每 60 秒自动刷新,标题行显示 交易中/休市 徽章
|
||||
- 自选股选项卡不变
|
||||
|
||||
## Version 2026.10.14-it-tools-pro
|
||||
|
||||
### 🎨 面单模板全部去掉头部背景色带
|
||||
|
||||
@@ -2613,6 +2613,22 @@ _ITHOME_RSS = "https://www.ithome.com/rss/" # IT之家:权威中文 IT 资讯
|
||||
_STOCK_URL = ("https://push2.eastmoney.com/api/qt/clist/get?pn=1&pz=10&po=1&np=1"
|
||||
"&fltt=2&invt=2&fid=f3&fs=m:0+t:6,m:0+t:80,m:1+t:2,m:1+t:23&fields=f12,f14,f3")
|
||||
|
||||
# AI 相关概念板块(东方财富 board code)——「AI 最热」股票列的股票池来源
|
||||
_AI_STOCK_BOARDS = [
|
||||
"BK0800", # 人工智能
|
||||
"BK1127", # AI 芯片
|
||||
"BK1134", # 算力概念
|
||||
"BK1629", # AI 应用
|
||||
"BK0809", # AI 智能体
|
||||
"BK1153", # 多模态 AI
|
||||
"BK1111", # AIGC 概念
|
||||
"BK1128", # CPO 概念
|
||||
"BK1182", # 智谱 AI 概念
|
||||
"BK1172", # AI 语料
|
||||
"BK0891", # 国产芯片
|
||||
"BK1137", # 存储芯片
|
||||
]
|
||||
|
||||
|
||||
def _cst_now():
|
||||
return _dt.now(_CST)
|
||||
@@ -2716,6 +2732,48 @@ def _fetch_stock():
|
||||
return out
|
||||
|
||||
|
||||
def _fetch_ai_stock():
|
||||
"""「AI 最热」:聚合 AI 概念板块成分股,按成交额降序取前 10。
|
||||
用成交额而非涨幅排序——涨幅榜常年被小盘股占据,成交额榜才是资金真正关注的主线龙头。"""
|
||||
pool = {}
|
||||
for bk in _AI_STOCK_BOARDS:
|
||||
url = ("https://push2.eastmoney.com/api/qt/clist/get?pn=1&pz=200&po=1&np=1"
|
||||
"&fltt=2&invt=2&fid=f6"
|
||||
f"&fs=b:{bk}&fields=f2,f3,f6,f12,f14")
|
||||
try:
|
||||
j = json.loads(_http_get(OPENER_DIRECT, url))
|
||||
except Exception as e: # noqa: BLE001
|
||||
print(f"[news] ai board {bk} failed: {e}", flush=True)
|
||||
continue
|
||||
diff = ((j.get("data") or {}).get("diff")) or []
|
||||
if isinstance(diff, dict):
|
||||
diff = list(diff.values())
|
||||
for r in diff:
|
||||
code, name = str(r.get("f12") or ""), str(r.get("f14") or "")
|
||||
pct, price, turn = r.get("f3"), r.get("f2"), r.get("f6")
|
||||
if not code or not name or not isinstance(pct, (int, float)):
|
||||
continue
|
||||
turn = turn if isinstance(turn, (int, float)) else 0
|
||||
# 同一只股票可能属于多个板块,取最大成交额并集
|
||||
if code not in pool or turn > pool[code]["turn"]:
|
||||
pool[code] = {"code": code, "name": name, "pct": pct,
|
||||
"price": price, "turn": turn}
|
||||
if not pool:
|
||||
return []
|
||||
today = _cst_now().strftime("%m-%d")
|
||||
out = []
|
||||
for s in sorted(pool.values(), key=lambda x: -x["turn"])[:10]:
|
||||
price = s["price"]
|
||||
price_s = f"{price}" if isinstance(price, (int, float)) else "-"
|
||||
out.append({
|
||||
"title": f"{s['name']} {s['code']} {s['pct']:+.2f}%",
|
||||
"desc": f"现价 {price_s} · 成交额 {s['turn'] / 1e8:.1f}亿",
|
||||
"url": f"https://quote.eastmoney.com/{s['code']}.html",
|
||||
"time": today,
|
||||
})
|
||||
return out
|
||||
|
||||
|
||||
_STOCK_QUOTE_CACHE = {"t": 0, "key": "", "val": []}
|
||||
|
||||
|
||||
@@ -2854,7 +2912,7 @@ def _fetch_news():
|
||||
lambda: _parse_rss(_http_get(OPENER_PROXY, _TC_AI_RSS)))
|
||||
_col("it", "IT\u6700\u65b0\u6280\u672f", "\U0001f4bb",
|
||||
lambda: _parse_rss(_http_get(OPENER_DIRECT, _ITHOME_RSS)))
|
||||
_col("stock", "\u5f53\u5929\u6700\u70ed\u80a1\u7968", "\U0001f4c8", _fetch_stock)
|
||||
_col("stock", "AI\u6700\u70ed\u80a1\u7968", "\U0001f4c8", _fetch_ai_stock)
|
||||
|
||||
# 翻译:world/ai 英文标题与简介、github 英文简介(it=IT之家中文、stock 中文均免翻)
|
||||
en_title_keys = {"world", "ai"}
|
||||
@@ -2930,14 +2988,14 @@ def _market_status():
|
||||
|
||||
|
||||
def _refresh_stock_if_stale(data, max_age=60):
|
||||
"""「当天最热股票」列高频刷新:交易时段内按需重抓(其余 4 列仍每天 08:00 更新)。
|
||||
"""「AI 最热股票」列高频刷新:交易时段内按需重抓(其余 4 列仍每天 08:00 更新)。
|
||||
失败/非交易时段直接返回原数据,绝不影响 /news 正常返回。"""
|
||||
try:
|
||||
if not data.get("columns") or not _is_trading_time():
|
||||
return data
|
||||
if time.time() - float(data.get("stock_updated") or 0) < max_age:
|
||||
return data
|
||||
fresh = _fetch_stock()
|
||||
fresh = _fetch_ai_stock()
|
||||
if not fresh:
|
||||
return data
|
||||
for c in data["columns"]:
|
||||
|
||||
+2
-2
@@ -26,8 +26,8 @@ const groups: { title: string; items: Item[] }[] = [
|
||||
{
|
||||
title: '首页资讯',
|
||||
items: [
|
||||
{ name: '每日资讯 5 列', icon: '讯', desc: '首页顶部并排 5 列:GitHub 热榜、国际新闻、AI 资讯、IT 最新技术、当天最热股票;每天 08:00 自动抓取更新,英文标题与简介自动翻译中文,点标题新标签打开原文', tag: '全新' },
|
||||
{ name: '最热股票实时刷新', icon: '股', desc: '交易时段(工作日 9:30-15:00)每 60 秒自动拉取东方财富最新涨幅;标题行显示 交易中/休市 状态徽章,收盘后与周末自动休市', tag: '全新' },
|
||||
{ name: '每日资讯 5 列', icon: '讯', desc: '首页顶部并排 5 列:GitHub 热榜、国际新闻、AI 资讯、IT 最新技术、AI 最热股票;每天 08:00 自动抓取更新,英文标题与简介自动翻译中文,点标题新标签打开原文', tag: '全新' },
|
||||
{ name: 'AI 最热股票实时刷新', icon: '股', desc: '交易时段(工作日 9:30-15:00)每 60 秒自动拉取东方财富数据;聚合人工智能、AI 芯片、算力概念、AI 应用等 12 个 AI 概念板块(约 580 只成分股)按成交额排序取最热 10 只,标题行显示 交易中/休市 状态徽章', tag: '全新' },
|
||||
{ name: '自选股', icon: '自', desc: '股票列「自选」选项卡:输入 6 位代码即可添加,行内看 名称·涨跌幅·现价,红涨绿跌,一键移出;自选股登录后云端同步,换电脑即恢复', tag: '全新' },
|
||||
{ name: '首页推荐与全部工具', icon: '首', desc: '管理员可配置首页「精选推荐」工具位;「近期新功能」随版本滚动更新;「全部工具」默认折叠并显示总数徽章,各分组标题右侧均显示功能数量', tag: '全新' },
|
||||
],
|
||||
|
||||
@@ -43,8 +43,8 @@ onMounted(async () => {
|
||||
catch { /* 无推荐则隐藏 */ }
|
||||
});
|
||||
|
||||
// 每日 5 列资讯:GITHUB/国际新闻/AI资讯/IT最新技术/当天最热股票
|
||||
// 前 4 列 relay 每天 08:00 抓取;「当天最热股票」交易时段 60s 高频刷新
|
||||
// 每日 5 列资讯:GITHUB/国际新闻/AI资讯/IT最新技术/AI最热股票
|
||||
// 前 4 列 relay 每天 08:00 抓取;「AI最热股票」交易时段 60s 高频刷新
|
||||
const newsCols = ref<any[]>([]);
|
||||
const newsDate = ref('');
|
||||
const newsMarket = ref<'open' | 'closed' | ''>('');
|
||||
@@ -74,7 +74,7 @@ onUnmounted(() => {
|
||||
if (newsTimer) clearInterval(newsTimer);
|
||||
});
|
||||
|
||||
// ===== 股票列选项卡:最热 / 自选(自选实时行情,登录后随云同步)=====
|
||||
// ===== 股票列选项卡:AI最热 / 自选(自选实时行情,登录后随云同步)=====
|
||||
const MY_STOCKS_KEY = 'it-tools-my-stocks';
|
||||
const stockTab = ref<'hot' | 'mine'>('hot');
|
||||
const stockInput = ref('');
|
||||
@@ -213,7 +213,7 @@ function onUpdateFavoriteTools() {
|
||||
>{{ newsMarket === 'open' ? '交易中' : '休市' }}</span>
|
||||
</div>
|
||||
<div v-if="col.key === 'stock'" class="stock-tabs">
|
||||
<button class="stock-tab" :class="{ on: stockTab === 'hot' }" @click="switchStockTab('hot')">最热</button>
|
||||
<button class="stock-tab" :class="{ on: stockTab === 'hot' }" @click="switchStockTab('hot')">AI最热</button>
|
||||
<button class="stock-tab" :class="{ on: stockTab === 'mine' }" @click="switchStockTab('mine')">自选<template v-if="myStocks.length">·{{ myStocks.length }}</template></button>
|
||||
</div>
|
||||
<div class="news-list">
|
||||
@@ -233,7 +233,7 @@ function onUpdateFavoriteTools() {
|
||||
<button class="mystock-x" title="移出自选" @click="removeMyStock(q.code)">✕</button>
|
||||
</div>
|
||||
</template>
|
||||
<!-- 最热(默认) -->
|
||||
<!-- AI 最热(默认):AI 概念板块成分股按成交额排序 -->
|
||||
<template v-else>
|
||||
<a
|
||||
v-for="(it, i) in col.items"
|
||||
|
||||
Reference in new issue
Block a user