std_material.js 881 B

12345678910111213141516171819202122232425262728293031323334
  1. app.controller('StdMaterialCtrl', [ '$rootScope', '$scope', function($rootScope, $scope) {
  2. $scope.getMaterialArray = function(){
  3. $rootScope.ajaxRequest({
  4. url : '../enrol/std/material/all.htm'
  5. }, function(response) {
  6. $scope.materialArray = response.array;
  7. });
  8. }
  9. // 获取截止时间标志
  10. $scope.getDeadLineFlag = function() {
  11. $rootScope.ajaxRequest({
  12. url : '../enrol/std/modify/info/flag/get.htm'
  13. }, function(response) {
  14. $scope.modifyFlag = response.entity;
  15. });
  16. }
  17. $scope.getDeadLineFlag();
  18. $scope.getMaterialArray();
  19. $scope.showMaterial = function(m){
  20. // 没有上传或者审核失败
  21. if(m.material_id == undefined || m.verify_status == 'InActive') {
  22. $rootScope.uploadStdMaterial(m.material_type,function(){
  23. $scope.getMaterialArray();
  24. });
  25. }else {
  26. $rootScope.goLocation('std/material_info/' + m.material_id );
  27. }
  28. }
  29. } ])