note updata

Signed-off-by: zhuhong <1870495044@qq.com>
This commit is contained in:
zhuhong 2022-03-09 13:19:48 +08:00
parent 5d5a11070c
commit 23294f0292
236 changed files with 9374 additions and 38 deletions

16
.gitignore vendored Normal file
View File

@ -0,0 +1,16 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
/entry/.preview
.cxx
/node_modules

176
LICENSE Normal file
View File

@ -0,0 +1,176 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS

View File

@ -1,39 +1,2 @@
# applications_note
# ohos_notes
#### 介绍
{**以下是 Gitee 平台说明,您可以替换此简介**
Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN。专为开发者提供稳定、高效、安全的云端软件开发协作平台
无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
#### 软件架构
软件架构说明
#### 安装教程
1. xxxx
2. xxxx
3. xxxx
#### 使用说明
1. xxxx
2. xxxx
3. xxxx
#### 参与贡献
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
#### 特技
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

38
build.gradle Normal file
View File

@ -0,0 +1,38 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply plugin: 'com.huawei.ohos.app'
//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510
ohos {
compileSdkVersion 8
supportSystem "standard"
}
buildscript {
repositories {
maven {
url 'http://repo.ark.tools.huawei.com/artifactory/maven-public/'
allowInsecureProtocol = true
}
maven {
url 'http://mirrors.tools.huawei.com/maven/'
allowInsecureProtocol = true
}
}
dependencies {
classpath 'com.huawei.ohos:hap:3.0.6.4'
classpath 'com.huawei.ohos:decctest:1.2.7.2'
}
}
allprojects {
repositories {
maven {
url 'http://repo.ark.tools.huawei.com/artifactory/maven-public/'
allowInsecureProtocol = true
}
maven {
url 'http://mirrors.tools.huawei.com/maven/'
allowInsecureProtocol = true
}
}
}

View File

@ -0,0 +1,20 @@
apply plugin: 'com.huawei.ohos.library'
//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510
ohos {
compileSdkVersion 8
defaultConfig {
compatibleSdkVersion 8
}
buildTypes {
release {
proguardOpt {
proguardEnabled false
rulesFiles 'proguard-rules.pro'
}
}
}
}
dependencies {
}

1
common/component/proguard-rules.pro vendored Normal file
View File

@ -0,0 +1 @@
# config module specific ProGuard rules here.

View File

@ -0,0 +1,22 @@
{
"app": {
"bundleName": "com.ohos.note",
"vendor": "ohos",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {},
"module": {
"package": "com.ohos.note.common",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "component",
"moduleType": "har"
}
}
}

View File

@ -0,0 +1,531 @@
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import FolderData from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/FolderData.ets'
import NoteData from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/NoteData.ets'
import {circleColorArray,fontColorArray} from '../../../../../../common/utils/src/main/ets/default/model/NoteBaseData.ets'
import {SysDefFolderUuid, DeleteFileType, FolderType} from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/EnumData.ets'
import GlobalResourceManager from '../../../../../../common/utils/src/main/ets/default/baseUtil/GlobalResourceManager.ets';
import FolderUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/FolderUtil.ets'
import NoteUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/NoteUtil.ets'
@CustomDialog
export struct NewOrEditFolderDialog {
newOrEditFolderDialogCtl: CustomDialogController;
confirm: (color: string, name: string) => void
@State inputName: string = "";
private oriInputName: string = "";
private oriSelectedColor: string = "";
private editFolderUuid: string = "";
private dialogType: number = 0; // 0表示新建文件夹 1表示修改文件夹
@State isExisted: boolean = false;
@StorageLink('AllFolderArray') AllFolderArray: FolderData[] = AppStorage.Link('AllFolderArray')
@Consume('SelectedColor') selectedColor: string;
build() {
Column() {
Text(this.dialogType == 0 ? $r("app.string.createFolder") : $r("app.string.editFolder"))
.fontSize(20).height(56).margin({ left: 24 })
// folder color choose
Flex({ wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceBetween }) {
ForEach(circleColorArray, (colorStr: string) => {
ColorCircleComp({ circleColor: colorStr })
}, colorStr => colorStr)
}.margin({ bottom: 24, left: 24, right: 24 })
// folder name input
Flex({ wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceBetween }) {
Image($r("app.media.folder"))
.width(24)
.height(24)
.objectFit(ImageFit.ScaleDown)
.fillColor(this.selectedColor)
TextInput({ text: this.inputName, placeholder: $r("app.string.input_placeholder") })
.placeholderFont({ size: 18 })
.maxLength(20)
.borderRadius(15)
.backgroundColor(Color.White)
.width('90%')
.onChange((value: string) => {
this.inputName = value
FolderUtil.duplicateDetection(this.inputName, this.AllFolderArray).then(result => {
this.isExisted = result
})
})
}.margin({ bottom: 4, left: 24, right: 24 })
Text($r("app.string.category_already_exist")).fontSize(10).margin({ left: 64 }).fontColor("#FA2A2D")
.visibility((this.isExisted && this.inputName != this.oriInputName) ? Visibility.Visible : Visibility.None)
// button group
Flex({ wrap: FlexWrap.Wrap, justifyContent: FlexAlign.SpaceBetween }) {
Text($r("app.string.cancel"))
.fontSize(18)
.textAlign(TextAlign.Center)
.fontColor($r("app.color.button_color_f86d05"))
.width('48%')
.onClick(() => {
this.newOrEditFolderDialogCtl.close()
})
Divider().vertical(true).height(15).strokeWidth(1).color($r("app.color.divider_color_e4e4e4"))
Text($r("app.string.save"))
.opacity(this.inputName == ""
|| (this.oriSelectedColor == this.selectedColor && this.inputName == this.oriInputName && this.dialogType == 1)
|| (this.isExisted && this.dialogType == 0)
|| (this.isExisted && this.dialogType == 1 && this.inputName != this.oriInputName) ? 0.4 : 1)
.enabled(this.inputName == ""
|| (this.oriSelectedColor == this.selectedColor && this.inputName == this.oriInputName && this.dialogType == 1)
|| (this.isExisted && this.dialogType == 0)
|| (this.isExisted && this.dialogType == 1 && this.inputName != this.oriInputName) ? false : true)
.fontSize(18)
.textAlign(TextAlign.Center)
.fontColor($r("app.color.button_color_f86d05"))
.width('48%')
.onClick(() => {
this.newOrEditFolderDialogCtl.close()
this.confirm(this.selectedColor, this.inputName)
})
}.width('100%').margin({ top: 21, bottom: 25 })
}
.width(336)
.borderRadius(36)
.backgroundColor(Color.White)
.alignItems(HorizontalAlign.Start)
.margin({bottom:16,left:12,right:12})
}
aboutToAppear(): void{
var currentFolder: FolderData = FolderUtil.getFolderData(this.AllFolderArray, this.editFolderUuid) // 获取当前选中的文件夹
if (currentFolder == null) {
return
}
if (currentFolder.folder_type == FolderType.CusDef) {
this.inputName = currentFolder.name
this.oriInputName = this.inputName
this.oriSelectedColor = currentFolder.color
} else {
GlobalResourceManager.getStringByResource(FolderUtil.getFolderText(currentFolder)).then(result => {
this.inputName = result
this.oriInputName = this.inputName
this.oriSelectedColor = currentFolder.color
})
}
}
}
@Component
struct ColorCircleComp {
private circleColor: string
@Consume('SelectedColor') selectedColor: string;
build() {
Stack({ alignContent: Alignment.Center }) {
Circle({ width: 24, height: 24 }).fill(this.circleColor)
Circle({ width: 12, height: 12 }).fill($r("app.color.color_ffffff"))
.visibility(this.circleColor == this.selectedColor ? Visibility.Visible : Visibility.None)
}.onClick(() => {
this.selectedColor = this.circleColor
})
}
}
@CustomDialog
export struct DeleteDialog {
@StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = []
@StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray')
@StorageLink('AllFolderArray') AllFolderArray: FolderData[] = AppStorage.Link('AllFolderArray')
@Consume('SelectedNoteData') selectedNoteData: NoteData;
@Consume('SelectedFolderData') selectedFolderData: FolderData
private multiSelect: boolean = false
private deleteFileType = DeleteFileType.NoteData
noteDataDeleteDialogCtl: CustomDialogController
onConfirm: () => void
build() {
Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.SpaceBetween }) {
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
if (this.deleteFileType == DeleteFileType.FolderData) {
Text($r("app.string.delete_tips")).fontSize(14).textAlign(TextAlign.Center).maxLines(1)
} else {
Text(this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes ? $r("app.string.deleteNoteComplete") : $r("app.string.deleteNote"))
.fontSize(14).textAlign(TextAlign.Center).maxLines(1)
.visibility(this.multiSelect == false || this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes ? Visibility.Visible : Visibility.None)
if (this.CheckedNoteArray.length ==
NoteUtil.getNoteDataArray(this.AllNoteArray, this.selectedFolderData.uuid).length) {
Text($r("app.string.deleteAllNote"))
.fontSize(14).textAlign(TextAlign.Center).maxLines(1)
.visibility(this.multiSelect == false || this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes ? Visibility.None : Visibility.Visible)
} else if (this.CheckedNoteArray.length == 1) {
Text($r("app.string.deleteNote"))
.fontSize(14).textAlign(TextAlign.Center).maxLines(1)
.visibility(this.multiSelect == false || this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes ? Visibility.None : Visibility.Visible)
} else {
Text($r("app.string.deletePartNote", this.CheckedNoteArray.length))
.fontSize(14).textAlign(TextAlign.Center).maxLines(1)
.visibility(this.multiSelect == false || this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes ? Visibility.None : Visibility.Visible)
}
}
}
.width(288)
.height(28.5)
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
Text($r("app.string.cancel"))
.fontSize(16)
.fontColor($r("app.color.button_color_f86d05"))
.textAlign(TextAlign.Center)
.maxLines(1)
.width('50%')
.height('100%')
.onClick(() => {
this.noteDataDeleteDialogCtl.close()
})
Divider().vertical(true).strokeWidth(1).color($r("app.color.divider_color_e4e4e4")).height(40)
Text($r("app.string.delete"))
.fontSize(16)
.fontColor($r("app.color.delete_color_fa2a2d"))
.textAlign(TextAlign.Center)
.maxLines(1)
.width('50%')
.height('100%')
.onClick(() => {
this.noteDataDeleteDialogCtl.close()
this.onConfirm()
})
}
.width('100%')
.height('50%')
}
.width(336)
.height(117)
.borderRadius(36)
.padding({ top: 24, bottom: 16, left: 16, right: 16 })
.backgroundColor(Color.White)
.margin({bottom:16,left:12,right:12})
}
}
@Component
struct NoteDataMoveItemComp {
@StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = []
@StorageLink('AllFolderArray') AllFolderArray: FolderData[] = []
private folderItem: FolderData
build() {
Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap }) {
Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap }) {
Image(FolderUtil.getFolderIcon(this.folderItem.uuid))
.objectFit(ImageFit.ScaleDown)
.width(24)
.height(24)
.fillColor(FolderUtil.getFolderIconColor(this.AllFolderArray, this.folderItem.uuid, false))
}
.width(24)
Column() {
Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceBetween }) {
Text(FolderUtil.getFolderText(this.folderItem))
.fontSize(16)
.textAlign(TextAlign.Center)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.flexShrink(1)
Image((FolderUtil.getCommonFolder(this.AllFolderArray, this.CheckedNoteArray) == null
|| FolderUtil.getCommonFolder(this.AllFolderArray, this.CheckedNoteArray) != this.folderItem) ? $r("app.media.foldMove_unselect") : $r("app.media.foldMove_select"))
.objectFit(ImageFit.ScaleDown)
.width(24)
.height(24)
}
.width(248)
.height(55)
Divider().color($r("app.color.divider_color_e4e4e4")).strokeWidth(1)
}
.padding({ left: 16 })
}
.width(288)
.height(56)
.visibility(FolderUtil.isFolderMoveIn(this.folderItem) ? Visibility.Visible : Visibility.None)
}
}
@CustomDialog
export struct NoteDataMoveDialog {
noteDataMoveDialogCtl: CustomDialogController
onConfirm: (folderUuid: string) => void
@StorageLink('AllFolderArray') AllFolderArray: FolderData[] = []
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap }) {
Flex({ alignItems: ItemAlign.Center }) {
Text($r("app.string.chooseFolder"))
.fontSize(20)
}.height(56).width(288)
List() {
ForEach(this.AllFolderArray, (item) => {
ListItem() {
NoteDataMoveItemComp({ folderItem: item })
}
.onClick(() => {
this.noteDataMoveDialogCtl.close()
this.onConfirm(item.uuid)
})
}, noteItem => noteItem.uuid)
}.listDirection(Axis.Vertical)
.edgeEffect(EdgeEffect.Spring)
.height(this.AllFolderArray.length > 12 ? 504 : (this.AllFolderArray.length - 3) * 56)
Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text($r("app.string.cancel"))
.fontSize(16)
.fontColor($r("app.color.text_color_3f97e9"))
.onClick(() => {
this.noteDataMoveDialogCtl.close()
})
}.height(56).width(288)
}
.width(336)
.borderRadius(36)
.height(this.AllFolderArray.length > 12 ? 616 : (this.AllFolderArray.length - 1) * 56)
.padding({ left: 24, right: 24 })
.backgroundColor(Color.White)
.margin({bottom:16,left:12,right:12})
}
}
@CustomDialog
export struct EditContentDialog {
editContentDialogCtl: CustomDialogController;
confirm: (excuteJs: string) => void
@Consume('SelectedColor') selectedColor: string;
@State inSetValue: number = 20
private circleColor: string
private fontSize:number
build() {
Row() {
Column() {
Row({ space: 70 }) {
Button({ type: ButtonType.Normal, stateEffect: true }) {
Image($r('app.media.action_bold')).height(24).width(24)
.onClick(() => {
this.confirm("javascript:RE.setBold()")
})
}.width(42).height(42).borderRadius(8).backgroundColor($r('app.color.color_ffffff'))
Button({ type: ButtonType.Normal, stateEffect: true }) {
Image($r('app.media.format_italic')).height(24).width(24)
.onClick(() => {
this.confirm("javascript:RE.setItalic()")
})
}.width(42).height(42).borderRadius(8).backgroundColor($r('app.color.color_ffffff'))
Button({ type: ButtonType.Normal, stateEffect: true }) {
Image($r('app.media.underline')).height(24).width(24)
.onClick(() => {
this.confirm("javascript:RE.setUnderline()")
})
}.width(42).height(42).borderRadius(8).backgroundColor($r('app.color.color_ffffff'))
Button({ type: ButtonType.Normal, stateEffect: true }) {
Image($r('app.media.right_justify')).height(24).width(24)
.onClick(() => {
this.confirm("javascript:RE.setJustifyRight()")
})
}.width(42).height(42).borderRadius(8).backgroundColor($r('app.color.color_ffffff'))
Button({ type: ButtonType.Normal, stateEffect: true }) {
Image($r('app.media.mid_justify')).height(24).width(24)
.onClick(() => {
this.confirm("javascript:RE.setJustifyCenter()")
})
}.width(42).height(42).borderRadius(8).backgroundColor($r('app.color.color_ffffff'))
Button({ type: ButtonType.Normal, stateEffect: true }) {
Image($r('app.media.left_justify')).height(24).width(24)
.onClick(() => {
this.confirm("javascript:RE.setJustifyLeft()")
})
}.width(42).height(42).borderRadius(8).backgroundColor($r('app.color.color_ffffff'))
}
.alignItems(VerticalAlign.Bottom)
.padding({bottom:2})
.height(71)
Divider().vertical(false).color($r("app.color.divider_color_e4e4e4"))
Row({ space: 70 }){
Button({ type: ButtonType.Normal, stateEffect: true }) {
Image($r('app.media.suojin')).height(24).width(24)
.onClick(() => {
this.confirm("javascript:RE.setIndent()")
})
}.width(42).height(42).borderRadius(8).backgroundColor($r('app.color.color_ffffff'))
Button({ type: ButtonType.Normal, stateEffect: true }) {
Image($r('app.media.suojin_back')).height(24).width(24)
.onClick(() => {
this.confirm("javascript:RE.setOutdent()")
})
}.width(42).height(42).borderRadius(8).backgroundColor($r('app.color.color_ffffff'))
Button({ type: ButtonType.Normal, stateEffect: true }) {
Image($r("app.media.format_menulist_number")).height(24).width(24)
.onClick(() => {
this.confirm("javascript:RE.setNumbers()")
})
}.width(42).height(42).borderRadius(8).backgroundColor($r('app.color.color_ffffff'))
Button({ type: ButtonType.Normal, stateEffect: true }) {
Image($r("app.media.format_menulist_alphabet")).height(24).width(24)
.onClick(() => {
this.confirm("javascript:RE.setABC()")
})
}.width(42).height(42).borderRadius(8).backgroundColor($r('app.color.color_ffffff'))
Button({ type: ButtonType.Normal, stateEffect: true }) {
Image($r('app.media.format_menubullte2')).height(24).width(24)
.onClick(() => {
this.confirm("javascript:RE.setBullets()")
})
}.width(42).height(42).borderRadius(8).backgroundColor($r('app.color.color_ffffff'))
Button({ type: ButtonType.Normal, stateEffect: true }) {
Image($r('app.media.format_menubullte1')).height(24).width(24)
.onClick(() => {
this.confirm("javascript:RE.setSquare()")
})
}.width(42).height(42).borderRadius(8).backgroundColor($r('app.color.color_ffffff'))
}
.alignItems(VerticalAlign.Top)
.padding({top:2})
.height(56)
}
.width('50%')
.padding({left:24,right:24})
.height(128)
Divider().vertical(true).height(128).color($r("app.color.divider_color_e4e4e4")).margin({top:4,bottom:4})
Column() {
Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap, justifyContent: FlexAlign.End }) {
Image($r('app.media.cross')).height(16).width(16).margin({top:8})
.onClick(() => {
this.editContentDialogCtl.close()
})
}
.height(36)
Row(){
Flex({ wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceBetween }) {
ForEach(fontColorArray, (colorStr: string) => {
Stack({ alignContent: Alignment.Center }) {
Circle({ width: 24, height: 24 }).fill(colorStr)
Circle({ width: 12, height: 12 }).fill($r("app.color.color_ffffff"))
.visibility(colorStr == this.selectedColor ? Visibility.Visible : Visibility.None)
}.onClick(() => {
this.selectedColor = colorStr
this.confirm("javascript:RE.setTextColor('" + this.selectedColor + "')")
})
}, colorStr => colorStr)
}.padding({ bottom: 11})
}
.alignItems(VerticalAlign.Top)
.height(35)
Divider().vertical(false).color($r("app.color.divider_color_e4e4e4"))
Row({ space: 15 }) {
Image($r('app.media.font_small')).height(24).width(24).margin({top:8})
Slider({
value: this.inSetValue,
min: 0,
max: 60,
step: 10,
style: SliderStyle.InSet
})
.blockColor($r("app.color.color_ffffff"))
.trackColor($r("app.color.divider_color_e4e4e4"))
.selectedColor($r("app.color.text_color_f86d05"))
.showSteps(false)
.showTips(false)
.onChange((value: number, mode: SliderChangeMode) => {
this.inSetValue = value
this.fontSize = value + 20
this.confirm("javascript:RE.execFontSize('" + this.fontSize+"')")
console.info('value:' + value + 'mode:' + mode.toString())
})
.width('88%')
Image($r('app.media.font_large')).height(24).width(24).margin({top:7})
}
.alignItems(VerticalAlign.Top)
.padding({ top: 5 })
.height(56)
}
.width('50%')
.height(128)
.padding({left:24,right:24})
}
.width('100%')
.height(128)
.backgroundColor($r("app.color.color_ffffff"))
.borderRadius(36)
}
}
@CustomDialog
export struct EditTitleDialog {
editTitleDialog: CustomDialogController;
confirm: (newTitle: string) => void
@State inputName: string = "";
build() {
Column() {
Text($r("app.string.editNoteTitle")).fontSize(20).height(56).margin({ left: 24 })
// title input
Flex({ wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceBetween }) {
TextInput({ text: this.inputName, placeholder: $r("app.string.input_placeholder") })
.placeholderFont({ size: 18 })
.maxLength(20)
.borderRadius(15)
.backgroundColor(Color.White)
.width('90%')
.onChange((value: string) => {
this.inputName = value
})
}.margin({ bottom: 4, left: 24, right: 24 })
// button group
Flex({ wrap: FlexWrap.Wrap, justifyContent: FlexAlign.SpaceBetween }) {
Text($r("app.string.cancel"))
.fontSize(18)
.textAlign(TextAlign.Center)
.fontColor($r("app.color.button_color_419fff"))
.width('48%')
.onClick(() => {
this.editTitleDialog.close()
})
Divider().vertical(true).height(15).strokeWidth(1).color($r("app.color.divider_color_e4e4e4"))
Text($r("app.string.save"))
.opacity((this.inputName == "") ? 0.4 : 1)
.enabled((this.inputName == "") ? false : true)
.fontSize(18)
.textAlign(TextAlign.Center)
.fontColor($r("app.color.button_color_419fff"))
.width('48%')
.onClick(() => {
this.editTitleDialog.close()
this.confirm(this.inputName)
})
}.width('100%').margin({ top: 21, bottom: 25 })
}
.width(336)
.borderRadius(36)
.backgroundColor(Color.White)
.alignItems(HorizontalAlign.Start)
.margin({bottom:16,left:12,right:12})
}
}

View File

@ -0,0 +1,354 @@
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import FolderData from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/FolderData.ets'
import NoteData from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/NoteData.ets'
import {SysDefFolderUuid, TableName, FolderType, FolderTableColumn, NoteTableColumn, Delete, DeleteFileType
} from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/EnumData.ets'
import {NewOrEditFolderDialog, DeleteDialog} from './CusDialogComp.ets'
import StyleConstants from '../../../../../../common/utils/src/main/ets/default/constants/StyleConstants.ets'
import RdbStoreUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/RdbStoreUtil.ets'
import FolderUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/FolderUtil.ets'
import NoteUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/NoteUtil.ets'
// Folder list component
@Component
export struct FolderListComp {
@StorageLink('AllFolderArray') AllFolderArray: FolderData[] = AppStorage.Link('AllFolderArray')
@Consume('SectionStatus') sectionStatus: number
@Consume('ExpandStatus') expandStatus: boolean //笔记本折叠展开状态
controllerShow: WebController
build() {
Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Column() {
Column() {
Image($r("app.media.suojin")).height(24).width(24)
.onClick(() => {
if (this.sectionStatus == 1) {
this.expandStatus = !this.expandStatus
} else{
this.sectionStatus = (this.sectionStatus == 3 ? 2 : 3)
// 迁移
console.log("FolderListComp, set continue section")
AppStorage.SetOrCreate<number>('ContinueSection', this.sectionStatus)
console.log("FolderListComp, set continue section success")
}
})
}.alignItems(HorizontalAlign.Start)
.width("100%").margin({ top: 28 }).padding({ left: 24 })
NoteAndCreateComp()
// center
Column() {
List() {
ForEach(this.AllFolderArray, (folderItem: FolderData) => {
ListItem() {
if (!FolderUtil.isBottomFixedFolder(folderItem)) {
FolderItemComp({ folderItem: folderItem,controllerShow: this.controllerShow})
}
}
}, folderItem => folderItem.name.toString())
}
}.width('100%').padding({ left: 12, right: 12 }).height(7 * 56) // 列表最多显示7个 每个的高度为56
}
Column() {
FolderItemComp({
folderItem: FolderUtil.getFolderData(AppStorage.Get('AllFolderArray'), SysDefFolderUuid.MyFavorites),controllerShow: this.controllerShow
})
FolderItemComp({
folderItem: FolderUtil.getFolderData(AppStorage.Get('AllFolderArray'), SysDefFolderUuid.RecentDeletes),controllerShow: this.controllerShow
})
}.margin({ bottom: 48 }).width("100%").padding({ left: 12, right: 12 })
}
}
}
@Component
export struct NoteAndCreateComp {
@StorageLink('AllFolderArray') AllFolderArray: FolderData[] = AppStorage.Link('AllFolderArray')
@Consume('SelectedColor') selectedColor: string;
@Consume('PortraitModel') portraitModel:boolean
folderCreateDialogCtl: CustomDialogController = new CustomDialogController({
builder: NewOrEditFolderDialog({ confirm: this.onCreateConfirm.bind(this), dialogType: 0 }),
alignment: DialogAlignment.Center,
autoCancel: false,
customStyle: true,
})
folderCreateDialogCtlBottom: CustomDialogController = new CustomDialogController({
builder: NewOrEditFolderDialog({ confirm: this.onCreateConfirm.bind(this), dialogType: 0 }),
alignment: DialogAlignment.Bottom,
autoCancel: false,
customStyle: true,
})
onCreateConfirm(color:string, name:string) {
let folderData = new FolderData(0, name, new Date().getTime() + "", color, FolderType.CusDef, Delete.No, new Date().getTime(), new Date().getTime()) // 新的的笔记本都是自定义类型 type为1
this.AllFolderArray.push(folderData)
// insert folder to db
RdbStoreUtil.insert(TableName.FolderTable, folderData.toFolderObject(), null)
}
build() {
Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {
Row() {
Text($r("app.string.note"))
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.width(102)
Row() {
Text($r("app.string.create"))
.fontSize(14)
.fontColor($r("app.color.text_color_f86d05"))
.onClick(() => {
this.selectedColor = "#e84026" // 新建的时候选中第一个颜色
if(this.portraitModel) {
this.folderCreateDialogCtlBottom.open()
}else{
this.folderCreateDialogCtl.open()
}
}).padding({ right: 0 })
}.width(50)
}.width("100%").margin({ top: 8 }).padding({ left: 24 }).height(56)
}
}
@Component
struct FolderItemComp {
@State folderItem: FolderData = undefined
@StorageLink('AllNoteArray') AllNoteArray: NoteData[] = []
@StorageLink('AllFolderArray') AllFolderArray: FolderData[] = []
@StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = []
@Consume('SelectedFolderData') selectedFolderData: FolderData
@Consume('SelectedNoteData') selectedNoteData: NoteData;
@Consume('RefreshFlag') refreshFlag: number
@Consume('Longpress') longpress: boolean
@Consume('SelectedColor') selectedColor: string;
@Consume('PortraitModel') portraitModel:boolean
controllerShow: WebController
private isLongPress: boolean = false
TAG = "FolderListComp"
// Folder Edit Dialog
folderEditDialogCtl: CustomDialogController = new CustomDialogController({
builder: NewOrEditFolderDialog({
editFolderUuid: this.folderItem.uuid,
confirm: this.onEditConfirm.bind(this),
dialogType: 1
}),
alignment: DialogAlignment.Center,
autoCancel: false,
customStyle: true,
})
// Folder Edit Dialog for portrait model
folderEditDialogCtlBottom: CustomDialogController = new CustomDialogController({
builder: NewOrEditFolderDialog({
editFolderUuid: this.folderItem.uuid,
confirm: this.onEditConfirm.bind(this),
dialogType: 1
}),
alignment: DialogAlignment.Bottom,
autoCancel: false,
customStyle: true,
})
// Folder Edit Callback
onEditConfirm(color:string, name:string) {
this.folderItem.color = color
this.folderItem.name = name
this.folderItem.folder_type = FolderType.CusDef
// update folder to db
let predicates_folder = RdbStoreUtil.getRdbPredicates(TableName.FolderTable)
predicates_folder.equalTo(FolderTableColumn.Uuid, this.folderItem.uuid)
RdbStoreUtil.update(this.folderItem.toFolderObject(), predicates_folder, null)
}
// Folder Delete Dialog
folderDeleteDialogCtl: CustomDialogController = new CustomDialogController({
builder: DeleteDialog({ onConfirm: this.onDeleteConfirm.bind(this), deleteFileType: DeleteFileType.FolderData }),
alignment: DialogAlignment.Center,
autoCancel: false,
customStyle: true,
})
// Folder Delete Dialog for portrait model
folderDeleteDialogCtlBottom: CustomDialogController = new CustomDialogController({
builder: DeleteDialog({ onConfirm: this.onDeleteConfirm.bind(this), deleteFileType: DeleteFileType.FolderData }),
alignment: DialogAlignment.Bottom,
autoCancel: false,
customStyle: true,
})
// Folder Delete Callback
onDeleteConfirm() {
let currentFolder = FolderUtil.getFolderData(this.AllFolderArray, this.folderItem.uuid)
let index = this.AllFolderArray.indexOf(currentFolder)
let currentNoteDataArray = NoteUtil.getNoteDataArray(AppStorage.Get('AllNoteArray'), this.folderItem.uuid)
if (index > -1) {
this.AllFolderArray.splice(index, 1)
currentNoteDataArray.forEach((noteItem: NoteData) => {
noteItem.is_deleted = Delete.Yes
noteItem.folder_uuid = SysDefFolderUuid.UnClassified
noteItem.deleted_time = new Date().getTime()
// update note to db
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
predicates_note.equalTo(NoteTableColumn.Uuid, noteItem.uuid)
RdbStoreUtil.update(noteItem.toNoteObject(), predicates_note, null)
})
// delete folder from db
let predicates_folder = RdbStoreUtil.getRdbPredicates(TableName.FolderTable)
predicates_folder.equalTo(FolderTableColumn.Uuid, this.folderItem.uuid)
RdbStoreUtil.delete(predicates_folder, null)
}
}
// Folder Create Dialog
folderCreateDialogCtl: CustomDialogController = new CustomDialogController({
builder: NewOrEditFolderDialog({ confirm: this.onCreateConfirm.bind(this), dialogType: 0 }),
alignment: DialogAlignment.Center,
autoCancel: false,
customStyle: true,
})
// Folder Create Dialog for portrait model
folderCreateDialogCtlBottom: CustomDialogController = new CustomDialogController({
builder: NewOrEditFolderDialog({ confirm: this.onCreateConfirm.bind(this), dialogType: 0 }),
alignment: DialogAlignment.Bottom,
autoCancel: false,
customStyle: true,
})
// Folder Create Callback
onCreateConfirm(color:string, name:string) {
let folderData = new FolderData(0, name, new Date().getTime() + "", color, FolderType.CusDef, Delete.No, new Date().getTime(), new Date().getTime()) // 新的的笔记本都是自定义类型 type为1
this.AllFolderArray.push(folderData)
// insert folder to db
RdbStoreUtil.insert(TableName.FolderTable, folderData.toFolderObject(), null)
}
@Builder menuBuilder() {
Column({space: 1}) {
Text($r("app.string.editFolder"))
.width(124).height(48).padding({top:13, bottom: 13})
.fontSize(16).fontColor($r("app.color.folder_color_182431"))
.onClick(() => {
this.selectedColor = this.folderItem.color;
if (this.portraitModel) {
this.folderEditDialogCtlBottom.open()
} else {
this.folderEditDialogCtl.open()
}
ContextMenu.close();
})
Divider().color($r("app.color.divider_color_e4e4e4")).strokeWidth(1)
Text($r("app.string.deleteFolder"))
.width(124).height(48).padding({top:13, bottom: 14})
.fontSize(16).fontColor($r("app.color.folder_color_182431"))
.onClick(() => {
if(this.portraitModel) {
this.folderDeleteDialogCtlBottom.open()
}else{
this.folderDeleteDialogCtl.open()
}
ContextMenu.close();
})
Divider().color($r("app.color.divider_color_e4e4e4")).strokeWidth(1)
Text($r("app.string.createFolder"))
.width(124).height(48).padding({top:13, bottom: 15})
.fontSize(16).fontColor($r("app.color.folder_color_182431"))
.onClick(() => {
this.selectedColor = "#e84026" // 新建的时候选中第一个颜色
if(this.portraitModel) {
this.folderCreateDialogCtlBottom.open()
}else{
this.folderCreateDialogCtl.open()
}
ContextMenu.close();
})
}.width(156).height(154).padding({top: 4, bottom: 4, left: 16, right: 16}).borderRadius(16).backgroundColor(Color.White)
.visibility(this.folderItem.folder_type == FolderType.CusDef ? Visibility.Visible : Visibility.None)
}
build() {
Flex() {
Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceBetween }) {
Row() {
Image(FolderUtil.getFolderIcon(this.folderItem.uuid))
.objectFit(ImageFit.ScaleDown)
.width(24)
.height(24)
.fillColor(FolderUtil.getFolderIconColor(this.AllFolderArray, this.folderItem.uuid, this.selectedFolderData.uuid == this.folderItem.uuid))
.margin({ right: 16 })
Text(FolderUtil.getFolderText(this.folderItem))
.fontSize(16)
.textAlign(TextAlign.Center)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.flexShrink(1)
.fontColor(FolderUtil.getFolderTextColor(this.selectedFolderData.uuid == this.folderItem.uuid))
Text(this.refreshFlag.toString()).visibility(Visibility.None) // 用于强制刷新使用
}.width(118)
Text(FolderUtil.getNoteCount(AppStorage.Get('AllNoteArray'), this.folderItem.uuid).toString())
.fontSize(14)
.textAlign(TextAlign.Center)
}
.width('100%')
.borderRadius(12)
.height(56)
.padding({ left: 12, right: 12 })
.backgroundColor(this.isLongPress ? $r("app.color.folder_color_19182431") : this.selectedFolderData.uuid == this.folderItem.uuid
? $r("app.color.folder_color_ffffff") : $r("app.color.folder_color_19ffffff"))
.bindContextMenu(this.menuBuilder, ResponseType.LongPress)
.bindContextMenu(this.menuBuilder, ResponseType.RightClick)
.onClick(() => {
if (this.longpress) {
this.longpress = false
NoteUtil.unsetAllNotesChecked(this.CheckedNoteArray)
} else {
this.selectedFolderData = this.folderItem
this.selectedNoteData = NoteUtil.getFirstNoteData(AppStorage.Get('AllNoteArray'), this.folderItem.uuid)
// 刷新web界面
this.controllerShow.runJavaScript({script:"RE.setHtml('" + this.selectedNoteData.content_text + "')"})
// 迁移
console.log("FolderItemComp, set continue folder and note")
let continueFolder: string = JSON.stringify(this.selectedFolderData.toFolderObject())
console.log("FolderItemComp, continueFolder : " + continueFolder)
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
console.log("FolderItemComp, continueNote : " + continueNote)
AppStorage.SetOrCreate<string>('ContinueFolder', continueFolder)
AppStorage.SetOrCreate<string>('ContinueNote', continueNote)
AppStorage.SetOrCreate('ContinueSection', 3)
console.log("FolderItemComp, set continue folder and note success")
}
})
}
.width('100%')
.height(56)
.parallelGesture(
GestureGroup(GestureMode.Exclusive,
LongPressGesture()
.onAction(() => {
this.isLongPress = true
this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0)
})
.onActionEnd(() => {
this.isLongPress = false
this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0)
})
)
)
}
}

