!55 fix note bug

Merge pull request !55 from zhanghongchuan33/master
This commit is contained in:
openharmony_ci
2022-05-26 01:39:55 +00:00
committed by Gitee
5 changed files with 18 additions and 7 deletions
@@ -30,6 +30,7 @@ import OperationUtils from '@ohos/utils/src/main/ets/default/baseUtil/OperationU
import mediaquery from '@ohos.mediaquery'
import router from '@system.router';
import inputMethod from '@ohos.inputmethod';
import {folderTextMap} from '@ohos/utils/src/main/ets/default/model/NoteBaseData'
const TAG = "NoteContent"
@@ -384,7 +385,9 @@ export struct NoteContentOverViewComp {
.fontColor($r("app.color.modified_time_font_color"))
.margin({ left: 12 })
Row() {
Text(FolderUtil.getFolderText(FolderUtil.getFolderData(AppStorage.Get('AllFolderArray'), this.selectedNoteData.folder_uuid)))
Text(FolderUtil.getFolderText(FolderUtil.getFolderData(AppStorage.Get('AllFolderArray'), this.selectedNoteData.folder_uuid)) ==
folderTextMap["sys_def_myFavorites_uuid"] ? folderTextMap["sys_def_unClassified_uuid"] :
FolderUtil.getFolderText(FolderUtil.getFolderData(AppStorage.Get('AllFolderArray'), this.selectedNoteData.folder_uuid)))
.fontSize(12)
.fontColor($r("app.color.list_modified_time_font_color"))
Image($r('app.media.triangle'))
@@ -28,6 +28,7 @@ import {LogUtil} from '@ohos/utils/src/main/ets/default/baseUtil/LogUtil'
import OperationUtils from '@ohos/utils/src/main/ets/default/baseUtil/OperationUtils'
import mediaquery from '@ohos.mediaquery'
import inputMethod from '@ohos.inputmethod';
import {folderTextMap} from '@ohos/utils/src/main/ets/default/model/NoteBaseData'
const TAG = "NoteContentComp"
@@ -276,7 +277,9 @@ export struct NoteContentOverViewComp {
.fontColor($r("app.color.modified_time_font_color"))
.margin({ left: 12 })
Row() {
Text(FolderUtil.getFolderText(FolderUtil.getFolderData(AppStorage.Get('AllFolderArray'), this.selectedNoteData.folder_uuid)))
Text(FolderUtil.getFolderText(FolderUtil.getFolderData(AppStorage.Get('AllFolderArray'), this.selectedNoteData.folder_uuid)) ==
folderTextMap["sys_def_myFavorites_uuid"] ? folderTextMap["sys_def_unClassified_uuid"] :
FolderUtil.getFolderText(FolderUtil.getFolderData(AppStorage.Get('AllFolderArray'), this.selectedNoteData.folder_uuid)))
.fontSize(12)
.fontColor($r("app.color.list_modified_time_font_color"))
Image($r('app.media.triangle'))
@@ -29,6 +29,7 @@ import { LogUtil } from '@ohos/utils/src/main/ets/default/baseUtil/LogUtil'
import OperationUtils from '@ohos/utils/src/main/ets/default/baseUtil/OperationUtils'
import router from '@system.router'
import inputMethod from '@ohos.inputmethod';
import {folderTextMap} from '@ohos/utils/src/main/ets/default/model/NoteBaseData'
var time_id: number
@@ -229,7 +230,9 @@ export struct NoteContentOverViewComp {
.padding({ top: 4, bottom: 4 })
.fontColor($r("app.color.modified_time_font_color"))
Row() {
Text(FolderUtil.getFolderText(FolderUtil.getFolderData(AppStorage.Get('AllFolderArray'), this.selectedNoteData.folder_uuid)))
Text(FolderUtil.getFolderText(FolderUtil.getFolderData(AppStorage.Get('AllFolderArray'), this.selectedNoteData.folder_uuid)) ==
folderTextMap["sys_def_myFavorites_uuid"] ? folderTextMap["sys_def_unClassified_uuid"] :
FolderUtil.getFolderText(FolderUtil.getFolderData(AppStorage.Get('AllFolderArray'), this.selectedNoteData.folder_uuid)))
.fontColor($r('app.color.folder_color_99182431'))
.fontSize(12)
Image($r('app.media.triangle'))
@@ -432,7 +435,7 @@ export struct DeleteNoteComp {
.onClick(() => {
this.selectedNoteData.is_deleted = Delete.No
this.selectedNoteData.deleted_time = 0
prompt.showToast({ message: $r('app.string.restore').toString(), duration: 2000 })
prompt.showToast({ message: $r('app.string.restore'), duration: 2000 })
this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0)
// update note to db
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
@@ -630,7 +630,7 @@ export struct AddNoteComp {
.responseRegion({ x: -15.0, y: -15.0, width: 54, height: 54 })
.onClick(() => {
let noteData
if (this.selectedFolderData.uuid == SysDefFolderUuid.AllNotes) {
if (this.selectedFolderData.uuid == SysDefFolderUuid.AllNotes || this.selectedFolderData.uuid == SysDefFolderUuid.MyFavorites) {
noteData = new NoteData(0, "标题", new Date().getTime() + "", SysDefFolderUuid.UnClassified, "", "", NoteType.SysDef, Top.No, Favorite.No, Delete.No, new Date().getTime(), new Date().getTime(), 0)
} else {
noteData = new NoteData(0, "标题", new Date().getTime() + "", this.selectedFolderData.uuid, "", "", NoteType.SysDef, Top.No, Favorite.No, Delete.No, new Date().getTime(), new Date().getTime(), 0)
@@ -18,7 +18,7 @@ var RICH_EDITOR = {};
RICH_EDITOR.editor = document.getElementById('editorjs');
RICH_EDITOR.setHtml = function(contents) {
RICH_EDITOR.editor.innerHTML = contents.replace(/%20/g, '+');
RICH_EDITOR.editor.innerHTML = contents.replace(/'/g, "'");
}
RICH_EDITOR.getHtml = function() {
@@ -322,6 +322,7 @@ RICH_EDITOR.getSelectedAnchorNode=function(){
function get_html_content() {
console.log('get_html_content');
var htmlString = RICH_EDITOR.getHtml()
htmlString = htmlString.replace(/'/g, ''')
var str = callBackToApp.callbackhtml(htmlString)
console.log('get_html_content end');
}
@@ -329,7 +330,8 @@ function get_html_content() {
function save_html_content() {
console.log('save_html_content');
var htmlString = RICH_EDITOR.getHtml()
var str = callBackToApp.callbackhtmlSave(htmlString.replace(/\+/g, '%20'))
htmlString = htmlString.replace(/'/g, ''')
var str = callBackToApp.callbackhtmlSave(htmlString)
console.log('save_html_content end');
}