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.

project_publishnote.js 2.5 kB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. app.controller('ProjectPublishNoteController', ['$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_project = rms.get('current_project');
  5. var project_id = $routeParams.id;
  6. vm.alertService = alertService.create();
  7. vm.notetitle = "";
  8. vm.note = "";
  9. if(!vm.current_project){
  10. $http.get(config.apiUrl+ 'projects/'+project_id+"?token="+auth.token()).then(
  11. function(response) {
  12. console.log(response.data);
  13. if (response.data.status == 0){
  14. vm.current_project = response.data.data;
  15. console.log("projects");
  16. console.log(response.data.data);
  17. }
  18. else{
  19. vm.alertService.showMessage('提示', response.data.message);
  20. }
  21. if(!vm.current_project){
  22. vm.tip_1 = "该项目不存在或已被删除";
  23. }
  24. }
  25. );
  26. }
  27. vm.cancel = function(){
  28. window.history.back();
  29. };
  30. //发布通知 只有老师能发布
  31. vm.publishNote = function(){
  32. if(vm.notetitle.length == 0)
  33. {
  34. vm.alertService.showMessage('提示', '标题不能为空');
  35. return;
  36. }
  37. if(vm.note.length == 0)
  38. {
  39. vm.alertService.showMessage('提示', '内容不能为空');
  40. return;
  41. }
  42. var text = vm.note.replace(/\n/g,'<br/>');
  43. $http.post(config.apiUrl + "projects/"+project_id+"/publishnote",
  44. {token: auth.token(),title: vm.notetitle, text: text}
  45. ).then(function(response){
  46. if(response.data.status == 0)
  47. {
  48. vm.alertService.showMessage('提示', '发布成功',function(){
  49. rms.save('project_activities_page',0);
  50. rms.save("project_activities",[]);
  51. rms.save("project_has_more",false);
  52. rms.save('tab_num',null);
  53. $location.path("/project").search({id: project_id});
  54. });
  55. }
  56. else{
  57. vm.alertService.showMessage('提示', response.data.message);
  58. }
  59. });
  60. };
  61. }] );

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