View File

@ -0,0 +1,541 @@
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import DateUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/DateUtil.ets'
import RdbStoreUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/RdbStoreUtil.ets'
import FolderData from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/FolderData.ets'
import NoteData from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/NoteData.ets'
import {TableName, NoteTableColumn, SysDefFolderUuid, Favorite, Delete
} from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/EnumData.ets'
import StyleConstants from '../../../../../../common/utils/src/main/ets/default/constants/StyleConstants.ets'
import {EditContentDialog,DeleteDialog,EditTitleDialog} from './CusDialogComp.ets'
import FolderUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/FolderUtil.ets'
import NoteUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/NoteUtil.ets'
import prompt from '@system.prompt'
import featureAbility from '@ohos.ability.featureAbility';
import LogUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/LogUtil.ets'
const TAG = "NoteContentComp"
// Note content component
@Component
export struct NoteContentComp {
@Consume('SelectedNoteData') selectedNoteData: NoteData;
@StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray')
@Consume('SelectedFolderData') selectedFolderData: FolderData
@Consume('RefreshFlag') refreshFlag: number
@Consume('EditModel') editModel:boolean
@Consume('SectionStatus') sectionStatus: number
@Consume('LastSectionStatus') lastSectionStatus: number
controllerShow: WebController
private editContentFlag = false
@State uri1 : string = "";
private context = getContext(this)
noteContent = {
callbackhtml: (html) => {
LogUtil.info(TAG, 'html content is:' + html)
LogUtil.info(TAG, 'note uuid is:' + this.selectedNoteData.uuid)
this.selectedNoteData.content_text = html
this.selectedNoteData.modified_time = new Date().getTime()
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid)
RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null)
LogUtil.info(TAG, 'update note success:' + this.selectedNoteData)
// 删除空白笔记
NoteUtil.deleteEmptyNote(this.selectedNoteData,this.AllNoteArray,this.controllerShow)
return "AceString";
}
}
build() {
Stack({ alignContent: Alignment.Bottom }) {
Flex({ direction: FlexDirection.Column, wrap: FlexWrap.Wrap,
alignItems: ItemAlign.Start, alignContent: FlexAlign.SpaceAround }) {
Column() {
ToolBarComp({controllerShow: this.controllerShow})
}
Column() {
NoteContentOverViewComp()
Text(this.refreshFlag.toString()).visibility(Visibility.None)
Text(this.AllNoteArray.length.toString()).visibility(Visibility.None) // 用于强制刷新使用
Web({ src: $rawfile('editor.html'), controller: this.controllerShow })
.javaScriptAccess(true)
.onPageEnd((e) => {
if (this.editContentFlag == false) {
this.controllerShow.registerJavaScriptProxy({
obj: this.noteContent,
name: "callBackToApp", // html--> name.method
methodList: ["callbackhtml"],
});
LogUtil.info(TAG, "finish register")
this.controllerShow.refresh()
this.editContentFlag = true
}
LogUtil.info(TAG, "finish loadurl")
console.log('onPageEnd:' + e.url)
this.controllerShow.runJavaScript({script:"RE.setHtml('" + this.selectedNoteData.content_text + "')"})
// 初次加载为为小屏预览模式
if(this.sectionStatus != 1) {
this.controllerShow.runJavaScript({script:"RE.setInputEnabled(false)"})
}
})
.zoomAccess(false)
.height(450)
.width('100%')
}
.margin({ top: 16 }).width(StyleConstants.PERCENTAGE_100)
.opacity(this.selectedNoteData.is_deleted == Delete.Yes ? 0.4 : 1)
.enabled(this.selectedNoteData.is_deleted == Delete.Yes ? false : true)
.onClick(() => {
// 点击第三屏进入全屏编辑模式
if(this.sectionStatus != 1) {
this.lastSectionStatus = this.sectionStatus
this.sectionStatus = 1
this.controllerShow.runJavaScript({script:"RE.setInputEnabled(true)"})
this.editModel = !this.editModel
}
})
}
.height(StyleConstants.PERCENTAGE_100)
.margin({ left: 24, right: 24 })
.visibility(FolderUtil.getNoteCount(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid) == 0 ? Visibility.Hidden : Visibility.Visible)
DeleteNoteComp()
}
.height(StyleConstants.PERCENTAGE_100)
.width(StyleConstants.PERCENTAGE_100)
}
}
@Component
export struct NoteContentOverViewComp {
@Consume('SelectedNoteData') selectedNoteData: NoteData;
@StorageLink('AllFolderArray') AllFolderArray: FolderData[] = []
@StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = []
@Consume('EditModel') editModel:boolean
@Consume('SectionStatus') sectionStatus: number
editTitleDialogCtl: CustomDialogController = new CustomDialogController({
builder: EditTitleDialog({ confirm: this.confirm.bind(this), dialogType: 0 }),
alignment: DialogAlignment.Center,
autoCancel: false,
customStyle: true,
})
confirm(newTitle: string) {
this.selectedNoteData.title = newTitle
this.selectedNoteData.modified_time = new Date().getTime()
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid)
RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null)
}
@Builder MenuBuilder() {
Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
List() {
ForEach(this.AllFolderArray, (item) => {
ListItem() {
NoteDataMoveItemComp({ folderItem: item })
}
.onClick(() => {
this.selectedNoteData.folder_uuid = item.uuid
})
}, noteItem => noteItem.uuid)
}.listDirection(Axis.Vertical)
.edgeEffect(EdgeEffect.Spring)
.height(this.AllFolderArray.length > 12 ? 504 : (this.AllFolderArray.length - 3) * 56)
}
.width(148)
.backgroundColor($r("app.color.color_fffffB"))
.padding({left:24,right:24})
}
build() {
Flex({ direction: FlexDirection.Column, wrap: FlexWrap.NoWrap,
justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Row() {
Text(this.selectedNoteData.title).fontSize(30)
.onClick(() => {
this.editModel = true
this.sectionStatus = 1
this.editTitleDialogCtl.open()
})
}.height(40).width(StyleConstants.PERCENTAGE_100)
Row() {
Text(DateUtil.formateDateForNoteContent(new Date(this.selectedNoteData.modified_time))).fontSize(12)
.padding({ top: 4, bottom: 4 })
Row() {
Text(FolderUtil.getFolderText(FolderUtil.getFolderData(AppStorage.Get('AllFolderArray'), this.selectedNoteData.folder_uuid)))
.fontSize(12)
Image($r('app.media.triangle'))
.width(6)
.height(12)
.margin({ left: 4 })
}
.padding({ left: 8, right: 8, top: 4, bottom: 4 })
.margin({ left: 8 })
.borderRadius(16)
.backgroundColor(NoteUtil.getNoteBgColor(AppStorage.Get('AllFolderArray'), this.selectedNoteData.folder_uuid, SysDefFolderUuid.AllNotes, false))
.bindMenu(this.MenuBuilder)
}.alignItems(VerticalAlign.Top).height(40).width(StyleConstants.PERCENTAGE_100)
}
.width(StyleConstants.PERCENTAGE_100)
.height(80)
}
}
@Component
export struct ToolBarComp {
@Consume('SelectedNoteData') selectedNoteData: NoteData;
@Consume('RefreshFlag') refreshFlag: number
@Consume('SectionStatus') sectionStatus: number
@Consume('LastSectionStatus') lastSectionStatus: number
@Consume('SelectedFolderData') selectedFolderData: FolderData
@Consume('ChooseNote') chooseNote: boolean
@Consume('PortraitModel') portraitModel: boolean
@StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray')
@Consume('EditModel') editModel:boolean
controllerShow: WebController
private context = getContext(this)
//private lastSectionStatus: number
noteDataDeleteDialogCtl: CustomDialogController = new CustomDialogController({
builder: DeleteDialog({ onConfirm: this.onDeleteConfirm.bind(this) }),
alignment: DialogAlignment.Center,
autoCancel: false,
customStyle: true,
})
noteDataDeleteDialogCtlBottom: CustomDialogController = new CustomDialogController({
builder: DeleteDialog({ onConfirm: this.onDeleteConfirm.bind(this) }),
alignment: DialogAlignment.Bottom,
autoCancel: false,
customStyle: true,
})
onDeleteConfirm() {
if (this.selectedFolderData.uuid != SysDefFolderUuid.RecentDeletes) {
this.selectedNoteData.is_deleted = Delete.Yes
this.selectedNoteData.deleted_time = new Date().getTime()
// update note to db
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid)
RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null)
} else {
NoteUtil.removeNoteData(this.AllNoteArray, this.selectedNoteData.uuid)
// delete note from db
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid)
RdbStoreUtil.delete(predicates_note, null)
}
this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0)
this.selectedNoteData = NoteUtil.getFirstNoteData(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid)
this.controllerShow.runJavaScript({script:"RE.setHtml('" + this.selectedNoteData.content_text + "')"})
this.chooseNote = false
// 迁移
console.log("ToolBarComp, onDeleteConfirm, set continue note")
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
console.log("ToolBarComp, onDeleteConfirm, continueNote : " + continueNote)
AppStorage.SetOrCreate<string>('ContinueNote', continueNote)
console.log("ToolBarComp, onDeleteConfirm, set continue note success")
}
editContentDialogCtl: CustomDialogController = new CustomDialogController({
builder: EditContentDialog({ confirm: this.confirm.bind(this), dialogType: 0 }),
alignment: DialogAlignment.Bottom,
autoCancel: true,
customStyle: true,
})
confirm(excuteJs: string) {
prompt.showToast({ message: excuteJs, duration: 2000 })
this.controllerShow.runJavaScript({script:excuteJs})
}
build() {
Flex({ direction: FlexDirection.Row, wrap: FlexWrap.NoWrap,
justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
if (this.portraitModel == true) {
Image($r('app.media.back')).height(24).width(24)
.onClick(() => {
this.chooseNote = false
})
} else {
Image($r('app.media.zoom')).height(24).width(24)
.onClick(() => {
if (this.sectionStatus != 1) {
this.lastSectionStatus = this.sectionStatus
this.sectionStatus = 1
this.controllerShow.runJavaScript({script:"RE.setInputEnabled(true)"})
} else {
if (this.lastSectionStatus != undefined) {
this.sectionStatus = this.lastSectionStatus
// 切换为小屏预览模式
this.controllerShow.runJavaScript({script:"RE.setInputEnabled(false)"})
// 退出全屏时存库
LogUtil.info(TAG, "close note"+ this.selectedNoteData.uuid)
this.controllerShow.runJavaScript({script:"get_html_content()"})
} else {
this.sectionStatus = 3
}
}
this.editModel = !this.editModel
// 迁移
console.log("ToolBarComp, set continue section")
AppStorage.SetOrCreate<number>('ContinueSection', this.sectionStatus)
console.log("ToolBarComp, set continue section success")
})
.visibility(this.selectedNoteData.is_deleted == Delete.Yes ? Visibility.None : Visibility.Visible)
}
if (this.selectedNoteData.is_deleted == Delete.Yes) {
Row({ space: StyleConstants.SPACE_24 }) {
Image($r('app.media.delete')).height(24).width(24)
.onClick(() => {
this.noteDataDeleteDialogCtl.open()
})
Image($r('app.media.recover')).height(24).width(24)
.onClick(() => {
this.selectedNoteData.is_deleted = Delete.No
this.selectedNoteData.deleted_time = 0
prompt.showToast({ message: "已恢复", duration: 2000 })
this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0)
this.chooseNote = false
// update note to db
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid)
RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null)
this.selectedNoteData = NoteUtil.getFirstNoteData(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid)
this.controllerShow.runJavaScript({script:"RE.setHtml('" + this.selectedNoteData.content_text + "')"})
})
}.width(72)
.visibility(this.portraitModel ? Visibility.None : Visibility.Visible)
} else if(this.portraitModel == true && this.editModel == true) {
Row({ space: StyleConstants.SPACE_24 }) {
Image($r('app.media.undo')).height(24).width(24)
.onClick(() => {
this.controllerShow.runJavaScript({script:"javascript:RE.undo()"})
})
Image($r('app.media.todo')).height(24).width(24)
.onClick(() => {
this.controllerShow.runJavaScript({script:"javascript:RE.redo()"})
})
Image($r('app.media.tick_thin')).height(24).width(24)
.onClick(() => {
// 保存笔记信息到数据库
this.controllerShow.runJavaScript({script:"get_html_content()"})
})
}.width(120)
} else if(this.editModel == true) {
Row({ space: StyleConstants.SPACE_24 }) {
Image($r('app.media.circle_tick1')).height(24).width(24)
.onClick(() => {
// 清单
this.controllerShow.runJavaScript({script:"javascript:RE.setTodo()"})
})
Image($r('app.media.styles')).height(24).width(24)
.onClick(() => {
if(this.portraitModel) {
this.editContentDialogCtl.open()
}else{
this.editContentDialogCtl.open()
}
})
Image($r('app.media.picture_white')).height(24).width(24)
.onClick(() => {
console.info('test select single select!')
this.controllerShow.runJavaScript({script:"javascript:RE.insertImage()"})
})
Image($r('app.media.tick_thick')).height(24).width(24)
.onClick(() => {
// 保存笔记信息到数据库
this.controllerShow.runJavaScript({script:"get_html_content()"})
})
Image($r('app.media.undo')).height(24).width(24)
.onClick(() => {
this.controllerShow.runJavaScript({script:"RE.undo()"})
})
Image($r('app.media.todo')).height(24).width(24)
.onClick(() => {
this.controllerShow.runJavaScript({script:"RE.redo()"})
})
}.width(268)
} else {
Row({ space: StyleConstants.SPACE_24 }) {
Image(this.selectedNoteData.is_favorite == Favorite.Yes ? $r('app.media.favorite') : $r('app.media.favorite_cancel'))
.height(24).width(24)
.onClick(() => {
this.selectedNoteData.is_favorite = (this.selectedNoteData.is_favorite == Favorite.Yes ? Favorite.No : Favorite.Yes)
this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0)
// update note to db
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.selectedFolderData.uuid === SysDefFolderUuid.MyFavorites) {
this.selectedNoteData = NoteUtil.getFirstNoteData(AppStorage.Get('AllNoteArray'), SysDefFolderUuid.MyFavorites)
// 迁移
console.log("ToolBarComp, set continue note")
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
console.log("ToolBarComp, continueNote : " + continueNote)
AppStorage.SetOrCreate<string>('ContinueNote', continueNote)
console.log("ToolBarComp, set continue note success")
}
})
Image($r('app.media.delete')).height(24).width(24)
.onClick(() => {
if (this.portraitModel) {
this.noteDataDeleteDialogCtlBottom.open()
} else {
this.noteDataDeleteDialogCtl.open()
}
})
}.width(72)
}
}
.width(StyleConstants.PERCENTAGE_100)
.height(80)
}
}
@Component
export struct DeleteNoteComp {
@StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = []
@StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray')
@Consume('SelectedFolderData') selectedFolderData: FolderData
@Consume('RefreshFlag') refreshFlag: number
@Consume('SelectedNoteData') selectedNoteData: NoteData;
@Consume('PortraitModel') portraitModel: boolean
@Consume('ChooseNote') chooseNote: boolean
noteDataDeleteDialogCtlBottom: CustomDialogController = new CustomDialogController({
builder: DeleteDialog({ onConfirm: this.onDeleteConfirm.bind(this), multiSelect: true }),
alignment: DialogAlignment.Bottom,
autoCancel: false,
customStyle: true,
})
onDeleteConfirm() {
if (this.selectedFolderData.uuid != SysDefFolderUuid.RecentDeletes) {
this.selectedNoteData.is_deleted = Delete.Yes
this.selectedNoteData.deleted_time = new Date().getTime()
// update note to db
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid)
RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null)
} else {
NoteUtil.removeNoteData(this.AllNoteArray, this.selectedNoteData.uuid)
// delete note from db
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid)
RdbStoreUtil.delete(predicates_note, null)
}
this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0)
this.selectedNoteData = NoteUtil.getFirstNoteData(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid)
this.chooseNote = false
// 迁移
console.log("DeleteNoteComp, onDeleteConfirm, set continue note")
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
console.log("DeleteNoteComp, onDeleteConfirm, continueNote : " + continueNote)
AppStorage.SetOrCreate<string>('ContinueNote', continueNote)
console.log("DeleteNoteComp, onDeleteConfirm, set continue note success")
}
build() {
Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap, justifyContent: FlexAlign.SpaceBetween }) {
Column() {
Image($r('app.media.delete'))
.width(24)
.height(24)
.onClick(() => {
this.noteDataDeleteDialogCtlBottom.open()
})
Text($r("app.string.delete"))
.fontSize(10).fontColor('#182431')
.padding({ top: 5 })
}
.alignItems(HorizontalAlign.Center)
Column() {
Image($r('app.media.recover'))
.width(24)
.height(24)
.onClick(() => {
this.selectedNoteData.is_deleted = Delete.No
this.selectedNoteData.deleted_time = 0
prompt.showToast({ message: "已恢复", duration: 2000 })
this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0)
this.chooseNote = false
// update note to db
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid)
RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null)
})
Text($r("app.string.recover"))
.fontSize(10).fontColor('#182431')
.padding({ top: 5 })
}
.alignItems(HorizontalAlign.Center)
}
.width(360)
.height(56)
.visibility(this.selectedNoteData.is_deleted == Delete.Yes && this.portraitModel == true ?
Visibility.Visible : Visibility.None)
}
}
@Component
struct NoteDataMoveItemComp {
@StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = []
@StorageLink('AllFolderArray') AllFolderArray: FolderData[] = []
private folderItem: FolderData
build() {
Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap,justifyContent: FlexAlign.Center }) {
Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap }) {
Image(FolderUtil.getFolderIcon(this.folderItem.uuid))
.objectFit(ImageFit.ScaleDown)
.width(24)
.height(24)
.fillColor(FolderUtil.getFolderIconColor(this.AllFolderArray, this.folderItem.uuid, false))
}
.width(24)
Column() {
Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceBetween }) {
Text(FolderUtil.getFolderText(this.folderItem))
.fontSize(16)
.fontColor(FolderUtil.getFolderIconColor(this.AllFolderArray, this.folderItem.uuid, false))
.textAlign(TextAlign.Center)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.flexShrink(1)
}
.width('100%')
.height(55)
Divider().color($r("app.color.divider_color_e4e4e4")).strokeWidth(1)
}
.padding({ left: 16 })
}
.width('100%')
.height(56)
.visibility(FolderUtil.isFolderMoveIn(this.folderItem) ? Visibility.Visible : Visibility.None)
}
}

View File

