diff --git a/features/src/main/ets/components/CusDialogComp.ets b/features/src/main/ets/components/CusDialogComp.ets index 8875dbd..26c7400 100644 --- a/features/src/main/ets/components/CusDialogComp.ets +++ b/features/src/main/ets/components/CusDialogComp.ets @@ -678,8 +678,7 @@ export struct EditTitleDialog { .backgroundColor($r("app.color.title_input_bg_color")) .width('90%') .onChange((value: string) => { - let reg = /^\S+$/ - if (this.inputName == value && reg.test(value)) { + if (this.inputName == value) { this.isEquivalentVal = true } else { this.isEquivalentVal = false @@ -716,9 +715,13 @@ export struct EditTitleDialog { .width('48%') .onClick(() => { this.editTitleDialog.close() - this.confirm(this.inputName) // @ts-ignore inputMethod.getController().stopInputSession(); + if (this.inputName.replace(/\s+/g,'') == '') { + return + } else { + this.confirm(this.inputName) + } }) }.width('100%') .margin({ top: 21, bottom: 25 }) diff --git a/features/src/main/ets/components/NoteContent.ets b/features/src/main/ets/components/NoteContent.ets index 2e0a744..bdeba37 100644 --- a/features/src/main/ets/components/NoteContent.ets +++ b/features/src/main/ets/components/NoteContent.ets @@ -351,6 +351,9 @@ export struct ToolBarComp { this.controllerShow.runJavaScript({ script: "javascript:RICH_EDITOR.insertImage('" + path + "')" }) + this.issave = 1 + // 保存笔记信息到数据库 + this.controllerShow.runJavaScript({script:"getHtmlContent"}) }) } } @@ -457,6 +460,7 @@ export struct NoteContentOverViewComp { let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) AppStorage.SetOrCreate('ContinueNote', continueNote) LogUtil.info(TAG, "NoteContentOverViewComp MenuBuilder, set continue note success") + NoteUtil.refreshAll() }) }, noteItem => JSON.stringify(noteItem)) }.listDirection(Axis.Vertical) diff --git a/features/src/main/ets/components/NoteContentComp.ets b/features/src/main/ets/components/NoteContentComp.ets index 70cbe19..6ffe77f 100644 --- a/features/src/main/ets/components/NoteContentComp.ets +++ b/features/src/main/ets/components/NoteContentComp.ets @@ -60,6 +60,15 @@ export struct NoteContentComp { private context = getContext(this) @StorageLink('ScrollTopPercent') scrollTopPercent: number = 0.0 @StorageLink('isUpdate') isUpdate: boolean = false + @StorageLink('refreshCurrentNote')@Watch('isDatacChange') refreshCurrentNote: boolean = false + + isDataChange() { + if (!this.refreshCurrentNote) { + return + } + this.controllerShow.runJavaScript({script:"RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')"}) + this.refreshCurrentNote = false + } storeScrollTop(scrollTop: number) { if (scrollTop < 0) { @@ -360,6 +369,7 @@ export struct NoteContentOverViewComp { let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) AppStorage.SetOrCreate('ContinueNote', continueNote) LogUtil.info(TAG, "NoteContentOverViewComp, MenuBuilder, set continue note success") + NoteUtil.refreshAll() }) }, noteItem => noteItem.uuid) }.listDirection(Axis.Vertical) @@ -634,6 +644,9 @@ export struct ToolBarComp { this.controllerShow.runJavaScript({ script: "javascript:RICH_EDITOR.insertImage('" + path + "')" }) + this.issave = 1 + // 保存笔记信息到数据库 + this.controllerShow.runJavaScript({script:"getHtmlContent"}) }) } } diff --git a/features/src/main/ets/components/NoteContentCompPortrait.ets b/features/src/main/ets/components/NoteContentCompPortrait.ets index 1245f0e..c0cbbf6 100644 --- a/features/src/main/ets/components/NoteContentCompPortrait.ets +++ b/features/src/main/ets/components/NoteContentCompPortrait.ets @@ -287,6 +287,7 @@ export struct NoteContentOverViewComp { let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) AppStorage.SetOrCreate('ContinueNote', continueNote) LogUtil.info(TAG, 'MenuBuilder, set continue note success') + NoteUtil.refreshAll() }) }, noteItem => noteItem.uuid) } diff --git a/features/src/main/ets/components/NoteListComp.ets b/features/src/main/ets/components/NoteListComp.ets index f19e296..8a3b3fe 100644 --- a/features/src/main/ets/components/NoteListComp.ets +++ b/features/src/main/ets/components/NoteListComp.ets @@ -355,10 +355,9 @@ export struct NoteItemComp { LongPressGesture() .onAction(() => { if (this.longpress == false) { - this.isChecked = false this.longpress = true NoteUtil.setNoteChecked(this.CheckedNoteArray, this.noteItem) - this.isChecked = NoteUtil.isNoteChecked(this.CheckedNoteArray, this.noteItem) ? true : false + this.isChecked = NoteUtil.isNoteChecked(this.CheckedNoteArray, this.noteItem) } }) )