Skip to content

Commit

Permalink
V8.1.0 (#638)
Browse files Browse the repository at this point in the history
* fix: 修复股票排序

* feat: 添加估算净值

* fix: 同步删除股票

* Bump electron-log from 5.0.0-beta.24 to 5.0.0-beta.25 (#636)

Bumps [electron-log](https://github.com/megahertz/electron-log) from 5.0.0-beta.24 to 5.0.0-beta.25.
- [Changelog](https://github.com/megahertz/electron-log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/megahertz/electron-log/commits)

---
updated-dependencies:
- dependency-name: electron-log
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @types/node from 20.4.2 to 20.4.5 (#635)

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.4.2 to 20.4.5.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: 修改资金流向为堆叠图

* fix: 修复复制图标

* bump: 更新依赖

* fix: 去除托盘多余选项

* feat: 低调模式支持透明度

* fix: 修复代理

* feat: 添加总是置顶

* feat: k线boll技术指标

* feat: 板块添加走势、k线

* feat: 股票新增实时、盘后资金流

* Bump @types/node from 20.4.5 to 20.4.7 (#640)

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.4.5 to 20.4.7.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* bump: 8.1.0

* fix: 优化工作时间段

* fix: 使用默认菜单

* fix: 修复钱包删除问题

* Bump @types/node from 20.4.7 to 20.5.0 (#643)

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.4.7 to 20.5.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* bump: electron 26.0.0

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
1zilc and dependabot[bot] committed Aug 14, 2023
1 parent 1e40123 commit bdbf3e1
Show file tree
Hide file tree
Showing 27 changed files with 382 additions and 153 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@
"devDependencies": {
"@types/color": "^3.0.3",
"@types/color-hash": "^1.0.2",
"@types/node": "20.4.2",
"@types/node": "20.5.0",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@vitejs/plugin-react": "^4.0.3",
"electron": "^25.3.0",
"electron": "^26.0.0",
"electron-builder": "^24.4.0",
"electron-vite": "^1.0.25",
"electron-vite": "^1.0.26",
"generate-react-cli": "^8.3.0",
"sass": "^1.63.6",
"typescript": "^5.1.6",
Expand All @@ -178,7 +178,7 @@
"electron-debug": "^3.2.0",
"electron-disable-file-drop": "^1.0.2",
"electron-icon-builder": "^2.0.1",
"electron-log": "5.0.0-beta.24",
"electron-log": "5.0.0-beta.25",
"electron-store": "^8.1.0",
"electron-updater": "^6.1.1",
"electron-window-state": "^5.0.3",
Expand Down
2 changes: 1 addition & 1 deletion release/app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "fishing-funds",
"productName": "Fishing Funds",
"version": "8.0.1",
"version": "8.1.0",
"main": "./dist/main/index.js",
"description": "基金,大盘,股票,虚拟货币状态栏显示小应用,基于Electron开发,支持 MacOS,Windows,Linux客户端,数据源来自天天基金,蚂蚁基金,爱基金,腾讯证券等",
"author": {
Expand Down
14 changes: 10 additions & 4 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import { createChildWindow } from './childWindow';
import Proxy from './proxy';
import HotkeyManager from './hotkey';
import ContextMenuManager from './contextMenu';
import { createAppMenu } from './menu';
import { saveImage, saveJsonToCsv, saveString, readFile } from './io';
import {
lockSingleInstance,
Expand Down Expand Up @@ -166,6 +165,16 @@ function main() {
ipcMain.handle('get-version', async (event, config) => {
return app.getVersion();
});
ipcMain.handle('set-opacity', async (event, config) => {
getOtherWindows(windowIds).forEach((win) => {
win?.setOpacity(config);
});
});
ipcMain.handle('set-alwaysOnTop', async (event, config) => {
getOtherWindows(windowIds).forEach((win) => {
win?.setAlwaysOnTop(config);
});
});
// touchbar 相关监听
ipcMain.handle('update-touchbar-zindex', async (event, config) => {
touchBarManager.updateZindexItems(config);
Expand Down Expand Up @@ -289,9 +298,6 @@ function main() {
});
// 存储窗口大小
mainWindowState.manage(mb.window!);
// 生成应用菜单
const appMenu = createAppMenu();
Menu.setApplicationMenu(appMenu);
// 是否打开备份文件
if (openBackupFilePath) {
sendMessageToRenderer(mb.window, 'open-backup-file', openBackupFilePath);
Expand Down
21 changes: 0 additions & 21 deletions src/main/menu.ts

This file was deleted.

18 changes: 6 additions & 12 deletions src/main/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,18 @@ export default class Proxy {

constructAgents() {
if (this.type === 'SOCKS' || this.type === 'SOCKS5') {
const agent = new SocksProxyAgent({
hostname: this.host,
port: this.port,
});
const proxyURL = `socks:${this.host}:${this.port}`;
const agent = new SocksProxyAgent(proxyURL);

this.httpAgent = agent;
this.httpsAgent = agent;
} else if (this.type === 'PROXY' || this.type === 'HTTPS') {
const proxyURL = `http:${this.host}:${this.port}`;

if (this.url.startsWith('https://')) {
this.httpsAgent = new HttpsProxyAgent({
hostname: this.host,
port: this.port,
});
this.httpsAgent = new HttpsProxyAgent(proxyURL);
} else {
this.httpAgent = new HttpProxyAgent({
hostname: this.host,
port: this.port,
});
this.httpAgent = new HttpProxyAgent(proxyURL);
}
} else {
// DIRECT do nothing
Expand Down
17 changes: 12 additions & 5 deletions src/renderer/components/Home/FundView/FundRow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,18 @@ const FundRow: React.FC<RowProps> = React.memo((props) => {
</div>
<Collapse isOpened={fund.collapse}>
<div className={styles.collapseContent}>
<section>
<span>净值:</span>
<span>{calcFundResult.dwjz}</span>
<span>{calcFundResult.jzrq}</span>
</section>
{isFix ? (
<section>
<span>净值:</span>
<span>{calcFundResult.dwjz}</span>
<span>{calcFundResult.jzrq}</span>
</section>
) : (
<section>
<span>估算净值:</span>
{calcFundResult.gsz}
</section>
)}
<section>
<span>成本价:</span>
{calcFundResult.cbj !== undefined ? <span>{calcFundResult.cbj}</span> : <a onClick={onEditClick}>录入</a>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ import * as Services from '@/services';
import styles from './index.module.scss';

export interface AfterTimeFundFlowProps {
code: string;
secid: string;
}

const AfterTimeFundFlow: React.FC<AfterTimeFundFlowProps> = ({ code = '' }) => {
const AfterTimeFundFlow: React.FC<AfterTimeFundFlowProps> = ({ secid = '' }) => {
const { ref: chartRef, chartInstance } = useResizeEchart(CONST.DEFAULT.ECHARTS_SCALE);
const { data: result = [], run: runGetAfterTimeFundFlowFromEasymoney } = useRequest(
() => Services.Quotation.GetAfterTimeFundFlowFromEasymoney(code),
() => Services.Quotation.GetAfterTimeFundFlowFromEasymoney(secid),
{
pollingInterval: 1000 * 60,
refreshDeps: [code],
refreshDeps: [secid],
ready: !!chartInstance,
}
);
Expand All @@ -31,6 +31,11 @@ const AfterTimeFundFlow: React.FC<AfterTimeFundFlowProps> = ({ code = '' }) => {
lineStyle: {
width: 1,
},
areaStyle: {
opacity: 0.8,
},
smooth: true,
stack: '流入',
};
chartInstance?.setOption({
title: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ import * as Services from '@/services';
import styles from './index.module.scss';

export interface RealTimeFundFlowProps {
code: string;
secid: string;
}

const RealTimeFundFlow: React.FC<RealTimeFundFlowProps> = ({ code = '' }) => {
const RealTimeFundFlow: React.FC<RealTimeFundFlowProps> = ({ secid = '' }) => {
const { ref: chartRef, chartInstance } = useResizeEchart(CONST.DEFAULT.ECHARTS_SCALE);
const { data: result = [], run: runGetRealTimeFundFlowFromEasymoney } = useRequest(
() => Services.Quotation.GetRealTimeFundFlowFromEasymoney(code),
() => Services.Quotation.GetRealTimeFundFlowFromEasymoney(secid),
{
pollingInterval: 1000 * 60,
refreshDeps: [code],
refreshDeps: [secid],
ready: !!chartInstance,
}
);
Expand All @@ -32,6 +32,11 @@ const RealTimeFundFlow: React.FC<RealTimeFundFlowProps> = ({ code = '' }) => {
lineStyle: {
width: 1,
},
areaStyle: {
opacity: 0.8,
},
smooth: true,
stack: '流入',
};
chartInstance?.setOption({
title: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import Funds from '@/components/Home/QuotationView/DetailQuotationContent/Funds'
import Recent from '@/components/Home/NewsList/Recent';
import RealTimeTransaction from '@/components/Home/QuotationView/DetailQuotationContent/RealTimeTransaction';
import CustomDrawerContent from '@/components/CustomDrawer/Content';
import K from '@/components/Home/StockView/DetailStockContent/K';
import Trend from '@/components/Home/StockView/DetailStockContent/Trend';
import Estimate from '@/components/Home/StockView/DetailStockContent/Estimate';
import GuBa from '@/components/Home/NewsList/GuBa';
import { RedirectSearchParams } from '@/containers/InitPage';
import { DetailQuotationPageParams } from '@/components/Home/QuotationView/DetailQuotationPage';
Expand Down Expand Up @@ -63,7 +66,10 @@ export const DetailQuotation: React.FC<DetailQuotationProps> = (props) => {
已关注
</a>
) : (
<a className={styles.selfAdd} onClick={() => dispatch(setFavoriteQuotationMapAction({ code: quotation.code, status: true }))}>
<a
className={styles.selfAdd}
onClick={() => dispatch(setFavoriteQuotationMapAction({ code: quotation.code, status: true }))}
>
未关注
</a>
)}
Expand All @@ -76,7 +82,9 @@ export const DetailQuotation: React.FC<DetailQuotationProps> = (props) => {
</div>
<div className={styles.detail}>
<div className={styles.detailItem}>
<div className={clsx(styles.zdf, Utils.GetValueColor(quotation.zdd).textClass)}>{Utils.Yang(quotation.zdf)}%</div>
<div className={clsx(styles.zdf, Utils.GetValueColor(quotation.zdd).textClass)}>
{Utils.Yang(quotation.zdf)}%
</div>
<div className={styles.detailItemLabel}>涨跌幅</div>
</div>
<div className={clsx(styles.detailItem, 'text-center')}>
Expand All @@ -96,13 +104,13 @@ export const DetailQuotation: React.FC<DetailQuotationProps> = (props) => {
items={[
{
key: String(0),
label: '实时资金流向',
children: <RealTimeFundFlow code={code} />,
label: '板块走势',
children: <Trend secid={`90.${quotation.code}`} zs={quotation.zs} name={quotation.name} />,
},
{
key: String(1),
label: '盘后资金流向',
children: <AfterTimeFundFlow code={code} />,
label: '走势详情',
children: <Estimate secid={`90.${quotation.code}`} />,
},
{
key: String(2),
Expand All @@ -124,9 +132,24 @@ export const DetailQuotation: React.FC<DetailQuotationProps> = (props) => {
items={[
{
key: String(0),
label: 'K线',
children: <K secid={`90.${quotation.code}`} />,
},
{
key: String(1),
label: '实时成交分布',
children: <RealTimeTransaction code={code} />,
},
{
key: String(2),
label: '实时资金',
children: <RealTimeFundFlow secid={`90.${code}`} />,
},
{
key: String(3),
label: '盘后资金',
children: <AfterTimeFundFlow secid={`90.${code}`} />,
},
]}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const chartTypeList = [
{ name: 'KDJ', type: 2, code: 2 },
{ name: 'RSI', type: 3, code: 3 },
{ name: 'BIAS', type: 4, code: 4 },
{ name: 'BOLL', type: 5, code: 5 },
];
const timeTypeList = [
{ name: '一年', type: 2, code: 360 },
Expand All @@ -45,11 +46,14 @@ const K: React.FC<PerformanceProps> = ({ secid = '', name }) => {
const [k, setKType] = useState(kTypeList[0]);
const [chart, setChartType] = useState(chartTypeList[0]);
const [time, setTimeType] = useState(timeTypeList[0]);
const { data: result = [], run: runGetKFromEastmoney } = useRequest(() => Services.Stock.GetKFromEastmoney(secid, k.code, time.code), {
refreshDeps: [secid, k.code, time.code],
ready: !!chartInstance,
cacheKey: Utils.GenerateRequestKey('Stock.GetKFromEastmoney', [secid, k.code, time.code]),
});
const { data: result = [], run: runGetKFromEastmoney } = useRequest(
() => Services.Stock.GetKFromEastmoney(secid, k.code, time.code),
{
refreshDeps: [secid, k.code, time.code],
ready: !!chartInstance,
cacheKey: Utils.GenerateRequestKey('Stock.GetKFromEastmoney', [secid, k.code, time.code]),
}
);

useRenderEcharts(
({ varibleColors }) => {
Expand Down Expand Up @@ -190,6 +194,38 @@ const K: React.FC<PerformanceProps> = ({ secid = '', name }) => {
},
]);
}
if (chart.type === 5) {
const BOLL = IndicatorFormula.getClass('boll');
const bollIndicator = new BOLL();
const bollData: any[] = bollIndicator.calculate(standData);
Array.prototype.push.apply(chartConfig, [
{
name: 'UPPER',
type: 'line',
xAxisIndex: 0,
yAxisIndex: 0,
data: bollData.map((_) => _.UPPER),
symbol: 'none',
},
{
name: 'MID',
type: 'line',
xAxisIndex: 0,
yAxisIndex: 0,
data: bollData.map((_) => _.MID),
symbol: 'none',
},

{
name: 'LOWER',
type: 'line',
xAxisIndex: 0,
yAxisIndex: 0,
data: bollData.map((_) => _.LOWER),
symbol: 'none',
},
]);
}

chartInstance?.setOption({
title: {
Expand Down Expand Up @@ -457,7 +493,7 @@ const K: React.FC<PerformanceProps> = ({ secid = '', name }) => {
<div className={styles.content}>
<TypeSelection types={kTypeList} activeType={k.type} onSelected={setKType} colspan={6} />
<div ref={chartRef} style={{ width: '100%' }} />
<TypeSelection types={chartTypeList} activeType={chart.type} onSelected={setChartType} colspan={6} />
<TypeSelection types={chartTypeList} activeType={chart.type} onSelected={setChartType} flex />
<TypeSelection types={timeTypeList} activeType={time.type} onSelected={setTimeType} flex />
</div>
</ChartCard>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import Recent from '@/components/Home/NewsList/Recent';
import CycleReturn from '@/components/Home/FundView/DetailFundContent/CycleReturn';
import CustomDrawerContent from '@/components/CustomDrawer/Content';
import GuBa from '@/components/Home/NewsList/GuBa';
import AfterTimeFundFlow from '@/components/Home/QuotationView/DetailQuotationContent/AfterTimeFundFlow';
import RealTimeFundFlow from '@/components/Home/QuotationView/DetailQuotationContent/RealTimeFundFlow';
import { RedirectSearchParams } from '@/containers/InitPage';
import { DetailStockPageParams } from '@/components/Home/StockView/DetailStockPage';
import { addStockAction } from '@/store/features/stock';
Expand Down Expand Up @@ -211,6 +213,16 @@ export const DetailStock: React.FC<DetailStockProps> = (props) => {
},
{
key: String(1),
label: '实时资金',
children: <RealTimeFundFlow secid={secid} />,
},
{
key: String(2),
label: '盘后资金',
children: <AfterTimeFundFlow secid={secid} />,
},
{
key: String(3),
label: '周期回报',
children: (
<CycleReturn onFresh={runGetKFromEastmoney} data={kdata.map(({ date: x, sp: y }) => ({ x, y }))} />
Expand Down

0 comments on commit bdbf3e1

Please sign in to comment.