mobileoa-common-modules
Version:
移动办公平台前端公共功能模块
56 lines (47 loc) • 1.54 kB
JavaScript
var angular = require('angular');
require('../modules');
require('../../notice/services/NoticeService');
require('../../intro/services/introService');
'use strict';
angular
.module('setting')
.controller('assistCtrl', assistCtrl);
/** @ngInject */
function assistCtrl($scope, AppConfig, LinkerService, $timeout, CacheService,
NoticeService, introService, $toast) {
//2g/3g/4g网络下是否加载图片
var module = AppConfig.getModuleByName('infoDisplay');
$scope.imgLoadSet = false;
if(module) {
$scope.imgLoadSet = true;
$scope.title = module.text;
}
//-----------------------
var moduleNames = AppConfig.getModuleNames();
var userId = LinkerService.currentUserId,
key = 'notice-order-' + userId,
noticeOrder = CacheService.get(key, 'noticeOrder_time');
$scope.notice = {};
$scope.notice.order = noticeOrder;
$scope.introReset = introReset;
$scope.$watch('notice.order', function() {
var _order = CacheService.get(userId);
if(!_.isEmpty($scope.notice.order) && _order != $scope.notice.order) {
CacheService.put(key, $scope.notice.order);
sortNotices($scope.notice.order, moduleNames);
}
}, true);
function sortNotices(order, moduleNames) {
if(order === 'noticeOrder_module') {
NoticeService.appNotices.orderNotices(moduleNames);
} else {
NoticeService.appNotices.orderNotices();
}
}
//使用向导
function introReset() {
introService.reset();
$toast.showLongCenter('重启成功');
}
//---------------------
}