!93 对数据加上保护;修改未分类文件颜色;修改蒙层问题

Merge pull request !93 from nobbo/master
This commit is contained in:
openharmony_ci 2022-08-15 09:38:47 +00:00 committed by Gitee
commit d3dc3c6e34
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
7 changed files with 36 additions and 12 deletions

View File

@ -253,6 +253,10 @@ struct FolderItemComp {
// update selectedFolderData and selectedNoteData
this.selectedFolderData = FolderUtil.getFolderData(this.AllFolderArray, SysDefFolderUuid.AllNotes)
this.selectedNoteData = NoteUtil.getFirstNoteData(this.AllNoteArray, SysDefFolderUuid.AllNotes)
// 刷新web界面
this.controllerShow.runJavaScript({
script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')"
})
// save continue data
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
AppStorage.SetOrCreate<string>('ContinueNote', continueNote)
@ -482,6 +486,6 @@ export struct FolderListBackGround {
.width("100%")
.height("100%")
.backgroundColor($r('app.color.folder_color_d6d6d6'))
.blur(60)
.backgroundBlurStyle(BlurStyle.Thick)
}
}

View File

@ -372,7 +372,7 @@ export struct NoteContentOverViewComp {
}
build() {
// if (this.selectedNoteData && this.selectedNoteData.is_deleted) {
if (this.selectedNoteData) {
Flex({ direction: FlexDirection.Column, wrap: FlexWrap.NoWrap,
justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Row() {
@ -413,7 +413,7 @@ export struct NoteContentOverViewComp {
.opacity(this.selectedNoteData.is_deleted == Delete.Yes ? 0.4 : 1)
.width(StyleConstants.PERCENTAGE_100)
.height(80)
// }
}
}
}

View File

@ -142,9 +142,11 @@ export struct NoteContentComp {
this.editContentFlag = true
}
LogUtil.info(TAG, "finish loadurl")
this.controllerShow.runJavaScript({
script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')"
})
if(this.selectedNoteData){
this.controllerShow.runJavaScript({
script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')"
})
}
// 初次加载为为小屏预览模式
if (this.sectionStatus != 1) {
this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setInputEnabled(false)" })
@ -282,7 +284,7 @@ export struct NoteContentOverViewComp {
}
build() {
// if (this.selectedNoteData && this.selectedNoteData.is_deleted) {
if (this.selectedNoteData) {
Flex({ direction: FlexDirection.Column, wrap: FlexWrap.NoWrap,
justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Row() {
@ -329,7 +331,7 @@ export struct NoteContentOverViewComp {
.opacity(this.selectedNoteData.is_deleted == Delete.Yes ? 0.4 : 1)
.width(StyleConstants.PERCENTAGE_100)
.height(80)
// }
}
}
}
@ -442,7 +444,19 @@ export struct ToolBarComp {
.onClick(() => {
this.selectedNoteData.is_deleted = Delete.No
this.selectedNoteData.deleted_time = 0
prompt.showToast({ message: "已恢复", duration: 2000 })
let context: any = getContext(this)
let resource = {
bundleName: "com.ohos.note",
moduleName: "tablet",
id: $r('app.string.restore').id
};
context.resourceManager.getString(resource, (error, value) => {
if (error != null) {
console.log("error is " + error);
} else {
prompt.showToast({ message: value, duration: 2000 });
}
});
this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0)
this.chooseNote = false
// update note to db

View File

@ -216,7 +216,7 @@ export struct NoteContentOverViewComp {
}
build() {
// if (this.selectedNoteData && this.selectedNoteData.is_deleted) {
if (this.selectedNoteData) {
Flex({ direction: FlexDirection.Column, wrap: FlexWrap.NoWrap,
justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Row() {
@ -254,7 +254,7 @@ export struct NoteContentOverViewComp {
.opacity(this.selectedNoteData.is_deleted == Delete.Yes ? 0.4 : 1)
.width(StyleConstants.PERCENTAGE_100)
.height(82)
// }
}
}
}

View File

@ -591,7 +591,7 @@ export struct OperateNoteComp {
this.longpress = false
NoteUtil.unsetAllNotesChecked(this.CheckedNoteArray)
})
Image(this.selectedAll ? $r('app.media.check_all1') : $r('app.media.check_all'))
Image(this.CheckedNoteArray.length == NoteUtil.getNoteDataArray(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid).length ? $r('app.media.check_all1') : $r('app.media.check_all'))
.width(24)
.height(24)
.onClick(() => {

View File

@ -72,6 +72,9 @@ export class FolderUtil {
}
LogUtil.info(TAG, "folderData uuid " + folderData.uuid + " isSelected " + isSelected)
if (folderData.folder_type == FolderType.SysDef || folderData.folder_type == FolderType.FeatureDef) {
if (folderData.uuid ==SysDefFolderUuid.UnClassified) {
return "#FF9516"
}
return isSelected ? $r("app.color.folder_color_f86d05") : $r("app.color.folder_color_99182431")
}
return folderData.color

View File

@ -144,6 +144,9 @@ export class NoteUtil {
if (folderData.color == "#ffffff") {
return "#FFEBE1"
}
if (folderData.color == "#e84026") {
return "#ffe0b2ac"
}
LogUtil.info(TAG, "isSelected " + isSelected.toString() + ", folderData.color: " + folderData.color.toString())
return isSelected ? selectedNoteBgColorMap[folderData.color] : unSelectedNoteBgColorMap[folderData.color]
}