蓝黄代码同步

Signed-off-by: @two-thousand-or-three-thousand <lisiquan1@huawei.com>
This commit is contained in:
@two-thousand-or-three-thousand 2022-12-19 18:26:09 +08:00
parent 668a56a87f
commit 76add7e139
7 changed files with 26 additions and 40 deletions

View File

@ -1,12 +1,10 @@
# 备忘录部件
## 简介
## 1. 项目介绍
备忘录应用是OpenHarmony中预置的应用为用户提供文本编辑以及保存功能。
**架构图**
![](./figures/note.png)
## 目录
## 2. 目录结构
```
/applications/standard/note
├─common
@ -47,10 +45,20 @@
└─resources # 资源文件
```
### 整体架构
![](./figures/note.png)
## 3. 签名打包
## 编译构建/使用方法
### 签名
#### 签名文件的获取
1.生成签名文件可参考https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/hapsigntool-overview.md
#### 签名文件的配置
打开项目工程,选择 File → Project Structure
![](./figures/signature_1.png)
@ -74,6 +82,7 @@
![](./figures/ds_ohosbuild_output_dir_release.png)
## 4. 安装、调试
### 应用安装
@ -81,9 +90,6 @@
![](./figures/install.png)
### 应用调试
#### log打印

View File

@ -16,9 +16,7 @@
<div class="edit-box">
<div id="editorjs" contenteditable="true">
</div>
<div id="editorjs" contenteditable="true"></div>
<div class="button-box" id="buttonBox">
<div id="addToDo">
<img id="img1" src="../base/media/todo1.svg">

View File

@ -428,7 +428,7 @@ RICH_EDITOR.insertImageHtml = function (contents) {
selection.getRangeAt(0).insertNode(img);
};
document.getElementById('addToDo').addEventListener('click', (e) => {
document.addEventListener('click', (e) => {
console.info(`lsq: e is ${JSON.stringify(e)}`)
if (e.id !== 'editorjs') {
e.preventDefault()
@ -444,7 +444,6 @@ document.getElementById('chooseStyle').addEventListener('click', () => {
})
document.getElementById('openAlbum').addEventListener('click', () => {
RICH_EDITOR.getFocus()
callBackToApp.openAlbum()
})

View File

@ -99,7 +99,6 @@ export struct NewOrEditFolderDialog {
.width('48%')
.onClick(() => {
this.newOrEditFolderDialogCtl.close()
// @ts-ignore
inputMethod.getController().stopInputSession();
})
Divider()
@ -123,7 +122,6 @@ export struct NewOrEditFolderDialog {
.onClick(() => {
this.newOrEditFolderDialogCtl.close()
this.confirm(this.selectedColor, this.inputName)
// @ts-ignore
inputMethod.getController().stopInputSession();
})
}.width('100%')
@ -697,7 +695,6 @@ export struct EditTitleDialog {
.width('48%')
.onClick(() => {
this.editTitleDialog.close()
// @ts-ignore
inputMethod.getController().stopInputSession();
})
Divider()
@ -714,7 +711,6 @@ export struct EditTitleDialog {
.width('48%')
.onClick(() => {
this.editTitleDialog.close()
// @ts-ignore
inputMethod.getController().stopInputSession();
if (this.inputName.replace(/\s+/g, '') == '') {
return

View File

@ -252,8 +252,8 @@ export struct NoteContent {
}
aboutToDisappear(): void {
NoteUtil.refreshAll()
AppStorage.Set("refreshCurrentNote", true)
NoteUtil.refreshAll()
clearInterval(timeID)
LogUtil.info(TAG, "aboutToDisappear")
}

View File

@ -228,10 +228,10 @@ export struct NoteContentCompPortrait {
alignItems: ItemAlign.Start, alignContent: FlexAlign.SpaceAround }) {
Column() {
ToolBarComp({ controllerShow: this.controllerShow })
NoteContentOverViewComp()
}
Column() {
NoteContentOverViewComp()
Web({ src: $rawfile('editor.html'), controller: this.controllerShow })
.javaScriptAccess(true)
.javaScriptProxy({
@ -272,7 +272,6 @@ export struct NoteContentCompPortrait {
this.storeScrollTop(event.yOffset)
})
}
.enabled(this.selectedNoteData && this.selectedNoteData.is_deleted == Delete.Yes ? false : true)
.flexShrink(1)
.onClick(() => {
if (time_id) {
@ -464,7 +463,6 @@ export struct ToolBarComp {
.width(24)
.responseRegion({ width: 54, height: 54 })
.onClick(() => {
inputMethod.getController().stopInputSession()
this.controllerShow.runJavaScript({ script: "getHtmlContent()" })
// 清除定时器
if (time_id != undefined) {
@ -534,7 +532,6 @@ export struct ToolBarComp {
Button({ type: ButtonType.Normal, stateEffect: true }) {
Image($r('app.media.tick_thin')).height(24).width(24)
.onClick(() => {
inputMethod.getController().stopInputSession()
// 保存笔记信息到数据库
this.controllerShow.runJavaScript({ script: "getHtmlContent()" })
this.editModel = false

View File

@ -60,7 +60,6 @@ export struct NoteHomePortraitComp {
.backgroundColor($r("app.color.notelist_bgcolor_f1f3f5"))
//Folder list display area
Row() {
Stack() {
FolderListBackGround()
FolderListComp()
@ -68,15 +67,6 @@ export struct NoteHomePortraitComp {
.width(200)
.height(StyleConstants.PERCENTAGE_100)
.visibility(this.expandStatus == false ? Visibility.None : Visibility.Visible)
Column() {
}
.height("100%")
.width("100%")
.backgroundColor("#18181A")
.opacity(0.2)
.visibility(this.expandStatus ? Visibility.Visible : Visibility.None)
}
}
.width(StyleConstants.PERCENTAGE_100).height(StyleConstants.PERCENTAGE_100)
}