课程管理

beetlsql3-dev
姚丹ab 2 years ago
parent 060801bdd2
commit ee74764435

@ -0,0 +1,89 @@
/*jslint browser: true */ /*global jQuery: true */
/**
* jQuery Cookie plugin
*
* Copyright (c) 2010 Klaus Hartl (stilbuero.de)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/
// TODO JsDoc
/**
* Create a cookie with the given key and value and other optional parameters.
*
* @example $.cookie('the_cookie', 'the_value');
* @desc Set the value of a cookie.
* @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
* @desc Create a cookie with all available options.
* @example $.cookie('the_cookie', 'the_value');
* @desc Create a session cookie.
* @example $.cookie('the_cookie', null);
* @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
* used when the cookie was set.
*
* @param String key The key of the cookie.
* @param String value The value of the cookie.
* @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
* If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
* If set to null or omitted, the cookie will be a session cookie and will not be retained
* when the the browser exits.
* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
* require a secure protocol (like HTTPS).
* @type undefined
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/klaus.hartl@stilbuero.de
*/
/**
* Get the value of a cookie with the given key.
*
* @example $.cookie('the_cookie');
* @desc Get the value of a cookie.
*
* @param String key The key of the cookie.
* @return The value of the cookie.
* @type String
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/klaus.hartl@stilbuero.de
*/
jQuery.cookie = function (key, value, options) {
// key and value given, set cookie...
if (arguments.length > 1 && (value === null || typeof value !== "object")) {
options = jQuery.extend({}, options);
if (value === null) {
options.expires = -1;
}
if (typeof options.expires === 'number') {
var days = options.expires, t = options.expires = new Date();
t.setDate(t.getDate() + days);
}
return (document.cookie = [
encodeURIComponent(key), '=',
options.raw ? String(value) : encodeURIComponent(String(value)),
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
options.path ? '; path=' + options.path : '',
options.domain ? '; domain=' + options.domain : '',
options.secure ? '; secure' : ''
].join(''));
}
// key and possibly options given, get cookie...
options = value || {};
var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
};