@ -0,0 +1,730 @@
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import DateUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/DateUtil.ets'
import FolderData from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/FolderData.ets'
import NoteData from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/NoteData.ets'
import {TableName, NoteTableColumn, SysDefFolderUuid, Favorite, Delete, Top, NoteType
} from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/EnumData.ets'
import {NoteDataMoveDialog, DeleteDialog} from './CusDialogComp.ets'
import RdbStoreUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/RdbStoreUtil.ets'
import prompt from '@system.prompt'
import NoteUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/NoteUtil.ets'
import FolderUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/FolderUtil.ets'
import StyleConstants from '../../../../../../common/utils/src/main/ets/default/constants/StyleConstants.ets'
import SearchModel from '../../../../../../common/utils/src/main/ets/default/model/searchModel/SearchModel.ets'
import LogUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/LogUtil.ets'
const TAG = "NoteListComp"
// Note list component
@Component
export struct NoteListComp {
@StorageLink('AllFolderArray') AllFolderArray: FolderData[] = AppStorage.Link('AllFolderArray')
@Consume('SelectedFolderData') selectedFolderData: FolderData
@Consume('Search') search: boolean
controllerShow: WebController
build() {
Stack({ alignContent: Alignment.Bottom }) {
Flex({ direction: FlexDirection.Column }) {
NoteOverViewComp({controllerShow: this.controllerShow})
NoteItemListComp({controllerShow: this.controllerShow})
}
.padding({ top: this.search ? 15 : 0 })
.width('100%')
.height('100%')
OperateNoteCompForPortrait()
}
.height('100%')
.width('100%')
}
}
@Component
struct NoteOverViewComp {
@StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray')
@StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = []
@Consume('SelectedFolderData') selectedFolderData: FolderData
@Consume('RefreshFlag') refreshFlag: number
@Consume('SectionStatus') sectionStatus: number
@Consume("Longpress") longpress: boolean
@Consume('ExpandStatus') expandStatus: boolean
@Consume('Search') search: boolean
controllerShow: WebController
build() {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) {
Image($r("app.media.suojin_back"))
.height(24)
.width(24)
.margin({ right: this.sectionStatus != 3 ? 24 : 0 }) // 两分栏时缩进图片与右边有个24的间距
.visibility(this.sectionStatus != 3 ? Visibility.Visible : Visibility.None)
.onClick(() => {
if (this.sectionStatus == 1) {
this.expandStatus = !this.expandStatus
} else {
this.sectionStatus = (this.sectionStatus == 3 ? 2 : 3)
// 迁移
console.log("NoteOverViewComp, set continue section")
AppStorage.SetOrCreate<number>('ContinueSection', this.sectionStatus)
console.log("NoteOverViewComp, set continue section success")
}
})
Flex({
direction: FlexDirection.Column,
wrap: FlexWrap.Wrap,
justifyContent: FlexAlign.Center,
alignItems: ItemAlign.Start
}) {
Text(FolderUtil.getFolderText(this.selectedFolderData))
.fontSize(30).fontColor('#182431')
Row() {
Text(FolderUtil.getNoteCount(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid).toString())
.fontSize(14).fontColor('#182431')
Text($r("app.string.noteslist"))
.fontSize(14).fontColor('#182431')
}
.visibility((FolderUtil.getNoteCount(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid) == 0) ? Visibility.None : Visibility.Visible)
}.visibility(this.longpress ? Visibility.None : Visibility.Visible)
Row() {
Image($r("app.media.cross"))
.height(24)
.width(24)
.onClick(() => {
this.longpress = false
this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0)
NoteUtil.unsetAllNotesChecked(this.CheckedNoteArray)
})
Text(this.CheckedNoteArray.length == 0 ? $r("app.string.none_selected") : $r("app.string.selected", this.CheckedNoteArray.length))
.fontSize(20).fontColor('#182431').margin({ left: 16 })
}.alignItems(VerticalAlign.Center).visibility(this.longpress ? Visibility.Visible : Visibility.None)
}.padding({ top: 8, bottom: 8 }).height('100%')
AddNoteComp({controllerShow: this.controllerShow})
OperateNoteComp({controllerShow: this.controllerShow})
Text(this.refreshFlag.toString()).visibility(Visibility.None)
}
.width('100%').height(82)
.padding({ left: this.sectionStatus == 2 ? 24 : 36, right: 24 }) // 两分栏时缩进图标与左侧不需要间距
.visibility(this.search ? Visibility.None : Visibility.Visible)
}
}
@Component
export struct NoteItemComp {
public noteItem: NoteData
public spans: any[]
controllerShow: WebController
@Consume('SelectedFolderData') selectedFolderData: FolderData
@Consume('SelectedNoteData') selectedNoteData: NoteData;
@StorageLink('AllFolderArray') AllFolderArray: FolderData[] = AppStorage.Link('AllFolderArray')
@StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = []
@Consume('Longpress') longpress: boolean
@Consume('ChooseNote') chooseNote: boolean
@Consume('RefreshFlag') refreshFlag: number
@Consume('Search') search: boolean
@Consume('selectedAll') selectedAll: boolean
build() {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) {
Text(this.refreshFlag.toString()).visibility(Visibility.None) // 用于强制刷新使用
Column({ space: 2 }) {
Row({ space: 8 }) {
Image($r("app.media.verticalBar"))
.height(16).width(4)
.fillColor(NoteUtil.getVerticalBarBgColor(AppStorage.Get('AllFolderArray'), this.noteItem.folder_uuid))
Text() {
ForEach(this.spans.map((item1, index1) => {
return { index: index1, data: item1 };
}), item => {
if (item.data.type == 0) {
Span(item.data.text).fontColor('#182431').fontSize(16)
} else if (item.data.type == 1) {
Span(item.data.text).fontColor(Color.Blue).fontSize(16)
}
},
item => item.index)
}
}
Row({ space: 4 }) {
Text(DateUtil.formateDateForNoteTitle(new Date(this.noteItem.modified_time)))
.fontSize(14)
.fontColor('#182431')
Image($r("app.media.favorite")).height(16).width(16)
.visibility(this.noteItem.is_favorite == Favorite.Yes ? Visibility.Visible : Visibility.None)
Image($r("app.media.topped")).height(16).width(16)
.visibility(this.noteItem.is_top == Top.Yes ? Visibility.Visible : Visibility.None)
}
.padding({ left: 12 })
}.alignItems(HorizontalAlign.Start)
}.width(240)
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Image(this.noteItem.content_img)
.height(48)
.width(48)
.borderRadius(12)
.border({ width: 0.5, color: '#19182431' })
Stack({ alignContent: Alignment.Center }) {
Image($r("app.media.unChecked")).height(24).width(24)
Image($r("app.media.checked")).width(24).height(24)
.visibility(NoteUtil.isNoteChecked(this.CheckedNoteArray, this.noteItem) ? Visibility.Visible : Visibility.None)
}.width(24).height(24).visibility(this.longpress ? Visibility.Visible : Visibility.None)
}.height(48).width(this.longpress ? 80 : 48)
}
.width('100%')
.height(72)
.padding({ left: 16, right: 12, top: 4, bottom: 4 })
.borderRadius(24)
.linearGradient({
direction: GradientDirection.Right,
colors: this.selectedNoteData.uuid == this.noteItem.uuid ? [[0xffcdae, 0.0], [0xFfece2, 1.0]] : [[0xffffff, 0.0], [0xffffff, 1.0]]
})
.onClick(() => {
if (this.search) {
this.search = false
return
}
if (this.longpress) {
if (NoteUtil.isNoteChecked(this.CheckedNoteArray, this.noteItem)) {
NoteUtil.unsetNoteChecked(this.CheckedNoteArray, this.noteItem)
this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0)
} else {
NoteUtil.setNoteChecked(this.CheckedNoteArray, this.noteItem)
this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0)
}
} else {
this.selectedNoteData = this.noteItem
this.chooseNote = true
// 迁移
console.log("NoteItemComp, set continue note")
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
console.log("NoteItemComp, continueNote : " + continueNote)
AppStorage.SetOrCreate<string>('ContinueNote', continueNote)
console.log("NoteItemComp, set continue note success")
}
this.controllerShow.runJavaScript({script:"RE.setHtml('" + this.selectedNoteData.content_text + "')"})
this.controllerShow.runJavaScript({script:"RE.updateRichTextState()"})
this.selectedAll = this.CheckedNoteArray.length ==
NoteUtil.getNoteDataArray(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid).length
this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0)
})
.gesture(
GestureGroup(GestureMode.Exclusive,
// 长按:对笔记列表进行操作
LongPressGesture()
.onAction(() => {
if (this.longpress == false) {
this.longpress = true
NoteUtil.setNoteChecked(this.CheckedNoteArray, this.noteItem)
}
})
)
)
}
}
@Component
export struct NoteItemListComp {
@StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray')
@Consume('SelectedFolderData') selectedFolderData: FolderData
@Consume('RefreshFlag') refreshFlag: number
@Consume('Longpress') longpress: boolean
@Consume('Search') search: boolean
@Consume @Watch('doSearch') inputKeyword: string
@Consume('SearchResultList') searchResultList: NoteData[]
@Consume('SelectedNoteData') selectedNoteData: NoteData;
controllerShow: WebController
doSearch() {
SearchModel.search(NoteUtil.getNoteDataArray(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid), this.inputKeyword)
.then((result: NoteData[]) => {
LogUtil.info(TAG, "result size " + result.length.toString())
this.searchResultList = result
if (this.searchResultList.length != 0) {
this.selectedNoteData = this.searchResultList[0]
} else {
this.selectedNoteData = NoteUtil.getFirstNoteData(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid)
}
// 迁移
console.log("doSearch, set continue note")
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
console.log("doSearch, continueNote : " + continueNote)
AppStorage.SetOrCreate<string>('ContinueNote', continueNote)
console.log("doSearch, set continue note success")
this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0)
})
}
build() {
Column() {
Text(this.refreshFlag.toString()).visibility(Visibility.None)
Flex() {
SearchComp()
}.margin({ left: 24, right: 24, bottom: 12 })
.visibility((FolderUtil.getNoteCount(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid) == 0) ? Visibility.None : Visibility.Visible)
Flex({ justifyContent: FlexAlign.Center }) {
Text($r("app.string.permanently_delete_tips")).fontSize(12).fontColor('#18181A')
}
.margin({ bottom: this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes ? 12 : 0 })
.width('100%')
.visibility(this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes ? Visibility.Visible : Visibility.None)
Column() {
List({ initialIndex: 0 }) {
ListItem() {
Column({ space: 8 }) {
Image($r('app.media.emptyPage')).width(120).height(120)
Text($r("app.string.Empty_page")).fontSize(12).fontColor('#A3A7AD')
}
}
.width('100%').height('100%').padding({ bottom: 120 })
.visibility((FolderUtil.getNoteCount(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid) == 0) ? Visibility.Visible : Visibility.None)
ForEach(this.inputKeyword.length == 0 ?
NoteUtil.getNoteDataArray(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid) : this.searchResultList, (noteItem) => {
ListItem() {
NoteItemComp({
noteItem: noteItem,
spans: SearchModel.splitToHighlightText(noteItem.title, this.inputKeyword),
controllerShow: this.controllerShow
})
}.margin({ left: 24, right: 24, bottom: 12 })
}, noteItem => noteItem.uuid.toString())
}.listDirection(Axis.Vertical)
.edgeEffect(EdgeEffect.Spring)
}
.backgroundColor(this.search && this.inputKeyword.length == 0 ? $r("app.color.notecontent_color_000000") : $r("app.color.notelist_bgcolor_f1f3f5"))
.opacity(this.search && this.inputKeyword.length == 0 ? StyleConstants.OPACITY_10 : StyleConstants.OPACITY_100)
.height('100%')
}
.height('80%')
.padding({bottom: 1 })
.onClick(() => {
this.search = false
})
}
}
@Component
export struct OperateNoteComp {
@Consume('Longpress') longpress: boolean
@StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = []
@StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray')
@Consume('SelectedFolderData') selectedFolderData: FolderData
@Consume('RefreshFlag') refreshFlag: number
@Consume('SelectedNoteData') selectedNoteData: NoteData;
@Consume('PortraitModel') portraitModel: boolean
@Consume('selectedAll') selectedAll: boolean
controllerShow: WebController
noteDataMoveDialogCtl: CustomDialogController = new CustomDialogController({
builder: NoteDataMoveDialog({ onConfirm: this.onMoveConfirm.bind(this) }),
alignment: DialogAlignment.Center,
autoCancel: false,
customStyle: true,
})
onMoveConfirm(folderUuid: string) {
this.CheckedNoteArray.forEach((noteItem) => {
noteItem.folder_uuid = folderUuid
// update note to db
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
predicates_note.equalTo(NoteTableColumn.Uuid, noteItem.uuid)
RdbStoreUtil.update(noteItem.toNoteObject(), predicates_note, null)
})
this.longpress = false
NoteUtil.unsetAllNotesChecked(this.CheckedNoteArray)
}
noteDataDeleteDialogCtl: CustomDialogController = new CustomDialogController({
builder: DeleteDialog({ onConfirm: this.onDeleteConfirm.bind(this), multiSelect: true }),
alignment: DialogAlignment.Center,
autoCancel: false,
customStyle: true,
})
onDeleteConfirm() {
if (this.selectedFolderData.uuid != SysDefFolderUuid.RecentDeletes) {
this.CheckedNoteArray.forEach((noteItem: NoteData) => {
noteItem.is_deleted = Delete.Yes
noteItem.deleted_time = new Date().getTime()
// update note to db
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
predicates_note.equalTo(NoteTableColumn.Uuid, noteItem.uuid)
RdbStoreUtil.update(noteItem.toNoteObject(), predicates_note, null)
})
} else {
this.CheckedNoteArray.forEach((noteItem: NoteData) => {
NoteUtil.removeNoteData(this.AllNoteArray, noteItem.uuid)
// delete note from db
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
predicates_note.equalTo(NoteTableColumn.Uuid, noteItem.uuid)
RdbStoreUtil.delete(predicates_note, null)
})
}
NoteUtil.unsetAllNotesChecked(this.CheckedNoteArray)
this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0)
this.longpress = false
this.selectedNoteData = NoteUtil.getFirstNoteData(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid)
this.controllerShow.runJavaScript({script:"RE.setHtml('" + this.selectedNoteData.content_text + "')"})
// 迁移
console.log("OperateNoteComp, set continue note")
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
console.log("OperateNoteComp, continueNote : " + continueNote)
AppStorage.SetOrCreate<string>('ContinueNote', continueNote)
console.log("OperateNoteComp, set continue note success")
}
build() {
Row() {
Image($r('app.media.set_top'))
.width(24)
.height(24)
.opacity(this.CheckedNoteArray.length == 0 ? 0.4 : 1)
.enabled(this.CheckedNoteArray.length == 0 ? false : true)
.margin({ right: this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes ? 0 : 24 })
.visibility(this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes ? Visibility.None : Visibility.Visible)
.onClick(() => {
this.CheckedNoteArray.forEach((noteItem) => {
noteItem.is_top = (noteItem.is_top == Top.Yes) ? Top.No : Top.Yes
// update note to db
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
predicates_note.equalTo(NoteTableColumn.Uuid, noteItem.uuid)
RdbStoreUtil.update(noteItem.toNoteObject(), predicates_note, null)
})
this.longpress = false
NoteUtil.unsetAllNotesChecked(this.CheckedNoteArray)
})
Image($r('app.media.move'))
.width(24)
.height(24)
.opacity(this.CheckedNoteArray.length == 0 ? 0.4 : 1)
.enabled(this.CheckedNoteArray.length == 0 ? false : true)
.margin({ right: this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes ? 0 : 24 })
.visibility(this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes ? Visibility.None : Visibility.Visible)
.onClick(() => {
this.noteDataMoveDialogCtl.open()
})
Image($r('app.media.delete'))
.width(24)
.height(24)
.margin({ right: 24 })
.opacity(this.CheckedNoteArray.length == 0 ? 0.4 : 1)
.enabled(this.CheckedNoteArray.length == 0 ? false : true)
.onClick(() => {
this.noteDataDeleteDialogCtl.open()
})
Image($r('app.media.recover'))
.width(24)
.height(24)
.opacity(this.CheckedNoteArray.length == 0 ? 0.4 : 1)
.enabled(this.CheckedNoteArray.length == 0 ? false : true)
.margin({ right: this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes ? 24 : 0 })
.visibility(this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes ? Visibility.Visible : Visibility.None)
.onClick(() => {
this.CheckedNoteArray.forEach((noteItem) => {
noteItem.is_deleted = Delete.No
noteItem.deleted_time = 0
prompt.showToast({ message: "已恢复", duration: 2000 })
// update note to db
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
predicates_note.equalTo(NoteTableColumn.Uuid, noteItem.uuid)
RdbStoreUtil.update(noteItem.toNoteObject(), predicates_note, null)
})
this.longpress = false
NoteUtil.unsetAllNotesChecked(this.CheckedNoteArray)
})
Image(this.selectedAll ? $r('app.media.check_all1') : $r('app.media.check_all'))
.width(24)
.height(24)
.onClick(() => {
if (this.CheckedNoteArray.length <
NoteUtil.getNoteDataArray(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid)
.length) {
NoteUtil.setAllNotesChecked(this.CheckedNoteArray, NoteUtil.getNoteDataArray(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid))
} else {
NoteUtil.unsetAllNotesChecked(this.CheckedNoteArray)
}
this.selectedAll = !this.selectedAll
this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0)
})
}
.width(this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes ? 120 : 168)
.visibility(this.longpress && this.portraitModel == false ? Visibility.Visible : Visibility.None)
}
}
@Component
export struct AddNoteComp {
@StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray')
@Consume('Longpress') longpress: boolean
@Consume('SelectedFolderData') selectedFolderData: FolderData
@Consume('SelectedNoteData') selectedNoteData: NoteData;
@Consume('SectionStatus') sectionStatus: number
@Consume('LastSectionStatus') lastSectionStatus: number
@Consume('EditModel') editModel:boolean
controllerShow: WebController
build() {
Image($r('app.media.addNote'))
.width(24).height(24).margin({ right: 12 })
.onClick(() => {
let noteData = new NoteData(0,"标题",new Date().getTime() + "",SysDefFolderUuid.UnClassified,"","",NoteType.SysDef,Top.No,Favorite.No,Delete.No,new Date().getTime(),new Date().getTime(),0)
this.AllNoteArray.push(noteData)
RdbStoreUtil.insert(TableName.NoteTable, noteData.toNoteObject(), null)
LogUtil.info(TAG, 'insert new note is:' + noteData.uuid)
this.selectedNoteData = noteData
if (this.sectionStatus != 1) {
this.lastSectionStatus = this.sectionStatus
this.sectionStatus = 1
this.controllerShow.runJavaScript({script:"RE.setInputEnabled(true)"})
} else {
this.sectionStatus = this.lastSectionStatus
}
this.controllerShow.runJavaScript({script:"RE.setHtml('" + this.selectedNoteData.content_text + "')"})
this.editModel = true
})
.visibility(this.longpress || this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes ? Visibility.None : Visibility.Visible)
}
}
@Component
export struct SearchComp {
@Consume('Search') search: boolean
@Consume('InputKeyword') inputKeyword: string
build() {
Row() {
Image($r('app.media.back'))
.width(24)
.height(24)
.margin({ right: this.search ? 16 : 0 })
.visibility(this.search ? Visibility.Visible : Visibility.None)
.onClick(() => {
this.search = false
})
Flex({ justifyContent: FlexAlign.Start }) {
Image($r('app.media.search')).width(18).height(18)
TextInput({ text: this.inputKeyword, placeholder: $r('app.string.searchNote') })
.backgroundColor($r("app.color.color_ffffff"))
.onChange((value: string) => {
LogUtil.info(TAG, "Search value: " + value)
this.inputKeyword = value
})
.onClick(() => {
this.search = true
})
}
.width(this.search ? 344 : 384)
.height(52)
.padding({ left: 12, right: 12, top: 6, bottom: 6 })
.borderRadius(20)
.backgroundColor($r("app.color.color_ffffff"))
}
}
}
@Component
export struct OperateNoteCompForPortrait {
@Consume('Longpress') longpress: boolean
@StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = []
@StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray')
@Consume('SelectedFolderData') selectedFolderData: FolderData
@Consume('RefreshFlag') refreshFlag: number
@Consume('SelectedNoteData') selectedNoteData: NoteData;
@Consume('PortraitModel') portraitModel: boolean
noteDataMoveDialogCtlBottom: CustomDialogController = new CustomDialogController({
builder: NoteDataMoveDialog({ onConfirm: this.onMoveConfirm.bind(this) }),
alignment: DialogAlignment.Bottom,
autoCancel: false,
customStyle: true,
})
onMoveConfirm(folderUuid: string) {
this.CheckedNoteArray.forEach((noteItem) => {
noteItem.folder_uuid = folderUuid
// update note to db
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
predicates_note.equalTo(NoteTableColumn.Uuid, noteItem.uuid)
RdbStoreUtil.update(noteItem.toNoteObject(), predicates_note, null)
})
this.longpress = false
NoteUtil.unsetAllNotesChecked(this.CheckedNoteArray)
}
noteDataDeleteDialogCtlBottom: CustomDialogController = new CustomDialogController({
builder: DeleteDialog({ onConfirm: this.onDeleteConfirm.bind(this), multiSelect: true }),
alignment: DialogAlignment.Bottom,
autoCancel: false,
customStyle: true,
})
onDeleteConfirm() {
if (this.selectedFolderData.uuid != SysDefFolderUuid.RecentDeletes) {
this.CheckedNoteArray.forEach((noteItem: NoteData) => {
noteItem.is_deleted = Delete.Yes
noteItem.deleted_time = new Date().getTime()
// update note to db
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
predicates_note.equalTo(NoteTableColumn.Uuid, noteItem.uuid)
RdbStoreUtil.update(noteItem.toNoteObject(), predicates_note, null)
})
} else {
this.CheckedNoteArray.forEach((noteItem: NoteData) => {
NoteUtil.removeNoteData(this.AllNoteArray, noteItem.uuid)
// delete note from db
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
predicates_note.equalTo(NoteTableColumn.Uuid, noteItem.uuid)
RdbStoreUtil.delete(predicates_note, null)
})
}
NoteUtil.unsetAllNotesChecked(this.CheckedNoteArray)
this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0)
this.longpress = false
this.selectedNoteData = NoteUtil.getFirstNoteData(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid)
// 迁移
console.log("OperateNoteCompForPortrait, set continue note")
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
console.log("OperateNoteCompForPortrait, continueNote : " + continueNote)
AppStorage.SetOrCreate<string>('ContinueNote', continueNote)
console.log("OperateNoteCompForPortrait, set continue note success")
}
build() {
Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap, justifyContent: FlexAlign.SpaceBetween }) {
if (this.selectedFolderData.uuid != SysDefFolderUuid.RecentDeletes) {
Column() {
Image($r("app.media.set_top"))
.width(24)
.height(24)
.onClick(() => {
this.CheckedNoteArray.forEach((noteItem) => {
noteItem.is_top = (noteItem.is_top == Top.Yes) ? Top.No : Top.Yes
// update note to db
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
predicates_note.equalTo(NoteTableColumn.Uuid, noteItem.uuid)
RdbStoreUtil.update(noteItem.toNoteObject(), predicates_note, null)
})
this.longpress = false
NoteUtil.unsetAllNotesChecked(this.CheckedNoteArray)
})
Text($r("app.string.set_top"))
.fontSize(10).fontColor('#182431')
.padding({ top: 5 })
}
.opacity(this.CheckedNoteArray.length == 0 ? 0.4 : 1)
.enabled(this.CheckedNoteArray.length == 0 ? false : true)
.alignItems(HorizontalAlign.Center)
}
Column() {
Image($r('app.media.delete'))
.width(24)
.height(24)
.onClick(() => {
this.noteDataDeleteDialogCtlBottom.open()
})
Text($r("app.string.delete"))
.fontSize(10).fontColor('#182431')
.padding({ top: 5 })
}
.opacity(this.CheckedNoteArray.length == 0 ? 0.4 : 1)
.enabled(this.CheckedNoteArray.length == 0 ? false : true)
.alignItems(HorizontalAlign.Center)
if (this.selectedFolderData.uuid != SysDefFolderUuid.RecentDeletes) {
Column() {
Image($r('app.media.move'))
.width(24)
.height(24)
.onClick(() => {
this.noteDataMoveDialogCtlBottom.open()
})
Text($r("app.string.move"))
.fontSize(10).fontColor('#182431')
.padding({ top: 5 })
}
.opacity(this.CheckedNoteArray.length == 0 ? 0.4 : 1)
.enabled(this.CheckedNoteArray.length == 0 ? false : true)
.alignItems(HorizontalAlign.Center)
}
if (this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes) {
Column() {
Image($r('app.media.recover'))
.width(24)
.height(24)
.onClick(() => {
this.CheckedNoteArray.forEach((noteItem) => {
noteItem.is_deleted = Delete.No
noteItem.deleted_time = 0
prompt.showToast({ message: "已恢复", duration: 2000 })
// update note to db
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
predicates_note.equalTo(NoteTableColumn.Uuid, noteItem.uuid)
RdbStoreUtil.update(noteItem.toNoteObject(), predicates_note, null)
})
this.longpress = false
NoteUtil.unsetAllNotesChecked(this.CheckedNoteArray)
this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0)
})
Text($r("app.string.recover"))
.fontSize(10).fontColor('#182431')
.padding({ top: 5 })
}
.opacity(this.CheckedNoteArray.length == 0 ? 0.4 : 1)
.enabled(this.CheckedNoteArray.length == 0 ? false : true)
.alignItems(HorizontalAlign.Center)
}
Column() {
Image($r('app.media.check_all'))
.width(24)
.height(24)
.onClick(() => {
if (this.CheckedNoteArray.length <
NoteUtil.getNoteDataArray(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid)
.length) {
NoteUtil.setAllNotesChecked(this.CheckedNoteArray, NoteUtil.getNoteDataArray(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid))
} else {
NoteUtil.unsetAllNotesChecked(this.CheckedNoteArray)
}
this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0)
})
Text($r("app.string.check_all"))
.fontSize(10).fontColor('#182431')
.padding({ top: 5 })
}
.alignItems(HorizontalAlign.Center)
}
.width(360)
.height(56)
.visibility(this.longpress && this.portraitModel == true ? Visibility.Visible : Visibility.None)
}
}

View File

@ -0,0 +1,80 @@
{
"color": [
{
"name": "color_ffffff",
"value": "#ffffff"
},
{
"name": "delete_color_fa2a2d",
"value": "#fa2a2d"
},
{
"name": "cancel_color_4fb4e3",
"value": "#4fb4e3"
},
{
"name": "divider_color_e4e4e4",
"value": "#cce4e4e4"
},
{
"name": "divider_color_182431",
"value": "#182431"
},
{
"name": "button_color_419fff",
"value": "#419fff"
},
{
"name": "button_color_fb4447",
"value": "#fb4447"
},
{
"name": "text_color_3f97e9",
"value": "#3f97e9"
},
{
"name": "text_color_f86d05",
"value": "#f86d05"
},
{
"name": "folder_color_182431",
"value": "#182431"
},
{
"name": "folder_color_f86d05",
"value": "#f86d05"
},
{
"name": "folder_color_ffffff",
"value": "#ffffff"
},
{
"name": "folder_color_19ffffff",
"value": "#19ffffff"
},
{
"name": "folder_color_19182431",
"value": "#19182431"
},
{
"name": "notecontent_color_ffffff",
"value": "#ffffff"
},
{
"name": "notecontent_color_000000",
"value": "#000000"
},
{
"name": "folderlist_bgcolor_f1f3f5",
"value": "#f1f3f5"
},
{
"name": "notelist_bgcolor_f1f3f5",
"value": "#f1f3f5"
},
{
"name": "notelist_bgcolor_000000",
"value": "#000000"
}
]
}

View File

@ -0,0 +1,136 @@
{
"float": [
{
"name": "wh_value_1",
"value": "1"
},
{
"name": "wh_value_4",
"value": "4"
},
{
"name": "wh_value_5",
"value": "5"
},
{
"name": "wh_value_8",
"value": "8"
},
{
"name": "wh_value_10",
"value": "10"
},
{
"name": "wh_value_14",
"value": "14"
},
{
"name": "wh_value_16",
"value": "16"
},
{
"name": "wh_value_20",
"value": "20"
},
{
"name": "wh_value_24",
"value": "24"
},
{
"name": "wh_value_30",
"value": "30"
},
{
"name": "wh_value_40",
"value": "40"
},
{
"name": "wh_value_50",
"value": "50"
},
{
"name": "wh_value_60",
"value": "60"
},
{
"name": "wh_value_65",
"value": "65"
},
{
"name": "wh_value_70",
"value": "70"
},
{
"name": "wh_value_80",
"value": "80"
},
{
"name": "wh_value_100",
"value": "100"
},
{
"name": "wh_value_120",
"value": "120"
},
{
"name": "wh_value_130",
"value": "1300"
},
{
"name": "wh_value_160",
"value": "160"
},
{
"name": "wh_value_230",
"value": "230"
},
{
"name": "wh_value_280",
"value": "280"
},
{
"name": "wh_value_390",
"value": "390"
},
{
"name": "wh_value_400",
"value": "400"
},
{
"name": "font_35",
"value": "35"
},
{
"name": "font_15",
"value": "15"
},
{
"name": "font_20",
"value": "20"
},
{
"name": "font_25",
"value": "25"
},
{
"name": "font_28",
"value": "28"
},
{
"name": "font_50",
"value": "50"
},
{
"name": "control_common_font_size",
"value": "20"
},
{
"name": "slider_text_padding_left",
"value": "5"
},
{
"name": "volume_border_radius",
"value": "15"
}
]
}

View File

@ -0,0 +1,140 @@
{
"string": [
{
"name": "entry_MainAbility",
"value": "备忘录"
},
{
"name": "description_mainability",
"value": "ETS_Empty Ability"
},
{
"name": "note",
"value": "笔记"
},
{
"name": "allNotes",
"value": "全部笔记"
},
{
"name": "unClassified",
"value": "未分类"
},
{
"name": "recentDeletes",
"value": "最近删除"
},
{
"name": "myFavorites",
"value": "我的收藏"
},
{
"name": "create",
"value": "新建"
},
{
"name": "createFolder",
"value": "新建文件夹"
},
{
"name": "editFolder",
"value": "编辑文件夹"
},
{
"name": "deleteFolder",
"value": "删除文件夹"
},
{
"name": "createNote",
"value": "新建笔记"
},
{
"name": "cancel",
"value": "取消"
},
{
"name": "save",
"value": "保存"
},
{
"name": "delete",
"value": "删除"
},
{
"name": "name",
"value": "名称"
},
{
"name": "delete_tips",
"value": "是否删除此文件夹及其中的内容?"
},
{
"name": "deleteNote",
"value": "是否删除此笔记?"
},
{
"name": "deleteNoteComplete",
"value": "此笔记将被永久删除,无法恢复。是否删除?"
},
{
"name": "deleteAllNote",
"value": "是否删除全部笔记?"
},
{
"name": "deletePartNote",
"value": "是否删除%d条笔记"
},
{
"name": "selected",
"value": "已选择%d项"
},
{
"name": "none_selected",
"value": "未选择"
},
{
"name": "noteslist",
"value": "条笔记"
},
{
"name": "Empty_page",
"value": "没有笔记"
},
{
"name": "searchNote",
"value": "搜索笔记"
},
{
"name": "chooseFolder",
"value": "请选择文件夹"
},
{
"name": "category_already_exist",
"value": "文件夹名称已存在"
},
{
"name": "input_placeholder",
"value": "名称"
},
{
"name": "permanently_delete_tips",
"value": "笔记删除前会显示剩余天数最长30天之后将永久删除"
},
{
"name": "set_top",
"value": "置顶"
},
{
"name": "move",
"value": "移到"
},
{
"name": "recover",
"value": "恢复"
},
{
"name": "check_all",
"value": "多选"
}
]
}

20
common/utils/build.gradle Normal file
View File

@ -0,0 +1,20 @@
apply plugin: 'com.huawei.ohos.library'
//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510
ohos {
compileSdkVersion 8
defaultConfig {
compatibleSdkVersion 8
}
buildTypes {
release {
proguardOpt {
proguardEnabled false
rulesFiles 'proguard-rules.pro'
}
}
}
}
dependencies {
}

1
common/utils/proguard-rules.pro vendored Normal file
View File

@ -0,0 +1 @@
# config module specific ProGuard rules here.

View File

@ -0,0 +1,22 @@
{
"app": {
"bundleName": "com.ohos.note",
"vendor": "ohos",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {},
"module": {
"package": "com.ohos.note.common",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "utils",
"moduleType": "har"
}
}
}

View File

@ -0,0 +1,122 @@
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import LogUtil from './LogUtil.ets'
import GlobalResourceManager from './GlobalResourceManager.ets'
const TAG = "DateUtil"
/**
* 日期和时间均显示为2位数
* @param time
*/
function getUnifiedTime(time: number): any {
return time > 9 ? time : "0" + time
}
/**
* 日期时间工具类, 中文暂时不写到string.json, $r("")取出来的是Resource, 转化为string困难
*/
export class DateUtil {
/**
* 获取笔记标题的格式化时间
* @param date note modified time
*/
formateDateForNoteTitle(date: Date): string{
let nowDate = new Date()
let diffMin = Math.floor((nowDate.getTime() - date.getTime()) / 1000 / 60)
if (diffMin < 0) {
LogUtil.info("DateUtils, formateDateForNoteTitle : date is error")
return this.formateDateForNoteContent(date)
}
let noteTitletTime = ""
let year = date.getFullYear()
let month = date.getMonth()
let day = date.getDate()
let hours = date.getHours()
let mins = date.getMinutes()
let nowYear = nowDate.getFullYear()
let nowMonth = nowDate.getMonth()
let nowDay = nowDate.getDate()
if (diffMin < 1) {
// 1分钟内, 显示“刚刚”
noteTitletTime = "刚刚"
} else if (diffMin < 60) {
// 1小时内, 显示“X分钟前”
noteTitletTime = diffMin + "分钟前"
} else if (nowYear === year && nowMonth === month && nowDay === day) {
// 今天, 显示“hh:mm”
noteTitletTime = getUnifiedTime(hours) + ":" + getUnifiedTime(mins)
} else if (nowYear === year && nowMonth === month && nowDay === (day + 1)) {
// 昨天, 场景1: 2022年1月1日 - 2022年1月2日, 显示“昨天”
noteTitletTime = "昨天"
} else if (nowYear === year && nowDay === 1) {
// 昨天, 场景2: 2022年1月31日 - 2022年2月1日, 显示“昨天”
let now = new Date()
now.setDate(0) // 设置为上个月的最后一天
noteTitletTime = now.getDate() === day ? "昨天" : ""
} else if (nowYear === year + 1 && nowDay === 1) {
// 昨天, 场景3: 2022年12月31日 - 2023年1月1日, 显示“昨天”
let now = new Date()
now.setMonth(-1) // 设置为去年的最后一个月
noteTitletTime = now.getMonth() === month ? "昨天" : ""
} else if (nowYear === year) {
// 今年, 显示“X月X日”
noteTitletTime = getUnifiedTime(month + 1) + "月" + getUnifiedTime(day) + "日"
} else {
// 不是今年, 显示“X年X月X日”
noteTitletTime = year + "年" + getUnifiedTime(month + 1) + "月" + getUnifiedTime(day) + "日"
}
return noteTitletTime
}
/**
* 获取笔记内容的格式化时间
* @param date note modified time
*/
formateDateForNoteContent(date: Date): string{
// formatted time
let noteContentTime = ""
// note modified time
let year = date.getFullYear()
let month = date.getMonth()
let day = date.getDate()
let hours = date.getHours()
let mins = date.getMinutes()
// now date
let nowDate = new Date()
let nowYear = nowDate.getFullYear()
let nowMonth = nowDate.getMonth()
let nowDay = nowDate.getDate()
if (nowYear === year && nowMonth === month && nowDay === day) {
// 今天, 显示“hh:mm”
noteContentTime = "今天" + " " + getUnifiedTime(hours) + ":" + getUnifiedTime(mins)
} else if (nowYear === year) {
// 今年, 显示“X月X日 hh:mm”
noteContentTime = getUnifiedTime(month + 1) + "月" + getUnifiedTime(day) + "日"
+ " " + getUnifiedTime(hours) + ":" + getUnifiedTime(mins)
} else {
// 不是今年, 显示“X年X月X日 hh:mm”
noteContentTime = year + "年" + getUnifiedTime(month + 1) + "月" + getUnifiedTime(day) + "日"
+ " " + getUnifiedTime(hours) + ":" + getUnifiedTime(mins)
}
return noteContentTime
}
}
let dateUtil = new DateUtil()
export default dateUtil as DateUtil

