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

TypeScript store.store类代码示例

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

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



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

示例1: shortenDate

).done(() => {

	if (isEdit) {
		$('.forCreat').remove();


		opg.api.findProgramContract({relCopyrightProgramId}, (data) => {
			contractFullMeta = data;
			contractId = data.contractId;
			contractNumber = data.contractNumber;

			let contract = data.contract || {};
			let program = data.program || {};

			$('#tbdProgram').jsonToFields(program);
			$('#tbdContract').jsonToFields(contract);

			//
			data.authorizedCorp = data.authorizedCorp ? data.authorizedCorp.split(',') : [];
			data.authorizedPlatform = data.authorizedPlatform ? data.authorizedPlatform.split(',') : [];
			data.transmitMode = data.transmitMode ? data.transmitMode.split(',') : [];

			data.copyrightBeginDate = shortenDate(data.copyrightBeginDate);
			data.copyrightEndDate = shortenDate(data.copyrightEndDate);
			data.shareMoneyBeginDate = shortenDate(data.shareMoneyBeginDate);
			data.shareMoneyEndDate = shortenDate(data.shareMoneyEndDate);

			$('#tbd').jsonToFields(data);

			$('#copyrightRealBeginDate').text(shortenDate(data.copyrightRealBeginDate));
			$('#copyrightRealEndDate').text(shortenDate(data.copyrightRealEndDate));
			$('#copyrightType').text(copyrightType[data.copyrightType]);
			//$('#spTransmitMode').text(data.transmitModeCNDesc);
			//$('#chargeRequire').text(data.chargeRequire);
			//$('#authorizedLifeDesc').text(data.authorizedLifeDesc);
		});
	}
	else {
		$('.forEdit').remove();

		const currentUser = store.get('userInfo');
		$('#personInCharge').val(currentUser.name);
		$('#contractNumber').val(contractNumber);

	}
});
开发者ID:rpdg,项目名称:fy.js,代码行数:46,代码来源:detail.ts


示例2: exportAll

	/***
	 * 导出全量
	 */
	static exportAll(){
		let loading = $('#opgAjaxLoading');

		loading.show();
		let req = new XMLHttpRequest();
		req.open('GET', opg.api.download.get('url'),  true);
		req.responseType = 'blob';
		req.setRequestHeader('X-Token', store.get('X-Token'));
		req.onload = function (e) {
			//console.log(req.getResponseHeader('Content-Disposition'));
			loading.hide();
			if(req.status==200 || req.status == 0){
				let blob = req.response;
				let fileName = 'allcopyright.csv';
				if (window.navigator && window.navigator.msSaveBlob) {
					window.navigator.msSaveBlob(blob , fileName);
				}
				else {
					let link = document.createElement('a');
					link.href = window.URL.createObjectURL(blob);
					link.download = fileName;
					document.body.appendChild(link);
					link.click();
					setTimeout(function(){
						document.body.removeChild(link);
						window.URL.revokeObjectURL(link.href);
					}, 100);
				}
			}
			else{
				opg.err(req.statusText);
			}
		};

		req.send();

	}
开发者ID:rpdg,项目名称:fy.js,代码行数:40,代码来源:contract.ts


示例3:

import opg from 'ts/opg.ts';
import Panel from "ts/ui/Panel.ts";
import Table from "ts/ui/Table.ts";
import {Combo} from 'ts/ui/Combo' ;
import {store, Cache} from 'ts/util/store';
import PopUp from "ts/ui/Popup";
import AuditPutBack from '../@comm/auditPutBack' ;


let currentUser = store.get('userInfo');

console.log('currentUser', currentUser);

opg.api({
	contentType: 'content/contentType/findAll',
	sourceTypes: 'system/collection/collectSourceEnum',
	audit: 'audit/findPage?stepCode=collect_audit',
	checkAuditPermission: 'audit/checkAuditPermission/${orderId}',  //检查审核权限
	'pass!POST': 'audit/pass',
	'cancelAuditOrder!!': 'audit/cancelAuditOrder/${orderId}',  //取消审核
	'delete!DELETE!': 'transcode/business/delete/${id}',
});


