课程配置

beetlsql3-dev
姚丹ab 2 years ago
parent b3deedf2db
commit 6f2fbfc783

@ -50,7 +50,6 @@ layui.define(['form', 'laydate', 'table'], function (exports) {
field: 'courseInfoParentParentName',
title: '归属课程',
align: "center",
width: 200,
templet: function (d) {
return selectList; //一级
}
@ -59,7 +58,6 @@ layui.define(['form', 'laydate', 'table'], function (exports) {
field: 'courseInfoParentName',
title: '归属章节',
align: "center",
width: 200,
templet: function (d) {
var htm = "<select lay-filter='select_courseInfoIds_1'><option value=''>请选择</option>";
if (!$.isEmpty(d.courseInfoParentId)) {
@ -102,19 +100,19 @@ layui.define(['form', 'laydate', 'table'], function (exports) {
}
},
{
field: 'addTypeText', width: 150, title: '来源', align: "center"
field: 'addTypeText', title: '来源', align: "center"
},
{
field: 'orgIdText', width: 150, title: '上传院校', align: "center"
field: 'orgIdText', title: '上传院校', align: "center"
},
{
field: 'resourcesInfoType', width: 150, title: '资源类型', align: "center", templet: function (d) {//(1视频 2PPT 3PDF)
field: 'resourcesInfoType', title: '资源类型', align: "center", templet: function (d) {//(1视频 2PPT 3PDF)
var text= d.resourcesInfoType == 1 ? "视频" : d.resourcesInfoType == 2 ? "PPT" : d.resourcesInfoType == 3 ? "PDF" : d.resourcesInfoType == 4 ? "链接" : d.resourcesInfoType == 5 ? "图文" : '-';
return '<span class="textType">' + text + '</span>';
}
},
{
field: 'userId', title: '操作', width: 180, align: "center",field:'right', templet: function (d) {
field: 'userId', title: '操作', align: "center",field:'right', templet: function (d) {
var htm = '<a class="layui-table-link" lay-event="edit">编辑</a>';
htm += '<a class="layui-table-link" lay-event="previewPage">' + (d.resourcesInfoType == 3 ? '下载' : '预览') + '</a>';
htm += '<a class="layui-table-link" lay-event="del">删除</a>';

@ -276,6 +276,7 @@ type="course_info.course_info_name.course_info_status!=3,course_info_type=1,find
field: 'courseInfoId',
title: '操作',
align: "center",
style: "text-align: left;",
templet: function (d) {
var htm = '';
if (d.courseInfoType === 2) {
@ -342,7 +343,7 @@ type="course_info.course_info_name.course_info_status!=3,course_info_type=1,find
};
addOpen("",'子章节名称',"",param);
}else if (obj.event === 'updataResources') {//上传资源
updataResourcesOpen();
updataResourcesOpen(courseInfoId);
}else if (obj.event === 'addLine') {//添加链接
addLine(data.courseInfoId);
} else if (obj.event === 'addPW') {//添加图文
@ -350,6 +351,7 @@ type="course_info.course_info_name.course_info_status!=3,course_info_type=1,find
}else if (obj.event === 'look') {//查看
Lib.downloadFile(data);
}else if (obj.event === 'update') {//上传
return;
updataResourcesOpen();
}else if(obj.event === 'edit'){
var title="章节目录";
@ -436,7 +438,7 @@ type="course_info.course_info_name.course_info_status!=3,course_info_type=1,find
}
/*资源类型弹出框*/
function updataResourcesOpen() {
function updataResourcesOpen(courseInfoId) {
layer.open({
title: '上传资源类型'
, shadeClose: true
@ -456,7 +458,7 @@ type="course_info.course_info_name.course_info_status!=3,course_info_type=1,find
if(type == '1'||type == 1){
updataResourcesOpenLocal();
}else {
updataResourcesOpenRe();
updataResourcesOpenRe(courseInfoId);
}
layer.close(index);
}
@ -485,7 +487,7 @@ type="course_info.course_info_name.course_info_status!=3,course_info_type=1,find
}
/*资源库上传弹出框*/
function updataResourcesOpenRe() {
function updataResourcesOpenRe(courseInfoId) {
layer.open({
type: 1,
title: "资源库上传",
@ -510,9 +512,8 @@ type="course_info.course_info_name.course_info_status!=3,course_info_type=1,find
});
return;
}
var param = {courseInfoIdPlural: ids};
var ret = Common.postAjax("/jlw/courseInfo/edit.json", param);
var param = {resourcesInfoIds: ids,courseId:courseInfoId};
var ret = Common.postAjax("/jlw/resourcesInfo/copy.json", param);
layer.msg(ret.code == 0 ? "保存成功!" : ret.msg, {
offset: ['50%'],
icon: ret.code == 0 ? 1 : 2,
@ -670,6 +671,14 @@ type="course_info.course_info_name.course_info_status!=3,course_info_type=1,find
});
return;
}
if ($.isEmpty(resourcesInfoContent)) {
layer.msg("请输入图文内容!", {
offset: ['50%'],
icon: 2,
time: 2000 //2秒关闭如果不配置默认是3秒
});
return;
}
var param = {
'resourcesInfoName': resourcesInfoName,
'resourcesInfoContent': resourcesInfoContent,

Loading…
Cancel
Save