@@ -4,13 +4,14 @@ var bootstrap = function ($, learun) {
var endTime = '2022-01-23';
var classNo;
var curWeek;
var weekList;
var page = {
init: function () {
page.bind();
page.bindSelect();
},
loadData: function (param) {
$.lrSetFormWithParam(top.$.rootUrl + '/PersonnelManagement/TimeTable /GetDataInEducation', param,
$.lrSetFormWithParam(top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm /GetDataInEducation', param,
function (data) {
console.log('res', data);
// 数据处理
@@ -19,7 +20,6 @@ var bootstrap = function ($, learun) {
//十节课
for (var i = 1; i < 11; i++) {
(function (arg) {
//console.log('arg', arg);
var args = arg - 1;
var datas = flogs(arg, weekLists, 'time');
//console.log('datas', datas);
@@ -63,7 +63,7 @@ var bootstrap = function ($, learun) {
function tdHandle() {
var html = '';
for (var j = 0; j < 10; j++) {
html += '<td><div></div><div></div><div></div><div></div></td>';
html += '<td class="active" id="" num="' + j + '" ><div></div><div></div><div></div><div></div></td>';
}
return html;
}
@@ -76,28 +76,37 @@ var bootstrap = function ($, learun) {
var args = arg - 1;
var datas = flogs2(arg, lists, 'day');
if (datas.length > 0) {
html += '<td class="active">';
html += '<td class="active" id="' + datas[0].ALTId + '" num="' + k + '" >';
$.each(datas, function (i, item) {
if (i > 0) {
html += '<hr>';
}
html += '<div>课程: ' +
html += '<div>' +
item.curriculum +
'</div>' +
'<div>教师: ' +
'<div>' +
item.teacher +
'</div>' +
'<div>班级:' +
item.className +
'</div>' +
'<div>教室:' +
'<div>' +
item.classRoom +
'</div>';
//html += '<div>课程:' +
// item.curriculum +
// '</div>' +
// '<div>教师:' +
// item.teacher +
// '</div>' +
// '<div>班级:' +
// item.className +
// '</div>' +
// '<div>教室:' +
// item.classRoom +
// '</div>';
});
html += '</td>';
} else {
html += '<td><div></div><div></div><div></div><div></div></td>';
html += '<td class="active" id="" num="' + k + '" ><div></div><div></div><div></div><div></div></td>';
}
})(k);
@@ -120,31 +129,53 @@ var bootstrap = function ($, learun) {
//获取周次
learun.httpAsyncGet(top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm/GetWeekTime', function (res) {
if (res.code == 200) {
weekList = res.data.weekList;
$('#WeekTimes').lrRadioCheckbox({
type: 'radio',
data: res.data.weekList,
//data: [{ text: '分析清晰', value: '1' }, { text: '需要改进', value: '2' }]
select: function(item) {
console.log(item);
}
});
curWeek = res.data.curWeek;
if (!$('#WeekTimes').find('input[value="' + res.data.curWeek + '"]').is(":checked")) {
$('#WeekTimes').find('input[value="' + res.data.curWeek + '"]').trigger('click');
}
//周次
$('#WeekTimeSelect').lrselect({
placeholder: "请选择周次",
maxHeight: 300,
allowSearch: true,
type: 'multiple',
data: res.data.weekList
});
}
});
$('#WeekTimes').change(function() {
//切换周次
$('#WeekTimes').change(function () {
curWeek = $('#WeekTimes input[name="WeekTimes"]:checked ').val();
page.search();
});
//单元格选中事件
$("#lessonTermTable").on('click', '.active', function () {
console.log('选中!');
//undefined
//console.log($(this).attr('id'));
//console.log('当前周', curWeek);
//第几节
//console.log('节次', $(this).closest("tr").find("td:eq(0)").text());
//星期几
//console.log('星期', $(this).attr('num'));
$('#WeekTimeSelect').lrselectSet('1');
$('#WeekSelect').lrselectSet('2');
$('#NodeSelect').lrselectSet(($(this).closest("tr").find("td:eq(0)").text()).replace('节', ''));
});
// 刷新
$('#lr_refresh').on('click', function () {
location.reload();
});
//查询
//$('#lr_search').on('click', function () {
// var p = {};
@@ -183,82 +214,66 @@ var bootstrap = function ($, learun) {
}
},
bindSelect: function () {
////校区
//$('#F_SchoolId').lrDataSourceSelect({
// code: 'company', value: 'f_companyid', text: 'f_fullname', select: function (item) {
// if (!!item) {
// // 班级
// $('#ClassNo').lrselectRefresh({
// placeholder: "请选择班级",
// allowSearch: true,
// url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetClassData',
// param: { schoolId: item.f_companyid },
// value: 'value',
// text: 'text'
// });
// // 教师
// $('#EmpNo').lrselectRefresh({
// placeholder: "请选择教师",
// allowSearch: true,
// url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetTeacherData',
// param: { schoolId: item.f_companyid },
// value: 'value',
// text: 'text'
// });
// } else {
// //班级
// $('#ClassNo').lrselectRefresh({
// placeholder: "请选择班级",
// allowSearch: true,
// url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetClassData',
// param: { schoolId: "" },
// value: 'value',
// text: 'text'
// });
// //教师
// $('#EmpNo').lrselectRefresh({
// placeholder: "请选择教师",
// allowSearch: true,
// url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetTeacherData',
// param: { schoolId: "" },
// value: 'value',
// text: 'text'
// });
// }
// }
//});
////班级
//$('#ClassNo').lrselect({
// placeholder: "请选择班级",
// allowSearch: true,
// url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetClassData',
// value: 'value',
// text: 'text'
//});
//教师
$('#EmpNo').lrselect({
placeholder: "请选择教师",
//课程
$('#LessonInfo').lrDataSourceSelect({
// 展开最大高度
maxHeight: '100px',
placeholder: "请选择课程",
allowSearch: true,
url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetTeacherData ',
value: 'va lu e',
text: 'text '
code: 'LessonInfo',
value: 'lessonno',
text: 'lessonname'
});
//教师
$('#EmpNo1').lrs elect({
$('#EmpInfo').lrDataSourceSelect({
placeholder: "请选择教师",
maxHeight: 300,
allowSearch: true,
code: 'EmpInfo',
value: 'empno',
text: 'empname'
});
//教室
$('#ClassroomInfo').lrDataSourceSelect({
placeholder: "请选择教室",
maxHeight: 300,
allowSearch: true,
code: 'ClassroomInfo',
value: 'classroomno',
text: 'classroomname'
});
////周次
//$('#WeekTimeSelect').lrselect({
// placeholder: "请选择周次",
// maxHeight: 300,
// allowSearch: true,
// type:'multiple',
// data: weekList
//});
//星期
$('#WeekSelect').lrselect({
placeholder: "请选择星期",
maxHeight: 300,
allowSearch: true,
//type: 'multiple',
data: [{ text: '星期一', value: '1' }, { text: '星期二', value: '2' }, { text: '星期三', value: '3' }, { text: '星期四', value: '4' }, { text: '星期五', value: '5' }, { text: '星期六', value: '6' }, { text: '星期日', value: '7' }, { text: '星期八', value: '8' }, { text: '星期九', value: '9' }, { text: '星期十', value: '10' }]
});
//节次
$('#NodeSelect').lrselect({
placeholder: "请选择节次",
maxHeight: 300,
allowSearch: true,
url: top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm/GetWeekTime',
value: 'value',
text: 'text'
//type: 'multiple',
data: [{ text: '1节', value: '1' }, { text: '2节', value: '2' }, { text: '3节', value: '3' }, { text: '4节', value: '4' }, { text: '5节', value: '5' }, { text: '6节', value: '6' }, { text: '7节', value: '7' }, { text: '8节', value: '8' }, { text: '9节', value: '9' }, { text: '10节', value: '10' }]
});
$('#NodeSelect').lrselectSet(5);
},
search: function (param) {
param = param || {};
//当前第几周
param.curWeek = curWeek;
//班级
param.classNo = classNo;
param.classNo = '202010';// classNo;
page.loadData(param);
}
};