修改页面年份显示

master
yuan 7 years ago
parent 2ecb3920e2
commit 8de1d7b688

@ -2,11 +2,19 @@
<section class="content">
<div class="box box-default">
<div class="box-header">
<div uib-dropdown>
<!-- <div uib-dropdown>
<button class="btn btn-primary" uib-dropdown-toggle type="button" ng-bind="params.year"></button>
<ul class="dropdown-menu" uib-dropdown-menu role="menu">
<li ng-repeat="year in availableYears" role="menuitem"><a role="button" ng-click="initMonth(year)" ng-bind="year"></a></li>
</ul>
</div>-->
<div ng-repeat="year in availableYears" style="display: inline">
<button class="btn btn-info"
ng-click="initMonth(year)"
ng-bind="year"
ng-class="{'active':year == params.year}"
></button>
</div>
</div>
<div class="box-body">

@ -78,6 +78,7 @@ define(['angular', 'decimal', 'uiRouter', 'angularEcharts', '../../analysis/repo
}]);
app.controller('platformRevenueRootCtrl', ['$scope', '$http', '$filter', 'chartParser', function ($scope, $http, $filter, chartParser) {
$scope.params = {year: new Date().getFullYear()};
$scope.availableYears = [new Date().getFullYear() - 1, new Date().getFullYear()];
$scope.initMonth = function (year) {
$scope.months = [];
for (var i = 1; i < 13; i++) {
@ -93,6 +94,7 @@ define(['angular', 'decimal', 'uiRouter', 'angularEcharts', '../../analysis/repo
return start <= mon && end >= mon
};
$scope.loadYearReport = function (year) {
$scope.params.year = year;
$http.get('/analysis/platform/revenue/year_reports/' + year).then(function (resp) {
$scope.report = resp.data;
loadChargeAnalysis(year);
@ -164,7 +166,7 @@ define(['angular', 'decimal', 'uiRouter', 'angularEcharts', '../../analysis/repo
})
}
$scope.loadYearReport(2017);
$scope.loadYearReport(new Date().getFullYear());
}]);
return app;
});

@ -14,7 +14,7 @@
<div class="form-inline">
<div class="form-group">
<label class="control-label" style="width: 50px">年份</label>
<div uib-dropdown class="btn-group">
<!--<div uib-dropdown class="btn-group">
<button id="single-button" type="button" class="btn btn-primary" style="width: 100px" ng-bind="analysis.analysis_year" uib-dropdown-toggle ng-disabled="disabled">
<span class="caret"></span>
</button>
@ -23,6 +23,14 @@
<li><a ng-click="loadYearReport(2016)">2016</a></li>
<li><a ng-click="loadYearReport(2017)">2017</a></li>
</ul>
</div>-->
<div ng-repeat="year in availableYears" style="display: inline">
<button class="btn btn-info"
ng-click="loadYearReport(year)"
ng-bind="year"
ng-class="{'active':year == params.year}"
></button>
</div>
</div>
</div>

Loading…
Cancel
Save