Merge remote-tracking branch 'origin/beetlsql3-dev' into beetlsql3-dev

beetlsql3-dev
Mlxa0324
commit fd123185a2

@ -383,7 +383,7 @@ var Common = {
ajaxInit: function() {
var _role_tag = getHeadTag();
var key = getCookie(_role_tag);
// $.ajaxSetup({headers: { token: getCookie(key) , _role_tag}})
return {token: getCookie(key) , _role_tag};
},
/**
* cookie获取
@ -401,10 +401,10 @@ var Common = {
return va;
},
post: function (url, paras, next) {
this.ajaxInit()
$.ajax({
url: Common.ctxPath + url,
type: "POST",
headers: this.ajaxInit(),
data: paras,
success: function (rsp) {
if (rsp.code != 0) {
@ -429,10 +429,10 @@ var Common = {
},
postJSON: function (url, paras, next) {
var r = "";
this.ajaxInit()
$.ajax({
url: Common.ctxPath + url,
type: "POST",
headers: this.ajaxInit(),
contentType:'application/json;charset=utf-8',
dataType:'json',
data: paras,
@ -462,11 +462,11 @@ var Common = {
},
postAjax: function (url, paras) {
var r = "";
this.ajaxInit()
$.ajax({
url: Common.ctxPath + url,
async: false,
type: "POST",
headers: this.ajaxInit(),
data: paras,
dataType: "json",
success: function (rsp) {
@ -482,12 +482,13 @@ var Common = {
},
getAjax: function (url, paras) {
var r = "";
this.ajaxInit()
$.ajax({
url: Common.ctxPath + url,
async: false,
type: "GET",
data: paras,
headers: this.ajaxInit(),
dataType: "json",
success: function (rsp) {
r = rsp;

@ -931,8 +931,7 @@ public class IndexController {
log.error("教师用户信息:"+ JSONUtil.toJsonStr(teacher));
log.error("学生用户信息:"+ JSONUtil.toJsonStr(student));
String roleTagCopy = StringUtils.isNotBlank(roleTag) ? ( "?_role_tag=" + roleTag ) : getLastRoleTag();
String roleTagCopy = StringUtils.isNotBlank(roleTag) ? ( "?_role_tag=" + roleTag ) : "";//getLastRoleTag()
try {
//判断是老师还是学生

@ -1,8 +1,10 @@
package com.ibeetl.jlw.web;
import cn.hutool.core.collection.ListUtil;
import cn.jlw.Interceptor.SCoreUser;
import cn.jlw.util.ToolUtils;
import cn.jlw.validate.ValidateConfig;
import com.alibaba.fastjson.JSON;
import com.ibeetl.admin.core.annotation.Function;
import com.ibeetl.admin.core.entity.CoreUser;
import com.ibeetl.admin.core.file.FileService;
@ -99,9 +101,10 @@ public class TeacherOpenCourseHandsOnController{
@GetMapping(MODEL + "/index.do")
@Function("teacherOpenCourseHandsOn.query")
public ModelAndView index() {
public ModelAndView index(Long teacherOpenCourseId) {
ModelAndView view = new ModelAndView("/jlw/teacherOpenCourseHandsOn/index.html") ;
view.addObject("search", TeacherOpenCourseHandsOnQuery.class.getName());
view.addObject("teacherOpenCourseId", teacherOpenCourseId);
return view;
}
@ -239,6 +242,128 @@ public class TeacherOpenCourseHandsOnController{
}
//
/**
*
* @param teacherOpenCourseId ID
* @param classId ID
* @param coreUser
* @return
*/
@GetMapping(MODEL + "/getHandsOnList/export.json")
public JsonResult<PageQuery> getHandsOnListExport(GetHandsOnListParam param,
HttpServletRequest request,
HttpServletResponse response,
@SCoreUser CoreUser coreUser) {
if(null == coreUser){
return JsonResult.failMessage("请登录后再操作");
}else{
PageQuery list = teacherOpenCourseHandsOnService.getHandsOnList(param);
HSSFWorkbook workbook = null;
try {
//表头数据
String[] header = {
"项目名称",
"观看视频平均得分",
"观看PPT平均得分",
"理论测评平均得分",
"实训操作步骤平均得分",
"报告撰写平均得分"
};
String[] headerCode = {
"handsOnName",
"videoAvgScore",
"pptAvgScore",
"theoryAvgScore",
"stepAvgScore",
"reportAvgScore"
};
//数据内容
List<TeacherOpenCourseHandsOnList> hands = list.getList();
//内容宽度
List<Map> mapList = JSON.parseArray(JSON.toJSONString(hands), Map.class);
Map<String, Object> widthMap = mapList.get(0);
//声明一个工作簿
workbook = new HSSFWorkbook();
//生成一个表格,设置表格名称为"Sheet1"
HSSFSheet sheet = workbook.createSheet("Sheet1");
//冻结表头
sheet.createFreezePane(0, 1, 0, 1);
//设置默认列宽度为5个字节
sheet.setDefaultColumnWidth(5);
//创建第一行表头
HSSFRow headRow = sheet.createRow(0);
//头部样式
HSSFCellStyle headerStyle = workbook.createCellStyle();
//垂直居中
headerStyle.setVerticalAlignment(VerticalAlignment.CENTER);
//水平居中
headerStyle.setAlignment(HorizontalAlignment.CENTER);
//单元格样式
HSSFCellStyle cellStyle = workbook.createCellStyle();
//垂直居中
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
//水平居左
cellStyle.setAlignment(HorizontalAlignment.CENTER);
//自动换行
cellStyle.setWrapText(true);
//遍历添加表头
for (int i = 0; i < header.length; i++) {
//设置表格特定的列宽度
if (null != widthMap.get(headerCode[i])) {
String width = widthMap.get(headerCode[i]).toString().split("\\.")[0];
int w = Math.max(width.length(), header[i].length() * 3);
sheet.setColumnWidth(i, w * 190);
}
//创建一个单元格
HSSFCell cell = headRow.createCell(i);
//创建一个内容对象
HSSFRichTextString text = new HSSFRichTextString(header[i]);
//将内容对象的文字内容写入到单元格中
cell.setCellValue(text);
//设置样式
cell.setCellStyle(headerStyle);
}
//遍历结果集,把内容加入表格
for (int i = 0; i < mapList.size(); i++) {
HSSFRow row = sheet.createRow(i + 1);
row.setHeight((short) (50*10));
Map<String, Object> map = mapList.get(i);
for (int j = 0; j < headerCode.length; j++) {
HSSFCell cell = row.createCell(j);
cell.setCellStyle(cellStyle);
HSSFRichTextString text = new HSSFRichTextString(null != map.get(headerCode[j]) ? map.get(headerCode[j]).toString() : " ");
cell.setCellValue(text);
}
}
//准备将Excel的输出流通过response输出到页面下载
//八进制输出流
response.setContentType("application/octet-stream");
//这后面可以设置导出Excel的名称此例中名为student.xls
String fileName = ToolUtils.web2fileName(request,"teacherOpenCourseHandsOn(" + TimeTool.getNowTime("YMD") + ").xls");
response.setHeader("Content-disposition", "attachment;filename="+fileName);
//刷新缓冲
response.flushBuffer();
//workbook将Excel写入到response的输出流中供页面下载
workbook.write(response.getOutputStream());
}catch (Exception e){
e.printStackTrace();
} finally {
try {
if (null != workbook) {
workbook.close();
}
if (null != response && null != response.getOutputStream()) {
response.getOutputStream().close();
}
} catch (Exception e) { }
}
return JsonResult.success(list);
}
}
/**
*
* @param teacherOpenCourseId ID

@ -1,16 +1,42 @@
layui.define([ 'form', 'laydate', 'table' ], function(exports) {
layui.define([ 'form', 'laydate', 'table','laytpl' ], function(exports) {
var form = layui.form;
var laydate = layui.laydate;
var table = layui.table;
var laytpl = layui.laytpl;
var teacherOpenCourseHandsOnTable = null;
var teacherOpenCourseId = $("input[name='teacherOpenCourseId']").val();
var data={};
var ret = Common.getAjax("/jlw/teacherOpenCourseHandsOn/getHandsOnListCount.do?teacherOpenCourseId"+teacherOpenCourseId);
if(ret.code==0){
data = ret.data;
}else {
Common.info(ret.msg);
}
if ($.isEmpty(data)) {
data = {
videoAvgScore: '',
pptAvgScore: '',
theoryAvgScore: '',
stepAvgScore: '',
reportAvgScore: ''
};
}
var getTpl = demo.innerHTML
,view = document.getElementById('view');
laytpl(getTpl).render(data, function(html){
view.innerHTML = html;
});
var view ={
init:function(){
var that = this
var that = this;
this.initTable();
this.initSearchForm();
this.initToolBar();
window.dataReload = function(){
Lib.doSearchForm($("#searchForm"),teacherOpenCourseHandsOnTable)
Lib.doSearchForm($("#searchForm"),teacherOpenCourseHandsOnTable);
that.initToolBar();
}
},
@ -21,94 +47,76 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
elem : '#teacherOpenCourseHandsOnTable',
height : Lib.getTableHeight(1),
cellMinWidth: 100,
method : 'post',
url : Common.ctxPath + '/jlw/teacherOpenCourseHandsOn/list.json' // 数据接口
method : 'get',
url : Common.ctxPath + '/jlw/teacherOpenCourseHandsOn/getHandsOnList.do' // 数据接口 /server
,where:{"teacherOpenCourseId":teacherOpenCourseId}
,page : Lib.tablePage // 开启分页
,toolbar: '#toolbar_teacherOpenCourseHandsOn' //自定义头部左侧工具栏
,defaultToolbar: ['filter', 'print', 'exports'] //头部右侧工具栏
,limit : 10,
cols : [ [ // 表头
{
type : 'checkbox',
type : 'numbers',
title:'序号'
},
{
field : 'handsOnId',
title : '实操主键',
align:"center",
hideField :false,
hide:$.isEmpty(sx_['handsOnId'])?false:sx_['handsOnId'],
width : 60,
},
{
field : 'teacherOpenCourseId',
title : '开课ID',
align:"center",
hideField :false,
hide:$.isEmpty(sx_['teacherOpenCourseId'])?false:sx_['teacherOpenCourseId'],
},
{
field : 'courseInfoId',
title : '归属课程',
align:"center",
hideField :false,
hide:$.isEmpty(sx_['courseInfoId'])?false:sx_['courseInfoId'],
},
{
field : 'courseChildNode',
title : '归属章节',
align:"center",
hideField :false,
hide:$.isEmpty(sx_['courseChildNode'])?false:sx_['courseChildNode'],
},
{
field : 'handsOnName',
title : '实操名称',
field : 'handsOnName',
title : '项目名称',
align:"center",
hideField :false,
hide:$.isEmpty(sx_['handsOnName'])?false:sx_['handsOnName'],
hide:$.isEmpty(sx_['handsOnName'])?false:sx_['handsOnName']
},
{
field : 'handsOnRecommend',
title : '实操介绍',
field : 'videoAvgScore',
title : '观看视频平均得分',
align:"center",
hideField :false,
hide:$.isEmpty(sx_['handsOnRecommend'])?false:sx_['handsOnRecommend'],
hide:$.isEmpty(sx_['videoAvgScore'])?false:sx_['videoAvgScore'],
templet:function (d) {
var htm = '<a class="layui-table-link" lay-event="videoAvgScore">'+d.videoAvgScore+'</a>';
return htm
}
},
{
field : 'addTime',
title : '添加时间',
field : 'pptAvgScore',
title : '观看PPT平均得分',
align:"center",
hideField :false,
hide:$.isEmpty(sx_['addTime'])?false:sx_['addTime'],
hide:$.isEmpty(sx_['pptAvgScore'])?false:sx_['pptAvgScore'],
templet:function (d) {
var htm = '<a class="layui-table-link" lay-event="pptAvgScore">'+d.pptAvgScore+'</a>';
return htm
}
},
{
field : 'orgId',
title : '组织机构ID',
field : 'theoryAvgScore',
title : '理论测评平均得分',
align:"center",
hideField :false,
hide:$.isEmpty(sx_['orgId'])?false:sx_['orgId'],
hide:$.isEmpty(sx_['theoryAvgScore'])?false:sx_['theoryAvgScore'],
templet:function (d) {
var htm = '<a class="layui-table-link" lay-event="theoryAvgScore">'+d.theoryAvgScore+'</a>';
return htm
}
},
{
field : 'userId',
title : '后台用户ID',
field : 'stepAvgScore',
title : '实训操作步骤平均得分',
align:"center",
hideField :false,
hide:$.isEmpty(sx_['userId'])?false:sx_['userId'],
hide:$.isEmpty(sx_['stepAvgScore'])?false:sx_['stepAvgScore'],
templet:function (d) {
var htm = '<a class="layui-table-link" lay-event="stepAvgScore">'+d.stepAvgScore+'</a>';
return htm
}
},
{
field : 'trainingData',
title : '数据集(多个地址,逗号隔开)',
field : 'reportAvgScore',
title : '报告撰写平均得分',
align:"center",
hideField :false,
hide:$.isEmpty(sx_['trainingData'])?false:sx_['trainingData'],
}
,{
field : 'operation_',title : '操作',align:"center", templet: function (d) {
var htm = '<button type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit">编辑</button>';
htm += '<button type="button" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</button>';
return htm;
hide:$.isEmpty(sx_['reportAvgScore'])?false:sx_['reportAvgScore'],
templet:function (d) {
var htm = '<a class="layui-table-link" lay-event="reportAvgScore">'+d.reportAvgScore+'</a>';
return htm
}
}
@ -159,6 +167,16 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
Lib.doSearchForm($("#searchForm"), teacherOpenCourseHandsOnTable, 1);
view.initToolBar()
},
addButton_cancel:function () {
parent.Lib.tableRefresh();
Lib.closeFrame();
},exportDocument:function () { console.log("h")
/*layer.confirm('', function (index) {
$.downFile(Common.ctxPath + "/jlw/teacherOpenCourseStudentSigninSetting/exportSummary.json?teacherOpenCourseId=" + teacherOpenCourseId,'签到汇总表');
layer.close(index);
});*/
},
}
//触发事件
$('.ext-toolbar').on('click', function() {
@ -184,6 +202,15 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
}
});
});
}else if(obj.event === "videoAvgScore"){
//teacherOpenCourseId handsOnId
//搜索条件studentOrName
}else if(obj.event === "pptAvgScore"){
}else if(obj.event === "theoryAvgScore"){
}else if(obj.event === "stepAvgScore"){
}else if(obj.event === "reportAvgScore"){
}
})
}