View File

@ -0,0 +1,63 @@
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import LogUtil from '../../common/baseUtil/LogUtil.ets'
import SysDefData from '../../model/databaseModel/SysDefData.ets'
import FolderData from '../../model/databaseModel/FolderData.ets'
import NoteData from '../../model/databaseModel/NoteData.ets'
const TAG = "FakerRdbStoreUtil"
let folderDataArray = []
let noteDataArray = []
function FakerInitFolder(folderdata: any) {
return new FolderData(0, folderdata.name, folderdata.uuid, folderdata.color, folderdata.folder_type, folderdata.is_deleted,
folderdata.created_time, folderdata.modified_time)
}
function FakerInitFolderArray(folderdataList: any[]) {
folderdataList.forEach((folderData) => {
folderDataArray.push(FakerInitFolder(folderData))
})
}
function FakerInitNote(noteData: any) :NoteData{
return new NoteData(0, noteData.title, noteData.uuid, noteData.folder_uuid, noteData.content_text, noteData.content_img,
noteData.note_type, 0, 0, 0, noteData.created_time, noteData.modified_time, noteData.deleted_time)
}
function FakerInitNoteArray(noteDataList: any[]) {
noteDataList.forEach((noteData) => {
noteDataArray.push(FakerInitNote(noteData))
})
}
export default {
FakerInitAppStorage() {
FakerInitFolderArray([SysDefData.sys_def_allNotes, SysDefData.sys_def_unClassified, SysDefData.sys_def_life,SysDefData.sys_def_recentDeletes, SysDefData.sys_def_myFavorites,
SysDefData.sys_def_personal, SysDefData.sys_def_work])
FakerInitNoteArray([SysDefData.sys_def_note1,SysDefData.sys_def_note2, SysDefData.sys_def_note3, SysDefData.sys_def_note4])
AppStorage.SetOrCreate('AllNoteArray', noteDataArray)
AppStorage.SetOrCreate('AllFolderArray', folderDataArray)
for (let folderData of folderDataArray) {
LogUtil.info(TAG, "folderData : " + JSON.stringify(folderData))
}
for (let noteData of noteDataArray) {
LogUtil.info(TAG, "noteDataArray : " + JSON.stringify(noteData))
}
AppStorage.SetOrCreate('DBQueryFinished', 1)
}
}

View File

@ -0,0 +1,193 @@
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {folderIconMap, folderTextMap} from '../model/NoteBaseData.ets'
import FolderData from '../model/databaseModel/FolderData.ets'
import NoteData from '../model/databaseModel/NoteData.ets'
import {SysDefFolderUuid, FolderType, Favorite, Delete} from '../model/databaseModel/EnumData.ets'
import GlobalResourceManager from './GlobalResourceManager.ets'
import StyleConstants from '../constants/StyleConstants.ets'
import LogUtil from './LogUtil.ets'
const TAG = "FolderUtil"
export class FolderUtil {
/**
* Get Folder Data
*
* @param folderDataArray - Folder data list
* @param folderUuid - fold uuid
* @return FolderData
*/
getFolderData(folderDataArray: FolderData[], folderUuid: string): FolderData {
LogUtil.info(TAG, "get folder uuid " + folderUuid)
let folderData = folderDataArray.find((folder) => {
return folder.uuid == folderUuid
})
if (folderData == undefined) {
LogUtil.info(TAG, "no folder get " + folderUuid)
}
return folderData
}
/**
* Get Folder Icon
*
* @param folderUuid - folder Uuid
* @return Resource - Folder Icon Resource
*/
getFolderIcon(folderUuid: string): Resource {
LogUtil.info(TAG, "folderUuid " + folderUuid)
if (folderIconMap[folderUuid] != undefined) {
return folderIconMap[folderUuid]
}
return $r("app.media.folder")
}
/**
* Get folder Icon color
*
* @param folderDataArray - Folder data list
* @param selectFolderUuid - Selected fold uuid
* @param isSelected - is selected or not
* @return Resource | string - color value
*/
getFolderIconColor(folderDataArray: FolderData[], selectFolderUuid: string, isSelected: boolean): Resource | string {
let folderData: FolderData = this.getFolderData(folderDataArray, selectFolderUuid)
if (folderData == undefined) {
LogUtil.info(TAG, "FolderIconColor is 182431")
return $r("app.color.folder_color_182431")
}
LogUtil.info(TAG, "folderData uuid " + folderData.uuid + " isSelected " + isSelected)
if (folderData.folder_type == FolderType.SysDef || folderData.folder_type == FolderType.FeatureDef) {
return isSelected ? $r("app.color.folder_color_f86d05") : $r("app.color.folder_color_182431")
}
return folderData.color
}
/**
* Get folder Text color
*
* @param isSelected - is selected or not
* @return Resource | string - color value
*/
getFolderTextColor(isSelected: boolean): Resource | string {
LogUtil.info(TAG, "isSelected " + isSelected)
return isSelected ? $r("app.color.folder_color_f86d05") : $r("app.color.folder_color_182431")
}
/**
* Is folder bottom fixed
*
* @param folderData - Folder
* @return boolean - fottom fixed folder: deleted or favorite return true. else return false
*/
isBottomFixedFolder(folderData: FolderData) : boolean {
LogUtil.info(TAG, "folderDataUuid " + folderData.uuid)
return (folderData.folder_type == FolderType.FeatureDef)
}
/**
* Is the folder can be moved into notes
*
* @param folderDataUuid - Folder uuid
* @return boolean - can be moved into notes return true. else return false
*/
isFolderMoveIn(folderData: FolderData) : boolean {
LogUtil.info(TAG, "folderDataUuid " + folderData.uuid)
return (folderData.uuid == SysDefFolderUuid.UnClassified || folderData.folder_type == FolderType.CusDef)
}
/**
* Get folder text
*
* @param folderData
* @return string | Resource - folder text
*/
getFolderText(folderData: FolderData): string | Resource {
LogUtil.info(TAG, "folderData.uuid " + folderData.uuid + " folderData.folder_type " + folderData.folder_type)
return folderData.folder_type == FolderType.CusDef ? folderData.name : folderTextMap[folderData.uuid]
}
/**
* Get Note Count
*
* @param noteDataArray
* @param folderUuid
* @return number - Note Count
*/
getNoteCount(noteDataArray: NoteData[], folderUuid: string): number {
let count = 0;
const folderTextMap = {
"sys_def_allNotes_uuid": (noteData) => {noteData.is_deleted == Delete.No ? ++count : count},
"sys_def_recentDeletes_uuid": (noteData) => {noteData.is_deleted == Delete.Yes ? ++count : count},
"sys_def_myFavorites_uuid": (noteData) => {noteData.is_favorite == Favorite.Yes && noteData.is_deleted == Delete.No ? ++count : count},
"sys_def_other_uuid": (noteData) => {noteData.folder_uuid == folderUuid && noteData.is_deleted == Delete.No ? ++count : count},
}
if (folderUuid == SysDefFolderUuid.AllNotes || folderUuid == SysDefFolderUuid.RecentDeletes || folderUuid == SysDefFolderUuid.MyFavorites) {
noteDataArray.forEach(folderTextMap[folderUuid])
} else {
noteDataArray.forEach(folderTextMap["sys_def_other_uuid"])
}
LogUtil.info(TAG, "folderUuid " + folderUuid + " count " + count.toString())
return count;
}
/**
* Get common FolderData
*
* @param folderDataArray - Folder data list
* @param selectedNoteArray - Selected note data list
* @return FolderData - return folder when note data list belong to the same folder, else return null
*/
getCommonFolder(folderDataArray: FolderData[], selectedNoteArray: NoteData[]): FolderData {
if (selectedNoteArray.length == 0) {
return null
}
let folderData: FolderData = this.getFolderData(folderDataArray, selectedNoteArray[0].folder_uuid)
let currentFolderData = null
selectedNoteArray.forEach((noteItem) => {
if (folderData != this.getFolderData(folderDataArray, noteItem.folder_uuid)) {
currentFolderData = this.getFolderData(folderDataArray, noteItem.folder_uuid).name
}
})
return (currentFolderData == null) ? folderData : null
}
/**
* folder name duplicate detection
*
* @param inputStr - Folder name input
* @param folderDataArray - folder already exist
* @return Promise<boolean> - if input name exist, return true, else return false
*/
async duplicateDetection(inputStr: string, folderDataArray: FolderData[]): Promise<boolean> {
for (let index = 0; index < folderDataArray.length; index++) {
if (folderDataArray[index].folder_type == FolderType.CusDef && folderDataArray[index].name == inputStr) {
return true
} else {
let temp = GlobalResourceManager.getStringByResource(this.getFolderText(folderDataArray[index]))
temp.then(result => {
if (result == inputStr) {
return true
}
})
}
}
return false
}
}
let folderUtil = new FolderUtil()
export default folderUtil as FolderUtil

View File

@ -0,0 +1,50 @@
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Rsm from '@ohos.resourceManager';
const TAG = "Note_GlobalResourceManager"
export class GlobalResourceManager {
public async getStringByResource(res: any): Promise<string>{
let json = JSON.parse(JSON.stringify(res));
let id = json.id;
console.info(TAG, "ResourceID = %d", id)
return await this.getStringById(id);
}
public getStringById(id: number): Promise<string>{
let promise = new Promise<string>(resolve => {
let resourceMgr = Rsm.getResourceManager("com.example.note");
resourceMgr.then((result) => {
result.getString(id)
.then((resource) => {
resolve(resource);
console.info('getStringById resolve(resource) : ' + resolve(resource));
console.info('getStringById resource : ' + resource);
console.info('getStringById resource2 : ' + JSON.stringify(resource));
})
.catch((err) => {
console.info('getStringById err : ' + JSON.stringify(err));
});
});
});
console.info('getStringById promise: ' + JSON.stringify(promise));
return promise;
}
}
let mGlobalResourceManager = new GlobalResourceManager();
export default mGlobalResourceManager as GlobalResourceManager
;

View File

@ -0,0 +1,42 @@
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {WidthWeightMessage, unSelectedNoteBgColorMap, selectedNoteBgColorMap, folderTextMap, widthWeightMessageMap} from '../model/NoteBaseData.ets'
import FolderData from '../model/databaseModel/FolderData.ets'
import NoteData from '../model/databaseModel/NoteData.ets'
import {SysDefFolderUuid, FolderType, Favorite, Delete} from '../model/databaseModel/EnumData.ets'
import GlobalResourceManager from './GlobalResourceManager.ets'
import StyleConstants from '../constants/StyleConstants.ets'
import LogUtil from './LogUtil.ets'
import FolderUtil from './FolderUtil.ets'
import NoteUtil from './NoteUtil.ets'
const TAG = "LayoutUtil"
export class LayoutUtil {
/**
* Get Width Weight Message
*
* @param sectionStatus - page's section number
* @return WidthWeightMessage
*/
getWidthWeightMessage(sectionStatus: number): WidthWeightMessage {
LogUtil.info(TAG, "sectionStatus " + sectionStatus.toString())
return widthWeightMessageMap[sectionStatus]
}
}
let layoutUtil = new LayoutUtil()
export default layoutUtil as LayoutUtil

View File

@ -0,0 +1,72 @@
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Log Util
*/
export class LogUtil {
getLogFirstStr(tag: string, ...msg) {
let firstStr: string = tag + ", " + msg[0] + " "
try {
throw new Error();
} catch (e) {
firstStr += e.stack.split('at ')[3].split(' ')[0]
}
return firstStr
}
debug(tag: string, ...msg) {
if (msg.length == 0) {
console.debug(tag)
return
}
let firstStr = this.getLogFirstStr(tag, ...msg)
msg.shift()
console.debug(firstStr, ...msg)
}
info(tag: string, ...msg) {
if (msg.length == 0) {
console.debug(tag)
return
}
let firstStr = this.getLogFirstStr(tag, ...msg)
msg.shift()
console.info(firstStr, ...msg)
}
warn(tag: string, ...msg) {
if (msg.length == 0) {
console.debug(tag)
return
}
let firstStr = this.getLogFirstStr(tag, ...msg)
msg.shift()
console.warn(firstStr, ...msg)
}
error(tag: string, ...msg) {
if (msg.length == 0) {
console.debug(tag)
return
}
let firstStr = this.getLogFirstStr(tag, ...msg)
msg.shift()
console.error(firstStr, ...msg)
}
}
let mLogUtil = new LogUtil();
export default mLogUtil as LogUtil

View File

@ -0,0 +1,250 @@
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {WidthWeightMessage, unSelectedNoteBgColorMap, selectedNoteBgColorMap, folderTextMap, widthWeightMessageMap} from '../model/NoteBaseData.ets'
import FolderData from '../model/databaseModel/FolderData.ets'
import NoteData from '../model/databaseModel/NoteData.ets'
import {SysDefFolderUuid, FolderType, Favorite, Delete,TableName, NoteTableColumn,} from '../model/databaseModel/EnumData.ets'
import GlobalResourceManager from './GlobalResourceManager.ets'
import StyleConstants from '../constants/StyleConstants.ets'
import LogUtil from './LogUtil.ets'
import FolderUtil from './FolderUtil.ets'
import RdbStoreUtil from './RdbStoreUtil.ets'
const TAG = "NoteUtil"
export class NoteUtil {
/**
* Set Note Checked status
*
* @param checkedNoteArray - Checked status Note list
* @param noteItem - note
*/
setNoteChecked(checkedNoteArray: NoteData[], noteItem: NoteData) {
LogUtil.info(TAG, "setNoteChecked")
checkedNoteArray.push(noteItem)
}
/**
* unset Note with Checked status
*
* @param checkedNoteArray - Checked status Note list
* @param noteItem - note
*/
unsetNoteChecked(checkedNoteArray: NoteData[], noteItem: NoteData) {
let index = checkedNoteArray.findIndex((note) => {
return note == noteItem
})
LogUtil.info(TAG, "index " + index.toString() + noteItem.uuid)
index == -1 ? null : checkedNoteArray.splice(index, 1)
}
/**
* Is Note Checked status
*
* @param checkedNoteArray - Checked status Note list
* @param noteItem - note
* @return boolean - Checked: true, unchecked: false
*/
isNoteChecked(checkedNoteArray: NoteData[], noteItem: NoteData): boolean {
for(let i = 0; i < checkedNoteArray.length; i++) {
LogUtil.info(TAG, "index " + checkedNoteArray[i].uuid + " noteItem uuid: " + noteItem.uuid)
}
let index = checkedNoteArray.findIndex((note) => {
return note.uuid == noteItem.uuid
})
LogUtil.info(TAG, "index " + index.toString() + " noteItem uuid: " + noteItem.uuid)
return index != -1
}
/**
* Set all notes Checked status
*
* @param checkedNoteArray - Checked status Note list
* @param selectedNoteArray - note array
*/
setAllNotesChecked(checkedNoteArray: NoteData[], noteArray: NoteData[]) {
LogUtil.info(TAG, "setAllNotesChecked")
this.unsetAllNotesChecked(checkedNoteArray)
checkedNoteArray.push(...noteArray)
}
/**
* unset all Notes with Checked status
*
* @param CheckedNoteArray - Checked status Note list
*/
unsetAllNotesChecked(checkedNoteArray: NoteData[]) {
LogUtil.info(TAG, "unsetAllNotesChecked")
checkedNoteArray.splice(0, checkedNoteArray.length)
}
/**
* Get Note Count in folder
*
* @param noteDataArray
* @param folderData
* @return number - Note Count
*/
getNoteCount(noteDataArray: NoteData[], folderData: FolderData): number {
let count = 0;
const folderTextMap = {
"sys_def_allNotes_uuid": (noteData) => {noteData.is_deleted == Delete.No ? ++count : count},
"sys_def_recentDeletes_uuid": (noteData) => {noteData.is_deleted == Delete.Yes ? ++count : count},
"sys_def_myFavorites_uuid": (noteData) => {noteData.is_favorite == Favorite.Yes && noteData.is_deleted == Delete.No ? ++count : count},
"sys_def_other_uuid": (noteData) => {noteData.folder_uuid == folderData.uuid && noteData.is_deleted == Delete.No ? ++count : count}
}
if (folderData.uuid == SysDefFolderUuid.AllNotes || folderData.folder_type == FolderType.FeatureDef) {
noteDataArray.forEach(folderTextMap[folderData.uuid])
} else {
noteDataArray.forEach(folderTextMap["sys_def_other_uuid"])
}
LogUtil.info(TAG, "folderUuid " + folderData.uuid + " count " + count.toString())
return count;
}
/**
* Get note background color
*
* @param folderDataArray - Folder data list
* @param uuid - note's folder_uuid
* @param selectFolderUuid - selected folder's uuid
* @param isSelected - is selected or not
* @return Resource | string - color value
*/
getNoteBgColor(folderDataArray: FolderData[], uuid: string, selectFolderUuid: string, isSelected: boolean): Resource | string {
let folderData: FolderData = FolderUtil.getFolderData(folderDataArray, uuid)
if (folderData == undefined || (selectFolderUuid != SysDefFolderUuid.AllNotes && !isSelected)) {
LogUtil.info(TAG, "NoteBgColor is ffffff")
return $r("app.color.color_ffffff")
}
LogUtil.info(TAG, "isSelected %s, folderData.color: %s", isSelected, folderData.color)
return isSelected ? selectedNoteBgColorMap[folderData.color] : unSelectedNoteBgColorMap[folderData.color]
}
/**
* Get verticalBar background color
*
* @param folderDataArray - Folder data list
* @param uuid - note's folder_uuid
* @return Resource | string - color value
*/
getVerticalBarBgColor(folderDataArray: FolderData[], uuid: string): Resource | string {
let folderData: FolderData = FolderUtil.getFolderData(folderDataArray, uuid)
if (folderData == undefined) {
LogUtil.info(TAG, "NoteBgColor is ffffff")
return $r("app.color.color_ffffff")
}
LogUtil.info(TAG, "isSelected %s, folderData.color: %s", folderData.color)
if (folderData.color == "#ffffff") {
return "#ff9516"
}
return folderData.color
}
/**
* Automatically delete notes in the deleted folder more than 30 days
*
* @param allNoteDataArray
*/
autoDeleteNote(allNoteDataArray: NoteData[]) {
for (let index = 0; index < allNoteDataArray.length;) {
if (allNoteDataArray[index].is_deleted == Delete.Yes && new Date().getTime() - allNoteDataArray[index].deleted_time > StyleConstants.DELETE_DEADLINE) {
LogUtil.info(TAG, "Delete Note, uuid " + allNoteDataArray[index].uuid + " delete time " + allNoteDataArray[index].deleted_time)
allNoteDataArray.splice(index, 1);
}
index++
}
}
/**
* Get Note Count
*
* @param allNoteDataArray
* @param folderUuid
* @return NoteData[] - return Note in folder
*/
getNoteDataArray(allNoteDataArray: NoteData[], folderUuid: string): NoteData[] {
LogUtil.info(TAG, "folderUuid " + folderUuid)
this.autoDeleteNote(allNoteDataArray)
let noteDataArray: NoteData[] = [];
let func = (noteData) => noteDataArray.push(noteData)
const folderTextMap = {
"sys_def_allNotes_uuid": (noteData) => {noteData.is_deleted == Delete.No ? func(noteData) : null},
"sys_def_recentDeletes_uuid": (noteData) => {noteData.is_deleted == Delete.Yes ? func(noteData) : null},
"sys_def_myFavorites_uuid": (noteData) => {noteData.is_favorite == Favorite.Yes && noteData.is_deleted == Delete.No ? func(noteData) : null},
"sys_def_other_uuid": (noteData) => {noteData.folder_uuid == folderUuid && noteData.is_deleted == Delete.No ? func(noteData) : null},
}
if (folderUuid == SysDefFolderUuid.AllNotes || folderUuid == SysDefFolderUuid.RecentDeletes || folderUuid == SysDefFolderUuid.MyFavorites) {
allNoteDataArray.forEach(folderTextMap[folderUuid])
} else {
allNoteDataArray.forEach(folderTextMap["sys_def_other_uuid"])
}
// Sort priority: 1、Top or not 2、created time
noteDataArray.sort((noteItemLeft: NoteData, noteItemRight: NoteData) => {
if (noteItemRight.is_top != noteItemLeft.is_top) {
return noteItemRight.is_top - noteItemLeft.is_top
}
return noteItemRight.created_time - noteItemLeft.created_time
})
LogUtil.info(TAG, "noteDataArray size " + noteDataArray.length.toString())
return noteDataArray
}
/**
* Get First Note in note array
*
* @param allNoteDataArray
* @param folderUuid
* @return NoteData
*/
getFirstNoteData(allNoteDataArray: NoteData[], folderUuid: string): NoteData {
let noteDataArray: NoteData[] = this.getNoteDataArray(allNoteDataArray, folderUuid);
LogUtil.info(TAG, "get noteDataArray size " + noteDataArray.length.toString())
return noteDataArray == undefined ? null : noteDataArray[0]
}
/**
* Remove NoteData
*
* @param allNoteDataArray
* @param noteUuid
*/
removeNoteData(allNoteDataArray: NoteData[], noteUuid: string) {
let index = allNoteDataArray.findIndex((note) => {
return note.uuid == noteUuid
})
LogUtil.info(TAG, "index " + index.toString() + " uuid " + noteUuid)
index == -1 ? null : allNoteDataArray.splice(index, 1)
}
deleteEmptyNote(selectedNoteData: NoteData, AllNoteArray: NoteData[],controllerShow: WebController) {
LogUtil.info(TAG, selectedNoteData.content_text)
if (selectedNoteData.title == "标题" && selectedNoteData.content_text == "") {
// delete note from db
noteUtil.removeNoteData(AllNoteArray,selectedNoteData.uuid)
LogUtil.info(TAG, "delete note:" + selectedNoteData.content_text)
LogUtil.info(TAG, "delete note:" + selectedNoteData.uuid)
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
predicates_note.equalTo(NoteTableColumn.Uuid, selectedNoteData.uuid)
RdbStoreUtil.delete(predicates_note, null)
LogUtil.info(TAG, "delete note success:" + selectedNoteData.uuid)
selectedNoteData = AllNoteArray[0]
controllerShow.runJavaScript({script:"RE.setHtml('" + selectedNoteData.content_text + "')"})
}
}
}
let noteUtil = new NoteUtil()
export default noteUtil as NoteUtil

View File

