码迷,mamicode.com
首页 > 其他好文 > 详细

[OHIF-Viewers]医疗数字阅片-医学影像-Module: Panel-自定义面板-上

时间:2020-07-15 15:02:39      阅读:62      评论:0      收藏:0      [点我收藏+]

标签:from   manage   pen   view   href   src   定义   example   医疗   

[OHIF-Viewers]医疗数字阅片-医学影像-Module: Panel-自定义面板-上

 

https://docs.ohif.org/extensions/modules/panel.html

Module: Panel

An extension can register a Panel Module by defining a getPanelModule method. The panel module provides the ability to define menuOptions and components that can be used by the consuming application. components are React Components that can be displayed in the consuming application‘s "Panel" Component.

技术图片

A panel extension example

The menuOptions‘s target key points to a registered components‘s id. A defaultContext is applied to all menuOptions; however, each menuOption can optional provide it‘s own context value.

The getPanelModule receives an object containing the ExtensionManager‘s associated ServicesManager and CommandsManager.

import MyComponent from ./MyComponent.js;

export default {
  id: example-panel-module,

  /**
   * @param {object} params
   * @param {ServicesManager} params.servicesManager
   * @param {CommandsManager} params.commandsManager
   */
  getPanelModule({ servicesManager, commandsManager }) {
    return {
      menuOptions: [
        {
          // A suggested icon
          // Available icons determined by consuming app
          icon: list,
          // A suggested label
          label: Magic,
          // ‘right‘ or ‘left‘
          from: right,
          // The target component to toggle open/close
          target: target-component-id,
          // UI Hint; If the target panel is in a "disabled" state
          isDisabled: studies => {
            return false;
          },
          // Overrides `defaultContext`, if specified
          context: [ACTIVE_VIEWPORT:MAGIC],
        },
      ],
      components: [
        {
          id: target-component-id,
          component: MyComponent,
        },
      ],
      defaultContext: [ROUTE:VIEWER],
    };
  },
};

 

[OHIF-Viewers]医疗数字阅片-医学影像-Module: Panel-自定义面板-上

标签:from   manage   pen   view   href   src   定义   example   医疗   

原文地址:https://www.cnblogs.com/landv/p/13304709.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!