refactor: 提取 K 线图弹窗共享类型到 types.ts
- 新建 types.ts 存放 StockInfo 接口和图表常量 - KLineChartModal.tsx: 移除内联 StockInfo 定义,改为从 types 导入 - TimelineChartModal.tsx: 移除内联 StockInfo 定义,改为从 types 导入 - 减少代码重复,统一类型管理 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -21,14 +21,7 @@ import * as echarts from 'echarts';
|
||||
import dayjs from 'dayjs';
|
||||
import { klineDataCache, getCacheKey, fetchKlineData } from '@views/Community/components/StockDetailPanel/utils/klineDataCache';
|
||||
import { selectIsMobile } from '@store/slices/deviceSlice';
|
||||
|
||||
/**
|
||||
* 股票信息
|
||||
*/
|
||||
interface StockInfo {
|
||||
stock_code: string;
|
||||
stock_name?: string;
|
||||
}
|
||||
import { StockInfo } from './types';
|
||||
|
||||
/**
|
||||
* TimelineChartModal 组件 Props
|
||||
|
||||
Reference in New Issue
Block a user