mirror of
https://ghfast.top/https://github.com/aeroxw/tick-stock-panel.git
synced 2026-09-12 17:54:15 +08:00
分组卡片视图 (WatchlistGroupCards): - 新增整页卡片总览: 组内按涨跌幅降序, 默认前 N 条可展开 - 头部重排: 名称+指标数值居左, 总数+N涨/N跌居右 (红涨绿跌着色) - 成员行: 创/科/北板块标识移至名称后; 序号列可开关 - 卡片设置 (GroupStatsSettings): 指标/排序/前N条/头部颜色/序号, 与统计条共享持久化 分组统计条 (WatchlistGroupStatsBar): - 中轴分叉条形图概览, 指标与排序可配置 - 行尾 N涨/N跌 红绿着色 分组管理: - 后端分组重排端点 + service + 测试 (9 passed) - 管理弹窗上移/下移 + 拖拽排序, 顺序贯通标签栏/统计条/卡片/侧栏 自选交互: - 修复 WatchlistAddMenu 内部滚动误关闭 (capture 目标包含判断) - 监控规则编辑器: 指定标的支持从自选/自选分组批量导入 (去重合并) 前端扩展插槽: - 新增 stock-preview.footer / watchlist.toolbar 插槽及 context 契约, 更新二开文档
63 lines
1.8 KiB
Plaintext
63 lines
1.8 KiB
Plaintext
import { ShieldCheck } from 'lucide-react'
|
|
import type { FrontendExtension } from '@/extensions/types'
|
|
|
|
function RiskPage() {
|
|
return <div>风险分析</div>
|
|
}
|
|
|
|
function NavigationExtra({ collapsed }: { collapsed: boolean; pathname: string }) {
|
|
return collapsed ? null : <div className="px-3 py-1 text-xs text-muted">二开内容</div>
|
|
}
|
|
|
|
/** 个股详情对话框底部: 自带分隔与内边距 */
|
|
function StockPreviewFooter({ symbol, name }: { symbol: string; name: string | null; view: 'daily' | 'intraday' }) {
|
|
return (
|
|
<div className="border-t border-border px-4 py-2 text-xs text-muted">
|
|
{symbol} {name} · 二开面板示例
|
|
</div>
|
|
)
|
|
}
|
|
|
|
/** 自选页工具栏: 按钮尺寸与核心工具栏一致 */
|
|
function WatchlistToolbar({ symbols, refresh }: { symbols: string[]; viewMode: 'table' | 'card'; selectedGroup: string; refresh: () => void }) {
|
|
return (
|
|
<button
|
|
type="button"
|
|
onClick={refresh}
|
|
className="inline-flex items-center h-8 px-2.5 rounded-btn bg-elevated text-xs text-secondary hover:bg-elevated/80 hover:text-foreground transition-colors duration-150 ease-smooth"
|
|
>
|
|
二开操作 ({symbols.length})
|
|
</button>
|
|
)
|
|
}
|
|
|
|
const extension: FrontendExtension = {
|
|
id: 'company.risk',
|
|
apiVersion: 1,
|
|
routes: [
|
|
{ id: 'company-risk', path: '/company/risk', component: RiskPage },
|
|
],
|
|
navigation: [
|
|
{ id: 'company-risk', routeId: 'company-risk', label: '风险分析', icon: ShieldCheck },
|
|
],
|
|
slots: [
|
|
{
|
|
name: 'layout.navigation.extra',
|
|
id: 'company-risk-summary',
|
|
component: NavigationExtra,
|
|
},
|
|
{
|
|
name: 'stock-preview.footer',
|
|
id: 'company-risk-stock-footer',
|
|
component: StockPreviewFooter,
|
|
},
|
|
{
|
|
name: 'watchlist.toolbar',
|
|
id: 'company-risk-watchlist-action',
|
|
component: WatchlistToolbar,
|
|
},
|
|
],
|
|
}
|
|
|
|
export default extension
|