var $url="/settings/administratorsRole",data=utils.init({roles:null}),methods={apiGet:function(){var t=this;utils.loading(this,!0),$api.get($url).then(function(i){var e=i.data;t.roles=e.roles}).catch(function(t){utils.error(t)}).then(function(){utils.loading(t,!1)})},apiDelete:function(t){var i=this;utils.loading(this,!0),$api.delete($url,{data:{id:t.id}}).then(function(t){var e=t.data;i.roles=e.roles}).catch(function(t){utils.error(t)}).then(function(){utils.loading(i,!1)})},btnAdminViewClick:function(t){utils.openLayer({title:"查看资料",url:utils.getCommonUrl("adminLayerView",{userName:t}),full:!0})},btnAddClick:function(){utils.addTab("添加角色",utils.getSettingsUrl("administratorsRoleAdd",{tabName:utils.getTabName()}))},btnEditClick:function(t){utils.addTab("编辑角色",utils.getSettingsUrl("administratorsRoleAdd",{roleId:t.id,tabName:utils.getTabName()}))},btnDeleteClick:function(t){var i=this;utils.alertDelete({title:"删除角色",text:"此操作将删除角色 "+t.roleName+"，确定吗？",callback:function(){i.apiDelete(t)}})}},$vue=new Vue({el:"#main",data:data,methods:methods,created:function(){this.apiGet()}});