issue修改
This commit is contained in:
parent
2a58193e8f
commit
c2f09a4989
|
|
@ -611,59 +611,46 @@ end
|
|||
def classroom
|
||||
@menu_type = 2
|
||||
@sub_type = 1
|
||||
@syllabus = Syllabus.where("0=0")
|
||||
@courselist = CourseList.where("0=0")
|
||||
@sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order]
|
||||
# major_level_option = params[:major_level] if params[:major_level]
|
||||
# discipline_category_option = params[:discipline_category_id] if params[:discipline_category_id]
|
||||
# first_level_discipline_option = params[:first_level_discipline_id] if params[:first_level_discipline_id]
|
||||
# syllabus_major_option = params[:major_id] if params[:major_id]
|
||||
keyword = params[:keyword]
|
||||
search = params[:search]
|
||||
|
||||
# if major_level_option && major_level_option != '0'
|
||||
# @syllabus = @syllabus.where(:major_level=>major_level_option)
|
||||
# end
|
||||
#
|
||||
# if discipline_category_option && discipline_category_option != '0'
|
||||
# @syllabus=@syllabus.where(:discipline_category_id=>discipline_category_option)
|
||||
# end
|
||||
#
|
||||
# if first_level_discipline_option && first_level_discipline_option != '0'
|
||||
# @syllabus=@syllabus.where(:first_level_discipline_id=>first_level_discipline_option)
|
||||
# end
|
||||
#
|
||||
# if syllabus_major_option && syllabus_major_option != '0'
|
||||
# @syllabus=@syllabus.where(:major_id=>syllabus_major_option)
|
||||
# end
|
||||
|
||||
# if params[:school_id] && params[:school_id] != ''
|
||||
# @syllabus = @syllabus.includes(:user => {:user_extensions => []}).where("user_extensions.school_id = #{params[:school_id]}")
|
||||
# end
|
||||
|
||||
if params[:support_shixuns_search_title]
|
||||
@courselist = @courselist.where(:support_shixuns_search => params[:support_shixuns_search_title].to_i)
|
||||
end
|
||||
if search.blank?
|
||||
@syllabus = @syllabus
|
||||
@courselist = @courselist
|
||||
else
|
||||
if "u_name" == keyword
|
||||
user_id = User.where("concat(lastname, firstname) like '%#{search}%'")
|
||||
@syllabus = @syllabus.includes(:user).where("concat(users.lastname, users.firstname) like '%#{search}%'")
|
||||
@courselist = @courselist.includes(:user).where("concat(users.lastname, users.firstname) like '%#{search}%'")
|
||||
else
|
||||
@syllabus= @syllabus.where("title like '%#{search}%'")
|
||||
@courselist= @courselist.where("name like '%#{search}%'")
|
||||
end
|
||||
end
|
||||
|
||||
@syllabus = @syllabus.order("syllabuses.created_at #{@sx_order}")
|
||||
@syllabus_count = @syllabus.count
|
||||
@courselist_count = @courselist.count
|
||||
limit = 20
|
||||
@is_remote = true
|
||||
@syllabus_pages = Paginator.new @syllabus_count, limit, params['page'] || 1
|
||||
@offset ||= @syllabus_pages.offset
|
||||
@syllabus = paginateHelper @syllabus, limit
|
||||
@courselist_pages = Paginator.new @courselist_count, limit, params['page'] || 1
|
||||
@offset ||= @courselist_pages.offset
|
||||
@courselist = paginateHelper @courselist, limit
|
||||
|
||||
# @courselist = @courselist.order("courselist.created_at #{@sx_order}")
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
# 支撑实训检索
|
||||
def support_shixuns_search
|
||||
if params[:shixun_id]
|
||||
courselist = CourseList.find params[:shixun_id]
|
||||
courselist.update_attributes(:support_shixuns_search => !courselist.support_shixuns_search)
|
||||
end
|
||||
end
|
||||
|
||||
# 课堂列表
|
||||
def classroom_classment
|
||||
@menu_type = 2
|
||||
|
|
@ -679,6 +666,7 @@ end
|
|||
@search = params[:search] # 搜索字
|
||||
@keyword = params[:keyword].blank? ? "u_name" : params[:keyword] # 根据姓名/课程名搜索
|
||||
status = params[:status].to_i
|
||||
courselist = params[:course_list]
|
||||
|
||||
if params[:school_id] && params[:school_id] != ''
|
||||
@school_id = params[:school_id]
|
||||
|
|
@ -689,6 +677,9 @@ end
|
|||
@courses = @courses.where(:homepage_show => params[:homepage_show].to_i)
|
||||
end
|
||||
|
||||
if params[:course_list]
|
||||
@courses = @courses.where(:course_list_id => courselist)
|
||||
end
|
||||
if params[:status] && params[:status]!=''
|
||||
@status = params[:status]
|
||||
@courses =@courses.where(:is_end =>status)
|
||||
|
|
@ -813,7 +804,7 @@ end
|
|||
|
||||
# 0 全部;1 活动的; 2 已注册; 3 锁定
|
||||
def users
|
||||
@menu_type =7
|
||||
@menu_type
|
||||
@sub_type = 1
|
||||
status = params[:user_status].nil? ? 0 : params[:user_status].to_i
|
||||
@us_order = params[:us_order].blank? ? "desc" : params[:us_order] # 排序
|
||||
|
|
@ -832,9 +823,13 @@ end
|
|||
@users = User.where("status = #{status} and #{condition} like '%#{params[:research_contents]}%'").order("#{@order_key} #{@us_order}").all
|
||||
end
|
||||
end
|
||||
# if params[:school_id] && params[:school_id] !=''
|
||||
# @users = @users.find(params[:school_id])
|
||||
# end
|
||||
|
||||
school_name = params[:school]
|
||||
school = School.where("name like '%#{school_name}%'")
|
||||
school_id = school.map(&:id)
|
||||
user_id = UserExtensions.where(:school_id => school_id).map(&:user_id)
|
||||
@users = User.where(:id => user_id)
|
||||
|
||||
@users_count = @users.count
|
||||
@limit = 20
|
||||
@is_remote = true
|
||||
|
|
@ -964,7 +959,7 @@ end
|
|||
def users_trial
|
||||
@menu_type = 7
|
||||
@sub_type = 2
|
||||
@users = User.where(:status => 1).order("created_on desc").all
|
||||
@users = User.where(:status => 1).order("last_login_on desc").all
|
||||
@users_count = @users.count
|
||||
@limit = 20
|
||||
@is_remote = true
|
||||
|
|
@ -1161,7 +1156,9 @@ end
|
|||
@type = trial_authorization_status(params[:type])
|
||||
type = params[:type] || 0 # 存在type 就用type 没有就为 0
|
||||
user_id = User.find_by_sql("select id from users where concat(lastname,firstname) like '%#{params[:name]}%'")
|
||||
@unapproved_user = ApplyUserAuthentication.where(:status => @type, :user_id => user_id, :auth_type => 1).order("updated_at desc")
|
||||
|
||||
@unapproved_user = ApplyUserAuthentication.where(:status => @type, :user_id => user_id, :auth_type => 1).find_by_sql("SELECT s.*, TIMESTAMPDIFF(SECOND, s.updated_at, now()) diff FROM `apply_user_authentications` s order by diff asc")
|
||||
# @unapproved_user = ApplyUserAuthentication.where(:status => @type, :user_id => user_id, :auth_type => 1).order("updated_at desc")
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.js
|
||||
|
|
@ -1174,7 +1171,8 @@ end
|
|||
@type = trial_authorization_status(params[:type])
|
||||
type = params[:type] || 0 # 存在type 就用type 没有就为 0
|
||||
user_id = User.find_by_sql("select id from users where concat(lastname,firstname) like '%#{params[:name]}%'")
|
||||
@unapproved_user = ApplyUserAuthentication.where(:status => @type, :user_id => user_id, :auth_type => 2).order("updated_at desc")
|
||||
@unapproved_user = ApplyUserAuthentication.where(:status => @type, :user_id => user_id, :auth_type => 2).find_by_sql("SELECT s.*, TIMESTAMPDIFF(SECOND, s.updated_at, now()) diff FROM `apply_user_authentications` s order by diff asc")
|
||||
# @unapproved_user = ApplyUserAuthentication.where(:status => @type, :user_id => user_id, :auth_type => 2).order("updated_at desc")
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.js
|
||||
|
|
@ -1316,4 +1314,26 @@ end
|
|||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
# 课程删除
|
||||
before_filter :find_courselist, :only => [:destroy]
|
||||
|
||||
# 课程列表的删除
|
||||
def destroy
|
||||
if @courselist
|
||||
CourseList.where(:id => @courselist.id).destroy_all
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
end
|
||||
private
|
||||
# Find courselist of id params[:id]
|
||||
def find_courselist
|
||||
@courselist = CourseList.find_by_id(params[:id])
|
||||
render_404 if @courselist.nil?
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
render_404
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@ class CourseList < ActiveRecord::Base
|
|||
has_many :shixun_major_courses
|
||||
has_many :courses
|
||||
belongs_to :user
|
||||
attr_accessible :name, :user_id, :is_admin
|
||||
attr_accessible :name, :user_id, :is_admin,:support_shixuns_search
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,14 +1,23 @@
|
|||
<div class="active-class">
|
||||
<div class="task-index-head mt30 mb30 bor-grey-e">
|
||||
<div class="task-index-head-top-course">
|
||||
<h2 class="fl task-inde-head-title">在线课堂</h2>
|
||||
<div class="" style="position: relative" >
|
||||
<h2 class="fl task-inde-head-title">
|
||||
<canvas id="myCanvas" ></canvas>
|
||||
<div class="logo" border="0"></div>
|
||||
</h2>
|
||||
<h2 class="fl task-inde-head-title" style="position: absolute;left:550px;top: 25px;letter-spacing:0.8em;text-shadow: 0 1px 2px #fff;">
|
||||
在线课堂
|
||||
</h2>
|
||||
<p class="fl task-inde-head-title" style="position: absolute;left:420px;top:65px;text-shadow: #fff 0px 0px 10px;">
|
||||
One who is anxious to learn, can always learn from others.
|
||||
</p>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<ul class="task-index-head-info clearfix">
|
||||
<li><span class="color-orange font-bd" id="all_syllabuses"><%= @syllabuses_num %></span><br/><span >全部</span></li>
|
||||
<li><span class="color-orange font-bd" id="my_syllabuses"><%= @create_syllabuses_count + @join_syllabuses_count %></span><br/><span>我的课堂</span></li>
|
||||
<%= link_to "+ 新建".html_safe, new_course_path, :class => "color-light-green fr font-16" , :style => "line-height:56px"%>
|
||||
<%= link_to "+ 加入课堂".html_safe, join_private_courses_courses_path, :remote => true, :method => "post", :class => "color-light-green fr mr30 font-16" , :style => "line-height:56px" %>
|
||||
<%= link_to "+ 新建".html_safe, new_course_path, :class => "fr font-16 white-btn orange-btn mt10" %>
|
||||
<%= link_to "+ 加入课堂".html_safe, join_private_courses_courses_path, :remote => true, :method => "post", :class => "fr mr30 font-16 white-btn orange-btn mt10" %>
|
||||
<!-- <li><span class="color-orange font-bd"><%#= @create_syllabuses_count %></span><br/><span>你已创建</span></li>-->
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -37,9 +46,9 @@
|
|||
</div>
|
||||
</div>
|
||||
<%= render :partial => 'layouts/public_left_info' %>
|
||||
<style>body{background: #FFFFFF}</style><!--后续需要删除-->
|
||||
|
||||
<%= javascript_include_tag 'edu/shixun_course_path' %>
|
||||
<script>
|
||||
|
||||
$(function(){
|
||||
<% unless @is_over.blank? %>
|
||||
$.ajax({
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
<i class="fa fa-lock ml5 mt8 color-grey font-16 fl"></i>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<p class="color-grey font-12 ml15">
|
||||
<p class="color-grey font-12 mt3">
|
||||
<span class="">更新于<%= time_from_now homework.updated_at %></span>
|
||||
<span class="ml30"><%= homework.quotes %> 次引用</span>
|
||||
<span class="ml30"><%= StudentWork.where(:is_delete => 0, :work_status => [1, 2, 3], :homework_common_id => homework.homework_commons.map(&:id)).count %> 次答题</span>
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
<% end %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<div id="edu-tab-con-1">
|
||||
<div id="edu-tab-con-1" class="edu-bg-shadow">
|
||||
<div class="" style="padding:0 15px;">
|
||||
<div class="fr edu-position edu-position-hidebox">
|
||||
<a href="javascript:void(0);" class="font-16"><i class="fa fa-bars"></i></a>
|
||||
|
|
@ -162,7 +162,7 @@
|
|||
<% end %>
|
||||
<%# end %>
|
||||
</div>
|
||||
<div id="edu-tab-con-2" class="undis">
|
||||
<div id="edu-tab-con-2" class="undis edu-bg-shadow">
|
||||
<div class="edu-tab-con-box">
|
||||
<div>
|
||||
<% unless @homework.reference_answer.blank? %>
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@
|
|||
})
|
||||
</script>
|
||||
</head>
|
||||
<body onload="prettyPrint();">
|
||||
<body onload="prettyPrint();" style="height:100%">
|
||||
<div class="newContainer"> <!-- 页面全部内容 -->
|
||||
<div class="newHeader">
|
||||
<% is_current_user = User.current.logged? && User.current == @user %>
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
<td>
|
||||
<a href="script:void(0)">删除</a>
|
||||
<input type="checkbox" name="homepage_show" value="<%= course.id %>" <%= course.homepage_show ? "checked" : "" %> class="ml-3 mr5 magic-checkbox" id="join_course_role_<%= course.id %>">
|
||||
<label style="top:0px;padding-left: 25px;float:right;" for="join_course_role_<%= course.id %>">首页显示</label>
|
||||
<label style="top:0px;padding-left: 25px;float:right; margin-right: 10px" for="join_course_role_<%= course.id %>">首页显示</label>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -15,37 +15,44 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @syllabus.each_with_index do |syllabus,index| %>
|
||||
<tr>
|
||||
<% @courselist.each_with_index do |courselist, index| %>
|
||||
<tr id="courselist_show_<%= courselist.id %>">
|
||||
<td><%= index + 1 %></td>
|
||||
<!--<td><%#= syllabus.syllabus_major_level == '' ? "--" : syllabus.syllabus_major_level %></td>-->
|
||||
<!--<td class="edu-txt-left"><%#= syllabus.syllabus_discipline_category == '' ? "--" : syllabus.syllabus_discipline_category %></td>-->
|
||||
<!--<td><%#= syllabus.syllabus_first_level_discipline == "" ? "--" : syllabus.syllabus_first_level_discipline %></td>-->
|
||||
<!--<td><%#= syllabus.syllabus_major == "" ? "--" : syllabus.syllabus_major %></td>-->
|
||||
<td class="edu-txt-left">
|
||||
<%= link_to syllabus.title,syllabus_path(syllabus.id) %>
|
||||
<%= link_to courselist.name,course_path(courselist.id) %>
|
||||
</td>
|
||||
<td>
|
||||
<%= syllabus.courses.count %>
|
||||
<%= courselist.courses.count %>
|
||||
</td>
|
||||
<td>
|
||||
<%= %>
|
||||
<%= ShixunMajorCourse.where(:course_list_id => courselist.id).map(&:shixun_id).count %>
|
||||
</td>
|
||||
<td><%= link_to syllabus.user.show_real_name, user_path(syllabus.user) %></td>
|
||||
<td><%= format_time syllabus.created_at %></td>
|
||||
<td>
|
||||
<a href="script:void(0)">删除</a>
|
||||
<input type="checkbox" name="homepage_show" value="<%= syllabus.id %>" class="ml-3 mr5 magic-checkbox" id="join_course_role_<%= syllabus.id %>">
|
||||
<label style="top:0px;padding-left: 25px;float:right;" for="join_course_role_<%= syllabus.id %>">支持实训检索</label>
|
||||
<%= courselist.user.try(:show_real_name) %>
|
||||
</td>
|
||||
<td><%= format_time courselist.created_at %></td>
|
||||
<td>
|
||||
<% if courselist.courses.count != 0 || ShixunMajorCourse.where(:course_list_id => courselist.id).map(&:shixun_id).count !=0 %>
|
||||
--
|
||||
<% else %>
|
||||
<a href="javascript:void(0);" onclick="delete_confirm_box_2('<%= management_path(courselist) %>', '确定要删除吗?')" class="fl ml10">删除 </a>
|
||||
<% end %>
|
||||
<input type="checkbox" name="support_shixuns_search" value="<%= courselist.id %>" <%= courselist.support_shixuns_search ? "checked" : "" %> class="ml-3 mr5 magic-checkbox" id="join_course_role_<%= courselist.id %>">
|
||||
<label style="top:0px;padding-left: 22px;float:right;padding-right: 30px" for="join_course_role_<%= courselist.id %>">支持实训检索</label>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="cl"></div>
|
||||
<div style="text-align:center;" class="new_expand">
|
||||
<div class="pages_user_show" style="width:auto; display:inline-block;margin: 18px 0;">
|
||||
<ul id="homework_pository_ref_pages">
|
||||
<%= pagination_links_full @syllabus_pages, @syllabus_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true %>
|
||||
<%= pagination_links_full @courselist_pages, @courselist_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
|
@ -61,5 +68,14 @@
|
|||
dateType: "script"
|
||||
});
|
||||
});
|
||||
$("input[name='support_shixuns_search']").click(function(){
|
||||
var support_shixuns_search_val = $(this).val();
|
||||
$.ajax({
|
||||
url:"<%= support_shixuns_search_managements_path %>",
|
||||
data: {shixun_id: support_shixuns_search_val},
|
||||
type: 'post',
|
||||
dateType: "script"
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<% else %>
|
||||
<%= render :partial => "welcome/no_data" %>
|
||||
<%= render :partial => "welcome/management_no_data" %>
|
||||
<% end %>
|
||||
<div style="text-align:center;" class="new_expand">
|
||||
<div class="pages_user_show" style="width:auto; display:inline-block;margin: 18px 0;">
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@
|
|||
<td><%= format_time department.created_at %></td>
|
||||
<td>
|
||||
<% if UserExtensions.where(:department_id => department.id,:school_id => department.school_id ).count == 0 %>
|
||||
<a href="javascript:void(0);" onclick="delete_confirm_box_2('<%= department_path(department.department_id) %>', '确定要删除该部门吗?')">删除 </a>
|
||||
<a href="javascript:void(0);" onclick="delete_confirm_box_2('<%= department_path(department.department_id) %>', '确定要删除该部门吗?')">删除 </a>
|
||||
<% else %>
|
||||
--
|
||||
--
|
||||
<% end %>
|
||||
<%= link_to '更改', update_department_managements_path(:school_id=> department.school_id,:department_id => department.department_id), :remote => true, :class => "application-default-link" %>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -83,9 +83,8 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<% else %>
|
||||
<%= render :partial => "welcome/no_data" %>
|
||||
<%= render :partial => "welcome/management_no_data" %>
|
||||
<% end %>
|
||||
|
||||
<div style="text-align:center;" class="new_expand">
|
||||
<div class="pages_user_show" style="width:auto; display:inline-block;margin: 18px 0;">
|
||||
<ul id="homework_pository_ref_pages">
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
<th>职业</th>
|
||||
<th>单位</th>
|
||||
<th>子单位</th>
|
||||
<th>最后登录时间</th>
|
||||
<th>试用状态</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -34,6 +35,7 @@
|
|||
<td><%= user.professional_certification ? "已认证" : "未认证" %></td>
|
||||
<td ><span class="edu-txt-w140 task-hide2" title="<%= user.try(:user_extensions).try(:school).try(:name) %>"><%= user.try(:user_extensions).try(:school).try(:name).blank? ? "--" : user.try(:user_extensions).try(:school) %></span></td>
|
||||
<td ><span class="edu-txt-w140 task-hide2"><%= user.try(:user_extensions).department ? user.try(:user_extensions).try(:department).try(:name).to_s : '--' %></span></td>
|
||||
<td><%= user.last_login_on.blank? ? "--" : (format_time user.last_login_on) %></td>
|
||||
<td><%= identity_authentication_status(user) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -19,6 +19,10 @@
|
|||
<input class="fl task-form-20 task-height-30 mt20" name="search" maxlength="" placeholder="输入关键字进行搜索" type="text" style="height: 21px;" id="Look_name">
|
||||
<a href="javascript:void(0);" class="fl task-btn task-btn-blue ml5 mt20" onclick="$('#classroom').submit();">搜索</a>
|
||||
<a href="javascript:clearSearchCondition()" class="fl task-btn ml5 mt2 mt20" id="clear_contents">清除</a>
|
||||
<span class="fr shixun_webssh">
|
||||
<input type="checkbox" class="mr5 magic-checkbox" name="support_shixuns_search_title" value="1" id="join_course_role_0">
|
||||
<label style="top:2px;padding-left:23px;" for="join_course_role_0"><span class="only_view">支持实训检索</span></label>
|
||||
</span>
|
||||
<input name="sx_order" type="hidden">
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
@ -26,14 +30,18 @@
|
|||
<%= render :partial => "managements/classroom_list" %>
|
||||
</div>
|
||||
<script>
|
||||
//支持实训检索
|
||||
$("#join_course_role_0").on("click",function(){
|
||||
$('#classroom').submit();
|
||||
});
|
||||
function clearSearchCondition(){
|
||||
$("#part").val("");
|
||||
// $("#part").val("");
|
||||
$("#condition").val("u_name");
|
||||
$("#Look_name").val("");
|
||||
$("#major_level").val("");
|
||||
$("#discipline_category_id").val("");
|
||||
$("#major_id").val("0");
|
||||
$("#first_level_discipline_id").val("");
|
||||
// $("#major_level").val("");
|
||||
// $("#discipline_category_id").val("");
|
||||
// $("#major_id").val("0");
|
||||
// $("#first_level_discipline_id").val("");
|
||||
$.get('<%= classroom_managements_path() %>');
|
||||
}
|
||||
$("input[name='school']").on('input', function (e) {
|
||||
|
|
|
|||
|
|
@ -1,29 +1,35 @@
|
|||
<%= form_tag(url_for(classroom_classment_managements_path), :id => "class_publish_shixuns_search", :method => "post", :remote => true ) do %>
|
||||
<div class="edu-con-top clearfix xmt10">
|
||||
<select class="fl task-form-10 task-height-30" style="margin:0px 10px 0px 25px;" id="status" name="status">
|
||||
<select class="task-form-10 task-height-30 fl" style="margin:0px 10px 0px 25px;" id="status" name="status">
|
||||
<option value="" selected="selected">全部状态</option>
|
||||
<option value="0">正在进行(<%= @timing %>)</option>
|
||||
<option value="1">已结束(<%= @end %>)</option>
|
||||
</select>
|
||||
<li class="fl task-height-30 mb10 ml35" style="display: inline-block">
|
||||
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="school" class="task-height-40 panel-box-sizing fl" type="text" placeholder="请选择学校" style="width: 330px" />
|
||||
<li class="task-height-30 ml15 fl" style="display: inline-block;">
|
||||
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="school" class="task-height-40 panel-box-sizing fl" type="text" placeholder="请选择学校" style="width: 330px;height:32px" />
|
||||
<input nhname="tag" nh_tag_5="true" class="fl" id="school_id" name="school_id" style="display:none;" type="text"/> <!-- 单位名称的test框选中下拉列表框的id -->
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<div id="search_school_result_list" style="width: 330px;line-height: 1.5;min-height:20px; max-height: 200px; height: auto !important;display:none;background: white;overflow: scroll;border: solid 1px #cccccc; overflow-x: hidden; overflow-y: auto;">
|
||||
</div>
|
||||
|
||||
<select class="fl task-form-15 task-height-30" style="margin:0px 0px 10px 25px;width: 11%" name="keyword" id="condition_status">
|
||||
<select class="task-form-15 task-height-30 fl" style="margin:0px 0px 0px 25px;width: 11%" name="keyword" id="condition_status">
|
||||
<option value="u_name">创建者姓名搜索</option>
|
||||
<option value="cla_name">课程名称搜索</option>
|
||||
</select>
|
||||
<input class="fl task-form-20 task-height-30" name="search" maxlength="" placeholder="输入关键字进行搜索" type="text" style="height: 21px;" id="Look_name" >
|
||||
<a href="javascript:void(0);" class="fl task-btn task-btn-blue ml5" onclick="$('#class_publish_shixuns_search').submit();">搜索</a>
|
||||
<a href="javascript:clearSearchCondition();" class="fl task-btn ml5 mt2 " id="clear_contents">清除</a>
|
||||
<input class="task-form-20 task-height-30 fl" name="search" maxlength="" placeholder="输入关键字进行搜索" type="text" style="height: 21px;" id="Look_name" >
|
||||
<a href="javascript:void(0);" class=" task-btn task-btn-blue ml5 mt3 fl mb5 " onclick="$('#class_publish_shixuns_search').submit();">搜索</a>
|
||||
<a href="javascript:clearSearchCondition();" class="task-btn ml5 mt3 fl mb5" id="clear_contents" >清除</a>
|
||||
<span class="fr shixun_webssh">
|
||||
<input type="checkbox" class="mr5 magic-checkbox" name="homepage_show" value="1" id="join_course_role_0">
|
||||
<label style="top:2px;padding-left:23px;" for="join_course_role_0"><span class="only_view">只看首页显示</span></label>
|
||||
</span>
|
||||
<select class="mt10 task-form-20 task-height-30 ml25 fl" name="course_list" id="course_list">
|
||||
<option value="" selected="selected">课程名称</option>
|
||||
<% @courses.each do |courses| %>
|
||||
<option value="<%= courses.course_list_id %>"><%= CourseList.where(:id => courses.course_list_id).map(&:name).join("-") %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
<input name="sx_order" type="hidden">
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
@ -36,6 +42,7 @@
|
|||
$("#part").val("");
|
||||
$("#condition_status").val("uname")
|
||||
$("#Look_name").val("");
|
||||
$("#course_list").val("");
|
||||
$.get('<%= classroom_classment_managements_path() %>')
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
for(var i=0; i<$("#courselist_show_<%= @courselist.id %>").nextAll().length; i++){
|
||||
var index = parseInt($($("#courselist_show_<%= @courselist.id %>").nextAll()[i]).children(":first").html());
|
||||
$($("#courselist_show_<%= @courselist.id %>").nextAll()[i]).children(":first").html(index - 1);
|
||||
}
|
||||
$("#courselist_show_<%= @courselist.id %>").remove();
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
<li><span class="color-orange font-bd"><%= @current_user_had_passed %></span><br/><span>你已通过</span></li>
|
||||
<li><span class="color-orange font-bd"><%= @shixun_my_score %></span><br/><span>累计经验值</span></li>
|
||||
<%#= link_to "+ 新建".html_safe, new_shixun_path, :class => "color-light-green fr font-16" , :style => "line-height:56px" %>
|
||||
<a href="javascript:void(0);" class="color-light-green fr font-16" style="line-height:56px" onclick="shixun_new(<%= @mail %>)">+ 新建</a>
|
||||
<a href="javascript:void(0);" class="white-btn orange-btn fr font-16 mt10" onclick="shixun_new(<%= @mail %>)">+ 新建</a>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<ul class="task-index-head-info clearfix">
|
||||
<li><span class="color-orange font-bd"><%= @subjects_all_count %></span><br/><span >全部</span></li>
|
||||
<li><span class="color-orange font-bd"><%= @subject_created_count %></span><br/><span>我已创建</span></li>
|
||||
<%= link_to "+ 新建".html_safe, new_subject_path(), :class => "color-light-green fr font-16" , :style => "line-height:56px"%>
|
||||
<%= link_to "+ 新建".html_safe, new_subject_path(), :class => "white-btn orange-btn mt10 fr font-16" %>
|
||||
</ul>
|
||||
</div>
|
||||
<!--<div class="clearfix mb15 fl">-->
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@
|
|||
<p class="edu-con-top clearfix" style="height: 50px">
|
||||
<a href="<%= syllabuses_path(:type => 1, :tab => 1) %>" class="fl ml15 edu-filter-cir-grey mr5 font-12 active mt20" data-remote="true" id="syllabuses_processing">正在进行</a>
|
||||
<a href="<%= syllabuses_path(:type => 2, :tab => 1) %>" class="fl edu-filter-cir-grey mr5 font-12 mt20" data-remote="true" id="syllabuses_end">已结束</a>
|
||||
<a href="/courses/new" class="color-light-green fr font-14 mr30 mt20" >+ 新建</a>
|
||||
<a href="/courses/join_private_courses" class="color-light-green fr mr20 font-14 mt20" data-method="post" data-remote="true" rel="nofollow" >+ 加入</a>
|
||||
<a href="/courses/new" class="white-btn orange-btn fr font-14 mr30 mt10" >+ 新建</a>
|
||||
<a href="/courses/join_private_courses" class="white-btn orange-btn fr mr20 font-14 mt10" data-method="post" data-remote="true" rel="nofollow" >+ 加入</a>
|
||||
</p>
|
||||
<div id="my_syllabuses">
|
||||
<%= render :partial => "syllabuses/my_syllabuses" %>
|
||||
|
|
@ -34,8 +34,8 @@
|
|||
<p class="edu-con-top clearfix" style="height: 50px">
|
||||
<a href="<%= syllabuses_path(:type => 1, :tab => 2) %>" class="fl ml15 edu-filter-cir-grey mr5 active font-12 mt20" data-remote="true" id="syllabuses_processing">正在进行</a>
|
||||
<a href="<%= syllabuses_path(:type => 2, :tab => 2) %>" class="fl edu-filter-cir-grey mr5 font-12 mt20" data-remote="true" id="syllabuses_end">已结束</a>
|
||||
<a href="/courses/new" class="color-light-green fr font-14 mr30 mt20" >+ 新建</a>
|
||||
<a href="/courses/join_private_courses" class="color-light-green fr mr20 font-14 mt20" data-method="post" data-remote="true" rel="nofollow" >+ 加入</a>
|
||||
<a href="/courses/new" class="white-btn orange-btn fr font-14 mr30 mt10" >+ 新建</a>
|
||||
<a href="/courses/join_private_courses" class="white-btn orange-btn fr mr20 font-14 mt10" data-method="post" data-remote="true" rel="nofollow" >+ 加入</a>
|
||||
</p>
|
||||
<div class="edu-class-inner-max" style="min-height:700px;">
|
||||
<div id="join_syllabuses">
|
||||
|
|
|
|||
|
|
@ -1,33 +1,40 @@
|
|||
|
||||
|
||||
<div class="boxContainer">
|
||||
<div>
|
||||
<div class="sendText fl mr10" style="width: auto">发送到</div>
|
||||
<div class="resourcesSendTo">
|
||||
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id%>','<%= send_ids%>','<%= User.current.id %>','message');">
|
||||
<option value="1">班级</option>
|
||||
<option value="2">项目</option>
|
||||
<option value="3">组织</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>-->
|
||||
<div class="fl">
|
||||
<%= form_tag search_user_course_user_path(user),:method => 'get',
|
||||
:remote=>true,:id=>'search_user_course_form',:class=>'resourcesSearchBox' do %>
|
||||
<%= hidden_field_tag(:send_id, send_id) %>
|
||||
<%= hidden_field_tag(:send_ids, send_ids) %>
|
||||
<input type="text" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入班级ID或者名称搜索" class="searchResourcePopup" />
|
||||
<script>
|
||||
observeSearchfieldOnInput('search_course_input','<%= search_user_course_user_path(user)%>','<%= send_id %>','<%= send_ids%>','message')
|
||||
</script>
|
||||
<!--<a href="javascript:void(0);" class="searchIconPopup"></a>-->
|
||||
<%= submit_tag '',:class=>'searchIcon2',:onfocus=>"this.blur();",:style=>'border-style:none' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div id="course_message_form">
|
||||
<%= render :partial => 'users/course_message_form', :locals => {:user => user, :courses => courses, :send_id => send_id, :send_ids => send_ids} %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="task-popup" style="width:450px;">
|
||||
<div class="task-popup-title clearfix task-popup-bggrey">
|
||||
<h3 class="fl">发送资源</h3>
|
||||
<a href="javascript:void(0);" class="pop_close"><i class="fa fa-times-circle font-18 link-color-grey fr mt5"></i></a>
|
||||
</div>
|
||||
<!--<div>-->
|
||||
<!--<div class="resourcesSendTo ml40">-->
|
||||
<!--<select class="resourcesSendType" onclick="chooseSendType('<%= send_id%>','<%= send_ids%>','<%= User.current.id %>','message');">-->
|
||||
<!--<option value="1">班级</option>-->
|
||||
<!--<option value="2">项目</option>-->
|
||||
<!--<option value="3">组织</option>-->
|
||||
<!--</select>-->
|
||||
<!--</div>-->
|
||||
<!--<div class="cl"></div>-->
|
||||
<!--</div>-->
|
||||
<!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>-->
|
||||
<div class="task_popup_con">
|
||||
<div class="newupload_conbox">
|
||||
<div class="mb10 mt-10 edu-position">
|
||||
<%= form_tag search_user_course_user_path(user),:method => 'get',:remote=>true,:id=>'search_user_course_form',:class=>'resourcesSearchBox' do %>
|
||||
<%= hidden_field_tag(:send_id, send_id) %>
|
||||
<%= hidden_field_tag(:send_ids, send_ids) %>
|
||||
<input type="text" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入班级ID或者名称搜索" class="task-form-100 task-height-40 panel-box-sizing" />
|
||||
<script>
|
||||
observeSearchfieldOnInput('search_course_input','<%= search_user_course_user_path(user)%>','<%= send_id %>','<%= send_ids%>','message')
|
||||
</script>
|
||||
<!--<a href="javascript:void(0);" class="edu-btn-search font-16 color-grey mt5"><i class="fa fa-search"></i></a>-->
|
||||
|
||||
<!--<a href="javascript:void(0);" class="searchIconPopup"></a>-->
|
||||
<%= submit_tag '',:class=>'searchIcon2',:onfocus=>"this.blur();",:style=>'border-style:none' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div id="course_message_form">
|
||||
<%= render :partial => 'users/course_message_form', :locals => {:user => user, :courses => courses, :send_id => send_id, :send_ids => send_ids} %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -28,17 +28,19 @@
|
|||
pop_box_new(htmlvalue, 452, 463);
|
||||
|
||||
<% elsif params[:send_type] == 'message' %>
|
||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_course' ,:locals => {:courses => @course, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>');
|
||||
showModal('ajax-modal', '452px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
||||
$('#ajax-modal').parent().css("top","50%").css("left","50%");
|
||||
$('#ajax-modal').parent().addClass("popbox").addClass("resourceUploadPopup");
|
||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
||||
//与更新版本弹窗js冲突新增样式代码
|
||||
$('#ajax-modal').parent().css({"border":"3px solid #269ac9", "padding":"4px"});
|
||||
var val = $("#search_course_input").val();
|
||||
$("#search_course_input").val("").focus().val(val);
|
||||
var htmlvalue = "<%= escape_javascript( render :partial => 'users/share_message_to_course' ,:locals => {:courses => @course, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>";
|
||||
pop_box_new(htmlvalue, 452, 463);
|
||||
// $("#ajax-modal").html('<%#= escape_javascript( render :partial => 'users/share_message_to_course' ,:locals => {:courses => @course, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>');
|
||||
// showModal('ajax-modal', '452px');
|
||||
// $('#ajax-modal').siblings().remove();
|
||||
// $('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
||||
// $('#ajax-modal').parent().css("top","50%").css("left","50%");
|
||||
// $('#ajax-modal').parent().addClass("popbox").addClass("resourceUploadPopup");
|
||||
// $('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
||||
// //与更新版本弹窗js冲突新增样式代码
|
||||
// $('#ajax-modal').parent().css({"border":"3px solid #269ac9", "padding":"4px"});
|
||||
// var val = $("#search_course_input").val();
|
||||
// $("#search_course_input").val("").focus().val(val);
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if params[:send_type] == 'news' %>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
<div class="kong" style="text-align: center;background:#fff">
|
||||
<div class="p2 font-14 color-grey">
|
||||
<img src="../images/edu_user/edu-nodata.png" style="width: 200px"/>
|
||||
<p class="pb20 font-16">没有数据可以显示!</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -228,6 +228,7 @@ RedmineApp::Application.routes.draw do
|
|||
post 'add_department'
|
||||
get 'shixun_feedback'
|
||||
match 'update_user',:via=>[:get,:post]
|
||||
post 'support_shixuns_search'
|
||||
end
|
||||
end
|
||||
# Enable Grack support
|
||||
|
|
|
|||
|
|
@ -0,0 +1,435 @@
|
|||
/**
|
||||
* Created by Administrator on 2017/9/8.
|
||||
*/
|
||||
var Point = function(x, y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
};
|
||||
|
||||
var Circle = function(rad, centerPoint) { //圆
|
||||
this.rad = rad;
|
||||
this.centerPoint = centerPoint;
|
||||
};
|
||||
|
||||
var DelaunayDataSet = function(vertex, context) { //三角形
|
||||
this.vertex = vertex;
|
||||
this.context = context;
|
||||
|
||||
this.fillTriangleColor = "#ff0000";
|
||||
this.fillTriangleCheck = true;
|
||||
|
||||
this.strokeTriangleColor = "rgba(255, 255, 255,0)";//棱锥边的颜色
|
||||
this.strokeTriangleCheck = true;
|
||||
}
|
||||
|
||||
var TriSettings = [];
|
||||
var lights = [];
|
||||
var max_lights = 20;//小球的数量
|
||||
DelaunayDataSet.prototype.drawLight = function() {
|
||||
// alert(this.context.canvas.height)
|
||||
while (lights.length < max_lights) {
|
||||
var light = {
|
||||
x: Math.random() * this.context.canvas.width,
|
||||
y: Math.random() * this.context.canvas.height,
|
||||
angle: Math.random() * 360 * (Math.PI / 180),
|
||||
speed: Math.random() * 1
|
||||
}
|
||||
lights.push(light);
|
||||
}
|
||||
for (var i = 0; i < lights.length; i++) {
|
||||
var light = lights[i];
|
||||
light.x += Math.cos(light.angle) * light.speed;// 速度*[-1,1]
|
||||
light.y += Math.sin(light.angle) * light.speed;
|
||||
if (light.x < 0 || light.y < 0 || light.x > this.context.canvas.width || light.y > this.context.canvas.height) {
|
||||
light.x = Math.random() * this.context.canvas.width;
|
||||
light.y = Math.random() * this.context.canvas.height;
|
||||
continue;
|
||||
}
|
||||
with(this.context) {
|
||||
fillStyle = "#ffffff";//小球颜色
|
||||
beginPath();
|
||||
arc(light.x, light.y, 5, 0, 2 * Math.PI, false);//圆形的半径
|
||||
shadowColor = '#ffffff';//小球阴影色
|
||||
shadowBlur = 10;//模糊级数
|
||||
shadowOffsetX = 0;
|
||||
shadowOffsetY = 0;
|
||||
fill();
|
||||
closePath();
|
||||
|
||||
}
|
||||
}
|
||||
this.context.shadowBlur = 0;
|
||||
};
|
||||
|
||||
DelaunayDataSet.prototype.drawTriangle = function() {
|
||||
|
||||
for (var i = 0; i < this.triangleVertexNumber.length; i += 3) {
|
||||
|
||||
|
||||
if (this.triangleVertexNumber[i] !== 0 && this.triangleVertexNumber[i] !== 1 && this.triangleVertexNumber[i] !== 2 && this.triangleVertexNumber[i + 1] !== 0 && this.triangleVertexNumber[i + 1] !== 1 && this.triangleVertexNumber[i + 1] !== 2 && this.triangleVertexNumber[i + 2] !== 0 && this.triangleVertexNumber[i + 2] !== 1 && this.triangleVertexNumber[i + 2] !== 2) {
|
||||
|
||||
var ctx = this.context;
|
||||
var points = [];
|
||||
points.push({
|
||||
x: this.vertex[this.triangleVertexNumber[i]].x,
|
||||
y: this.vertex[this.triangleVertexNumber[i]].y
|
||||
});
|
||||
points.push({
|
||||
x: this.vertex[this.triangleVertexNumber[i + 1]].x,
|
||||
y: this.vertex[this.triangleVertexNumber[i + 1]].y
|
||||
});
|
||||
points.push({
|
||||
x: this.vertex[this.triangleVertexNumber[i + 2]].x,
|
||||
y: this.vertex[this.triangleVertexNumber[i + 2]].y
|
||||
});
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(points[0].x, points[0].y)//开始划线的起点
|
||||
ctx.lineTo(points[1].x, points[1].y)//三个结束点
|
||||
ctx.lineTo(points[2].x, points[2].y)
|
||||
ctx.lineTo(points[0].x, points[0].y)
|
||||
|
||||
if (this.fillTriangleCheck) {
|
||||
var settings = TriSettings[i];
|
||||
if (!settings) {
|
||||
var num = 120 + (80 / this.triangleVertexNumber.length * i) | 0;
|
||||
var sp = new Point(this.vertex[this.triangleVertexNumber[i]].x, this.vertex[this.triangleVertexNumber[i]].y);
|
||||
var ep = new Point(sp.x + 50 + Math.random() * 200, sp.y + 50 + Math.random() * 200);
|
||||
var opacity = .05 + Math.random() * .6;//背景透明度
|
||||
settings = {
|
||||
start_point: sp,
|
||||
end_point: ep,
|
||||
opacity: opacity
|
||||
}
|
||||
TriSettings[i] = settings;
|
||||
}
|
||||
|
||||
var color = '255,88,00';
|
||||
var collision = false;
|
||||
for (var l = 0; l < lights.length; l++) {
|
||||
var collision = is_in_triangle(lights[l].x, lights[l].y, points[0].x, points[0].y, points[1].x, points[1].y, points[2].x, points[2].y)
|
||||
if (collision) {
|
||||
color = '255,255,255';//背景渐变色
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
var grad = ctx.createLinearGradient(settings.start_point.x, settings.start_point.y, settings.end_point.x, settings.end_point.y);
|
||||
grad.addColorStop(0, 'rgba(255,88,00,' + settings.opacity + ')');//开始颜色到结束颜色的透明度及颜色的变化
|
||||
grad.addColorStop(1, 'rgba(' + color + ',' + settings.opacity + ')');//三角形渐变的颜色
|
||||
ctx.fillStyle = grad;
|
||||
ctx.fill();
|
||||
}
|
||||
|
||||
if (this.strokeTriangleCheck) {
|
||||
ctx.strokeStyle = this.strokeTriangleColor;
|
||||
ctx.stroke();
|
||||
}
|
||||
|
||||
ctx.closePath();
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
DelaunayDataSet.prototype.update = function() {
|
||||
|
||||
var vertexNumber = this.vertex.length;
|
||||
this.triangleVertexNumber = [0, 1, 2];
|
||||
this.circumCircles = [];
|
||||
|
||||
|
||||
var firstCircle = calculationCircle(this.vertex[0], this.vertex[1], this.vertex[2]);
|
||||
this.circumCircles.push(firstCircle);
|
||||
|
||||
for (var i = 3; i < vertexNumber; i++) {
|
||||
calTriangles(this, i);
|
||||
if (i > 3) {
|
||||
removeTriangle(this, i);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
// define the method which is very useful
|
||||
|
||||
|
||||
function distanceBetweenPoints(pt1, pt2) {
|
||||
var dx = pt2.x - pt1.x;
|
||||
var dy = pt2.y - pt1.y;
|
||||
|
||||
return Math.sqrt(dx * dx + dy * dy);
|
||||
}
|
||||
|
||||
function distanceBetweenPointAndCircle(pt, circle) {
|
||||
var dx = pt.x - circle.centerPoint.x;
|
||||
var dy = pt.y - circle.centerPoint.y;
|
||||
|
||||
return Math.sqrt(dx * dx + dy * dy);
|
||||
}
|
||||
|
||||
function judgeBetweenDistance(_pt, _circle) {
|
||||
var dis = distanceBetweenPointAndCircle(_pt, _circle);
|
||||
|
||||
var circleJudge = false;
|
||||
if (dis < _circle.rad) {
|
||||
circleJudge = true;
|
||||
}
|
||||
|
||||
return circleJudge;
|
||||
}
|
||||
|
||||
//this is the process of 3 ( separating of the triangles, add the circum circles, and deleting the extra triangle
|
||||
|
||||
|
||||
function calTriangles(_delaunayDataSet, num) {
|
||||
var newNumber = num;
|
||||
var pt = _delaunayDataSet.vertex[newNumber];
|
||||
|
||||
var tempVertexNumber = [];
|
||||
var tempCircles = [];
|
||||
var tempNumbers = [];
|
||||
|
||||
for (var i = 0; i < _delaunayDataSet.circumCircles.length; i++) {
|
||||
if (judgeBetweenDistance(pt, _delaunayDataSet.circumCircles[i])) {
|
||||
tempNumbers.push(i);
|
||||
|
||||
var selectingNum01 = _delaunayDataSet.triangleVertexNumber[3 * i];
|
||||
var selectingNum02 = _delaunayDataSet.triangleVertexNumber[3 * i + 1];
|
||||
var selectingNum03 = _delaunayDataSet.triangleVertexNumber[3 * i + 2];
|
||||
|
||||
tempVertexNumber.push(selectingNum01);
|
||||
tempVertexNumber.push(selectingNum02);
|
||||
tempVertexNumber.push(newNumber);
|
||||
|
||||
tempVertexNumber.push(selectingNum02);
|
||||
tempVertexNumber.push(selectingNum03);
|
||||
tempVertexNumber.push(newNumber);
|
||||
|
||||
tempVertexNumber.push(selectingNum03);
|
||||
tempVertexNumber.push(selectingNum01);
|
||||
tempVertexNumber.push(newNumber);
|
||||
|
||||
var ct01circle1 = calculationCircle(_delaunayDataSet.vertex[selectingNum01], _delaunayDataSet.vertex[selectingNum02], _delaunayDataSet.vertex[newNumber]);
|
||||
var ct01circle2 = calculationCircle(_delaunayDataSet.vertex[selectingNum02], _delaunayDataSet.vertex[selectingNum03], _delaunayDataSet.vertex[newNumber]);
|
||||
var ct01circle3 = calculationCircle(_delaunayDataSet.vertex[selectingNum03], _delaunayDataSet.vertex[selectingNum01], _delaunayDataSet.vertex[newNumber]);
|
||||
|
||||
tempCircles.push(ct01circle1);
|
||||
tempCircles.push(ct01circle2);
|
||||
tempCircles.push(ct01circle3);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < tempVertexNumber.length; i++) {
|
||||
_delaunayDataSet.triangleVertexNumber.push(tempVertexNumber[i]);
|
||||
}
|
||||
|
||||
for (i = 0; i < tempCircles.length; i++) {
|
||||
_delaunayDataSet.circumCircles.push(tempCircles[i]);
|
||||
}
|
||||
|
||||
for (i = 0; i < tempNumbers.length; i++) {
|
||||
var num = tempNumbers[i] - i;
|
||||
|
||||
var slicedObjectPtNumbers;
|
||||
var slicedCircles;
|
||||
|
||||
if (num == 0) {
|
||||
slicedObjectPtNumbers = _delaunayDataSet.triangleVertexNumber.slice(3);
|
||||
slicedCircles = _delaunayDataSet.circumCircles.slice(1);
|
||||
} else {
|
||||
var slicedObjectPtNumberBefore = _delaunayDataSet.triangleVertexNumber.slice(0, 3 * num);
|
||||
var slicedObjectPtNumberAfter = _delaunayDataSet.triangleVertexNumber.slice(3 * num + 3);
|
||||
slicedObjectPtNumbers = slicedObjectPtNumberBefore.concat(slicedObjectPtNumberAfter);
|
||||
|
||||
var slicedCircleBefore = _delaunayDataSet.circumCircles.slice(0, num);
|
||||
var slicedCircleAfter = _delaunayDataSet.circumCircles.slice(1 + num);
|
||||
slicedCircles = slicedCircleBefore.concat(slicedCircleAfter);
|
||||
}
|
||||
|
||||
_delaunayDataSet.triangleVertexNumber = slicedObjectPtNumbers;
|
||||
_delaunayDataSet.circumCircles = slicedCircles;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function calculationCircle(pt01, pt02, pt03) {
|
||||
|
||||
var x1 = pt01.x;
|
||||
var y1 = pt01.y;
|
||||
|
||||
var x2 = pt02.x;
|
||||
var y2 = pt02.y;
|
||||
|
||||
var x3 = pt03.x;
|
||||
var y3 = pt03.y;
|
||||
|
||||
var c = 2.0 * ((x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1));
|
||||
var tempX = ((y3 - y1) * (x2 * x2 - x1 * x1 + y2 * y2 - y1 * y1) + (y1 - y2) * (x3 * x3 - x1 * x1 + y3 * y3 - y1 * y1)) / c;
|
||||
var tempY = ((x1 - x3) * (x2 * x2 - x1 * x1 + y2 * y2 - y1 * y1) + (x2 - x1) * (x3 * x3 - x1 * x1 + y3 * y3 - y1 * y1)) / c;
|
||||
var tempPt = new Point(tempX, tempY);
|
||||
|
||||
var tempRad = Math.sqrt(Math.pow(tempX - x1, 2) + Math.pow(tempY - y1, 2));
|
||||
|
||||
return new Circle(tempRad, tempPt);
|
||||
}
|
||||
|
||||
function removeTriangle(_delaunayDataSet, tempVertexNum) {
|
||||
var circumcircleArrays = _delaunayDataSet.circumCircles;
|
||||
var ommitCircumCircleNumbers = [];
|
||||
|
||||
for (var i = 0; i < circumcircleArrays.length; i++) {
|
||||
var vertexNum01 = _delaunayDataSet.triangleVertexNumber[i * 3];
|
||||
var vertexNum02 = _delaunayDataSet.triangleVertexNumber[i * 3 + 1];
|
||||
var vertexNum03 = _delaunayDataSet.triangleVertexNumber[i * 3 + 2];
|
||||
|
||||
for (var num = 0; num < tempVertexNum; num++) {
|
||||
if (num != vertexNum01 && num != vertexNum02 && num != vertexNum03) {
|
||||
|
||||
if (judgeBetweenDistance(_delaunayDataSet.vertex[num], circumcircleArrays[i])) {
|
||||
ommitCircumCircleNumbers.push(i);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//omit
|
||||
var tempCircumCircleArray = [];
|
||||
var tempTriagneNumberArray = [];
|
||||
|
||||
for (i = 0; i < circumcircleArrays.length; i++) {
|
||||
for (var j = 0; j < ommitCircumCircleNumbers.length; j++) {
|
||||
if (ommitCircumCircleNumbers[j] == i) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (j == ommitCircumCircleNumbers.length) {
|
||||
|
||||
tempTriagneNumberArray.push(_delaunayDataSet.triangleVertexNumber[3 * i]);
|
||||
tempTriagneNumberArray.push(_delaunayDataSet.triangleVertexNumber[3 * i + 1]);
|
||||
tempTriagneNumberArray.push(_delaunayDataSet.triangleVertexNumber[3 * i + 2]);
|
||||
|
||||
tempCircumCircleArray.push(_delaunayDataSet.circumCircles[i]);
|
||||
}
|
||||
}
|
||||
|
||||
_delaunayDataSet.triangleVertexNumber = [];
|
||||
for (i = 0; i < tempTriagneNumberArray.length; i++) {
|
||||
_delaunayDataSet.triangleVertexNumber[i] = tempTriagneNumberArray[i];
|
||||
}
|
||||
|
||||
_delaunayDataSet.circumCircles = [];
|
||||
for (i = 0; i < tempCircumCircleArray.length; i++) {
|
||||
_delaunayDataSet.circumCircles[i] = tempCircumCircleArray[i];
|
||||
}
|
||||
}
|
||||
|
||||
function initTriangle(context, recWid, recHig, recTop, recLeft) {
|
||||
var vertex = [];
|
||||
|
||||
var bigRad = Math.sqrt(Math.pow(recWid, 2) + Math.pow(recHig, 2)) / 2;
|
||||
var bigCirclePos = new Point(recWid / 2 + recLeft, recHig / 2 + recTop);
|
||||
|
||||
vertex.push(new Point(bigCirclePos.x - Math.sqrt(3) * bigRad, bigCirclePos.y - bigRad));
|
||||
vertex.push(new Point(bigCirclePos.x + Math.sqrt(3) * bigRad, bigCirclePos.y - bigRad));
|
||||
vertex.push(new Point(bigCirclePos.x, bigCirclePos.y + bigRad * 2));
|
||||
|
||||
return new DelaunayDataSet(vertex, context);
|
||||
}
|
||||
|
||||
function is_in_triangle(px, py, ax, ay, bx, by, cx, cy) {
|
||||
|
||||
var v0 = [cx - ax, cy - ay];
|
||||
var v1 = [bx - ax, by - ay];
|
||||
var v2 = [px - ax, py - ay];
|
||||
|
||||
var dot00 = (v0[0] * v0[0]) + (v0[1] * v0[1]);
|
||||
var dot01 = (v0[0] * v1[0]) + (v0[1] * v1[1]);
|
||||
var dot02 = (v0[0] * v2[0]) + (v0[1] * v2[1]);
|
||||
var dot11 = (v1[0] * v1[0]) + (v1[1] * v1[1]);
|
||||
var dot12 = (v1[0] * v2[0]) + (v1[1] * v2[1]);
|
||||
|
||||
var invDenom = 1 / (dot00 * dot11 - dot01 * dot01);
|
||||
|
||||
var u = (dot11 * dot02 - dot01 * dot12) * invDenom;
|
||||
var v = (dot00 * dot12 - dot01 * dot02) * invDenom;
|
||||
|
||||
return ((u >= 0) && (v >= 0) && (u + v < 1));
|
||||
}
|
||||
|
||||
window.requestAnimFrame = (function() {
|
||||
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||
|
||||
function(callback) {
|
||||
window.setTimeout(callback, 1000 / 80);
|
||||
};
|
||||
})();
|
||||
|
||||
(function() {
|
||||
var canvas = document.getElementById("myCanvas");
|
||||
var canvasWid = 1200;
|
||||
var canvasHig = 130;
|
||||
|
||||
canvas.width = canvasWid;
|
||||
canvas.height = canvasHig;
|
||||
var context = canvas.getContext("2d");
|
||||
|
||||
var recWid = canvasWid;
|
||||
var recHig = canvasHig;
|
||||
|
||||
var recTop = 0;
|
||||
var recLeft = 0;
|
||||
|
||||
var delaneyNum = 30;
|
||||
var myDelaunayDataSet = initTriangle(context, recWid, recHig, recTop, recLeft);
|
||||
|
||||
var tempPt;
|
||||
tempPt = new Point(0, 0);
|
||||
myDelaunayDataSet.vertex.push(tempPt);
|
||||
|
||||
tempPt = new Point(canvasWid, 0);
|
||||
myDelaunayDataSet.vertex.push(tempPt);
|
||||
|
||||
tempPt = new Point(0, canvasHig);
|
||||
myDelaunayDataSet.vertex.push(tempPt);
|
||||
|
||||
tempPt = new Point(canvasWid, canvasHig);
|
||||
myDelaunayDataSet.vertex.push(tempPt);
|
||||
|
||||
for (var i = 0; i < delaneyNum - 4; i++) {
|
||||
var pt = new Point(Math.random() * recWid + recLeft, Math.random() * recHig + recTop);
|
||||
myDelaunayDataSet.vertex.push(pt);
|
||||
}
|
||||
|
||||
var mousePos = new Point(canvasWid / 2, canvasHig / 2);
|
||||
myDelaunayDataSet.vertex.push(mousePos);
|
||||
|
||||
myDelaunayDataSet.update();
|
||||
myDelaunayDataSet.drawTriangle();
|
||||
|
||||
function getMousePos(canvas, evt) {
|
||||
var rect = canvas.getBoundingClientRect();
|
||||
return new Point(evt.clientX - rect.left, evt.clientY - rect.top);
|
||||
}
|
||||
|
||||
loop();
|
||||
|
||||
function loop() {
|
||||
context.clearRect(0, 0, canvasWid, canvasHig);
|
||||
context.fillStyle='rgba(255,75,00,0.5)';
|
||||
context.fillRect(0,0,1350,130);
|
||||
// context.font="30px Arial";
|
||||
// context.fillText("在线课堂",550,75);
|
||||
// context.font="22px Arial";
|
||||
// context.fillText("One who is anxious to learn, can always learn from others.",300,140);
|
||||
myDelaunayDataSet.drawTriangle();
|
||||
myDelaunayDataSet.drawLight();
|
||||
requestAnimFrame(loop);
|
||||
}
|
||||
|
||||
})();
|
||||
|
|
@ -336,13 +336,13 @@ html>body #ajax-indicator { position: fixed; }
|
|||
.user_course_filtrate:hover .user_filtrate_span1{color: #FF7500!important;}
|
||||
.user_course_filtrate:hover .user_filtrate_span2{background: #FF7500!important;}
|
||||
/*课堂----------筛选切换(没有数字,默认白色背景)*/
|
||||
.course_filtrate{width: auto;padding:0px 10px;text-align: center;background: #fff;border-radius: 10px;margin-right: 20px;line-height: 26px;border: 1px solid #d1d1d1}
|
||||
.course_filtrate:hover{background: #FF7500; color: #ffffff;border: 0px solid white }
|
||||
.course_filtrate_bg{background: #FF7500; color: #ffffff!important;border: 0px solid white }
|
||||
.course_filtrate{width: auto;padding:0px 10px;text-align: center;background: #eeeeee;border-radius: 10px;margin-right: 20px;line-height: 26px;}
|
||||
.course_filtrate:hover{background: #FF7500; color: #ffffff; }
|
||||
.course_filtrate_bg{background: #FF7500; color: #ffffff!important; }
|
||||
/*我的课堂----------筛选切换(没有数字,默认灰色背景)*/
|
||||
.edu-filter-cir-grey{color: #666;width: auto;padding:0px 15px;text-align: center;background: #eeeeee;border-radius: 10px;margin-right: 20px;display: block; height:25px; line-height:25px;border: 1px solid #d1d1d1}
|
||||
.edu-filter-cir-grey:hover{background: #FF7500; color: #ffffff;border: 0px solid white }
|
||||
.edu-filter-cir-grey.active{background: #FF7500; color: #ffffff!important;border: 0px solid white }
|
||||
.edu-filter-cir-grey{color: #666;width: auto;padding:0px 15px;text-align: center;background: #eeeeee;border-radius: 10px;margin-right: 20px;display: block; height:25px; line-height:25px;}
|
||||
.edu-filter-cir-grey:hover{background: #FF7500; color: #ffffff;}
|
||||
.edu-filter-cir-grey.active{background: #FF7500; color: #ffffff!important;}
|
||||
|
||||
|
||||
/*最新和最热导航条的公用样式*/
|
||||
|
|
@ -448,12 +448,17 @@ input::-ms-clear{display:none;}
|
|||
.transform90{transform: rotate(90deg);}
|
||||
/*---------------------编辑器边框------------------------*/
|
||||
.kindeditor{background: #F0F0EE;height:22px;border:1px solid #CCCCCC;border-bottom: none}
|
||||
<<<<<<< HEAD
|
||||
|
||||
|
||||
/*两端对齐*/
|
||||
.justify{text-align: justify;}
|
||||
=======
|
||||
|
||||
/**/
|
||||
#edu-tab-nav .edu-position-hidebox li a{font-size: 12px}
|
||||
>>>>>>> dev_xucheng
|
||||
/*在线课堂*/
|
||||
a.white-btn.green-btn{color:#29bd8b;border:1px solid #29bd8b; }
|
||||
a.white-btn.orange-btn{color: #FF7500;border: 1px solid #FF7500}
|
||||
a.white-btn.orange-btn:hover{color: #FFFFFF;border: 1px solid #FF7500;background: #ff7500}
|
||||
.white-btn{cursor: pointer;display: inline-block;padding: 0 12px;border: none;letter-spacing: 1px;font-size: 14px;height: 30px;line-height: 30px;border-radius: 3px;}
|
||||
.courseRefer{float:left; max-height:120px;margin-bottom:10px;overflow:auto; overflow-x:hidden;}
|
||||
.logo {width: 295px;height: 30px;border-style:none;position: absolute;top:50%;left:39%;}
|
||||
Loading…
Reference in New Issue