@flatbiz/pro-layout 4.4.11 → 4.4.13

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
@@ -424,6 +424,9 @@ export type BootstrapOptions = {
424
424
  * @deprecated 已过期,判断业务中是否使用了model的全局异常拦截功能,如果没有使用可删除
425
425
  */
426
426
  verifySessionExpired?: (err: any) => boolean;
427
+ /** 当sidebar菜单有level限制时,限制数目 */
428
+ /** 侧边栏一级菜单是否可以多个打开,默认值: true */
429
+ siderBarFirstMenuFoldMultipleOpen?: boolean;
427
430
  };
428
431
  export type LayoutCtxProps = {
429
432
  menus: TMenuItem[];
@@ -445,7 +448,9 @@ export type LayoutCtxProps = {
445
448
  onChangeSelectedKeys: (selectedKeys: string[]) => void;
446
449
  onChangeOpendKeys: (opendKeys: string[]) => void;
447
450
  addOrUpdateIframeTab: (item: TMenuItem) => void;
448
- onIframeChange: (id: string, type: "menuClick" | "iframeTabClick" | "iframeRefresh") => void;
451
+ onIframeChange: (id: string, type: "menuClick" | "iframeTabClick" | "iframeRefresh", options?: {
452
+ locationMenu?: boolean;
453
+ }) => void;
449
454
  onDeleteIframeTabItem: (type: "other" | "otherAll" | "all" | "me", id?: string) => void;
450
455
  onIframeChangeByHttpUrl: (url: string, options?: {
451
456
  name?: string;
@@ -457,6 +462,12 @@ export type LayoutCtxProps = {
457
462
  hideSidebarMenu?: boolean;
458
463
  /** 关闭当前iframe tab并打开指定iframe tab */
459
464
  onDeleteCurrentIframeTabItemOpenTargetIframeTab: (id: string | number, menuId?: string | number) => void;
465
+ /** 通过新iframe tab打开第三方菜单页面 */
466
+ onOpenNewIframeThirdMenuItem: (data: {
467
+ menuItem: TMenuItem;
468
+ link: string;
469
+ name: string;
470
+ }) => void;
460
471
  } & Omit<BootstrapOptions, "sidebarWidth" | "componentSize" | "locale" | "hideSidebarMenu">;
461
472
  export interface LeaveMenuProps {
462
473
  leaveMenus?: TMenuItem[];
@@ -596,6 +607,41 @@ export type IframeApiProps = {
596
607
  name: string;
597
608
  metaTitle?: string;
598
609
  }) => IframeApiProps;
610
+ /**
611
+ * 通过新iframe tab打开第三方页面
612
+ *
613
+ * ```
614
+ * 在第三方项目中触发在iframe main打开新tab,方法如下(案例:大数据-数据服务平台)
615
+ const openNewTabItem = (
616
+ menuItem: { id: string; link: string; name: string },
617
+ ) => {
618
+ if (menuItem?.id) {
619
+ window.parent.postMessage(
620
+ JSON.stringify({
621
+ type: 'FLATBIZ-LAYOUT',
622
+ data: {
623
+ type: 'redirect_to_frame_layout_menu_third_item',
624
+ data: {
625
+ menuId: menuItem.id,
626
+ options: {
627
+ link: menuItem.link,
628
+ name: menuItem.name,
629
+ },
630
+ },
631
+ },
632
+ }),
633
+ '*'
634
+ );
635
+ } else {
636
+ message.error(`未查询到菜单数据`);
637
+ }
638
+ };
639
+ * ```
640
+ */
641
+ openNewThirdTabItem: (menuId: string | number, options: {
642
+ link: string;
643
+ name: string;
644
+ }) => IframeApiProps;
599
645
  /** 打开新的浏览器窗口 */
600
646
  openBrowserWindow: (url: string) => IframeApiProps;
601
647
  /** 刷新当前iframe tab */
@@ -603,9 +649,7 @@ export type IframeApiProps = {
603
649
  /** iframe tab路由变更,可修改当前url地址(不会重新刷新当前页面) */
604
650
  tabItemHistoryChange: (link: string) => IframeApiProps;
605
651
  /** 通过菜单Id打开新的iframe tab窗口 */
606
- openNewTabItemByMenuId: (data: {
607
- id: string;
608
- }) => IframeApiProps;
652
+ openNewTabItemByMenuId: (id: string) => IframeApiProps;
609
653
  /** 关闭当前iframe-tab,跳转上一个链路tab */
610
654
  closedIframeTabToPrevlink: () => IframeApiProps;
611
655
  };
@@ -626,7 +670,6 @@ export type IframeApiProps = {
626
670
  * });
627
671
  *
628
672
  * ```
629
- * @returns
630
673
  */
631
674
  export declare const useIframe: <T>(onReceivedMessageCallback?: IframeHandler<T>) => IframeApiProps;
632
675
  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.13",
4
4
  "description": "WEB菜单布局",
5
5
  "main": "index.js",
6
6
  "typings": "index.d.ts",