本文整理汇总了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();
},
});
}
示例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();
});
示例3: port
function port(assetId){
parent.window['importMetaData'](assetId);
let cache = Cache.getInstance();
let pop = cache.get('importWin');
cache.remove('importWin');
pop.close();
}
示例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();
});
示例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();
});*/
});
});
});
}
示例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;
});
示例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);
});
示例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);
}
示例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();
示例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){