|
|
|
@ -6,6 +6,18 @@
|
|
|
|
|
.layui-form-label {
|
|
|
|
|
width: 100px;
|
|
|
|
|
}
|
|
|
|
|
.layui-table-body, .layui-table-box, .layui-table-cell{
|
|
|
|
|
overflow:visible;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*td .layui-form-select {
|
|
|
|
|
margin-top: -10px;
|
|
|
|
|
margin-left: -15px;
|
|
|
|
|
margin-right: -15px;
|
|
|
|
|
}
|
|
|
|
|
.layui-form-select dl {
|
|
|
|
|
text-align: left;
|
|
|
|
|
}*/
|
|
|
|
|
</style>
|
|
|
|
|
<form class="layui-form" id="addForm">
|
|
|
|
|
<div class="layui-row" style="margin-left: 40px;">
|
|
|
|
@ -45,9 +57,10 @@
|
|
|
|
|
<div class="layui-input-inline">
|
|
|
|
|
<input style="display:none;" type="text" name="schoolClassIds"
|
|
|
|
|
value="${teacherOpenCourseScheduleSession.schoolClassIds}" class="layui-input">
|
|
|
|
|
<layui:simpleDictSelect style='layui-input-inline'
|
|
|
|
|
<div id="demo1" style="width: 300px"></div>
|
|
|
|
|
<!--<layui:simpleDictSelect style='layui-input-inline'
|
|
|
|
|
type="school_class.class_name.class_status=1,"
|
|
|
|
|
id="schoolClassIds" name="schoolClassIds"/>
|
|
|
|
|
id="schoolClassIds" name="schoolClassIds"/>-->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -159,18 +172,46 @@
|
|
|
|
|
<input type="hidden" name="teacherOpenCourseScheduleSessionId" value="${teacherOpenCourseScheduleSession.teacherOpenCourseScheduleSessionId}" />
|
|
|
|
|
|
|
|
|
|
</form>
|
|
|
|
|
<script type="text/html" id="select_resourcesApplicationIds" >
|
|
|
|
|
<layui:simpleDictSelect style='layui-input-inline' layFilter="select_"
|
|
|
|
|
type="teacher_open_course_schedule_session_class.teacher_open_course_schedule_session_class_name.1=1"
|
|
|
|
|
id="teacherOpenCourseScheduleSessionClassId" name="teacherOpenCourseScheduleSessionClassId"/>
|
|
|
|
|
</script>
|
|
|
|
|
<!--#} -->
|
|
|
|
|
<script>
|
|
|
|
|
layui.use(['add', 'table', 'laydate'], function () {
|
|
|
|
|
layui.use(['add', 'table', 'laydate','xmSelect','form'], function () {
|
|
|
|
|
var teacherOpenCourseScheduleSessionAdd = layui.add,
|
|
|
|
|
laydate = layui.laydate,
|
|
|
|
|
table = layui.table;
|
|
|
|
|
table.render({
|
|
|
|
|
table = layui.table,
|
|
|
|
|
form = layui.form,
|
|
|
|
|
xmSelect = layui.xmSelect;
|
|
|
|
|
var teacherOpenCourseScheduleSessionId = $("input[name='teacherOpenCourseScheduleSessionId']").val();
|
|
|
|
|
var kkJieciTableData = [];
|
|
|
|
|
|
|
|
|
|
var demo1 = xmSelect.render({
|
|
|
|
|
el: '#demo1',
|
|
|
|
|
data: [
|
|
|
|
|
{name: '水果', value: 1,selected:false},
|
|
|
|
|
{name: '蔬菜', value: 2,selected:false},
|
|
|
|
|
{name: '桌子', value: 3,selected:false},
|
|
|
|
|
{name: '北京', value: 4,selected:false},
|
|
|
|
|
],
|
|
|
|
|
});
|
|
|
|
|
form.render();//刷新表单
|
|
|
|
|
if($.isEmpty(teacherOpenCourseScheduleSessionId)){
|
|
|
|
|
kkJieciTableData = Common.getAjax('/jlw/teacherOpenCourseScheduleSessionTag/getValues.json').data;
|
|
|
|
|
kkJieciTableData.forEach(function (item,index) {
|
|
|
|
|
item.teacherOpenCourseScheduleSessionClassName = '';
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
var kkJieciTabel = table.render({
|
|
|
|
|
elem: '#kkJieciTable',
|
|
|
|
|
height: Lib.getTableHeight(1),
|
|
|
|
|
cellMinWidth: 100,
|
|
|
|
|
method: 'post',
|
|
|
|
|
url: Common.ctxPath + '/jlw/teacherOpenCourseScheduleSession/listGroup.json' // 数据接口
|
|
|
|
|
/*height: Lib.getTableHeight(1),
|
|
|
|
|
cellMinWidth: 100,*/
|
|
|
|
|
method: 'get',
|
|
|
|
|
data: kkJieciTableData
|
|
|
|
|
, limit: 10000,
|
|
|
|
|
page: false
|
|
|
|
|
, cols: [[
|
|
|
|
|
{
|
|
|
|
|
type: 'checkbox',
|
|
|
|
@ -179,24 +220,35 @@
|
|
|
|
|
{
|
|
|
|
|
field: 'teacherOpenCourseScheduleSessionTagName',
|
|
|
|
|
title: '课次',
|
|
|
|
|
align: "center"
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'teacherOpenCourseScheduleSessionTagStartTime',
|
|
|
|
|
title: '开始时间',
|
|
|
|
|
align: "center"
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'teacherOpenCourseScheduleSessionTagEndTime',
|
|
|
|
|
title: '结束时间',
|
|
|
|
|
align: "center"
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'teacherOpenCourseScheduleSessionClassName',
|
|
|
|
|
title: '上课教室',
|
|
|
|
|
align: "center"
|
|
|
|
|
width: 200,
|
|
|
|
|
align: "center",
|
|
|
|
|
templet: function (d) {
|
|
|
|
|
// html字符串转对象,深拷贝操作,相当于每行copy一个下拉框进行回显选中操作
|
|
|
|
|
var copyHtml = $($('#select_resourcesApplicationIds').html());
|
|
|
|
|
// 兼容之前的一对多关系
|
|
|
|
|
|
|
|
|
|
return copyHtml.html();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
]],
|
|
|
|
|
|
|
|
|
|
]], done: function (res, curr, count) {
|
|
|
|
|
merge(res);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
laydate.render({
|
|
|
|
@ -204,6 +256,39 @@
|
|
|
|
|
,type: 'datetime'
|
|
|
|
|
,range: true
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function merge(res) {
|
|
|
|
|
var data = res.data;
|
|
|
|
|
var mergeIndex = 0; //定位需要添加合并属性的行数
|
|
|
|
|
var mark = 1; //每次需要合并的行数
|
|
|
|
|
var columsName = ['teacherOpenCourseScheduleSessionClassName']; //合并列名称
|
|
|
|
|
var columsIndex = [4]; //合并列索引值
|
|
|
|
|
|
|
|
|
|
for (var k = 0; k < columsName.length; k++) { //循环所有要合并的列
|
|
|
|
|
var trArr = $(".layui-table-body>.layui-table").find("tr");//所有行
|
|
|
|
|
|
|
|
|
|
for (var i = 1; i < res.data.length; i++) { //循环表格数据
|
|
|
|
|
var tdCurArr = trArr.eq(i).find("td").eq(columsIndex[k]);//获取当前行的当前列
|
|
|
|
|
var tdPreArr = trArr.eq(mergeIndex).find("td").eq(columsIndex[k]);//获取相同列的第一列
|
|
|
|
|
if (data[i][columsName[k]] === data[i - 1][columsName[k]]) { //后一行与前一行做比较,相同合并
|
|
|
|
|
mark += 1;
|
|
|
|
|
tdPreArr.each(function () {//相同列的第一列增加rowspan属性
|
|
|
|
|
$(this).attr("rowspan", mark);
|
|
|
|
|
});
|
|
|
|
|
tdCurArr.each(function () {//当前行隐藏
|
|
|
|
|
$(this).css("display", "none");
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
mergeIndex = i;
|
|
|
|
|
mark = 1;//一旦前后两行的值不一样了,那么需要合并的格子数mark就需要重新计算
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
mergeIndex = 0;
|
|
|
|
|
mark = 1;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
teacherOpenCourseScheduleSessionAdd.init();
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|