From 2e0cfa782a2e0017cd4fc6ca336070b06f0425a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E6=94=BF=E6=9D=83?= <1978141412@qq.com> Date: Tue, 29 Oct 2024 19:35:01 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9Evue-text-format?= =?UTF-8?q?=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + pnpm-lock.yaml | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 62b6c978bf7..a49998f1048 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "async-validator": "^4.2.5", "cherry-markdown": "^0.8.26", "dingtalk-jsapi": "^3.0.38", + "vue-text-format": "^3.1.2", "dayjs": "^1.11.10", "echarts": "^5.4.3", "lodash-es": "^4.17.21", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c5f04e9708c..808bb3e05c2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -80,6 +80,9 @@ dependencies: vue-router: specifier: ^4.2.5 version: 4.2.5(vue@3.3.9) + vue-text-format: + specifier: ^3.1.2 + version: 3.1.2 vue3-hash-calendar: specifier: ^1.1.3 version: 1.1.3(vue@3.3.9) @@ -4604,7 +4607,6 @@ packages: engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] requiresBuild: true - dev: true optional: true /function-bind@1.1.2: @@ -7291,7 +7293,6 @@ packages: hasBin: true optionalDependencies: fsevents: 2.3.3 - dev: true /rollup@4.6.1: resolution: {integrity: sha512-jZHaZotEHQaHLgKr8JnQiDT1rmatjgKlMekyksz+yk9jt/8z9quNjnKNRoaM0wd9DC2QKXjmWWuDYtM3jfF8pQ==} @@ -8605,6 +8606,12 @@ packages: he: 1.2.0 dev: true + /vue-text-format@3.1.2: + resolution: {integrity: sha512-TxwtpH3Oj5ezzqNAZ6kAsncuaPUbhoMosBW1mMmtP53ju+EhclO6xH1yGvD884CB0inKRNfiqFXvktez7DQ+Iw==} + dependencies: + rollup: 3.29.4 + dev: false + /vue-tsc@1.8.24(typescript@5.3.2): resolution: {integrity: sha512-eH1CSj231OzVEY5Hi7wS6ubzyOEwgr5jCptR0Ddf2SitGcaXIsPVDvrprm3eolCdyhDt3WS1Eb2F4fGX9BsUUw==} hasBin: true -- Gitee From 054742aaddaec7c2f9f2c905012fc28eaebdac63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E6=94=BF=E6=9D=83?= <1978141412@qq.com> Date: Tue, 29 Oct 2024 19:36:07 +0800 Subject: [PATCH 2/4] =?UTF-8?q?feat:=20=E5=88=86=E9=A1=B5=E5=AF=BC?= =?UTF-8?q?=E8=88=AA=E3=80=81=E6=A0=91=E5=AF=BC=E8=88=AA=E8=A7=86=E5=9B=BE?= =?UTF-8?q?=E5=BC=95=E6=93=8E=E7=9B=91=E5=90=AC=E5=AE=9E=E4=BD=93=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/view-engine/mob-tab-exp-view.engine.ts | 55 ++++++++++++++++++++- src/view-engine/mob-tree-exp-view.engine.ts | 55 ++++++++++++++++++++- 2 files changed, 108 insertions(+), 2 deletions(-) diff --git a/src/view-engine/mob-tab-exp-view.engine.ts b/src/view-engine/mob-tab-exp-view.engine.ts index a21a4362cd6..50cfc2d73aa 100644 --- a/src/view-engine/mob-tab-exp-view.engine.ts +++ b/src/view-engine/mob-tab-exp-view.engine.ts @@ -1,3 +1,5 @@ +/* eslint-disable no-case-declarations */ +import { IPortalMessage } from '@ibiz-template/core'; import { ViewController, ITabExpPanelController, @@ -7,7 +9,7 @@ import { calcDeCodeNameById, IToolbarController, } from '@ibiz-template/runtime'; -import { IAppDETabExplorerView } from '@ibiz/model-core'; +import { IAppDataEntity, IAppDETabExplorerView } from '@ibiz/model-core'; export class MobTabExpViewEngine extends ViewEngineBase { /** @@ -80,6 +82,14 @@ export class MobTabExpViewEngine extends ViewEngineBase { return this.view.getController('footertoolbar') as IToolbarController; } + /** + * @description 当前多数据部件对应的应用实体对象 + * @protected + * @type {IAppDataEntity} + * @memberof MobTreeExpViewEngine + */ + protected dataEntity!: IAppDataEntity; + /** * 视图created生命周期执行逻辑 * @@ -96,6 +106,13 @@ export class MobTabExpViewEngine extends ViewEngineBase { this.view.slotProps.tabexppanel = {}; } this.view.slotProps.tabexppanel.defaultTabName = this.view.state.srfnav; + if (this.view.model.appDataEntityId) { + // 初始化实体属性id和name的映射 + this.dataEntity = await ibiz.hub.getAppDataEntity( + this.view.model.appDataEntityId!, + this.view.model.appId, + ); + } } async onMounted(): Promise { @@ -160,4 +177,40 @@ export class MobTabExpViewEngine extends ViewEngineBase { toolbar?.calcButtonState(data, appDeId); }); } + + /** + * @description 检测实体数据变更 + * @protected + * @param {IPortalMessage} msg + * @return {*} {void} + * @memberof MobTreeExpViewEngine + */ + protected onDEDataChange(msg: IPortalMessage): void { + // 非这个实体的数据变更,则不处理 + if ( + !msg.data || + (msg.data as IData).srfdecodename !== this.dataEntity?.codeName + ) { + return; + } + + let isRefresh = false; + const { srfkey } = msg.data as IData; + + // 只监听更新事件 + switch (msg.subtype) { + case 'OBJECTUPDATED': + const { srfactiveviewdata } = this.view.state; + if (srfactiveviewdata && srfactiveviewdata.srfkey === srfkey) { + isRefresh = true; + } + break; + default: + break; + } + + if (isRefresh) { + this.loadEntityData(); + } + } } diff --git a/src/view-engine/mob-tree-exp-view.engine.ts b/src/view-engine/mob-tree-exp-view.engine.ts index 304800dcee5..4e3b55e1523 100644 --- a/src/view-engine/mob-tree-exp-view.engine.ts +++ b/src/view-engine/mob-tree-exp-view.engine.ts @@ -1,3 +1,5 @@ +/* eslint-disable no-case-declarations */ +import { IPortalMessage } from '@ibiz-template/core'; import { ViewController, ITreeExpViewEvent, @@ -7,7 +9,7 @@ import { IExpBarControlController, calcDeCodeNameById, } from '@ibiz-template/runtime'; -import { IAppDETreeExplorerView } from '@ibiz/model-core'; +import { IAppDataEntity, IAppDETreeExplorerView } from '@ibiz/model-core'; export class MobTreeExpViewEngine extends ViewEngineBase { /** @@ -45,6 +47,14 @@ export class MobTreeExpViewEngine extends ViewEngineBase { return this.expBar.xDataController as ITreeController; } + /** + * @description 当前多数据部件对应的应用实体对象 + * @protected + * @type {IAppDataEntity} + * @memberof MobTreeExpViewEngine + */ + protected dataEntity!: IAppDataEntity; + async onCreated(): Promise { await super.onCreated(); const { childNames } = this.view; @@ -52,6 +62,13 @@ export class MobTreeExpViewEngine extends ViewEngineBase { if (!this.view.slotProps.treeexppanel) { this.view.slotProps.treeexppanel = {}; } + if (this.view.model.appDataEntityId) { + // 初始化实体属性id和name的映射 + this.dataEntity = await ibiz.hub.getAppDataEntity( + this.view.model.appDataEntityId!, + this.view.model.appId, + ); + } } async onMounted(): Promise { @@ -63,4 +80,40 @@ export class MobTreeExpViewEngine extends ViewEngineBase { } await this.loadEntityData(); } + + /** + * @description 检测实体数据变更 + * @protected + * @param {IPortalMessage} msg + * @return {*} {void} + * @memberof MobTreeExpViewEngine + */ + protected onDEDataChange(msg: IPortalMessage): void { + // 非这个实体的数据变更,则不处理 + if ( + !msg.data || + (msg.data as IData).srfdecodename !== this.dataEntity?.codeName + ) { + return; + } + + let isRefresh = false; + const { srfkey } = msg.data as IData; + + // 只监听更新事件 + switch (msg.subtype) { + case 'OBJECTUPDATED': + const { srfactiveviewdata } = this.view.state; + if (srfactiveviewdata && srfactiveviewdata.srfkey === srfkey) { + isRefresh = true; + } + break; + default: + break; + } + + if (isRefresh) { + this.loadEntityData(); + } + } } -- Gitee From a4aef58907a7156567b1c5b1c31927ab3c2a9958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E6=94=BF=E6=9D=83?= <1978141412@qq.com> Date: Tue, 29 Oct 2024 19:36:48 +0800 Subject: [PATCH 3/4] =?UTF-8?q?style:=20=E8=A1=A8=E5=8D=95=E9=A1=B9?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=9E=82=E7=9B=B4=E5=AF=B9=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form-item/form-item-container/form-item-container.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/control/form/form-detail/form-item/form-item-container/form-item-container.scss b/src/control/form/form-detail/form-item/form-item-container/form-item-container.scss index 8af1af17d69..d4b89a4fed8 100644 --- a/src/control/form/form-detail/form-item/form-item-container/form-item-container.scss +++ b/src/control/form/form-detail/form-item/form-item-container/form-item-container.scss @@ -72,6 +72,7 @@ $form-item-label: (line-height: 1, overflow: visible; color: getCssVar(form-item-label, text-color); height: getCssVar(form-item, line-height); + line-height: getCssVar(form-item, line-height); span { @include utils-ellipsis; -- Gitee From c398ea7745b2379beb375e33da02c7d8c957a6cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E6=94=BF=E6=9D=83?= <1978141412@qq.com> Date: Tue, 29 Oct 2024 19:37:04 +0800 Subject: [PATCH 4/4] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 892efcfdcc8..5c2629e2dbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,15 @@ ## [Unreleased] +### Added + +- 新增vue-text-format依赖 + +### Change + +- 分页导航、树导航视图引擎监听实体数据变化 +- 表单项标签垂直对齐 + ## [0.0.32] - 2024-10-29 ### Added -- Gitee