|
|
|
@ -1,54 +1,54 @@
|
|
|
|
|
layui.define([ 'form', 'laydate', 'table' ], function(exports) {
|
|
|
|
|
layui.define(['form', 'laydate', 'table'], function (exports) {
|
|
|
|
|
var form = layui.form;
|
|
|
|
|
var laydate = layui.laydate;
|
|
|
|
|
var table = layui.table;
|
|
|
|
|
var universitiesCollegesJurisdictionCurriculumResourcesTable = null;
|
|
|
|
|
var view ={
|
|
|
|
|
init:function(){
|
|
|
|
|
var view = {
|
|
|
|
|
init: function () {
|
|
|
|
|
this.initTable();
|
|
|
|
|
this.initSearchForm();
|
|
|
|
|
this.initToolBar();
|
|
|
|
|
window.dataReload = function(){
|
|
|
|
|
Lib.doSearchForm($("#searchForm"),universitiesCollegesJurisdictionCurriculumResourcesTable)
|
|
|
|
|
window.dataReload = function () {
|
|
|
|
|
Lib.doSearchForm($("#searchForm"), universitiesCollegesJurisdictionCurriculumResourcesTable)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
initTable:function(){
|
|
|
|
|
initTable: function () {
|
|
|
|
|
universitiesCollegesJurisdictionCurriculumResourcesTable = table.render({
|
|
|
|
|
elem : '#universitiesCollegesJurisdictionCurriculumResourcesTable',
|
|
|
|
|
height : Lib.getTableHeight(1),
|
|
|
|
|
elem: '#universitiesCollegesJurisdictionCurriculumResourcesTable',
|
|
|
|
|
height: Lib.getTableHeight(1),
|
|
|
|
|
cellMinWidth: 100,
|
|
|
|
|
method : 'post',
|
|
|
|
|
size:"lg",
|
|
|
|
|
method: 'post',
|
|
|
|
|
size: "lg",
|
|
|
|
|
// url : Common.ctxPath + '/jlw/universitiesCollegesJurisdictionCurriculumResources/list.json' // 数据接口
|
|
|
|
|
url : Common.ctxPath + '/jlw/universitiesCollegesJurisdictionCurriculumResources/listWithCourseInfo.json?useTypePlural=1,2' // 数据接口
|
|
|
|
|
,page : Lib.tablePage // 开启分页
|
|
|
|
|
,limit : 10,
|
|
|
|
|
cols : [ [ // 表头
|
|
|
|
|
url: Common.ctxPath + '/jlw/universitiesCollegesJurisdictionCurriculumResources/listWithCourseInfo.json?useTypePlural=1,2' // 数据接口
|
|
|
|
|
, page: Lib.tablePage // 开启分页
|
|
|
|
|
, limit: 10,
|
|
|
|
|
cols: [[ // 表头
|
|
|
|
|
{
|
|
|
|
|
type : 'checkbox',
|
|
|
|
|
fixed:'left',
|
|
|
|
|
type: 'checkbox',
|
|
|
|
|
fixed: 'left',
|
|
|
|
|
},
|
|
|
|
|
// {
|
|
|
|
|
// field : 'universitiesCollegesName',
|
|
|
|
|
// title : '院校名称',
|
|
|
|
|
// },
|
|
|
|
|
{
|
|
|
|
|
field : 'courseInfoName',
|
|
|
|
|
title : '课程名称',
|
|
|
|
|
field: 'courseInfoName',
|
|
|
|
|
title: '课程名称',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field : 'courseLabelType',
|
|
|
|
|
title : '课程类别',
|
|
|
|
|
field: 'courseLabelType',
|
|
|
|
|
title: '课程类别',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field : 'courseLabelName',
|
|
|
|
|
title : '课程标签',
|
|
|
|
|
field: 'courseLabelName',
|
|
|
|
|
title: '课程标签',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field : 'userId',
|
|
|
|
|
title : '课程来源',
|
|
|
|
|
field: 'type',
|
|
|
|
|
title: '课程来源',
|
|
|
|
|
templet: function (d) {
|
|
|
|
|
if(d.userId == null || d.userId == 1) {
|
|
|
|
|
if (d.type == 2) {
|
|
|
|
|
return '系统授权'
|
|
|
|
|
} else {
|
|
|
|
|
return '院校添加'
|
|
|
|
@ -56,33 +56,29 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field : 'useType',
|
|
|
|
|
title : '使用级别',
|
|
|
|
|
field: 'useType',
|
|
|
|
|
title: '使用级别',
|
|
|
|
|
templet: function (d) {
|
|
|
|
|
return d.useType === 0 ? '不使用'
|
|
|
|
|
: d.useType === 1 ? '购买'
|
|
|
|
|
: d.useType === 2 ? '试用'
|
|
|
|
|
// 默认试用,会有一些课程,在清单中,但不属于授权的
|
|
|
|
|
: '试用';
|
|
|
|
|
return d.useType === 0 ? '不使用' : (d.useType === 1 ? '购买' : (d.useType === 2 ? '试用' : (d.useType === 3 ? '-' : '试用')));
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field : 'useStartTime',
|
|
|
|
|
title : '开始时间',
|
|
|
|
|
field: 'useStartTime',
|
|
|
|
|
title: '开始时间',
|
|
|
|
|
templet: function (d) {
|
|
|
|
|
return d.useStartTime ? d.useStartTime : '-'
|
|
|
|
|
return d.useStartTime ? d.useStartTime : '-'
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field : 'useEndTime',
|
|
|
|
|
title : '结束时间',
|
|
|
|
|
field: 'useEndTime',
|
|
|
|
|
title: '结束时间',
|
|
|
|
|
templet: function (d) {
|
|
|
|
|
return d.useEndTime ? d.useEndTime : '-'
|
|
|
|
|
return d.useEndTime ? d.useEndTime : '-'
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field : '_endStatus_',
|
|
|
|
|
title : '到期状态',
|
|
|
|
|
field: '_endStatus_',
|
|
|
|
|
title: '到期状态',
|
|
|
|
|
templet: function (d) {
|
|
|
|
|
// 默认在用,会有一些课程,在清单中,但不属于授权的
|
|
|
|
|
if (!d.useEndTime) {
|
|
|
|
@ -97,42 +93,42 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field : 'addTime',
|
|
|
|
|
title : '添加时间',
|
|
|
|
|
field: 'addTime',
|
|
|
|
|
title: '添加时间',
|
|
|
|
|
}
|
|
|
|
|
] ]
|
|
|
|
|
]]
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
table.on('checkbox(universitiesCollegesJurisdictionCurriculumResourcesTable)', function(obj){
|
|
|
|
|
table.on('checkbox(universitiesCollegesJurisdictionCurriculumResourcesTable)', function (obj) {
|
|
|
|
|
var universitiesCollegesJurisdictionCurriculumResources = obj.data;
|
|
|
|
|
if(obj.checked){
|
|
|
|
|
if (obj.checked) {
|
|
|
|
|
//按钮逻辑Lib.buttonEnable()
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
initSearchForm:function(){
|
|
|
|
|
Lib.initSearchForm( $("#searchForm"),universitiesCollegesJurisdictionCurriculumResourcesTable,form);
|
|
|
|
|
initSearchForm: function () {
|
|
|
|
|
Lib.initSearchForm($("#searchForm"), universitiesCollegesJurisdictionCurriculumResourcesTable, form);
|
|
|
|
|
},
|
|
|
|
|
initToolBar:function(){
|
|
|
|
|
initToolBar: function () {
|
|
|
|
|
toolbar = {
|
|
|
|
|
add : function() { // 获取选中数据
|
|
|
|
|
add: function () { // 获取选中数据
|
|
|
|
|
var url = "/jlw/universitiesCollegesJurisdictionCurriculumResources/add.do";
|
|
|
|
|
Common.openDlg(url,"UniversitiesCollegesJurisdictionCurriculumResources管理>新增");
|
|
|
|
|
Common.openDlg(url, "UniversitiesCollegesJurisdictionCurriculumResources管理>新增");
|
|
|
|
|
},
|
|
|
|
|
edit : function() { // 获取选中数目
|
|
|
|
|
var data = Common.getOneFromTable(table,"universitiesCollegesJurisdictionCurriculumResourcesTable");
|
|
|
|
|
if(data==null){
|
|
|
|
|
return ;
|
|
|
|
|
edit: function () { // 获取选中数目
|
|
|
|
|
var data = Common.getOneFromTable(table, "universitiesCollegesJurisdictionCurriculumResourcesTable");
|
|
|
|
|
if (data == null) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var url = "/jlw/universitiesCollegesJurisdictionCurriculumResources/edit.do?universitiesCollegesJurisdictionCurriculumResourcesId="+data.universitiesCollegesJurisdictionCurriculumResourcesId;
|
|
|
|
|
Common.openDlg(url,"UniversitiesCollegesJurisdictionCurriculumResources管理>"+data.universitiesCollegesJurisdictionCurriculumResourcesId+">编辑");
|
|
|
|
|
var url = "/jlw/universitiesCollegesJurisdictionCurriculumResources/edit.do?universitiesCollegesJurisdictionCurriculumResourcesId=" + data.universitiesCollegesJurisdictionCurriculumResourcesId;
|
|
|
|
|
Common.openDlg(url, "UniversitiesCollegesJurisdictionCurriculumResources管理>" + data.universitiesCollegesJurisdictionCurriculumResourcesId + ">编辑");
|
|
|
|
|
},
|
|
|
|
|
del : function() {
|
|
|
|
|
layui.use(['del'], function(){
|
|
|
|
|
del: function () {
|
|
|
|
|
layui.use(['del'], function () {
|
|
|
|
|
var delView = layui.del
|
|
|
|
|
delView.delBatch();
|
|
|
|
|
});
|
|
|
|
@ -141,12 +137,12 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
|
|
|
|
|
Lib.doSearchForm($("#searchForm"), universitiesCollegesJurisdictionCurriculumResourcesTable, 1);
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
$('.ext-toolbar').on('click', function() {
|
|
|
|
|
$('.ext-toolbar').on('click', function () {
|
|
|
|
|
var type = $(this).data('type');
|
|
|
|
|
toolbar[type] ? toolbar[type].call(this) : '';
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
exports('index',view);
|
|
|
|
|
exports('index', view);
|
|
|
|
|
|
|
|
|
|
});
|