[]
        
(Showing Draft Content)

dashboard.VisualNS.CommandService

类: CommandService

dashboard.VisualNS.CommandService

Table of contents

构造方法

方法

构造方法

constructor

new CommandService()

方法

execute

execute(desc): void

执行命令。

参数

名称 类型 描述
desc ICommandDescription[] 命令描述。

返回值

void

示例代码

// 运行一个命令切换容器标签
this.visualHost.commandService.execute([{
		name: 'SelectTab',
		payload: {
			target: 'myTabContainer',
			index: 0,
		}
}]);

// 运行一个命令切换页面
this.visualHost.commandService.execute([{
		name: 'SwitchPage',
		payload: {
			index: 0,
		}
}]);

// 运行一个命令保留或排除数据点
this.visualHost.commandService.execute([{
		name: 'Keep', // or 'Exclude'
		payload: {
			selectionIds,
		},
}]);

// 运行一个命令跳转仪表板
this.visualHost.commandService.execute([{
 	name: 'Jump', // or 'Jump'
 	payload: {
			target: '组件1',
			selectionIds, //可选
			position: {
				x: number,
				y: number
			},
			jumpToName,
			jumpToPosition: {
				top: number,
				left: number
			}
		},
]});

// 运行一个命令钻取
this.visualHost.commandService.execute([{
	 	name: 'Drill',
	 	payload: {
			selectionIds,
			position: {
				x: number,
				y: number
			},
			drillDimension: string,
		},
}]);

// 运行一个命令显示组件
this.visualHost.commandService.execute([{
	 	name: 'ShowScenario',
	 	payload: {
			scenarioId: string;
			target: string, //可选
			enterAnimation: ScenarioAnimationType,
			delay: number;
			duration: number;
		},
}]);

// 运行一个命令隐藏组件
this.visualHost.commandService.execute([{
	 	name: 'HideScenario',
	 	payload: {
			scenarioId: string;
			target: string, //可选
			enterAnimation: ScenarioAnimationType,
			delay: number;
			duration: number;
		},
}]);

// 运行一个命令切换组件
this.visualHost.commandService.execute([{
	 	name: 'ToggleScenario',
	 	payload: {
			scenarioId: string;
			target: string, //可选
			enterAnimation: ScenarioAnimationType,
			delay: number;
			duration: number;
		},
}]);