Skip to content

Commit

Permalink
feat: (apiflow) 新增历史记录功能
Browse files Browse the repository at this point in the history
  • Loading branch information
shuxiaokai3 committed Apr 11, 2023
1 parent 4639ccc commit 19b5945
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/@types/apiflow.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,16 @@ export type FlowSelection = {
};
/*
|--------------------------------------------------------------------------
| 历史记录
|--------------------------------------------------------------------------
*/
export type FlowHistory = {
nodeList: FlowNodeInfo[],
lineList: FlowLineInfo[],
configInfo: FlowConfig
}
/*
|--------------------------------------------------------------------------
| 容器信息
|--------------------------------------------------------------------------
*/
Expand Down
17 changes: 17 additions & 0 deletions src/renderer/store/apiflow/history.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { FlowHistory } from "@@/apiflow"
import { defineStore } from "pinia"

type FlowHistoryStore = {
readonly maxHistory: number;
undoList: FlowHistory[];
redoList: FlowHistory[];
}
export const useFlowHistoryStore = defineStore("flowHistory", {
state: (): FlowHistoryStore => {
return {
maxHistory: 0,
undoList: [],
redoList: [],
}
}
})

0 comments on commit 19b5945

Please sign in to comment.