48 lines
1.6 KiB
JavaScript
48 lines
1.6 KiB
JavaScript
app.controller('ClassGroupController', ['$scope', 'config','$http', 'auth','$location','$routeParams','alertService','rms','common','$timeout', function($scope, config, $http, auth, $location, $routeParams,alertService,rms,common,$timeout){
|
|
// common.checkLogin();
|
|
|
|
$scope.replaceUrl = function(url){
|
|
return url;
|
|
};
|
|
|
|
var vm = $scope;
|
|
var courseid = $routeParams.id;
|
|
vm.alertService = alertService.create();
|
|
|
|
if(!vm.course){
|
|
$http.get(config.apiUrl+ 'courses/'+courseid+"?token="+auth.token()).then(
|
|
function(response) {
|
|
console.log(response.data);
|
|
if (response.data.status == 0){
|
|
vm.course = response.data.data;
|
|
console.log("courses");
|
|
console.log(response.data.data);
|
|
}
|
|
else{
|
|
vm.alertService.showMessage('提示', response.data.message);
|
|
}
|
|
if(!vm.course){
|
|
vm.tip_1 = "该班级不存在或已被删除";
|
|
}
|
|
}
|
|
);
|
|
}
|
|
|
|
|
|
$http.get(config.apiUrl + 'courses/course_groups_withstudent/'+courseid+'?token='+auth.token()).then(
|
|
function(response) {
|
|
console.log("groups=");
|
|
console.log(response);
|
|
if(response.data.status == 0) {
|
|
vm.groups = response.data.data;
|
|
}
|
|
else{
|
|
vm.groups = [];
|
|
}
|
|
});
|
|
|
|
vm.goEditGroup = function(){
|
|
$location.path("/edit_class_group").search({id: courseid});
|
|
}
|
|
|
|
}]); |