• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript settings-service.getCategoryCharacter函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中common/query/services/settings-service.getCategoryCharacter函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getCategoryCharacter函数的具体用法?TypeScript getCategoryCharacter怎么用?TypeScript getCategoryCharacter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getCategoryCharacter函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: _getWantedReportFullName

	/**
	 * Check report name obtained from the 'rn' parameter and load default dashboard if rn parameter doesn't
	 * contain valid dashboard name.
	 * @param {object} location Location object.
	 * @returns {string} fixed dashboard full name (or empty string if can't find default dashboard).
	 */
	_getWantedReportFullName(location) {
		const urlFullName = location.fullName;
		const categories = this.categories.getValue();
		const isUrlFullNameExist =
			testFullName => categories.some(cat => cat.dashboards.some(dashName => dashName === testFullName));

		// calc current dashboard category
		const currentCategoryName = this._getWantedCategoryName();

		// calc current dashboard full name
		let currentDashboardFullName = '';
		let isCurrentDashbiardNameSet = false;
		if (isUrlFullNameExist(urlFullName)) {
			currentDashboardFullName = urlFullName;
			isCurrentDashbiardNameSet = true;
		}
		if (!isCurrentDashbiardNameSet && this.$izendaDashboardConfig.defaultDashboardName !== null) {
			currentDashboardFullName = this.$izendaDashboardConfig.defaultDashboardName;
			if (currentDashboardFullName && currentCategoryName && !this.$izendaUtilService.isUncategorized(currentCategoryName)) {
				currentDashboardFullName =
					currentCategoryName + this.$izendaSettingsService.getCategoryCharacter() + currentDashboardFullName;
			}
			isCurrentDashbiardNameSet = true;
		}

		// couldn't find dashboard - use first
		if (!isCurrentDashbiardNameSet) {
			const defaultCats = categories.filter(cat => cat.dashboards.length);
			currentDashboardFullName = defaultCats.length ? defaultCats[0].dashboards[0] : '';
		}

		return currentDashboardFullName;
	}
开发者ID:izenda,项目名称:resources,代码行数:39,代码来源:dashboard-storage-service.ts


示例2: getReportSetPreviewQueued

	/**
	 * Run reportSet preview request. If request R2 have come earlier that request R1 - R1 request cancels.
	 */
	getReportSetPreviewQueued(reportSetConfig) {
		this.cancelAllPreviewQueries();
		// prepare params
		const paramsArray = [
			'iic=1', // invalidate in cache
			'urlencoded=true',
			'wscmd=getNewReportSetPreviewFromJson',
			`wsarg0=${encodeURIComponent(JSON.stringify(reportSetConfig))}`
		];
		if (typeof (window.izendaPageId$) !== 'undefined')
			paramsArray.push(`izpid=${window.izendaPageId$}`);
		if (typeof (window.angularPageId$) !== 'undefined')
			paramsArray.push(`anpid=${window.angularPageId$}`);

		const rnParamValue = (reportSetConfig.reportCategory
			? reportSetConfig.reportCategory + this.$izendaSettingsService.getCategoryCharacter() + reportSetConfig.reportName
			: reportSetConfig.reportName);

		var resolver = this.$q.defer();
		const canceller = this.$q.defer();
		const req = {
			method: 'POST',
			url: this.$izendaUrlService.settings.urlRsPage,
			params: { 'rnalt': rnParamValue },
			timeout: canceller.promise,
			dataType: 'text',
			data: paramsArray.join('&'), // query parameters
			headers: {
				'Content-Type': 'text/html'
			}
		};

		// add request to current requests list
		this.requestList.push({
			canceller: canceller,
			resolver: resolver
		});

		const requestPromise = this.$http(req);
		requestPromise
			.then(
				response => resolver.resolve(response.data),
				response => {
					if (response.config.timeout.$$state.value !== 'Cancelled!') {
						//handle errors:
						const errorText = this.$izendaLocaleService.localeText('js_FailedToLoadPreview', 'Failed to load preview.');
						this.$izendaUtilUiService.showErrorDialog(errorText);
						resolver.reject(response.data);
					}
				});
		return resolver.promise;
	}
开发者ID:izenda,项目名称:resources,代码行数:55,代码来源:instant-report-query.ts


示例3: catch

		return this.$q((resolve, reject) => {
			try {

				// prepare report name variables
				let newReportName = reportName || null;
				let newReportCategory = categoryName || null;
				let newReportFullName: string;
				if (this.$izendaUtilService.isUncategorized(newReportCategory))
					newReportCategory = null;
				if (newReportName) {
					// if name was set
					newReportFullName = this.$izendaUtilService.createReportFullName(newReportName,
						this.$izendaSettingsService.getCategoryCharacter(),
						newReportCategory);
				} else {
					// if name wasn't set
					const currentLocation = this.location.getValue();
					newReportName = currentLocation.name;
					newReportCategory = currentLocation.category;
					newReportFullName = currentLocation.fullName;
				}

				// update report names in the model
				const model: IzendaDashboardModel = this.model.getValue();
				model.reportCategory = newReportCategory;
				model.reportName = newReportName;
				model.reportFullName = this.$izendaSettingsService.getReportFullName(newReportName, newReportCategory);

				// create json and send save request
				const json = this.createJsonConfigForSend();
				this.$izendaDashboardQueryService.saveDashboardNew(json).then(() => {
					this.$izendaUrlService.setReportFullName(newReportFullName);
					resolve();
				}, (error) => {
					reject(error);
				});
			} catch (e) {
				reject(e);
			}
		});
开发者ID:izenda,项目名称:resources,代码行数:40,代码来源:dashboard-storage-service.ts


示例4: itemSelectedHandler

	/**
	 * User clicked to report set item
	 */
	itemSelectedHandler(item) {
		const isReportPart = item.isReportPart;
		let reportFullName = item.Name;

		if (item.CategoryFull)
			reportFullName = item.CategoryFull + this.$izendaSettingsService.getCategoryCharacter() + reportFullName;

		if (!isReportPart) {
			// if report set selected
			this.isLoading = true;
			this.groups = [];
			this.$izendaCommonQueryService.getReportParts(reportFullName).then(data => {
				var reports = data.Reports;
				this.addReportPartsToModal(reports);
				this.isLoading = false;
			});
		} else {
			this.openedInner = false;
			// if report part selected
			if (angular.isFunction(this.onSelected))
				this.onSelected({ reportPartInfo: item });
		}
	}
开发者ID:izenda,项目名称:resources,代码行数:26,代码来源:select-report-component.ts


示例5:

			.map<string>(report => {
				const category = report.Category ? report.Category : this.uncategorizedText;
				return !report.Subcategory
					? category
					: category + this.$izendaSettingsService.getCategoryCharacter() + report.Subcategory;
			});
开发者ID:izenda,项目名称:resources,代码行数:6,代码来源:select-report-component.ts



注:本文中的common/query/services/settings-service.getCategoryCharacter函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript reducer.default函数代码示例发布时间:2022-05-25
下一篇:
TypeScript rs-query-service.rsQuery函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap