mirror of
https://github.com/openharmony/applications_notes.git
synced 2026-07-18 10:14:56 -04:00
!323 merge master into master
添加维测日志,修改jscrash问题 Created-by: sephyrothcloud Commit-by: haoxiaohui Merged-by: openharmony_ci Description: ### 一、内容说明(相关的Issue) https://gitcode.com/openharmony/applications_notes/issues/342 ### 二、建议测试周期和提测地址 建议测试完成时间:xxxx.xx.xx 投产上线时间:xxxx.xx.xx 提测地址:CI环境/压测环境 测试账号: ### 三、变更内容 * 3.1 关联PR列表 * 3.2 数据库和部署说明 1. 常规更新 2. 重启unicorn 3. 重启sidekiq 4. 迁移任务:是否有迁移任务,没有写 "无" 5. rake脚本:`bundle exec xxx RAILS_ENV = production`;没有写 "无" * 3.4 其他技术优化内容(做了什么,变更了什么) - 重构了 xxxx 代码 - xxxx 算法优化 * 3.5 废弃通知(什么字段、方法弃用?) * 3.6 后向不兼容变更(是否有无法向后兼容的变更?) ### 四、研发自测点(自测哪些?冒烟用例全部自测?) 自测测试结论: ### 五、测试关注点(需要提醒QA重点关注的、可能会忽略的地方) 检查点: | 需求名称 | 是否影响xx公共模块 | 是否需要xx功能 | 需求升级是否依赖其他子产品 | |------|------------|----------|---------------| | xxx | 否 | 需要 | 不需要 | | | | | | 接口测试: 性能测试: 并发测试: 其他: See merge request: openharmony/applications_notes!323
This commit is contained in:
@@ -33,7 +33,7 @@ export class MediaLibraryAccess {
|
||||
try {
|
||||
// 通过Uri拷贝图片到指定指定的包路径下
|
||||
// 1、获取本地路径
|
||||
|
||||
LogUtil.info(TAG, 'getFirstObject start: '+JSON.stringify(fetchOpt));
|
||||
let fileResult = await photoAccessHelper.getPhotoAccessHelper(context).getAssets(fetchOpt)
|
||||
if (fileResult != undefined) {
|
||||
album.count = fileResult.getCount();
|
||||
|
||||
@@ -12,13 +12,16 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import hilog from '@ohos.hilog'
|
||||
import hilog from '@ohos.hilog';
|
||||
|
||||
const TAG: string = 'SampleNote';
|
||||
|
||||
export class LogUtil {
|
||||
private static readonly IS_DEBUG_ON: boolean = false;
|
||||
private static readonly CONTACTS_DOMAIN: number = 0x0927;
|
||||
private static readonly SLASH: string = "/";
|
||||
private static readonly COLON: string = ": ";
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
@@ -28,21 +31,21 @@ export class LogUtil {
|
||||
|
||||
static debug(tag: string, msg: string, ...args: any[]) {
|
||||
if (this.IS_DEBUG_ON) {
|
||||
hilog.info(this.CONTACTS_DOMAIN, this.prefix(tag), msg, args);
|
||||
hilog.info(this.CONTACTS_DOMAIN, TAG, this.prefix(tag)+ msg, args);
|
||||
} else {
|
||||
hilog.debug(this.CONTACTS_DOMAIN, this.prefix(tag), msg, args);
|
||||
hilog.debug(this.CONTACTS_DOMAIN, TAG, this.prefix(tag)+ msg, args);
|
||||
}
|
||||
}
|
||||
|
||||
static info(tag: string, msg: string, ...args: any[]) {
|
||||
hilog.info(this.CONTACTS_DOMAIN, this.prefix(tag), msg, args);
|
||||
hilog.info(this.CONTACTS_DOMAIN, TAG, this.prefix(tag)+ msg, args);
|
||||
}
|
||||
|
||||
static warn(tag: string, msg: string, ...args: any[]) {
|
||||
hilog.warn(this.CONTACTS_DOMAIN, this.prefix(tag), msg, args);
|
||||
hilog.warn(this.CONTACTS_DOMAIN, TAG, this.prefix(tag)+ msg, args);
|
||||
}
|
||||
|
||||
static error(tag: string, msg: string, ...args: any[]) {
|
||||
hilog.error(this.CONTACTS_DOMAIN, this.prefix(tag), msg, args);
|
||||
hilog.error(this.CONTACTS_DOMAIN, TAG, this.prefix(tag)+ msg, args);
|
||||
}
|
||||
}
|
||||
@@ -25,9 +25,11 @@ let noteContext = AppStorage.Get<common.UIAbilityContext>('noteContext')!;
|
||||
|
||||
export class OperationUtils {
|
||||
async copy(uri: string): Promise<string | undefined> {
|
||||
LogUtil.info(TAG, 'copy start :'+ uri);
|
||||
let imagePath: string = '';
|
||||
try {
|
||||
let context = noteContext;
|
||||
LogUtil.info(TAG, 'getFileAssetById start :'+ uri);
|
||||
let fileAsset = await this.getFileAssetById(uri, context);
|
||||
if (fileAsset == null || fileAsset == undefined) {
|
||||
LogUtil.warn(TAG, "Failed to get fileAsset");
|
||||
@@ -110,7 +112,7 @@ export class OperationUtils {
|
||||
}
|
||||
|
||||
async getFileAssetById(imagePath: string, context: common.UIAbilityContext) {
|
||||
LogUtil.info(TAG, 'getFileAssetById', imagePath);
|
||||
LogUtil.info(TAG, 'getFileAssetById:', imagePath);
|
||||
let predicates: dataSharePredicates.DataSharePredicates = new dataSharePredicates.DataSharePredicates();
|
||||
let fetchOpt: photoAccessHelper.FetchOptions = {
|
||||
fetchColumns: [],
|
||||
|
||||
@@ -37,6 +37,7 @@ import inputMethod from '@ohos.inputMethod';
|
||||
import { folderTextMap } from '@ohos/utils/src/main/ets/default/model/NoteBaseData'
|
||||
import webview from '@ohos.web.webview';
|
||||
import common from '@ohos.app.ability.common';
|
||||
import { emitter } from '@kit.BasicServicesKit'
|
||||
|
||||
const TAG: string = 'NoteContent';
|
||||
|
||||
@@ -267,13 +268,16 @@ export struct NoteContent {
|
||||
|
||||
aboutToAppear(): void {
|
||||
LogUtil.info(TAG, "aboutToAppear")
|
||||
emitter.on('backToHome', () => {
|
||||
clearInterval(timeID);
|
||||
})
|
||||
}
|
||||
|
||||
aboutToDisappear(): void {
|
||||
AppStorage.Set("refreshCurrentNote", true)
|
||||
NoteUtil.refreshAll()
|
||||
clearInterval(timeID)
|
||||
LogUtil.info(TAG, "aboutToDisappear")
|
||||
AppStorage.set("refreshCurrentNote", true);
|
||||
emitter.off('backToHome');
|
||||
NoteUtil.refreshAll();
|
||||
LogUtil.info(TAG, "aboutToDisappear");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ import common from '@ohos.app.ability.common';
|
||||
import window from '@ohos.window';
|
||||
import { wantAgent, WantAgent } from '@kit.AbilityKit';
|
||||
import { backgroundTaskManager } from '@kit.BackgroundTasksKit';
|
||||
import { emitter } from '@kit.BasicServicesKit'
|
||||
|
||||
let time_id: number = 0;
|
||||
let noteContext = AppStorage.get<common.UIAbilityContext>('noteContext')!;
|
||||
@@ -143,7 +144,6 @@ export struct NoteContentCompPortrait {
|
||||
if (this.selectedNoteData.content_text === html) {
|
||||
return;
|
||||
}
|
||||
;
|
||||
this.selectedNoteData.content_text = html;
|
||||
this.selectedNoteData.modified_time = new Date().getTime();
|
||||
let predicatesNote = RdbStoreUtil.getRdbPredicates(TableName.NoteTable);
|
||||
@@ -423,7 +423,10 @@ export struct NoteContentCompPortrait {
|
||||
}
|
||||
|
||||
aboutToAppear(): void {
|
||||
this.isClickBack = false
|
||||
this.isClickBack = false;
|
||||
emitter.on('backToHome', () => {
|
||||
clearInterval(time_id);
|
||||
})
|
||||
LogUtil.info(TAG, 'aboutToAppear');
|
||||
window.getLastWindow(this.getUIContext().getHostContext()).then(currentWindow => {
|
||||
currentWindow.setWindowLayoutFullScreen(true);
|
||||
@@ -432,10 +435,10 @@ export struct NoteContentCompPortrait {
|
||||
|
||||
aboutToDisappear(): void {
|
||||
this.isClickBack = true
|
||||
clearInterval(time_id)
|
||||
NoteUtil.refreshAll()
|
||||
emitter.off('backToHome');
|
||||
NoteUtil.refreshAll();
|
||||
LogUtil.info(TAG, 'aboutToDisappear');
|
||||
this.editContentDialogCtl = null
|
||||
this.editContentDialogCtl = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import window from '@ohos.window';
|
||||
import util from '@ohos.util';
|
||||
import common from '@ohos.app.ability.common';
|
||||
import relationalStore from '@ohos.data.relationalStore';
|
||||
import { Configuration } from '@ohos.app.ability.Configuration';
|
||||
|
||||
AppStorage.setOrCreate<relationalStore.RdbStore>('rdbStore', undefined);
|
||||
|
||||
@@ -33,7 +34,8 @@ export default class MainAbility extends UIAbility {
|
||||
onCreate(want, launchParam) {
|
||||
|
||||
AppStorage.setOrCreate('context', this.context);
|
||||
LogUtil.info(this.Tag, " onCreate, launchReason is " + launchParam.launchReason + ", deviceType" + deviceInfo.deviceType);
|
||||
LogUtil.info(this.Tag,
|
||||
" onCreate, launchReason is " + launchParam.launchReason + ", deviceType" + deviceInfo.deviceType);
|
||||
if (deviceInfo.deviceType === 'phone' || deviceInfo.deviceType === 'default') {
|
||||
AppStorage.setOrCreate<boolean>('Expand', false);
|
||||
AppStorage.setOrCreate<boolean>('Choose', true);
|
||||
@@ -79,6 +81,7 @@ export default class MainAbility extends UIAbility {
|
||||
let windowClass = data;
|
||||
try {
|
||||
windowClass.on('windowSizeChange', (data) => {
|
||||
LogUtil.info(this.Tag, " --------------- windowSizeChange ---------------");
|
||||
this.screenBreakPoints(data.width);
|
||||
})
|
||||
// 窗口规避区域
|
||||
@@ -105,6 +108,7 @@ export default class MainAbility extends UIAbility {
|
||||
}
|
||||
})
|
||||
window.getLastWindow(this.context, (err, data) => {
|
||||
LogUtil.info(this.Tag, " --------------- getLastWindow ----------------");
|
||||
if (data && data.getWindowProperties()) {
|
||||
let windowWidth = data.getWindowProperties().windowRect.width;
|
||||
LogUtil.info(this.Tag, " getLastWindow:" + windowWidth);
|
||||
@@ -122,15 +126,39 @@ export default class MainAbility extends UIAbility {
|
||||
}
|
||||
|
||||
onForeground() {
|
||||
LogUtil.info(this.Tag, " onForeground");
|
||||
LogUtil.info(this.Tag, " ------------- onForeground ------------- ");
|
||||
}
|
||||
|
||||
onBackground() {
|
||||
LogUtil.info(this.Tag, " onBackground");
|
||||
LogUtil.info(this.Tag, " ------------- onBackground ------------- ");
|
||||
// 退出键盘
|
||||
inputMethod.getController().stopInputSession();
|
||||
}
|
||||
|
||||
onWillBackground(): void {
|
||||
LogUtil.info(this.Tag, " ------------- onWillBackground ------------- ");
|
||||
}
|
||||
|
||||
onDidBackground(): void {
|
||||
LogUtil.info(this.Tag, " ------------- onDidBackground ------------- ");
|
||||
}
|
||||
|
||||
onWillForeground(): void {
|
||||
LogUtil.info(this.Tag, " ------------- onWillForeground ------------- ");
|
||||
}
|
||||
|
||||
onDidForeground(): void {
|
||||
LogUtil.info(this.Tag, " ------------- onDidForeground ------------- ");
|
||||
}
|
||||
|
||||
onConfigurationUpdate(newConfig: Configuration): void {
|
||||
LogUtil.info(this.Tag, " ------------- onConfigurationUpdate : " + JSON.stringify(newConfig) + " ------------- ");
|
||||
}
|
||||
|
||||
onMemoryLevel(level: AbilityConstant.MemoryLevel): void {
|
||||
LogUtil.info(this.Tag, " ------------- onMemoryLevel : " + JSON.stringify(level) + " ------------- ");
|
||||
}
|
||||
|
||||
onContinue(wantParam: { [key: string]: any }) {
|
||||
LogUtil.info(this.Tag, " onContinue");
|
||||
// 获取本端的迁移数据
|
||||
@@ -186,7 +214,7 @@ export default class MainAbility extends UIAbility {
|
||||
}
|
||||
|
||||
getSrcFromHtml(html: string): any {
|
||||
LogUtil.info(this.Tag, " getSrcFromHtml "+ html);
|
||||
LogUtil.info(this.Tag, " getSrcFromHtml " + html);
|
||||
let srcArray = [];
|
||||
if (html == undefined || html == null || html == "") {
|
||||
return srcArray;
|
||||
@@ -235,7 +263,7 @@ export default class MainAbility extends UIAbility {
|
||||
screenDpi = displayClass.densityDPI;
|
||||
AppStorage.setOrCreate('dpi', screenDpi);
|
||||
let windowWidth = data / (screenDpi / 160);
|
||||
LogUtil.debug(this.Tag, " screenBreakPoints windowWidth: " + windowWidth);
|
||||
LogUtil.info(this.Tag, " screenBreakPoints windowWidth: " + windowWidth);
|
||||
if (windowWidth >= 320 && windowWidth < 520 || windowWidth < 320) {
|
||||
AppStorage.setOrCreate('breakPoint', 'sm');
|
||||
} else if (windowWidth >= 520 && windowWidth < 840) {
|
||||
|
||||
@@ -21,6 +21,7 @@ import RdbStoreUtil from '@ohos/utils/src/main/ets/default/baseUtil/RdbStoreUtil
|
||||
import inputMethod from '@ohos.inputMethod'
|
||||
import webview from '@ohos.web.webview';
|
||||
import common from '@ohos.app.ability.common';
|
||||
import { emitter } from '@kit.BasicServicesKit';
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
@@ -56,6 +57,7 @@ struct NoteContentHome {
|
||||
if (deviceInfo.deviceType !== 'phone' && deviceInfo.deviceType !== 'default') {
|
||||
inputMethod.getController().stopInputSession();
|
||||
}
|
||||
emitter.emit('backToHome');
|
||||
} catch (error) {
|
||||
LogUtil.info(this.TAG, 'onBackPress error')
|
||||
}
|
||||
|
||||
@@ -42,11 +42,15 @@ export struct NoteHomeComp {
|
||||
@Provide('SelectedAll') selectedAll: boolean = false
|
||||
@Provide('EditModel') editModel: boolean = false //编辑模式:临时方案
|
||||
@Provide('Issave') issave: number = 0
|
||||
@StorageLink('breakPoint') breakPoints: string = 'lg'
|
||||
@StorageLink('breakPoint') @Watch('onBreakPoints') breakPoints: string = 'lg'
|
||||
controllerShow: webview.WebviewController = new webview.WebviewController();
|
||||
TAG = "NoteHomeComp_Tablet"
|
||||
@Provide('AsideWidth') asideWidth: number = 200
|
||||
|
||||
onBreakPoints(){
|
||||
LogUtil.info(this.TAG, "onBreakPoints : "+this.breakPoints);
|
||||
}
|
||||
|
||||
build() {
|
||||
Flex({ justifyContent: FlexAlign.Start }) {
|
||||
if (this.breakPoints === 'lg') {
|
||||
|
||||
Reference in New Issue
Block a user