diff options
author | 2017-09-01 11:57:47 +0800 | |
---|---|---|
committer | 2017-09-01 11:57:58 +0800 | |
commit | 57dbba269d19bc59fad89160200bb2dbcccb9003 (patch) | |
tree | d466041ceffa2161124ca79a48b3e077777c74b8 /usecaseui-common/src/main/webapp/static/fusion/raptor/ebz/quick_links.js | |
parent | 4ff32341a0af1972b44a7410e76e9b231131e7ab (diff) |
Upload Monitor function code
Change-Id: I33ad76221b4cb771a298ff240245fc24be664efb
Issue-Id: USECASEUI-6
Signed-off-by: shentao <shentao@chinamobile.com>
Diffstat (limited to 'usecaseui-common/src/main/webapp/static/fusion/raptor/ebz/quick_links.js')
-rw-r--r-- | usecaseui-common/src/main/webapp/static/fusion/raptor/ebz/quick_links.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/usecaseui-common/src/main/webapp/static/fusion/raptor/ebz/quick_links.js b/usecaseui-common/src/main/webapp/static/fusion/raptor/ebz/quick_links.js new file mode 100644 index 00000000..81e8276e --- /dev/null +++ b/usecaseui-common/src/main/webapp/static/fusion/raptor/ebz/quick_links.js @@ -0,0 +1,33 @@ +'use strict'; +angular.module('quantum').directive('quickLinks', ['$http','$window', function($http,$window){ + return { + restrict: 'E', + scope:{ + ngModel: '=' + }, + template: "<div att-links-list class='att-accordion'>" + + "<a ng-repeat='quickLink in quickLinks' class='att-accordion__group' att-links-list-item href='' ng-click='openLink(quickLink.reportURL)'>{{quickLink.reportName}}<span ng-show='quickLink.showDescr'> - {{quickLink.reportDescr}}</span></a>" + + "<a ng-repeat='quickLink in ngModel' class='att-accordion__group' att-links-list-item href='' ng-click='openLink(quickLink.reportURL)'>{{quickLink.reportName}}<span ng-show='quickLink.showDescr'> - {{quickLink.reportDescr}}</span></a>" + + "</div>", + link: function($scope,element,attr){ + $scope.ngDisplayType=attr.ngDisplayType; + $scope.popUpWindowSize = "top=" + ((screen.height*.2)/2) + ",left=" + ((screen.width*.05)/2) + ",width="+(screen.width-(screen.width*.06))+",height="+(screen.height-(screen.height*.25)); + + $scope.openLink = function(url){ + if($scope.ngDisplayType){ + if($scope.ngDisplayType=='1'){ + $window.open(url,'_self'); + }else if($scope.ngDisplayType=='2'){ + $window.open(url, '_blank'); + }else if($scope.ngDisplayType=='3'){ + $window.open(url, '', $scope.popUpWindowSize); + } + } + }; + + $http.get('raptor.htm?action=quicklinks.json&quick_links_menu_id='+attr.ngMenuId).then(function(result){ + $scope.quickLinks=result.data; + }); + } + }; +}]);
\ No newline at end of file |