angular.module('push') .controller('resourceLibraryLocalTypeCtrl', function ($scope, $stateParams, $timeout, $ionicActionSheet, SqliteStorageService) { if($scope.app){ $scope.setStatusBar(0); } $scope.reclib = angular.fromJson($stateParams.reclib); // console.log($scope.reclib); var getResourceLibrary = function () { var sql = "select * from conninfofolder where localparentid = " + $scope.reclib.localid;// + " and infocount > 0 " SqliteStorageService.queryData(sql).then(function (response) { // console.log(response); $scope.resourcelibraryclass = response; }, function () { }); }; getResourceLibrary(); //私人库资源库搜索 $scope.goResourceSearch = function () { $timeout(function () { $scope.go('resourceSearch', {tabindex: 3}); }, 350); }; //网络异常时点击屏幕重新加载 $scope.repeatLoad = function () { // console.log("重新加载"); getResourceLibrary(); }; //进入私人资源库详情 $scope.goResorceLibaryDetail = function (reclibc) { $scope.go('resourceList', { libtype: reclibc.moduleid, privateName: $scope.reclib.name, name: reclibc.name, reclibid: $scope.reclib.localid, modlibid: reclibc.localid, isCloud: $scope.reclib.isCloud }); }; //打开操作表 $scope.openActionSheet = function () { $ionicActionSheet.show({ buttons: [ {text: '设置'} ], cancelText: '取消', buttonClicked: function (index) { if (index == 0) { $scope.go("authorityLocalSet", {authoritydata: angular.toJson($scope.reclib), type: 1, goflg: 1}); } return true; } }); }; //下拉刷新数据 $scope.refreshData = function () { $scope.repeatLoad(); $scope.$broadcast('scroll.refreshComplete'); var trHtml = "