本文整理汇总了TypeScript中app/core/repositories/motions/workflow-repository.service.WorkflowRepositoryService类的典型用法代码示例。如果您正苦于以下问题:TypeScript service.WorkflowRepositoryService类的具体用法?TypeScript service.WorkflowRepositoryService怎么用?TypeScript service.WorkflowRepositoryService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了service.WorkflowRepositoryService类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: setStateOfMultiple
/**
* Opens a dialog and then sets the status for all motions.
*
* @param motions The motions to change
*/
public async setStateOfMultiple(motions: ViewMotion[]): Promise<void> {
const title = this.translate.instant('This will set the following state for all selected motions:');
const choices = this.workflowRepo.getWorkflowStatesForMotions(motions).map(workflowState => ({
id: workflowState.id,
label: workflowState.name
}));
const selectedChoice = await this.choiceService.open(title, choices);
if (selectedChoice) {
await this.repo.setMultiState(motions, selectedChoice.items as number);
}
}
开发者ID:jwinzer,项目名称:OpenSlides,代码行数:16,代码来源:motion-multiselect.service.ts
示例2: setRecommendation
/**
* Opens a dialog and sets the recommendation to the users choice for all selected motions.
*
* @param motions The motions to change
*/
public async setRecommendation(motions: ViewMotion[]): Promise<void> {
const title = this.translate.instant('This will set the following recommendation for all selected motions:');
const choices = this.workflowRepo
.getWorkflowStatesForMotions(motions)
.filter(workflowState => !!workflowState.recommendation_label)
.map(workflowState => ({
id: workflowState.id,
label: workflowState.recommendation_label
}));
const clearChoice = this.translate.instant('Delete recommendation');
const selectedChoice = await this.choiceService.open(title, choices, false, null, clearChoice);
if (selectedChoice) {
const requestData = motions.map(motion => ({
id: motion.id,
recommendation: selectedChoice.action ? 0 : (selectedChoice.items as number)
}));
await this.httpService.post('/rest/motions/motion/manage_multiple_recommendation/', {
motions: requestData
});
}
}
开发者ID:jwinzer,项目名称:OpenSlides,代码行数:26,代码来源:motion-multiselect.service.ts
注:本文中的app/core/repositories/motions/workflow-repository.service.WorkflowRepositoryService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论