當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript store.store類代碼示例

本文整理匯總了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;未經允許,請勿轉載。