K线本地缓存、图表交互优化与交易记录表格修复

新增 kline_store 优先读本地库;修复加载中遮挡、支持缩放与交易时段刷新;修复交易记录操作列被裁切。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-15 17:27:31 +08:00
parent a9f4e2b1a5
commit b804bd19a7
7 changed files with 505 additions and 80 deletions
+3 -1
View File
@@ -30,6 +30,7 @@ from fee_specs import (
from fee_sync import sync_fees_from_akshare
from contract_profile import get_contract_profile
from stats_engine import STATS_VIEWS, load_stats_cache, refresh_stats_cache
from kline_store import ensure_kline_tables
from kline_chart import generate_review_kline_chart, fetch_market_klines, MARKET_PERIODS
from market import get_price as market_get_price, set_ths_refresh_token, get_quote_source_label
@@ -303,6 +304,7 @@ def init_db():
(key TEXT PRIMARY KEY,
data_json TEXT NOT NULL,
updated_at TEXT NOT NULL)''')
ensure_kline_tables(conn)
conn.commit()
conn.close()
@@ -1321,7 +1323,7 @@ def api_kline():
if not symbol:
return jsonify({"error": "请提供合约代码"}), 400
try:
data = fetch_market_klines(symbol, period)
data = fetch_market_klines(symbol, period, DB_PATH)
except Exception as exc:
app.logger.warning("kline api failed: %s", exc)
return jsonify({"error": str(exc)}), 500