提交 b70ae039 编写于 作者: R rsercano

refactoring

上级 06b12d78
......@@ -65,7 +65,7 @@ const fillInformation = function (node) {
SessionManager.set(SessionManager.strSessionUsermanagementManageSelection, node.data[0].text);
this.getInfo({ roleName: node.data[0].text }, 'getRoleInfo');
} else if (node.data[0].privilege) this.getInfo({ resource: node.data[0].privilegeType }, 'getResourceInfo');
else if (node.data[0].action) this.getActionInfo(node.text);
else if (node.data[0].action) this.getInfo({ action: node.text }, 'getActionInfo');
};
const selectNodeCallback = function (evt, data) {
......@@ -156,38 +156,22 @@ UserManagementTree.prototype = {
});
},
getInfo(args, methodName) {
Notification.start('#btnRefreshUsers');
this.loading = true;
Communicator.call({
methodName,
args,
callback: (err, result) => {
if (err) SessionManager.set(SessionManager.strSessionUsermanagementInfo, err.message);
else SessionManager.set(SessionManager.strSessionUsermanagementInfo, result);
this.loading = false;
Notification.stop();
}
});
},
getNodeInformation(node) {
if (!node.data || !node.data[0]) return this.defaultInformationText;
return node.text;
},
getActionInfo(action) {
getInfo(args, methodName) {
Notification.start('#btnRefreshUsers');
this.loading = true;
Communicator.call({
methodName: 'getActionInfo',
args: { action },
methodName,
args,
callback: (err, result) => {
if (err) SessionManager.set(SessionManager.strSessionUsermanagementInfo, err.message);
else SessionManager.set(SessionManager.strSessionUsermanagementInfo, result);
this.loading = false;
Notification.stop();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册