教务 - 新增和校长一样的直通车功能,查看全校老师
年级组长 - 直通车到本年级所有班主任和任课老师
学科备课组长 - 直通车到本学科的所有老师角色
具体需求如下:
教务 - 新增和校长一样的直通车功能,查看全校老师
年级组长 - 直通车到本年级所有班主任和任课老师
学科备课组长 - 直通车到本学科的所有老师角色
对上图角色开通校内直通测功能
代码
if(ztc != undefined && ztc != null){
//显示直通车按钮
$('.menu_xnztc').css('display', 'block');
//隐藏角色切换
$("a.dropdown-toggle.account_change").css('display', 'none');
//隐藏我的设置菜单
var menu = $('.menu_xnztc').attr("rel");
$("."+menu).show().hide();
}else if(zxCookie.getCookieActInfoValue('postId') == 20 &&
zxCookie.getCookieActInfoValue( 'tchGid') != undefined &&
zxCookie.getCookieActInfoValue( 'tchGid') != null ){
//显示直通车
$('.menu_xnztc').css('display', 'block');
//如果隐藏了 就置为显示
var menu = $('.menu_xnztc').attr("rel");
$("."+menu).hide().show();
}else if(zxCookie.getCookieActInfoValue('postId') == 17 &&
zxCookie.getCookieActInfoValue( 'tchGid') != undefined &&
zxCookie.getCookieActInfoValue( 'tchGid') != null ){
//显示直通车
$('.menu_xnztc').css('display', 'block');
//如果隐藏了 就置为显示
var menu = $('.menu_xnztc').attr("rel");
$("."+menu).hide().show();
}else if(zxCookie.getCookieActInfoValue('postId') == 15 &&
zxCookie.getCookieActInfoValue( 'tchGid') != undefined &&
zxCookie.getCookieActInfoValue( 'tchGid') != null ){
//显示直通车
$('.menu_xnztc').css('display', 'block');
//如果隐藏了 就置为显示
var menu = $('.menu_xnztc').attr("rel");
$("."+menu).hide().show();
}else if(zxCookie.getCookieActInfoValue('postId') == 14 &&
zxCookie.getCookieActInfoValue( 'tchGid') != undefined &&
zxCookie.getCookieActInfoValue( 'tchGid') != null ){
//显示直通车
$('.menu_xnztc').css('display', 'block');
//如果隐藏了 就置为显示
var menu = $('.menu_xnztc').attr("rel");
$("."+menu).hide().show();
}
else{
$('.menu_xnztc').css('display', 'none');
}
年级组长 - 直通车到本年级所有班主任和任课老师
<div class="xkFilter">
<div style="margin-left: 0px; line-height: 40px;" class="">
<ul class="xkList">
<li class="xk_all nxkids_-2 active" xkid = '0' postid='7'>
<!-- <a href="javascript:;"> -->
<span class="xk-icon guanli">
<i class="icon-user-md"></i>
</span>
<div class="xk-name">教务</div>
<!-- </a> -->
</li>
<li class="xk_all nxkids_-2 " xkid = '0' postid='4'>
<!-- <a href="javascript:;"> -->
<span class="xk-icon guanli">
<i class="icon-group"></i>
</span>
<div class="xk-name">年级组长</div>
<!-- </a> -->
</li>
<li class="xk_all nxkids_-1 " xkid = '0' postid='5'>
<a href="javascript:;">
<span class="xk-icon guanli">
<i class="icon-user"></i>
</span>
<div class="xk-name">学科组长</div>
</a>
</li>
<li class="xk_all nxkids_0 " xkid = '0' postid='3'>
<a href="javascript:;">
<span class="xk-icon guanli">
<i class="icon-male"></i>
</span>
<div class="xk-name">班主任</div>
</a>
</li>
<li class="xk_all nxkids_1" xkid = '1' postid='2'>
<a href="javascript:;">
<span class="xk-icon wen">
<i class="xkfont icon-wen"></i>
</span>
<div class="xk-name">语文</div>
</a>
</li>
<li class="xk_all nxkids_2" xkid = '2' postid='2'>
<a href="javascript:;">
<span class="xk-icon math">
<i class="xkfont icon-math"></i>
</span>
<div class="xk-name">数学</div>
</a>
</li>
<li class="xk_all nxkids_3" xkid = '3' postid='2'>
<a href="javascript:;">
<span class="xk-icon yingyu">
<i class="xkfont icon-yingyu"></i>
</span>
<div class="xk-name">英语</div>
</a>
</li>
<li class="xk_lk nxkids_4" xkid = '4' postid='2'>
<a href="javascript:;">
<span class="xk-icon wuli">
<i class="xkfont icon-wuli"></i>
</span>
<div class="xk-name">物理</div>
</a>
</li>
<li class="xk_lk nxkids_5" xkid = '5' postid='2'>
<a href="javascript:;">
<span class="xk-icon huaxue">
<i class="xkfont icon-huaxue"></i>
</span>
<div class="xk-name">化学</div>
</a>
</li>
<li class="xk_lk nxkids_9" xkid = '9' postid='2'>
<a href="javascript:;">
<span class="xk-icon shengwu">
<i class="xkfont icon-shengwu"></i>
</span>
<div class="xk-name">生物</div>
</a>
</li>
<li class="xk_wk nxkids_6" xkid = '6' postid='2'>
<a href="javascript:;">
<span class="xk-icon lishi">
<i class="xkfont icon-lishi"></i>
</span>
<div class="xk-name">历史</div>
</a>
</li>
<li class="xk_wk nxkids_7" xkid = '7' postid='2'>
<a href="javascript:;">
<span class="xk-icon dili">
<i class="xkfont icon-dili"></i>
</span>
<div class="xk-name">地理</div>
</a>
</li>
<li class="xk_wk nxkids_8" xkid = '8' postid='2'>
<a href="javascript:;">
<span class="xk-icon zhengzhi">
<i class="xkfont icon-zhengzhi"></i>
</span>
<div class="xk-name">政治</div>
</a>
</li>
</ul>
</div>
<div class="portal_nav_right" style="margin-top: 0px;">
<input id="searchValue" type="text" class="form-control input-medium input-sm" name="query" placeholder="搜索教师...">
</div>
</div>
<script id="studentScore_template" type="text/template">
<%if(Custom.getGradeName2gradeId(grade) != false){%>
<div class="col-md-12 student-cards cards-tch njzz_<%=grade%>">
<div class="student-card-classes"><%=Custom.getGradeName2gradeId(grade)%></div>
<%}else{%>
<div class="col-md-12 student-cards cards-jw">
<%}%>
<ul class="<%=grade%>">
<%
var data = _.sortBy(data, function(one){
return one.classId * 1;
});
var currtGid = zxCookie.getCookieActInfoValue( 'tchGid');
if(zxCookie.getCookieValue("orgUser") != undefined && zxCookie.getCookieValue("orgUser") != null){
var orgUser = zxCookie.getCookieValue("orgUser");
currtGid = zxCookie.getCookieValue("orgUser").mainTchGid;
}
%>
<%_.each( data, function(oneData){ %>
<%
if(oneData.tchGid != undefined && oneData.tchGid != null && oneData.tchGid != "" && oneData.tchGid != currtGid){%>
<li>
<div class="student-card" >
<div class="student-card-logo" tchRoleEn="<%=oneData.tchRoleEn%>" tGid="<%=oneData.tchGid %>"tId="<%=oneData._id %>" sId="<%=oneData.schId %>">
<%=oneData.sex==1?'<img src="assets/img/conn.png">':'<img src="assets/img/conn.png">'%>
</div>
<div class="student-card-name"><%=oneData.tchName%></div>
<div class="student-card-des">
<% if(oneData.postId == 3){%>
<div>班主任</div>
<div>班级:<%= oneData.className%></div>
<div style="display:none;">
<i class="_xkId" tchName="<%=oneData.tchName%>" xkId=0 postid=<%=oneData.postId%>></i>
</div>
<%}else if(oneData.postId == 2){%>
<div>任课教师</div>
<div>教学班级:<%= oneData.className%></div>
<div style="display:none;">
<i class="icon-file _xkId" tchName="<%=oneData.tchName%>" xkId=<%=oneData.xkId%> postid=<%=oneData.postId%> ></i>学科 :<%=oneData.xkName%>
</div>
<%}else if(oneData.postId == 4){%>
<div>年级组长</div>
<div>年级:<%= Custom.getGradeName2gradeId(oneData.gradeId)%></div>
<div style="display:none;">
<i class="icon-file _xkId" tchName="<%=oneData.tchName%>" xkId=0 postid=<%=oneData.postId%> ></i>
</div>
<%}else if(oneData.postId == 5){%>
<div>备课组长</div>
<div>年级:<%= Custom.getGradeName2gradeId(oneData.gradeId)%></div>
<div style="display:none;">
<i class="icon-file _xkId" tchName="<%=oneData.tchName%>" xkId=0 postid=<%=oneData.postId%> ></i>
</div>
<%}else if(oneData.postId == 6){%>
<div>教研组长组长</div>
<div style="display:none;">
<i class="icon-file _xkId" tchName="<%=oneData.tchName%>" xkId=0 postid=<%=oneData.postId%> ></i>
</div>
<%}else if(oneData.postId == 7){%>
<div>教务</div>
<div style="display:none;">
<i class="icon-file _xkId" tchName="<%=oneData.tchName%>" xkId=0 postid=<%=oneData.postId%> ></i>
</div>
<%}else{%>
<div>校长</div>
<div style="display:none;">
<i class="icon-file _xkId" tchName="<%=oneData.tchName%>" xkId=0 postid=<%=oneData.postId%> ></i>
</div>
<%}%>
</div>
</div>
</li>
<%}%>
<% }) %>
</ul>
</div>
</script>
if(roleId == 14){
$(".nxkids_-2").hide();
$(".nxkids_-1").hide();
$(".nxkids_-2").removeClass("active");
$(".nxkids_0").addClass("active");
if(gradeId == 8){
$(".nxkids_5").hide();
}else if(gradeId == 7){
$(".nxkids_4").hide();
$(".nxkids_5").hide();
}
}
var checkTeacherByXkId = function(){
$(".xkFilter ul li").unbind('click');
$(".xkFilter ul li").click( function search(){
$(".xkFilter ul li").removeClass("active");
$(this).addClass("active");
var _xkId = $(this).attr("xkid");
var _postId = $(this).attr("postid");
//console.log(_postId);
var searchValue = $("#searchValue").val();
$(".studentScoreData li").each(function(index){
var xkId = $(this).find("._xkId").attr("xkId");
var postId = $(this).find("._xkId").attr("postid");
if(postId >= 3){
if( $.trim( searchValue.length) > 0){
postId = $(this).find("._xkId[tchname*="+searchValue+"]").attr("postid");
}
if (_postId == postId) {
$(this).hide().show();
}else{
$(this).show().hide();
}
if (_postId == 7) {
$(".cards-jw").hide().show();
$(".cards-tch").show().hide();
}else if(roleId == 14){
$(".cards-jw").hide();
$(".njzz_7").hide();
$(".njzz_8").hide();
$(".njzz_9").hide();
$(".njzz_"+gradeId).show();
}else{
$(".cards-jw").show().hide();
$(".cards-tch").hide().show();
}
}else{
if( $.trim( searchValue.length) > 0){
xkId = $(this).find("._xkId[tchname*="+searchValue+"]").attr("xkId");
}
if (_xkId == xkId) {
$(this).hide().show();
}else{
$(this).show().hide();
}
}
});
})
searchTeacher();
}
学科备课组长 - 直通车到本学科的所有老师角色
var gra = account.get("uriParam");
var gradeId = gra.gradeId;
var roleId = zxCookie.getCookieActInfoValue('postId');
var xk = account.get("userXK");
if(roleId == 15){
$(".nxkids_-2").hide();
$(".nxkids_-1").hide();
$(".nxkids_0").hide();
$(".nxkids_1").hide();
$(".nxkids_2").hide();
$(".nxkids_3").hide();
$(".nxkids_4").hide();
$(".nxkids_5").hide();
$(".nxkids_6").hide();
$(".nxkids_7").hide();
$(".nxkids_8").hide();
$(".nxkids_9").hide();
$(".nxkids_"+xk).show();
$(".nxkids_-2").removeClass("active");
$(".nxkids_"+xk).addClass("active");
}