@flatbiz/pro-layout 4.4.11 → 4.4.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -445,7 +445,9 @@ export type LayoutCtxProps = {
445
445
  onChangeSelectedKeys: (selectedKeys: string[]) => void;
446
446
  onChangeOpendKeys: (opendKeys: string[]) => void;
447
447
  addOrUpdateIframeTab: (item: TMenuItem) => void;
448
- onIframeChange: (id: string, type: "menuClick" | "iframeTabClick" | "iframeRefresh") => void;
448
+ onIframeChange: (id: string, type: "menuClick" | "iframeTabClick" | "iframeRefresh", options?: {
449
+ locationMenu?: boolean;
450
+ }) => void;
449
451
  onDeleteIframeTabItem: (type: "other" | "otherAll" | "all" | "me", id?: string) => void;
450
452
  onIframeChangeByHttpUrl: (url: string, options?: {
451
453
  name?: string;
@@ -457,6 +459,12 @@ export type LayoutCtxProps = {
457
459
  hideSidebarMenu?: boolean;
458
460
  /** 关闭当前iframe tab并打开指定iframe tab */
459
461
  onDeleteCurrentIframeTabItemOpenTargetIframeTab: (id: string | number, menuId?: string | number) => void;
462
+ /** 通过新iframe tab打开第三方菜单页面 */
463
+ onOpenNewIframeThirdMenuItem: (data: {
464
+ menuItem: TMenuItem;
465
+ link: string;
466
+ name: string;
467
+ }) => void;
460
468
  } & Omit<BootstrapOptions, "sidebarWidth" | "componentSize" | "locale" | "hideSidebarMenu">;
461
469
  export interface LeaveMenuProps {
462
470
  leaveMenus?: TMenuItem[];
@@ -596,6 +604,41 @@ export type IframeApiProps = {
596
604
  name: string;
597
605
  metaTitle?: string;
598
606
  }) => IframeApiProps;
607
+ /**
608
+ * 通过新iframe tab打开第三方页面
609
+ *
610
+ * ```
611
+ * 在第三方项目中触发在iframe main打开新tab,方法如下(案例:大数据-数据服务平台)
612
+ const openNewTabItem = (
613
+ menuItem: { id: string; link: string; name: string },
614
+ ) => {
615
+ if (menuItem?.id) {
616
+ window.parent.postMessage(
617
+ JSON.stringify({
618
+ type: 'FLATBIZ-LAYOUT',
619
+ data: {
620
+ type: 'redirect_to_frame_layout_menu_third_item',
621
+ data: {
622
+ menuId: menuItem.id,
623
+ options: {
624
+ link: menuItem.link,
625
+ name: menuItem.name,
626
+ },
627
+ },
628
+ },
629
+ }),
630
+ '*'
631
+ );
632
+ } else {
633
+ message.error(`未查询到菜单数据`);
634
+ }
635
+ };
636
+ * ```
637
+ */
638
+ openNewThirdTabItem: (menuId: string | number, options: {
639
+ link: string;
640
+ name: string;
641
+ }) => IframeApiProps;
599
642
  /** 打开新的浏览器窗口 */
600
643
  openBrowserWindow: (url: string) => IframeApiProps;
601
644
  /** 刷新当前iframe tab */
@@ -603,9 +646,7 @@ export type IframeApiProps = {
603
646
  /** iframe tab路由变更,可修改当前url地址(不会重新刷新当前页面) */
604
647
  tabItemHistoryChange: (link: string) => IframeApiProps;
605
648
  /** 通过菜单Id打开新的iframe tab窗口 */
606
- openNewTabItemByMenuId: (data: {
607
- id: string;
608
- }) => IframeApiProps;
649
+ openNewTabItemByMenuId: (id: string) => IframeApiProps;
609
650
  /** 关闭当前iframe-tab,跳转上一个链路tab */
610
651
  closedIframeTabToPrevlink: () => IframeApiProps;
611
652
  };
@@ -626,7 +667,6 @@ export type IframeApiProps = {
626
667
  * });
627
668
  *
628
669
  * ```
629
- * @returns
630
670
  */
631
671
  export declare const useIframe: <T>(onReceivedMessageCallback?: IframeHandler<T>) => IframeApiProps;
632
672
  export declare const LayoutPage: (props: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flatbiz/pro-layout",
3
- "version": "4.4.11",
3
+ "version": "4.4.12",
4
4
  "description": "WEB菜单布局",
5
5
  "main": "index.js",
6
6
  "typings": "index.d.ts",