You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

class_publishissue.js 2.4 kB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. app.controller('ClassPublishIssueController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,common){
  2. // common.checkLogin();
  3. var vm = $scope;
  4. vm.current_course = rms.get('current_course');
  5. vm.issuetitle = "";
  6. vm.issue = "";
  7. var course_id = $routeParams.id;
  8. vm.alertService = alertService.create();
  9. if(!vm.current_course){
  10. $http.get(config.apiUrl+ 'courses/'+course_id+"?token="+auth.token()).then(
  11. function(response) {
  12. console.log(response.data);
  13. if (response.data.status == 0){
  14. vm.current_course = response.data.data;
  15. console.log("courses");
  16. console.log(response.data.data);
  17. }
  18. else{
  19. vm.alertService.showMessage('提示', response.data.message);
  20. }
  21. if(!vm.current_course){
  22. vm.tip_1 = "该班级不存在或已被删除";
  23. }
  24. }
  25. );
  26. }
  27. vm.cancel = function(){
  28. window.history.back();
  29. };
  30. //发布问题 即项目讨论区
  31. vm.publishIssue = function(){
  32. if(vm.issuetitle.length == 0)
  33. {
  34. vm.alertService.showMessage('提示', '标题不能为空');
  35. return;
  36. }
  37. if(vm.issue.length == 0)
  38. {
  39. vm.alertService.showMessage('提示', '内容不能为空');
  40. return;
  41. }
  42. var text = vm.issue.replace(/\n/g,'<br/>');
  43. $http.post(config.apiUrl + "courses/"+course_id+"/publishissue",
  44. {token: auth.token(),title: vm.issuetitle, text: text}
  45. ).then(function(response){
  46. if(response.data.status == 0)
  47. {
  48. vm.alertService.showMessage('提示', '发布成功',function(){
  49. rms.save('course_activities_page',0);
  50. rms.save("course_activities",[]);
  51. rms.save("course_has_more",false);
  52. $location.path("/class").search({id: course_id});
  53. });
  54. }
  55. else{
  56. vm.alertService.showMessage('提示', response.data.message);
  57. }
  58. });
  59. };
  60. }] );

软件技术创新是当今国家整体创新能力的重要基础和发展引擎。近年来,大众参与的软件创新与创业活动已经成为网络时代软件开发和应用的新形态,正在快速改变着全球软件创新模式和软件产业格局。 ...