cloudHomeCtrl.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. angular.module('push')
  2. .controller('cloudHomeCtrl', function ($scope, UtilService, AuthorityService, $timeout, AuthorityModelService) {
  3. if($scope.app){
  4. $scope.setStatusBar(0);
  5. }
  6. $scope.search = {searchkey: ""};
  7. //权限列表初始化
  8. var getAuthorityList = function () {
  9. $scope.showLoadingToast();
  10. AuthorityService.getAuthorityList("", "").then(function (response) {
  11. $scope.AuthorityList = response.cloautlist;
  12. $scope.hideLoadingToast();
  13. }, function () {
  14. $scope.hideLoadingToast();
  15. UtilService.showMess("网络不给力,请稍后重试");
  16. })
  17. };
  18. getAuthorityList();
  19. //创建权限
  20. $scope.creatAuthority = function () {
  21. AuthorityModelService.resetData();
  22. $scope.go('creatAuthority');
  23. };
  24. //进入权限详情
  25. $scope.goAuthoritydetail = function (tempauthority) {
  26. $scope.go('authorityName', {authorityid: tempauthority.id, ccomefrom: tempauthority.comefrom, invite_url:tempauthority.invite_url});
  27. };
  28. //查找权限
  29. $scope.searchClassification = function () {
  30. $timeout(function () {
  31. $(".searchClassification").css("width", "88%");
  32. $(".category_search_icon").css("left", "5%");
  33. $(".new_category_search").animate({paddingLeft: "10%"});
  34. $(".new_category_search").css("text-align", "left");
  35. $(".searchClassDelete").css("display", "inline-block");
  36. }, 100);
  37. };
  38. //取消查询
  39. $scope.searchClassDelete = function () {
  40. $(".searchClassification").css("width", "100%");
  41. $(".category_search_icon").animate({left: "39%"});
  42. $(".new_category_search").animate({paddingLeft: "0%"});
  43. $(".new_category_search").css("text-align", "center");
  44. $(".searchClassDelete").css("display", "none");
  45. $scope.search.searchkey = "";
  46. };
  47. });