You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
105 lines
3.3 KiB
JavaScript
105 lines
3.3 KiB
JavaScript
//**********************************
|
|
//教师端-----学生成绩管理
|
|
//**********************************
|
|
$(function () {
|
|
var classid = 0;
|
|
var searchVal = "";
|
|
//加载班级
|
|
SetSelectList("SelectClass");
|
|
//加载页面
|
|
LoadScoreMangerList();
|
|
// 选择列表班级赛选
|
|
//$("#SelectClass").unbind("change").bind("change", function () {
|
|
// classid = $(this).val();
|
|
// SetPageList(classid);
|
|
//});
|
|
$("#ScoreKeyWord").unbind("focus").focus(function () {
|
|
$("#ScoreKeyWord").val("").css("color", "black");
|
|
})
|
|
|
|
|
|
|
|
$("#btnSearch").unbind("click").bind("click", function () {
|
|
classid = $("#SelectClass").val();
|
|
searchVal = $("#ScoreKeyWord").val().replace(/[<>&"]/g, function (c) { return { '<': '<', '>': '>', '&': '&', '"': '"', '"': '"', "'": '′', "'": '′' }[c]; });
|
|
if (searchVal == "学号/姓名")
|
|
{ searchVal = "";}
|
|
SetPageList(classid, searchVal);
|
|
});
|
|
})
|
|
|
|
//初次加载
|
|
function LoadScoreMangerList() {
|
|
SetPageList();
|
|
};
|
|
//搜索加载
|
|
function SearchLoadPage() {
|
|
var ScoreKeyWord = $("#ScoreKeyWord").val();
|
|
var KeyWord = null;
|
|
if (ScoreKeyWord != null && ScoreKeyWord != "" && ScoreKeyWord.length > 0) {
|
|
KeyWord = ScoreKeyWord
|
|
}
|
|
SetPageList(0, KeyWord);
|
|
}
|
|
//加载班级下拉列表
|
|
function SetSelectList(SelectId) {
|
|
selectHelper.GetSelect({
|
|
url: "/Teacher/ScoreManager/LoadSelectList",
|
|
Id: "#" + SelectId,
|
|
value: "全部",
|
|
data: {}
|
|
})
|
|
}
|
|
|
|
|
|
//设置列表
|
|
function SetPageList(ClassId, keyWord) {
|
|
if (typeof ClassId =="undefined") {
|
|
ClassId = 0;
|
|
};
|
|
if (typeof keyWord == "undefined") {
|
|
keyWord = "";
|
|
};
|
|
$("#ScoreTab tbody").html("");
|
|
pageHelper.Init({
|
|
url: "/Teacher/ScoreManager/LoadStudentList",
|
|
type: "POST",
|
|
pageDiv: "#Pages",
|
|
data: {
|
|
ClassId: ClassId,
|
|
keyWord: keyWord,
|
|
rId: Math.random()
|
|
},
|
|
bind: function (data) {
|
|
var bodyhtml = "";
|
|
if (data.Data != null) {
|
|
//先加载下拉列表
|
|
$(data.Data).each(function (index, dom) {
|
|
var html = "";
|
|
html += "<tr>";
|
|
html += "<td><div title=\"{0}\" class=\"ellipsis\">{0}</div></td>";
|
|
html += "<td><div title=\"{1}\" class=\"ellipsis\">{1}</div></td>";
|
|
html += "<td><div title=\"{2}\" class=\"ellipsis\">{2}</div></td>";
|
|
html += "<td class=\"operate\" >"
|
|
html += "<a class=\"edit\" title=\"查看\" href=\"javascript:ViewShow({3})\">查看</a>"
|
|
html += "</td>";
|
|
html += "</tr>"
|
|
|
|
bodyhtml += StringHelper.FormatStr(html,
|
|
dom.SchoolNumber, // 0学号
|
|
dom.UserName, //1姓名
|
|
dom.ClassName, //2班级名称
|
|
dom.Id
|
|
)
|
|
});
|
|
}
|
|
|
|
$("#ScoreTab tbody").html(bodyhtml);
|
|
}
|
|
});
|
|
};
|
|
|
|
//展示试图
|
|
function ViewShow(userid) {
|
|
window.location.href = "/Teacher/ScoreManager/ScoreDetail?userId=" + userid;
|
|
} |