This commit is contained in:
X1627315083@163.com
2026-03-17 11:06:32 +08:00
parent 9aa9c8193c
commit 2ad392037e
5 changed files with 27 additions and 10 deletions

View File

@@ -36,6 +36,9 @@ export class StateManager {
nodeManager: any
toolManager: any
generateManager: any
// 是否有数据没保存
isSave: any
// 设置管理器
setManager(options) {
options.eventManager && (this.eventManager = options.eventManager)
@@ -54,6 +57,7 @@ export class StateManager {
this.mxHistory = ref(50)
this.historyList = ref([])
this.historyIndex = ref(0)
this.isSave = ref(false)
this.activeNodeID = ref("")
this.nodes = ref<NodesItem[]>([]);
@@ -172,6 +176,8 @@ export class StateManager {
const size = this.historyList.value.length - this.mxHistory.value
if (size > 0) this.historyList.value.splice(0, size)
this.historyIndex.value = this.historyList.value.length - 1
this.isSave.value = true
}
/** 撤回状态 */
undoState() {
@@ -205,6 +211,7 @@ export class StateManager {
}
dispose() {
this.isSave.value = false
this.historyList.value = []
this.historyIndex.value = 0
}