微信增加项目相关内容
This commit is contained in:
parent
1ae23bafe4
commit
653b98d832
|
@ -419,6 +419,54 @@ module Mobile
|
|||
|
||||
end
|
||||
|
||||
desc "获取班级某成员角色信息"
|
||||
params do
|
||||
requires :id, type: Integer
|
||||
requires :token, type: String
|
||||
requires :user_id, type: Integer
|
||||
end
|
||||
post 'get_member_info' do
|
||||
authenticate!
|
||||
|
||||
c = Course.find("#{params[:id]}")
|
||||
|
||||
my_member = c.member_principals.where("users.id=#{params[:user_id]}").first
|
||||
|
||||
if my_member && my_member.roles[0]
|
||||
present :course_id,params[:id]
|
||||
present :user_id,params[:user_id]
|
||||
present :member_info,my_member, with: Mobile::Entities::ProjectMember
|
||||
present :status, 0
|
||||
else
|
||||
present :status, -1
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
desc "修改班级某成员角色信息"
|
||||
params do
|
||||
requires :id, type: Integer
|
||||
requires :token, type: String
|
||||
requires :user_id, type: Integer
|
||||
requires :role_id, type: Integer
|
||||
end
|
||||
post 'edit_member_role' do
|
||||
authenticate!
|
||||
|
||||
c = Course.find("#{params[:id]}")
|
||||
|
||||
#7教辅 9教师 10学生
|
||||
if c.tea_id == params[:user_id] || c.tea_id != current_user.id || !(params[:role_id] == 7 || params[:role_id] == 9 || params[:role_id] == 10)
|
||||
present :status, -1
|
||||
else
|
||||
|
||||
cs = CoursesService.new
|
||||
cs.set_user_course_role params
|
||||
|
||||
present :status, 0
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -62,69 +62,111 @@ module Mobile
|
|||
present :status, 0
|
||||
end
|
||||
|
||||
desc "获取项目"
|
||||
desc "获取项目成员"
|
||||
params do
|
||||
requires :id, type: Integer
|
||||
requires :token, type: String
|
||||
end
|
||||
post 'auth' do
|
||||
post 'members' do
|
||||
authenticate!
|
||||
|
||||
auth = 0
|
||||
project = Project.find("#{params[:id]}")
|
||||
members = project.member_principals
|
||||
|
||||
if (current_user.user_extensions && current_user.user_extensions.identity == 0 && current_user.allowed_to?(:add_course, nil, :global => true))
|
||||
auth = 1
|
||||
master_members = project.member_principals.includes(:roles, :principal).where("member_roles.role_id=3").all.sort
|
||||
|
||||
master_members.each do |m|
|
||||
if m.user_id == project.user_id
|
||||
master_members.delete(m)
|
||||
master_members.insert(0,m)
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
present :auth, auth
|
||||
develop_members = project.member_principals.includes(:roles, :principal).where("member_roles.role_id=4").all.sort
|
||||
report_members = project.member_principals.includes(:roles, :principal).where("member_roles.role_id=5").all.sort
|
||||
|
||||
present :master_members,master_members, with: Mobile::Entities::ProjectMember
|
||||
present :develop_members,develop_members, with: Mobile::Entities::ProjectMember
|
||||
present :report_members,report_members, with: Mobile::Entities::ProjectMember
|
||||
present :status, 0
|
||||
end
|
||||
|
||||
desc "新建大纲"
|
||||
desc "获取项目某成员角色信息"
|
||||
params do
|
||||
requires :id, type: Integer
|
||||
requires :token, type: String
|
||||
requires :title, type: String, desc: '大纲标题'
|
||||
requires :courses, type: Array[String], desc: '课程名'
|
||||
requires :user_id, type: Integer
|
||||
end
|
||||
post do
|
||||
post 'get_member_info' do
|
||||
authenticate!
|
||||
|
||||
ss = SyllabusesService.new
|
||||
project = Project.find("#{params[:id]}")
|
||||
|
||||
sy = ss.create(current_user, params[:title],
|
||||
params[:courses].map{|c| {name: c} })
|
||||
my_member = project.member_principals.where("users.id=#{params[:user_id]}").first
|
||||
|
||||
if sy.new_record?
|
||||
{status:-1, message: '创建大纲失败' }
|
||||
if my_member && my_member.roles[0]
|
||||
present :project_id,params[:id]
|
||||
present :user_id,params[:user_id]
|
||||
present :member_info,my_member, with: Mobile::Entities::ProjectMember
|
||||
present :status, 0
|
||||
else
|
||||
present :data, sy, with: Mobile::Entities::Syllabus,user: current_user
|
||||
present :status, -1
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
desc "修改项目某成员角色信息"
|
||||
params do
|
||||
requires :id, type: Integer
|
||||
requires :token, type: String
|
||||
requires :user_id, type: Integer
|
||||
requires :role_id, type: Integer
|
||||
end
|
||||
post 'edit_member_role' do
|
||||
authenticate!
|
||||
|
||||
project = Project.find("#{params[:id]}")
|
||||
|
||||
my_member = project.member_principals.where("users.id=#{current_user.id}").first
|
||||
|
||||
#3管理 4开发 5报告
|
||||
if !(my_member && my_member.roles[0] && my_member.roles[0].id == 3 ) || project.user_id == params[:user_id] || !(params[:role_id] == 3 || params[:role_id] == 4 || params[:role_id] == 5)
|
||||
present :status, -1
|
||||
else
|
||||
|
||||
present :status, 0
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
desc '编辑大纲'
|
||||
desc "新建项目"
|
||||
params do
|
||||
requires :token, type: String
|
||||
requires :title, type: String, desc: '大纲标题'
|
||||
# requires :add_courses, type: Array[String], desc: '课程名'
|
||||
# requires :modify_courses, type: Array[Integer,String], desc: '课程名'
|
||||
requires :name, type: String, desc: '项目名称'
|
||||
end
|
||||
post ':id/edit' do
|
||||
|
||||
post 'create' do
|
||||
authenticate!
|
||||
|
||||
ss = SyllabusesService.new
|
||||
|
||||
#修改课程大纲
|
||||
status = ss.edit(current_user, params)
|
||||
|
||||
if status == -1
|
||||
{status:status, message: '修改课程信息失败' }
|
||||
else
|
||||
present :status, status
|
||||
end
|
||||
present :status, 0
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
desc "加入项目"
|
||||
params do
|
||||
requires :token, type: String
|
||||
requires :invite_code, type: String, desc: '邀请码'
|
||||
end
|
||||
post 'create' do
|
||||
authenticate!
|
||||
|
||||
|
||||
|
||||
present :status, 0
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -86,6 +86,15 @@ module Mobile
|
|||
expose :my_homework,using: Mobile::Entities::Homework do |f, opt|
|
||||
f[:my_homework] if f.is_a?(Hash) && f.key?(:my_homework)
|
||||
end
|
||||
expose :is_creator, if: lambda { |instance, options| options[:user] } do |instance, options|
|
||||
if instance[:course]
|
||||
course = instance[:course]
|
||||
else
|
||||
course = instance
|
||||
end
|
||||
current_user = options[:user]
|
||||
course.tea_id == current_user.id
|
||||
end
|
||||
course_expose :current_user_is_member
|
||||
course_expose :current_user_is_teacher
|
||||
course_expose :work_unit
|
||||
|
|
|
@ -3,13 +3,25 @@ module Mobile
|
|||
class Project < Grape::Entity
|
||||
expose :name
|
||||
expose :id
|
||||
expose :user_id
|
||||
expose :can_setting, if: lambda { |instance, options| options[:user] } do |instance, options|
|
||||
current_user = options[:user]
|
||||
can_setting = instance.user_id == current_user.id ? true : false
|
||||
can_setting = false if instance.id.nil?
|
||||
|
||||
my_member = instance.member_principals.where("users.id=#{current_user.id}").first
|
||||
can_setting = false
|
||||
if my_member && my_member.roles[0] && my_member.roles[0].id == 3
|
||||
can_setting = true
|
||||
end
|
||||
can_setting
|
||||
end
|
||||
|
||||
expose :is_creator, if: lambda { |instance, options| options[:user] } do |instance, options|
|
||||
current_user = options[:user]
|
||||
|
||||
current_user.id == instance.user_id
|
||||
end
|
||||
|
||||
|
||||
expose :member_count, if: lambda { |instance, options| options[:user] } do |instance, options|
|
||||
instance.members.count
|
||||
end
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
module Mobile
|
||||
module Entities
|
||||
class ProjectMember < Grape::Entity
|
||||
include Redmine::I18n
|
||||
include ApplicationHelper
|
||||
include ApiHelper
|
||||
def self.member_expose(f)
|
||||
expose f do |u,opt|
|
||||
if u.is_a?(Hash) && u.key?(f)
|
||||
u[f]
|
||||
elsif u.is_a?(::Member)
|
||||
if u.respond_to?(f)
|
||||
u.send(f)
|
||||
else
|
||||
case f
|
||||
when :roles_id
|
||||
u.roles[0].id
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
expose :user, using: Mobile::Entities::User do |c, opt|
|
||||
if c.is_a?(::Member)
|
||||
c.user
|
||||
end
|
||||
end
|
||||
|
||||
member_expose :roles_id
|
||||
|
||||
end
|
||||
end
|
||||
end
|
|
@ -24,10 +24,12 @@ module Mobile
|
|||
u.nil? || u.user_extensions.nil? ? "" : u.user_extensions.brief_introduction
|
||||
when :student_num
|
||||
u.nil? || u.user_extensions.nil? ? "" : u.user_extensions.student_id
|
||||
when :realname
|
||||
u.nil? ? "" : get_user_realname(u)
|
||||
when :real_name
|
||||
u.nil? ? "" : get_user_realname(u).gsub(/\s*/,"");
|
||||
when :name
|
||||
u.nil? ? "" : u.show_name
|
||||
when :roles_id
|
||||
u[:roles_id].nil? ? nil : u.roles_id
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -37,11 +39,13 @@ module Mobile
|
|||
|
||||
expose :id
|
||||
#头像
|
||||
user_expose :img_url
|
||||
#昵称
|
||||
expose :nickname
|
||||
#真名
|
||||
user_expose :realname
|
||||
user_expose :img_url
|
||||
#昵称
|
||||
expose :realname
|
||||
#昵称
|
||||
user_expose :real_name
|
||||
#性别
|
||||
user_expose :gender
|
||||
#我的二维码
|
||||
|
@ -62,6 +66,8 @@ module Mobile
|
|||
|
||||
user_expose :role_name
|
||||
|
||||
user_expose :roles_id
|
||||
|
||||
user_expose :name
|
||||
|
||||
end
|
||||
|
|
|
@ -89,7 +89,8 @@ class CoursesService
|
|||
@members = searchTeacherAndAssistant(c)
|
||||
when '2'
|
||||
#@subPage_title = l :label_student_list
|
||||
@members = searchStudent(c)
|
||||
# @members = searchStudent(c)
|
||||
@members = searchmember_by_name(student_homework_score(0,c.id, 0,"desc"),"")
|
||||
else
|
||||
#@subPage_title = ''
|
||||
@members = c.member_principals.includes(:roles, :principal).all.sort
|
||||
|
@ -104,6 +105,7 @@ class CoursesService
|
|||
:work_unit => work_unit, :mail => m.user.mail, :location => location,
|
||||
role_name: m.roles.first.name,
|
||||
name: m.user.show_name,
|
||||
roles_id: m.roles[0].id,
|
||||
:brief_introduction => m.user.user_extensions.brief_introduction,:realname=>m.user.realname}
|
||||
end
|
||||
users
|
||||
|
@ -954,5 +956,19 @@ class CoursesService
|
|||
# student_works[index + 1 .. index + n]
|
||||
# end
|
||||
|
||||
|
||||
def set_user_course_role params
|
||||
if params[role_id] == 7
|
||||
|
||||
|
||||
|
||||
elsif params[role_id] ==
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -32,11 +32,14 @@
|
|||
|
||||
<div class="class-member-row f13 c-grey3" ng-repeat="teacher in teachers|filter:searchText">
|
||||
<img ng-src="/images/wechat/{{teacher.gender==0 ? 'male' : 'female'}}.jpg" width="30" class="fl ml10 img-circle" /><span class="fl ml10 mt5">{{teacher.name}}</span><span class="fr mr10 c-grey2">{{teacher.role_name|identify}}</span><img ng-src="/images/wechat/{{teacher.gender==0 ? 'male' : 'female'}}.png" width="15" class="fl ml10 mt5" />
|
||||
<span class = "fr mr10 mt5" ng-show ="teacher.id == course.tea_id">管理员</span>
|
||||
<img src="/images/wechat/setting.png" ng-show = "course.is_creator && teacher.id != course.tea_id" width="15" class="class-list-setting" ng-click="onSetting(teacher)" />
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="member-banner f13 mt10 c-grey3">我的同学</div>
|
||||
<div class="class-member-row f13 c-grey3" ng-repeat="student in students|filter:searchText">
|
||||
<img ng-src="/images/wechat/{{student.gender==0 ? 'male' : 'female'}}.jpg" width="30" class="fl ml10 img-circle" /><span class="fl ml10 mt5">{{student.name}}</span><img ng-src="/images/wechat/{{student.gender==0 ? 'male' : 'female'}}.png" width="15" class="fl ml10 mt5" />
|
||||
<img src="/images/wechat/setting.png" ng-show = "course.is_creator" width="15" class="class-list-setting" ng-click="onSetting(student)" />
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -50,8 +53,8 @@
|
|||
|
||||
<div ng-class="{'undis': !showTestcase}">
|
||||
<div ng-repeat="r in exercises|filter:searchText" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><img src="/images/wechat/test.png" width="15" class="ml10 fl" /><span class="fl ml10 resource-width">{{r.exercise_name}}</span><a ng-show="isTeacher" herf="javascript:void(0);" class="fr mr10 link-blue2 undis" ng-click="sendFile(r,3)">发送</a><div class="cl"></div></div>
|
||||
<p ng-show="exercises_tag == true && exercises.length<=0" class="class-test-tip">暂无小测验,<br />
|
||||
请登录Trustie网站,在PC浏览器中上传小测验。</p>
|
||||
<p ng-show="exercises_tag == true && exercises.length<=0" class="class-test-tip">暂无测验,<br />
|
||||
请登录Trustie网站,在PC浏览器中上传测验。</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
<div class="bottom-tab-wrap mt10">
|
||||
<a ng-click="newClass()" href="javascript:void(0);" class="weixin-tab link-blue2 border-top">新建课程</a>
|
||||
<a ng-click="joinClass()" class="weixin-tab link-blue2 border-top">加入班级</a>
|
||||
<a ng-click="goResource()" href="javascript:void(0);" class="weixin-tab link-blue2 border-top">我的资源</a>
|
||||
<!--<a ng-click="goResource()" href="javascript:void(0);" class="weixin-tab link-blue2 border-top">我的资源</a>-->
|
||||
</div>
|
||||
|
||||
<my-alert message="alertService_1.message" title="alertService_1.title" visible="alertService_1.visible" cb="alertService_1.cb"></my-alert>
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
<div class="post-container">
|
||||
<div loading-spinner></div>
|
||||
<div ng-show="current_edit_member" class="post-container" style="padding-bottom:50px;">
|
||||
<div class="blue-title">角色变更</div>
|
||||
<div class="class-detail-row f13 c-grey3"><img ng-src="/images/wechat/{{current_edit_member.user.gender==0 ? 'male' : 'female'}}.jpg" width="30" class="fl ml10 img-circle mt4" /><span class="fl mt10 ml10">{{current_edit_member.user.realname == "" ? current_edit_member.user.name : current_edit_member.user.realname}}</span><img ng-src="/images/wechat/{{current_edit_member.user.gender==0 ? 'male' : 'female'}}.png" width="15" class="fl ml10 mt10" /><div class="cl"></div> </div>
|
||||
<div class="course-list-row f13 c-grey3 mt10"><span class="fl ml10">角色</span></div>
|
||||
<ul class="class-list f13 c-grey3">
|
||||
<li><span class="fl ml10 class-list-name hidden">教师</span><span ng-click="selectRole(9)" ng-class="['login-box', 'fr', 'mr10', 'mt12','img-circle', {'checked': current_edit_member.roles_id == 9}]"></span></li>
|
||||
<li><span class="fl ml10 class-list-name hidden">教辅</span><span ng-click="selectRole(7)" ng-class="['login-box', 'fr', 'mr10', 'mt12','img-circle', {'checked': current_edit_member.roles_id == 7}]"></span></li>
|
||||
<li class="border-bottom-none"><span class="fl ml10 class-list-name hidden">学生</span><span ng-click="selectRole(10)" ng-class="['login-box', 'fr', 'mr10', 'mt12','img-circle', {'checked': current_edit_member.roles_id == 10}]"></span></li>
|
||||
</ul>
|
||||
<div class="bottom-tab-wrap mt10">
|
||||
<a href="javascript:void(0);" ng-click="cancel()" class="weixin-tab c-grey border-top">取消</a>
|
||||
<a href="javascript:void(0);" ng-click="edit_member_role()" class="weixin-tab link-blue2 border-top">确定</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert>
|
||||
</div>
|
|
@ -0,0 +1,21 @@
|
|||
<div class="post-container">
|
||||
<div loading-spinner></div>
|
||||
<div ng-show="current_edit_member" class="post-container" style="padding-bottom:50px;">
|
||||
<div class="blue-title">角色变更</div>
|
||||
<div class="class-detail-row f13 c-grey3"><img ng-src="/images/wechat/{{current_edit_member.user.gender==0 ? 'male' : 'female'}}.jpg" width="30" class="fl ml10 img-circle mt4" /><span class="fl mt10 ml10">{{current_edit_member.user.real_name == "" ? current_edit_member.user.name : current_edit_member.user.real_name}}</span><img ng-src="/images/wechat/{{current_edit_member.user.gender==0 ? 'male' : 'female'}}.png" width="15" class="fl ml10 mt10" /><div class="cl"></div> </div>
|
||||
<div class="course-list-row f13 c-grey3 mt10"><span class="fl ml10">角色</span></div>
|
||||
<ul class="class-list f13 c-grey3">
|
||||
<li><span class="fl ml10 class-list-name hidden">管理人员</span><span ng-click="selectRole(3)" ng-class="['login-box', 'fr', 'mr10', 'mt12','img-circle', {'checked': current_edit_member.roles_id == 3}]"></span></li>
|
||||
<li><span class="fl ml10 class-list-name hidden">开发人员</span><span ng-click="selectRole(4)" ng-class="['login-box', 'fr', 'mr10', 'mt12','img-circle', {'checked': current_edit_member.roles_id == 4}]"></span></li>
|
||||
<li class="border-bottom-none"><span class="fl ml10 class-list-name hidden">报告人员</span><span ng-click="selectRole(5)" ng-class="['login-box', 'fr', 'mr10', 'mt12','img-circle', {'checked': current_edit_member.roles_id == 5}]"></span></li>
|
||||
</ul>
|
||||
<div class="bottom-tab-wrap mt10">
|
||||
<a href="javascript:void(0);" ng-click="cancel()" class="weixin-tab c-grey border-top">取消</a>
|
||||
<a href="javascript:void(0);" ng-click="edit_member_role()" class="weixin-tab link-blue2 border-top">确定</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert>
|
||||
</div>
|
|
@ -0,0 +1,11 @@
|
|||
<div class="post-container">
|
||||
<div loading-spinner></div>
|
||||
|
||||
<div class="blue-title">新建项目</div>
|
||||
<form novalidate name="classForm">
|
||||
<div class="course-list-row f13 c-grey3 mt30"><span class="fl ml15 c-grey3">项目</span><input class="new-class-input ml25" ng-model="project.name" required placeholder="例如:团队写作方法与机制研究" /></div>
|
||||
<a ng-click="newProject(classForm, project)" ng-class="['finish-btn', {'btn-disabled':!classForm.$valid} ]" >完成</a>
|
||||
</form>
|
||||
|
||||
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert>
|
||||
</div>
|
|
@ -5,100 +5,127 @@
|
|||
<a ng-click="tab($index+1)" ng-repeat="menu in menus" id="class_tab_1" href="javascript:void(0);" ng-class="['weixin-tab', {'class-tab-active': currentTab == $index+1}]">{{menu}}</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div ng-repeat="act in project_activities">
|
||||
<div ng-if="act.container_type=='Project' ">
|
||||
<div ng-if="act.act_type=='Issue'">
|
||||
<div class="post-container">
|
||||
<div class="post-wrapper">
|
||||
<div class="post-main">
|
||||
<div dataID = "{{act.act_id}}" ng-click="goDetail('issues',act.act_id, act.id)" id="act_{{act.id}}">
|
||||
<div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
|
||||
<div class="post-dynamic-author hidden fl">
|
||||
<span ng-if="act.author.realname != ' '">{{act.author.realname}}</span>
|
||||
<span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span>
|
||||
<img ng-if="act.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
|
||||
<img ng-if="act.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
|
||||
<div ng-class="{'undis': currentTab != 1}">
|
||||
<div ng-repeat="act in project_activities">
|
||||
<div ng-if="act.container_type=='Project' ">
|
||||
<div ng-if="act.act_type=='Issue'">
|
||||
<div class="post-container">
|
||||
<div class="post-wrapper">
|
||||
<div class="post-main">
|
||||
<div dataID = "{{act.act_id}}" ng-click="goDetail('issues',act.act_id, act.id)" id="act_{{act.id}}">
|
||||
<div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
|
||||
<div class="post-dynamic-author hidden fl">
|
||||
<span ng-if="act.author.realname != ' '">{{act.author.realname}}</span>
|
||||
<span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span>
|
||||
<img ng-if="act.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
|
||||
<img ng-if="act.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
|
||||
</div>
|
||||
<div class="post-dynamic-time fr f13">{{act.latest_update}}</div>
|
||||
<div class="cl"></div>
|
||||
<div class="post-dynamic-title c-grey3 hidden mt12 fb">【问题】{{act.subject|safeHtml}}</div>
|
||||
<div class="post-content c-grey3 mt10 mb10">
|
||||
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
|
||||
<span class="mr15 f13 c-grey2">状态:{{act.issue_detail.issue_status}}</span> <span class="mr15 f13 c-grey2">优先级:{{act.issue_detail.issue_priority}}</span> <br />
|
||||
<span class="mr15 f13 c-grey2">指派给:{{act.issue_detail.issue_assigned_to}}</span> <span class="mr15 f13 c-grey2">完成度:{{act.issue_detail.done_ratio}}%</span>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="post-dynamic-time fr f13">{{act.latest_update}}</div>
|
||||
<div class="cl"></div>
|
||||
<div class="post-dynamic-title c-grey3 hidden mt12 fb">【问题】{{act.subject|safeHtml}}</div>
|
||||
<div class="post-content c-grey3 mt10 mb10">
|
||||
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
|
||||
<span class="mr15 f13 c-grey2">状态:{{act.issue_detail.issue_status}}</span> <span class="mr15 f13 c-grey2">优先级:{{act.issue_detail.issue_priority}}</span> <br />
|
||||
<span class="mr15 f13 c-grey2">指派给:{{act.issue_detail.issue_assigned_to}}</span> <span class="mr15 f13 c-grey2">完成度:{{act.issue_detail.done_ratio}}%</span>
|
||||
<div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div>
|
||||
<div class="fr f13">
|
||||
<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>赞</span></div>
|
||||
<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
|
||||
<div ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
|
||||
</div>
|
||||
<div class="fr mr25 f13">
|
||||
<a ng-if="!act.reply_count" ng-click="goDetail('issues',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
|
||||
<a ng-if="act.reply_count" ng-click="goDetail('issues',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div>
|
||||
<div class="fr f13">
|
||||
<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>赞</span></div>
|
||||
<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
|
||||
<div ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
|
||||
</div>
|
||||
<div class="fr mr25 f13">
|
||||
<a ng-if="!act.reply_count" ng-click="goDetail('issues',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
|
||||
<a ng-if="act.reply_count" ng-click="goDetail('issues',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div ng-if="act.act_type=='Message'">
|
||||
<div class="post-container">
|
||||
<div class="post-wrapper">
|
||||
<div class="post-main">
|
||||
<div dataID = "{{act.act_id}}" ng-click="goDetail('project_discussion',act.act_id, act.id)" id="act_{{act.id}}">
|
||||
<div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
|
||||
<div class="post-dynamic-author hidden fl">
|
||||
<span ng-if="act.author.realname != ' '">{{act.author.realname}}</span>
|
||||
<span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span>
|
||||
<img ng-if="act.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
|
||||
<img ng-if="act.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
|
||||
<div ng-if="act.act_type=='Message'">
|
||||
<div class="post-container">
|
||||
<div class="post-wrapper">
|
||||
<div class="post-main">
|
||||
<div dataID = "{{act.act_id}}" ng-click="goDetail('project_discussion',act.act_id, act.id)" id="act_{{act.id}}">
|
||||
<div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
|
||||
<div class="post-dynamic-author hidden fl">
|
||||
<span ng-if="act.author.realname != ' '">{{act.author.realname}}</span>
|
||||
<span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span>
|
||||
<img ng-if="act.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
|
||||
<img ng-if="act.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
|
||||
</div>
|
||||
<div class="post-dynamic-time fr f13">{{act.latest_update}}</div>
|
||||
<div class="cl"></div>
|
||||
<div class="post-dynamic-title c-grey3 hidden mt12 fb">【帖子】{{act.subject|safeHtml}}</div>
|
||||
<div class="post-content c-grey3 mt10 mb10">
|
||||
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="post-dynamic-time fr f13">{{act.latest_update}}</div>
|
||||
<div class="cl"></div>
|
||||
<div class="post-dynamic-title c-grey3 hidden mt12 fb">【帖子】{{act.subject|safeHtml}}</div>
|
||||
<div class="post-content c-grey3 mt10 mb10">
|
||||
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
|
||||
<div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div>
|
||||
<div class="fr f13">
|
||||
<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>赞</span></div>
|
||||
<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
|
||||
<div ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
|
||||
</div>
|
||||
<div class="fr mr25 f13">
|
||||
<a ng-if="!act.reply_count" ng-click="goDetail('project_discussion',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
|
||||
<a ng-if="act.reply_count" ng-click="goDetail('project_discussion',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div>
|
||||
<div class="fr f13">
|
||||
<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>赞</span></div>
|
||||
<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
|
||||
<div ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
|
||||
</div>
|
||||
<div class="fr mr25 f13">
|
||||
<a ng-if="!act.reply_count" ng-click="goDetail('project_discussion',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
|
||||
<a ng-if="act.reply_count" ng-click="goDetail('project_discussion',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-if="act.act_type=='Project'">
|
||||
<div class="post-container">
|
||||
<div class="post-wrapper">
|
||||
<div class="post-main">
|
||||
<div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
|
||||
<div class="post-title hidden mb5"><span class="c-grey3 f13 fb mr10">{{act.author.realname}}</span>创建了<span class="c-grey3 f13 fb ml10">{{act.course_project_name}} | 项目</span></div>
|
||||
<div class="post-title hidden"><span class="mr10">{{act.latest_update}}</span></div>
|
||||
<div class="cl"></div>
|
||||
<div ng-if="act.act_type=='Project'">
|
||||
<div class="post-container">
|
||||
<div class="post-wrapper">
|
||||
<div class="post-main">
|
||||
<div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
|
||||
<div class="post-title hidden mb5"><span class="c-grey3 f13 fb mr10">{{act.author.realname}}</span>创建了<span class="c-grey3 f13 fb ml10">{{act.course_project_name}} | 项目</span></div>
|
||||
<div class="post-title hidden"><span class="mr10">{{act.latest_update}}</span></div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-if="project_has_more">
|
||||
<div id="more_project_activities" class="more-events mt10" ng-click="getActivities(project_activities_page+1);">更多</div>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-if="project_has_more">
|
||||
<div id="more_project_activities" class="more-events mt10" ng-click="getActivities(project_activities_page+1);">更多</div>
|
||||
|
||||
<div ng-class="{'undis': currentTab != 2}">
|
||||
<div class="class-search-wrap">
|
||||
<div class="class-search-inner"> <img src="/images/wechat/search.png" width="18" class="class-search-icon" />
|
||||
<input class="class-detail-search" ng-model="searchText" placeholder="输入关键词进行搜索" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="member-banner f13 c-grey3">管理人员({{project_master_members.length}})</div>
|
||||
<div class="class-member-row f13 c-grey3" ng-repeat="master in project_master_members|filter:searchText">
|
||||
<img ng-src="/images/wechat/{{master.user.gender==0 ? 'male' : 'female'}}.jpg" width="30" class="fl ml10 img-circle" /><span class="fl ml10 mt5">{{master.user.real_name == "" ? master.user.name : master.user.real_name }}</span><span class="fr mr10 c-grey2">{{teacher.role_name|identify}}</span><img ng-src="/images/wechat/{{master.user.gender==0 ? 'male' : 'female'}}.png" width="15" class="fl ml10 mt5" />
|
||||
<img src="/images/wechat/setting.png" ng-show = "master.user.id != project.user_id && project.can_setting" width="15" class="class-list-setting" ng-click="onSetting(master)" />
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="member-banner f13 mt10 c-grey3">开发人员({{project_develop_members.length}})</div>
|
||||
<div class="class-member-row f13 c-grey3" ng-repeat="develop in project_develop_members|filter:searchText">
|
||||
<img ng-src="/images/wechat/{{develop.user.gender==0 ? 'male' : 'female'}}.jpg" width="30" class="fl ml10 img-circle" /><span class="fl ml10 mt5">{{develop.user.real_name == "" ? develop.user.name : develop.user.real_name}}</span><img ng-src="/images/wechat/{{develop.user.gender==0 ? 'male' : 'female'}}.png" width="15" class="fl ml10 mt5" />
|
||||
<img src="/images/wechat/setting.png" ng-show = "master.user.id != project.user_id && project.can_setting " width="15" class="class-list-setting" ng-click="onSetting(develop)" />
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="member-banner f13 mt10 c-grey3">报告人员({{project_report_members.length}})</div>
|
||||
<div class="class-member-row f13 c-grey3" ng-repeat="report in project_report_members|filter:searchText">
|
||||
<img ng-src="/images/wechat/{{report.user.gender==0 ? 'male' : 'female'}}.jpg" width="30" class="fl ml10 img-circle" /><span class="fl ml10 mt5">{{report.user.real_name == "" ? report.user.name : report.user.real_name}}</span><img ng-src="/images/wechat/{{report.user.gender==0 ? 'male' : 'female'}}.png" width="15" class="fl ml10 mt5" />
|
||||
<img src="/images/wechat/setting.png" ng-show = "master.user.id != project.user_id && project.can_setting " width="15" class="class-list-setting" ng-click="onSetting(report)" />
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<div>
|
||||
<div class="course-diff-row"><span class="c-blue f13 ml10">我创建的项目</span></div>
|
||||
<div ng-repeat="project in projects" style="position:relative;">
|
||||
<div ng-click="goProject(project.id)" ng-show="project.can_setting" class="course-list-row f13 c-grey3 border-top-none">
|
||||
<div ng-click="goProject(project.id)" ng-show="project.is_creator" class="course-list-row f13 c-grey3 border-top-none">
|
||||
<span class="fl ml15 class-list-name hidden">{{project.name}}</span>
|
||||
<span class="fr c-grey4 mr10">></span>
|
||||
<span class="students-amount f12 fr mt10 mr5">{{project.member_count}}人</span>
|
||||
|
@ -18,7 +18,7 @@
|
|||
<div>
|
||||
<div class="course-diff-row mt10"><span class="c-blue f13 ml10">我参与的项目</span></div>
|
||||
<div ng-click="goProject(project.id)" ng-repeat="project in projects" style="position:relative;">
|
||||
<div ng-show="!project.can_setting" class="course-list-row f13 c-grey3 border-top-none">
|
||||
<div ng-show="!project.is_creator" class="course-list-row f13 c-grey3 border-top-none">
|
||||
<span class="fl ml15 class-list-name hidden">{{project.name}}</span>
|
||||
<span class="fr c-grey4 mr10">></span>
|
||||
<span class="students-amount f12 fr mt10 mr5">{{project.member_count}}人</span>
|
||||
|
|
|
@ -139,11 +139,19 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
|
|||
var resetMenu = function(is_teacher){
|
||||
vm.isTeacher = is_teacher;
|
||||
if(is_teacher){
|
||||
vm.menus = ["课件", "作业", "小测验", "学生管理"];
|
||||
vm.menus = ["课件", "作业", "测验", "成员管理"];
|
||||
} else {
|
||||
vm.menus = ['课件', "我的同学"];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
vm.onSetting = function(user){
|
||||
rms.save('current_edit_member', user);
|
||||
$location.path("/edit_class_member").search({id: courseid,user_id: user.id});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
}]);
|
|
@ -47,7 +47,7 @@ app.controller('EditClassController', ['$scope', '$http', 'auth', 'config', 'ale
|
|||
token: auth.token()
|
||||
}).then(function(response){
|
||||
if(response.data.status!=0){
|
||||
vm.alertService_1.showMessage('出错了', response.data.message);
|
||||
vm.alertService_1.showMessage('提示', response.data.message);
|
||||
} else {
|
||||
vm.alertService_1.showMessage('提示', '删除班级成功', function(){
|
||||
vm.syllabus.courses.splice(index, 1);
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
|
||||
|
||||
app.controller('EditClassMemberController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms', function($scope, $http, auth, config, alertService, $location,$routeParams, rms){
|
||||
var vm = $scope;
|
||||
|
||||
// vm.current_edit_member = rms.get('current_edit_member');
|
||||
vm.current_edit_member = null;
|
||||
|
||||
vm.alertService = alertService.create();
|
||||
|
||||
var course_id = $routeParams.id;
|
||||
var user_id = $routeParams.user_id;
|
||||
if(!vm.current_edit_member){
|
||||
$http.post(config.apiUrl+'courses/get_member_info', {
|
||||
token: auth.token(),
|
||||
id: course_id,
|
||||
user_id:user_id
|
||||
}).then(function(response){
|
||||
if(response.data.status!=0){
|
||||
vm.alertService.showMessage('提示', response.data.message);
|
||||
} else {
|
||||
course_id = response.data.course_id;
|
||||
user_id = response.data.user_id;
|
||||
vm.current_edit_member = response.data.member_info;
|
||||
vm.current_roles_id = vm.current_edit_member.roles_id;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
console.log(vm.current_edit_member);
|
||||
|
||||
vm.cancel = function(){
|
||||
vm.alertService.showMessage('提示', '您确定不对角色进行变更吗?', function(){
|
||||
// rms.save("project_master_members",[]);
|
||||
// rms.save("project_develop_members",[]);
|
||||
// rms.save("project_report_members",[]);
|
||||
window.history.back();
|
||||
// $location.path("/project").search({id: project_id});
|
||||
});
|
||||
};
|
||||
|
||||
vm.edit_member_role = function(){
|
||||
if(vm.current_roles_id == vm.current_edit_member.roles_id){
|
||||
vm.alertService.showMessage('提示', "该用户当前已是该角色");
|
||||
return;
|
||||
}
|
||||
|
||||
$http.post(config.apiUrl+'courses/edit_member_role', {
|
||||
token: auth.token(),
|
||||
id: course_id,
|
||||
user_id:vm.current_edit_member.user.id,
|
||||
role_id:vm.current_edit_member.roles_id
|
||||
}).then(function(response){
|
||||
if(response.data.status!=0){
|
||||
vm.alertService.showMessage('提示', response.data.message);
|
||||
} else {
|
||||
vm.alertService.showMessage('提示', '修改角色成功', function(){
|
||||
// window.history.back();
|
||||
$location.path("/class").search({id: course_id});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
|
||||
vm.selectRole = function(role_id){
|
||||
vm.current_edit_member.roles_id = role_id;
|
||||
}
|
||||
|
||||
}] );
|
|
@ -0,0 +1,80 @@
|
|||
|
||||
|
||||
app.controller('EditProjectMemberController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms', function($scope, $http, auth, config, alertService, $location,$routeParams, rms){
|
||||
var vm = $scope;
|
||||
|
||||
// vm.current_edit_member = rms.get('current_edit_member');
|
||||
|
||||
vm.current_edit_member = null;
|
||||
|
||||
vm.alertService = alertService.create();
|
||||
|
||||
var project_id = $routeParams.id;
|
||||
var user_id = $routeParams.user_id;
|
||||
if(!vm.current_edit_member){
|
||||
$http.post(config.apiUrl+'projects/get_member_info', {
|
||||
token: auth.token(),
|
||||
id: project_id,
|
||||
user_id:user_id
|
||||
}).then(function(response){
|
||||
if(response.data.status!=0){
|
||||
vm.alertService.showMessage('提示', response.data.message);
|
||||
} else {
|
||||
project_id = response.data.project_id;
|
||||
user_id = response.data.user_id;
|
||||
vm.current_edit_member = response.data.member_info;
|
||||
vm.current_roles_id = vm.current_edit_member.roles_id;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
console.log(vm.current_edit_member);
|
||||
|
||||
vm.cancel = function(){
|
||||
vm.alertService.showMessage('提示', '您确定不对角色进行变更吗?', function(){
|
||||
// rms.save("project_master_members",[]);
|
||||
// rms.save("project_develop_members",[]);
|
||||
// rms.save("project_report_members",[]);
|
||||
window.history.back();
|
||||
// $location.path("/project").search({id: project_id});
|
||||
});
|
||||
};
|
||||
|
||||
vm.edit_member_role = function(){
|
||||
if(vm.current_roles_id == vm.current_edit_member.roles_id){
|
||||
vm.alertService.showMessage('提示', "该用户当前已是该角色");
|
||||
return;
|
||||
}
|
||||
|
||||
$http.post(config.apiUrl+'projects/edit_member_role', {
|
||||
token: auth.token(),
|
||||
id: project_id,
|
||||
user_id:vm.current_edit_member.user.id,
|
||||
role_id:vm.current_edit_member.roles_id
|
||||
}).then(function(response){
|
||||
if(response.data.status!=0){
|
||||
vm.alertService.showMessage('提示', response.data.message);
|
||||
} else {
|
||||
vm.alertService.showMessage('提示', '修改角色成功', function(){
|
||||
rms.save('project_activities_page',0);
|
||||
rms.save("project_activities",[]);
|
||||
rms.save("project_has_more",false);
|
||||
rms.save("project",null);
|
||||
rms.save("project_master_members",[]);
|
||||
rms.save("project_develop_members",[]);
|
||||
rms.save("project_report_members",[]);
|
||||
rms.save('tab_num',null);
|
||||
// window.history.back();
|
||||
$location.path("/project").search({id: project_id});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
|
||||
vm.selectRole = function(role_id){
|
||||
vm.current_edit_member.roles_id = role_id;
|
||||
}
|
||||
|
||||
}] );
|
|
@ -0,0 +1,47 @@
|
|||
|
||||
|
||||
app.controller('NewProjectController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','rms', function($scope, $http, auth, config, alertService, $location,rms){
|
||||
var vm = $scope;
|
||||
|
||||
vm.alertService = alertService.create();
|
||||
|
||||
vm.project = {
|
||||
name:""
|
||||
};
|
||||
|
||||
vm.addClass = function(){
|
||||
vm.syllabus.courses.push({});
|
||||
};
|
||||
|
||||
vm.deleteClass = function(index){
|
||||
vm.syllabus.courses.splice(index, 1);
|
||||
}
|
||||
|
||||
vm.newProject = function (frm, project) {
|
||||
frm.$setSubmitted();
|
||||
console.log(project);
|
||||
|
||||
if(!frm.$valid){
|
||||
console.log(frm.$error);
|
||||
return;
|
||||
}
|
||||
|
||||
$http.post(config.apiUrl+"projects/create", {
|
||||
token: auth.token(),
|
||||
name: project.name
|
||||
}).then(function(response){
|
||||
if(response.data.status!=0){
|
||||
vm.alertService.showMessage('出错了', response.data.message);
|
||||
} else {
|
||||
vm.alertService.showMessage('提示', '新建项目成功', function(){
|
||||
// window.history.back();
|
||||
rms.save('projects',[]);
|
||||
$location.path("/project_list");
|
||||
});
|
||||
}
|
||||
console.log(response.data.data);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}] );
|
|
@ -10,10 +10,15 @@ app.controller('ProjectController', ['$scope', 'config','$http','$timeout', 'aut
|
|||
vm.project_activities = rms.get("project_activities") || [];
|
||||
vm.project_has_more = rms.get("project_has_more");
|
||||
|
||||
vm.project = rms.get("project")
|
||||
vm.project = rms.get("project") || null;
|
||||
|
||||
vm.project_members = [];
|
||||
vm.project_members_page = 0;
|
||||
|
||||
// vm.project_members_page = rms.get('project_members_page') || 0;
|
||||
vm.project_master_members = rms.get("project_master_members") || [];
|
||||
vm.project_develop_members = rms.get("project_develop_members") || [];
|
||||
vm.project_report_members = rms.get("project_report_members") || [];
|
||||
|
||||
// vm.project_members_has_more = rms.get("project_members_has_more");
|
||||
|
||||
vm.alertService = alertService.create();
|
||||
|
||||
|
@ -25,17 +30,55 @@ app.controller('ProjectController', ['$scope', 'config','$http','$timeout', 'aut
|
|||
data:{token:auth.token(),page:page}
|
||||
}).then(function successCallback(response) {
|
||||
console.log(response.data);
|
||||
vm.project_activities_page = response.data.page;
|
||||
if(response.data.page > 0)
|
||||
{
|
||||
vm.project_activities = vm.project_activities.concat(response.data.data);
|
||||
if(response.data.status == 0){
|
||||
vm.project_activities_page = response.data.page;
|
||||
if(response.data.page > 0)
|
||||
{
|
||||
vm.project_activities = vm.project_activities.concat(response.data.data);
|
||||
}
|
||||
else{
|
||||
vm.project_activities = response.data.data;
|
||||
vm.project_activities_page = 0;
|
||||
vm.project_has_more = (response.data.count + response.data.page * 10) < response.data.all_count;
|
||||
}
|
||||
}
|
||||
else{
|
||||
vm.project_activities = response.data.data;
|
||||
vm.project_activities_page = 0;
|
||||
vm.project_has_more = (response.data.count + response.data.page * 10) < response.data.all_count;
|
||||
vm.alertService.showMessage('提示', response.data.message);
|
||||
}
|
||||
|
||||
|
||||
}, function errorCallback(response) {
|
||||
});
|
||||
}
|
||||
|
||||
vm.getMembers = function(page){
|
||||
$http({
|
||||
method: 'POST',
|
||||
url: apiUrl + "projects/members?id=" + projectid,
|
||||
data:{token:auth.token(),page:page}
|
||||
}).then(function successCallback(response) {
|
||||
console.log(response.data);
|
||||
if(response.data.status == 0){
|
||||
// vm.project_members_page = response.data.page;
|
||||
// if(response.data.page > 0)
|
||||
// {
|
||||
// vm.project_members = vm.project_members.concat(response.data.data);
|
||||
// }
|
||||
// else{
|
||||
// vm.project_members = response.data.data;
|
||||
// vm.project_members_page = 0;
|
||||
// vm.project_members_has_more = (response.data.count + response.data.page * 10) < response.data.all_count;
|
||||
// }
|
||||
vm.project_master_members = response.data.master_members;
|
||||
vm.project_develop_members = response.data.develop_members;
|
||||
vm.project_report_members = response.data.report_members;
|
||||
|
||||
}
|
||||
else{
|
||||
vm.alertService.showMessage('提示', response.data.message);
|
||||
}
|
||||
|
||||
|
||||
}, function errorCallback(response) {
|
||||
});
|
||||
}
|
||||
|
@ -53,19 +96,14 @@ app.controller('ProjectController', ['$scope', 'config','$http','$timeout', 'aut
|
|||
vm.currentTab = index;
|
||||
vm.searchText = '';
|
||||
|
||||
if(index == 1){
|
||||
if(index == 1 && vm.project_activities.length <= 0 ){
|
||||
vm.getActivities(0);
|
||||
}
|
||||
else if(index == 2){
|
||||
$http.get(config.apiUrl + 'projects/members?token='+auth.token()+'&project_id='+projectid).then(
|
||||
function(response) {
|
||||
console.log(response.data);
|
||||
vm.project_activities = response.data.data;
|
||||
}
|
||||
)
|
||||
else if(index == 2 && vm.project_master_members.length <= 0){
|
||||
vm.getMembers(0);
|
||||
}
|
||||
|
||||
rms.save("tab_num",$scope.currentTab);
|
||||
rms.save("tab_num",vm.currentTab);
|
||||
};
|
||||
|
||||
//初始化TAB按钮
|
||||
|
@ -75,7 +113,6 @@ app.controller('ProjectController', ['$scope', 'config','$http','$timeout', 'aut
|
|||
} else {
|
||||
vm.menus = ['项目动态', "我的伙伴"];
|
||||
}
|
||||
|
||||
}
|
||||
if(vm.project){
|
||||
resetMenu(vm.project.can_setting);
|
||||
|
@ -134,4 +171,19 @@ app.controller('ProjectController', ['$scope', 'config','$http','$timeout', 'aut
|
|||
common.decreaseCommonPraise(act);
|
||||
};
|
||||
|
||||
vm.onSetting = function(data){
|
||||
rms.save('current_edit_member', data);
|
||||
|
||||
rms.save('project_activities_page',vm.project_activities_page);
|
||||
rms.save("project_activities",vm.project_activities);
|
||||
rms.save("project_has_more",vm.project_has_more);
|
||||
|
||||
rms.save("project",vm.project);
|
||||
rms.save("project_master_members",vm.project_master_members);
|
||||
rms.save("project_develop_members",vm.project_develop_members);
|
||||
rms.save("project_report_members",vm.project_report_members);
|
||||
|
||||
$location.path("/edit_project_member").search({id: projectid,user_id: data.user.id});
|
||||
};
|
||||
|
||||
}]);
|
|
@ -6,7 +6,8 @@
|
|||
app.controller('ProjectListController', ['$scope', 'config', 'auth', '$http', '$location', 'alertService','rms',
|
||||
function ($scope, config, auth, $http, $location, alertService,rms) {
|
||||
var vm = $scope;
|
||||
vm.projects = rms.get('projects') || [];
|
||||
// vm.projects = rms.get('projects') || [];
|
||||
vm.projects = [];
|
||||
|
||||
vm.alertService_1 = alertService.create();
|
||||
vm.alertService_3 = alertService.create();
|
||||
|
@ -26,29 +27,27 @@ app.controller('ProjectListController', ['$scope', 'config', 'auth', '$http', '$
|
|||
}
|
||||
|
||||
vm.goProject = function (project_id) {
|
||||
|
||||
rms.save('project_activities_page',0);
|
||||
rms.save("project_activities",[]);
|
||||
rms.save("project_has_more",false);
|
||||
rms.save("project",null);
|
||||
rms.save('project_members_page',0);
|
||||
rms.save("project_members",[]);
|
||||
rms.save("project_members_has_more",false);
|
||||
rms.save('tab_num',null);
|
||||
console.log(project_id);
|
||||
$location.path("/project").search({id: project_id});
|
||||
}
|
||||
};
|
||||
|
||||
vm.newProject = function () {
|
||||
//先判断下权限
|
||||
$http.post(config.apiUrl + "projects/auth",{token: auth.token()} ).then(
|
||||
function (response) {
|
||||
console.log(response.data);
|
||||
if (response.data.auth == 0) {
|
||||
vm.alertService_1.showMessage('提示', '非教师身份不能创建课程哦~');
|
||||
}
|
||||
else{
|
||||
$location.path("/new_project");
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
$location.path("/new_project");
|
||||
};
|
||||
|
||||
vm.joinProject = function () {
|
||||
vm.alertService_3.showMessage('提示', '请输入6位项目邀请码(不区分大小写)', function(){
|
||||
if (vm.alertService_3.invite && vm.alertService_3.invite.length == 5) {
|
||||
$http.post(config.apiUrl + "courses/join", {
|
||||
if (vm.alertService_3.invite && vm.alertService_3.invite.length == 6) {
|
||||
$http.post(config.apiUrl + "projects/join", {
|
||||
token: auth.token(),
|
||||
invite_code: vm.alertService_3.invite
|
||||
}).then(function (response) {
|
||||
|
@ -58,7 +57,7 @@ app.controller('ProjectListController', ['$scope', 'config', 'auth', '$http', '$
|
|||
} else {
|
||||
vm.alertService_1.showMessage('提示', '加入项目成功');
|
||||
vm.alertService_3.invite = "";
|
||||
loadClassList();
|
||||
loadProjectList();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -34,11 +34,14 @@ app.config(['$routeProvider',"$httpProvider", "$locationProvider",'config', func
|
|||
.when('/new_class', makeRoute('new_class.html', 'NewClassController'))
|
||||
.when('/edit_class', makeRoute('edit_class.html', 'EditClassController'))
|
||||
.when('/class_list', makeRoute('class_list.html', 'ClassListController'))
|
||||
.when('/edit_class_member', makeRoute('edit_class_member.html', 'EditClassMemberController'))
|
||||
.when('/myresource', makeRoute('myresource.html', 'MyResourceController'))
|
||||
.when('/invite_code', {templateUrl: rootPath + 'invite_code.html', controller: 'InviteCodeController'})
|
||||
.when('/send_class_list', makeRoute('send_class_list.html', 'SendClassListController'))
|
||||
.when('/project_list', makeRoute('project_list.html', 'ProjectListController'))
|
||||
.when('/project', makeRoute('project.html', 'ProjectController'))
|
||||
.when('/edit_project_member', makeRoute('edit_project_member.html', 'EditProjectMemberController'))
|
||||
.when('/new_project', makeRoute('new_project.html', 'NewProjectController'))
|
||||
.otherwise({
|
||||
redirectTo: '/activites'
|
||||
});
|
||||
|
|
|
@ -191,9 +191,9 @@ a.underline {text-decoration:underline;}
|
|||
.class-detail-search {width:100%; height:33px; color:#999; background-color:#fff; border:none; outline:none;}
|
||||
.border-top {border-top:1px solid #ccc;}
|
||||
.class-detail-row {width:100%; line-height:18px; padding:10px 0; border-bottom:1px solid #ccc; background-color:#fff;}
|
||||
.class-member-row {width:100%; line-height:18px; padding:5px 0; border-bottom:1px solid #ccc; background-color:#fff;}
|
||||
.class-member-row {width:100%; line-height:18px; padding:5px 0; border-bottom:1px solid #ccc; background-color:#fff; position:relative;}
|
||||
.class-test-tip {text-align:center; font-size:13px; color:#444; padding-top:40px;}
|
||||
.img-circle {border-radius:50%;}
|
||||
.img-circle {border-radius:50% !important;}
|
||||
.member-banner {height:24px; line-height:24px; text-align:center; vertical-align:middle; background-color:#dfdfdf;}
|
||||
.resource-width {width:76%;}
|
||||
.courseware-from-width {max-width:57%;}
|
||||
|
|
Loading…
Reference in New Issue