123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- angular.module('push')
- .controller('wujingTeacherCtrl', function ($q, $scope, $ionicActionSheet, $ionicSlideBoxDelegate, ResourceLibraryService, $stateParams, $timeout, $ionicScrollDelegate,
- UtilService, $ionicPopup, $ionicListDelegate, AuthorityService,
- UserService, taskModuleService, ConfigService, ActivityService, ConstantService, dataToolsService, CommonService, $ionicModal) {
- $scope.moduleid = 44;
- $scope.reclibc = $stateParams.reclibc;
- taskModuleService.thisUserIsAdmin().then(function (res) {
- if (res.code == 3350) {
- $scope.isAdmin = res.data;
- }
- })
- var getClaid = function () {
- ResourceLibraryService.getClaid($scope.moduleid).then(function (res) {
- if (res.code == 3350) {
- $scope.data = res.data;
- }
- })
- }
- getClaid();
- $scope.keyfilter = {key: ""};//搜索关键词
- var getAllResourceList = function () {
- ResourceLibraryService.getFirstResourceList(44, 231, 0, $scope.keyfilter.key, "enterprisescale,desc", 0, 0, "", "").then(function (res) {
- if (res.code == 3350) {
- $scope.length = res.data.length;
- $scope.allData = res.data;
- }
- })
- }
- getAllResourceList();
- $scope.goEnterCompanyInfo = function () {
- /*$scope.go('visitModularForm', {
- companyid: 0,
- pageid: 44,
- orgtype: 10104,
- pagecode: 1000027,
- isedit: 0,
- node: UserService.node,
- pageTitle: '新建导师'
- });*/
- $scope.go('visitModularForm', {
- companyid: 0,
- pageid: 20,
- orgtype: 10104,
- pagecode: 1000035,
- isedit: 0,
- node: UserService.node,
- pageTitle: '新建导师',
- innertype: 44
- });
- }
- $scope.deletItem = function (id, node, idx) {
- console.log(2);
- var data = {
- data: {
- id: id,
- isenabled: 2,
- comfrom: node
- },
- node: node
- }
- // confirm 对话框
- var confirmPopup = $ionicPopup.confirm({
- title: '删除确认',
- template: '请确认是否要删除此项!',
- cancelText: '取消',
- okText: '确认',
- });
- confirmPopup.then(function (res) {
- console.log(res);
- if (res) {
- dataToolsService.saveWebInfo(data).then(function (res) {
- if (res.code == 3350) {
- if ($scope.app) {
- UtilService.showMess('删除成功');
- } else {
- CommonService.showMessage('删除成功', $scope);
- }
- getAllResourceList();
- } else {
- if ($scope.app) {
- UtilService.showMess('删除失败');
- } else {
- CommonService.showMessage('删除失败', $scope);
- }
- }
- })
- }
- });
- }
- $scope.goResourceDetail = function (resource) {
- if(UserService.id == 0){
- if (!ConfigService.islogin) {
- if (localStorage.wxFlag == "true") {
- if (localStorage.isUserFocusXW == 0) {
- var title = localStorage.appidStr;
- $ionicPopup.alert({
- title: '提示',
- template: '请先关注微信公众号"' + title + '"!'
- });
- return;
- } else {
- if (localStorage.isUserBindWx == 0) {
- var wxFlag = JSON.parse(localStorage.params);
- if (wxFlag.weChatModel) {
- $scope.go('bindPhone', {
- params: localStorage.params,
- comfrom: 'maincontroller',
- url: window.location.href.split('#/')[1]
- });
- } else {
- $scope.go('login');
- return;
- }
- } else {
- $scope.go('login');
- return;
- }
- }
- } else {
- $scope.go('login');
- return;
- }
- }
- }
- if (resource.groupid == "0") {
- $scope.go('resourceDetails', {
- recourceid: resource.unique,
- recourcetype: resource.type,
- recourcecomefrom: resource.source,
- title: resource.title
- });
- } else {
- $scope.go('resourceCommonDetailsPage', {
- recourceid: resource.unique,
- recourcetype: resource.type,
- recourcecomefrom: resource.source,
- creator: resource.clickthrough,
- title: resource.title,
- orgtype: 0,
- pagecode: 0,
- label: JSON.stringify(resource.otherObj)
- });
- }
- };
- //虚拟搜索框
- $scope.showSearchButtonLeft = function () {
- $scope.isShowSearchButton = false;
- $(".showSearchInput").focus();
- };
- //清空搜索内容
- $scope.clearSearch = function () {
- $scope.isShowSearchButton = true;
- $scope.keyfilter.key = "";
- };
- // 搜索各种资源信息
- $scope.searchResourceList = function () {
- $scope.showLoadingToast();
- getAllResourceList();
- }, function () {
- $scope.hideLoadingToast();
- };
- })
- ;
|