1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- angular.module('push')
- .controller('notificationCtrl', function ($scope, ResourceLibraryService, ConfigService, UserService, CommentService, UtilService, $timeout, CommonService) {
- $scope.keyfilter = {};
- var getNoticeList = function () {
- ResourceLibraryService.getClaidInfo(UserService.node).then(function (res) {
- if (res.code == 3350) {
- var reclibid = res.data;
- ResourceLibraryService.getFirstResourceList(33, reclibid, 0, $scope.keyfilter.key, "enterprisescale,desc", 0, 0, "", "").then(function (res) {
- if (res.code == 3350) {
- $scope.datalist = res.data;
- }
- })
- }
- })
- }
- getNoticeList();
- //发布通知公告
- $scope.sendNotification = function () {
- $scope.islogin = ConfigService.islogin;
- if (!$scope.islogin) {
- $scope.go('login');
- return;
- }
- $scope.go("newNotification");
- }
- //进入通知公告详情页面
- $scope.goNoticeDetail = function (data) {
- console.log(data)
- $scope.go("notificationDetail", {notice: data, unique: data.unique});
- }
- ResourceLibraryService.judgeManager(UserService.id, 0).then(function (res) {
- $scope.canDoSend = res.data;
- })
- //虚拟搜索框
- $scope.isShowSearchButton = true;
- $scope.keyfilter = {key: ""};//搜索关键词
- $scope.showSearchButtonLeft = function () {
- $scope.isShowSearchButton = false;
- $(".showSearchInputForResLibrary").focus();
- };
- //清空搜索内容
- $scope.clearSearch = function () {
- $scope.isShowSearchButton = true;
- $scope.keyfilter.key = "";
- };
- $scope.searchResourceList = function () {
- $scope.showLoadingToast();
- getNoticeList();
- $scope.hideLoadingToast();
- }, function () {
- $scope.hideLoadingToast();
- };
- ResourceLibraryService.judgeManager(UserService.id, 10501).then(function (res) {
- // console.log(res);
- $scope.hasAuth = res.data;
- })
- //设置置顶
- $scope.changeStickTop = function (type, resid) {
- console.log(resid);
- if (type) {
- ResourceLibraryService.cancelStickTop(resid).then(function (res) {
- console.log(res);
- if (res.code == 3350) {
- $scope.submitSelected();
- }
- })
- } else {
- ResourceLibraryService.stickTop(resid).then(function (res) {
- console.log(res);
- if (res.code == 3350) {
- $scope.submitSelected();
- }
- })
- }
- }
- $scope.submitSelected = function () {
- //重新加载全部企业
- $scope.showLoadingToast();
- getNoticeList();
- $scope.hideLoadingToast();
- }
- $scope.goback1 = function(){
- $scope.go('tab.activityIndex');
- }
- });
|