From c3af16f71461c90c979a729c522c6921c6fab52c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E4=B8=B9ab?= <1421553879@qq.com> Date: Sun, 23 Apr 2023 17:01:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../teacherOpenCourseScheduleSession/add.js | 2 +- .../teacherOpenCourseScheduleSession/index.js | 134 +++++++++++------- .../templates/jlw/schoolClass/add.html | 60 ++++---- .../resources/templates/jlw/teacher/add.html | 31 ++-- 4 files changed, 129 insertions(+), 98 deletions(-) diff --git a/web/src/main/resources/static/js/jlw/teacherOpenCourseScheduleSession/add.js b/web/src/main/resources/static/js/jlw/teacherOpenCourseScheduleSession/add.js index 039091d6..58801dd3 100644 --- a/web/src/main/resources/static/js/jlw/teacherOpenCourseScheduleSession/add.js +++ b/web/src/main/resources/static/js/jlw/teacherOpenCourseScheduleSession/add.js @@ -422,7 +422,7 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule layer.msg('排课标题未填写!!', {icon: 5}); return; } - console.log($.isEmpty(teacherOpenCourseId)) + if ($.isEmpty(teacherOpenCourseId)) { layer.msg('开课未选!!', {icon: 5}); return; diff --git a/web/src/main/resources/static/js/jlw/teacherOpenCourseScheduleSession/index.js b/web/src/main/resources/static/js/jlw/teacherOpenCourseScheduleSession/index.js index 3c3a6b69..49ac676c 100644 --- a/web/src/main/resources/static/js/jlw/teacherOpenCourseScheduleSession/index.js +++ b/web/src/main/resources/static/js/jlw/teacherOpenCourseScheduleSession/index.js @@ -1,48 +1,61 @@ -layui.define([ 'form', 'laydate', 'table' ,'laytpl'], function(exports) { +layui.define(['form', 'laydate', 'table', 'laytpl'], function (exports) { var form = layui.form; var laydate = layui.laydate; var table = layui.table; var laytpl = layui.laytpl; var teacherOpenCourseScheduleSessionTable = null; - var view ={ - init:function(){ + var view = { + init: function () { var that = this this.initTable(); this.initSearchForm(); this.initToolBar(); - window.dataReload = function(){ - Lib.doSearchForm($("#searchForm"),teacherOpenCourseScheduleSessionTable) + window.dataReload = function () { + Lib.doSearchForm($("#searchForm"), teacherOpenCourseScheduleSessionTable) that.initToolBar(); } }, - initTable:function(){ - var sx_ = localStorage.getItem("teacherOpenCourseScheduleSessionTable_field_"+Common.userInfoId); //筛选值显示、隐藏缓存 - if($.isEmpty(sx_)){sx_ = {};}else {sx_ = JSON.parse(sx_);} + initTable: function () { + var sx_ = localStorage.getItem("teacherOpenCourseScheduleSessionTable_field_" + Common.userInfoId); //筛选值显示、隐藏缓存 + if ($.isEmpty(sx_)) { + sx_ = {}; + } else { + sx_ = JSON.parse(sx_); + } teacherOpenCourseScheduleSessionTable = table.render({ - elem : '#teacherOpenCourseScheduleSessionTable', - height : Lib.getTableHeight(1), + elem: '#teacherOpenCourseScheduleSessionTable', + height: Lib.getTableHeight(1), cellMinWidth: 100, - method : 'post', + method: 'post', // url : Common.ctxPath + '/jlw/teacherOpenCourseScheduleSession/list.json' // 数据接口 - url : Common.ctxPath + '/jlw/teacherOpenCourseScheduleSession/listGroup.json' // 数据接口 - ,page : Lib.tablePage // 开启分页 + url: Common.ctxPath + '/jlw/teacherOpenCourseScheduleSession/listGroup.json' // 数据接口 + , page: Lib.tablePage // 开启分页 /*,toolbar: '#toolbar_teacherOpenCourseScheduleSession' //自定义头部左侧工具栏 ,defaultToolbar: ['filter', 'print', 'exports'] //头部右侧工具栏*/ - ,limit : 10, - cols : [ [ // 表头 + , limit: 10, + cols: [[ // 表头 { field: 'scheduleSessionTitle', title: '排课标题', align: "center", hideField: false, - hide:$.isEmpty(sx_['scheduleSessionTitle'])?false:sx_['scheduleSessionTitle'], + hide: $.isEmpty(sx_['scheduleSessionTitle']) ? false : sx_['scheduleSessionTitle'], }, { field: 'teacherOpenCourseIdText', title: '开课名称', align: "center", hideField: false, - hide:$.isEmpty(sx_['teacherOpenCourseIdText'])?false:sx_['teacherOpenCourseIdText'], + hide: $.isEmpty(sx_['teacherOpenCourseIdText']) ? false : sx_['teacherOpenCourseIdText'], + templet: function (d) { + var value; + if ($.isEmpty(d.teacherOpenCourseIdText)) { + value = d.courseInfoIdText; + }else { + value = d.teacherOpenCourseIdText; + } + return value; + } }, { field: 'teacherIdText', @@ -68,7 +81,7 @@ layui.define([ 'form', 'laydate', 'table' ,'laytpl'], function(exports) { align: "center", hideField: false, hide: $.isEmpty(sx_['look']) ? false : sx_['look'], - templet:function (d) { + templet: function (d) { return "查看" } }, @@ -101,13 +114,18 @@ layui.define([ 'form', 'laydate', 'table' ,'laytpl'], function(exports) { align: "center", hideField: false, hide: $.isEmpty(sx_['teacherOpenCourseScheduleSessionStatusText']) ? false : sx_['teacherOpenCourseScheduleSessionStatusText'], - templet:function (d) { + templet: function (d) { var css = d.teacherOpenCourseScheduleSessionStatus == 2 ? "textType2" : 'textType'; - return '' +d.teacherOpenCourseScheduleSessionStatusText + '' + return '' + d.teacherOpenCourseScheduleSessionStatusText + '' } }, { - field : 'userId',title : '操作',align:"center",width:200,fixed:'right', templet: function (d) { + field: 'userId', + title: '操作', + align: "center", + width: 200, + fixed: 'right', + templet: function (d) { var htm = '编辑'; htm += '启用'; htm += '禁用'; @@ -115,26 +133,26 @@ layui.define([ 'form', 'laydate', 'table' ,'laytpl'], function(exports) { return htm; } } - ] ] + ]] - }); + }); - table.on('checkbox(teacherOpenCourseScheduleSessionTable)', function(obj){ + table.on('checkbox(teacherOpenCourseScheduleSessionTable)', function (obj) { var teacherOpenCourseScheduleSession = obj.data; - if(obj.checked){ + if (obj.checked) { //按钮逻辑Lib.buttonEnable() - }else{ + } else { } }) }, - initSearchForm:function(){ + initSearchForm: function () { //Lib.initSearchForm( $("#searchForm"),teacherOpenCourseScheduleSessionTable,form); var btn = $("#searchFormSearch"); btn.on('click', function () { var data = $("#searchForm").serializeJson(); - data.courseType = $("#searchForm select[name='teacherOpenCourseId']").find("option:selected").attr("status")||""; + data.courseType = $("#searchForm select[name='teacherOpenCourseId']").find("option:selected").attr("status") || ""; console.log(data.courseType) teacherOpenCourseScheduleSessionTable.reload({ where: data, @@ -145,22 +163,22 @@ layui.define([ 'form', 'laydate', 'table' ,'laytpl'], function(exports) { }); }, - initToolBar:function(){ + initToolBar: function () { toolbar = { add: function () { var url = "/jlw/teacherOpenCourseScheduleSession/add.do"; - Common.openDlg(url,"排课管理>新增排课"); + Common.openDlg(url, "排课管理>新增排课"); }, edit: function () { - var data = Common.getOneFromTable(table,"teacherOpenCourseScheduleSessionTable"); - if(data==null){ - return ; + var data = Common.getOneFromTable(table, "teacherOpenCourseScheduleSessionTable"); + if (data == null) { + return; } - var url = "/jlw/teacherOpenCourseScheduleSession/add.do?teacherOpenCourseScheduleSessionId="+data.teacherOpenCourseScheduleSessionId; - Common.openDlg(url,"排课管理>编辑排课"); + var url = "/jlw/teacherOpenCourseScheduleSession/add.do?teacherOpenCourseScheduleSessionId=" + data.teacherOpenCourseScheduleSessionId; + Common.openDlg(url, "排课管理>编辑排课"); }, del: function () { - layui.use(['del'], function(){ + layui.use(['del'], function () { var delView = layui.del delView.delBatch(); }); @@ -176,7 +194,7 @@ layui.define([ 'form', 'laydate', 'table' ,'laytpl'], function(exports) { }, } //触发事件 - $('.ext-toolbar').on('click', function() { + $('.ext-toolbar').on('click', function () { var type = $(this).data('type'); toolbar[type] ? toolbar[type].call(this) : ''; }); @@ -184,28 +202,31 @@ layui.define([ 'form', 'laydate', 'table' ,'laytpl'], function(exports) { }, initTableTool: table.on('tool(teacherOpenCourseScheduleSessionTable)', function (obj) { var data = obj.data; if (obj.event === 'edit') { - var url = "/jlw/teacherOpenCourseScheduleSession/add.do?teacherOpenCourseScheduleSessionId="+data.teacherOpenCourseScheduleSessionId; - Common.openDlg(url,"排课管理>编辑排课"); - }else if(obj.event === "del"){ + var url = "/jlw/teacherOpenCourseScheduleSession/add.do?teacherOpenCourseScheduleSessionId=" + data.teacherOpenCourseScheduleSessionId; + Common.openDlg(url, "排课管理>编辑排课"); + } else if (obj.event === "del") { layer.confirm('是否确定删除该信息?', function (index) { - var ret = Common.postAjax("/jlw/teacherOpenCourseScheduleSession/delete.json",{ids:data.teacherOpenCourseScheduleSessionId}); - layer.msg(ret.code == 0?"删除成功!":ret.msg, { + var ret = Common.postAjax("/jlw/teacherOpenCourseScheduleSession/delete.json", {ids: data.teacherOpenCourseScheduleSessionId}); + layer.msg(ret.code == 0 ? "删除成功!" : ret.msg, { offset: ['50%'], - icon: ret.code == 0?1:2, + icon: ret.code == 0 ? 1 : 2, time: 1500 //2秒关闭(如果不配置,默认是3秒) - },function (){ - if(ret.code == 0){ + }, function () { + if (ret.code == 0) { Lib.tableRefresh(); } }); }); - }else if(obj.event == 'look'){ + } else if (obj.event == 'look') { lookInfoDate(data); } else if (obj.event == "enable") { layer.confirm('是否确定启用该信息?', function (index) { var ret = Common.postAjax("/jlw/teacherOpenCourseScheduleSession/edit.json", - {teacherOpenCourseScheduleSessionId: data.teacherOpenCourseScheduleSessionId,teacherOpenCourseScheduleSessionStatus:1}); + { + teacherOpenCourseScheduleSessionId: data.teacherOpenCourseScheduleSessionId, + teacherOpenCourseScheduleSessionStatus: 1 + }); layer.msg(ret.code == 0 ? "启用成功!" : ret.msg, { offset: ['50%'], icon: ret.code == 0 ? 1 : 2, @@ -219,7 +240,10 @@ layui.define([ 'form', 'laydate', 'table' ,'laytpl'], function(exports) { } else if (obj.event == "disable") { layer.confirm('是否确定禁用该信息?', function (index) { var ret = Common.postAjax("/jlw/teacherOpenCourseScheduleSession/edit.json", - {teacherOpenCourseScheduleSessionId: data.teacherOpenCourseScheduleSessionId,teacherOpenCourseScheduleSessionStatus:2}); + { + teacherOpenCourseScheduleSessionId: data.teacherOpenCourseScheduleSessionId, + teacherOpenCourseScheduleSessionStatus: 2 + }); layer.msg(ret.code == 0 ? "禁用成功!" : ret.msg, { offset: ['50%'], icon: ret.code == 0 ? 1 : 2, @@ -233,24 +257,26 @@ layui.define([ 'form', 'laydate', 'table' ,'laytpl'], function(exports) { } }) }; - exports('index',view); + exports('index', view); + function lookInfoDate(data) { layer.open({ type: 1, title: '查看', btnAlign: 'c', - closeBtn:true, - shadeClose:true, + closeBtn: true, + shadeClose: true, area: ['750px', '250px'], content: '
', success: function (layero, index) { var getTpl = lookInfoDate_demo.innerHTML - ,view = document.getElementById('lookInfoDate_view'); - laytpl(getTpl).render(data, function(html){ + , view = document.getElementById('lookInfoDate_view'); + laytpl(getTpl).render(data, function (html) { view.innerHTML = html; }); }, - yes: function (index) {}, + yes: function (index) { + }, btn2: function (index, layero) { layer.close(index); } diff --git a/web/src/main/resources/templates/jlw/schoolClass/add.html b/web/src/main/resources/templates/jlw/schoolClass/add.html index 74601cff..bf017564 100644 --- a/web/src/main/resources/templates/jlw/schoolClass/add.html +++ b/web/src/main/resources/templates/jlw/schoolClass/add.html @@ -2,7 +2,7 @@
- +
@@ -12,8 +12,10 @@
- +
@@ -40,8 +42,9 @@
+ type="universities_colleges.universities_colleges_name.universities_colleges_status=1" + id="universitiesCollegesId" name="universitiesCollegesId" + layFilter="select_universitiesColleges" lay-verify="required"/>
@@ -54,7 +57,8 @@ @@ -77,35 +81,37 @@ - - - - - - - - - - + + + + + + + + + +
- -
- -
+ +
+ +
- - + + diff --git a/web/src/main/resources/templates/jlw/teacher/add.html b/web/src/main/resources/templates/jlw/teacher/add.html index 2b382156..33f1b46d 100644 --- a/web/src/main/resources/templates/jlw/teacher/add.html +++ b/web/src/main/resources/templates/jlw/teacher/add.html @@ -20,7 +20,7 @@ - + +-->
@@ -63,21 +63,21 @@
- -
+ +
@@ -92,7 +92,6 @@
-