|
|
@@ -1,53 +1,69 @@ |
|
|
|
(function () { |
|
|
|
var multipleData = null; |
|
|
|
var page = { |
|
|
|
grid: null, |
|
|
|
init: function ($page) { |
|
|
|
page.grid = $page.find('#lr_ArrangeExamTerm_list').lrpagination({ |
|
|
|
lclass: page.lclass, |
|
|
|
rows: 10, // 每页行数 |
|
|
|
getData: function (param, callback) {// 获取数据 param 分页参数,callback 异步回调 |
|
|
|
param.multipleData = multipleData; |
|
|
|
page.loadData(param, callback, $page); |
|
|
|
}, |
|
|
|
renderData: function (_index, _item, _$item) {// 渲染数据模板 |
|
|
|
return page.rowRender(_index, _item, _$item, $page); |
|
|
|
}, |
|
|
|
}); |
|
|
|
}, |
|
|
|
lclass: 'lr-list', |
|
|
|
loadData: function (param, callback, $page) {// 列表加载后台数据 |
|
|
|
var _postParam = { |
|
|
|
pagination: { |
|
|
|
rows: param.rows, |
|
|
|
page: param.page |
|
|
|
}, |
|
|
|
queryJson: '{}' |
|
|
|
}; |
|
|
|
if (param.multipleData) { |
|
|
|
_postParam.queryJson = JSON.stringify(multipleData); |
|
|
|
} |
|
|
|
learun.httpget(config.webapi + '/learun/ask/testlist', _postParam, (data) => { |
|
|
|
$page.find('.lr-badge').text('0'); |
|
|
|
if (data) { |
|
|
|
$page.find('.lr-badge').text(data.records); |
|
|
|
callback(data.rows, parseInt(data.records)); |
|
|
|
} |
|
|
|
else { |
|
|
|
callback([], 2); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
rowRender: function (_index, _item, _$item, $page) {// 渲染列表行数据 |
|
|
|
_$item.addClass('lr-list-item lr-list-item-multi'); |
|
|
|
_$item.append($('<p class="lr-ellipsis"><span>考试日期:</span></p>').dataFormatter({ value: _item.ExamDate })); |
|
|
|
_$item.append($('<p class="lr-ellipsis"><span>考试时间:</span></p>').dataFormatter({ value: _item.ExamTime })); |
|
|
|
_$item.append($('<p class="lr-ellipsis"><span>课程编码:</span></p>').dataFormatter({ value: _item.LessonNo })); |
|
|
|
_$item.append($('<p class="lr-ellipsis"><span>课程名称:</span></p>').dataFormatter({ value: _item.LessonName })); |
|
|
|
_$item.append($('<p class="lr-ellipsis"><span>教室编码:</span></p>').dataFormatter({ value: _item.ClassRoomNo })); |
|
|
|
_$item.append($('<p class="lr-ellipsis"><span>教室名称:</span></p>').dataFormatter({ value: _item.ClassRoomName })); |
|
|
|
return ''; |
|
|
|
}, |
|
|
|
}; |
|
|
|
return page; |
|
|
|
})(); |
|
|
|
(function() { |
|
|
|
var multipleData = null; |
|
|
|
var page = { |
|
|
|
grid: null, |
|
|
|
init: function($page) { |
|
|
|
page.grid = $page.find('#lr_ArrangeExamTerm_list').lrpagination({ |
|
|
|
lclass: page.lclass, |
|
|
|
rows: 10, // 每页行数 |
|
|
|
getData: function(param, callback) { // 获取数据 param 分页参数,callback 异步回调 |
|
|
|
param.multipleData = multipleData; |
|
|
|
page.loadData(param, callback, $page); |
|
|
|
}, |
|
|
|
renderData: function(_index, _item, _$item) { // 渲染数据模板 |
|
|
|
return page.rowRender(_index, _item, _$item, $page); |
|
|
|
}, |
|
|
|
}); |
|
|
|
}, |
|
|
|
lclass: 'lr-list', |
|
|
|
loadData: function(param, callback, $page) { // 列表加载后台数据 |
|
|
|
var _postParam = { |
|
|
|
pagination: { |
|
|
|
rows: param.rows, |
|
|
|
page: param.page, |
|
|
|
sidx: 'ExamDate', |
|
|
|
sord: 'asc', |
|
|
|
}, |
|
|
|
queryJson: '{}' |
|
|
|
}; |
|
|
|
if (param.multipleData) { |
|
|
|
_postParam.queryJson = JSON.stringify(multipleData); |
|
|
|
} |
|
|
|
|
|
|
|
var baseUser = JSON.parse(localStorage.userinfo); |
|
|
|
_postParam.queryJson = JSON.stringify({ EmpNo: baseUser.baseinfo.account }); |
|
|
|
learun.httpget(config.webapi + '/learun/ask/testlist', _postParam, (data) => { |
|
|
|
$page.find('.lr-badge').text('0'); |
|
|
|
if (data) { |
|
|
|
$page.find('.lr-badge').text(data.records); |
|
|
|
callback(data.rows, parseInt(data.records)); |
|
|
|
} else { |
|
|
|
callback([], 2); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
rowRender: function(_index, _item, _$item, $page) { // 渲染列表行数据 |
|
|
|
_$item.addClass('lr-list-item lr-list-item-multi'); |
|
|
|
_$item.append($('<p class="lr-ellipsis"><span>考试日期:</span></p>').dataFormatter({ |
|
|
|
value: _item.ExamDate |
|
|
|
})); |
|
|
|
_$item.append($('<p class="lr-ellipsis"><span>考试时间:</span></p>').dataFormatter({ |
|
|
|
value: _item.ExamTime |
|
|
|
})); |
|
|
|
_$item.append($('<p class="lr-ellipsis"><span>课程编码:</span></p>').dataFormatter({ |
|
|
|
value: _item.LessonNo |
|
|
|
})); |
|
|
|
_$item.append($('<p class="lr-ellipsis"><span>课程名称:</span></p>').dataFormatter({ |
|
|
|
value: _item.LessonName |
|
|
|
})); |
|
|
|
_$item.append($('<p class="lr-ellipsis"><span>教室编码:</span></p>').dataFormatter({ |
|
|
|
value: _item.ClassRoomNo |
|
|
|
})); |
|
|
|
_$item.append($('<p class="lr-ellipsis"><span>教室名称:</span></p>').dataFormatter({ |
|
|
|
value: _item.ClassRoomName |
|
|
|
})); |
|
|
|
return ''; |
|
|
|
}, |
|
|
|
}; |
|
|
|
return page; |
|
|
|
})(); |