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.

316 lines
14 KiB
HTML

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!--#layout("/common/layout.html",{"jsBase":"/js/jlw/teacherOpenCourseHandsOn/"}){ -->
<div class="layui-row layui-col-space15 layui-form">
<div class="layui-col-md3">
<div class="layui-panel">
<div style="padding: 15px;">
<div class="layui-form" id="studentForm">
<div class="layui-inline">
<label class="layui-form-label">选择班级:</label>
<layui:simpleDictSelect style='layui-input-block' type="school_class.class_name.class_status=1"
id="classId" name="classId"/>
</div>
<div class="layui-inline" style="padding-top: 10px">
<input type="text" id="studentOrName" placeholder="请输入学号或姓名" name="studentOrName"
class="layui-input">
</div>
<div class="layui-inline" style="padding-top: 10px">
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" id="studentFormSearch"><i
class="layui-icon layui-icon-search"></i>搜索
</button>
</div>
</div>
<table id="studentTable" lay-filter="studentTable"></table>
</div>
</div>
</div>
<div class="layui-col-md9">
<div class="layui-inline">
<layui:searchForm formId="searchForm" searchList="" condition="${search}">
<div class="layui-inline">
<label class="layui-form-label">项目名称</label>
<div class="layui-input-inline" id="view"></div>
</div>
</layui:searchForm>
</div>
<div class="layui-inline layui-form-item" style="margin-top:-5px;">
<layui:accessButton function="teacherOpenCourseQuestionLog.query" action="exportDocument"><span
class="iconfont">&#xe8c7;</span>导出</layui:accessButton>
</div>
<div class="layui-inline" style="float: right">
<layui:accessButton function="teacherOpenCourseQuestionLog.query" class="layui-btn-primary"
action="addButton_cancel"><span class="iconfont">&#xe600;</span>返回</layui:accessButton>
</div>
<table id="studentHandsOnTaskVideoTable"
lay-filter="studentHandsOnTaskVideoTable"></table>
</div>
</div>
<input type="hidden" name="teacherOpenCourseId" autocomplete="off" class="layui-input" value="${teacherOpenCourseId}"/>
<input type="hidden" name="handsOnId" autocomplete="off" class="layui-input" value="${handsOnId}"/>
<!--#} -->
<script id="demo" type="text/html">
<select name="handsOnId" lay-verify="">
<option value="">请选择</option>
{{# layui.each(d, function(index, item){ }}
<option value="{{item.handsOnId}}" {{item.handsOnId == ${handsOnId}?'selected':''}}>{{item.handsOnName}}
</option>
{{# }); }}
</select>
</script>
<script>
layui.use(['form','laydate','table','laytpl'], function(){
var form = layui.form;
var laydate = layui.laydate;
var table = layui.table;
var laytpl = layui.laytpl;
var studentHandsOnTaskVideoTable = null;
var studentTable = null;
var handsOnId = $("input[name='handsOnId']").val();
var teacherOpenCourseId=$("input[name='teacherOpenCourseId']").val();
var data = [];
var url = "/jlw/teacherOpenCourseHandsOn/getHandsOnList.do?teacherOpenCourseId=" + teacherOpenCourseId;
var ret = Common.getAjax(url);
if (ret.code == 0) {
data = ret.data;
}
var getTpl = demo.innerHTML
, view = document.getElementById('view');
laytpl(getTpl).render(data, function(html){
view.innerHTML = html;
});
var view ={
init:function(){
var that = this;
this.initTable();
this.initSearchForm();
this.initToolBar();
window.dataReload = function(){
Lib.doSearchForm($("#searchForm"), studentHandsOnTaskVideoTable);
Lib.doSearchForm($("#searchForm"), studentTable);
that.initToolBar();
}
},
initTable:function(){
var sx_ = localStorage.getItem("studentHandsOnTaskVideoTable_field_" + Common.userInfoId); //筛选值显示、隐藏缓存
if($.isEmpty(sx_)){sx_ = {};}else {sx_ = JSON.parse(sx_);}
studentHandsOnTaskVideoTable = table.render({
elem: '#studentHandsOnTaskVideoTable',
height : Lib.getTableHeight(1),
cellMinWidth: 100,
method : 'post',
url: Common.ctxPath + '/api/studentHandsOnTaskReport/getPageList.do' // 数据接口
,page : Lib.tablePage // 开启分页
/* ,toolbar: '#toolbar_teacherOpenCourseQuestionLog' //自定义头部左侧工具栏
,defaultToolbar: ['filter', 'print', 'exports'] //头部右侧工具栏*/
,where:{'teacherOpenCourseId':teacherOpenCourseId, 'handsOnId':handsOnId}
,limit : 10,
cols : [ [ // 表头
{
field: 'studentSn',
title: '学号',
align: "center",
hideField: false,
},
{
field: 'studentName', //数据字典类型为 student.student_name.student_status=1
title: '姓名',
align: "center",
hideField: false,
},
{
field: 'reportFileMap.fileName', //数据字典类型为 school_class.class_name.class_status=1
title: '报告名称',
align: "center",
},
{
field: 'reportFile',
title: '下载',
align: "center",
templet:function (d) {
var htm = '<a class="layui-table-link" lay-event="download">下载</a>';
}
},
{
field: 'reportComment', //数据字典类型为 teacher_open_course.teacher_open_course_title.teacher_open_course_status=1
title: '教师评语',
align: "center"
},{
field: 'reportScore', //数据字典类型为 teacher_open_course.teacher_open_course_title.teacher_open_course_status=1
title: '报告得分',
align: "center"
}
] ]
});
studentTable = table.render({
elem: '#studentTable',
height: Lib.getTableHeight(),
cellMinWidth: 80,
method: 'get',
even: true,
// skin:'nob',
where:getParam_s(),
size: "sm",
url: Common.ctxPath + '/api/teacherOpenCourseHandsOnSimulationTasks/getStudentScore.do' // 数据接口
,parseData: function(res){ //res 即为原始返回的数据
return {
"code": 0, //解析接口状态
"msg": '', //解析提示文本
"count": res.totalRow, //解析数据长度
"data": res.list //解析数据列表
};
}
, page: Lib.tablePage // 开启分页
, limit: 10,
cols: [[
{
field: 'studentSn',
title: '学号', align: "center",
},
{
field: 'studentName',
title: '姓名', align: "center"
}, {
field: 'sumStudentScore',
title: '得分', align: "center",
templet:function (d) {
return '0'
}
}
]]
});
table.on('checkbox(studentHandsOnTaskVideoTable)', function (obj) {
var teacherOpenCourseQuestionLog = obj.data;
if(obj.checked){
//按钮逻辑Lib.buttonEnable()
}else{
}
});
//触发行单击事件
table.on('row(studentTable)', function(obj){
var data = obj.data;
$(".layui-table-body tr ").attr({"style": "color:#666"});//其他tr恢复原样
// console.log(obj.tr) //得到当前点击的tr
$(obj.tr).attr({"style": "color:#5FB878"});//改变当前tr颜色
var handsOnIdNew = $("select[name='handsOnId']").val();
var param={
'studentId':obj.data.studentId,
'teacherOpenCourseId':teacherOpenCourseId,
'handsOnId':$.isEmpty(handsOnIdNew)?handsOnId:handsOnIdNew
};
studentHandsOnTaskVideoTable.reload({
where: param,
page: {
curr: 1
}
});
});
},
initSearchForm:function(){
//Lib.initSearchForm( $("#searchForm"),studentHandsOnTaskVideoTable,form);
//Lib.initSearchForm( $("#studentForm"),studentTable,form);
var btn_s = $("#searchFormSearch");
btn_s.on('click', function () {
var data = $("#searchForm").serializeJson();
var handsOnIdNew = $("select[name='handsOnId']").val();
data.handsOnId = $.isEmpty(handsOnIdNew)?handsOnId:handsOnIdNew;
data.teacherOpenCourseId=teacherOpenCourseId;
studentHandsOnTaskVideoTable.reload({
where: data,
page: {
curr: 1
}
});
});
var btn = $("#studentFormSearch");
btn.on('click', function () {
studentTable.reload({
where: getParam_s(),
page: {
curr: 1
}
});
});
},
initToolBar:function(){
toolbar = {
exportDocument: function () {
var handsOnIdNew = $("select[name='handsOnId']").val();
handsOnIdNew = $.isEmpty(handsOnIdNew)?handsOnId:handsOnIdNew;
var url = '/jlw/studentHandsOnTaskReport/excel/export.do?teacherOpenCourseId='+teacherOpenCourseId+'&handsOnId='+handsOnIdNew;
Common.openConfirm("确认要导出课程实操存档详情?", function (index) {
$.downFile(Common.ctxPath + url,'课程实操存档详情');
layer.close(index);
})
},
addButton_cancel:function () {
parent.Lib.tableRefresh();
Lib.closeFrame();
},
};
//触发事件
$('.ext-toolbar').on('click', function() {
var type = $(this).data('type');
toolbar[type] ? toolbar[type].call(this) : '';
});
}, initTableTool: table.on('tool(studentHandsOnTaskVideoTable)', function (obj) {
var data = obj.data;
if (obj.event === 'edit') {
//var url = "/jlw/teacherOpenCourseQuestionLog/add.do?teacherOpenCourseQuestionLogId="+data.teacherOpenCourseQuestionLogId;
Common.openDlg(url, "学生签到记录管理>" + data.teacherOpenCourseQuestionLogId + ">编辑");
}else if(obj.event === "del"){
layer.confirm('是否确定删除该信息?', function (index) {
// var ret = Common.postAjax("/jlw/teacherOpenCourseQuestionLog/delete.json",{ids:data.teacherOpenCourseQuestionLogId});
layer.msg(ret.code == 0?"删除成功!":ret.msg, {
offset: ['50%'],
icon: ret.code == 0?1:2,
time: 1500 //2秒关闭如果不配置默认是3秒
},function (){
if(ret.code == 0){
Lib.tableRefresh();
}
});
});
}else if(obj.event === 'download'){
layer.confirm('是否确定删除该信息?', function (index) {
Lib.downloadFile2(data.reportFile,"报告表")
});
}
})
};
function getParam_s(){
var param = {
"classId":$("#studentForm select[name='classId']").val(),
"studentName":$("#studentForm input[name='studentOrName']").val(),
'teacherOpenCourseId': teacherOpenCourseId,
"handsOnId": handsOnId
};
return param
}
form.render();
view.init();
});
</script>