From 3c6329c2515942739cc58507acefc82e4dde9a3d Mon Sep 17 00:00:00 2001 From: JackLee <809262979@qq.com> Date: Wed, 8 Apr 2026 22:27:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AF=B4=E6=98=8E=E6=96=87?= =?UTF-8?q?=E4=BB=B6.=20=E5=A2=9E=E5=8A=A0=E7=9B=AE=E5=BD=95=E9=80=89?= =?UTF-8?q?=E6=8B=A9=20=E5=A2=9E=E5=8A=A0=E6=96=87=E4=BB=B6=E9=80=89?= =?UTF-8?q?=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/ets/pages/DispWinInfo/README.md | 8 +++ .../ets/pages/EventSubWin/File/SWNewFile.ets | 71 ++++++++++--------- .../src/main/ets/pages/RunEnvCheck/README.md | 5 ++ .../ets/pages/RunEnvCheck/RunEnvCheck.ets | 0 4 files changed, 49 insertions(+), 35 deletions(-) create mode 100644 entry/src/main/ets/pages/DispWinInfo/README.md create mode 100644 entry/src/main/ets/pages/RunEnvCheck/README.md create mode 100644 entry/src/main/ets/pages/RunEnvCheck/RunEnvCheck.ets diff --git a/entry/src/main/ets/pages/DispWinInfo/README.md b/entry/src/main/ets/pages/DispWinInfo/README.md new file mode 100644 index 00000000..dfd7b939 --- /dev/null +++ b/entry/src/main/ets/pages/DispWinInfo/README.md @@ -0,0 +1,8 @@ + +该目录主要用户检测设备得分辨率,通过分辨率计算出主窗口得大小,实现动态实时尺寸
+当前进度:
+支持默认0显示物理设备的分辨率获取.
+开发中:
+支持多物理设备的分辨率获取,同时要求支持建模画面进行流转功能,且扭转的组件只能为XCom组件. +需要将XCom组件寄生于一个page中进行流转,不流转软件所有界面本身.防止其他设备性能过低导致卡顿问题.
+ diff --git a/entry/src/main/ets/pages/EventSubWin/File/SWNewFile.ets b/entry/src/main/ets/pages/EventSubWin/File/SWNewFile.ets index 3d93e9c9..c997eae0 100644 --- a/entry/src/main/ets/pages/EventSubWin/File/SWNewFile.ets +++ b/entry/src/main/ets/pages/EventSubWin/File/SWNewFile.ets @@ -12,7 +12,7 @@ export struct SWNewFile { Column({ space: 5 }) { Row(){ Text('保存目录:').width('10%') - TextInput().width('80%') + TextInput({placeholder:this.message}).width('80%') Button('选择目录') .width('10%') .backgroundColor($r('sys.color.background_secondary')) @@ -24,44 +24,45 @@ export struct SWNewFile { let context = getContext(this) as common.Context; try { const documentSelectOptions = new picker.DocumentSelectOptions(); + documentSelectOptions.selectMode = picker.DocumentSelectMode.FOLDER; const documentPicker = new picker.DocumentViewPicker(context); documentPicker.select(documentSelectOptions).then((documentSelectResult: Array) => { - this.message = JSON.stringify(documentSelectResult); + this.message =documentSelectResult.toString(); if (documentSelectResult.length === 0) { return; } - this.getUIContext().showAlertDialog( - { - title: '文件路径', - message: this.message, - autoCancel: true, - alignment: DialogAlignment.Center, - offset: { dx: 0, dy: -20 }, - gridCount: 3, - width: 300, - height: 300, - cornerRadius: $r('sys.float.corner_radius_level7'), - borderWidth: 1, - borderStyle: BorderStyle.Dashed, - borderColor: Color.Blue, - backgroundColor: Color.White, - textStyle: { wordBreak: WordBreak.BREAK_ALL }, - confirm: { - value: '确定', - action: () => { - console.log('Confirm button is clicked.'); - }, - }, - onWillDismiss: (dismissDialogAction: DismissDialogAction) => { - if (dismissDialogAction.reason === DismissReason.PRESS_BACK) { - dismissDialogAction.dismiss(); - } - if (dismissDialogAction.reason === DismissReason.TOUCH_OUTSIDE) { - dismissDialogAction.dismiss(); - } - } - } - ) + // this.getUIContext().showAlertDialog( + // { + // title: '文件路径', + // message: this.message, + // autoCancel: true, + // alignment: DialogAlignment.Center, + // offset: { dx: 0, dy: -20 }, + // gridCount: 3, + // width: 300, + // height: 300, + // cornerRadius: $r('sys.float.corner_radius_level7'), + // borderWidth: 1, + // borderStyle: BorderStyle.Dashed, + // borderColor: Color.Blue, + // backgroundColor: Color.White, + // textStyle: { wordBreak: WordBreak.BREAK_ALL }, + // confirm: { + // value: '确定', + // action: () => { + // console.log('Confirm button is clicked.'); + // }, + // }, + // onWillDismiss: (dismissDialogAction: DismissDialogAction) => { + // if (dismissDialogAction.reason === DismissReason.PRESS_BACK) { + // dismissDialogAction.dismiss(); + // } + // if (dismissDialogAction.reason === DismissReason.TOUCH_OUTSIDE) { + // dismissDialogAction.dismiss(); + // } + // } + // } + // ) }).catch((err: BusinessError) => { console.error(`DocumentViewPicker.select failed with err: ${err.code}, ${err.message}`); }); @@ -73,7 +74,7 @@ export struct SWNewFile { }.height('5%') Row(){ Text('文件名:') - TextInput() + TextInput({placeholder:'model.prt'}) }.height('5%') Blank().height('85%') Row(){ diff --git a/entry/src/main/ets/pages/RunEnvCheck/README.md b/entry/src/main/ets/pages/RunEnvCheck/README.md new file mode 100644 index 00000000..2f127d6c --- /dev/null +++ b/entry/src/main/ets/pages/RunEnvCheck/README.md @@ -0,0 +1,5 @@ + +该目录主要针对运行环境得检测
+CheckDriver 用于检测运行设备,设备区分平板和PC
+CheckDispMode 用于检测设备窗口运行模式,这里分为自由多窗.要求用户强制使用自由多窗获取更好建模体验
+同时该目录具备一个监听功能,发现用户修改模式后,实时弹出提醒.
diff --git a/entry/src/main/ets/pages/RunEnvCheck/RunEnvCheck.ets b/entry/src/main/ets/pages/RunEnvCheck/RunEnvCheck.ets new file mode 100644 index 00000000..e69de29b