"use strict";app.controller("adminNavmanagerListCtrl",["$rootScope","$scope","$state","$timeout","$interval","$modal","SweetAlert","Restangular","api_configure_data","api_conversation","api_user_data",function(e,t,a,n,r,o,i,s,c,d,u){function l(e,t){for(var a={},n=null,r=0;r0&&(t.doing_asyncpower=!1)}else i.swal({title:"系统错误!",text:"请刷新重试!",type:"error"})})},t.try_async_powerload(),t.addData=function(){a.go("app.system.form",{formKey:"system_add_menu",service:"api_configure_data"})},t.addService=function(){a.go("app.system.form",{formKey:"system_add_service",service:"api_configure_data"})},t.choiceMenu=[],t.showHandler=function(e){t.choiceMenu=e},t.changeMenu=function(){t.choiceMenu.service?c.fetchDataById("linkConfigure",t.choiceMenu.service).then(function(e){if(200==e.status){e.data.menu={menu:e.data.menu};var t={model:e.data};a.go("app.system.form",{formKey:"system_add_service",service:"api_configure_data",model:JSON.stringify(t)})}}):c.fetchDataById("menu",t.choiceMenu.id).then(function(e){if(200==e.status)if(null!=e.data.link){e.data.type="link";var t={model:e.data};a.go("app.system.form",{formKey:"system_add_menu",service:"api_configure_data",model:JSON.stringify(t)});var t={model:e.data}}else if(e.data.service){e.data.menu={menu:e.data.menu};var t={model:e.data};a.go("app.system.form",{formKey:"system_add_service",service:"api_configure_data",model:JSON.stringify(t)})}else if(e.data.event){e.data.type="event",e.data.menu={parent:e.data.parent};var t={model:e.data};a.go("app.system.form",{formKey:"system_add_menu",service:"api_configure_data",model:JSON.stringify(t)})}else if(e.data.wechat){e.data.type="wechat",e.data.menu={parent:e.data.parent};var t={model:e.data};a.go("app.system.form",{formKey:"system_add_menu",service:"api_configure_data",model:JSON.stringify(t)})}})},t.removeData=function(){var e=o.open({templateUrl:"assets/views/delete.html",controller:["$scope","scope","$modalInstance",function(e,t,a){e.ok=function(){t.choiceMenu.children&&t.choiceMenu.children.length>0?i.swal({title:"操作异常!",text:"请先删除菜单子类",type:"error"}):a.close(t.choiceMenu)},e.cancel=function(){a.dismiss("cancel")}}],size:"sm",resolve:{scope:function(){return t}}});e.result.then(function(e){if(e){var a=[],n=[];e.service&&null!=e.service?a.push(e.service):n.push(e.id),n.length>0&&c.rmvData("menu",n).then(function(e){e.data?i.swal({title:"删除成功!",type:"success",confirmButtonColor:"#007AFF"},function(){t.try_async_powerload()}):a.length>0||i.swal({title:"操作异常!",text:"系统异常,请稍后重试,或者联系管理员!",type:"error"})}),a.length>0&&c.rmvData("linkConfigure",a).then(function(e){e.data?i.swal({title:"删除成功!",type:"success",confirmButtonColor:"#007AFF"},function(){t.try_async_powerload(),t.getbranchs=[]}):a.length>0||i.swal({title:"操作异常!",text:"系统异常,请稍后重试,或者联系管理员!",type:"error"})})}})}}]);