-
Notifications
You must be signed in to change notification settings - Fork 443
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
17,115 additions
and
14,721 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# ChangeLog | ||
|
||
## [2.0.0] | ||
|
||
feat: 韭菜之家> 数据统计>牛熊风向标 | ||
|
||
## [1.9.9] | ||
|
||
fix: 修复雪球 cookie 问题 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>iframe dom 操作测试</title> | ||
</head> | ||
<body> | ||
<script src="https://cdn.staticfile.org/jquery/2.0.0/jquery.min.js"></script> | ||
<iframe | ||
id="iframeWraper" | ||
src="https://emdatah5.eastmoney.com/dc/nxfxb/index" | ||
frameborder="0" | ||
frameborder="0" | ||
style="width: 100%; height: 900px" | ||
></iframe> | ||
<script> | ||
$('#iframeWraper').contents().find('.common-header2'); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"name": "leek-fund", | ||
"displayName": "韭菜盒子", | ||
"description": "韭菜盒子,VSCode 里也可以看股票 & 基金实时数据,做最好用的投资插件", | ||
"version": "1.9.9", | ||
"version": "2.0.0", | ||
"author": "giscafer <[email protected]>", | ||
"repository": { | ||
"type": "git", | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
51 changes: 51 additions & 0 deletions
51
template-packages/leek-center/src/view/data-center/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { Layout, Menu } from 'antd'; | ||
import { ReactElement } from 'react'; | ||
import { Link, Route, Switch, Redirect } from 'react-router-dom'; | ||
import NxfxbPage from './nxfxb'; | ||
import OtherPage from './other'; | ||
const { Content, Sider } = Layout; | ||
|
||
export default function DataCenter({ children }: { children: ReactElement }) { | ||
return ( | ||
<Layout> | ||
<Sider | ||
style={{ | ||
overflow: 'auto', | ||
height: 'calc(100vh - 86px)', | ||
position: 'fixed', | ||
left: 0, | ||
}} | ||
> | ||
<Menu | ||
theme="dark" | ||
style={{ | ||
height: 'calc(100vh - 86px)', | ||
}} | ||
> | ||
<Menu.Item key="nxfxb"> | ||
<Link to="/data-center/nxfxb">牛熊风向标</Link> | ||
</Menu.Item> | ||
<Menu.Item key="other"> | ||
<Link to="/data-center/other">欢迎PR</Link> | ||
</Menu.Item> | ||
</Menu> | ||
</Sider> | ||
<Content | ||
id="flashNewsContent" | ||
style={{ | ||
height: 'calc(100vh - 86px)', | ||
position: 'fixed', | ||
left: 220, | ||
width: 'calc(100vw - 220px)', | ||
overflowY: 'auto', | ||
}} | ||
> | ||
<Switch> | ||
<Route exact path="/data-center/nxfxb" component={NxfxbPage} /> | ||
<Route exact path="/data-center/other" component={OtherPage} /> | ||
<Redirect from="/data-center" to="/data-center/nxfxb"></Redirect> | ||
</Switch> | ||
</Content> | ||
</Layout> | ||
); | ||
} |
87 changes: 87 additions & 0 deletions
87
template-packages/leek-center/src/view/data-center/nxfxb/UpDownChart.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import { | ||
Annotation, | ||
Axis, | ||
Chart, | ||
Interaction, | ||
Interval, | ||
Legend, | ||
Tooltip, | ||
} from 'bizcharts'; | ||
import { useMemo } from 'react'; | ||
|
||
function dataConvert(obj: any = {}) { | ||
return [ | ||
{ type: '涨停', value: obj.t, marked: false }, | ||
{ type: '涨停~5%', value: obj.rp10, marked: false }, | ||
{ type: '5%~1%', value: obj.rp5, marked: false }, | ||
{ type: '1%~0%', value: obj.rp01, marked: false }, | ||
{ type: '平盘', value: obj.rp0, marked: true }, | ||
{ type: '0%~-1%', value: obj.rn01, marked: true }, | ||
{ type: '-1%~-5%', value: obj.rn1, marked: true }, | ||
{ type: '-5%~跌停', value: obj.rn5, marked: true }, | ||
{ type: '跌停', value: obj.b, marked: true }, | ||
]; | ||
} | ||
|
||
const scale = { | ||
value: { | ||
alias: '涨跌分布统计', | ||
nice: true, | ||
formatter: (val: string) => { | ||
return `${val} 家`; | ||
}, | ||
}, | ||
}; | ||
|
||
const axisCfg = { | ||
axis: false, | ||
title: { | ||
style: { | ||
fontSize: '14', | ||
fill: '#ff5957', | ||
fontWeight: 'bold', | ||
}, | ||
}, | ||
}; | ||
|
||
function UpDownChart({ data }: { data: Record<string, any> }) { | ||
const barData = useMemo(() => { | ||
return dataConvert(data); | ||
}, [data]); | ||
return ( | ||
<Chart padding={[60]} autoFit height={400} data={barData} scale={scale}> | ||
<Axis name="type" /> | ||
<Axis name="value" {...(axisCfg as any)} visible={false} line={false} /> | ||
<Interaction type="active-region" /> | ||
|
||
<Tooltip showCrosshairs showMarkers={false} /> | ||
<Interval | ||
position="type*value" | ||
color={[ | ||
'type*value*marked', | ||
(type: number, value: number | string, marked: boolean) => { | ||
return marked ? '#36c361' : '#ff5957'; | ||
}, | ||
]} | ||
label={[ | ||
'type*value', | ||
(type: number, value: any) => { | ||
return { | ||
style: { color: '#fff' }, | ||
content: (originData: any) => { | ||
/* if (originData.type === '涨停') { | ||
return null; | ||
} */ | ||
return `${value} 家`; | ||
}, | ||
}; | ||
}, | ||
]} | ||
/> | ||
<Legend visible={false} /> | ||
{/* <Annotation.DataMarker {...(dataMarkerCfg as any)} /> */} | ||
</Chart> | ||
); | ||
} | ||
|
||
export default UpDownChart; |
58 changes: 58 additions & 0 deletions
58
template-packages/leek-center/src/view/data-center/nxfxb/UpDownStatistic.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import React, { useMemo } from 'react'; | ||
import { Statistic, StatisticCard } from '@ant-design/pro-card'; | ||
import { omit, pick, sum } from 'lodash'; | ||
|
||
const { Divider } = StatisticCard; | ||
|
||
const UpDownStatistic = ({ data = {} }: { data: Record<string, any> }) => { | ||
const total = useMemo(() => { | ||
return sum(Object.values(pick(data, ['up', 'down', 'r0']))); | ||
}, [data]); | ||
return ( | ||
<StatisticCard.Group> | ||
<StatisticCard | ||
statistic={{ | ||
title: '全部', | ||
tip: '当天开盘上市公司数量', | ||
value: total, | ||
}} | ||
/> | ||
<Divider /> | ||
<StatisticCard | ||
statistic={{ | ||
title: '上涨', | ||
value: data?.up, | ||
valueStyle: { color: '#f22323' }, | ||
}} | ||
/> | ||
<StatisticCard | ||
statistic={{ | ||
title: '涨停', | ||
value: data?.t, | ||
valueStyle: { color: '#f22323' }, | ||
description: ( | ||
<Statistic title="自然涨停" value={data?.tn} trend="up" /> | ||
), | ||
}} | ||
/> | ||
<StatisticCard | ||
statistic={{ | ||
title: '下跌', | ||
value: data?.down, | ||
suffix: '', | ||
valueStyle: { color: '#00A000' }, | ||
}} | ||
/> | ||
<StatisticCard | ||
statistic={{ | ||
title: '跌停', | ||
value: data?.b, | ||
suffix: '', | ||
valueStyle: { color: '#00A000' }, | ||
}} | ||
/> | ||
</StatisticCard.Group> | ||
); | ||
}; | ||
|
||
export default UpDownStatistic; |
Oops, something went wrong.