Files
xiaobai-review/frontend/shared/context.js
T
总工andmultica-agent fa82b8621e feat(HEL-566): 去掉主站行情管理入口并修好模型列表收起
主站行情管理并入数据中枢
- 数据中枢数据源配置页新增「主站行情任务」卡:交易时段后台刷新开关、
  手动后台刷新、历史区间回补(任务提交 + 轮询主站 job 记录亮灯),
  数据与调度仍归主站,控制台只经桥接代操作
- 新增桥接端点 /api/hub-admin/market/{refresh,backfill};回补改为
  market.backfill 后台任务(jobs.config.json 注册,锁独立,超时 30 分钟),
  桥接调用秒回,不再阻塞
- 主站桌面端删除顶栏「行情管理」按钮与整个行情管理对话框,清理随之
  失效的 CSS;移动端删除 system/admin 页与入口,管理员专区只留数据中枢
- Tushare Token / iFinD 凭证编辑沿用数据源页既有凭证区,无功能缺失

模型池收起修复
- 拉出模型清单后按钮切换为「收起列表」,收起只留一行摘要;再次点击
  重新拉取并展开;勾选添加完成后清单自动收起(原逻辑保留)
- 交互全部沿用 HEL-558 已确认样式的既有按钮与提示组件,未新增视觉

自测
- verify_baseline 通过;pytest 492 项通过;数据中枢 240 项通过
- verify_datahub_console 新增 [11b] 行情任务桥接端到端段;UI 自测新增
  行情任务卡开关往返、模型清单展开/收起/再展开/添加自动收起,日夜主题
  与 1030 窄屏复验通过
- Playwright e2e 102/103:唯一失败项在基线提交上同样失败(本机字体度量
  导致的头部溢出,与本卡无关)

Co-authored-by: multica-agent <github@multica.ai>
2026-09-16 17:24:05 +08:00

220 lines
6.3 KiB
JavaScript

