本文整理汇总了TypeScript中instant-report/module-definition.controller函数的典型用法代码示例。如果您正苦于以下问题:TypeScript controller函数的具体用法?TypeScript controller怎么用?TypeScript controller使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了controller函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
izendaInstantReportModule.controller('InstantReportDataSourceController', [
'$rootScope',
'$scope',
'$window',
'$timeout',
'$q',
'$log',
'$sce',
'$anchorScroll',
'$izendaUrlService',
'$izendaLocaleService',
'$izendaCompatibilityService',
'$izendaInstantReportQueryService',
'$izendaInstantReportPivotService',
'$izendaInstantReportValidationService',
'$izendaInstantReportStorageService',
'$izendaInstantReportSettingsService',
function (
$rootScope,
$scope,
$window,
$timeout,
$q,
$log,
$sce,
$anchorScroll,
$izendaUrlService,
$izendaLocaleService,
$izendaCompatibilityService,
$izendaInstantReportQueryService,
$izendaInstantReportPivotService,
$izendaInstantReportValidationService,
$izendaInstantReportStorageService,
$izendaInstantReportSettingsService) {
'use strict';
var vm = this;
var angularJq$ = angular.element;
$scope.$izendaInstantReportStorageService = $izendaInstantReportStorageService;
$scope.$izendaCompatibilityService = $izendaCompatibilityService;
$scope.$izendaUrlService = $izendaUrlService;
$scope.$izendaInstantReportSettingsService = $izendaInstantReportSettingsService;
$scope.trustAsHtml = function (value) {
return $sce.trustAsHtml(value);
};
vm.searchString = '';
vm.dataSources = null;
vm.isDataSourcesLoading = true;
vm.searchResults = [];
var previousResultsCount = null;
vm.searchPanelOpened = false;
vm.options = $izendaInstantReportStorageService.getOptions();
vm.columnSortPanelOpened = false;
vm.columnSortPanelButtonEnabled = false;
var searchState = {
timeoutId: null,
changing: false
};
var collapseState = {
started: false
};
/**
* Collapse animation completed handler.
*/
vm.collapseCompleted = function (collapsed) {
collapseState.started = false;
$scope.$applyAsync();
};
/**
* Toggle opened/collapsed state.
*/
vm.toggleItemCollapse = function (item) {
if (!collapseState.started) {
collapseState.started = true;
item.collapsed = !item.collapsed;
}
};
/**
* Turn off search panel and reset it to default state.
* @param {boolean} resetSearchResults. Clear search string and results.
*/
vm.turnOffSearch = function (resetSearchResults) {
vm.searchPanelOpened = false;
if (resetSearchResults) {
angular.element('#izInstDataSourcesTree').get(0).scrollTop = 0;
vm.searchString = '';
vm.searchResults = [];
previousResultsCount = null;
}
}
/**
* Run search query.
*/
//.........这里部分代码省略.........
示例2: function
izendaInstantReportModule.controller('InstantReportValidationController', [
'$rootScope',
'$scope',
'$izendaLocaleService',
'$izendaInstantReportValidationService',
function (
$rootScope,
$scope,
$izendaLocaleService,
$izendaInstantReportValidationService) {
'use strict';
var vm = this;
$scope.$izendaInstantReportValidationService = $izendaInstantReportValidationService;
vm.isValid = true;
vm.messages = [];
vm.infoMessages = [];
/**
* Initialize controller
*/
vm.init = function () {
$scope.$watch('$izendaInstantReportValidationService.getValidationMessages()', function (messages) {
vm.isValid = $izendaInstantReportValidationService.isReportValid();
vm.messages = [];
vm.infoMessages = [];
angular.element.each(messages, function () {
var message = this;
if (message.type === 'info') {
vm.infoMessages.push(message);
} else {
vm.messages.push(message);
}
});
});
};
}
]);
示例3: function
izendaInstantReportModule.controller('InstantReportFiltersController', [
'$rootScope',
'$scope',
'$window',
'$timeout',
'$q',
'$sce',
'$log',
'$izendaLocaleService',
'$izendaSettingsService',
'$izendaCompatibilityService',
'$izendaUtilUiService',
'$izendaInstantReportQueryService',
'$izendaInstantReportStorageService',
'$izendaInstantReportValidationService',
function (
$rootScope,
$scope,
$window,
$timeout,
$q,
$sce,
$log,
$izendaLocaleService,
$izendaSettingsService,
$izendaCompatibilityService,
$izendaUtilUiService,
$izendaInstantReportQueryService,
$izendaInstantReportStorageService,
$izendaInstantReportValidationService) {
'use strict';
$scope.$izendaLocaleService = $izendaLocaleService;
$scope.$izendaInstantReportStorageService = $izendaInstantReportStorageService;
$scope.$izendaSettingsService = $izendaSettingsService;
$scope.$izendaCompatibilityService = $izendaCompatibilityService;
var vm = this;
vm.panelOpened = false;
vm.filters = [];
vm.filterOptions = $izendaInstantReportStorageService.getFilterOptions();
vm.options = $izendaInstantReportStorageService.getOptions();
vm.activeFields = [];
vm.currentValue = '';
vm.dateFormat = $izendaSettingsService.getDateFormat();
vm.culture = $izendaSettingsService.getCulture();
/**
* Add new filter
*/
vm.addFilter = function (fieldSysName) {
$izendaInstantReportStorageService.createNewFilter(fieldSysName).then(function (filter) {
if (filter.field !== null && !filter.field.allowedInFilters) {
var errorTitle = $izendaLocaleService.localeText('js_Error', 'Error');
var errorText = $izendaLocaleService.localeText('js_FieldForbiddenForFiltering', 'This field is forbidden to use for filtering.');
$izendaUtilUiService.showNotification(errorText, errorTitle);
return;
}
$izendaInstantReportStorageService.getFilters().push(filter);
filter.initialized = true;
$izendaInstantReportValidationService.validateReportSet();
$izendaInstantReportStorageService.setFilterOperator(filter, null).then(function () {
$scope.$applyAsync();
});
});
};
/**
* Swap filter handler
*/
vm.reorderFilters = function (index1, index2) {
$izendaInstantReportStorageService.swapFilters(index1, index2);
var allfilters = $izendaInstantReportStorageService.getFilters();
var index = Math.min(index1, index2);
var filter = allfilters[index];
$izendaInstantReportStorageService.updateFieldFilterExistentValues(filter).then(function () {
$izendaInstantReportStorageService.refreshNextFiltersCascading(filter).then(function () {
$scope.$applyAsync();
});
});
};
/**
* Move to filter handler
*/
vm.moveFilterTo = function (index1, index2) {
$izendaInstantReportStorageService.moveFilterTo(index1, index2);
var allfilters = $izendaInstantReportStorageService.getFilters();
var index = Math.min(index1, index2);
index = index > 0 ? index - 1 : 0;
var filter = allfilters[index];
$izendaInstantReportStorageService.updateFieldFilterExistentValues(filter).then(function () {
$izendaInstantReportStorageService.refreshNextFiltersCascading(filter).then(function () {
$scope.$applyAsync();
});
});
}
/**
* Remove filter
*/
//.........这里部分代码省略.........
示例4: function
izendaInstantReportModule.controller('InstantReportFieldOptionsController', [
'$rootScope',
'$scope',
'$window',
'$timeout',
'$q',
'$sce',
'$log',
'$izendaLocaleService',
'$izendaCompatibilityService',
'$izendaInstantReportQueryService',
'$izendaInstantReportStorageService',
'$izendaInstantReportValidationService',
function (
$rootScope,
$scope,
$window,
$timeout,
$q,
$sce,
$log,
$izendaLocaleService,
$izendaCompatibilityService,
$izendaInstantReportQueryService,
$izendaInstantReportStorageService,
$izendaInstantReportValidationService) {
'use strict';
var vm = this;
var primaryButtonClass = "izenda-common-btn-dark",
activeButtonClass = "izenda-common-btn-dark active";
$scope.$izendaLocaleService = $izendaLocaleService;
$scope.$izendaInstantReportStorageService = $izendaInstantReportStorageService;
vm.field = null;
vm.currentSortFunction = 'asc';
vm.isSubtotalsEnabled = false;
vm.drillDownStyles = $izendaInstantReportStorageService.getDrillDownStyles();
vm.subreports = $izendaInstantReportStorageService.getSubreports();
vm.expanded = false;
vm.ddkValuesMaxAmount = -1;
/**
* Get class
*/
vm.getPanelClass = function () {
if ($izendaCompatibilityService.isSmallResolution())
return 'expanded';
if (!angular.isObject(vm.field) || !$scope.irController.isLeftPanelBodyActive(0))
return 'collapsed';
if (vm.expanded)
return 'expanded';
return '';
};
/**
* Get classes for validate messages icon
*/
vm.getValidateMessageIconClass = function (message) {
return message;
};
/**
* Fires when description was set manually.
*/
vm.onDescriptionWasSet = function () {
$izendaInstantReportStorageService.applyDescription(vm.field);
};
/**
* Fires when group was selected
*/
vm.onFunctionSelected = function () {
if (vm.field.groupByFunction === null)
return;
$izendaInstantReportStorageService.onFieldFunctionApplied(vm.field);
};
/**
* Fires when typegroup was selected
*/
vm.onTypeGroupSelected = function () {
$izendaInstantReportStorageService.onExpressionTypeGroupApplied(vm.field);
};
/**
* Fires when expression changed.
*/
vm.onExpressionChanged = function () {
$izendaInstantReportStorageService.onExpressionApplied();
};
/**
* Update preview
*/
vm.applyChanges = function () {
$izendaInstantReportValidationService.validateReportSetAndRefresh();
};
/**
* Toggle label justification
//.........这里部分代码省略.........
示例5: function
izendaInstantReportModule.controller('InstantReportPivotsController', [
'$rootScope',
'$scope',
'$izendaLocaleService',
'$izendaCompatibilityService',
'$izendaInstantReportStorageService',
'$izendaInstantReportPivotService',
'$izendaInstantReportValidationService',
function (
$rootScope,
$scope,
$izendaLocaleService,
$izendaCompatibilityService,
$izendaInstantReportStorageService,
$izendaInstantReportPivotService,
$izendaInstantReportValidationService) {
var vm = this;
$scope.$izendaInstantReportPivotService = $izendaInstantReportPivotService;
$scope.$izendaInstantReportStorageService = $izendaInstantReportStorageService;
vm.panelOpened = false; // pivot panel state
vm.activeFields = $izendaInstantReportStorageService.getAllFieldsInActiveTables(true);
vm.pivotColumn = $izendaInstantReportPivotService.getPivotColumn();
vm.pivotOptions = $izendaInstantReportPivotService.getPivotOptions();
vm.cellValues = $izendaInstantReportPivotService.getCellValues();
vm.selectedFields = [];
var updateSelectedFieldsArray = function () {
vm.selectedFields = [];
vm.cellValues.forEach(cellValue => {
if (cellValue)
vm.selectedFields.push($izendaInstantReportStorageService.getFieldBySysName(cellValue.sysname));
});
}
updateSelectedFieldsArray();
////////////////////////////
// pivot column
////////////////////////////
/**
* Get additional class for "add cell value" button.
* @returns {string} class names 'class1 class2 ...'.
*/
vm.getAddCellBtnClass = function () {
if (!vm.pivotColumn)
return 'disabled';
var result = false;
angular.element.each(vm.cellValues, function (iValue, value) {
if (!value)
result = true;
});
return result ? 'disabled' : '';
};
/**
* Update validation
*/
vm.updateValidation = function () {
$izendaInstantReportValidationService.validateReportSet();
};
/**
* Update validation state and refresh if needed.
*/
vm.updateReportSetValidationAndRefresh = function () {
$izendaInstantReportPivotService.setDefaultGroup();
$izendaInstantReportStorageService.clearReportPreviewHtml();
$izendaInstantReportStorageService.applyAutoGroups(true);
$izendaInstantReportValidationService.validateReportSetAndRefresh();
};
/**
* User selected pivot column
*/
vm.onPivotColumnFieldSelect = function () {
if (vm.pivotColumn !== null) {
var sourceField = $izendaInstantReportStorageService.getFieldBySysName(vm.pivotColumn.sysname);
var groupName = null;
var oldPivotColumn = $izendaInstantReportPivotService.getPivotColumn();
if (angular.isObject(oldPivotColumn) && sourceField.sysname === oldPivotColumn.sysname) {
groupName = oldPivotColumn.groupByFunction.value;
}
$izendaInstantReportStorageService.copyFieldObject(sourceField, vm.pivotColumn, true);
$izendaInstantReportStorageService.resetFieldObject(vm.pivotColumn);
vm.pivotColumn.isPivotColumn = true;
$izendaInstantReportPivotService.setPivotColumn(vm.pivotColumn);
$izendaInstantReportStorageService.initializeField(vm.pivotColumn).then(function () {
if (groupName !== null) {
angular.element.each(vm.pivotColumn.groupByFunctionOptions, function () {
if (this.value === groupName)
vm.pivotColumn.groupByFunction = this;
});
}
if (vm.cellValues.length === 0) {
//.........这里部分代码省略.........
示例6: function
izendaInstantReportModule.controller('InstantReportFormatController', [
'$rootScope',
'$scope',
'$window',
'$timeout',
'$q',
'$log',
'$izendaLocaleService',
'$izendaCompatibilityService',
'$izendaInstantReportStorageService',
'$izendaInstantReportSettingsService',
function (
$rootScope,
$scope,
$window,
$timeout,
$q,
$log,
$izendaLocaleService,
$izendaCompatibilityService,
$izendaInstantReportStorageService,
$izendaInstantReportSettingsService) {
'use strict';
$scope.$izendaCompatibilityService = $izendaCompatibilityService;
var vm = this;
vm.optGroups = {
'headerAndFooter': {
opened: false
},
'color': {
opened: false
},
'page': {
opened: false
},
'drilldowns': {
opened: false
}
};
$scope.$izendaInstantReportStorageService = $izendaInstantReportStorageService;
vm.options = $izendaInstantReportStorageService.getOptions();
vm.vgStyles = [];
vm.allActiveFields = [];
vm.drillDownFields = $izendaInstantReportStorageService.getDrillDownFields();
vm.selectedDrilldownField = null;
vm.settings = $izendaInstantReportSettingsService.getSettings();
vm.ddkValuesMaxAmount = vm.settings.ddkValuesMaxAmount;
vm.allowVirtualDataSources = vm.settings.allowVirtualDataSources;
/**
* Restore default color settings.
*/
vm.restoreDefaultColors = function () {
$izendaInstantReportStorageService.restoreDefaultColors();
};
/**
* Remove fields which are already in drilldown collection
*/
vm.removeDrilldownFieldsFromAvailable = function () {
vm.allActiveFields = angular.element.grep(vm.allActiveFields, function (f: any) {
var found = false;
angular.element.each(vm.drillDownFields, function () {
var ddField = this;
if (ddField.id === f.id)
found = true;
});
return !found;
});
};
/**
* update available collection
*/
vm.syncAvailableCollection = function () {
var activeTables = $izendaInstantReportStorageService.getActiveTables();
vm.allActiveFields = [];
angular.element.each(activeTables, function () {
var table = this;
angular.element.each(table.fields, function () {
vm.allActiveFields.push(this);
});
});
vm.removeDrilldownFieldsFromAvailable();
};
/**
* Add drilldown key
*/
vm.addDrilldown = function () {
if (vm.selectedDrilldownField === null)
return;
if (vm.drillDownFields.length >= vm.ddkValuesMaxAmount)
return;
vm.drillDownFields.push(vm.selectedDrilldownField);
vm.syncAvailableCollection();
};
//.........这里部分代码省略.........
示例7: function
izendaInstantReportModule.controller('InstantReportColumnsSortController', [
'$rootScope',
'$scope',
'$window',
'$timeout',
'$q',
'$sce',
'$log',
'$izendaLocaleService',
'$izendaCompatibilityService',
'$izendaInstantReportStorageService',
'$izendaInstantReportValidationService',
function (
$rootScope,
$scope,
$window,
$timeout,
$q,
$sce,
$log,
$izendaLocaleService,
$izendaCompatibilityService,
$izendaInstantReportStorageService,
$izendaInstantReportValidationService) {
'use strict';
$scope.$izendaInstantReportStorageService = $izendaInstantReportStorageService;
var vm = this;
//vm.panelOpened = false;
vm.activeFields = $izendaInstantReportStorageService.getAllActiveFields();
vm.columnReordered = function (fromIndex, toIndex, isVisualGroupColumn) {
$izendaInstantReportStorageService.moveFieldToPosition(fromIndex, toIndex, isVisualGroupColumn, false);
if (!$izendaCompatibilityService.isSmallResolution())
$izendaInstantReportValidationService.validateReportSetAndRefresh();
$scope.$applyAsync();
};
vm.columnSelected = function(field) {
$izendaInstantReportStorageService.applyFieldSelected(field, true);
$scope.$applyAsync();
};
/**
* Initialize watches
*/
vm.initWatchers = function () {
$scope.$watch('$izendaInstantReportStorageService.getAllActiveFields()', function (newActiveFields) {
vm.activeFields = newActiveFields;
}, true);
};
/**
* Initialize controller
*/
vm.init = function () {
};
vm.initWatchers();
}
]);
示例8: function
izendaInstantReportModule.controller('InstantReportController', [
'$rootScope',
'$scope',
'$window',
'$timeout',
'$cookies',
'$q',
'$log',
'$izendaUtilUiService',
'$izendaUrlService',
'$izendaLocaleService',
'$izendaSettingsService',
'$izendaCompatibilityService',
'$izendaScheduleService',
'$izendaShareService',
'$izendaInstantReportStorageService',
'$izendaInstantReportPivotService',
'$izendaInstantReportValidationService',
'$izendaInstantReportSettingsService',
function (
$rootScope,
$scope,
$window,
$timeout,
$cookies,
$q,
$log,
$izendaUtilUiService,
$izendaUrlService,
$izendaLocaleService,
$izendaSettingsService,
$izendaCompatibilityService,
$izendaScheduleService,
$izendaShareService,
$izendaInstantReportStorageService,
$izendaInstantReportPivotService,
$izendaInstantReportValidationService,
$izendaInstantReportSettingsService) {
'use strict';
var vm = this;
var UNCATEGORIZED = $izendaLocaleService.localeText('js_Uncategorized', 'Uncategorized');
$scope.$izendaInstantReportStorageService = $izendaInstantReportStorageService;
$scope.$izendaInstantReportPivotService = $izendaInstantReportPivotService;
$scope.$izendaInstantReportValidationService = $izendaInstantReportValidationService;
$scope.$izendaUrlService = $izendaUrlService;
$scope.$izendaLocaleService = $izendaLocaleService;
$scope.$izendaCompatibilityService = $izendaCompatibilityService;
$scope.$izendaScheduleService = $izendaScheduleService;
$scope.$izendaShareService = $izendaShareService;
vm.isSmallResolution = $izendaCompatibilityService.isSmallResolution();
vm.isSaveReportModalOpened = false;
vm.isLoading = true;
vm.previewHtml = $izendaInstantReportStorageService.getPreview();
vm.reportSetOptions = {
isVgUsed: false,
vgStyle: null,
sortedActiveFields: []
};;
vm.filtersPanelOpened = $izendaInstantReportStorageService.getFiltersPanelOpened();
vm.pivotsPanelOpened = $izendaInstantReportPivotService.getPivotsPanelOpened();
vm.isValid = true;
vm.activeField = null;
vm.filtersCount = $izendaInstantReportStorageService.getFilters().length;
vm.pivotCellsCount = $izendaInstantReportPivotService.getCellValues().length;
vm.top = $izendaInstantReportStorageService.getOptions().top;
vm.previewTop = $izendaInstantReportStorageService.getOptions().previewTop;
vm.activeFields = $izendaInstantReportStorageService.getAllActiveFields();
vm.settings = $izendaInstantReportSettingsService.getSettings();
vm.reportInfo = null;
vm.isExistingReport = false;
vm.currentInsertColumnOrder = -1; // used for select field position for drag'n'drop fields
// Left panel state object
var previewPanelId = 6;
vm.leftPanel = {
activeItem: 0,
previousPanelId: 0,
opened: true
};
vm.exportProgress = null;
vm.effectiveRights = $izendaCompatibilityService.getRights();
_updateReportSetRightVariables();
/**
* Wait message header for export and print
*/
vm.getWaitMessageHeaderText = function () {
if (vm.exportProgress === 'export') {
return $izendaLocaleService.localeText('js_ExportingInProgress', 'Exporting in progress.');
}
if (vm.exportProgress === 'print') {
return $izendaLocaleService.localeText('js_PrintingInProgress', 'Printing in progress.');
}
//.........这里部分代码省略.........
示例9: function
izendaInstantReportModule.controller('InstantReportChartsController', [
'$rootScope',
'$scope',
'$window',
'$timeout',
'$q',
'$izendaUrlService',
'$izendaLocaleService',
'$izendaCompatibilityService',
'$izendaInstantReportStorageService',
'$izendaInstantReportVisualizationService',
'$izendaInstantReportValidationService',
'$log',
function (
$rootScope,
$scope,
$window,
$timeout,
$q,
$izendaUrlService,
$izendaLocaleService,
$izendaCompatibilityService,
$izendaInstantReportStorageService,
$izendaInstantReportVisualizationService,
$izendaInstantReportValidationService,
$log) {
'use strict';
var vm = this;
$scope.$izendaInstantReportStorageService = $izendaInstantReportStorageService;
$scope.$izendaInstantReportVisualizationService = $izendaInstantReportVisualizationService;
vm.visualizationConfig = $izendaInstantReportVisualizationService.getVisualizationConfig();
vm.selectedChart = null;
/**
* Select chart
*/
vm.selectChart = function (chart) {
if (vm.selectedChart === chart) {
vm.selectedChart = null;
$izendaInstantReportStorageService.selectChart(null);
if (!$izendaCompatibilityService.isSmallResolution())
$izendaInstantReportValidationService.validateReportSetAndRefresh();
} else {
vm.selectedChart = chart;
$izendaInstantReportStorageService.selectChart(chart);
if (!$izendaCompatibilityService.isSmallResolution())
$izendaInstantReportValidationService.validateReportSetAndRefresh();
}
};
/**
* Prepare config
*/
vm.prepareConfig = function () {
if (!angular.isObject(vm.visualizationConfig))
return;
if (!angular.isArray(vm.visualizationConfig.categories))
return;
angular.element.each(vm.visualizationConfig.categories, function (iCategory: number, category: any) {
category.opened = iCategory === 0;
});
};
/**
* Open new window with chart help
* @param {object} chart object
*/
vm.showChartHelp = function (chart) {
if (!angular.isObject(chart))
throw 'Chart parameter should be object';
$window.open(chart.docUrl, '_blank');
};
/**
* Initialize controller
*/
vm.init = function () {
$scope.$watch('$izendaInstantReportVisualizationService.getVisualizationConfig()', function (visConfig) {
vm.visualizationConfig = visConfig;
vm.prepareConfig();
});
$scope.$watch('$izendaInstantReportStorageService.getSelectedChart()', function (chart) {
vm.selectedChart = chart;
});
};
}
]);