本文整理汇总了TypeScript中ts/opg.api.save方法的典型用法代码示例。如果您正苦于以下问题:TypeScript api.save方法的具体用法?TypeScript api.save怎么用?TypeScript api.save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ts/opg.api
的用法示例。
在下文中一共展示了api.save方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
window['doSave'] = function (popWin, tree) {
let param = form.fieldsToJson({
roleName: {
name: '角色名称',
type: 'ns',
require: true
},
roleDesc: {
name: '角色描述',
maxLength: 80
}
});
if (!param)
return true;
let ids = {}, unsetIds = {};
let backThroughChildren = (chk)=> {
let childCheck = $(chk).closest('.folder').siblings('ul').find(':checkbox:checked');
childCheck.each((i, elem :HTMLInputElement) => {
unsetIds[elem.value] = 1;
});
};
tree2.jq.find(':checkbox:checked').each((i, elem)=> {
//backThroughParent(elem, ids);
if (!ids[elem.value] && !unsetIds[elem.value]) {
ids[elem.value] = 1;
}
if ($(elem).closest('span').hasClass('folder')) {
backThroughChildren(elem);
}
});
let menuIds = opg.convert.hashKeysToArray(ids);
let reservedPermissions = opg.convert.hashKeysToArray(reservedPermissionIdHash);
param.pIds = opg.array.unique(opg.array.combine(menuIds, reservedPermissions));
param.id = id;
param.parentId = ~~opg.request['parentId'];
console.log('param', param);
opg.api.save(param, function () {
popWin.close();
tree.update();
});
return true;
};