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

beetlsql3-dev
wgf 2 years ago
commit 3dba87e4b8

@ -9,7 +9,7 @@ layui.define(['table', 'handsOnApi'], function(exports) {
if(data==null){
return ;
}
Common.openConfirm("确认要删除这些HandsOn?",function(){
Common.openConfirm("确认要删除这些课程实训案例吗?",function(){
var ids =Common.concatBatchId(data,"handsOnId");
handsOnApi.del(ids,function(){
Common.info("删除成功");

@ -87,9 +87,9 @@ layui.define(['form', 'laydate', 'table'], function (exports) {
width: 260,
templet: function (d) {
var css = isAdmin? "" : "display: none;";
var htm = '';
if(d.dataType == 'ADMIN_ADD'){
htm += '<div style="text-align:left"><a class="layui-table-link" lay-event="up" data-item="${JSON.stringify(d)}" >上架</a>'
var htm = '<div style="text-align:left">';
if(d.dataType == 'ADMIN_ADD'&&isAdmin){
htm += '<a class="layui-table-link" lay-event="up" data-item="${JSON.stringify(d)}" >上架</a>'
+ '<a class="layui-table-link" lay-event="drown" data-item="${JSON.stringify(d)}" style="color: #bebebe!important">下架</a>';
}
@ -107,13 +107,42 @@ layui.define(['form', 'laydate', 'table'], function (exports) {
});
table.on('checkbox(handsOnTable)', function (obj) {
/*课程实操上方的上架和下架做功能全选*/
var handsOn = obj.data;
var btnDrown = $("#table-button-drown");
var btnUp = $("#table-button-up" );
var btnDell = $("#table-button-allDel" );
if (obj.checked) {
//按钮逻辑Lib.buttonEnable()
console.log(handsOn)
if(isAdmin && handsOn.dataType == "FACULTY_ADD"){
btnDrown.addClass("button-disabled");
btnUp.addClass("button-disabled");
btnDell.addClass("button-disabled");
Common.info("只能 '删除、上/下架' 系统内置的课程实训案例");
}
if(!isAdmin&& handsOn.dataType == "ADMIN_ADD"){
btnDell.addClass("button-disabled");
Common.info("只能 '删除' 院校添加的课程实训案例");
}
} else {
var isFalse = true;
var data = Common.getMoreDataFromTable(table, "handsOnTable");
if(!$.isEmpty(data)){
data.forEach(function (value, index) {
if(isAdmin && value.dataType == "FACULTY_ADD"){
isFalse = false;
}else if(!isAdmin && value.dataType === "ADMIN_ADD"){
isFalse = false;
}
})
}
if(isFalse){
if(isAdmin){
btnDrown.removeClass("button-disabled");
btnUp.removeClass("button-disabled");
btnDell.removeClass("button-disabled");
}else {
btnDell.removeClass("button-disabled");
}
}
}
})
},
@ -138,20 +167,81 @@ layui.define(['form', 'laydate', 'table'], function (exports) {
view.initToolBar()
},
allDel: function () {
var data = Common.getMoreDataFromTable(table, "handsOnTable");
var isFalse = true;
if(!$.isEmpty(data)){
data.forEach(function (value, index) {
if(isAdmin && value.dataType == "FACULTY_ADD"){
Common.info("只能 '删除' 系统内置的课程实训案例")
isFalse = false;
return;
}
if(!isAdmin && value.dataType === "ADMIN_ADD"){
Common.info("只能 '删除'院校添加的课程实训案例")
isFalse = false;
return;
}
})
}
layui.use(['del'], function () {
var delView = layui.del;
delView.delBatch();
if(isFalse && isAdmin) {
delView.delBatch();
}
});
if(isFalse && !isAdmin){
Common.openConfirm("确认要删除这些教师开课-课程实操?",function(){
var ids = Common.concatBatchId(data,"handsOnId");
Common.post("/jlw/teacherOpenCourseHandsOn/delete.json",{"ids":ids},function(){
Common.info("删除成功");
dataReload();
})
})
}
},
up: function () {
var data = Common.getMoreDataFromTable(table, "handsOnTable");
var ids = Common.concatBatchId(data, "handsOnId");
upDrown(1, ids);
var isFalse = true;
if(!isEmpty(data) || data.length > 0){
data.forEach(function (value, index) {
if(isAdmin && value.dataType == "FACULTY_ADD"){
Common.info("只能上架系统内置的课程实训案例")
isFalse = false;
return;
}
if(!isAdmin && value.dataType === "ADMIN_ADD"){
Common.info("只能 '删除'院校添加的课程实训案例")
isFalse = false;
return;
}
})
}
if(isFalse){
var ids = Common.concatBatchId(data, "handsOnId");
upDrown(1, ids);
}
},
drown: function () {
var data = Common.getMoreDataFromTable(table, "handsOnTable");
var ids = Common.concatBatchId(data, "handsOnId");
upDrown(0, ids);
var isFalse = true;
if(!$.isEmpty(data)){
data.forEach(function (value, index) {
if(isAdmin && value.dataType == "FACULTY_ADD"){
Common.info("只能下架架系统内置的课程实训案例")
isFalse = false;
return;
}
if(!isAdmin && value.dataType === "ADMIN_ADD"){
Common.info("只能 '删除'院校添加的课程实训案例")
isFalse = false;
return;
}
})
}
if(isFalse){
var ids = Common.concatBatchId(data, "handsOnId");
upDrown(0, ids);
}
}
}
//触发事件

@ -34,20 +34,18 @@ layui.define(['form', 'laydate', 'table'], function (exports) {
courseInfoParentId: courseInfoId,
courseInfoType:courseInfoType,
sourceType:sourceType
}).data;//获取课程数据
}).data;//获取课程章节数据
return data
}
currentAuthCourseInfoDetails.forEach(function(e,i){
if(e.sourceType == 2 && isAdmin){
if(e.courseLabelType == '考证课程类'){
textualResearchCourseList.push(e);
}else if(e.courseLabelType == '理论课程类'){
theoryCourseList.push(e);
}else if(e.courseLabelType == '应用课程类'){
applicationCourseList.push(e);
}
}else if(e.sourceType == 1&&!isAdmin){
if(e.courseLabelType == '考证课程类'){
textualResearchCourseList.push(e);
}else if(e.courseLabelType == '理论课程类'){
theoryCourseList.push(e);
}else if(e.courseLabelType == '应用课程类'){
applicationCourseList.push(e);
}else if (e.courseLabelType == '院校'){
openCourseList.push(e)
}
});
@ -72,7 +70,7 @@ layui.define(['form', 'laydate', 'table'], function (exports) {
selectList += htmY + '</optgroup>' + htmK + '</optgroup>' + htmL + '</optgroup>' + "</select>";
//console.log($("#isUser").val())
}else {
selectList+= htmO + '</optgroup>' + "</select>";
selectList+= htmL + '</optgroup>' + htmO + '</optgroup>' + "</select>";
}
/*$.each(courseLabelTypes, function (key, value) {
@ -108,12 +106,8 @@ layui.define(['form', 'laydate', 'table'], function (exports) {
type: 'checkbox'
},
{
field: 'resourcesInfoName', title: '资源名称', align: "center", style: "text-align: left;",
templet:function (d) {
var htm = '<div style="overflow: hidden;text-overflow:ellipsis;">'+d.resourcesInfoName+'</div>';
return htm;
}
field: 'resourcesInfoName', title: '资源名称', align: "center",
style: "text-align: left;overflow: hidden;text-overflow:ellipsis;",
},
{
field: 'courseInfoParentParentName',
@ -122,13 +116,14 @@ layui.define(['form', 'laydate', 'table'], function (exports) {
if((d.sourceType == 1 && !isAdmin)||(d.sourceType == 2 && isAdmin)){
return selectList; //一级
}else {
var htm = '<div style="text-align: center;">'+d.courseInfoParentParentName||""+'</div>';
var htm = '<div style="text-align: center;overflow: hidden;text-overflow: ellipsis; white-space: nowrap;">'+d.courseInfoParentParentName||""+'</div>';
return htm;
}
}
},{
field: 'courseInfoParentName',
title: '归属章节',
style: "text-align: left;",
align: "center",
templet: function (d) {
if((d.sourceType == 1 && !isAdmin)||(d.sourceType == 2 && isAdmin)){
@ -152,16 +147,17 @@ layui.define(['form', 'laydate', 'table'], function (exports) {
return htm + "</select>"; //二级
}
}else{
var value = '';
var value = '<div style="overflow: hidden;text-overflow:ellipsis;">';
if(!$.isEmpty(d.courseInfoParentParentId)){
value = d.courseInfoParentName||"";
value += d.courseInfoParentName||"";
}
value += "</div>"
return value;
}
}
},
{
field: 'courseInfoName', title: '归属小节', align: "center", width: 200, templet: function (d) {
field: 'courseInfoName', title: '归属小节', align: "center", width: 200, style: "text-align: left;", templet: function (d) {
if((d.sourceType == 1 && !isAdmin)||(d.sourceType == 2 && isAdmin)){
var htm = "<select lay-filter='select_courseInfoIds_2'><option value=''>请选择</option>";
if (!$.isEmpty(d.courseInfoId)&&!$.isEmpty(d.courseInfoParentParentId)) {
@ -184,10 +180,11 @@ layui.define(['form', 'laydate', 'table'], function (exports) {
return htm + "</select>"; //三级
}
}else{
var value = '';
var value = '<div style="overflow: hidden;text-overflow:ellipsis;">';
if(!$.isEmpty(d.courseInfoParentParentId)){
value = d.courseInfoName||"";
value += d.courseInfoName||"";
}
value += "</div>"
return value;
}
}

@ -48,7 +48,7 @@
<!--#if(user.get().isAdmin){ -->
<!--#// 查询授权的课程列表。自动根据身份判断 isSignRole.get()!'' :1admin+管理员 2:uniAdmin学院管理员 3:teacher 4student-->
<!--#layout("/common/courseInfoSelect.html",{"name":"courseInfoId", "id": "courseInfoIds", "isShowGroupName": "true","filterName": "应用课程类,理论课程类,考证课程类","defaultValue": courseInfoId}) {} -->
<!--#layout("/common/courseInfoSelect.html",{"name":"courseInfoId", "id": "courseInfoIds", "isShowGroupName": "false","filterName": "理论课程类","defaultValue": courseInfoId}) {} -->
<!--#}else{ -->
<!--#layout("/common/courseInfoSelect.html",{"name":"courseInfoId", "id": "courseInfoIds", "isShowGroupName": "true","filterName": "理论课程类,开课类","defaultValue": courseInfoId}) {} -->
@ -225,6 +225,7 @@
</div>
<!-- 业务对象须有hidden字段保存delFlag和version字段-->
<input type="hidden" name="handsOnId" value="${handsOn.handsOnId}"/>
<input type="hidden" name="courseInfoId_" value="${courseInfoId}"/>
</form>
<!--#} -->

@ -1,4 +1,5 @@
<!--#layout("/common/layout.html",{"jsBase":"/js/jlw/handsOn/"}){ -->
<script></script>
<style>
/* 分页确定按钮*/
.layui-laypage-btn{
@ -83,10 +84,13 @@
<!--#} -->
<layui:accessButton function="handsOn.query" action="allDel" class="layui-btn-danger"><i
class="layui-icon">&#xe640;</i>删除</layui:accessButton>
<!--#if(user.get().isAdmin){ -->
<layui:accessButton function="handsOn.query" action="up" class="layui-btn-warm"><i
class="iconfont">&#xebcb;</i>上架</layui:accessButton>
<layui:accessButton function="handsOn.query" action="drown" class="layui-btn-warm"><i
class="iconfont">&#xebcc;</i>下架</layui:accessButton>
<!--#} -->
<!-- <layui:accessButton function="handsOn.query" action="refresh"><i class="layui-icon">&#xe669;</i>刷新</layui:accessButton>-->
</div>

@ -6,11 +6,14 @@
<script type="text/javascript" src="${ctxPath}/plugins/highlight/highlight.min.js?v=${jsVer}"></script>
<form class="layui-form" id="updateForm">
<div class="layui-row" style="margin: 0 auto;">
<a class="layui-btn layui-btn-primary" id="addButton-cancel" style="margin-bottom: 10px;padding: 0 30px;">返回</a>
<a class="layui-btn bg_button" id="addButton"
style="${!user.get().isAdmin ? 'margin-bottom: 10px;padding: 0 28px;':'display: none;'}">确定</a>
<div class="layui-form-item" style="/*position:absolute;*/right:10px;bottom:0px;">
<button class="layui-btn layui-btn-primary" type="button" style="padding: 0 30px;" id="updateButton-cancel">返回</button>
<button class="layui-btn layui-btn-danger"
style="background-color: #73a2f8;padding: 0 30px;${!user.get().isAdmin ? 'margin-bottom: 10px;padding: 0 28px;':'display: none;'}"
type="button" id="updateButton" lay-submit="" lay-filter="form">确定</button>
</div>
<div class="layui-row">
<div class="layui-form-item">
<label class="layui-form-label"><span class="req">*</span>归属课程:</label>
@ -238,8 +241,9 @@
</div>
</div>-->
<!-- 业务对象须有hidden字段保存delFlag和version字段-->
<input type="hidden" name="实操任务" value="${teacherOpenCourseHandsOn.handsOnId}" />
<input type="hidden" id="teacherOpenCourseId" name="teacherOpenCourseId" value="${teacherOpenCourseHandsOn.teacherOpenCourseId}" class="layui-input" >
<input type="hidden" name="handsOnId" value="${teacherOpenCourseHandsOn.handsOnId}" class="layui-input"/>
<input type="hidden" name="courseInfoId_" value="${teacherOpenCourseHandsOn.courseInfoId}" class="layui-input" />
<input type="hidden" id="teacherOpenCourseId" name="teacherOpenCourseId" value="${teacherOpenCourseHandsOn.teacherOpenCourseId}" class="layui-input" />
<!-- <layui:submitButtons id="updateButton" buttonType="" showExamine="2" />-->
</form>
<!--#} -->

Loading…
Cancel
Save