@ -0,0 +1,311 @@
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import ohosDataRdb from '@ohos.data.rdb'
import LogUtil from './LogUtil.ets'
import SysDefData from '../model/databaseModel/SysDefData.ets'
import FolderData from '../model/databaseModel/FolderData.ets'
import NoteData from '../model/databaseModel/NoteData.ets'
import {TableSql, TableName, FolderTableColumn, NoteTableColumn} from '../model/databaseModel/EnumData.ets'
const TAG = "RdbStoreUtil"
/**
* db instance
*/
var rdbStore = undefined
export default {
/**
* create db and table
*/
createRdbStore(context) {
ohosDataRdb.getRdbStore(context, SysDefData.dbInfo.db_name, SysDefData.dbInfo.db_verison)
.then(async (store) => {
LogUtil.info(TAG, "createRdbStore, store is " + store)
rdbStore = store
// create table
await rdbStore.executeSql(TableSql.FolderTableSQL, null)
await rdbStore.executeSql(TableSql.NoteTableSQL, null)
await rdbStore.executeSql(TableSql.AttachmentTableSQL, null)
await rdbStore.executeSql(TableSql.FormTableSQL, null)
LogUtil.info(TAG, "create table success")
// insert system defined folder
await rdbStore.insert(TableName.FolderTable, SysDefData.sys_def_allNotes)
LogUtil.info(TAG, "insert sys_def_allNotes success")
await rdbStore.insert(TableName.FolderTable, SysDefData.sys_def_unClassified)
LogUtil.info(TAG, "insert sys_def_unClassified success")
await rdbStore.insert(TableName.FolderTable, SysDefData.sys_def_myFavorites)
LogUtil.info(TAG, "insert sys_def_myFavorites success")
await rdbStore.insert(TableName.FolderTable, SysDefData.sys_def_recentDeletes)
LogUtil.info(TAG, "insert sys_def_recentDeletes success")
await rdbStore.insert(TableName.FolderTable, SysDefData.sys_def_personal)
LogUtil.info(TAG, "insert sys_def_personal success")
await rdbStore.insert(TableName.FolderTable, SysDefData.sys_def_life)
LogUtil.info(TAG, "insert sys_def_life success")
await rdbStore.insert(TableName.FolderTable, SysDefData.sys_def_work)
LogUtil.info(TAG, "insert sys_def_work success")
// insert system defined note and attachment
await rdbStore.insert(TableName.NoteTable, SysDefData.sys_def_note1)
LogUtil.info(TAG, "insert sys_def_note1 success")
await rdbStore.insert(TableName.NoteTable, SysDefData.sys_def_note2)
LogUtil.info(TAG, "insert sys_def_note2 success")
await rdbStore.insert(TableName.NoteTable, SysDefData.sys_def_note3)
LogUtil.info(TAG, "insert sys_def_note3 success")
await rdbStore.insert(TableName.NoteTable, SysDefData.sys_def_note4)
LogUtil.info(TAG, "insert sys_def_note4 success")
// add sys-def folder and note to AppStorage
let folderDataArray = []
let sysDefFolderArray = [SysDefData.sys_def_allNotes, SysDefData.sys_def_unClassified,
SysDefData.sys_def_myFavorites, SysDefData.sys_def_recentDeletes,
SysDefData.sys_def_personal, SysDefData.sys_def_life, SysDefData.sys_def_work]
sysDefFolderArray.forEach((sysDefFolder) => {
let folderData = new FolderData(sysDefFolder.id, sysDefFolder.name, sysDefFolder.uuid, sysDefFolder.color,
sysDefFolder.folder_type, sysDefFolder.is_deleted, sysDefFolder.created_time,
sysDefFolder.modified_time)
folderDataArray.push(folderData)
})
let noteDataArray = []
let sysDefNoteArray = [SysDefData.sys_def_note1, SysDefData.sys_def_note2,
SysDefData.sys_def_note3, SysDefData.sys_def_note4]
sysDefNoteArray.forEach((sysDefNote) => {
let noteData = new NoteData(sysDefNote.id, sysDefNote.title, sysDefNote.uuid, sysDefNote.folder_uuid, sysDefNote.content_text,
sysDefNote.content_img, sysDefNote.note_type, sysDefNote.is_top, sysDefNote.is_favorite,
sysDefNote.is_deleted, sysDefNote.created_time, sysDefNote.modified_time, sysDefNote.deleted_time)
noteDataArray.push(noteData)
})
LogUtil.info(TAG, "folderDataArray[sysdef] : " + folderDataArray.length)
for (let folderData of folderDataArray) {
LogUtil.info(TAG, "folderData[sysdef] : " + JSON.stringify(folderData))
}
LogUtil.info(TAG, "noteDataArray[sysdef] : " + noteDataArray.length)
for (let noteData of noteDataArray) {
LogUtil.info(TAG, "noteData[sysdef] : " + JSON.stringify(noteData))
}
AppStorage.SetOrCreate('AllFolderArray', folderDataArray)
AppStorage.SetOrCreate('AllNoteArray', noteDataArray)
// 迁移
let isContinue = AppStorage.Get('IsContinue');
LogUtil.info(TAG, "createRdbStore, isContinue is " + isContinue)
if (isContinue != undefined && isContinue == 1) {
console.info("RdbStoreUtil createRdbStore, IsContinue true")
let continueFolder: string = AppStorage.Get('ContinueFolder')
console.log("RdbStoreUtil createRdbStore, continueFolder is " + continueFolder)
let continueNote: string = AppStorage.Get('ContinueNote')
console.log("RdbStoreUtil createRdbStore, continueNote is " + continueNote)
let continueSection = AppStorage.Get('ContinueSection')
console.log("RdbStoreUtil createRdbStore, continueSection is " + continueSection)
let folderObj = JSON.parse(continueFolder)
let folderData = new FolderData(folderObj.uuid, folderObj.name, folderObj.uuid, folderObj.color,
folderObj.folder_type, folderObj.is_deleted, folderObj.created_time, folderObj.modified_time)
let noteObj = JSON.parse(continueNote)
let noteData = new NoteData(noteObj.uuid, noteObj.title, noteObj.uuid, noteObj.folder_uuid,
noteObj.content_text, noteObj.content_img, noteObj.note_type, noteObj.is_top, noteObj.is_favorite,
noteObj.is_deleted, noteObj.created_time, noteObj.modified_time, noteObj.deleted_time)
AppStorage.SetOrCreate('Folder', folderData)
AppStorage.SetOrCreate('Note', noteData)
AppStorage.SetOrCreate('Section', continueSection)
} else {
console.info("RdbStoreUtil createRdbStore, IsContinue false")
AppStorage.SetOrCreate('Folder', AppStorage.Get('AllFolderArray')[0])
AppStorage.SetOrCreate('Note', AppStorage.Get('AllNoteArray')[0])
AppStorage.SetOrCreate('Section', 3)
}
AppStorage.SetOrCreate('DBQueryFinished', 1)
LogUtil.info(TAG, "createRdbStore, set DBQueryFinished 1")
})
.catch((err) => {
LogUtil.error(TAG, "createRdbStore, error : " + err)
})
},
/**
* query folders and notes from the database, then save them to the AppStorage.
*/
initAppStorage(context) {
let folderDataArray = []
let noteDataArray = []
ohosDataRdb.getRdbStore(context, SysDefData.dbInfo.db_name, SysDefData.dbInfo.db_verison)
.then(async (store) => {
LogUtil.info(TAG, "initAppStorage, store is " + store)
rdbStore = store
// query folder
let columns_folder = []
let predicates_folder = new ohosDataRdb.RdbPredicates(TableName.FolderTable)
let resultSet_folder = await rdbStore.query(predicates_folder, columns_folder)
while (resultSet_folder.goToNextRow()) {
let id = resultSet_folder.getLong(resultSet_folder.getColumnIndex(FolderTableColumn.Id))
let name = resultSet_folder.getString(resultSet_folder.getColumnIndex(FolderTableColumn.Name))
let uuid = resultSet_folder.getString(resultSet_folder.getColumnIndex(FolderTableColumn.Uuid))
let color = resultSet_folder.getString(resultSet_folder.getColumnIndex(FolderTableColumn.Color))
let folder_type = resultSet_folder.getLong(resultSet_folder.getColumnIndex(FolderTableColumn.FolderType))
let is_deleted = resultSet_folder.getLong(resultSet_folder.getColumnIndex(FolderTableColumn.IsDeleted))
let created_time = resultSet_folder.getLong(resultSet_folder.getColumnIndex(FolderTableColumn.CreatedTime))
let modified_time = resultSet_folder.getLong(resultSet_folder.getColumnIndex(FolderTableColumn.ModifiedTime))
let folderData = new FolderData(id, name, uuid, color, folder_type, is_deleted, created_time, modified_time)
folderDataArray.push(folderData)
}
LogUtil.info(TAG, "query folder table success")
// query note
let columns_note = []
let predicates_note = new ohosDataRdb.RdbPredicates(TableName.NoteTable)
let resultSet_note = await rdbStore.query(predicates_note, columns_note)
while (resultSet_note.goToNextRow()) {
let id = resultSet_note.getLong(resultSet_note.getColumnIndex(NoteTableColumn.Id))
let title = resultSet_note.getString(resultSet_note.getColumnIndex(NoteTableColumn.Title))
let uuid = resultSet_note.getString(resultSet_note.getColumnIndex(NoteTableColumn.Uuid))
let folder_uuid = resultSet_note.getString(resultSet_note.getColumnIndex(NoteTableColumn.FolderUuid))
let content_text = resultSet_note.getString(resultSet_note.getColumnIndex(NoteTableColumn.ContentText))
let content_img = resultSet_note.getString(resultSet_note.getColumnIndex(NoteTableColumn.ContentImg))
let noteType = resultSet_note.getLong(resultSet_note.getColumnIndex(NoteTableColumn.NoteType))
let is_top = resultSet_note.getLong(resultSet_note.getColumnIndex(NoteTableColumn.IsTop))
let is_favorite = resultSet_note.getLong(resultSet_note.getColumnIndex(NoteTableColumn.IsFavorite))
let is_deleted = resultSet_note.getLong(resultSet_note.getColumnIndex(NoteTableColumn.IsDeleted))
let created_time = resultSet_note.getLong(resultSet_note.getColumnIndex(NoteTableColumn.CreatedTime))
let modified_time = resultSet_note.getLong(resultSet_note.getColumnIndex(NoteTableColumn.ModifiedTime))
let deleted_time = resultSet_note.getLong(resultSet_note.getColumnIndex(NoteTableColumn.DeletedTime))
let noteData = new NoteData(id, title, uuid, folder_uuid, content_text, content_img, noteType, is_top, is_favorite, is_deleted, created_time, modified_time, deleted_time)
noteDataArray.push(noteData)
}
LogUtil.info(TAG, "query note table success")
LogUtil.info(TAG, "folderDataArray[query] : " + folderDataArray.length)
for (let folderData of folderDataArray) {
LogUtil.info(TAG, "folderData[query] : " + JSON.stringify(folderData))
}
LogUtil.info(TAG, "noteDataArray[query] : " + noteDataArray.length)
for (let noteData of noteDataArray) {
LogUtil.info(TAG, "noteData[query] : " + JSON.stringify(noteData))
}
AppStorage.SetOrCreate('AllFolderArray', folderDataArray)
AppStorage.SetOrCreate('AllNoteArray', noteDataArray)
// 迁移
let isContinue = AppStorage.Get('IsContinue');
LogUtil.info(TAG, "initAppStorage, isContinue is " + isContinue)
if (isContinue != undefined && isContinue == 1) {
console.info("RdbStoreUtil initAppStorage, IsContinue true")
let continueFolder: string = AppStorage.Get('ContinueFolder')
console.log("RdbStoreUtil initAppStorage, continueFolder is " + continueFolder)
let continueNote: string = AppStorage.Get('ContinueNote')
console.log("RdbStoreUtil initAppStorage, continueNote is " + continueNote)
let continueSection = AppStorage.Get('ContinueSection')
console.log("RdbStoreUtil initAppStorage, continueSection is " + continueSection)
let folderObj = JSON.parse(continueFolder)
let folderData = new FolderData(folderObj.uuid, folderObj.name, folderObj.uuid, folderObj.color,
folderObj.folder_type, folderObj.is_deleted, folderObj.created_time, folderObj.modified_time)
let noteObj = JSON.parse(continueNote)
let noteData = new NoteData(noteObj.uuid, noteObj.title, noteObj.uuid, noteObj.folder_uuid,
noteObj.content_text, noteObj.content_img, noteObj.note_type, noteObj.is_top, noteObj.is_favorite,
noteObj.is_deleted, noteObj.created_time, noteObj.modified_time, noteObj.deleted_time)
AppStorage.SetOrCreate('Folder', folderData)
AppStorage.SetOrCreate('Note', noteData)
AppStorage.SetOrCreate('Section', continueSection)
} else {
console.info("RdbStoreUtil initAppStorage, IsContinue false")
AppStorage.SetOrCreate('Folder', AppStorage.Get('AllFolderArray')[0])
AppStorage.SetOrCreate('Note', AppStorage.Get('AllNoteArray')[0])
AppStorage.SetOrCreate('Section', 3)
}
AppStorage.SetOrCreate('DBQueryFinished', 1)
LogUtil.info(TAG, "initAppStorage, set DBQueryFinished 1")
})
.catch((err) => {
LogUtil.error(TAG, "initAppStorage, error : " + err)
})
},
/**
* insert
* @param tableName
* @param valueBucket
* @param callback
*/
insert(tableName, valueBucket, callback) {
rdbStore.insert(tableName, valueBucket).then((rowId) => {
LogUtil.info(TAG, "insert success, rowId is " + rowId)
if (callback != null) {
callback(rowId)
}
}).catch((err) => {
LogUtil.error(TAG, "insert error : " + err)
})
},
/**
* delete
* @param predicates
* @param callback
*/
delete(predicates, callback) {
rdbStore.delete(predicates).then((affectedRowCount) => {
LogUtil.info(TAG, "delete success, affectedRowCount is " + affectedRowCount)
if (callback != null) {
callback(affectedRowCount)
}
}).catch((err) => {
LogUtil.error(TAG, "delete error : " + err)
})
},
/**
* update
* @param valueBucket
* @param predicates
* @param callback
*/
update(valueBucket, predicates, callback) {
rdbStore.update(valueBucket, predicates).then((affectedRowCount) => {
LogUtil.info(TAG, "update success, affectedRowCount is " + affectedRowCount)
if (callback != null) {
callback(affectedRowCount)
}
}).catch((err) => {
LogUtil.error(TAG, "update error : " + err)
})
},
/**
* query
* @param columns
* @param predicates
* @param callback
*/
query(columns, predicates, callback) {
rdbStore.query(predicates, columns).then((resultSet) => {
LogUtil.info(TAG, "query success, row count : " + resultSet.rowCount)
if (callback != null) {
callback(resultSet)
}
}).catch((err) => {
LogUtil.error(TAG, "query error : " + err)
})
},
/**
* get RdbPredicates by table name
* @param tableName
*/
getRdbPredicates(tableName) {
return new ohosDataRdb.RdbPredicates(tableName)
}
}

View File

@ -0,0 +1,27 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default class StyleConstants {
public static PERCENTAGE_100: string = '100%'
public static PERCENTAGE_60: string = '60%'
public static PERCENTAGE_0: string = '0%'
public static SPACE_24: number = 24
public static NOTE_LIST_BACKGROUND: string = "#f1f3f5"
public static DELETE_DEADLINE: number = 2592000000 // 30 days (30 * 24 * 60 * 60 * 1000)ms
public static OPACITY_10: number = 0.1
public static OPACITY_20: number = 0.2
public static OPACITY_40: number = 0.4
public static OPACITY_100: number = 1
}

View File

@ -0,0 +1,105 @@
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import NoteData from '../model/databaseModel/NoteData.ets'
export const circleColorArray: string[] = [
"#e84026", // 深红
"#ff7500", // 浅红
"#ffbf00", // 黄色
"#41ba41", // 绿色
"#00bfc9", // 浅蓝
"#00aaee", // 中蓝
"#3f56ea", // 深蓝
"#8a2be2", // 紫色
]
export const fontColorArray: string[] = [
"#e84026", // 深红
"#ffbf00", // 黄色
"#41ba41", // 绿色
"#00aaee", // 中蓝
"#3f56ea", // 深蓝
"#8a2be2", // 紫色
"#182431", //黑色
]
export const unSelectedNoteBgColorMap = {
"#e84026": "#eecfcc",
"#ff7500": "#f3d9c4",
"#ffbf00": "#f3e8c4",
"#41ba41": "#cde7d1",
"#00bfc9": "#c0e8ec",
"#00aaee": "#c0e4f4",
"#3f56ea": "#cdd3f3",
"#8a2be2": "#dccbf1",
"#ffffff": "#ffffff"
}
export const selectedNoteBgColorMap = {
"#e84026": "#eec4b8",
"#ff7500": "#f1d8c7",
"#ffbf00": "#f3cdb1",
"#41ba41": "#d1dabc",
"#00bfc9": "#c5dbd4",
"#00aaee": "#c5d7dc",
"#3f56ea": "#d1c8db",
"#8a2be2": "#dec1d9",
"#ffffff": "#19007dff"
}
export const folderTextMap = {
"sys_def_allNotes_uuid": $r('app.string.allNotes'),
"sys_def_unClassified_uuid": $r('app.string.unClassified'),
"sys_def_myFavorites_uuid": $r('app.string.myFavorites'),
"sys_def_recentDeletes_uuid": $r('app.string.recentDeletes'),
}
export const folderIconMap = {
"sys_def_allNotes_uuid": $r('app.media.allNotes'),
"sys_def_unClassified_uuid": $r('app.media.unClassified'),
"sys_def_myFavorites_uuid": $r('app.media.favorite_cancel'),
"sys_def_recentDeletes_uuid": $r('app.media.delete'),
}
let CheckedNoteArray: NoteData[] = []
AppStorage.SetOrCreate('CheckedNoteArray', CheckedNoteArray)
export class WidthWeightMessage {
folderListWeight: string // 三分栏每个分栏的比例, 用百分比表示 例如16%
folderListVisibility: number // 分栏的可见性 0表示Visibility.None 1表示Visibility.Visible
noteListWeight: string
noteListVisibility: number
noteCotentWeight: string
noteCotentVisibility: number
constructor(folderListWeight: string, folderListVisibility: number, noteListWeight: string, noteListVisibility: number,
noteCotentWeight: string, noteCotentVisibility: number) {
this.folderListWeight = folderListWeight
this.folderListVisibility = folderListVisibility
this.noteListWeight = noteListWeight
this.noteListVisibility = noteListVisibility
this.noteCotentWeight = noteCotentWeight
this.noteCotentVisibility = noteCotentVisibility
}
}
let widthWeightOneSection: WidthWeightMessage = new WidthWeightMessage("0%", 0, "0%", 0, "100%", 1)
let widthWeightTwoSection = new WidthWeightMessage("0%", 0, "34%", 1, "66%", 1)
let widthWeightThreeSection = new WidthWeightMessage("16%", 1, "34%", 1, "50%", 1)
export const widthWeightMessageMap = {
1: widthWeightOneSection,
2: widthWeightTwoSection,
3: widthWeightThreeSection
}

View File

@ -0,0 +1,37 @@
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* 附件类
*/
export default class AttachmentData {
id: number // 主键
uuid: string // 唯一标识
note_uuid: string // 笔记uuid
path: string // 路径
attachment_type: number // 类型
created_time: number // 创建时间
modified_time: number // 修改时间
constructor(id: number, uuid: string, note_uuid: string, path: string, attachment_type: number, created_time: number, modified_time: number) {
this.id = id;
this.uuid = uuid;
this.note_uuid = note_uuid;
this.path = path;
this.attachment_type = attachment_type;
this.created_time = created_time;
this.modified_time = modified_time;
}
}

View File

@ -0,0 +1,211 @@
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* table name
*/
export enum TableName {
FolderTable = "folder_table",
NoteTable = "note_table",
AttachmentTable = "attachment_table",
FormTable = "form_table"
}
/**
* folder table column
*/
export enum FolderTableColumn {
Id = "id", // 主键
Name = "name", // 名称
Uuid = "uuid", // 唯一标识
Color = "color", // 图标颜色
FolderType = "folder_type", // 类型
IsDeleted = "is_deleted", // 是否被删除
CreatedTime = "created_time", // 创建时间
ModifiedTime = "modified_time" // 修改时间
}
/**
* note table column
*/
export enum NoteTableColumn {
Id = "id", // 主键
Title = "title", // 标题
Uuid = "uuid", // 唯一标识
FolderUuid = "folder_uuid", // 文件夹uuid
ContentText = "content_text", // 文字内容
ContentImg = "content_img", // 图片路径
NoteType = "note_type", // 类型
IsTop = "is_top", // 是否置顶
IsFavorite = "is_favorite", // 是否被收藏
IsDeleted = "is_deleted", // 是否被删除
CreatedTime = "created_time", // 创建时间
ModifiedTime = "modified_time", // 修改时间
DeletedTime = "deleted_time" // 删除时间
}
/**
* attachment table column
*/
export enum AttachmentTableColumn {
Id = "id", // 主键
Uuid = "uuid", // 唯一标识
NoteUuid = "note_uuid", // 笔记uuid
Path = "path", // 路径
AttachmentType = "attachment_type", // 类型
CreatedTime = "created_time", // 创建时间
ModifiedTime = "modified_time" // 修改时间
}
/**
* form table column
*/
export enum FormTableColumn {
Id = "id", // 卡片id
Name = "name", // 卡片名称
Dimension = "dimension", // 卡片尺寸
}
/**
* Database table init sql
*/
export enum TableSql {
FolderTableSQL = "CREATE TABLE IF NOT EXISTS " + TableName.FolderTable + " ("
+ FolderTableColumn.Id + " INTEGER PRIMARY KEY AUTOINCREMENT,"
+ FolderTableColumn.Name + " TEXT NOT NULL,"
+ FolderTableColumn.Uuid + " TEXT NOT NULL,"
+ FolderTableColumn.Color + " TEXT DEFAULT '#ffffffff',"
+ FolderTableColumn.FolderType + " INTEGER DEFAULT 1,"
+ FolderTableColumn.IsDeleted + " INTEGER DEFAULT 0,"
+ FolderTableColumn.CreatedTime + " INTEGER,"
+ FolderTableColumn.ModifiedTime + " INTEGER"
+ ")",
NoteTableSQL = "CREATE TABLE IF NOT EXISTS " + TableName.NoteTable + " ("
+ NoteTableColumn.Id + " INTEGER PRIMARY KEY AUTOINCREMENT,"
+ NoteTableColumn.Title + " TEXT NOT NULL,"
+ NoteTableColumn.Uuid + " TEXT NOT NULL,"
+ NoteTableColumn.FolderUuid + " TEXT,"
+ NoteTableColumn.ContentText + " TEXT,"
+ NoteTableColumn.ContentImg + " TEXT,"
+ NoteTableColumn.NoteType + " INTEGER DEFAULT 1,"
+ NoteTableColumn.IsTop + " INTEGER DEFAULT 0,"
+ NoteTableColumn.IsFavorite + " INTEGER DEFAULT 0,"
+ NoteTableColumn.IsDeleted + " INTEGER DEFAULT 0,"
+ NoteTableColumn.CreatedTime + " INTEGER,"
+ NoteTableColumn.ModifiedTime + " INTEGER,"
+ NoteTableColumn.DeletedTime + " INTEGER"
+ ")",
AttachmentTableSQL = "CREATE TABLE IF NOT EXISTS " + TableName.AttachmentTable + " ("
+ AttachmentTableColumn.Id + " INTEGER PRIMARY KEY AUTOINCREMENT,"
+ AttachmentTableColumn.Uuid + " TEXT NOT NULL,"
+ AttachmentTableColumn.NoteUuid + " TEXT NOT NULL,"
+ AttachmentTableColumn.Path + " TEXT,"
+ AttachmentTableColumn.AttachmentType + " INTEGER DEFAULT 0,"
+ AttachmentTableColumn.CreatedTime + " INTEGER,"
+ AttachmentTableColumn.ModifiedTime + " INTEGER"
+ ")",
FormTableSQL = "CREATE TABLE IF NOT EXISTS " + TableName.FormTable + " ("
+ FormTableColumn.Id + " TEXT NOT NULL,"
+ FormTableColumn.Name + " TEXT NOT NULL,"
+ FormTableColumn.Dimension + " TEXT NOT NULL"
+ ")"
}
/**
* system Define folder
*/
export enum SysDefFolder {
AllNotes = "sys_def_allNotes",
UnClassified = "sys_def_unClassified",
MyFavorites = "sys_def_myFavorites",
RecentDeletes = "sys_def_recentDeletes",
Personal = "sys_def_personal",
Life = "sys_def_life",
Work = "sys_def_work"
}
/**
* system Define folder uuid
*/
export enum SysDefFolderUuid {
AllNotes = "sys_def_allNotes_uuid",
UnClassified = "sys_def_unClassified_uuid",
MyFavorites = "sys_def_myFavorites_uuid",
RecentDeletes = "sys_def_recentDeletes_uuid",
Personal = "sys_def_personal_uuid",
Life = "sys_def_life_uuid",
Work = "sys_def_work_uuid"
}
/**
* folder type
*/
export enum FolderType {
SysDef, // System definition
CusDef, // User defined
FeatureDef // feature defined: MyFavorites & RecentDeletes
}
/**
* note type
*/
export enum NoteType {
SysDef,
CusDef
}
/**
* attachment type
*/
export enum AttachmentType {
Image,
Voice,
HandWriting
}
/**
* Note favorite status
*/
export enum Favorite {
No,
Yes
}
/**
* Note delete status
*/
export enum Delete {
No,
Yes
}
/**
* Note top status
*/
export enum Top {
No,
Yes
}
/**
* delete file type
*/
export enum DeleteFileType {
NoteData,
FolderData
}

View File

@ -0,0 +1,57 @@
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {FolderType, Delete} from './EnumData.ets'
/**
* 文件夹类
*/
export default class FolderData {
id: number // 主键
name: string // 名称
uuid: string // 唯一标识
color: string // 图标颜色
folder_type: FolderType // 类型
is_deleted: Delete // 是否被删除
created_time: number // 创建时间
modified_time: number // 修改时间
constructor(id: number, name: string, uuid: string, color: string, folder_type: FolderType,
is_deleted: Delete, created_time: number, modified_time: number) {
this.id = id
this.name = name
this.uuid = uuid
this.color = color
this.folder_type = folder_type
this.is_deleted = is_deleted
this.created_time = created_time
this.modified_time = modified_time
}
/**
* 转化为folder_table表的valueBucket
*/
toFolderObject(): any{
return {
"name": this.name,
"uuid": this.uuid,
"color": this.color,
"folder_type": this.folder_type,
"is_deleted": this.is_deleted,
"created_time": this.created_time,
"modified_time": this.modified_time
}
}
}

View File

@ -0,0 +1,73 @@
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {NoteType, Favorite, Delete, Top} from './EnumData.ets'
/**
* 笔记类
*/
export default class NoteData {
id: number // 主键
title: string // 标题
uuid: string // 唯一标识
folder_uuid: string // 文件夹uuid
content_text: string // 文字内容
content_img: string // 图片路径
note_type: NoteType // 类型
is_top: Top // 是否置顶
is_favorite: Favorite // 是否被收藏
is_deleted: Delete // 是否被删除
created_time: number // 创建时间
modified_time: number // 修改时间
deleted_time: number // 删除时间
constructor(id: number, title: string, uuid: string, folder_uuid: string, content_text: string, content_img: string,
note_type: NoteType, is_top: Top, is_favorite: Favorite, is_deleted: Delete, created_time: number,
modified_time: number, deleted_time: number) {
this.id = id
this.title = title
this.uuid = uuid
this.folder_uuid = folder_uuid
this.content_text = content_text
this.content_img = content_img
this.note_type = note_type
this.is_top = is_top
this.is_favorite = is_favorite
this.is_deleted = is_deleted
this.created_time = created_time
this.modified_time = modified_time
this.deleted_time = deleted_time
}
/**
* 转化为note_table表的valueBucket
*/
toNoteObject(): any{
return {
"title": this.title,
"uuid": this.uuid,
"folder_uuid": this.folder_uuid,
"content_text": this.content_text,
"content_img": this.content_img,
"note_type": this.note_type,
"is_top": this.is_top,
"is_favorite": this.is_favorite,
"is_deleted": this.is_deleted,
"created_time": this.created_time,
"modified_time": this.modified_time,
"deleted_time": this.deleted_time
}
}
}

View File

@ -0,0 +1,175 @@
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {SysDefFolder, SysDefFolderUuid, FolderType, NoteType, Favorite, Top, Delete} from './EnumData.ets'
export default {
/**
* db info
*/
dbInfo: {
db_name: {
name: "note.db" // 数据库名称
},
db_verison: 1 // 数据库版本
},
/**
* system defined folder
*/
sys_def_allNotes: {
"id": 1,
"name": SysDefFolder.AllNotes,
"uuid": SysDefFolderUuid.AllNotes,
"color": "#ffffff",
"folder_type": FolderType.SysDef,
"is_deleted": Delete.No,
"created_time": 1641863695000,
"modified_time": 1641863695000
},
sys_def_unClassified: {
"id": 2,
"name": SysDefFolder.UnClassified,
"uuid": SysDefFolderUuid.UnClassified,
"color": "#ffffff",
"folder_type": FolderType.SysDef,
"is_deleted": Delete.No,
"created_time": 1641860095000,
"modified_time": 1641860095000
},
sys_def_myFavorites: {
"id": 3,
"name": SysDefFolder.MyFavorites,
"uuid": SysDefFolderUuid.MyFavorites,
"color": "#ffffff",
"folder_type": FolderType.FeatureDef,
"is_deleted": Delete.No,
"created_time": 1641856088000,
"modified_time": 1641856088000
},
sys_def_recentDeletes: {
"id": 4,
"name": SysDefFolder.RecentDeletes,
"uuid": SysDefFolderUuid.RecentDeletes,
"color": "#ffffff",
"folder_type": FolderType.FeatureDef,
"is_deleted": Delete.No,
"created_time": 1641848898000,
"modified_time": 1641848898000
},
sys_def_personal: {
"id": 5,
"name": "个人",
"uuid": SysDefFolderUuid.Personal,
"color": "#41ba41",
"folder_type": FolderType.CusDef,
"is_deleted": Delete.No,
"created_time": 1641677288000,
"modified_time": 1641677288000
},
sys_def_life: {
"id": 6,
"name": "生活",
"uuid": SysDefFolderUuid.Life,
"color": "#00aaee",
"folder_type": FolderType.CusDef,
"is_deleted": Delete.No,
"created_time": 1641676108000,
"modified_time": 1641676108000
},
sys_def_work: {
"id": 7,
"name": "工作",
"uuid": SysDefFolderUuid.Work,
"color": "#e84026",
"folder_type": FolderType.CusDef,
"is_deleted": Delete.No,
"created_time": 1641636508000,
"modified_time": 1641636508000
},
/**
* system defined note
*/
sys_def_note1: {
"id": 1,
"title": "数学公式",
"uuid": "note1_uuid",
"folder_uuid": SysDefFolderUuid.UnClassified,
"content_text": '好好学习,天天向上<div style="text-align:center;"><img src="./shuxue.png" height="700"/></div><br><br>',
"content_img": "/res/shuxue.png",
"note_type": NoteType.SysDef,
"is_top": Top.Yes,
"is_favorite": Favorite.Yes,
"is_deleted": Delete.No,
"created_time": 1641869573000,
"modified_time": 1641869573000,
"deleted_time": 0
},
sys_def_note2: {
"id": 2,
"title": "UX会议纪要",
"uuid": "note2_uuid",
"folder_uuid": SysDefFolderUuid.Work,
"content_text": "UX会议纪要",
"content_img": "",
"note_type": NoteType.SysDef,
"is_top": Top.Yes,
"is_favorite": Favorite.No,
"is_deleted": Delete.No,
"created_time": 1640999288000,
"modified_time": 1640999288000,
"deleted_time": 0
},
sys_def_note3: {
"id": 3,
"title": "旅游心得",
"uuid": "note3_uuid",
"folder_uuid": SysDefFolderUuid.Work,
"content_text": '旅游心得<div style="text-align:center;"><img src="./lvyou.png" height="700"/></div><br><br>',
"content_img": "/res/lvyou.png",
"note_type": NoteType.SysDef,
"is_top": Top.No,
"is_favorite": Favorite.No,
"is_deleted": Delete.No,
"created_time": 1641385708000,
"modified_time": 1641385708000,
"deleted_time": 0
},
sys_def_note4: {
"id": 4,
"title": "蛋糕做法",
"uuid": "note4_uuid",
"folder_uuid": SysDefFolderUuid.Life,
"content_text": '蛋糕做法<div style="text-align:center;"><img src="./cake.png" height="700"/></div><br><br>',
"content_img": "/res/cake.png",
"note_type": NoteType.CusDef,
"is_top": Top.No,
"is_favorite": Favorite.Yes,
"is_deleted": Delete.No,
"created_time": 1640909288000,
"modified_time": 1640909288000,
"deleted_time": 0
}
}

View File

@ -0,0 +1,84 @@
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import LogUtil from '../../baseUtil/LogUtil.ets'
import NoteData from '../../model/databaseModel/NoteData.ets'
import ohosDataRdb from '@ohos.data.rdb';
import {TableName, NoteTableColumn} from '../../model/databaseModel/EnumData.ets'
import NoteUtil from '../../baseUtil/NoteUtil.ets'
import RdbStoreUtil from '../../baseUtil/RdbStoreUtil.ets'
import SysDefData from '../../model/databaseModel/SysDefData.ets'
const TAG = "SearchModel"
/**
* Search service class
*/
export class SearchModel {
private rdbStore;
/**
* Search
*
* @param query - query content
*/
public async search(noteDataArray: NoteData[], query: string): Promise<NoteData[]> {
LogUtil.info(TAG, "query is " + query)
if (!query) {
LogUtil.info(TAG, "query is null")
return []
}
let searchData: NoteData[] = [];
noteDataArray.forEach((noteData) => {
if (noteData.content_text.toLowerCase().indexOf(query.toLowerCase()) != -1
|| noteData.title.toLowerCase().indexOf(query.toLowerCase()) != -1) {
LogUtil.info(TAG, "uuid " + noteData.uuid)
searchData.push(noteData);
}
})
// 排序
return searchData;
}
splitToHighlightText(text: string, highlightKeyword): any[] {
let spans: any[] = []
var lowerSpans: string[] = text.toLowerCase().split(highlightKeyword.toLowerCase())
var keywordStartIndex = 0
var keywordLength = highlightKeyword.length
for (var i = 0; i < lowerSpans.length; i++) {
var normalText = text.substr(keywordStartIndex, lowerSpans[i].length)
spans.push({
type: 0,
text: normalText
})
// if not at last, append highlight keyword
if (i != lowerSpans.length - 1) {
keywordStartIndex += lowerSpans[i].length
var keywordText = text.substr(keywordStartIndex, keywordLength)
spans.push({
type: 1,
text: keywordText
})
keywordStartIndex += keywordLength
}
}
return spans
}
}
let searchModel = new SearchModel()
export default searchModel as SearchModel

View File

@ -0,0 +1,4 @@
{
"string": [
]
}

13
gradle.properties Normal file
View File

