diff --git a/common/utils/src/main/ets/default/baseUtil/FolderUtil.ets b/common/utils/src/main/ets/default/baseUtil/FolderUtil.ets index ab9190b6af86222e909c6b2d63ff4c313e8bb7bb..6d09c24cda3342d86f1768506685a4e08be16bc7 100644 --- a/common/utils/src/main/ets/default/baseUtil/FolderUtil.ets +++ b/common/utils/src/main/ets/default/baseUtil/FolderUtil.ets @@ -98,7 +98,14 @@ export class FolderUtil { * @return boolean - fottom fixed folder: deleted or favorite return true. else return false */ isBottomFixedFolder(folderData: FolderData): boolean { - LogUtil.info(TAG, "folderDataUuid " + folderData.uuid) + if (folderData === undefined || folderData === null) { + LogUtil.info(TAG, "isBottomFixedFolder folderData undefined") + } + if (folderData.uuid === undefined || folderData.uuid === null) { + LogUtil.info(TAG, "isBottomFixedFolder folderData uuid undefined") + folderData.uuid = 'sys_def_unClassified_uuid'; + } + LogUtil.info(TAG, "isBottomFixedFolder folderDataUuid " + folderData.uuid) return (folderData.folder_type == FolderType.FeatureDef) } @@ -109,7 +116,14 @@ export class FolderUtil { * @return boolean - can be moved into notes return true. else return false */ isFolderMoveIn(folderData: FolderData): boolean { - LogUtil.info(TAG, "folderDataUuid " + folderData.uuid) + if (folderData === undefined || folderData === null) { + LogUtil.info(TAG, "isFolderMoveIn folderData undefined") + } + if (folderData.uuid === undefined || folderData.uuid === null) { + LogUtil.info(TAG, "isFolderMoveIn folderData uuid undefined") + folderData.uuid = 'sys_def_unClassified_uuid'; + } + LogUtil.info(TAG, "isFolderMoveIn folderDataUuid " + folderData.uuid) return (folderData.uuid == SysDefFolderUuid.UnClassified || folderData.folder_type == FolderType.CusDef) } diff --git a/features/src/main/ets/components/CusDialogComp.ets b/features/src/main/ets/components/CusDialogComp.ets index a7d62269b7952767671e67ae4206ebaf46110a36..1afb2e0b065e3f70228b6ab5a9dcb80b16d33029 100644 --- a/features/src/main/ets/components/CusDialogComp.ets +++ b/features/src/main/ets/components/CusDialogComp.ets @@ -332,6 +332,10 @@ export struct NoteDataMoveDialog { aboutToAppear() { this.NoteDataMoveArray = this.AllFolderArray.slice(2, this.AllFolderArray.length); + if (this.AllFolderArray[1] === undefined || this.AllFolderArray[1] === null) { + LogUtil.info(TAG, "this AllFolderArray[1] undefined") + return + } this.NoteDataMoveArray.push(this.AllFolderArray[1]); } @@ -346,15 +350,17 @@ export struct NoteDataMoveDialog { .width(288) List() { - ForEach(this.NoteDataMoveArray.slice(0, this.NoteDataMoveArray.length - 1), (item) => { - ListItem() { - NoteDataMoveItemComp({ folderItem: item }) - } - .onClick(() => { - this.noteDataMoveDialogCtl.close() - this.onConfirm(item.uuid) - }) - }, noteItem => noteItem.uuid) + if (this.NoteDataMoveArray !== undefined && this.NoteDataMoveArray !== null && this.NoteDataMoveArray !== []) { + ForEach(this.NoteDataMoveArray.slice(0, this.NoteDataMoveArray.length - 1), (item) => { + ListItem() { + NoteDataMoveItemComp({ folderItem: item }) + } + .onClick(() => { + this.noteDataMoveDialogCtl.close() + this.onConfirm(item.uuid) + }) + }, noteItem => noteItem.uuid) + } ListItem() { NoteDataMoveItemComp({ folderItem: this.NoteDataMoveArray[this.NoteDataMoveArray.length - 1], diff --git a/features/src/main/ets/components/NoteContentComp.ets b/features/src/main/ets/components/NoteContentComp.ets index b6341e4676dc6ddb25f92909bf92a7e50a278e74..58052e554c317282c5f4e19671a10f7c6d77af8e 100644 --- a/features/src/main/ets/components/NoteContentComp.ets +++ b/features/src/main/ets/components/NoteContentComp.ets @@ -349,11 +349,19 @@ export struct NoteContentOverViewComp { getArray() { this.NoteDataMoveArray = this.AllFolderArray.slice(2, this.AllFolderArray.length); + if (this.AllFolderArray[1] === undefined || this.AllFolderArray[1] === null) { + LogUtil.info(TAG, "this AllFolderArray[1] undefined") + return + } this.NoteDataMoveArray.push(this.AllFolderArray[1]); } aboutToAppear() { this.NoteDataMoveArray = this.AllFolderArray.slice(2, this.AllFolderArray.length); + if (this.AllFolderArray[1] === undefined || this.AllFolderArray[1] === null) { + LogUtil.info(TAG, "this AllFolderArray[1] undefined") + return + } this.NoteDataMoveArray.push(this.AllFolderArray[1]); } @@ -369,31 +377,33 @@ export struct NoteContentOverViewComp { @Builder MenuBuilder() { Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { List() { - ForEach(this.NoteDataMoveArray, (item) => { - ListItem() { - NoteDataMoveItemCompTablet({ folderItem: item, uuid: this.selectedNoteData.folder_uuid }) - } - .onClick(() => { - this.selectedNoteData.folder_uuid = item.uuid - let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) - predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) - RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) - if (this.sectionStatus != 1) { - this.selectedNoteData = NoteUtil.getFirstNoteData(this.AllNoteArray, this.selectedFolderData.uuid) - this.controllerShow.runJavaScript( - "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')" - ) - this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0) - } else { - this.selectedFolderData = FolderUtil.getFolderData(AppStorage.Get('AllFolderArray'), item.uuid) + if (this.NoteDataMoveArray !== undefined && this.NoteDataMoveArray !== null && this.NoteDataMoveArray !== []) { + ForEach(this.NoteDataMoveArray, (item) => { + ListItem() { + NoteDataMoveItemCompTablet({ folderItem: item, uuid: this.selectedNoteData.folder_uuid }) } - // save continue data - 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) + .onClick(() => { + this.selectedNoteData.folder_uuid = item.uuid + let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) + predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) + RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) + if (this.sectionStatus != 1) { + this.selectedNoteData = NoteUtil.getFirstNoteData(this.AllNoteArray, this.selectedFolderData.uuid) + this.controllerShow.runJavaScript( + "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')" + ) + this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0) + } else { + this.selectedFolderData = FolderUtil.getFolderData(AppStorage.Get('AllFolderArray'), item.uuid) + } + // save continue data + 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) .edgeEffect(EdgeEffect.Spring) .height(this.AllFolderArray.length > 12 ? 504 : (this.AllFolderArray.length - 3) * 56) diff --git a/features/src/main/ets/components/NoteContentCompPortrait.ets b/features/src/main/ets/components/NoteContentCompPortrait.ets index 63a595d7660f9e483f70c52ffce54b3535313ef5..abb16eb6e019eb5c6187065f3f6e992dc144b43f 100644 --- a/features/src/main/ets/components/NoteContentCompPortrait.ets +++ b/features/src/main/ets/components/NoteContentCompPortrait.ets @@ -363,6 +363,10 @@ export struct NoteContentOverViewComp { aboutToAppear() { this.NoteDataMoveArray = this.AllFolderArray.slice(2, this.AllFolderArray.length); + if (this.AllFolderArray[1] === undefined || this.AllFolderArray[1] === null) { + LogUtil.info(TAG, "this AllFolderArray[1] undefined") + return + } this.NoteDataMoveArray.push(this.AllFolderArray[1]); }