@ -20,17 +20,17 @@ public class UniversityFacultyQuery extends PageParam {
private Long universityFacultyId;
@Query(name = "院系名称", display = true)
private String universityFacultyName;
@Query(name = "联系人", display = true)
@Query(name = "联系人", display = false)
private String universityFacultyContact;
@Query(name = "联系人电话", display = true)
@Query(name = "联系人电话", display = false)
private String universityFacultyContactTel;
@Query(name = "联系人地址", display = false)
private String universityFacultyContactAddress;
// @Query(name = "院校ID (院系的上一级)", display = true)
@Query(name = "院校ID", display = true)
@Query(name = "院校ID", display = false)
private Long universitiesCollegesId;
// @Query(name = "状态( 1 正常 2删除", display = true,type=Query.TYPE_DICT,dict="global_status")
@Query(name = "状态", display = true,type=Query.TYPE_DICT,dict=GLOBAL_STATUS)
@Query(name = "状态", display = false,type=Query.TYPE_DICT,dict=GLOBAL_STATUS)
private Integer universityFacultyStatus;
@Query(name = "创建时间", display = false)
private Date universityFacultyAddTime;

@ -24,49 +24,49 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
,page : Lib.tablePage // 开启分页
,limit : 10,
cols : [ [ // 表头
{
field : 'courseInfoName',
{
field : 'courseInfoName',
title : '课程名称',align:"center"
},
{
field : 'courseLabelType',
},
{
field : 'courseLabelType',
title : '课程类别',align:"center" //类型(1课程 2章 3节)
},
{
field : 'courseLabelName',
},
{
field : 'courseLabelName',
title : '课程标签',align:"center"
},
{
field : 'userName',
title : '创建人',align:"center"
},
{
field : 'addTime',
title : '创建时间',align:"center"
},
{
field : 'courseInfoStatus',title : '状态',align:"center", templet: function (d) {
if(d.courseInfoStatus == 1){
return "<span style='color:#73a2f8; '>启用</span>";
}else if(d.courseInfoStatus == 2){
return "<span style='color: red;'>禁用</span>";
}else {
return "-";
},
{
field : 'userName',
title : '创建人',align:"center"
},
{
field : 'addTime',
title : '创建时间',align:"center"
},
{
field : 'courseInfoStatus',title : '状态',align:"center", templet: function (d) {
if(d.courseInfoStatus == 1){
return "<span style='color:#73a2f8; '>启用</span>";
}else if(d.courseInfoStatus == 2){
return "<span style='color: red;'>禁用</span>";
}else {
return "-";
}
}
},
{
field : 'userId',width:300,title : '操作',align:"center", templet: function (d) {
var htm = '<a class="layui-table-link" lay-event="edit">编辑</a>';
htm += '<a class="layui-table-link" lay-event="courseConfigure">课程配置</a>';
htm += '<a class="layui-table-link" lay-event="editStatus">'+(d.courseInfoStatus == 1?"停用":"启用")+'</a>';
htm += '<a class="layui-table-link" lay-event="del">删除</a>';
return htm;
}
}
},
{
field : 'userId',width:300,title : '操作',align:"center", templet: function (d) {
var htm = '<button type="button" class="layui-btn layui-btn-xs" lay-event="edit">编辑</button></a>';
htm += '<button type="button" class="layui-btn layui-btn-xs" lay-event="courseConfigure">课程配置</button></a>';
htm += '<button type="button" class="layui-btn layui-btn-xs" lay-event="editStatus">'+(d.courseInfoStatus == 1?"停用":"启用")+'</button></a>';
htm += '<button type="button" class="layui-btn layui-btn-xs" lay-event="del">删除</button></a>';
return htm;
}
}
] ]
] ]
});
});
table.on('checkbox(courseInfoTable)', function(obj){
var courseInfo = obj.data;
@ -94,7 +94,7 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
search:function () {
Lib.doSearchForm($("#searchForm"), courseInfoTable, 1);
}
};
};
$('.ext-toolbar').on('click', function() {
var type = $(this).data('type');
toolbar[type] ? toolbar[type].call(this) : '';
@ -118,6 +118,10 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
});
});
}else if(obj.event === "courseConfigure"){ //跳转至课程配置
if(data.courseInfoStatus == 1){
Common.info("课程配置时,请先停用课程。配置完成后再启用课程")
return;
}
var url = "/jlw/courseInfo/courseConfigurePage.do?courseInfoId="+data.courseInfoId;
Common.openDlg(url,"");
}else if(obj.event === "editStatus"){ //启用
@ -138,6 +142,7 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
layer.msg(ret.code == 0?"操作成功!":ret.msg, {
offset: ['50%'],
icon: ret.code == 0?1:2,
shade:0.3,
time: 1500 //2秒关闭如果不配置默认是3秒
},function (){
if(ret.code == 0){

@ -1,93 +1,214 @@
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 resourcesApplicationCourseTable = null;
var view ={
init:function(){
var view = {
init: function () {
this.initTable();
this.initSearchForm();
this.initToolBar();
window.dataReload = function(){
Lib.doSearchForm($("#searchForm"),resourcesApplicationCourseTable)
window.dataReload = function () {
Lib.doSearchForm($("#searchForm"), resourcesApplicationCourseTable)
}
},
initTable:function(){
initTable: function () {
resourcesApplicationCourseTable = table.render({
elem : '#resourcesApplicationCourseTable',
height : Lib.getTableHeight(1),
elem: '#resourcesApplicationCourseTable',
height: Lib.getTableHeight(1),
cellMinWidth: 100,
method : 'post',
url : Common.ctxPath + '/jlw/resourcesApplicationCourse/list.json' // 数据接口
,page : Lib.tablePage // 开启分页
,limit : 10,
cols : [ [ // 表头
{
method: 'post',
url: Common.ctxPath + '/jlw/resourcesApplicationCourse/list.json' // 数据接口
, page: Lib.tablePage // 开启分页
, limit: 10,
size: 'lg',
cols: [[ // 表头
/*{
type : 'checkbox',
fixed:'left',
},*/
/*{
field: 'resourcesApplicationCourseId',
title: 'ID',
fixed: 'left',
width: 60,
},*/
{
field: 'courseInfoName',
align:"center",
title: '课程名称',
},
{
{
field : 'resourcesApplicationCourseId',
title : 'ID',
fixed:'left',
width : 60,
},
{
field: 'courseLabelType',
title: '课程类别',
align:"center",
templet: function (d) {
var html = "<div class='layui-input-inline'>\n" +
" <select name='courseLabelType' lay-filter='courseLabelType'>\n" +
" <option value='' >请选择</option>\n" +
" <option value='实务课程类' ${courseInfo.courseLabelType =='实务课程类'?'selected':''}>实务课程类</option>\n" +
" <option value='考证课程类' ${courseInfo.courseLabelType =='考证课程类'?'selected':''}>考证课程类</option>\n" +
" <option value='理论课程类' ${courseInfo.courseLabelType =='理论课程类'?'selected':''}>理论课程类</option>\n" +
" </select>\n" +
" </div>\n";
return html;
}
},
{
field : 'resourcesApplicationId',
title : '应用管理ID',
},
{
field: 'undefinedYD',
title: '绑定模块',
align:"center",
templet: function (d) {
var html = "<div class='layui-input-inline'>\n" +
" <select name='undefinedYD' lay-filter='undefinedYD'>\n" +
" <option value='' >请选择</option>\n" +
" <option value='金融大数据实训系统'>金融大数据实训系统</option>\n" +
" <option value='xxx'>xxx</option>\n" +
" <option value='ddd'>ddd</option>\n" +
" </select>\n" +
" </div>\n";
return html;
}
},
{
field : 'courseInfoId',
title : '课程配置ID',
}
field: 'resourcesApplicationId',
title: '绑定应用',
align:"center",
templet: function (d) {
var html = "<div class='layui-input-inline'>\n" +
" <select name='resourcesApplicationId' lay-filter='resourcesApplicationId'>\n" +
" <option value='' >请选择</option>\n" +
" <option value='金融大数据实训系统'>金融大数据实训系统</option>\n" +
" <option value='xxx'>xxx</option>\n" +
" <option value='ddd'>ddd</option>\n" +
" </select>\n" +
" </div>\n";
return html;
}
},
{
] ]
field: 'courseInfoId',
title: '课程配置ID',
align:"center",
templet: function (d) {
var htm = '<a class="layui-table-link" lay-event="binding">绑定</a>';
htm += '<a class="layui-table-link" lay-event="edit">编辑</a>';
htm += '<a class="layui-table-link" lay-event="del">删除</a>';
return htm;
}
}
]]
});
});
table.on('checkbox(resourcesApplicationCourseTable)', function(obj){
table.on('checkbox(resourcesApplicationCourseTable)', function (obj) {
var resourcesApplicationCourse = obj.data;
if(obj.checked){
if (obj.checked) {
//按钮逻辑Lib.buttonEnable()
}else{
} else {
}
})
});
table.on('edit(resourcesApplicationCourseTable)', function(obj){ //注edit是固定事件名test是table原始容器的属性 lay-filter="对应的值"
console.log(obj.value); //得到修改后的值
console.log(obj.field); //当前编辑的字段名
console.log(obj.data); //所在行的所有相关数据
});
},
initSearchForm:function(){
Lib.initSearchForm( $("#searchForm"),resourcesApplicationCourseTable,form);
initSearchForm: function () {
Lib.initSearchForm($("#searchForm"), resourcesApplicationCourseTable, form);
},
initToolBar:function(){
initToolBar: function () {
toolbar = {
add : function() { // 获取选中数据
add: function () { // 获取选中数据
var url = "/jlw/resourcesApplicationCourse/add.do";
Common.openDlg(url,"ResourcesApplicationCourse管理>新增");
Common.openDlg(url, "ResourcesApplicationCourse管理>新增");
},
edit : function() { // 获取选中数目
var data = Common.getOneFromTable(table,"resourcesApplicationCourseTable");
if(data==null){
return ;
edit: function () { // 获取选中数目
var data = Common.getOneFromTable(table, "resourcesApplicationCourseTable");
if (data == null) {
return;
}
var url = "/jlw/resourcesApplicationCourse/edit.do?resourcesApplicationCourseId="+data.resourcesApplicationCourseId;
Common.openDlg(url,"ResourcesApplicationCourse管理>"+data.resourcesApplicationCourseId+">编辑");
var url = "/jlw/resourcesApplicationCourse/edit.do?resourcesApplicationCourseId=" + data.resourcesApplicationCourseId;
Common.openDlg(url, "ResourcesApplicationCourse管理>" + data.resourcesApplicationCourseId + ">编辑");
},
del : function() {
layui.use(['del'], function(){
del: function () {
layui.use(['del'], function () {
var delView = layui.del
delView.delBatch();
});
}
};
$('.ext-toolbar').on('click', function() {
};
$('.ext-toolbar').on('click', function () {
var type = $(this).data('type');
toolbar[type] ? toolbar[type].call(this) : '';
});
}
}
exports('index',view);
}, initTableTool: table.on('tool(resourcesApplicationCourseTable)', function (obj) {
var data = obj.data;
if (obj.event === 'edit') {
console.log(data.resourcesApplicationCourseId)
var url = "/jlw/resourcesApplicationCourse/add.do?resourcesApplicationCourseId="+data.resourcesApplicationCourseId;
Common.openDlg(url,"");
}else if(obj.event === "del"){
layer.confirm('是否确定删除该课程?', function (index) { //courseInfoStatus:状态(1启用 2禁用 3删除)
var ret = Common.postAjax("/jlw/resourcesApplicationCourse/delete.json", {ids: data.resourcesApplicationCourseId});
layer.msg(ret.code == 0 ? "删除成功!" : ret.msg, {
offset: ['50%'],
icon: ret.code == 0 ? 1 : 2,
time: 1500 //2秒关闭如果不配置默认是3秒
}, function () {
if (ret.code == 0) {
Lib.tableRefresh();
}
});
});
}else if(obj.event === "binding"){
layer.confirm('是否确定绑定?', function (index) {
var ret = Common.postAjax("/jlw/xxx/xx.json", {ids: data.resourcesApplicationCourseId});
layer.msg(ret.code == 0 ? "绑定成功!" : ret.msg, {
offset: ['50%'],
icon: ret.code == 0 ? 1 : 2,
time: 1500 //2秒关闭如果不配置默认是3秒
}, function () {
if (ret.code == 0) {
Lib.tableRefresh();
}
});
});
}
})
};
form.on('select(courseLabelType)', function (data) {
console.log("data->>>>>>>>>>>>>>>>", data);
var selectElem = $(data.elem);
var tdElem = selectElem.closest('td');
var trElem = tdElem.closest('tr');
var tableView = trElem.closest('.layui-table-view');
table.cache[tableView.attr('lay-id')][trElem.data('index')][tdElem.data('field')] = data.value;
});
form.on('select(resourcesApplicationId)', function (data) {
console.log("data->>>>>>>>>>>>>>>>", data);
var selectElem = $(data.elem);
var tdElem = selectElem.closest('td');
var trElem = tdElem.closest('tr');
var tableView = trElem.closest('.layui-table-view');
table.cache[tableView.attr('lay-id')][trElem.data('index')][tdElem.data('field')] = data.value;
});
form.on('select(undefinedYD)', function (data) {
console.log("data->>>>>>>>>>>>>>>>", data);
var selectElem = $(data.elem);
var tdElem = selectElem.closest('td');
var trElem = tdElem.closest('tr');
var tableView = trElem.closest('.layui-table-view');
table.cache[tableView.attr('lay-id')][trElem.data('index')][tdElem.data('field')] = data.value;
});
exports('index', view);
});

@ -1,7 +1,10 @@
<!--# layout("/common/layout.html",{"jsBase":"/js/jlw/resourcesApplicationCourse/"}){ -->
<form class="layui-form layui-form-pane" id="addForm">
<div class="layui-row">
<link rel="stylesheet" type="text/css" href="${ctxPath}/css/plugin.css?v=${jsVer}" media="all"/>
<form class="layui-form" id="addForm">
<div style="margin-left: 80px;">
<layui:submitButtons id="addButton" buttonType=""/>
</div>
<!--<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">应用管理ID</label>
@ -16,13 +19,63 @@
</div>
</div>
</div>
</div>-->
<div class="layui-row">
<div class="layui-form-item">
<label class="layui-form-label">课程名称</label>
<div class="layui-input-inline">
<input type="text" name="courseInfoName" id="courseInfoName" autocomplete="off" value=""
class="layui-input">
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-form-item">
<label class="layui-form-label"><span class="req">*</span>课程类别:</label>
<div class="layui-input-inline">
<!-- '实务课程类','考证课程类','理论课程类';-->
<select lay-filter="select_courseLabelType">
<option value="">请选择</option>
<option value="实务课程类" ${resourcesApplicationCourse.courseLabelType=='实务课程类'?'selected':''}>实务课程类
</option>
<option value="考证课程类" ${resourcesApplicationCourse.courseLabelType=='考证课程类'?'selected':''}>考证课程类
</option>
<option value="理论课程类" ${resourcesApplicationCourse.courseLabelType=='理论课程类'?'selected':''}>理论课程类
</option>
</select>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-form-item">
<label class="layui-form-label"><span class="req">*</span>绑定模块:</label>
<div class="layui-input-inline">
<select name="undefinedYD">
<option value="">请选择</option>
<!--${resourcesApplicationCourse.courseLabelType =='实务课程类'?'selected':''}-->
<option value="xxx">xxx</option>
<option value="ccc">ccc</option>
<option value="ddc">ddd</option>
</select>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-form-item">
<label class="layui-form-label"><span class="req">*</span>绑定应用:</label>
<div class="layui-input-inline">
<layui:simpleDictSelect style='1' type="application_name"
id="resourcesApplicationId" value="" name="resourcesApplicationId"/>
</div>
</div>
</div>
<layui:submitButtons id="addButton" buttonType="" />
<input type="hidden" name="resourcesApplicationCourseId"
value=${resourcesApplicationCourse.resourcesApplicationCourseId}/>
</form>
<!--#} -->
<script>
layui.use(['add'], function(){
var resourcesApplicationCourseAdd = layui.add
resourcesApplicationCourseAdd.init();
});
layui.use(['add'], function () {
var resourcesApplicationCourseAdd = layui.add
resourcesApplicationCourseAdd.init();
});
</script>

@ -19,6 +19,19 @@
<table id="universitySystemTable" lay-filter="universitySystemTable"></table>
<!--#} -->
<script type="text/html" id="toolbar_universitySystem">
<div class="layui-btn-container">
<div class="layui-btn-group" >
<layui:accessButton function="universitySystem.add" action="add"><i class="layui-icon">&#xe61f;</i>添加</layui:accessButton>
<!--<layui:accessButton function="universitySystem.edit" action="edit">修改</layui:accessButton>
<layui:accessButton function="universitySystem.del" action="del">删除</layui:accessButton>-->
<layui:accessButton function="universitySystem.query" action="refresh"><i class="layui-icon">&#xe669;</i>刷新</layui:accessButton>
</div>
</div>
</script>
<script>
layui.use(['index'], function(){

Loading…
Cancel
Save