@ -0,0 +1,13 @@
# Project-wide Gradle settings.
# IDE (e.g. DevEco Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# If the Chinese output is garbled, please configure the following parameter.
# This function is enabled by default when the DevEco Studio builds the hap/app,if you need disable gradle parallel,you should set org.gradle.parallel false.
# more information see https://docs.gradle.org/current/userguide/performance.html
# org.gradle.parallel=false
# org.gradle.jvmargs=-Dfile.encoding=GBK

183
gradlew vendored Normal file
View File

@ -0,0 +1,183 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"

103
gradlew.bat vendored Normal file
View File

@ -0,0 +1,103 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

1
package.json Normal file
View File

@ -0,0 +1 @@
{}

20
product/pc/build.gradle Normal file
View File

@ -0,0 +1,20 @@
apply plugin: 'com.huawei.ohos.hap'
//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510
ohos {
compileSdkVersion 8
defaultConfig {
compatibleSdkVersion 8
}
buildTypes {
release {
proguardOpt {
proguardEnabled false
rulesFiles 'proguard-rules.pro'
}
}
}
}
dependencies {
}

View File

@ -0,0 +1,71 @@
{
"app": {
"bundleName": "com.ohos.note",
"vendor": "ohos",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {},
"module": {
"package": "com.ohos.note",
"name": ".MyApplication",
"mainAbility": "com.ohos.note.MainAbility",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "pc",
"moduleType": "entry",
"installationFree": true
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"visible": true,
"name": "com.ohos.note.MainAbility",
"icon": "$media:note",
"description": "$string:description_mainability",
"label":"$string:entry_MainAbility",
"type": "page",
"launchType": "singleton",
"srcPath": "MainAbility",
"srcLanguage": "ets",
"metaData": {
"customizeData": [
{
"name": "hwc-theme"
}
]
}
}
],
"js": [
{
"mode": {
"syntax": "ets",
"type": "pageAbility"
},
"pages": [
"pages/index"
],
"name": "MainAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}

View File

@ -0,0 +1,22 @@
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
onCreate() {
console.info('Application onCreate')
},
onDestroy() {
console.info('Application onDestroy')
},
}

View File

@ -0,0 +1,24 @@
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@Entry
@Component
struct Index {
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
}
.width('100%')
.height('100%')
}
}

View File

@ -0,0 +1,80 @@
{
"color": [
{
"name": "color_ffffff",
"value": "#ffffff"
},
{
"name": "delete_color_fa2a2d",
"value": "#fa2a2d"
},
{
"name": "cancel_color_4fb4e3",
"value": "#4fb4e3"
},
{
"name": "divider_color_e4e4e4",
"value": "#cce4e4e4"
},
{
"name": "divider_color_182431",
"value": "#182431"
},
{
"name": "button_color_419fff",
"value": "#419fff"
},
{
"name": "button_color_fb4447",
"value": "#fb4447"
},
{
"name": "text_color_3f97e9",
"value": "#3f97e9"
},
{
"name": "text_color_f86d05",
"value": "#f86d05"
},
{
"name": "folder_color_182431",
"value": "#182431"
},
{
"name": "folder_color_f86d05",
"value": "#f86d05"
},
{
"name": "folder_color_ffffff",
"value": "#ffffff"
},
{
"name": "folder_color_19ffffff",
"value": "#19ffffff"
},
{
"name": "folder_color_19182431",
"value": "#19182431"
},
{
"name": "notecontent_color_ffffff",
"value": "#ffffff"
},
{
"name": "notecontent_color_000000",
"value": "#000000"
},
{
"name": "folderlist_bgcolor_f1f3f5",
"value": "#f1f3f5"
},
{
"name": "notelist_bgcolor_f1f3f5",
"value": "#f1f3f5"
},
{
"name": "notelist_bgcolor_000000",
"value": "#000000"
}
]
}

View File

@ -0,0 +1,136 @@
{
"float": [
{
"name": "wh_value_1",
"value": "1"
},
{
"name": "wh_value_4",
"value": "4"
},
{
"name": "wh_value_5",
"value": "5"
},
{
"name": "wh_value_8",
"value": "8"
},
{
"name": "wh_value_10",
"value": "10"
},
{
"name": "wh_value_14",
"value": "14"
},
{
"name": "wh_value_16",
"value": "16"
},
{
"name": "wh_value_20",
"value": "20"
},
{
"name": "wh_value_24",
"value": "24"
},
{
"name": "wh_value_30",
"value": "30"
},
{
"name": "wh_value_40",
"value": "40"
},
{
"name": "wh_value_50",
"value": "50"
},
{
"name": "wh_value_60",
"value": "60"
},
{
"name": "wh_value_65",
"value": "65"
},
{
"name": "wh_value_70",
"value": "70"
},
{
"name": "wh_value_80",
"value": "80"
},
{
"name": "wh_value_100",
"value": "100"
},
{
"name": "wh_value_120",
"value": "120"
},
{
"name": "wh_value_130",
"value": "1300"
},
{
"name": "wh_value_160",
"value": "160"
},
{
"name": "wh_value_230",
"value": "230"
},
{
"name": "wh_value_280",
"value": "280"
},
{
"name": "wh_value_390",
"value": "390"
},
{
"name": "wh_value_400",
"value": "400"
},
{
"name": "font_35",
"value": "35"
},
{
"name": "font_15",
"value": "15"
},
{
"name": "font_20",
"value": "20"
},
{
"name": "font_25",
"value": "25"
},
{
"name": "font_28",
"value": "28"
},
{
"name": "font_50",
"value": "50"
},
{
"name": "control_common_font_size",
"value": "20"
},
{
"name": "slider_text_padding_left",
"value": "5"
},
{
"name": "volume_border_radius",
"value": "15"
}
]
}

View File

