本文整理汇总了TypeScript中app/core/ui-services/csv-export.service.CsvExportService类的典型用法代码示例。如果您正苦于以下问题:TypeScript service.CsvExportService类的具体用法?TypeScript service.CsvExportService怎么用?TypeScript service.CsvExportService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了service.CsvExportService类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: exportStatutes
/**
* Export all statute paragraphs as CSV
*
* @param statute statute PParagraphs to export
*/
public exportStatutes(statutes: ViewStatuteParagraph[]): void {
const exportProperties: CsvColumnDefinitionProperty<ViewStatuteParagraph>[] = [
{ property: 'title' },
{ property: 'text' }
];
this.csvExport.export(statutes, exportProperties, this.translate.instant('Statute') + '.csv');
}
示例2: exportMotionList
/**
* Export all motions as CSV
*
* @param motions Motions to export
* @param contentToExport content properties to export
*/
public exportMotionList(motions: ViewMotion[], contentToExport: string[]): void {
const properties = sortMotionPropertyList(['identifier', 'title'].concat(contentToExport));
const exportProperties: (
| CsvColumnDefinitionProperty<ViewMotion>
| CsvColumnDefinitionMap<ViewMotion>)[] = properties.map(option => {
if (option === 'recommendation') {
return {
label: 'recommendation',
map: motion => this.motionRepo.getExtendedRecommendationLabel(motion)
};
} else if (option === 'state') {
return {
label: 'state',
map: motion => this.motionRepo.getExtendedStateLabel(motion)
};
} else if (option === 'motion_block') {
return {
label: 'Motion block',
map: motion => (motion.motion_block ? motion.motion_block.getTitle() : '')
};
} else {
return { property: option } as CsvColumnDefinitionProperty<ViewMotion>;
}
});
this.csvExport.export(motions, exportProperties, this.translate.instant('Motions') + '.csv');
}
示例3: exportMotionList
/**
* Export all motions as CSV
*
* @param motions Motions to export
* @param contentToExport content properties to export
* @param infoToExport meta info to export
*/
public exportMotionList(motions: ViewMotion[], contentToExport: string[], infoToExport: InfoToExport[]): void {
const propertyList = ['identifier', 'title'].concat(contentToExport, infoToExport);
const exportProperties: CsvColumnDefinitionProperty<ViewMotion>[] = propertyList.map(option => {
return { property: option } as CsvColumnDefinitionProperty<ViewMotion>;
});
this.csvExport.export(motions, exportProperties, this.translate.instant('Motions') + '.csv');
}
示例4: exportDummyMotion
public exportDummyMotion(): void {
const headerRow = ['Identifier', 'Title', 'Text', 'Reason', 'Submitters', 'Category', 'Origin', 'Motion block'];
const rows = [
['A1', 'Title 1', 'Text 1', 'Reason 1', 'Submitter A', 'Category A', 'Last Year Conference A', 'Block A'],
['B1', 'Title 2', 'Text 2', 'Reason 2', 'Submitter B', 'Category B', null, 'Block A'],
[null, 'Title 3', 'Text 3', null, null, null, null, null]
];
this.csvExport.dummyCSVExport(headerRow, rows, `${this.translate.instant('motions-example')}.csv`);
}
示例5: exportDummyCSV
/**
* Exports a short example file
*/
public exportDummyCSV(): void {
const header = ['Title', 'Text'];
const rows = [
['ยง1', 'This is the first section'],
['ยง1, A 3', 'This is another important aspect'],
['ยง2', 'Yet another']
];
const filename = `${this.translate.instant('Statute')}-${this.translate.instant('example')}.csv`;
this.csvExport.dummyCSVExport(header, rows, filename);
}
示例6: downloadCsvExample
/**
* Triggers an example csv download
*/
public downloadCsvExample(): void {
const headerRow = ['Title', 'Text', 'Duration', 'Comment', 'Internal item'];
const rows = [
['Demo 1', 'Demo text 1', '1:00', 'test comment', null],
['Break', null, '0:10', null, 'internal', null],
['Demo 2', 'Demo text 2', '1:30', null, 'hidden']
];
this.exporter.dummyCSVExport(
headerRow,
rows,
`${this.translate.instant('Agenda')}-${this.translate.instant('example')}.csv`
);
}
示例7: downloadCsvExample
/**
* Triggers an example csv download
*/
public downloadCsvExample(): void {
const headerRow = [
'Title',
'Given name',
'Surname',
'Structure level',
'Participant number',
'Groups',
'Comment',
'Is active',
'Is present',
'Is a committee',
'Initial password',
'Email'
];
const rows = [
[
'Dr.',
'Max',
'Mustermann',
'Berlin',
1234567890,
'Delegates, Staff',
'xyz',
1,
1,
,
'initialPassword',
null
],
[
null,
'John',
'Doe',
'Washington',
'75/99/8-2',
'Committees',
'This is a comment, without doubt',
1,
1,
null,
null,
'john.doe@email.com'
],
[null, 'Fred', 'Bloggs', 'London', null, null, null, null, null, null, null, null],
[null, null, 'Executive Board', null, null, null, null, null, null, 1, null, null]
];
this.exporter.dummyCSVExport(headerRow, rows, `${this.translate.instant('participants-example')}.csv`);
}
示例8: exportItemList
/**
* Export all Agendas as CSV
*
* @param Agendas Agendas to export
*/
public exportItemList(items: ViewItem[]): void {
this.csvExport.export(
items,
[
{ label: 'Title', map: viewItem => viewItem.getTitle() },
{
label: 'Text',
map: viewItem => (viewItem.contentObject ? viewItem.contentObject.getCSVExportText() : '')
},
{ label: 'Duration', property: 'duration' },
{ label: 'Comment', property: 'comment' },
{ label: 'Item type', property: 'verboseCsvType' }
],
this.translate.instant('Agenda') + '.csv'
);
}
示例9: exportCallList
/**
* Exports the call list.
*
* @param motions All motions in the CSV. They should be ordered by callListWeight correctly.
*/
public exportCallList(motions: ViewMotion[]): void {
this.csvExport.export(
motions,
[
{ label: 'Called', map: motion => (motion.sort_parent_id ? '' : motion.identifierOrTitle) },
{ label: 'Called with', map: motion => (!motion.sort_parent_id ? '' : motion.identifierOrTitle) },
{ label: 'submitters', map: motion => motion.submitters.map(s => s.short_name).join(',') },
{ property: 'title' },
{
label: 'recommendation',
map: motion => (motion.recommendation ? this.motionRepo.getExtendedRecommendationLabel(motion) : '')
},
{ property: 'motion_block', label: 'Motion block' }
],
this.translate.instant('Call list') + '.csv'
);
}