From 8a7c42b4d89e041391eb6dd9df89275dd1a3ab91 Mon Sep 17 00:00:00 2001 From: wans <747101512@qq.com> Date: Wed, 16 Feb 2022 11:14:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=80=89=E6=8B=A9=E6=8E=88?= =?UTF-8?q?=E8=AF=BE=E8=AE=B2=E5=B8=88=E6=97=B6=E4=B8=8D=E5=86=8D=E5=85=B3?= =?UTF-8?q?=E8=81=94=E6=89=80=E9=80=89=E5=B7=A5=E7=A7=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../classplan/select-lesson-teacher.html | 33 +++++-------------- 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/src/main/resources/static/route/classplan/select-lesson-teacher.html b/src/main/resources/static/route/classplan/select-lesson-teacher.html index 3000c02..e2dce1d 100644 --- a/src/main/resources/static/route/classplan/select-lesson-teacher.html +++ b/src/main/resources/static/route/classplan/select-lesson-teacher.html @@ -62,9 +62,13 @@
@@ -133,10 +137,7 @@ max: '23:00:00' }); initLessons(); - laytpl(document.getElementById('teacherTemplate').innerHTML).render([], function(html) { - document.getElementById('teacherBox').innerHTML = html; - }); - form.render(null, 'dataForm'); + initTeacherList(); $('.layui-card').height($(window).height()); } initData(); @@ -160,25 +161,9 @@ }); } - form.on('select(changeLesson)',function(data){ - if(data.value == ''){ - laytpl(document.getElementById('teacherTemplate').innerHTML).render([], function(html) { - document.getElementById('teacherBox').innerHTML = html; - }); - form.render(null, 'dataForm'); - return; - } - var lessonWorkType = $(data.elem).find('option:selected').data().lessonWorkType; - initTeacherList(lessonWorkType); - }); - //查询讲师列表 - function initTeacherList(lessonWorkType){ - top.restAjax.get(top.restAjax.path('api/teacher/list',[]), {workerCategoryId : lessonWorkType}, null, function(code,data){ - if(typeof (data) === 'undefined' || data.length == 0){ - layer.msg('当前专业还没有讲师,请联系应急管理局进行添加'); - return; - } + function initTeacherList(){ + top.restAjax.get(top.restAjax.path('api/teacher/list',[]), {}, null, function(code,data){ laytpl(document.getElementById('teacherTemplate').innerHTML).render(data, function(html) { document.getElementById('teacherBox').innerHTML = html; });