|
|
|
@ -10,15 +10,45 @@ layui.define(['form', 'laydate', 'table'], function (exports) {
|
|
|
|
|
courseLabelTypes = Common.getAjax("/jlw/courseInfo/getTreeByCourseLabelTypes.json", {
|
|
|
|
|
courseLabelTypes: "应用课程类,考证课程类,理论课程类",
|
|
|
|
|
rankLimit: 3
|
|
|
|
|
}).data; //获取课程数据
|
|
|
|
|
}).data,//获取课程数据
|
|
|
|
|
htmY = '<optgroup label="应用课程类">', htmL = '<optgroup label="理论课程类">', htmK = '<optgroup label="考证课程类">',
|
|
|
|
|
currentAuthCourseInfoDetails = Common.getAjax("/jlw/universitiesCollegesJurisdictionCurriculumResources/getAuthDetailsByCacheUser.json").data;
|
|
|
|
|
// 应用课程类
|
|
|
|
|
var applicationCourseList = currentAuthCourseInfoDetails.applicationCourseList || [];
|
|
|
|
|
// 理论课程类
|
|
|
|
|
var theoryCourseList = currentAuthCourseInfoDetails.theoryCourseList || [];
|
|
|
|
|
// 考证课程类
|
|
|
|
|
var textualResearchCourseList = currentAuthCourseInfoDetails.textualResearchCourseList || [];
|
|
|
|
|
$.each(courseLabelTypes, function (key, value) {
|
|
|
|
|
selectList += '<option value="' + value.courseInfoId + '">' + value.courseInfoName + '</option>';
|
|
|
|
|
courseInfoMap[value.courseInfoId] = {courseInfoName: value.courseInfoName, children: value.children};
|
|
|
|
|
$.each(value.children, function (k, v) {
|
|
|
|
|
zjMap[v.courseInfoId] = {courseInfoName: v.courseInfoName, children: v.children};
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
selectList += "</select>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (let currentAuthCourseInfoDetail of applicationCourseList) {
|
|
|
|
|
htmY += '<option value="' + (currentAuthCourseInfoDetail.courseInfoId || '-1') + '">' + (currentAuthCourseInfoDetail.courseInfoName || '未查询到数据') + '</option>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (let currentAuthCourseInfoDetail of theoryCourseList) {
|
|
|
|
|
htmL+='<option value="'+ (currentAuthCourseInfoDetail.courseInfoId || '-1') +'">'+ (currentAuthCourseInfoDetail.courseInfoName || '未查询到数据') +'</option>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (let currentAuthCourseInfoDetail of textualResearchCourseList) {
|
|
|
|
|
htmK+='<option value="'+ (currentAuthCourseInfoDetail.courseInfoId || '-1') +'">'+ (currentAuthCourseInfoDetail.courseInfoName || '未查询到数据') +'</option>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($("#isUser").val() === "true"){
|
|
|
|
|
selectList += htmY + '</optgroup>' + htmK + '</optgroup>' + htmL + '</optgroup>' + "</select>";
|
|
|
|
|
console.log($("#isUser").val())
|
|
|
|
|
}else {
|
|
|
|
|
selectList+= htmL + '</optgroup>' + "</select>";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var view = {
|
|
|
|
|
init: function () {
|
|
|
|
|
this.initTable();
|
|
|
|
@ -49,7 +79,7 @@ layui.define(['form', 'laydate', 'table'], function (exports) {
|
|
|
|
|
{
|
|
|
|
|
field: 'courseInfoParentParentName',
|
|
|
|
|
title: '归属课程',
|
|
|
|
|
align: "center",
|
|
|
|
|
|
|
|
|
|
templet: function (d) {
|
|
|
|
|
return selectList; //一级
|
|
|
|
|
}
|
|
|
|
@ -63,6 +93,7 @@ layui.define(['form', 'laydate', 'table'], function (exports) {
|
|
|
|
|
if (!$.isEmpty(d.courseInfoParentId)) {
|
|
|
|
|
if ($.isEmpty(selectMap[d.courseInfoParentId])) {
|
|
|
|
|
var h = htm;
|
|
|
|
|
|
|
|
|
|
if (!$.isEmpty(courseInfoMap[d.courseInfoParentParentId])) {
|
|
|
|
|
$.each(courseInfoMap[d.courseInfoParentParentId].children, function (key, v) {
|
|
|
|
|
h += "<option value='" + v.courseInfoId + "'>" + v.courseInfoName + "</option>";
|
|
|
|
@ -106,13 +137,13 @@ layui.define(['form', 'laydate', 'table'], function (exports) {
|
|
|
|
|
field: 'orgIdText', title: '上传院校', align: "center"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
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 ? "图文" : '-';
|
|
|
|
|
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: '操作', 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>';
|
|
|
|
|