完善撤回逻辑

This commit is contained in:
2025-05-17 16:36:42 +08:00
parent 404824bf07
commit 82cfa36e03
6 changed files with 55 additions and 47 deletions

View File

@@ -28,8 +28,7 @@ export class DOBlock {
}
public set_show(show: number): void {
this.data.show = show
if (show == this.get_correct())
this.checked = true
this.checked = show == this.get_correct()
StorageManager.getInstance().onChanged()
}

View File

@@ -129,8 +129,14 @@ export class DOStage {
public get_undos(): Array<DataUndo> {
return this.data.undos
}
public add_undo(type: number, index: number, value: number): void {
var dataUndo: DataUndo = {type: type, index: index, value: value}
public add_undo(index: number, show: number=0, notes: Array<number>=new Array()): void {
var _notes: Array<number>
if (notes) {
_notes = new Array()
for (var i=0; i<notes.length; i++)
_notes.push(notes[i])
}
var dataUndo: DataUndo = {index: index, show: show, notes: _notes}
console.log("add_undo >>>>>>>>>>>>>>>>>>>>>>>>>>>>", JSON.stringify(dataUndo))
this.data.undos.push(dataUndo)
StorageManager.getInstance().onChanged()