@ -0,0 +1,140 @@
{
"string": [
{
"name": "entry_MainAbility",
"value": "备忘录"
},
{
"name": "description_mainability",
"value": "ETS_Empty Ability"
},
{
"name": "note",
"value": "笔记"
},
{
"name": "allNotes",
"value": "全部笔记"
},
{
"name": "unClassified",
"value": "未分类"
},
{
"name": "recentDeletes",
"value": "最近删除"
},
{
"name": "myFavorites",
"value": "我的收藏"
},
{
"name": "create",
"value": "新建"
},
{
"name": "createFolder",
"value": "新建文件夹"
},
{
"name": "editFolder",
"value": "编辑文件夹"
},
{
"name": "deleteFolder",
"value": "删除文件夹"
},
{
"name": "createNote",
"value": "新建笔记"
},
{
"name": "cancel",
"value": "取消"
},
{
"name": "save",
"value": "保存"
},
{
"name": "delete",
"value": "删除"
},
{
"name": "name",
"value": "名称"
},
{
"name": "delete_tips",
"value": "是否删除此文件夹及其中的内容?"
},
{
"name": "deleteNote",
"value": "是否删除此笔记?"
},
{
"name": "deleteNoteComplete",
"value": "此笔记将被永久删除,无法恢复。是否删除?"
},
{
"name": "deleteAllNote",
"value": "是否删除全部笔记?"
},
{
"name": "deletePartNote",
"value": "是否删除%d条笔记"
},
{
"name": "selected",
"value": "已选择%d项"
},
{
"name": "none_selected",
"value": "未选择"
},
{
"name": "noteslist",
"value": "条笔记"
},
{
"name": "Empty_page",
"value": "没有笔记"
},
{
"name": "searchNote",
"value": "搜索笔记"
},
{
"name": "chooseFolder",
"value": "请选择文件夹"
},
{
"name": "category_already_exist",
"value": "文件夹名称已存在"
},
{
"name": "input_placeholder",
"value": "名称"
},
{
"name": "permanently_delete_tips",
"value": "笔记删除前会显示剩余天数最长30天之后将永久删除"
},
{
"name": "set_top",
"value": "置顶"
},
{
"name": "move",
"value": "移到"
},
{
"name": "recover",
"value": "恢复"
},
{
"name": "check_all",
"value": "多选"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -0,0 +1,20 @@
apply plugin: 'com.huawei.ohos.hap'
//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510
ohos {
compileSdkVersion 8
defaultConfig {
compatibleSdkVersion 8
}
buildTypes {
release {
proguardOpt {
proguardEnabled false
rulesFiles 'proguard-rules.pro'
}
}
}
}
dependencies {
}

1
product/phone/proguard-rules.pro vendored Normal file
View File

@ -0,0 +1 @@
# config module specific ProGuard rules here.

View File

@ -0,0 +1,72 @@
{
"app": {
"bundleName": "com.ohos.note",
"vendor": "ohos",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {},
"module": {
"package": "com.ohos.note",
"name": ".MyApplication",
"mainAbility": "com.ohos.note.MainAbility",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "phone",
"moduleType": "entry",
"installationFree": true
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"visible": true,
"name": "com.ohos.note.MainAbility",
"icon": "$media:note",
"description": "$string:description_mainability",
"label":"$string:entry_MainAbility",
"type": "page",
"launchType": "singleton",
"srcPath": "MainAbility",
"srcLanguage": "ets",
"metaData": {
"customizeData": [
{
"name": "hwc-theme"
}
]
}
}
],
"js": [
{
"mode": {
"syntax": "ets",
"type": "pageAbility"
},
"pages": [
"pages/MyNoteHome",
"pages/NoteHome"
],
"name": "MainAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}

View File

@ -0,0 +1,17 @@
import LogUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/LogUtil.ets'
const TAG = "NoteApp"
export default {
onCreate() {
LogUtil.info(TAG, "Application onCreate")
AppStorage.SetOrCreate('AllFolderArray', [])
AppStorage.SetOrCreate('AllNoteArray', [])
AppStorage.SetOrCreate('DBQueryFinished', 0)
LogUtil.info(TAG, "AppStorage SetOrCreate : AllFolderArray, AllNoteArray, DBQueryFinished")
},
onDestroy() {
LogUtil.info(TAG, 'Application onDestroy')
},
}

View File

@ -0,0 +1,69 @@
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import fileio from '@ohos.fileio'
import {NoteHomeComp} from './NoteHome.ets'
import {NoteHomePortraitComp} from './NoteHomePortrait.ets'
import LogUtil from '../../../../../../../common/utils/src/main/ets/default/baseUtil/LogUtil.ets'
import RdbStoreUtil from '../../../../../../../common/utils/src/main/ets/default/baseUtil/RdbStoreUtil.ets'
@Entry
@Component
export struct MyNoteHomeComp {
@StorageLink('DBQueryFinished') dBQueryFinished: number = 0
@Provide('PortraitModel') portraitModel:boolean = true
private context = getContext(this)
TAG = "MyNoteHomeComp"
build() {
Flex() {
if (this.dBQueryFinished == 1) {
if (this.portraitModel == true){
NoteHomePortraitComp()
} else {
NoteHomeComp()
}
}
}
.width('100%').height('100%')
}
aboutToAppear(): void{
LogUtil.info(this.TAG, "aboutToAppear")
if (this.context == undefined || this.context == null) {
LogUtil.error(this.TAG, "context is error")
return
}
LogUtil.info(this.TAG, "databaseDir is " + this.context.databaseDir)
// /data/storage/el2/database/tablet
let dbPath = "/data/app/el2/100/database/com.ohos.note/phone/db/note.db"
try {
if (fileio.accessSync(dbPath) == undefined) {
LogUtil.info(this.TAG, "db has created")
RdbStoreUtil.initAppStorage(this.context)
}
} catch (err) {
LogUtil.info(this.TAG, "db has not created, start to create db")
RdbStoreUtil.createRdbStore(this.context)
}
}
aboutToDisappear(): void{
LogUtil.info(this.TAG, "aboutToDisappear")
}
}

View File

@ -0,0 +1,111 @@
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {FolderListComp} from '../../../../../../../common/component/src/main/ets/default/FolderListComp.ets'
import {NoteListComp} from '../../../../../../../common/component/src/main/ets/default/NoteListComp.ets'
import {NoteContentComp} from '../../../../../../../common/component/src/main/ets/default/NoteContentComp'
import StyleConstants from '../../../../../../../common/utils/src/main/ets/default/constants/StyleConstants.ets'
import LogUtil from '../../../../../../../common/utils/src/main/ets/default/baseUtil/LogUtil.ets'
import {circleColorArray} from '../../../../../../../common/utils/src/main/ets/default/model/NoteBaseData.ets'
import FolderData from '../../../../../../../common/utils/src/main/ets/default/model/databaseModel/FolderData.ets'
import NoteData from '../../../../../../../common/utils/src/main/ets/default/model/databaseModel/NoteData.ets'
import {SysDefFolderUuid} from '../../../../../../../common/utils/src/main/ets/default/model/databaseModel/EnumData.ets'
import LayoutUtil from '../../../../../../../common/utils/src/main/ets/default/baseUtil/LayoutUtil.ets'
import NoteUtil from '../../../../../../../common/utils/src/main/ets/default/baseUtil/NoteUtil.ets'
@Entry
@Component
export struct NoteHomeComp {
@Provide('RefreshFlag') refreshFlag: number = 0
@StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray')
@StorageLink('AllFolderArray') AllFolderArray: FolderData[] = AppStorage.Link('AllFolderArray')
@StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = []
// 当前文件夹、笔记、分栏
@Provide('SelectedFolderData') selectedFolderData: FolderData = AppStorage.Get('Folder')
@Provide('SelectedNoteData') selectedNoteData: NoteData = AppStorage.Get('Note')
@Provide('SectionStatus') sectionStatus: number = AppStorage.Get('Section');
@Provide('SelectedColor') selectedColor: string = circleColorArray[0];
@Provide('Longpress') longpress: boolean = false // 第二栏长按状态
@Provide('ExpandStatus') expandStatus: boolean = false // 笔记本折叠展开状态
@Provide('ChooseNote') chooseNote: boolean = true // 是否选择笔记进行打开
@Provide('Search') search: boolean = false // 是否处于搜索状态
@Provide('SearchResultList') searchResultList: NoteData[] = [] // 搜索得到的笔记列表
@Provide('InputKeyword') inputKeyword: string = '' // 搜索的字串
TAG = "NoteHomeComp"
build() {
Flex({ justifyContent: FlexAlign.Start }) {
// Folder list display area
Flex({ direction: FlexDirection.Column, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.Center }) {
FolderListComp()
}
.flexShrink(0)
.backgroundColor($r("app.color.folderlist_bgcolor_f1f3f5"))
.width(LayoutUtil.getWidthWeightMessage(this.sectionStatus).folderListWeight)
.height(StyleConstants.PERCENTAGE_100)
.visibility(
LayoutUtil.getWidthWeightMessage(this.sectionStatus)
.folderListVisibility == 0 ? Visibility.None : Visibility.Visible)
.opacity(this.search ? StyleConstants.OPACITY_40 : StyleConstants.OPACITY_100)
.enabled(this.search ? false : true)
Divider()
.vertical(true)
.strokeWidth(1)
.color($r("app.color.divider_color_182431"))
.height("100%")
.opacity(StyleConstants.OPACITY_10)
// Note list display area
Flex({ direction: FlexDirection.Column, wrap: FlexWrap.Wrap, justifyContent: FlexAlign.Start }) {
NoteListComp()
}
.flexShrink(0)
.backgroundColor($r("app.color.notelist_bgcolor_f1f3f5"))
.width(LayoutUtil.getWidthWeightMessage(this.sectionStatus).noteListWeight)
.height(StyleConstants.PERCENTAGE_100)
.visibility(
LayoutUtil.getWidthWeightMessage(this.sectionStatus)
.noteListVisibility == 0 ? Visibility.None : Visibility.Visible);
Divider()
.vertical(true)
.strokeWidth(1)
.color($r("app.color.divider_color_182431"))
.height("100%")
.opacity(StyleConstants.OPACITY_10)
// Note content display area
Flex({ direction: FlexDirection.Column, wrap: FlexWrap.Wrap, justifyContent: FlexAlign.Start }) {
NoteContentComp()
}
.flexShrink(0)
.backgroundColor(this.search && this.inputKeyword.length == 0 ? $r("app.color.notecontent_color_000000") : $r("app.color.notecontent_color_ffffff"))
.width(LayoutUtil.getWidthWeightMessage(this.sectionStatus).noteCotentWeight)
.height(StyleConstants.PERCENTAGE_100)
.opacity(this.longpress ? StyleConstants.OPACITY_40 : this.search && this.inputKeyword.length == 0 ? StyleConstants.OPACITY_20 : StyleConstants.OPACITY_100)
.enabled(this.longpress || this.search && this.inputKeyword.length == 0 ? false : true)
}
.width(StyleConstants.PERCENTAGE_100).height(StyleConstants.PERCENTAGE_100)
}
aboutToAppear(): void{
LogUtil.info(this.TAG, "aboutToAppear")
}
aboutToDisappear(): void{
LogUtil.info(this.TAG, "aboutToDisappear")
}
}

View File

@ -0,0 +1,88 @@
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {FolderListComp} from '../../../../../../../common/component/src/main/ets/default/FolderListComp.ets'
import {NoteListComp} from '../../../../../../../common/component/src/main/ets/default/NoteListComp.ets'
import {NoteContentComp} from '../../../../../../../common/component/src/main/ets/default/NoteContentComp'
import StyleConstants from '../../../../../../../common/utils/src/main/ets/default/constants/StyleConstants.ets'
import LogUtil from '../../../../../../../common/utils/src/main/ets/default/baseUtil/LogUtil.ets'
import {circleColorArray} from '../../../../../../../common/utils/src/main/ets/default/model/NoteBaseData.ets'
import FolderData from '../../../../../../../common/utils/src/main/ets/default/model/databaseModel/FolderData.ets'
import NoteData from '../../../../../../../common/utils/src/main/ets/default/model/databaseModel/NoteData.ets'
@Entry
@Component
export struct NoteHomePortraitComp {
@Provide('RefreshFlag') refreshFlag: number = 0
@StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray')
@StorageLink('AllFolderArray') AllFolderArray: FolderData[] = AppStorage.Link('AllFolderArray')
@StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = []
// 当前文件夹、笔记、分栏
@Provide('SelectedFolderData') selectedFolderData: FolderData = AppStorage.Get('Folder')
@Provide('SelectedNoteData') selectedNoteData: NoteData = AppStorage.Get('Note')
@Provide('SectionStatus') sectionStatus: number = AppStorage.Get('Section');
@Provide('SelectedColor') selectedColor: string = circleColorArray[0];
@Provide('Longpress') longpress: boolean = false // 第二栏长按状态
@Provide('ExpandStatus') expandStatus: boolean = false // 笔记本折叠展开状态
@Provide('ChooseNote') chooseNote: boolean = false // 是否选择笔记进行打开
@Provide('Search') search: boolean = false // 是否处于搜索状态
@Provide('SearchResultList') searchResultList: NoteData[] = [] // 搜索得到的笔记列表
@Provide('InputKeyword') inputKeyword: string = '' // 搜索的字串
TAG = "NoteHomeComp"
build() {
Stack({ alignContent: Alignment.Start }) {
// Note list display area
Flex({ direction: FlexDirection.Column, wrap: FlexWrap.Wrap, justifyContent: FlexAlign.Start }) {
NoteListComp()
}
.width(StyleConstants.PERCENTAGE_100)
.height(StyleConstants.PERCENTAGE_100)
.enabled(this.expandStatus ? false : true)
//Folder list display area
Flex({ direction: FlexDirection.Column, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.Center }) {
FolderListComp()
}
.backgroundColor($r("app.color.folderlist_bgcolor_f1f3f5"))
.width(StyleConstants.PERCENTAGE_60)
.height(StyleConstants.PERCENTAGE_100)
.visibility(this.expandStatus == false ? Visibility.None:Visibility.Visible)
// Note content display area
Flex({ direction: FlexDirection.Column, wrap: FlexWrap.Wrap, justifyContent: FlexAlign.Start }) {
NoteContentComp()
}
.backgroundColor($r("app.color.notecontent_color_ffffff"))
.width(StyleConstants.PERCENTAGE_100)
.height(StyleConstants.PERCENTAGE_100)
.visibility(this.chooseNote == false ? Visibility.None:Visibility.Visible)
}
.width(StyleConstants.PERCENTAGE_100).height(StyleConstants.PERCENTAGE_100)
}
aboutToAppear(): void{
LogUtil.info(this.TAG, "aboutToAppear")
}
aboutToDisappear(): void{
LogUtil.info(this.TAG, "aboutToDisappear")
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 KiB

View File

@ -0,0 +1,92 @@
{
"color": [
{
"name": "color_ffffff",
"value": "#ffffff"
},
{
"name": "color_fffffB",
"value": "#FFFBFBFB"
},
{
"name": "delete_color_fa2a2d",
"value": "#fa2a2d"
},
{
"name": "cancel_color_4fb4e3",
"value": "#4fb4e3"
},
{
"name": "divider_color_e4e4e4",
"value": "#cce4e4e4"
},
{
"name": "divider_color_182431",
"value": "#182431"
},
{
"name": "button_color_419fff",
"value": "#419fff"
},
{
"name": "button_color_fb4447",
"value": "#fb4447"
},
{
"name": "text_color_3f97e9",
"value": "#3f97e9"
},
{
"name": "text_color_f86d05",
"value": "#f86d05"
},
{
"name": "folder_color_182431",
"value": "#182431"
},
{
"name": "folder_color_f86d05",
"value": "#f86d05"
},
{
"name": "folder_color_ffffff",
"value": "#ffffff"
},
{
"name": "folder_color_19ffffff",
"value": "#19ffffff"
},
{
"name": "folder_color_19182431",
"value": "#19182431"
},
{
"name": "notecontent_color_ffffff",
"value": "#ffffff"
},
{
"name": "notecontent_color_000000",
"value": "#000000"
},
{
"name": "folderlist_bgcolor_f1f3f5",
"value": "#f1f3f5"
},
{
"name": "notelist_bgcolor_f1f3f5",
"value": "#f1f3f5"
},
{
"name": "notelist_bgcolor_000000",
"value": "#000000"
},
{
"name": "image_bordercolor_19182431",
"value": "#19182431"
},
{
"name": "button_color_f86d05",
"value": "#f86d05"
}
]
}

View File

@ -0,0 +1,136 @@
{
"float": [
{
"name": "wh_value_1",
"value": "1"
},
{
"name": "wh_value_4",
"value": "4"
},
{
"name": "wh_value_5",
"value": "5"
},
{
"name": "wh_value_8",
"value": "8"
},
{
"name": "wh_value_10",
"value": "10"
},
{
"name": "wh_value_14",
"value": "14"
},
{
"name": "wh_value_16",
"value": "16"
},
{
"name": "wh_value_20",
"value": "20"
},
{
"name": "wh_value_24",
"value": "24"
},
{
"name": "wh_value_30",
"value": "30"
},
{
"name": "wh_value_40",
"value": "40"
},
{
"name": "wh_value_50",
"value": "50"
},
{
"name": "wh_value_60",
"value": "60"
},
{
"name": "wh_value_65",
"value": "65"
},
{
"name": "wh_value_70",
"value": "70"
},
{
"name": "wh_value_80",
"value": "80"
},
{
"name": "wh_value_100",
"value": "100"
},
{
"name": "wh_value_120",
"value": "120"
},
{
"name": "wh_value_130",
"value": "1300"
},
{
"name": "wh_value_160",
"value": "160"
},
{
"name": "wh_value_230",
"value": "230"
},
{
"name": "wh_value_280",
"value": "280"
},
{
"name": "wh_value_390",
"value": "390"
},
{
"name": "wh_value_400",
"value": "400"
},
{
"name": "font_35",
"value": "35"
},
{
"name": "font_15",
"value": "15"
},
{
"name": "font_20",
"value": "20"
},
{
"name": "font_25",
"value": "25"
},
{
"name": "font_28",
"value": "28"
},
{
"name": "font_50",
"value": "50"
},
{
"name": "control_common_font_size",
"value": "20"
},
{
"name": "slider_text_padding_left",
"value": "5"
},
{
"name": "volume_border_radius",
"value": "15"
}
]
}

View File

@ -0,0 +1,144 @@
{
"string": [
{
"name": "entry_MainAbility",
"value": "备忘录"
},
{
"name": "description_mainability",
"value": "ETS_Empty Ability"
},
{
"name": "note",
"value": "笔记"
},
{
"name": "allNotes",
"value": "全部笔记"
},
{
"name": "unClassified",
"value": "未分类"
},
{
"name": "recentDeletes",
"value": "最近删除"
},
{
"name": "myFavorites",
"value": "我的收藏"
},
{
"name": "create",
"value": "新建"
},
{
"name": "createFolder",
"value": "新建文件夹"
},
{
"name": "editFolder",
"value": "编辑文件夹"
},
{
"name": "deleteFolder",
"value": "删除文件夹"
},
{
"name": "createNote",
"value": "新建笔记"
},
{
"name": "cancel",
"value": "取消"
},
{
"name": "save",
"value": "保存"
},
{
"name": "delete",
"value": "删除"
},
{
"name": "name",
"value": "名称"
},
{
"name": "delete_tips",
"value": "是否删除此文件夹及其中的内容?"
},
{
"name": "deleteNote",
"value": "是否删除此笔记?"
},
{
"name": "deleteNoteComplete",
"value": "此笔记将被永久删除,无法恢复。是否删除?"
},
{
"name": "deleteAllNote",
"value": "是否删除全部笔记?"
},
{
"name": "deletePartNote",
"value": "是否删除%d条笔记"
},
{
"name": "selected",
"value": "已选择%d项"
},
{
"name": "none_selected",
"value": "未选择"
},
{
"name": "noteslist",
"value": "条笔记"
},
{
"name": "Empty_page",
"value": "没有笔记"
},
{
"name": "searchNote",
"value": "搜索笔记"
},
{
"name": "chooseFolder",
"value": "请选择文件夹"
},
{
"name": "category_already_exist",
"value": "文件夹名称已存在"
},
{
"name": "input_placeholder",
"value": "名称"
},
{
"name": "permanently_delete_tips",
"value": "笔记删除前会显示剩余天数最长30天之后将永久删除"
},
{
"name": "set_top",
"value": "置顶"
},
{
"name": "move",
"value": "移到"
},
{
"name": "recover",
"value": "恢复"
},
{
"name": "check_all",
"value": "多选"
},
{
"name": "editNoteTitle",
"value": "修改标题"
}
]
}

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1,.cls-2{fill:none;stroke:#000;stroke-linecap:round;stroke-width:2.5px;}.cls-1{stroke-miterlimit:10;}.cls-2{stroke-linejoin:round;}</style></defs><title>文本粗细</title><path class="cls-1" d="M7.0625,4h5.625a3.625,3.625,0,0,1,0,7.25H7.0625"/><path class="cls-1" d="M7.0625,11.25h5.625a4.375,4.375,0,0,1,0,8.75H7.0625"/><line class="cls-2" x1="6.9375" y1="4" x2="6.9375" y2="20"/></svg>

After

Width:  |  Height:  |  Size: 502 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1{fill-rule:evenodd;}</style></defs><title>加-细</title><path class="cls-1" d="M21.25,11.25a.75.75,0,0,1,0,1.5h-7.5v-1.5Zm-8.5,10a.75.75,0,0,1-1.5,0v-8.5H2.75a.75.75,0,0,1,0-1.5h8.5V2.75a.75.75,0,0,1,1.5,0Z"/></svg>

After

Width:  |  Height:  |  Size: 330 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>笔记</title><path fill="#182431" d="M16.5,6.25a.75.75,0,0,1,0,1.5h-9a.75.75,0,0,1,0-1.5Zm0,5a.75.75,0,0,1,0,1.5h-9a.75.75,0,0,1,0-1.5Zm-4.5,5a.75.75,0,0,1,0,1.5H7.5a.75.75,0,0,1,0-1.5ZM16.07534,2.50071l-8.0508-.00053-.20148.00148A4.06394,4.06394,0,0,0,5.75371,2.857a2.135,2.135,0,0,0-.89672.89672A4.5924,4.5924,0,0,0,4.5,6.12777l.00017,11.84769.00149.20148A4.06394,4.06394,0,0,0,4.857,20.24629a2.135,2.135,0,0,0,.89672.89672,4.23561,4.23561,0,0,0,2.171.35628L8.12777,21.5h7.74446a4.5924,4.5924,0,0,0,2.37406-.357,2.135,2.135,0,0,0,.89672-.89672,4.23561,4.23561,0,0,0,.35628-2.17095L19.5,17.87223V6.12777a4.5924,4.5924,0,0,0-.357-2.37406,2.135,2.135,0,0,0-.89672-.89672A4.23561,4.23561,0,0,0,16.07534,2.50071ZM15.87223,1a5.88441,5.88441,0,0,1,3.03985.51223l.04161.022a3.63031,3.63031,0,0,1,1.46114,1.41987l.0509.09217A5.79955,5.79955,0,0,1,21,6.12777V17.87223l-.001.22154a5.55551,5.55551,0,0,1-.51122,2.81831l-.022.04161a3.63031,3.63031,0,0,1-1.41987,1.46114l-.09217.0509A5.79955,5.79955,0,0,1,15.87223,23H8.12777l-.22154-.001a5.55537,5.55537,0,0,1-2.81831-.51123l-.04161-.022a3.63037,3.63037,0,0,1-1.46114-1.41987l-.0509-.09217A5.79955,5.79955,0,0,1,3,17.87223V6.12777a5.8843,5.8843,0,0,1,.51223-3.03985l.022-.04161A3.63037,3.63037,0,0,1,4.95414,1.58517l.09217-.0509A5.79955,5.79955,0,0,1,8.12777,1Z"/></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>back</title><path d="M11.35355,3.21967a.75.75,0,0,1,.03374,1.02466l-.03374.036L4.38372,11.25h16.6895a.75.75,0,0,1,.74873.70593L21.82322,12a.75.75,0,0,1-.70593.74873l-.04407.00127H3.17678a1,1,0,0,1-.74486-1.66726l.03775-.03985,7.82322-7.82322A.75.75,0,0,1,11.35355,3.21967ZM5.384,13.75l5.96953,5.9697.03374.036a.75.75,0,0,1-1.0584,1.0584l-.036-.03374L3.26252,13.75Z"/></svg>

After

Width:  |  Height:  |  Size: 475 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>back</title><path d="M11.35355,3.21967a.75.75,0,0,1,.03374,1.02466l-.03374.036L4.38372,11.25h16.6895a.75.75,0,0,1,.74873.70593L21.82322,12a.75.75,0,0,1-.70593.74873l-.04407.00127H3.17678a1,1,0,0,1-.74486-1.66726l.03775-.03985,7.82322-7.82322A.75.75,0,0,1,11.35355,3.21967ZM5.384,13.75l5.96953,5.9697.03374.036a.75.75,0,0,1-1.0584,1.0584l-.036-.03374L3.26252,13.75Z"/></svg>

After

Width:  |  Height:  |  Size: 475 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>相机</title><path d="M12,9.5a3.25,3.25,0,1,0,3.25,3.25A3.25,3.25,0,0,0,12,9.5ZM12,8a4.75,4.75,0,1,1-4.75,4.75A4.75,4.75,0,0,1,12,8Zm3.1206-3.25H8.8794a.5.5,0,0,0-.41068.2148L6.88177,7.25H4a1.5,1.5,0,0,0-1.5,1.5v9A1.5,1.5,0,0,0,4,19.25H20a1.5,1.5,0,0,0,1.5-1.5v-9A1.5,1.5,0,0,0,20,7.25H17.11823L15.53128,4.9648A.5.5,0,0,0,15.1206,4.75Zm0-1.5a2,2,0,0,1,1.64274.85921L17.90278,5.75H20a3,3,0,0,1,3,3v9a3,3,0,0,1-3,3H4a3,3,0,0,1-3-3v-9a3,3,0,0,1,3-3H6.09722L7.23666,4.10921A2,2,0,0,1,8.8794,3.25Z"/></svg>

After

Width:  |  Height:  |  Size: 604 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1{fill-rule:evenodd;}</style></defs><title>全选</title><path class="cls-1" d="M15.80833,10.255a.75.75,0,0,1,.03026,1.0286l-.03026.03206-5.19975,5.19975a1.75,1.75,0,0,1-2.43161.04182l-.04326-.04182L5.684,14.06569a.75.75,0,0,1,1.0286-1.09092l.03206.03026,2.09619,2.09619a.75.75,0,0,0,1.0286.03026l.03206-.03026,4.8462-4.84619A.75.75,0,0,1,15.80833,10.255ZM15.59029,2c2.22879,0,3.037.23206,3.85182.66783a4.54323,4.54323,0,0,1,1.89006,1.89006C21.76794,5.3727,22,6.18092,22,8.40971v5.96252a5.79955,5.79955,0,0,1-.53427,3.08146,3.63532,3.63532,0,0,1-.97081,1.16035c.0032-.14453.00508-.29743.00508-.45987V8.34583a5.34107,5.34107,0,0,0-.51889-2.7827,3.72583,3.72583,0,0,0-1.54424-1.54424,4.993,4.993,0,0,0-2.51749-.51707L5.84583,3.5c-.16272,0-.31588.00189-.46066.00585a3.63917,3.63917,0,0,1,1.16114-.97158A5.79955,5.79955,0,0,1,9.62777,2ZM6.4868,6a3.86181,3.86181,0,0,0-1.98888.2902,1.68085,1.68085,0,0,0-.70772.70772l-.07856.1619A4.031,4.031,0,0,0,3.501,8.75809L3.5,17.5132a3.86181,3.86181,0,0,0,.2902,1.98888,1.68085,1.68085,0,0,0,.70772.70772l.1619.07856a4.03093,4.03093,0,0,0,1.59826.21061l.22872.001h8.5264l.43743-.00418a3.102,3.102,0,0,0,1.55145-.286,1.68085,1.68085,0,0,0,.70772-.70772l.07856-.1619a4.03074,4.03074,0,0,0,.21061-1.59826L18,17.5132V8.9868l-.00418-.43743a3.102,3.102,0,0,0-.286-1.55145,1.68085,1.68085,0,0,0-.70772-.70772l-.1619-.07856A4.03077,4.03077,0,0,0,15.24191,6.001Zm8.5264-1.5a5.07467,5.07467,0,0,1,2.69628.46748,3.18031,3.18031,0,0,1,1.323,1.323l.1017.20274A5.57961,5.57961,0,0,1,19.5,8.9868v8.5264a5.07467,5.07467,0,0,1-.46748,2.69628,3.18031,3.18031,0,0,1-1.323,1.323l-.20274.1017A5.57961,5.57961,0,0,1,15.0132,22H6.4868a5.07477,5.07477,0,0,1-2.69628-.46748,3.18031,3.18031,0,0,1-1.323-1.323l-.1017-.20274A5.57961,5.57961,0,0,1,2,17.5132V8.9868a5.07477,5.07477,0,0,1,.46748-2.69628,3.18031,3.18031,0,0,1,1.323-1.323l.20274-.1017a5.12058,5.12058,0,0,1,2.22834-.3641Z"/></svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,13 @@
<svg id="图层_1"
data-name="图层 1"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24">
<defs>
<style>.cls-1{fill:#f86d05;fill-rule:evenodd;}
</style>
</defs>
<title>全选</title>
<path
class="cls-1"
d="M15.80833,10.255a.75.75,0,0,1,.03026,1.0286l-.03026.03206-5.19975,5.19975a1.75,1.75,0,0,1-2.43161.04182l-.04326-.04182L5.684,14.06569a.75.75,0,0,1,1.0286-1.09092l.03206.03026,2.09619,2.09619a.75.75,0,0,0,1.0286.03026l.03206-.03026,4.8462-4.84619A.75.75,0,0,1,15.80833,10.255ZM15.59029,2c2.22879,0,3.037.23206,3.85182.66783a4.54323,4.54323,0,0,1,1.89006,1.89006C21.76794,5.3727,22,6.18092,22,8.40971v5.96252a5.79955,5.79955,0,0,1-.53427,3.08146,3.63532,3.63532,0,0,1-.97081,1.16035c.0032-.14453.00508-.29743.00508-.45987V8.34583a5.34107,5.34107,0,0,0-.51889-2.7827,3.72583,3.72583,0,0,0-1.54424-1.54424,4.993,4.993,0,0,0-2.51749-.51707L5.84583,3.5c-.16272,0-.31588.00189-.46066.00585a3.63917,3.63917,0,0,1,1.16114-.97158A5.79955,5.79955,0,0,1,9.62777,2ZM6.4868,6a3.86181,3.86181,0,0,0-1.98888.2902,1.68085,1.68085,0,0,0-.70772.70772l-.07856.1619A4.031,4.031,0,0,0,3.501,8.75809L3.5,17.5132a3.86181,3.86181,0,0,0,.2902,1.98888,1.68085,1.68085,0,0,0,.70772.70772l.1619.07856a4.03093,4.03093,0,0,0,1.59826.21061l.22872.001h8.5264l.43743-.00418a3.102,3.102,0,0,0,1.55145-.286,1.68085,1.68085,0,0,0,.70772-.70772l.07856-.1619a4.03074,4.03074,0,0,0,.21061-1.59826L18,17.5132V8.9868l-.00418-.43743a3.102,3.102,0,0,0-.286-1.55145,1.68085,1.68085,0,0,0-.70772-.70772l-.1619-.07856A4.03077,4.03077,0,0,0,15.24191,6.001Zm8.5264-1.5a5.07467,5.07467,0,0,1,2.69628.46748,3.18031,3.18031,0,0,1,1.323,1.323l.1017.20274A5.57961,5.57961,0,0,1,19.5,8.9868v8.5264a5.07467,5.07467,0,0,1-.46748,2.69628,3.18031,3.18031,0,0,1-1.323,1.323l-.20274.1017A5.57961,5.57961,0,0,1,15.0132,22H6.4868a5.07477,5.07477,0,0,1-2.69628-.46748,3.18031,3.18031,0,0,1-1.323-1.323l-.1017-.20274A5.57961,5.57961,0,0,1,2,17.5132V8.9868a5.07477,5.07477,0,0,1,.46748-2.69628,3.18031,3.18031,0,0,1,1.323-1.323l.20274-.1017a5.12058,5.12058,0,0,1,2.22834-.3641Z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
<style type="text/css">
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#f86d05;}
.st1{filter:url(#filter-2);}
.st2{fill-rule:evenodd;clip-rule:evenodd;}
.st3{fill:none;stroke:#000000;stroke-opacity:5.000000e-02;}
.st4{fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;}
</style>
<filter filterUnits="objectBoundingBox" height="153.3%" id="filter-2" width="185.7%" x="-28.6%" y="-17.8%">
<feMorphology in="SourceAlpha" operator="dilate" radius="1" result="shadowSpreadOuter1"></feMorphology>
<feOffset dx="1" dy="1" in="shadowSpreadOuter1" result="shadowOffsetOuter1"></feOffset>
<feMorphology in="SourceAlpha" operator="erode" radius="1" result="shadowInner"></feMorphology>
<feOffset dx="1" dy="1" in="shadowInner" result="shadowInner"></feOffset>
<feComposite in="shadowOffsetOuter1" in2="shadowInner" operator="out" result="shadowOffsetOuter1"></feComposite>
<feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1" stdDeviation="0.5"></feGaussianBlur>
<feColorMatrix in="shadowBlurOuter1" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"></feColorMatrix>
</filter>
<title>选中后</title>
<g id="编组" transform="translate(2.000000, 2.000000)">
<path id="Rectangle-2375-Copy" class="st0" d="M0,4c0-2.2,1.8-4,4-4h12c2.2,0,4,1.8,4,4v12c0,2.2-1.8,4-4,4H4c-2.2,0-4-1.8-4-4V4z"
/>
<g id="Rectangle-62" transform="translate(9.895979, 8.500859) rotate(43.000000) translate(-9.895979, -8.500859) ">
<g class="st1">
<path id="path-1_1_" class="st2" d="M7.4,14.1c-0.6,0-1-0.4-1-1c0-0.6,0.4-1,1-1l4,0l0-8.3c0-0.5,0.4-0.9,0.9-1l0.1,0
c0.6,0,1,0.5,1,1l0,9.2l0,0c0,0.4-0.3,0.8-0.7,0.9l-0.1,0c0,0-0.1,0-0.1,0l-0.1,0L7.4,14.1z"/>
</g>
<path class="st3" d="M12.2,2.4c0.5,0,0.9,0.2,1.2,0.4c0.3,0.3,0.5,0.7,0.5,1.1l0,0l0,9.2c0,0.3-0.1,0.6-0.3,0.9
c-0.2,0.3-0.5,0.5-0.8,0.6l0,0l-5.4,0.1c-0.4,0-0.8-0.2-1.1-0.4c-0.3-0.3-0.4-0.6-0.4-1.1c0-0.4,0.2-0.8,0.4-1.1
c0.3-0.3,0.6-0.4,1.1-0.4l0,0l3.5,0l0-7.8c0-0.4,0.1-0.7,0.4-1C11.5,2.6,11.8,2.4,12.2,2.4z"/>
</g>
<path class="st4" d="M4.2,10.9c-0.4-0.4-0.4-1-0.1-1.4c0.4-0.4,1-0.4,1.4,0l2.9,2.7l5.6-6c0.3-0.4,0.9-0.4,1.3-0.1l0.1,0.1
c0.4,0.4,0.4,1,0.1,1.4l-6.3,6.8l0,0c-0.3,0.3-0.7,0.4-1.1,0.2l-0.1-0.1c0,0-0.1,0-0.1-0.1l-0.1-0.1L4.2,10.9z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1{fill-rule:evenodd;}</style></defs><title>全选</title><path class="cls-1" d="M15.80833,10.255a.75.75,0,0,1,.03026,1.0286l-.03026.03206-5.19975,5.19975a1.75,1.75,0,0,1-2.43161.04182l-.04326-.04182L5.684,14.06569a.75.75,0,0,1,1.0286-1.09092l.03206.03026,2.09619,2.09619a.75.75,0,0,0,1.0286.03026l.03206-.03026,4.8462-4.84619A.75.75,0,0,1,15.80833,10.255ZM15.59029,2c2.22879,0,3.037.23206,3.85182.66783a4.54323,4.54323,0,0,1,1.89006,1.89006C21.76794,5.3727,22,6.18092,22,8.40971v5.96252a5.79955,5.79955,0,0,1-.53427,3.08146,3.63532,3.63532,0,0,1-.97081,1.16035c.0032-.14453.00508-.29743.00508-.45987V8.34583a5.34107,5.34107,0,0,0-.51889-2.7827,3.72583,3.72583,0,0,0-1.54424-1.54424,4.993,4.993,0,0,0-2.51749-.51707L5.84583,3.5c-.16272,0-.31588.00189-.46066.00585a3.63917,3.63917,0,0,1,1.16114-.97158A5.79955,5.79955,0,0,1,9.62777,2ZM6.4868,6a3.86181,3.86181,0,0,0-1.98888.2902,1.68085,1.68085,0,0,0-.70772.70772l-.07856.1619A4.031,4.031,0,0,0,3.501,8.75809L3.5,17.5132a3.86181,3.86181,0,0,0,.2902,1.98888,1.68085,1.68085,0,0,0,.70772.70772l.1619.07856a4.03093,4.03093,0,0,0,1.59826.21061l.22872.001h8.5264l.43743-.00418a3.102,3.102,0,0,0,1.55145-.286,1.68085,1.68085,0,0,0,.70772-.70772l.07856-.1619a4.03074,4.03074,0,0,0,.21061-1.59826L18,17.5132V8.9868l-.00418-.43743a3.102,3.102,0,0,0-.286-1.55145,1.68085,1.68085,0,0,0-.70772-.70772l-.1619-.07856A4.03077,4.03077,0,0,0,15.24191,6.001Zm8.5264-1.5a5.07467,5.07467,0,0,1,2.69628.46748,3.18031,3.18031,0,0,1,1.323,1.323l.1017.20274A5.57961,5.57961,0,0,1,19.5,8.9868v8.5264a5.07467,5.07467,0,0,1-.46748,2.69628,3.18031,3.18031,0,0,1-1.323,1.323l-.20274.1017A5.57961,5.57961,0,0,1,15.0132,22H6.4868a5.07477,5.07477,0,0,1-2.69628-.46748,3.18031,3.18031,0,0,1-1.323-1.323l-.1017-.20274A5.57961,5.57961,0,0,1,2,17.5132V8.9868a5.07477,5.07477,0,0,1,.46748-2.69628,3.18031,3.18031,0,0,1,1.323-1.323l.20274-.1017a5.12058,5.12058,0,0,1,2.22834-.3641Z"/></svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><defs><style>.cls-1{fill:none;}</style></defs><title>文本扫描 对勾</title><path d="M20,40A20,20,0,1,1,40,20,20,20,0,0,1,20,40Zm0-1A19,19,0,1,0,1,20,19,19,0,0,0,20,39Z"/><circle class="cls-1" cx="20" cy="20" r="19"/><path d="M16.99349,24.34229l12.2994-12.2994a1,1,0,0,1,1.41422,1.41422L17.7006,26.46361a1,1,0,0,1-1.41421,0l-6.9935-6.99349a1,1,0,0,1,1.41422-1.41422Z"/></svg>

After

Width:  |  Height:  |  Size: 474 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><defs><style>.cls-1{fill:#fff;}</style></defs><title>文档扫描</title><path d="M20,40A20,20,0,1,1,40,20,20,20,0,0,1,20,40Zm0-1A19,19,0,1,0,1,20,19,19,0,0,0,20,39Z"/><circle class="cls-1" cx="20" cy="20" r="19"/><path d="M16.99349,24.34229l12.2994-12.2994a1,1,0,0,1,1.41422,1.41422L17.7006,26.46361a1,1,0,0,1-1.41421,0l-6.9935-6.99349a1,1,0,0,1,1.41422-1.41422Z"/></svg>

After

Width:  |  Height:  |  Size: 467 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>叉-粗</title><path d="M19.77817,18.364A1,1,0,0,1,18.364,19.77817l-5.65685-5.65685,1.41421-1.41421ZM5.636,19.77817A1,1,0,0,1,4.22183,18.364L10.58579,12l-6.364-6.364A1,1,0,0,1,5.636,4.22183L12,10.58579l6.364-6.364A1,1,0,0,1,19.77817,5.636Z"/></svg>

After

Width:  |  Height:  |  Size: 350 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>叉-粗</title><path d="M19.77817,18.364A1,1,0,0,1,18.364,19.77817l-5.65685-5.65685,1.41421-1.41421ZM5.636,19.77817A1,1,0,0,1,4.22183,18.364L10.58579,12l-6.364-6.364A1,1,0,0,1,5.636,4.22183L12,10.58579l6.364-6.364A1,1,0,0,1,19.77817,5.636Z"/></svg>

After

Width:  |  Height:  |  Size: 350 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1{fill-rule:evenodd;}</style></defs><title>叉-细</title><path class="cls-1" d="M19.77817,18.71751a.75.75,0,0,1-1.06066,1.06066l-6.01023-6.01058,1.06049-1.06048Zm0-14.49568a.75.75,0,0,1,0,1.06066L5.28249,19.77817a.75.75,0,0,1-1.06066-1.06066l6.71769-6.718-6.71769-6.717A.75.75,0,0,1,5.28249,4.22183L12,10.939l6.71751-6.71716A.75.75,0,0,1,19.77817,4.22183Z"/></svg>

After

Width:  |  Height:  |  Size: 478 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>cycle-细</title><path d="M17,3.95711a.5.5,0,0,1,.35355.14644l2.2929,2.2929a.5.5,0,0,1-.35356.85355H6.86981A4.36217,4.36217,0,0,0,2.5,11.60438,4.318,4.318,0,0,0,3.26982,14.073.75.75,0,0,1,2.0366,14.927,5.85174,5.85174,0,0,1,6.86981,5.75L16.5,5.74911v-1.292A.5.5,0,0,1,17,3.95711ZM17.12985,16.75a4.352,4.352,0,0,0,3.60046-6.82316.75.75,0,0,1,1.23339-.85368A5.852,5.852,0,0,1,17.12985,18.25L7.5,18.24911v1.29378a.5.5,0,0,1-.85355.35356l-2.2929-2.2929A.5.5,0,0,1,4.70711,16.75Z"/></svg>

After

Width:  |  Height:  |  Size: 585 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>删除</title><path d="M12.125,1.875a3.25,3.25,0,0,1,3.24911,3.17329L15.375,5.125h5.75a.75.75,0,0,1,.04407,1.49873L21.125,6.625h-6.5a.75.75,0,0,1-.74873-.70593L13.875,5.875v-.75a1.75,1.75,0,0,0-3.499-.06016l-.001.06016v.75a.75.75,0,0,1-.70593.74873L9.625,6.625H2.875a.75.75,0,0,1-.04407-1.49873L2.875,5.125h6A3.25,3.25,0,0,1,12.125,1.875Zm1.75,10a.75.75,0,0,1,.75.75v6a.75.75,0,0,1-1.5,0v-6A.75.75,0,0,1,13.875,11.875Zm-3.5,0a.75.75,0,0,1,.75.75v6a.75.75,0,0,1-1.5,0v-6A.75.75,0,0,1,10.375,11.875ZM5.754,7.625,6.85113,18.59888A2.25,2.25,0,0,0,9.02349,20.624l.06647.001h6.06927a2.25,2.25,0,0,0,2.23134-1.96071l.00756-.06607.91929-9.22048L18.494,7.625h1.508l-.19209,1.90263-.91918,9.2194a3.75,3.75,0,0,1-3.64911,3.37708l-.08239.00089H9.09a3.75,3.75,0,0,1-3.7223-3.295l-.00909-.08187L4.246,7.625Z"/></svg>

After

Width:  |  Height:  |  Size: 904 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>删除-实心</title><path d="M12,1.875a3.00027,3.00027,0,0,1,2.98974,2.75013L21.25,4.625a.75.75,0,0,1,.04407,1.49873L21.25,6.125H2.75a.75.75,0,0,1-.04407-1.49873L2.75,4.625l6.26026.00013A3.00027,3.00027,0,0,1,12,1.875Zm2,10a.75.75,0,0,0-.75.75v6a.75.75,0,0,0,1.5,0v-6A.75.75,0,0,0,14,11.875Zm-4,0a.75.75,0,0,0-.75.75v6a.75.75,0,0,0,1.5,0v-6A.75.75,0,0,0,10,11.875Zm9.905-4.75L18.71823,19.19314A3.25,3.25,0,0,1,15.48384,22.125H8.51616a3.25,3.25,0,0,1-3.23439-2.93186L4.094,7.125Z"/></svg>

After

Width:  |  Height:  |  Size: 590 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>删除</title><path d="M12.125,1.875a3.25,3.25,0,0,1,3.24911,3.17329L15.375,5.125h5.75a.75.75,0,0,1,.04407,1.49873L21.125,6.625h-6.5a.75.75,0,0,1-.74873-.70593L13.875,5.875v-.75a1.75,1.75,0,0,0-3.499-.06016l-.001.06016v.75a.75.75,0,0,1-.70593.74873L9.625,6.625H2.875a.75.75,0,0,1-.04407-1.49873L2.875,5.125h6A3.25,3.25,0,0,1,12.125,1.875Zm1.75,10a.75.75,0,0,1,.75.75v6a.75.75,0,0,1-1.5,0v-6A.75.75,0,0,1,13.875,11.875Zm-3.5,0a.75.75,0,0,1,.75.75v6a.75.75,0,0,1-1.5,0v-6A.75.75,0,0,1,10.375,11.875ZM5.754,7.625,6.85113,18.59888A2.25,2.25,0,0,0,9.02349,20.624l.06647.001h6.06927a2.25,2.25,0,0,0,2.23134-1.96071l.00756-.06607.91929-9.22048L18.494,7.625h1.508l-.19209,1.90263-.91918,9.2194a3.75,3.75,0,0,1-3.64911,3.37708l-.08239.00089H9.09a3.75,3.75,0,0,1-3.7223-3.295l-.00909-.08187L4.246,7.625Z"/></svg>

After

Width:  |  Height:  |  Size: 904 B

View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 120 120" style="enable-background:new 0 0 120 120;" xml:space="preserve">
<style type="text/css">
.st0{opacity:0.15;fill-rule:evenodd;clip-rule:evenodd;fill:#A1A7B3;enable-background:new ;}
.st1{opacity:0.6;fill-rule:evenodd;clip-rule:evenodd;fill:#A1A7B3;enable-background:new ;}
.st2{opacity:0.3;fill-rule:evenodd;clip-rule:evenodd;fill:#A1A7B3;enable-background:new ;}
.st3{opacity:0.8;fill-rule:evenodd;clip-rule:evenodd;fill:#A1A7B3;enable-background:new ;}
.st4{opacity:0.2;fill-rule:evenodd;clip-rule:evenodd;fill:#A1A7B3;enable-background:new ;}
.st5{opacity:0.1;fill-rule:evenodd;clip-rule:evenodd;fill:#A1A7B3;enable-background:new ;}
.st6{opacity:0.5;fill-rule:evenodd;clip-rule:evenodd;fill:#A1A7B3;enable-background:new ;}
</style>
<title>笔记空页面</title>
<g id="编组" transform="translate(25.110000, 10.000000)">
<g id="board" transform="translate(0.699850, 0.000000)">
<ellipse id="椭圆形" class="st0" cx="33.6" cy="97.8" rx="33.3" ry="2.1"/>
<path id="形状结合" class="st1" d="M15.7,7.7c-0.8,1.2-1.3,2.6-1.5,4.1l-4.8,0c-0.5,0-0.9,0.4-1,0.9l0,0.1v67.7
c0,0.5,0.4,0.9,0.9,1l0.1,0H56c0.5,0,0.9-0.4,1-0.9l0-0.1l0-21c1.3-0.8,2.6-1.6,4-2.4c0.9-0.6,1.8-1.1,2.7-1.6l0,33.8
c0,2.2-1.8,4-4,4H5.4c-2.2,0-4-1.8-4-4V11.7c0-2.2,1.8-4,4-4L15.7,7.7z M49.7,7.7l10,0c2.2,0,4,1.8,4,4l0,30.1
c-2.2,2.2-4.5,4.9-6.7,7.7l0-36.7c0-0.6-0.4-1-1-1l-4.8,0C51,10.2,50.5,8.8,49.7,7.7z"/>
<path id="bolder" class="st2" d="M1.4,88c0,2.2,1.8,4,4,4l0,0h54.2c2.2,0,4-1.8,4-4l0,0v1.1c0,2.2-1.8,4-4,4H5.4c-2.2,0-4-1.8-4-4
V88z"/>
<path class="st3" d="M57,59.5l0,21c0,0.6-0.4,1-1,1H9.4c-0.5,0-0.9-0.4-1-0.9l0-0.1c0,0.6,0.5,1,1,1c27-0.9,41.6-2.4,43.7-4.5
c1-1,1.9-6.6,2.5-16.6C56,60,56.5,59.8,57,59.5z M56,11.7c0.6,0,1,0.4,1,1l0,36.7c-0.3,0.4-0.6,0.8-0.9,1.2
c0.4-9.6,0.7-21.8,0.9-36.6l0-1.2l0,0c0-0.5-0.4-0.9-0.9-1L56,11.7L56,11.7z"/>
<path class="st4" d="M14.2,11.7l0,0.2l0,0l0,0.2l0,0.2l37,0c0-0.2,0-0.4,0-0.5l4.8,0c0.6,0,1,0.4,1,1l0,0
c-0.2,15.4-0.5,28-0.9,37.9c-3.6,4.8-6.7,9.5-7.9,11.9l0,0l-14.5,14l-2.4,3c-0.1,0.1-0.1,0.2,0,0.2c0,0.1,0.1,0.1,0.2,0l0,0
l3.2-2.1L49,63.8c1.4-0.6,3.7-1.9,6.5-3.5c-0.6,10-1.5,15.5-2.5,16.6C51,79,36.4,80.5,9.4,81.4c-0.6,0-1-0.4-1-1l0-67.7
c0-0.6,0.4-1,1-1L14.2,11.7z M51.2,12.9h-37v0.7c0,0.3,0.2,0.6,0.5,0.6l0.1,0h35.8c0.3,0,0.6-0.2,0.6-0.5l0-0.1V12.9z"/>
<path class="st5" d="M14.2,11.7l0,0.2l0,0l0,0.2l0,0.2l37,0c0-0.2,0-0.4,0-0.5l4.8,0c0.6,0,1,0.4,1,1l0,0
c-0.2,15.4-0.5,28-0.9,37.9c-3.6,4.8-6.7,9.5-7.9,11.9l0,0l-14.5,14l-2.4,3c-0.1,0.1-0.1,0.2,0,0.2c0,0.1,0.1,0.1,0.2,0l0,0
l3.2-2.1L49,63.8c1.4-0.6,3.7-1.9,6.5-3.5c-0.6,10-1.5,15.5-2.5,16.6C51,79,36.4,80.5,9.4,81.4c-0.6,0-1-0.4-1-1l0-67.7
c0-0.6,0.4-1,1-1L14.2,11.7z M51.2,12.9h-37v0.7c0,0.3,0.2,0.6,0.5,0.6l0.1,0h35.8c0.3,0,0.6-0.2,0.6-0.5l0-0.1V12.9z"/>
<path class="st1" d="M51.2,12.9v0.7c0,0.3-0.3,0.6-0.6,0.6H14.8c-0.3,0-0.6-0.3-0.6-0.6v-0.7H51.2z M32.7,0.4
c2.7,0,3.8,1.6,4.9,3.7l0.1,0.2h5.5c4.4,0,8,3.6,8,8l-37,0l0-0.2c0.1-4.3,3.7-7.8,8-7.8h5.5C28.6,2.2,29.9,0.4,32.7,0.4z
M32.7,2.8c-1.4,0-2.5,1.1-2.5,2.5s1.1,2.5,2.5,2.5c1.4,0,2.5-1.1,2.5-2.5S34,2.8,32.7,2.8z"/>
</g>
<path id="pencil" class="st6" d="M88.3,24.5c2.7,0.8-2.5,12.1-8.3,18.6c-5.8,6.5-11.7,9.8-18.4,13.9c-5.1,3.1-9.7,5.9-11.9,6.8
L35.3,77.7l-3.2,2.1c-0.1,0-0.2,0-0.2,0c0-0.1,0-0.2,0-0.2l2.4-3l14.5-14c2.1-4.1,9.7-15.4,16.4-21.7c1.4-1.3,2.9-2.7,4.5-4.1
l0.6-0.5c0.3-0.3,0.6-0.5,1-0.8l0.6-0.5c0.1-0.1,0.2-0.2,0.3-0.3l0.6-0.5C79.6,28.6,86.4,24,88.3,24.5z M71.2,43.4
c-0.9,0.3-2.6,0.6-2.2,1c0.4,0.4,2.5,0.3,6.6-1.5c3.8-1.7,2.5-1.7,0.8-1.2l-0.2,0.1l0,0l-0.1,0C74.1,42.5,72.2,43.1,71.2,43.4z
M73.5,39.6c-0.8,0.2-1.6,0.4-1.3,0.7c0.4,0.4,2.5,0.3,6.6-1.5s2.4-1.7,0.5-1.1c-1.9,0.6-3.9,1.3-4.8,1.6c-0.2,0.1-0.4,0.1-0.6,0.2
L73.5,39.6z M77.2,35c-0.8,0.2-1.5,0.4-1.2,0.7c0.4,0.4,2.5,0.3,6.6-1.5c3.8-1.7,2.5-1.7,0.8-1.2l-0.2,0.1l0,0l-0.1,0
c-1.9,0.6-3.9,1.3-4.8,1.6c-0.2,0.1-0.4,0.1-0.6,0.2L77.2,35z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>收藏-实心</title><path fill="#FFBF00" d="M12.77438,2.24874a1.75,1.75,0,0,1,.7948.7948l2.01864,4.09022a1,1,0,0,0,.75294.547l4.51383.6559a1.75,1.75,0,0,1,.96987,2.985L19.6759,13.41524l-.11921.11695-.655.56353q-1.95786,1.666-3.82958,3.036-2.18369,1.5984-4.52814,2.99752l.00388-.0036L7.49726,21.731a1.75,1.75,0,0,1-2.53917-1.84481l.77106-4.49559a1,1,0,0,0-.2876-.88514L2.17531,11.32166a1.75,1.75,0,0,1,.96988-2.985L7.659,7.6808a1,1,0,0,0,.75293-.547L10.4306,3.04354A1.75,1.75,0,0,1,12.77438,2.24874Zm6.19,11.86043-.40614.39628a1,1,0,0,0-.2876.88514l.771,4.49559A1.75,1.75,0,0,1,16.50252,21.731l-3.13171-1.64644a24.58444,24.58444,0,0,0,4.37908-4.97074C17.89453,14.97283,18.35,14.61526,18.96437,14.10917Z"/></svg>

After

Width:  |  Height:  |  Size: 813 B

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
<style type="text/css">
.st0{fill:#182431;}
</style>
<title>收藏(线性)</title>
<path class="st0" d="M12.8,1.6c0.3,0.2,0.6,0.4,0.8,0.8l2,4.1C15.7,6.8,16,7,16.3,7.1l4.5,0.7c1,0.1,1.6,1,1.5,2
c-0.1,0.4-0.2,0.7-0.5,1l-3.3,3.2c-0.2,0.2-0.3,0.6-0.3,0.9l0.8,4.5c0.2,1-0.5,1.9-1.4,2c-0.4,0.1-0.8,0-1.1-0.2l-3.1-1.6
c0.5-0.3,0.9-0.6,1.4-1l2.4,1.2c0,0,0.1,0,0.2,0c0.1,0,0.2-0.1,0.2-0.3l0,0l-0.7-4.3c-0.6,0.5-1.2,0.9-1.7,1.3l-0.9,0.6l0,0
l-0.9,0.6c-0.6,0.4-1.2,0.8-1.8,1.2l-0.9,0.6l0,0l-3,1.6c-0.2,0.1-0.5,0.2-0.7,0.2l-0.1,0c-0.6,0-1.2-0.4-1.5-0.9
C5,20,4.9,19.7,5,19.3l0.8-4.5c0.1-0.3-0.1-0.7-0.3-0.9l-3.3-3.2c-0.7-0.7-0.7-1.8,0-2.5c0.3-0.3,0.6-0.5,1-0.5l4.5-0.7
C8,7,8.3,6.8,8.4,6.5l2-4.1C10.9,1.6,11.9,1.2,12.8,1.6z M12,3L12,3C11.9,3,11.9,3,12,3L12,3C11.9,3,11.9,3,12,3L12,3
c-0.1,0-0.1,0-0.1,0L12,3C11.9,3,11.8,3,11.8,3l0,0c0,0,0,0,0,0l0,0l-2,4.1C9.7,7.4,9.5,7.6,9.4,7.7c0,0,0,0,0,0c0,0,0,0.1-0.1,0.1
c0,0,0,0-0.1,0.1c0,0,0,0-0.1,0.1c0,0-0.1,0-0.1,0.1c0,0,0,0-0.1,0c0,0-0.1,0-0.1,0.1c0,0,0,0-0.1,0c0,0-0.1,0-0.1,0.1
c0,0-0.1,0-0.1,0c0,0-0.1,0-0.1,0c0,0-0.1,0-0.1,0c0,0-0.1,0-0.1,0c0,0,0,0-0.1,0c0,0-0.1,0-0.1,0c0,0-0.1,0-0.1,0c0,0-0.1,0-0.1,0
c0,0,0,0,0,0L8,8.5c0,0,0,0,0,0l-0.1,0L3.4,9.2c-0.1,0-0.1,0-0.1,0.1l0,0.1c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0.1l0,0
c0,0,0,0,0,0.1l0,0c0,0,0,0,0,0.1l0,0c0,0,0,0,0,0.1l0,0c0,0,0,0,0,0.1l0,0c0,0,0,0,0,0.1l0,0l3.3,3.2c0.2,0.2,0.3,0.4,0.4,0.6
c0,0,0,0,0,0.1c0,0,0,0.1,0,0.1c0,0,0,0,0,0.1c0,0,0,0.1,0,0.1c0,0,0,0,0,0.1c0,0,0,0.1,0,0.1c0,0,0,0.1,0,0.1c0,0,0,0,0,0.1
c0,0,0,0.1,0,0.1c0,0,0,0.1,0,0.1c0,0,0,0,0,0c0,0,0,0.1,0,0.1c0,0,0,0,0,0c0,0,0,0.1,0,0.1c0,0,0,0.1,0,0.1c0,0,0,0.1,0,0.1
c0,0,0,0,0,0l0,0c0,0,0,0,0,0.1l0,0.1l-0.8,4.5c0,0.1,0,0.1,0,0.2c0,0,0,0.1,0.1,0.1c0,0,0,0,0,0l0,0c0,0,0,0,0.1,0l0,0
c0,0,0,0,0.1,0l0,0c0,0,0,0,0.1,0l0,0c0,0,0.1,0,0.1,0l0,0c0,0,0,0,0.1,0l0,0l0.3-0.2l2.7-1.4l0.9-0.5c1.2-0.7,2.4-1.5,3.5-2.4
c1.2-0.9,2.5-1.9,3.7-2.9l0.6-0.5l2.3-2.2c0,0,0.1-0.1,0.1-0.1l0-0.1c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0-0.1l0,0c0,0,0,0,0-0.1
l0,0c0,0,0,0,0-0.1l0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0l0,0c0,0,0,0-0.1,0l0,0c0,0,0,0-0.1,0l0,0l-4.5-0.7c-0.1,0-0.2,0-0.3-0.1
c0,0,0,0-0.1,0c0,0-0.1,0-0.1,0c0,0-0.1,0-0.1,0c0,0,0,0-0.1,0c0,0-0.1,0-0.1,0c0,0-0.1,0-0.1,0c0,0,0,0-0.1,0c0,0-0.1,0-0.1-0.1
c0,0,0,0-0.1,0c0,0-0.1,0-0.1-0.1c0,0,0,0-0.1-0.1c0,0,0,0-0.1-0.1c0,0-0.1,0-0.1-0.1c0,0,0,0-0.1,0c0,0-0.1,0-0.1-0.1
c0,0,0,0,0-0.1c0,0-0.1-0.1-0.1-0.1c0,0,0,0,0,0c0,0-0.1-0.1-0.1-0.1c0,0,0,0,0,0c0,0,0-0.1-0.1-0.1c0,0,0,0,0,0l0,0c0,0,0,0,0,0
l0-0.1l-2-4.1c0,0-0.1-0.1-0.1-0.1l0,0L12,3C12,3,12,3,12,3C12,3,12,3,12,3z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
<style type="text/css">
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#007DFF;}
.st1{filter:url(#filter-2);}
.st2{fill-rule:evenodd;clip-rule:evenodd;}
.st3{fill:none;stroke:#000000;stroke-opacity:5.000000e-02;}
.st4{fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;}
</style>
<filter filterUnits="objectBoundingBox" height="160.0%" id="filter-2" width="160.0%" x="-30.0%" y="-20.0%">
<feMorphology in="SourceAlpha" operator="dilate" radius="1" result="shadowSpreadOuter1"></feMorphology>
<feOffset dx="0" dy="1" in="shadowSpreadOuter1" result="shadowOffsetOuter1"></feOffset>
<feMorphology in="SourceAlpha" operator="erode" radius="1" result="shadowInner"></feMorphology>
<feOffset dx="0" dy="1" in="shadowInner" result="shadowInner"></feOffset>
<feComposite in="shadowOffsetOuter1" in2="shadowInner" operator="out" result="shadowOffsetOuter1"></feComposite>
<feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1" stdDeviation="0.5"></feGaussianBlur>
<feColorMatrix in="shadowBlurOuter1" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"></feColorMatrix>
</filter>
<title>选中</title>
<g transform="translate(2.000000, 2.000000)">
<circle id="Oval-21" class="st0" cx="10" cy="10" r="10"/>
<g id="Oval-43">
<g class="st1">
<circle id="path-1_1_" class="st2" cx="10" cy="10" r="5"/>
</g>
<circle class="st3" cx="10" cy="10" r="5.5"/>
</g>
<circle class="st4" cx="10" cy="10" r="5"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
<style type="text/css">
.st0{opacity:0.4;}
.st1{fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;fill-opacity:0.4;}
.st2{fill-rule:evenodd;clip-rule:evenodd;fill:#182431;fill-opacity:0.4;}
</style>
<title>未选中</title>
<g id="未选中" class="st0">
<g transform="translate(2.000000, 2.000000)">
<circle id="Oval-21" class="st1" cx="10" cy="10" r="10"/>
<path id="Oval-22" class="st2" d="M10,0c5.5,0,10,4.5,10,10s-4.5,10-10,10S0,15.5,0,10S4.5,0,10,0z M10,1c-5,0-9,4-9,9s4,9,9,9
s9-4,9-9S15,1,10,1z"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 880 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>文件夹</title><path fill="#4fb4e3" d="M7.37868,4.5H5A2.5,2.5,0,0,0,2.501,6.93L2.5,17a2.5,2.5,0,0,0,2.43,2.499L5,19.5H19a2.5,2.5,0,0,0,2.499-2.43L21.5,17V11a2.5,2.5,0,0,0-2.43-2.499L12.41421,8.5a2.5,2.5,0,0,1-1.7083-.6747l-.05946-.05753Zm0-1.5a1.5,1.5,0,0,1,1.06066.43934l3.26777,3.26777A1,1,0,0,0,12.41421,7H19a4.043,4.043,0,0,1,.44285.02424,2.00019,2.00019,0,0,0-1.88056-1.52329L17.5,5.5l-5.543-.00013-1.50025-1.5L17.5,4A3.5,3.5,0,0,1,21,7.5l.00012.0352A3.9984,3.9984,0,0,1,23,11v6a4,4,0,0,1-4,4H5a4,4,0,0,1-4-4V7A4,4,0,0,1,5,3Z"/></svg>

After

Width:  |  Height:  |  Size: 643 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1{fill-rule:evenodd;}</style></defs><title>文本颜色</title><path class="cls-1" d="M2.5,19.02h19a1.5,1.5,0,0,1,0,3H2.5a1.5,1.5,0,0,1,0-3Z"/><path d="M14.421,10.95488H9.579l2.41086-6.66532ZM7.67463,16.202l1.33712-3.70745H14.968L16.32536,16.202H18.25L12.8205,1.98h-1.641L5.75,16.202Z"/></svg>

After

Width:  |  Height:  |  Size: 406 B

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
<style type="text/css">
.st0{fill:#182431;}
</style>
<title>字体大小备份 2</title>
<path id="A" class="st0" d="M8.3,19l1.2-3.1h4.8l1.2,3.1h1.9L12.6,7.3h-1.5L6.6,19H8.3z M13.7,14.4h-3.6l1.8-4.8L13.7,14.4z"/>
</svg>

After

Width:  |  Height:  |  Size: 567 B

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
<style type="text/css">
.st0{fill:#182431;}
</style>
<title>字体大小</title>
<path id="形状结合" class="st0" d="M20.1,12c0.6,0,1.1,0.1,1.6,0.4c0.5,0.3,0.8,0.6,1.1,1.1c0.3,0.5,0.4,1.1,0.4,1.7l0,0V20H22
l0-0.2c0-0.4,0-0.7,0-0.8c-0.2,0.4-0.6,0.7-1,0.9s-0.9,0.3-1.4,0.3c-0.5,0-1-0.1-1.4-0.3c-0.4-0.2-0.8-0.5-1-0.8s-0.4-0.8-0.4-1.3
c0-0.8,0.3-1.4,0.9-1.8c0.6-0.4,1.4-0.7,2.4-0.7c0.6,0,1.1,0.1,1.7,0.2c0-1.5-0.6-2.3-1.8-2.3c-0.9,0-1.5,0.4-2,1.2l0,0l-1-0.6
l0.1-0.2c0.2-0.5,0.6-0.8,1.1-1.1C18.8,12.2,19.4,12,20.1,12z M9.6,3.8l6.7,16.1h-2.2l-1.9-4.8H5.4l-1.8,4.8h-2L8.1,3.8H9.6z
M20.1,16.3c-0.6,0-1.2,0.1-1.5,0.4s-0.5,0.6-0.5,1.1c0,0.4,0.2,0.7,0.5,1c0.3,0.2,0.7,0.4,1.2,0.4c0.6,0,1.1-0.2,1.5-0.5
s0.6-0.8,0.6-1.4l0,0v-0.6l-0.3-0.1C21,16.3,20.6,16.3,20.1,16.3z M8.7,6.5l-2.6,6.9h5.5L8.7,6.5z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
<style type="text/css">
.st0{fill:#182431;}
</style>
<title>字体大小备份</title>
<path id="A" class="st0" d="M9.6,16.3l0.7-2h3l0.8,2h1.2L12.3,9h-0.9l-2.8,7.3H9.6z M13,13.4h-2.3l1.1-3L13,13.4z"/>
</svg>

After

Width:  |  Height:  |  Size: 555 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1{fill-rule:evenodd;}</style></defs><title>文本样式</title><path d="M9.35485,10.55043,5.98161,10.543,7.65616,5.69371ZM4.43707,14.56522l.99433-2.75741H9.85873l1.00885,2.75741h1.42981L8.25473,4H7.0354L3,14.56522Z"/><path class="cls-1" d="M11.75,3.75h9.5a.75.75,0,0,1,0,1.5h-9.5a.75.75,0,0,1,0-1.5Z"/><path class="cls-1" d="M13.75,8.25h7.5a.75.75,0,0,1,0,1.5h-7.5a.75.75,0,0,1,0-1.5Z"/><path class="cls-1" d="M15.75,12.75h5.5a.75.75,0,0,1,0,1.5h-5.5a.75.75,0,0,1,0-1.5Z"/><path class="cls-1" d="M2.75,18.75h18.5a.75.75,0,0,1,0,1.5H2.75a.75.75,0,0,1,0-1.5Z"/></svg>

After

Width:  |  Height:  |  Size: 678 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1{fill-rule:evenodd;}</style></defs><title>文本倾斜</title><path class="cls-1" d="M17.5,3a.75.75,0,0,1,0,1.5H14.104l-2.674,15h3.41848a.75.75,0,1,1,0,1.5H6.5a.75.75,0,0,1,0-1.5H9.895l2.674-15H9.15152a.75.75,0,0,1,0-1.5Z"/></svg>

After

Width:  |  Height:  |  Size: 344 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1{fill-rule:evenodd;}</style></defs><title>符号标注2</title><path class="cls-1" d="M7.75,3.5h13.5a.75.75,0,0,1,0,1.5H7.75a.75.75,0,0,1,0-1.5Z"/><path class="cls-1" d="M7.75,11.25h13.5a.75.75,0,0,1,0,1.5H7.75a.75.75,0,0,1,0-1.5Z"/><path class="cls-1" d="M7.75,19h13.5a.75.75,0,0,1,0,1.5H7.75a.75.75,0,0,1,0-1.5Z"/><rect x="2" y="2.75" width="3" height="3" rx="0.5" ry="0.5"/><rect x="2" y="10.5" width="3" height="3" rx="0.5" ry="0.5"/><rect x="2" y="18.25" width="3" height="3" rx="0.5" ry="0.5"/></svg>

After

Width:  |  Height:  |  Size: 620 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1{fill-rule:evenodd;}</style></defs><title>符号标注3</title><path class="cls-1" d="M21.25,3.5a.75.75,0,0,1,0,1.5H7.75a.75.75,0,0,1,0-1.5ZM3.5,2.75A1.5,1.5,0,1,1,2,4.25,1.5,1.5,0,0,1,3.5,2.75Zm17.75,8.5a.75.75,0,0,1,0,1.5H7.75a.75.75,0,0,1,0-1.5ZM3.5,10.5A1.5,1.5,0,1,1,2,12,1.5,1.5,0,0,1,3.5,10.5ZM21.25,19a.75.75,0,0,1,0,1.5H7.75a.75.75,0,0,1,0-1.5ZM3.5,18.25A1.5,1.5,0,1,1,2,19.75,1.5,1.5,0,0,1,3.5,18.25Z"/></svg>

After

Width:  |  Height:  |  Size: 533 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1{fill-rule:evenodd;}</style></defs><title>英文符号</title><path class="cls-1" d="M7.625,3.493h13.5a.75.75,0,0,1,0,1.5H7.625a.75.75,0,0,1,0-1.5Z"/><path class="cls-1" d="M7.625,11.243h13.5a.75.75,0,0,1,0,1.5H7.625a.75.75,0,0,1,0-1.5Z"/><path class="cls-1" d="M7.625,18.993h13.5a.75.75,0,0,1,0,1.5H7.625a.75.75,0,0,1,0-1.5Z"/><path d="M3.3332,5.32345a.65508.65508,0,0,1-.4205-.12733.4192.4192,0,0,1-.15991-.34647.43639.43639,0,0,1,.19545-.379A.9542.9542,0,0,1,3.499,4.33438a2.61049,2.61049,0,0,1,.62187.08884v.19545a.62915.62915,0,0,1-.231.51822A.85807.85807,0,0,1,3.3332,5.32345Zm-.077.49157a1.217,1.217,0,0,0,.539-.11253.91563.91563,0,0,0,.37312-.33166q.01777.11253.02961.379H4.725V3.93165a1.33643,1.33643,0,0,0-.34351-.97426A1.20817,1.20817,0,0,0,3.47534,2.605a1.42643,1.42643,0,0,0-.74328.19544,1.14883,1.14883,0,0,0-.47676.52711l.45011.26059a.78075.78075,0,0,1,.72847-.456q.67518,0,.687.83508a2.55213,2.55213,0,0,0-.68109-.09476,1.577,1.577,0,0,0-.94465.26651.84446.84446,0,0,0-.37016.72255.85641.85641,0,0,0,.154.51526.979.979,0,0,0,.41161.32574A1.39781,1.39781,0,0,0,3.25621,5.815Z"/><path d="M3.63624,13.36629a.79664.79664,0,0,1-.58754-.24739,1.04088,1.04088,0,0,1-.24458-.759,1.01182,1.01182,0,0,1,.24458-.74779.80586.80586,0,0,1,.58754-.24177.70243.70243,0,0,1,.5735.26145,1.12,1.12,0,0,1,.21365.72811,1.143,1.143,0,0,1-.21646.73935A.69854.69854,0,0,1,3.63624,13.36629Zm.10121.51727A1.19441,1.19441,0,0,0,4.37,13.70364a1.29939,1.29939,0,0,0,.4751-.5257,1.937,1.937,0,0,0,0-1.63052A1.32,1.32,0,0,0,4.37,11.0189a1.19382,1.19382,0,0,0-1.15823-.06184,1.034,1.034,0,0,0-.40763.36827V9.543H2.225v4.27872h.51165q.01123-.26988.03373-.48354a1.01876,1.01876,0,0,0,.41607.41044A1.17421,1.17421,0,0,0,3.73745,13.88356Z"/><path d="M3.649,21.395a1.359,1.359,0,0,0,.681-.168,1.11719,1.11719,0,0,0,.459-.504l-.474-.276a.76793.76793,0,0,1-.672.39.78366.78366,0,0,1-.63-.285,1.38748,1.38748,0,0,1,0-1.56.78366.78366,0,0,1,.63-.285.77027.77027,0,0,1,.672.384l.474-.276a1.11719,1.11719,0,0,0-.459-.504,1.359,1.359,0,0,0-.681-.168,1.52577,1.52577,0,0,0-.768.198,1.435,1.435,0,0,0-.552.567,1.919,1.919,0,0,0,0,1.722,1.435,1.435,0,0,0,.552.567A1.52577,1.52577,0,0,0,3.649,21.395Z"/></svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1{fill-rule:evenodd;}</style></defs><title>数字符号</title><path class="cls-1" d="M21.1,3.37562a.75.75,0,1,1,0,1.5H7.6a.75.75,0,1,1,0-1.5Zm0,7.75a.75.75,0,0,1,0,1.5H7.6a.75.75,0,0,1,0-1.5Zm0,7.75a.75.75,0,0,1,0,1.5H7.6a.75.75,0,1,1,0-1.5Z"/><polygon points="3.55 5.786 3.55 2.126 3.135 2.126 2.15 2.696 2.15 3.231 3.01 2.746 3.01 5.786 3.55 5.786"/><path d="M4.55,13.8584v-.476H2.95668l.7666-.85177a4.08243,4.08243,0,0,0,.55866-.7215,1.24419,1.24419,0,0,0,.15783-.61128,1.12763,1.12763,0,0,0-.14029-.57369.93337.93337,0,0,0-.38831-.37077,1.20194,1.20194,0,0,0-.55867-.12777,1.27808,1.27808,0,0,0-.744.23048,1.1231,1.1231,0,0,0-.44844.65136l.4309.24551a.957.957,0,0,1,.27808-.466.65031.65031,0,0,1,.44342-.17036.53785.53785,0,0,1,.40084.15783.61239.61239,0,0,1,.15532.44844.832.832,0,0,1-.12276.43841,4.08354,4.08354,0,0,1-.43841.55365L2.15,13.51268v.34572Z"/><path d="M3.355,21.87438a1.409,1.409,0,0,0,.6-.12645,1.00035,1.00035,0,0,0,.595-.94958.9551.9551,0,0,0-.16116-.56529.93613.93613,0,0,0-.47851-.33719.7945.7945,0,0,0,.3843-.31736.90827.90827,0,0,0,.12644-.481.96022.96022,0,0,0-.13388-.50826.90092.90092,0,0,0-.37686-.34215A1.237,1.237,0,0,0,3.35,18.12562a1.23745,1.23745,0,0,0-.72149.21074,1.11614,1.11614,0,0,0-.42892.61736l.42148.243a.92191.92191,0,0,1,.26529-.43884.6356.6356,0,0,1,.42893-.15124.55311.55311,0,0,1,.38926.13884.48642.48642,0,0,1,.15124.37686.54019.54019,0,0,1-.17852.41653.73719.73719,0,0,1-.5157.16364H2.9781v.46611h.1438q.86281,0,.86281.60992a.58533.58533,0,0,1-.181.45372.64535.64535,0,0,1-.45372.16612.80189.80189,0,0,1-.77355-.57521l-.42645.243a1.047,1.047,0,0,0,.45868.60247A1.39646,1.39646,0,0,0,3.355,21.87438Z"/></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>huaweishare</title><path d="M20.9634,19.015a10.72435,10.72435,0,0,1-1.05273,1.0913l-.16249.1432-.26824.23162a1,1,0,0,1-1.34764-1.47681l.04056-.037.26825-.23162a8.71745,8.71745,0,0,0,.98842-1.00416,8.9542,8.9542,0,0,0-.85234-12.34506l-.10792-.09556-.29966-.261a1,1,0,0,1,1.27123-1.54308l.04234.03492.29966.261A10.95239,10.95239,0,0,1,20.9634,19.015Zm-3.71762-2.48a6.94242,6.94242,0,0,1-.79333.80591,1,1,0,1,1-1.30611-1.51462,4.94205,4.94205,0,0,0,.56476-.57377A5.08714,5.08714,0,0,0,15.23264,8.25l-.08955-.079a1,1,0,0,1,1.27024-1.5439l.04237.03491.01921.01671A7.08582,7.08582,0,0,1,17.24578,16.53493ZM14,12.02581a2,2,0,1,1-2-2A2,2,0,0,1,14,12.02581Zm-5.2224,3.71955a1,1,0,0,1-1.30983,1.5114,6.88841,6.88841,0,0,1-.78514-.80155,7.06622,7.06622,0,0,1,.7629-9.79607l.019-.0166.04228-.035a1,1,0,0,1,1.274,1.54075l-.08842.07846a5.06783,5.06783,0,0,0-.472,6.94972A4.88862,4.88862,0,0,0,8.77761,15.74536Zm-2.95085,3.1571A1,1,0,0,1,4.47549,20.376l-.26513-.23007-.16074-.14236a10.6376,10.6376,0,0,1-1.04137-1.0849,10.92032,10.92032,0,0,1,1.16782-15.136l.29617-.25926.04226-.035a1,1,0,0,1,1.275,1.53994l-.29618.25923-.10659.09486a8.92259,8.92259,0,0,0-.84151,12.25655,8.63046,8.63046,0,0,0,.97591.9964l.26512.23006Z"/></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1{fill-rule:evenodd;}</style></defs><title>左对齐</title><path class="cls-1" d="M2.75,3.5a.75.75,0,0,0,0,1.5h18.5a.75.75,0,0,0,0-1.5Zm0,5.25a.75.75,0,0,0,0,1.5h10a.75.75,0,0,0,0-1.5Zm0,5a.75.75,0,0,0,0,1.5h18.5a.75.75,0,0,0,0-1.5Zm0,5.25a.75.75,0,0,0,0,1.5h10a.75.75,0,0,0,0-1.5Z"/></svg>

After

Width:  |  Height:  |  Size: 404 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1{fill-rule:evenodd;}</style></defs><title>位置提醒</title><path d="M12.5,2.25a6.94008,6.94008,0,0,1,6.87282,5.97627l.01376.104.31356,2.50425a5.55,5.55,0,0,0-1.59559-.67087l-.205-1.63647-.01226-.09287a5.44009,5.44009,0,0,0-5.296-4.6835L12.51116,3.75l-.09367.00065A5.4401,5.4401,0,0,0,7.11392,8.42555l-.01206.09051L5.94875,17.75l5.80074-.00058a9.4048,9.4048,0,0,0,.80441,1.50083L3.25,19.25a.75.75,0,0,1,0-1.5H4.43725L5.61341,8.33022a6.94009,6.94009,0,0,1,6.78174-6.07944Zm1.79369,19.22042.1379.1524.13288.13874q.09145.09267.20349.19978a2.98473,2.98473,0,0,1-2.19209,1.03772L12.5,23a3.00028,3.00028,0,0,1-2.98974-2.75006l3.75787-.00028Q13.73064,20.84545,14.29369,21.47042Z"/><path class="cls-1" d="M12.25,3.54616c.13807,0,.27632.00849.413.022l.11674.01274.11573.0147.17117.02471.48832.07789.10183.015.09886.01306.09565.01068.0922.0078c.48209.03308.80649-.07708.80649-.66148A2.17143,2.17143,0,0,0,12.5,1a2.17143,2.17143,0,0,0-2.25,2.08322c0,.59445.20217.69821.569.65965l.07305-.00915.07709-.01214.08109-.01457.363-.07139.15157-.02715.10555-.0167.10909-.01492.05585-.00662.11429-.0112C12.04626,3.55094,12.14645,3.54616,12.25,3.54616Z"/><path class="cls-1" d="M14.75,3.25a2.25,2.25,0,0,0-4.5,0"/><path d="M16.85,14.25A1.15,1.15,0,1,1,15.7,15.4,1.15,1.15,0,0,1,16.85,14.25Zm-.07526-1.67933.05425-.00045h.046A3.16888,3.16888,0,0,1,20,15.78111c0,1.29581-.62587,2.44931-1.91307,3.975a10.3467,10.3467,0,0,1-.96979.97255.35144.35144,0,0,1-.46234.00952L16.51,20.60622c-.36266-.33371-.617-.58437-.759-.747l-.09051-.106c-1.2501-1.47535-1.91047-2.70335-1.91047-3.9721A3.13085,3.13085,0,0,1,16.77474,12.57067Zm.10026-1.50045-.13328.00057A4.53356,4.53356,0,0,0,12.25,15.6149c0,1.735.89548,3.32209,2.55947,5.19375l.116.12939.11174.11778c.184.18825.442.42883.777.72519l.28.24515.03555.02963a1.20413,1.20413,0,0,0,1.53373-.02442,13.2405,13.2405,0,0,0,1.276-1.22164C20.64853,18.879,21.5,17.38332,21.5,15.6149A4.58534,4.58534,0,0,0,16.875,11.07022Z"/></svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1{fill-rule:evenodd;}</style></defs><title>居中</title><path class="cls-1" d="M21.25,3.5a.75.75,0,0,1,0,1.5H2.75a.75.75,0,0,1,0-1.5ZM17,8.75a.75.75,0,0,1,0,1.5H7a.75.75,0,0,1,0-1.5Zm4.25,5a.75.75,0,0,1,0,1.5H2.75a.75.75,0,0,1,0-1.5ZM17,19a.75.75,0,0,1,0,1.5H7A.75.75,0,0,1,7,19Z"/></svg>

After

Width:  |  Height:  |  Size: 402 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title></title><path d="M3,13a1,1,0,0,1,0-2H21a1,1,0,0,1,0,2Z"/></svg>

After

Width:  |  Height:  |  Size: 168 B

Some files were not shown because too many files have changed in this diff Show More