代码同步

Signed-off-by: nobbo <gaoshang22@huawei.com>
This commit is contained in:
nobbo
2022-12-08 16:23:17 +08:00
parent 80e232f01d
commit 9e4121bc4c
5 changed files with 25 additions and 5 deletions
@@ -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 })
@@ -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<string>('ContinueNote', continueNote)
LogUtil.info(TAG, "NoteContentOverViewComp MenuBuilder, set continue note success")
NoteUtil.refreshAll()
})
}, noteItem => JSON.stringify(noteItem))
}.listDirection(Axis.Vertical)
@@ -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<string>('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"})
})
}
}
@@ -287,6 +287,7 @@ export struct NoteContentOverViewComp {
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
AppStorage.SetOrCreate<string>('ContinueNote', continueNote)
LogUtil.info(TAG, 'MenuBuilder, set continue note success')
NoteUtil.refreshAll()
})
}, noteItem => noteItem.uuid)
}
@@ -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)
}
})
)