@ -168,8 +168,7 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
var url = "/jlw/questionLogSummary/index.do?teacherOpenCourseId=" + data.teacherOpenCourseId + "&questionSettingType=CHAPTER_EXERCISE";
Common.openDlg(url,"《"+title+"》/ 章节练习存档");
}else if(obj.event === "kcsc"){
var url = "/jlw/questionLogSummary/index.do?teacherOpenCourseId="+data.teacherOpenCourseId;
var url = "/jlw/teacherOpenCourseHandsOn/index.do?teacherOpenCourseId="+data.teacherOpenCourseId;
Common.openDlg(url,"《"+title+"》/ 课程实操存档");
} else if (obj.event === "homework") {
var url = "/jlw/questionLogSummary/homeworkIndex.do?teacherOpenCourseId=" + data.teacherOpenCourseId;

@ -90,7 +90,12 @@
title : '应用链接',align:"center"
},{
field : 'studentClientLinkImg',
title : '应用图片',align:"center"
title : '应用图片',align:"center",
// templet: function (d) {
// return '<a class="layui-table-link" lay-event="photos">' +
// '<img src="'+Common.ctxPath + d.studentClientLinkImg+'" />"'+
// '</a>'
// }
},
{
field : 'studentClientLinkDesc',
@ -158,6 +163,24 @@
Common.openDlg(url,"应用管理/编辑应用");
}else if(obj.event === "del"){
deleteInfo(data.studentClientLinkId);
}else if(obj.event === "photos"){
var json ={
"title": "", //相册标题
"id": 123, //相册id
"start": 0, //初始显示的图片序号默认0
"data": [ //相册包含的图片,数组格式
{
"alt": "图片名",
"pid": 666, //图片id
"src": Common.ctxPath + data.studentClientLinkImg, //原图地址
"thumb": "" //缩略图地址
}
]
}
layer.photos({
photos: json
,anim: 5 //0-6的选择指定弹出图片动画类型默认随机请注意3.0之前的版本用shift参数
});
}
})
}

