本文整理匯總了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;
};