@ -10,6 +10,7 @@ layui.define(['laydate', 'form', 'laydate', 'table','generalQuestionSettingApi',
var classData = Common . getAjax ( '/jlw/schoolClass/getValues.json' ) . data ; //上课班级多选框data
var xmSeValue = $ ( "#generalQuestionSettingSchoolClassIds" ) . data ( 'value' ) ;
var courseInfoIds = '' ;
var xmSeInitValue = [ ] ;
if ( ! $ . isEmpty ( xmSeValue ) ) {
@ -53,20 +54,32 @@ layui.define(['laydate', 'form', 'laydate', 'table','generalQuestionSettingApi',
} ) ;
$ ( '#manualProblemSetting' ) . click ( function ( ) { //手动出题
courseInfoIds = $ ( "#courseInfoIds" ) . find ( "option:selected" ) . val ( ) ;
if ( $ . isEmpty ( courseInfoIds ) ) {
Common . info ( "请选择需要设置的课程" ) ;
return ;
}
layer . open ( {
type : 1 ,
title : '在线调试'
type : 1
, title : '选择题库 '
, offset : [ '100px' , '150px' ]
, content : '<table id="resourcesQuestionTable" lay-filter="resourcesQuestionTable"></table>'
, shadeClose : true
, scrollbar : false
, content : $ ( "#resourcesQuestionTable_demo" )
, btn : [ '保存' , '关闭' ]
, success : function ( ) {
resourcesQuestionTable ( ) ;
}
, yes : function ( ) {
, yes : function ( index , layero ) {
layer . close ( index ) ;
$ ( '#resourcesQuestionTable_demo' ) . hide ( ) ;
}
, btn2 : function ( index , layero ) {
$ ( '#resourcesQuestionTable_demo' ) . hide ( ) ;
layer . close ( index ) ;
}
, btn2 : function ( ) {
, end : function ( ) {
$ ( '#resourcesQuestionTable_demo' ) . hide ( ) ;
}
} ) ;
} ) ;
@ -76,6 +89,7 @@ layui.define(['laydate', 'form', 'laydate', 'table','generalQuestionSettingApi',
var view = {
init : function ( ) {
this . initTable ( ) ;
this . initSearchForm ( ) ;
Lib . initGenrealForm ( $ ( "#addForm" ) , form ) ;
this . initSubmit ( ) ;
} ,
@ -84,8 +98,9 @@ layui.define(['laydate', 'form', 'laydate', 'table','generalQuestionSettingApi',
elem : '#questionTypeGroupInfoTable' ,
cellMinWidth : 100 ,
method : 'post' ,
url : Common . ctxPath + '/jlw/resourcesQuestion/questionTypeGroupInfo.json?courseInfoId=1232' // 数据接口
//, page: Lib.tablePage // 开启分页
url : Common . ctxPath + '/jlw/resourcesQuestion/questionTypeGroupInfo.json' // 数据接口
, limit : Number . MAX _VALUE
, page : false
/*,toolbar: '#toolbar_generalQuestionSetting' / / 自定义头部左侧工具栏
, defaultToolbar : [ 'filter' , 'print' , 'exports' ] //头部右侧工具栏*/
//, limit: 10,
@ -103,9 +118,6 @@ layui.define(['laydate', 'form', 'laydate', 'table','generalQuestionSettingApi',
field : 'totalCount' ,
title : '总数量' ,
align : "center" ,
temple : function ( d ) {
console . log ( d )
}
} ,
{
field : 'questionNum' ,
@ -137,7 +149,8 @@ layui.define(['laydate', 'form', 'laydate', 'table','generalQuestionSettingApi',
size : "sms" ,
url : Common . ctxPath + '/jlw/resourcesQuestion/list.json' // 数据接口
, page : Lib . tablePage // 开启分页
, limit : 4 ,
, limit : 4
, where : { "courseInfoId" : courseInfoIds } ,
cols : [ [ // 表头
{
type : 'checkbox' , align : "center"
@ -159,19 +172,26 @@ layui.define(['laydate', 'form', 'laydate', 'table','generalQuestionSettingApi',
{
field : 'courseInfoName' ,
title : '归属章节' , align : "center"
} ,
{
field : 'userId' , title : '操作' , align : "center" , width : 220 , templet : function ( d ) {
// TODO 上下架前端逻辑待开发
return '<a class="layui-table-link" lay-event="del">查看</a>' ;
}
}
] ]
} ) ;
}
} ,
initSearchForm : function ( ) {
/ * v a r b t n = $ ( " # s e a r c h F o r m " ) ;
btn . on ( 'click' , function ( ) {
questionTypeGroupInfoTable . reload ( {
where : { "courseId" : $ ( "#courseInfoIds" ) . find ( "option:selected" ) . val ( ) } ,
} ) ;
} ) ; * /
form . on ( 'select(select_courseInfoIds)' , function ( data ) {
courseInfoIds = data . value ;
questionTypeGroupInfoTable . reload ( {
where : { "courseId" : data . value } ,
} ) ;
} ) ;
} ,
initSubmit : function ( ) {
$ ( "#addButton" ) . click ( function ( ) {
form . on ( 'submit(form)' , function ( ) {