fix
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user