diff --git a/src/control/dashboard/portlet/portlet-part/portlet-part.state.ts b/src/control/dashboard/portlet/portlet-part/portlet-part.state.ts index 4ee67df33edd88617a2480974ee03c8d3b078bbc..c4ea77ffba207c89197634ddaa344f1a1c497673 100644 --- a/src/control/dashboard/portlet/portlet-part/portlet-part.state.ts +++ b/src/control/dashboard/portlet/portlet-part/portlet-part.state.ts @@ -29,6 +29,15 @@ export class PortletPartState implements IPortletState { containerDyna: [], }; + /** + * 上下文 + * + * @author zhanghengfeng + * @date 2024-08-05 20:08:34 + * @type {IContext} + */ + context!: IContext; + /** * 界面行为组状态 * @@ -36,4 +45,13 @@ export class PortletPartState implements IPortletState { * @memberof PortletPartState */ actionGroupState: IButtonContainerState | null = null; + + /** + * 门户标题 + * + * @author zhanghengfeng + * @date 2024-08-05 20:08:48 + * @type {(string | undefined)} + */ + title: string | undefined; } diff --git a/src/locale/index.ts b/src/locale/index.ts index 0d5ae4d699b07867e4caa3ac36353b767ebf78bb..d32a2695ba646ad703f307c4fe5850d5f556c5bb 100644 --- a/src/locale/index.ts +++ b/src/locale/index.ts @@ -94,6 +94,47 @@ export class IBizI18n implements I18n { options as IParams, ); } + + /** + * 合并语言资源 + * + * @author zhanghengfeng + * @date 2024-08-05 20:08:14 + * @param {IParams} data + */ + mergeLocaleMessage(data: IParams): void; + + /** + * 合并指定语言资源 + * + * @author zhanghengfeng + * @date 2024-08-05 20:08:24 + * @param {string} lang + * @param {IParams} data + */ + mergeLocaleMessage(lang: string, data: IParams): void; + + /** + * 合并语言资源 + * + * @author zhanghengfeng + * @date 2024-08-05 20:08:34 + * @param {(IParams | string)} dataOrLang + * @param {IParams} [data] + */ + mergeLocaleMessage(dataOrLang: IParams | string, data?: IParams): void { + if (typeof dataOrLang === 'string') { + const lang = dataOrLang; + i18n.global.mergeLocaleMessage(lang, data); + } else { + const langData = dataOrLang; + if (langData && Object.keys(langData).length > 0) { + Object.keys(langData).forEach(key => { + i18n.global.mergeLocaleMessage(key, langData[key]); + }); + } + } + } } const iBizI18n = new IBizI18n(); diff --git a/src/util/open-view-util/open-view-util.ts b/src/util/open-view-util/open-view-util.ts index 19c4d76e3a47ee627f74daa16ed4848f10c0c88a..1a18cd638a07692d576843d0631767236af2734f 100644 --- a/src/util/open-view-util/open-view-util.ts +++ b/src/util/open-view-util/open-view-util.ts @@ -1,3 +1,4 @@ +import { UrlHelper } from '@ibiz-template/core'; import { IModalData, IOpenViewUtil } from '@ibiz-template/runtime'; import { generateRoutePath, @@ -143,4 +144,29 @@ export class OpenViewUtil implements IOpenViewUtil { ibiz.log.warn('openUserCustom', appView, context, params); throw new Error(); } + + /** + * 独立程序打开 + * + * @author zhanghengfeng + * @date 2024-08-05 20:08:54 + * @param {string} appViewId + * @param {IContext} context + * @param {IParams} [params] + * @return {*} {Promise} + */ + async popupApp( + appViewId: string, + context: IContext, + params?: IParams, + ): Promise { + const appView = await ibiz.hub.config.view.get(appViewId!); + const { path } = await generateRoutePath( + appView, + this.router.currentRoute.value, + context, + params, + ); + window.open(`${UrlHelper.routeBase}${path}`, '_blank', 'popup'); + } }