任务资源选择

beetlsql3-dev
姚丹ab 2 years ago
parent fdcbb7d393
commit b558e72bb8

@ -232,7 +232,7 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT
}
});
$('#manualProblemSetting1').click(function () {//手动出题
$('#manualProblemSetting').click(function () {//手动出题
layer.open({
type: 1
, title: '选择题库'
@ -329,7 +329,7 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT
});
});
resourcesQuestionTable= function(){
var isAdmin = '${user.get().isAdmin}'
var isAdmin = '${user.get().isAdmin}';
var addType;
if(isAdmin){
addType = 'ADMIN_ADD';
@ -385,7 +385,7 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT
}
});
}
};
var view = {
init:function(){
Lib.initGenrealForm($("#addForm"),form);
@ -431,7 +431,8 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT
fileUrl:$(this).find(".fileUrl").html()
});
});
var resourcesInfoTableData = table.checkStatus("resourcesInfoTable").data; //获取选中行状态
var resourcesInfoTableData = table.cache["resourcesInfoShowTable"]||[]; //获取showtable数据 视频
for (var i = 0;i<resourcesInfoTableData.length;i++){
if(resourcesInfoTableData[i].resourcesInfoType == "1"){
tasksFile.push({
@ -468,15 +469,16 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT
fileUrl:$(this).find(".fileUrl").html()
});
});
var resourcesInfoTableData = table.checkStatus("resourcesInfoTable").data; //获取选中行状态
var resourcesInfoTableData = table.cache["resourcesInfoShowPPTTable"]||[]; //获取showtable数据 ppt
for (var i = 0;i<resourcesInfoTableData.length;i++){
if(resourcesInfoTableData[i].resourcesInfoType == "2"){
if(resourcesInfoTableData[i].resourcesInfoType == "2" || resourcesInfoTableData[i].resourcesInfoType == "3"){
tasksFile.push({
fileName:resourcesInfoTableData[i].resourcesInfoName,
fileUrl:resourcesInfoTableData[i].resourcesInfoContent
});
}
}
if (tasksFile.length <= 0){
Common.info("请上传PPT");
return;
@ -536,6 +538,7 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT
param.taskType = taskType;
param.taskId = taskId;
param.handsOnId = handsOnId; //案例ID
var url = "/jlw/handsOnSimulationTasks/edit.json";
if($.isEmpty(taskId)){
url = "/jlw/handsOnSimulationTasks/add.json";
@ -571,11 +574,11 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT
}
}
if(obj.value == "2"||obj.value == "1"){
if(!$.isEmpty(resourcesInfoShowTable) || !$.isEmpty(resourcesInfoShowPPTTable)){
/*resourcesInfoShowTable.reload({data:[]});
resourcesInfoShowPPTTable.reload({data:[]});*/
resourcesInfoShowTable = [];
resourcesInfoShowPPTTable = [];
if(!$.isEmpty(resourcesInfoShowTable)){
resourcesInfoShowTable.reload({data:[]});
}
if(!$.isEmpty(resourcesInfoShowPPTTable)){
resourcesInfoShowPPTTable.reload({data:[]});
}
}
@ -661,11 +664,15 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT
//视频资源库button
$("#videoClick").click(function (obj) {
updataResourcesOpenRe(1);
var htm = "已选中0";
$("#checkNumber").html(htm)
});
//PPT资源库button
$("#pptClick").click(function (obj) {
updataResourcesOpenRe('','2,3');
var htm = "已选中0";
$("#checkNumber").html(htm)
});
/*资源库上传弹出框*/
@ -688,12 +695,12 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT
var checkStatus = table.checkStatus("resourcesInfoTable"); //获取选中行状态
var dataNew = checkStatus.data, ids = Common.concatBatchId(dataNew, "resourcesInfoId"); //获取选中行数据
if(resourcesInfoType == 1){
resourcesInfoShowInfo(dataNew)
resourcesInfoShowInfo(checkStatusData)
}else if(resourcesInfoTypePlural == '2,3'){
resourcesInfoShowPPTInfo(dataNew)
resourcesInfoShowPPTInfo(checkStatusData)
}
form.render()
form.render();
layer.close(index);
}, btn2: function (index, layero) {
layer.close(index);
@ -741,7 +748,21 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT
return htm;
}
}
]]
]],done: function(res, curr, count){
//循环所有数据找出对应关系设置checkbox选中状态
for (var i = 0; i < res.data.length; i++) {
for (var j = 0; j < checkStatusData.length; j++) {
if (res.data[i].resourcesInfoId == checkStatusData[j].resourcesInfoId) {
//这里才是真正的有效勾选
res.data[i]["LAY_CHECKED"] = 'true';
//找到对应数据改变勾选样式,呈现出选中效果
var index = res.data[i]['LAY_TABLE_INDEX'];
$('.layui-table tr[data-index=' + index + '] input[type="checkbox"]').prop('checked', true);
$('.layui-table tr[data-index=' + index + '] input[type="checkbox"]').next().addClass('layui-form-checked');
}
}
}
}
});
table.on('tool(resourcesInfoTable)', function (obj) {
var data = obj.data;
@ -750,15 +771,36 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT
}
});
table.on('checkbox(resourcesInfoTable)', function(obj){
checkStatusData = table.checkStatus("resourcesInfoTable").data;
var htm = "已选中:";
var resourcesInfoTable = obj.data;
if(obj.checked){
htm += checkStatusData.length;
//按钮逻辑Lib.buttonEnable()
}else{
htm += checkStatusData.length;
if (obj.checked) { //选中
if (obj.type == "all") {//全选
var checkStatus = table.checkStatus('resourcesInfoTable').data;
var data = checkStatus;
for (var i = 0; i < checkStatusData.length; i++) {
for (var j = 0; j < checkStatus.length; j++) {
if(checkStatusData[i].resourcesInfoId == checkStatus[j].resourcesInfoId){
data.splice(checkStatus[j], 1); // 删除
}
}
}
for (var i = 0; i < data.length; i++) {
checkStatusData.push(data[i])
}
} else {
checkStatusData.push(obj.data);
}
} else {//取消全选
if (obj.type == "all") {//全选
var checkStatus = table.cache["resourcesInfoTable"];
for (var i = 0; i < checkStatus.length; i++) {
checkStatusData.splice(checkStatus[i], 1)
}
} else {
checkStatusData.splice(obj.data, 1); // 删除
//resourcesQuestionIds = Lib.stringRemove(resourcesQuestionIds, obj.data.resourcesQuestionId);
}
}
var htm = "已选择:"+checkStatusData.length;
$("#checkNumber").html(htm)
})
}
@ -771,6 +813,7 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT
method: 'post',
even: true,
data:data,
limit: 1000,
cols: [[ // 表头
{
field: 'resourcesInfoName', title: '资源名称', align: "center", style: "text-align: left;"
@ -814,6 +857,7 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT
method: 'post',
even: true,
data:data,
limit: 1000,
cols: [[ // 表头
{
field: 'resourcesInfoName', title: '资源名称', align: "center", style: "text-align: left;"

@ -6,7 +6,7 @@ layui.define(['form', 'laydate', 'table', 'laytpl'], function (exports) {
var teacherOpenCourseChatLogTable = null;
var teacherOpenCourseId = $("input[name='teacherOpenCourseId']").val();
var ret = Common.getAjax("/api/teacherOpenCourseChatLog/chatLogAnalysis.do", {'teacherOpenCourseId': teacherOpenCourseId});
var ret = Common.getAjax("/api/teacherOpenCourseChatLog/chatLogAnalysisNew.do", {'teacherOpenCourseId': teacherOpenCourseId});
var data = {};
if (ret.code == 0) {
data = ret.data;

@ -413,6 +413,16 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas
fileUrl:$(this).find(".fileUrl").html()
});
});
var resourcesInfoTableData = table.cache["resourcesInfoShowTable"]; //获取showtable数据
for (var i = 0;i<resourcesInfoTableData.length;i++){
if(resourcesInfoTableData[i].resourcesInfoType == "1"){
tasksFile.push({
fileName:resourcesInfoTableData[i].resourcesInfoName,
fileUrl:resourcesInfoTableData[i].resourcesInfoContent
});
}
}
if (tasksFile.length <= 0){
Common.info("请上传视频!");
return;
@ -441,6 +451,15 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas
fileUrl:$(this).find(".fileUrl").html()
});
});
var resourcesInfoTableData = table.cache["resourcesInfoShowPPTTable"]; //获取showtable数据
for (var i = 0;i<resourcesInfoTableData.length;i++){
if(resourcesInfoTableData[i].resourcesInfoType == "2"||resourcesInfoTableData[i].resourcesInfoType == "3"){
tasksFile.push({
fileName:resourcesInfoTableData[i].resourcesInfoName,
fileUrl:resourcesInfoTableData[i].resourcesInfoContent
});
}
}
if (tasksFile.length <= 0){
Common.info("请上传PPT");
return;
@ -543,8 +562,14 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas
editor.setToolbarAutoFixed(false);
}
}
resourcesInfoShowTable.reload({data:[]});
resourcesInfoShowPPTTable.reload({data:[]});
if(obj.value == "2"||obj.value == "1"){
if(!$.isEmpty(resourcesInfoShowTable)){
resourcesInfoShowTable.reload({data:[]});
}
if(!$.isEmpty(resourcesInfoShowPPTTable)){
resourcesInfoShowPPTTable.reload({data:[]});
}
}
// $("input[name='taskTitle']").val("");
// $("input[name='taskScore']").val("");
// $("input[name='taskOrder']").val("");
@ -626,11 +651,15 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas
//视频资源库button
$("#videoClick").click(function (obj) {
updataResourcesOpenRe(1);
var htm = "已选中0";
$("#checkNumber").html(htm)
});
//PPT资源库button
$("#pptClick").click(function (obj) {
updataResourcesOpenRe('','2,3');
var htm = "已选中0";
$("#checkNumber").html(htm)
});
/*资源库上传弹出框*/
@ -653,9 +682,9 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas
var checkStatus = table.checkStatus("resourcesInfoTable"); //获取选中行状态
var dataNew = checkStatus.data, ids = Common.concatBatchId(dataNew, "resourcesInfoId"); //获取选中行数据
if(resourcesInfoType == 1){
resourcesInfoShowInfo(dataNew)
resourcesInfoShowInfo(checkStatusData)
}else if(resourcesInfoTypePlural == '2,3'){
resourcesInfoShowPPTInfo(dataNew)
resourcesInfoShowPPTInfo(checkStatusData)
}
form.render()
@ -706,7 +735,21 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas
return htm;
}
}
]]
]],done: function(res, curr, count){
//循环所有数据找出对应关系设置checkbox选中状态
for (var i = 0; i < res.data.length; i++) {
for (var j = 0; j < checkStatusData.length; j++) {
if (res.data[i].resourcesInfoId == checkStatusData[j].resourcesInfoId) {
//这里才是真正的有效勾选
res.data[i]["LAY_CHECKED"] = 'true';
//找到对应数据改变勾选样式,呈现出选中效果
var index = res.data[i]['LAY_TABLE_INDEX'];
$('.layui-table tr[data-index=' + index + '] input[type="checkbox"]').prop('checked', true);
$('.layui-table tr[data-index=' + index + '] input[type="checkbox"]').next().addClass('layui-form-checked');
}
}
}
}
});
table.on('tool(resourcesInfoTable)', function (obj) {
var data = obj.data;
@ -715,15 +758,36 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas
}
});
table.on('checkbox(resourcesInfoTable)', function(obj){
checkStatusData = table.checkStatus("resourcesInfoTable").data;
var htm = "已选中:";
var resourcesInfoTable = obj.data;
if(obj.checked){
htm += checkStatusData.length;
//按钮逻辑Lib.buttonEnable()
}else{
htm += checkStatusData.length;
if (obj.checked) { //选中
if (obj.type == "all") {//全选
var checkStatus = table.checkStatus('resourcesInfoTable').data;
var data = checkStatus;
for (var i = 0; i < checkStatusData.length; i++) {
for (var j = 0; j < checkStatus.length; j++) {
if(checkStatusData[i].resourcesInfoId == checkStatus[j].resourcesInfoId){
data.splice(checkStatus[j], 1); // 删除
}
}
}
for (var i = 0; i < data.length; i++) {
checkStatusData.push(data[i])
}
} else {
checkStatusData.push(obj.data);
}
} else {//取消全选
if (obj.type == "all") {//全选
var checkStatus = table.cache["resourcesInfoTable"];
for (var i = 0; i < checkStatus.length; i++) {
checkStatusData.splice(checkStatus[i], 1)
}
} else {
checkStatusData.splice(obj.data, 1); // 删除
//resourcesQuestionIds = Lib.stringRemove(resourcesQuestionIds, obj.data.resourcesQuestionId);
}
}
var htm = "已选择:"+checkStatusData.length;
$("#checkNumber").html(htm)
})
}
@ -736,6 +800,7 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas
method: 'post',
even: true,
data:data,
limit: 1000,
cols: [[ // 表头
{
field: 'resourcesInfoName', title: '资源名称', align: "center", style: "text-align: left;"
@ -779,6 +844,7 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas
method: 'post',
even: true,
data:data,
limit: 1000,
cols: [[ // 表头
{
field: 'resourcesInfoName', title: '资源名称', align: "center", style: "text-align: left;"

@ -262,7 +262,7 @@
<label class="layui-form-label">客观题设置:</label>
<div class="layui-input-block">
<input type="hidden" name="taskList" value="${handsOnSimulationTasks.taskList}">
<button type="button" class="layui-btn bg_button button_add" id="manualProblemSetting1"
<button type="button" class="layui-btn bg_button button_add" id="manualProblemSetting"
style="float: left">题库选择
</button>
</div>

@ -11,9 +11,9 @@
<script type="text/html" id="demo">
<h2 style="float: left">互动汇总:【
讨论次数: {{!$.isEmpty(d.chatLogCount)?d.chatLogCount:"0"}}次;
学生提问次数:{{!$.isEmpty(d.studentSendCount)?d.studentSendCount:"0"}};
教师提问次数:{{!$.isEmpty(d.teacherSendCount)?d.teacherSendCount:"0"}}
讨论次数: {{!$.isEmpty(d.chatLogCount)?d.chatLogCount:"0"}}次;
学生提问次数:{{!$.isEmpty(d.studentSendCount)?d.studentSendCount:"0"}};
教师提问次数:{{!$.isEmpty(d.teacherSendCount)?d.teacherSendCount:"0"}}
</h2>
</script>

Loading…
Cancel
Save