@ -1,25 +1,47 @@
<!--#layout("/common/layout.html",{"jsBase":"/js/jlw/teacherOpenCourseHandsOn/"}){ -->
<layui:searchForm formId="searchForm" searchList="" condition="${search}">
</layui:searchForm>
<div class="layui-row" style="float: right;margin-bottom: 20px">
<layui:accessButton function="teacherOpenCourseStudentSigninSetting.query" class="layui-btn-primary"
action="addButton_cancel"><span class="iconfont">&#xe600;</span>返回</layui:accessButton>
<div class="layui-inline" style="float: right;">
<layui:accessButton function="teacherOpenCourseStudentSigninSetting.query" action="exportDocument"><span
class="iconfont">&#xe8c7;</span>导出</layui:accessButton>
</div>
</div>
<div class="layui-row">
<div style="float: left" id="view"></div>
</div>
<script type="text/html" id="demo">
<h2 style="float: left">课程实操汇总:【
观看视频平均得分:{{!$.isEmpty(d)?d.videoAvgScore:" "}};
观看ppt平均得分{{!$.isEmpty(d)?d.pptAvgScore:""}};
理论测评平均得分:{{!$.isEmpty(d)?d.theoryAvgScore:""}};
实训操作步骤平均得分:{{!$.isEmpty(d)?d.stepAvgScore:""}}
报告撰写平均得分:{{!$.isEmpty(d)?d.reportAvgScore:""}}
</h2>
</script>
<table id="teacherOpenCourseHandsOnTable" lay-filter="teacherOpenCourseHandsOnTable"></table>
<input type="hidden" name="teacherOpenCourseId" value="${teacherOpenCourseId}" />
<!--#} -->
<!--
<script type="text/html" id="toolbar_teacherOpenCourseHandsOn">
<div class="layui-btn-container">
<div class="layui-btn-group" >
<!--# if(core.searchIsShow(search)) {-->
&lt;!&ndash;# if(core.searchIsShow(search)) {&ndash;&gt;
<layui:accessButton function="teacherOpenCourseHandsOn.query" id="searchFormSearch" action="search"><i class="layui-icon">&#xe615;</i>搜索</layui:accessButton>
<!--# }-->
&lt;!&ndash;# }&ndash;&gt;
<layui:accessButton function="teacherOpenCourseHandsOn.add" action="add">添加</layui:accessButton>
<layui:accessButton function="teacherOpenCourseHandsOn.edit" action="edit">修改</layui:accessButton>
<layui:accessButton function="teacherOpenCourseHandsOn.del" action="del">删除</layui:accessButton>
<!--# if(!isEmpty(search)) {-->
&lt;!&ndash;# if(!isEmpty(search)) {&ndash;&gt;
<layui:accessButton function="teacherOpenCourseHandsOn.query" action="refresh"><i class="layui-icon">&#xe669;</i>刷新</layui:accessButton>
<!--# }-->
&lt;!&ndash;# }&ndash;&gt;
</div>
</div>
</script>
<script>
<script>-->
layui.use(['index'], function(){
var index = layui.index;

Loading…
Cancel
Save