本文整理匯總了TypeScript中ts/opg.ts.default.api.newAsset方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ts.default.api.newAsset方法的具體用法?TypeScript ts.default.api.newAsset怎麽用?TypeScript ts.default.api.newAsset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ts/opg.ts.default.api
的用法示例。
在下文中一共展示了ts.default.api.newAsset方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: function
window['doSave'] = function (pop: Popup, tb: Table, parentWin: Window) {
let param = $('#tbForm').fieldsToJson({
onlineTime: {
require: true,
type: 'date',
name: '上線時間',
},
episodeStart: {
require: true,
type: 'number',
name: '起始集數',
},
episodeEnd: {
require: true,
type: 'number',
name: '結束集數',
},
busiCodesList: {
require: true,
name: '業務',
},
});
if (param) {
if (param.episodeEnd < param.episodeStart)
return opg.warn('結束集數應大等於開始集數');
for (let i = param.episodeStart, l = param.episodeEnd + 1; i < l; i++) {
if (programInfo.producedEpisodes.indexOf(i)>-1)
return opg.warn('新增的劇集含已生產集數');
}
param.processType = 'NewAsset'; // 新增內容
param.assetId = assetId;
param.episodeNum = param.episodeEnd - param.episodeStart + 1;
param.seriesFlag = 1;
/*param.managerName = programInfo.managerName;
param.showName = programInfo.showName;
param.contentType = programInfo.contentType;
param.programLength = programInfo.programLength;
param.movieType = programInfo.movieType;
param.profile = programInfo.profile;*/
if (param.onlineTime.indexOf(' 00:00:00') == -1)
param.onlineTime += ' 00:00:00';
param.collectAudit = (param.collectAudit == '1');
param.collectCatalog = (param.collectCatalog == '1');
param.collectAudit3 = (param.collectAudit3 == '1');
for (let key in programInfo) {
if (param[key] === undefined) {
param[key] = programInfo[key];
}
}
delete param.producedEpisodes;
delete param.businessStatus;
delete param.busiCodes;
delete param.profileDesc;
delete param.movieTypeDesc;
if (param.programMediaFileId)
param.programMediaFileId = +param.programMediaFileId;
console.log(param);
opg.api.newAsset(param, (data) => {
pop.close();
tb.update();
parentWin['doCatalog'](data.assetId, data.id, param.managerName);
});
}
};