本文整理匯總了TypeScript中ts/opg.ts.default.api.auditMedias方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ts.default.api.auditMedias方法的具體用法?TypeScript ts.default.api.auditMedias怎麽用?TypeScript ts.default.api.auditMedias使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ts/opg.ts.default.api
的用法示例。
在下文中一共展示了ts.default.api.auditMedias方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: opg
).then(() => {
//媒體文件
opg.api.auditMedias({assetId, orderId}, (data) => {
let arr = data.amsMediaFiles;
if (arr && arr.length)
mediaRow = arr[0];
else
return;
//
let comment: any;
try {
comment = JSON.parse(data.comment);
}
catch (e) {
comment = [];
}
let mediaInfo: MediaInfo = {
fileId: mediaRow.id,
filePath: mediaRow.workPath,
commentArray: comment,
orderId: orderId,
writable: false,
};
//媒體文件表
let tbMedia = opg('#tbVideo').table({
data: arr,
columns: [
{
text: '生產庫',
src: 'workPath'
},
/*{
text: '審核狀態',
src: 'auditStatus',
width: 150,
render: (val) => {
return mediaAuditStatus[val];
}
},*/
{
text: '操作',
src: 'workStatus',
width: 150,
render: (workStatus, i, row) => {
//if (workStatus == 3) {
if (!orderRow.executor || (orderRow.executor == currentUser.loginName)) {
mediaInfo.writable = true;
return `<button class="btnAudit btn-mini btn-warning" data-flid="${row.id}" data-ordid="${orderId}">審片</button>`;
}
else {
mediaInfo.writable = false;
return `<button class="btnView btn-mini btn-info" data-flid="${row.id}" data-ordid="${orderId}">查看</button>`;
}
//}
//return '';
}
},
]
});
//審片(4審)
tbMedia.tbody.on('click', '.btnAudit, .btnView', () => {
opg.dispatch('MediaInfoLoaded', mediaInfo);
if (mediaInfo.writable) {
//opg.api.auditFile({fileId: mediaInfo.fileId}, () => {
//todo: 狀態切換有多種情況,目前就隻做 待審核 & 審核中 切換
mediaRow.auditStatus = 1;
tbMedia.update();
//});
}
});
});
//元數據
opg.api.meta({assetId}, (data) => {
data.length = opg.format.timeLength(data.length);
data.vodArrange = contentUsages[data.vodArrange] || '';
data.copyrightType = copyRightTypes[data.copyrightType] || '';
data.defaultPriceType = priceTypes[data.defaultPriceType] || '';
data.sourceType = serialSourceTypes[data.sourceType] || '';
data.starLevel = starLevels[data.starLevel] || '';
data.rating = ratings[data.rating] || '';
if (data.originDate) data.originDate = data.originDate.split(' ')[0];
for (let attr in data) {
$(document.getElementById(attr)).text(`${data[attr]}`);
}
//todo:可能會有擴展類別
if (data.type != 1000) {
$('.forOne').find('*').css('visibility', 'visible');
}
else {
//.........這裏部分代碼省略.........