|
|
|
@ -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;"
|
|
|
|
|