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


TypeScript store.Cache類代碼示例

本文整理匯總了TypeScript中ts/util/store.Cache的典型用法代碼示例。如果您正苦於以下問題:TypeScript Cache類的具體用法?TypeScript Cache怎麽用?TypeScript Cache使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Cache類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: modifyCopyrightTime

	/**
	 * 修改版權時間
	 * @param row
	 * @param tb
	 */
	static modifyCopyrightTime( row: any , tb: Table) {

		let cache = Cache.getInstance();
		let cacheKey = 'contract';

		console.log(row);
		cache.set(cacheKey, row);

		let pop = top.opg.confirm(`<iframe src="${moduleRoot}time.html" />`, function (i, ifr) {
			ifr.doSave(pop , tb);
			return true;
		}, {
			title: '修改版權時間',
			btnMax: true,
			width: 680,
			height: 400,
			buttons: {
				ok: '保存',
				cancel: '返回',
			},
			onClose: function () {
				cache.remove(cacheKey);
				tb.update();
			},
		});
	}
開發者ID:rpdg,項目名稱:fy.js,代碼行數:31,代碼來源:contract.ts

示例2: function

		opg.api.uploadPic(formData , (data)=>{

			let cache = Cache.getInstance();
			cache.set('imgUpload' , data);

			let container = `<iframe src="/page/produce/catalog/viewImage.html"></iframe>`;

			let previewWin = top.opg.confirm(container , function (i , iframe) {
				iframe.doSave(assetId , previewWin) ;
				return true ;
			} , {
				title: `圖片預覽`,
				btnMax : true ,
				width: 600,
				height: 420,
				buttons: {
					ok: `保存圖片`,
					cancel: '取消',
				},
				onDestroy : function () {
					console.warn("cache.remove('imgUpload');");
					cache.remove('imgUpload');
				}
			}).toggle();

			pop.close();
		});
開發者ID:rpdg,項目名稱:fy.js,代碼行數:27,代碼來源:uploadImage.ts

示例3: port

function port(assetId){
	parent.window['importMetaData'](assetId);
	let cache = Cache.getInstance();
	let pop = cache.get('importWin');
	cache.remove('importWin');
	pop.close();
}
開發者ID:rpdg,項目名稱:fy.js,代碼行數:7,代碼來源:copyInfo.ts

示例4: function

tb.jq.on('click' , '.port' , function () {
	let elem = $(this) , idx = elem.data('idx');
	let data = dbData[idx];

	let cache = Cache.getInstance();
	let win = cache.get('windowSrc');
	win.importDbData(data);

	let pop = cache.get('importWin');
	pop.close();

});
開發者ID:rpdg,項目名稱:fy.js,代碼行數:12,代碼來源:douban.ts

示例5: constructor

	constructor(row) {

		if (row.type == 3000) {//電視劇
			this.createEpisode(row);
		}
		else {//其他
			this.createTable(row);
		}


		let cache = Cache.getInstance();

		//delete
		this.tbMedia.tbody.on('click', '.btnDelete', function () {
			let btn = $(this),
				title = btn.data('title'),
				id = btn.data('id');

			opg.confirm(`要刪除“<b>${title}</b>”嗎?`, () => {
				opg.api.delete({id: id}, () => {
					if (row.type == 3000){
						btn.parent().parent().remove();
						//opg.ok(`刪除節目 <b>${title}</b> 成功`);
					}
					else{
						cache.remove('currentRow');

						let pop:PopUp = cache.get('currentViewWindow');
						pop.close();
					}
				});
			});
		});

		
		//delete media file
		this.tbMedia.tbody.on('click', '.btnDeleteFile', function () {
			let btn = $(this),
				title = btn.data('title'),
				id = btn.data('id');

			opg.confirm(`要刪除此文件嗎?`, () => {
				opg.api.deleteFile({id: id}, () => {
					btn.parent().parent().remove();
					/*opg.ok(`刪除文件成功`, () => {
						//PopUp.closeLast();
					});*/
				});
			});
		});
	}
開發者ID:rpdg,項目名稱:fy.js,代碼行數:51,代碼來源:viewMedia.ts

