[OHIF-Viewers]医疗数字阅片-医学影像-Module: Panel-自定义面板-上
/extensions/modules/panel.html
Module: Panel
An extension can register a Panel Module by defining agetPanelModule
method. The panel module provides the ability to definemenuOptions
andcomponents
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
ThemenuOptions
'starget
key points to a registeredcomponents
'sid
. AdefaultContext
is applied to allmenuOption
s; however, eachmenuOption
can optional provide it's owncontext
value.
ThegetPanelModule
receives an object containing theExtensionManager
's associatedServicesManager
andCommandsManager
.
import MyComponent from './MyComponent.js';export default {id: 'example-panel-module',/*** @param {object} params* @param {ServicesManager} params.servicesManager* @param {CommandsManager} mandsManager*/getPanelModule({ servicesManager, commandsManager }) {return {menuOptions: [{// A suggested icon// Available icons determined by consuming appicon: 'list',// A suggested labellabel: 'Magic',// 'right' or 'left'from: 'right',// The target component to toggle open/closetarget: 'target-component-id',// UI Hint; If the target panel is in a "disabled" stateisDisabled: studies => {return false;},// Overrides `defaultContext`, if specifiedcontext: ['ACTIVE_VIEWPORT:MAGIC'],},],components: [{id: 'target-component-id',component: MyComponent,},],defaultContext: ['ROUTE:VIEWER'],};},};