From 1b7f4f84f62cb39a1c008b5893c6172ef3e5bfda Mon Sep 17 00:00:00 2001 From: Cano1997 <1978141412@qq.com> Date: Fri, 21 Mar 2025 20:20:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?style:=20=E8=B0=83=E6=95=B4=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E6=A0=BC=E5=BC=8F=EF=BC=8C=E9=98=B2=E6=AD=A2=E6=89=93?= =?UTF-8?q?=E5=8C=85=E5=90=8E=E6=9D=83=E9=87=8D=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/control/wizard-panel/wizard-panel.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/control/wizard-panel/wizard-panel.scss b/src/control/wizard-panel/wizard-panel.scss index e65a3ffb..6e452d51 100644 --- a/src/control/wizard-panel/wizard-panel.scss +++ b/src/control/wizard-panel/wizard-panel.scss @@ -11,7 +11,8 @@ $control-wizard-panel: ( height: 100%; - @include e(form) { + // 防止权重不够 + .#{bem(control-wizardpanel, form)} { height: calc(100% - getCssVar('control-wizard-panel', 'footer-height')); overflow: auto; } -- Gitee From f2d36de578ba62f394e7c8d61800b938d6face14 Mon Sep 17 00:00:00 2001 From: Cano1997 <1978141412@qq.com> Date: Fri, 21 Mar 2025 20:24:31 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=90=91?= =?UTF-8?q?=E5=AF=BC=E8=A7=86=E5=9B=BE=E8=84=8F=E6=A3=80=E6=9F=A5=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 5 ++++ src/locale/en/index.ts | 2 ++ src/locale/zh-CN/index.ts | 1 + src/view-engine/wizard-view-engine.ts | 39 ++++++++++++++++++++++++++- 4 files changed, 46 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db251514..a210bce4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,11 @@ ### Fixed - 修复表格排序属性标识大小写不同导致的排序异常 +- 调整向导面板样式格式,防止打包后权重异常 + +### Added + +- 新增向导视图脏检查模式 ## [0.7.38-alpha.70] - 2025-03-20 diff --git a/src/locale/en/index.ts b/src/locale/en/index.ts index aaef3b96..0991000a 100644 --- a/src/locale/en/index.ts +++ b/src/locale/en/index.ts @@ -89,6 +89,8 @@ export default { missingToolbarModel: 'Missing toolbar component model', noCollapseTag: 'The fold identifier is not configured', noExpandTag: 'The expansion identifier is not configured', + confirmWizardPrompt: + 'The wizard operation is not complete. Are you sure to close the screen?', }, webApp: { authGuard: { diff --git a/src/locale/zh-CN/index.ts b/src/locale/zh-CN/index.ts index e717d90b..63862c82 100644 --- a/src/locale/zh-CN/index.ts +++ b/src/locale/zh-CN/index.ts @@ -83,6 +83,7 @@ export default { missingToolbarModel: '缺少工具栏部件模型', noCollapseTag: '未配置折叠标识', noExpandTag: '未配置展开标识', + confirmWizardPrompt: '向导操作未完成,确认关闭界面?', }, webApp: { authGuard: { diff --git a/src/view-engine/wizard-view-engine.ts b/src/view-engine/wizard-view-engine.ts index 39bcf7a5..96f873b0 100644 --- a/src/view-engine/wizard-view-engine.ts +++ b/src/view-engine/wizard-view-engine.ts @@ -31,10 +31,35 @@ export class WizardViewEngine extends ViewEngineBase { return this.view.getController('wizardpanel') as IWizardPanelController; } + /** + * 模态事件钩子 + * + * @param {{ allowClose?: boolean }} context + * @return {*} {Promise} + * @memberof WizardViewEngine + */ + async modalEventHook(context: { allowClose?: boolean }): Promise { + // 启用脏检查弹出提示 todo + const enableCheck = false; + if (enableCheck && context.allowClose == null) { + const isAllow = await ibiz.confirm.error({ + title: ibiz.i18n.t('viewEngine.closeRemind'), + desc: ibiz.i18n.t('viewEngine.confirmWizardPrompt'), + }); + if (!isAllow) { + context.allowClose = false; + } else { + context.allowClose = true; + } + } + } + async onCreated(): Promise { await super.onCreated(); - const { childNames } = this.view; + this.modalEventHook = this.modalEventHook.bind(this); + const { childNames, modal } = this.view; childNames.push('wizardpanel'); + modal.hooks.shouldDismiss.tapPromise(this.modalEventHook); } /** @@ -54,4 +79,16 @@ export class WizardViewEngine extends ViewEngineBase { this.view.closeView({ ok: true, data: event.data }); }); } + + /** + * 视图destroyed生命周期执行逻辑 + * + * @return {*} {Promise} + * @memberof WizardViewEngine + */ + async onDestroyed(): Promise { + super.onDestroyed(); + const { modal } = this.view; + modal.hooks.shouldDismiss.removeTapPromise(this.modalEventHook); + } } -- Gitee