示例6: function

subMenu.on('click', 'a', function () {
	let sm = $(this);
	sm.addClass('cur').siblings('.cur').removeClass('cur');
	Cache.empty();
	//mainFrame.attr('src', sm.attr('href') as string);
	mainFrameWindow.location.replace(sm.attr('href'));

	location.hash = curMainMenuId + sm[0].id;


	if (sm.hasClass('hasChildren')) {
		console.warn(sm.text() + ' has permission control!');
	}
	return false;
});
開發者ID:rpdg,項目名稱:fy.js,代碼行數:15,代碼來源:main.ts

示例7: opg

$('.btn-douban').click(function () {
	let pop = opg(`<iframe src="/page/produce/catalog/douban.html" />`).popup({
		title: '豆瓣查詢',
		width: 720,
		height: 480,
		btnMax: true,
		onDestroy: function () {
			cache.remove('windowSrc');
			cache.remove('importWin');
		}
	});

	let cache = Cache.getInstance();
	cache.set('importWin', pop);
	cache.set('windowSrc', window);
});
開發者ID:rpdg,項目名稱:fy.js,代碼行數:16,代碼來源:metaData.ts

示例8: modify

	/**
	 * 修改版權合同(帶節目列表展示)
	 * @param contractId
	 * @param tb
	 */
	static modify(contractId: string, tb: Table) {

		let cache = Cache.getInstance();
		let cacheKey = 'currentPop';

		let pop = opg.popTop(`<iframe src="${moduleRoot}add.html?contractId=${contractId}" />`, {
			title: '修改版權合同',
			btnMax: true,
			width: 900,
			height: 600,
			onClose: function () {
				cache.remove(cacheKey);
				tb.update();
			},
		});

		cache.set(cacheKey, pop);
	}
開發者ID:rpdg,項目名稱:fy.js,代碼行數:23,代碼來源:contract.ts

示例9: function

					return `<button class="btn-mini btn-warning" data-oid="${val}" data-aid="${row.assetId}" data-title="${row.managerName}" data-idx="${row[':index']}">二審</button>`;
				//return '';
				return `<button class="btn-mini btn-info" data-oid="${val}" data-aid="${row.assetId}" data-title="${row.managerName}" data-idx="${row[':index']}">查看</button>`;
			}
		}
	],
	api: opg.api.audit,
	onAjaxEnd: (data) => {
		list = data.results;
	},
	pagination: {
		pageSize: 10
	}
});

let cache = Cache.getInstance(), list = [];

//edit
tb.tbody.on('click', '.btn-warning', function () {
	let btn = $(this),
		title = btn.data('title'),
		assetId = btn.data('aid'),
		orderId = btn.data('oid'),
		idx = btn.data('idx') ,
		row = list[idx];

	opg.api.checkAuditPermission({orderId}, function (data) {
		if (data.result) {
			if(!row.executor)
				tb.update();
開發者ID:rpdg,項目名稱:fy.js,代碼行數:30,代碼來源:index.ts

示例10: function

import opg from 'ts/opg.ts';

import {Cache} from 'ts/util/store' ;


let cache = Cache.getInstance();


let assetId = opg.request['assetId'] ;

$('#tbImages').on('click' , '.btn-info' , function () {
	//製作
	cache.set('srcWindow' ,window);

	let size = $(this).data('size');

	//cache.set('curImage' , document.getElementById(`img_${size}`));
	//console.warn(cache.get('curImage') , `img_${size}` ) ;

	let pop = top.opg(`<iframe src="/page/produce/catalog/metaDataGenImage.html?assetId=${assetId}&size=${size}"></iframe>`).popup({
		title: `製作圖片`,
		btnMax : true ,
		width: 680,
		height: 480,
		buttons :{
			ok : '上傳',
			cancel : '返回',
		},
		callback:function (i, ifr) {
			//console.log(i, ifr);
			if(i==0){
開發者ID:rpdg,項目名稱:fy.js,代碼行數:31,代碼來源:metaData_Image.ts


注:本文中的ts/util/store.Cache類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。