@ -29,7 +29,7 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
} ,
{
field : 'resourcesCompetitionName' ,
title : ' 竞赛案例名称', align : "center"
title : ' 编程 竞赛案例名称', align : "center"
} ,
{
field : 'courseInfoParentName' ,
@ -39,11 +39,21 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
field : 'courseInfoName' ,
title : '归属章节' , align : "center"
} ,
{
field : 'questionStatus' , width : 80 ,
title : '状态' , align : "center" , templet : function ( d ) {
return d . questionStatus === '1'
? '<span class="layui-badge layui-bg-green" style="background-color: #abd5ff !important; color: #088eed!important">已上架</span>'
: '<span class="layui-badge layui-bg-gray" style="background-color: #dadada !important; color: #6c6c6c!important">已下架</span>'
}
} ,
{
field : 'userId' , 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="editStep">添加步骤</button></a>' ;
htm += '<button type="button" class="layui-btn layui-btn-xs" lay-event="del">删除</button></a>' ;
var htm = '<a class="layui-table-link" lay-event="up" data-item="${JSON.stringify(d)}" >上架</a>' ;
htm += '<a class="layui-table-link" lay-event="down" data-item="${JSON.stringify(d)}" style="color: #bebebe!important">下架</a>' ;
htm += '<a class="layui-table-link" lay-event="edit">编辑</a>' ;
htm += '<a class="layui-table-link" lay-event="editStep">添加步骤</a>' ;
htm += '<a class="layui-table-link" lay-event="del">删除</a>' ;
return htm ;
}
}
@ -69,7 +79,7 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
toolbar = {
add : function ( ) { // 获取选中数据
var url = "/jlw/resourcesCompetition/add.do" ;
Common . openDlg ( url , " 竞赛案例管理/新增竞赛案例") ;
Common . openDlg ( url , " 编程 竞赛案例管理/新增竞赛案例") ;
} ,
refresh : function ( ) { //刷新
searchForm . reset ( ) ;
@ -87,10 +97,10 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
var data = obj . data ;
if ( obj . event === 'edit' ) {
var url = "/jlw/resourcesCompetition/add.do?resourcesCompetitionId=" + data . resourcesCompetitionId ;
Common . openDlg ( url , " 竞赛案例管理/编辑竞赛案例") ;
Common . openDlg ( url , " 编程 竞赛案例管理/编辑竞赛案例") ;
} else if ( obj . event === 'editStep' ) {
var url = "/jlw/resourcesCompetition/add.do?resourcesCompetitionId=" + data . resourcesCompetitionId + "&sign=1" ;
Common . openDlg ( url , " 竞赛案例管理/编辑竞赛案例") ;
Common . openDlg ( url , " 编程 竞赛案例管理/编辑竞赛案例") ;
} else if ( obj . event === "del" ) {
layer . confirm ( '是否确定删除该信息?' , function ( index ) {
var ret = Common . postAjax ( "/jlw/resourcesCompetition/delete.json" , { ids : data . resourcesCompetitionId } ) ;
@ -107,9 +117,22 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
} else if ( obj . event === "addStep" ) { //添加步骤
var url = "/jlw/resourcesCompetitionStep/add.do?resourcesCompetitionId=" + data . resourcesCompetitionId ;
Common . openDlg ( url , "" ) ;
} else if ( obj . event === "up" ) {
alert ( 'up' )
} else if ( obj . event === "down" ) {
alert ( 'down' )
}
} )
}
} ;
//选择归属课程 并且根据选择的课程查询章节 resourcesQuestionIdsIsNotNull:查询题目不为空的章节
form . on ( 'select(select_courseInfoIds)' , function ( obj ) {
Lib . getCourseInfo ( $ ( "select[name='courseInfoId_1']" ) , obj . value , 1 ) ;
} ) ;
//选择归属课程 并且根据选择的课程查询章节
form . on ( 'select(select_courseInfoIds_)' , function ( obj ) {
Lib . getCourseInfo ( $ ( "select[name='courseInfoId_2']" ) , obj . value ) ;
} ) ;
exports ( 'index' , view ) ;
} ) ;