本文整理汇总了TypeScript中ts/opg.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: opg
opg.api.roles(data => {
let d = data;
data.results = [d];
tree1 = opg('#tree1').tree({
data: data,
root: '角色',
name : 'rolesTree' ,
cmd: 'checkAll'
});
/*tree1.jq.on('change', ':checkbox', function () {
let elem = $(this), pId = elem.val(), deal = elem.prop('checked');
//console.warn('deal' , this);
if (deal) {
reservedCheckedRolesHash[pId] = true;
}
else {
delete reservedCheckedRolesHash[pId];
}
});*/
})/*,
开发者ID:rpdg,项目名称:fy.js,代码行数:22,代码来源:info.ts
示例2:
opg.api.sourcetype(data => {
opg('#sourceType').listBox({
data: data ,
value : 'code'
});
})
开发者ID:rpdg,项目名称:fy.js,代码行数:6,代码来源:info.ts
示例3:
let panel: Panel = opg.wrapPanel('#tbSearch', {
title: '采集源查询',
btnSearchText: '<i class="ico-find"></i> 查询'
});
panel.btnSearch.click(function () {
let param = $('#tbSearch').fieldsToJson();
param.pageNo = 1;
//param.spCode = sel.getValue();
console.log(param);
tb.update(param);
});
let spHash = {};
opg('#spCode').listBox({
api: opg.api.amssp,
value: 'code',
onAjaxEnd: data => {
let arr = data.results, l = arr.length;
while (l--) {
let sp = arr[l];
spHash[sp.code] = sp.name;
}
},
onCreate: ()=> {
tb.update();
}
});
开发者ID:rpdg,项目名称:fy.js,代码行数:29,代码来源:index.ts
示例4: ViewMedia
opg.api({
pics: 'audit/viewPics/${assetId}',
//信息
'auditFile!PUT': 'audit/auditFile/${fileId}', //更改媒体文件审核状态
});
let currentUser = store.get('userInfo');
const currentRow = cache.get('currentRow');
console.log(currentRow , currentUser);
const id = opg.request['id'] ;
opg('#mainTab').tabView({
data: [
{label: '媒体文件', view: '#d0'},
{label: '元数据', view: '#d1'},
{label: '图片文件', view: '#d2'},
{label: '审片意见', view: '#d3'},
{label: '关联版权', view: '#d4'},
]
});
/*.jq.append(`<div style="display: table-row; text-align: right; padding-top: 10px;">
<div style="display: table-cell"></div>
<button>buttons here</button>
</div>`);*/
//媒体文件
new ViewMedia(currentRow) ;
开发者ID:rpdg,项目名称:fy.js,代码行数:31,代码来源:view.ts
示例5: opg
opg.api({
roles: 'system/role/list',
'delete!delete!': 'system/role/delete/${roleId}'
});
opg.api.delete.set('codes', {
'role_blind_users': '该角色绑定有用户,不能删除',
'role_have_child': '该角色有子角色,不能删除',
});
const infoPage = '/page/admin/role/info.html';
let subNodeParentId = 0;
let nodeParentId = 0;
let rootAdminId = 0;
let tree = opg('#leftSec').tree({
api: opg.api.roles,
root: '角色',
name : 'rolesTree' ,
onAjaxEnd: (json)=> {
console.log(json);
let d = json;
json.results = [d];
//console.log(tree);
//tree.rootName = d.name;
},
onCreate: function () {
tree.root.find('li:eq(0)').find('.sp:eq(0)').click();
},
开发者ID:rpdg,项目名称:fy.js,代码行数:31,代码来源:index.ts
示例6: opg
import opg from 'ts/opg';
opg.api({
templates: 'admin/template/findPage',
'delete!GET!': 'admin/template/deleteById?id=${id}'
});
const infoPage = '/page/collection/templates/template.html';
//create a data table
let tb = opg('#tb').table({
api: opg.api.templates,
columns: [
{
text: '模板名称',
width: 200,
src: 'name'
},
{
text: '描述',
src: 'description'
},
{
text: '操作',
src: 'id',
width: 160,
render: (val, i, row)=> {
return `
<button class="btn-mini btn-info" data-id="${val}" data-title="${row.name}">修改</button>
开发者ID:rpdg,项目名称:fy.js,代码行数:31,代码来源:index.ts
示例7: function
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);
});
});
开发者ID:rpdg,项目名称:fy.js,代码行数:96,代码来源:viewAudit.ts
示例8: loopNode
opg.api.roleTree({parentRoleId}, (data)=> {
let actions = data.actions, x = actions.length;
while (x--) {
let p = actions[x];
if (!permissions[p.parentId]) {
permissions[p.parentId] = [];
}
permissions[p.parentId].push(p);
}
let menuData = data.menu ? data.menu : [];
function loopNode(list :Array) {
let z = list.length;
while (z--) {
let node = list[z];
if (node.id in permissions) {
node.children = permissions[node.id];
}
if (node.children) {
loopNode(node.children);
}
}
}
loopNode(menuData);
console.log('permissions', permissions);
tree2 = opg('#menuTree').tree({
data: menuData,
root: '菜单列表',
cmd: 'checkAll'
});
/*tree2.jq.on('change', ':checkbox', function (e) {
let elem = $(this), pId = ~~elem.val(), deal = elem.prop('checked');
//console.warn('deal' , this);
if (deal) {
reservedPermissionIdHash[pId] = true;
}
else {
delete reservedPermissionIdHash[pId];
}
});*/
if (id) {
opg.api.findById({roleId: id}, function (data) {
form.jsonToFields(data.role);
let checkedIds = data.checkedIds ? data.checkedIds : [];
checkedIds.map((v)=> {
reservedPermissionIdHash[v] = v;
});
console.log('checkedIds', reservedPermissionIdHash);
if (data.checkedIds) {
//选中全部被选择的
let l = data.checkedIds.length;
while (l--) {
let curId = data.checkedIds[l];
let chk = document.getElementById(`${tree2.treeName}Chk_${curId}`);
if (chk) {
$(chk).prop('checked', true);
delete reservedPermissionIdHash[curId];
}
}
console.warn('reservedPermissionIdHash', data, reservedPermissionIdHash);
//将子节点选中的条数与全部子节点比较
l = data.checkedIds.length;
while (l--) {
let sp = $('#' + tree2.treeName + 'Sp_' + data.checkedIds[l]);
if (sp.hasClass('folder')) {
let ul = $('#' + tree2.treeName + 'Ul_' + data.checkedIds[l]);
/*let li = ul.children('li');
let all = li.length;
if (all != li.children('span').children('label').children(':checkbox:checked').length) {
//console.error('uncheck' , data.checkedIds[l] , all , li.children('span').children(':checkbox:checked').length);
$('#tree' + tree2.guid + 'Chk_' + data.checkedIds[l]).prop('checked', false);
}*/
ul.find(':checkbox').prop('checked', true);
}
}
}
//.........这里部分代码省略.........
开发者ID:rpdg,项目名称:fy.js,代码行数:101,代码来源:info.ts
示例9: function
opg.api.findVideoMeta({mediaPath}, (data) => {
cachedMediaPath = mediaPath;
streams = data.streams;
//
let streamsHash = {}, streamHtml: string = '';
streams.map((stream, i) => {
let type = stream['codec_type'];
let entry = streamsHash[type];
if (!entry) {
streamsHash[type] = [stream];
}
else {
entry.push(stream);
}
streamHtml += `<table class="search-table" style="margin-bottom: 2em; "><tbody>`;
for (let key in stream) {
streamHtml += `<tr><td class="lead">${key}</td><td>${stream[key]}</td></tr>`
}
streamHtml += `</tbody></table>`;
});
//视频
let videoArr = streamsHash['video']||[];
videoArr.forEach((item) => {
item.title = item.title ? item.title : (item.language ? item.language : item.index);
});
opg('#videoTrack').listBox({
data: videoArr,
text: 'title',
value: 'index',
autoPrependBlank: false,
onSelect : function () {
videoFrames = this.selectedData.frames;
}
});
//音频
let audioArr = streamsHash['audio']||[];
audioArr.forEach((item) => {
item.title = item.title ? item.title : (item.language ? item.language : item.index);
});
opg('#audioTrack').listBox({
data: audioArr,
text: 'title',
value: 'index',
autoPrependBlank: false,
});
//字幕
let subtitleArr = streamsHash['subtitle']||[];
subtitleArr.forEach((item) => {
item.title = item.title ? item.title : (item.language ? item.language : item.index);
});
opg('#subtitleTrack').listBox({
data: subtitleArr,
text: 'title',
value: 'index',
autoPrependBlank: false,
});
//详情
let tdDetails = $('#tdDetails');
let aExpand = $('#aExpand').click(function () {
let a = $(this);
if (a.hasClass('expanded')) {
$(this).removeClass('expanded').text('(展开)');
tdDetails.html('<span class="text-light-gray">详情已折叠,点击展开 ...</span>');
}
else {
$(this).addClass('expanded').text('(收起)');
tdDetails.html(streamHtml);
}
});
tdDetails.on('click', '.text-light-gray', function () {
aExpand.trigger('click');
});
//duration
if(data.format && data.format.duration)
duration = data.format.duration ;
$('#tbdProfile').show();
});
开发者ID:rpdg,项目名称:fy.js,代码行数:86,代码来源:collect.ts
注:本文中的ts/opg.default函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论