const {
clamp,
displayCompactDate,
escapeHtml,
formatNumber,
formatTimestamp,
localDateString,
number,
parseLocalDate,
todayString,
} = window.XiaobaiUI;
const {
emptyStateHtml,
renderEmptyState,
} = window.XiaobaiComponents;
const state = window.XiaobaiState.create({
session: {
user: null,
csrfToken: "",
authMode: "login",
started: false,
activeView: "sentimentCycleView",
dashboardLoading: false,
dashboardRequestSequence: 0,
dashboardRequestDate: "",
adminModels: [],
globalSearchResults: [],
globalSearchActiveIndex: -1,
globalSearchRequestSequence: 0,
},
market: {
dashboard: null,
filter: "all",
query: "",
sortKey: "streak",
sortDirection: "desc",
brokenQuery: "",
brokenSortKey: "",
brokenSortDirection: "desc",
downQuery: "",
downSortKey: "",
downSortDirection: "asc",
yesterdayFilter: "all",
yesterdayQuery: "",
yesterdaySortKey: "",
yesterdaySortDirection: "desc",
dragonTiger: null,
dragonViewMode: "daily",
dragonFilter: "all",
dragonQuery: "",
selectedDragonTraderId: "",
hotMoneyProfiles: null,
hotMoneyProfileQuery: "",
selectedHotMoneyProfileId: "",
rotationHistory: null,
rotationHistoryKey: "",
rotationSelectedSector: "",
rotationSelectedDate: "",
rotationMembers: null,
rotationMembersKey: "",
rotationMembersLoading: false,
rotationOrder: localStorage.getItem("xiaobaiRotationOrder") === "latest" ? "latest" : "oldest",
rotationLoading: false,
auctionData: null,
auctionDataset: "focus",
auctionFilter: "all",
auctionQuery: "",
auctionSortKey: "attention_score",
auctionSortDirection: "desc",
auctionLoading: false,
auctionTimer: null,
themeLibrary: null,
themeQuery: "",
selectedThemeCode: "",
themeDetail: null,
themeLoading: false,
popularityData: null,
popularitySource: "combined",
popularityQuery: "",
popularityLoading: false,
expandedLadderLevels: new Set(),
ladderSortMode: "time",
sentimentHistory: null,
sentimentRange: 20,
sentimentHistoryKey: "",
sentimentLoading: false,
},
details: {
stockDetail: null,
activeStock: null,
stockDetailChartMode: "daily",
stockDetailIntraday: null,
stockDetailRequestSequence: 0,
entityDetailItem: null,
entityDetailPayload: null,
entityDetailChartMode: "daily",
entityDetailIntraday: null,
entityDetailRequestSequence: 0,
stockPreviewCode: "",
stockPreviewType: "stock",
stockPreviewItem: null,
stockPreviewPayload: null,
stockPreviewChart: "daily",
stockPreviewFallback: null,
initialStockOpened: false,
},
review: {
watchlist: [],
watchlistSelection: null,
watchlistSearchResults: [],
watchlistSearchRequestSequence: 0,
editingDailyNoteId: 0,
notes: [],
tradeEntries: [],
tradeSummary: {},
editingTradeId: 0,
alerts: [],
alertFilter: "all",
alertUnreadCount: 0,
assistantMessages: [],
assistantLoading: false,
assistantController: null,
},
screener: {
screenerSetup: null,
screenerSetupKey: "",
screenerSetupRequestKey: "",
screenerSetupPromise: null,
selectedRegime: "",
selectedStrategy: null,
customStrategyDraft: null,
screenerRunning: false,
screenerRunningMode: "",
screenerResults: { smart: null, curated: null, quant: null },
screenerResultContexts: { smart: null, curated: null, quant: null },
screenerResultStore: {},
screenerArchiveView: "latest",
screenerTracking: null,
screenerMode: ["smart", "curated", "quant"].includes(localStorage.getItem("xiaobaiScreenerMode"))
? localStorage.getItem("xiaobaiScreenerMode")
: "smart",
curatedCategory: "全部",
curatedSchool: "全部",
curatedQuery: "",
curatedViewMode: localStorage.getItem("xiaobaiCuratedViewMode") === "grid" ? "grid" : "list",
selectedCuratedStrategyId: 0,
quantFilters: [],
quantScores: [],
screenerMobileView: "strategy",
},
mentor: {
mentorSetup: null,
selectedMentorId: "",
mentorMessages: [],
mentorLoading: false,
mentorQuery: "",
mentorGrade: "all",
mentorDirectoryOpen: false,
mentorSortMode: false,
mentorSavingPreferences: false,
mentorController: null,
},
heaven: {
heavenSetup: null,
heavenManualData: null,
personalField: null,
heavenPanel: "trend",
heavenInterpretations: { trend: "", fortune: "", heart: "" },
heavenReadingMode: "trend",
heavenReadingTab: "current",
heavenReadingHistory: { trend: [], fortune: [], heart: [] },
heavenReadingSelectedId: 0,
heavenReadingLoading: false,
heavenReadingError: "",
heartStage: "intro",
heartTimer: null,
heartSeconds: HEART_BREATH_TOTAL_MS / 1000,
heartBreathingEndsAt: 0,
heartLines: [],
heartThrows: [],
heartHexagram: null,
heartQuestion: "",
heartQuestionPreset: "custom",
heartCastAt: "",
heartCurtainTimer: null,
heartStageToken: 0,
heartRevealToken: 0,
heavenPerformanceKey: "",
heavenPerformancePanels: new Set(),
heavenPerformanceActive: "",
heavenRequestSequence: 0,
},
});
const elements = {
tradeDate: document.querySelector("#tradeDate"),
loading: document.querySelector("#loadingOverlay"),
toast: document.querySelector("#toast"),
stockDialog: document.querySelector("#stockDialog"),
tradeLogDialog: document.querySelector("#tradeLogDialog"),
watchlistDialog: document.querySelector("#watchlistDialog"),
alertsDialog: document.querySelector("#alertsDialog"),
assistantDialog: document.querySelector("#assistantDialog"),
heavenReadingDialog: document.querySelector("#heavenReadingDialog"),
globalSearchDialog: document.querySelector("#globalSearchDialog"),
globalSearchInput: document.querySelector("#globalSearchInput"),
globalSearchResults: document.querySelector("#globalSearchResults"),
entityDetailDialog: document.querySelector("#entityDetailDialog"),
entityDetailChart: document.querySelector("#entityDetailChart"),
settingsDialog: document.querySelector("#settingsDialog"),
priceChart: document.querySelector("#priceChart"),
stockPreview: document.querySelector("#stockPreview"),
stockPreviewBackdrop: document.querySelector("#stockPreviewBackdrop"),
stockPreviewChart: document.querySelector("#stockPreviewChart"),
};