本文整理匯總了TypeScript中ts/opg.api.comments方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript api.comments方法的具體用法?TypeScript api.comments怎麽用?TypeScript api.comments使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ts/opg.api
的用法示例。
在下文中一共展示了api.comments方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: constructor
constructor(currentRow) {
//debugger;
//console.log(currentRow);
opg.api.comments({id: currentRow.id}, function (data) {
let tb = opg('#tbRemarks').table({
data: data,
columns: [
{
text: '內容名稱', width: 220,
src: 'managerName'
},
{
text: '內容類型', width: 90,
src: 'contentType'
},
{
text: '已生產業務', width: 120,
src: 'busiCodes',
},
{
text: '生產中業務', width: 120,
src: 'produceBusiCodes',
},
{
text: '創建時間', width: 120,
src: 'createTime',
},
{
text: '時長', width: 120,
src: 'length',
},
{
text: '創建人', width: 90,
src: 'source',
},
]
});
let subData = [];
for (let i = 0, l = data.length; i < l; i++) {
let item = data[i];
let comments = item.comments || [];
let cmtArr = [];
for (let m = 0, n = comments.length; m < n; m++) {
let cmt = comments[m], prdCmts ;
try {
prdCmts = JSON.parse(cmt.produceComment);
}
catch (e) {
prdCmts = [];
}
for (let x = 0, y = prdCmts.length; x < y; x++) {
let prdCmt = prdCmts[x];
cmtArr.push({
text: prdCmt.text,
time: opg.convert.secondsToTimecode(prdCmt.time),
creator: cmt.creator,
stepCodeDesc: cmt.stepCodeDesc,
});
}
//subData
}
subData.push(cmtArr);
}
tb.tbody.find('tr').each(function (i, tr) {
let subTb = $(`
<tr><td colspan="7" style="padding: 3px; ">
<table class="grid">
<tbody><tr class="subTHead">
<th>審片意見</th>
<th style="width: 180px;">開始時間</th>
<th style="width: 90px;">審核人</th>
<th style="width: 90px;">工位</th>
</tr></tbody>
<tbody></tbody>
</table>
</td></tr><tr><td colspan="7" style="height: 10px; background-color: #f6f6f6;"></td></tr>`);
//console.log(subTb.find('tbody:last'));
subTb.find('tbody:last').bindList({
list: subData[i] ,
template: '<tr class="subTBody">' +
'<td style="white-space: normal;">${text}</td>' +
'<td class="text-center">${time}</td>' +
'<td class="text-center">${creator}</td>' +
'<td class="text-center">${stepCodeDesc}</td>' +
'</tr>',
});
$(tr).addClass('even').after(subTb);
});
});
//.........這裏部分代碼省略.........