let panel: Panel = opg.wrapPanel('#tbSearch', {
	title: '二审工单查询',
	btnSearchText: '<i class="ico-find"></i> 查询'
});
Combo.makeClearableInput($('#createTimeBegin').datetimepicker({
	timepicker: false,
	closeOnDateSelect: true,
开发者ID:rpdg,项目名称:fy.js,代码行数:31,代码来源:index.ts


示例4: function

import opg from "./opg";
import {store} from 'ts/util/store';

store.use('sessionStorage');

interface IConfig {
	apiServer: string ;
	ajaxTimeOut: number;
	loginPage: string;
	version: string;
	onServerError?: Function;
	onUnauthorizedError?:Function;
}

let cfg: IConfig = {
	apiServer: store.get('apiServer') || (window.CONFIG ? window.CONFIG.apiServer : null),
	ajaxTimeOut: 30000,
	loginPage: '/page/index.html',
	version: '6.7.3_20171117',
};

cfg.onUnauthorizedError = function () {
	let param = '', url = cfg.loginPage;
	if (top.window.location.hash) {
		param = '?returnUrl=' + encodeURIComponent(top.window.location.hash);
		url += param;
	}
	top.window.location.href = url;
};

开发者ID:rpdg,项目名称:fy.js,代码行数:29,代码来源:app.cfg.ts


示例5:

$('#liLogOff').click(() => {
	store.clear();
	window.location.href = cfg.loginPage;
});
开发者ID:rpdg,项目名称:fy.js,代码行数:4,代码来源:main.ts


示例6: function

	return function () {
		if (!form) {
			let currentUser = store.get('userInfo');
			let strForm = `<form style="width: 490px; padding: 20px;">
					<p>当前用户:<b>${currentUser.loginName}</b></p>
					<p><label>原有密码: <input id="old_password" name="old_password" type="password" maxlength="15" style="width:150px;"/></label></p>
					<p><label>新设密码: <input id="new_password" name="new_password" type="password" maxlength="15" style="width:150px;"/></label> <span class="text-gray"> (密码8~15位,大小写字母数字混合)</span></p>
					<p><label>重新输入: <input id="again_password" name="again_password" type="password" maxlength="15" style="width:150px;"/></label> <span class="text-gray"> (再次确认您要修改的密码)</span></p>
				</form>`;

			form = $(strForm);

			pop = opg.confirm(form, function () {
				let obj = form.fieldsToJson();

				if (!obj.old_password) {

					$('#old_password').iptError('原密码不能为空');

				}

				else if (!obj.new_password) {
					$('#new_password').iptError('新密码不能为空');

				}

				else if (obj.new_password.length < 8 || obj.new_password.length > 15) {
					$('#new_password').iptError('密码长度需要8~15位');
				}

				else if (!(/(?=.*[A-Z])(?=.*[a-z])(?=.*\d)/).test(obj.new_password)) {
					$('#new_password').iptError('密码需要由大小写数字混合');
				}

				else if (obj.new_password != obj.again_password) {
					$('#again_password').iptError('新密码两次输入不一致');
				}


				else {
					opg.api.editPassword(obj, function (json) {
						if (json.result) {
							pop.close();
							opg.ok('修改成功');
						}
						else
							opg.err('修改失败');
					});
				}
				return true;
			}, {
				title: '修改密码',
				show: false,
				destroy: false
			});
		}
		else {
			form[0].reset();
		}

		pop.open();
	};
开发者ID:rpdg,项目名称:fy.js,代码行数:62,代码来源:main.ts



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
TypeScript error_reporter.errorReporter类代码示例发布时间:2022-05-25
下一篇:
TypeScript store.Cache类代码示例发布时间: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