/*! * build: Hopaheal * copyright: Mead * time: 2023-3-13 15:21:04 */ (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ec4ebdca"],{"0e6b":function(e,t,s){},"22a4":function(e,t,s){"use strict";s.r(t),s.d(t,"courseList",(function(){return o})),s.d(t,"getRoomaList",(function(){return r})),s.d(t,"doAdd",(function(){return i})),s.d(t,"doEdit",(function(){return l})),s.d(t,"doDelete",(function(){return n})),s.d(t,"doPause",(function(){return d})),s.d(t,"getTermList",(function(){return u})),s.d(t,"getCategoryList",(function(){return c})),s.d(t,"getTeacherList",(function(){return m})),s.d(t,"getLessonList",(function(){return h})),s.d(t,"scheduleList",(function(){return p})),s.d(t,"graderListOption",(function(){return f})),s.d(t,"teacherLessonModelImport",(function(){return g}));var a=s("b775");function o(e){return Object(a["default"])({url:"/school/lesson-teacher",method:"get",params:e})}function r(e){return Object(a["default"])({url:"/school/room-select-options",method:"get",params:e})}function i(e){return Object(a["default"])({url:"/school/lesson-teacher",method:"post",data:e})}function l(e){return Object(a["default"])({url:"/school/lesson-teacher/"+e.id,method:"put",data:e})}function n(e){return Object(a["default"])({url:"/school/lesson-teacher/"+e,method:"post"})}function d(e){return Object(a["default"])({url:"/school/lesson-teacher/pause",method:"get",params:e})}function u(){return Object(a["default"])({url:"/school/term-select-options",method:"get"})}function c(e){return Object(a["default"])({url:"/base/category-select-options",method:"get",params:e})}function m(e){return Object(a["default"])({url:"/base/admin-select-options",method:"get",params:e})}function h(e){return Object(a["default"])({url:"/school/lesson-select-options",method:"get",params:e})}function p(e){return Object(a["default"])({url:"/school/schedule",method:"get",params:e})}function f(e){return Object(a["default"])({url:"/school/grade-select-options",method:"get",params:e})}function g(e){return Object(a["default"])({url:"/school/lesson-teacher/import",method:"post",data:e})}},"240b":function(e,t,s){"use strict";s("a57d")},"353a":function(e,t,s){"use strict";s("0e6b")},"6c50":function(e,t,s){"use strict";s.r(t),s.d(t,"fileDownLoad",(function(){return n}));var a=s("c0a4"),o=s("4360"),r=s("f121"),i=s("4ff3c"),l=s.n(i);function n(e,t,s,i){const n=(e,t)=>{let s=t+".xls";const a=new Blob([e.data],{type:"application/vnd.ms-excel"}),o=window.navigator;if("undefined"!==typeof o.msSaveBlob)o.msSaveBlob(a,decodeURI(s));else{const e=window.URL.createObjectURL(a),t=document.createElement("a");t.style.display="none",t.href=e,t.setAttribute("download",decodeURI(s)),"undefined"===typeof t.download&&t.setAttribute("target","_blank"),document.body.appendChild(t),t.click(),document.body.removeChild(t),window.URL,console.log(t,"tem")}};let d={};d=e;const u=o["default"].getters["user/token"];l()({baseURL:r["baseURL"],timeout:1e4,method:s,url:t,params:d,headers:{Authorization:"Bearer "+u,"Content-type":"application/x-www-form-urlencoded;charset=UTF-8"},responseType:"blob"}).then(e=>{n(e,i)}).catch(e=>{a["default"].prototype.$baseMessage(e,"error")})}},"84a5":function(e,t,s){"use strict";s.r(t);var a=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("el-dialog",{attrs:{"append-to-body":"","before-close":e.handleClose,title:"课表",visible:e.dialogVisible,width:"1000px"},on:{"update:visible":function(t){e.dialogVisible=t}}},[s("div",{staticClass:"content"},[s("vab-query-form",[s("vab-query-form-left-panel",{attrs:{span:6}},[e.transformAuth("100202")?s("el-button",{attrs:{icon:"el-icon-plus",type:"primary"},on:{click:e.handleEdit}},[e._v(" 添加排课 ")]):e._e()],1),s("vab-query-form-right-panel",{attrs:{span:18}},[s("el-form",{attrs:{inline:!0,model:e.queryForm},nativeOn:{submit:function(e){e.preventDefault()}}},[s("el-form-item",{attrs:{prop:"id"}},[s("el-select",{attrs:{clearable:"",placeholder:"请选择实验室"},on:{change:e.queryData},model:{value:e.queryForm.room_id,callback:function(t){e.$set(e.queryForm,"room_id",t)},expression:"queryForm.room_id"}},e._l(e.roomList,(function(e){return s("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),s("el-form-item",{attrs:{prop:"id"}},[s("el-select",{attrs:{clearable:"",placeholder:"请选择教学周"},on:{change:e.changeWeeks},model:{value:e.queryForm.week,callback:function(t){e.$set(e.queryForm,"week",t)},expression:"queryForm.week"}},e._l(e.weekList,(function(e){return s("el-option",{key:e.value,attrs:{label:e.name,value:e.value}})})),1)],1),s("el-form-item",[s("el-button",{attrs:{icon:"el-icon-search",type:"primary"},on:{click:e.queryData}},[e._v(" 查询 ")])],1)],1)],1)],1),s("div",[s("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{border:"",data:e.list}},[s("el-table-column",{attrs:{align:"center",label:"序号",prop:"date","show-overflow-tooltip":"",type:"index",width:"50"}}),s("el-table-column",{attrs:{align:"center",label:"教学周","min-width":"80",prop:"week","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.row;return[e._v("第"+e._s(s.week)+"周")]}}])}),s("el-table-column",{attrs:{align:"center",label:"上课时间","min-width":"250",prop:"time","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.row;return[e._v(" "+e._s(s.day)+" (周"+e._s(e.transformWeek(s.week_index))+") / "+e._s(s.time_id?s.time_id.name:"--")+" ")]}}])}),s("el-table-column",{attrs:{align:"center",label:"分组","min-width":"60",prop:"group_name","show-overflow-tooltip":""}}),s("el-table-column",{attrs:{align:"center",label:"实验室","min-width":"180",prop:"room.name","show-overflow-tooltip":""}}),s("el-table-column",{attrs:{align:"center",label:"上课人数","min-width":"80",prop:"student_nums","show-overflow-tooltip":""}}),s("el-table-column",{attrs:{align:"center",label:"状态","min-width":"120",prop:"status","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[1==a.status&&0==a.migrate_id?s("el-tag",[e._v(" 正常 ")]):e._e(),0==a.status?s("el-tag",{attrs:{type:"danger"}},[e._v("隐藏")]):e._e(),2==a.status?s("el-tag",{attrs:{type:"danger"}},[e._v("停课")]):e._e(),3==a.status?s("el-tag",{attrs:{type:"warning"}},[e._v("调课")]):e._e(),1==a.status&&0!==a.migrate_id?s("el-tag",{attrs:{type:"success"}},[e._v(" 补课 ")]):e._e()]}}])})],1),s("el-pagination",{attrs:{background:"","current-page":e.queryForm.page,layout:e.layout,"page-size":e.queryForm.per_page,"page-sizes":[15,20,30,40,50,100],total:e.total},on:{"current-change":e.handleCurrentChange,"size-change":e.handleSizeChange}})],1),s("addTable",{ref:"add-table",on:{"fetch-data":e.getList}})],1),s("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[s("el-button",{attrs:{type:"primary"},on:{click:e.handleClose}},[e._v("关 闭")])],1)])},o=[],r=s("22a4"),i=s("7736"),l=s("d12b"),n=s("8c15"),d={name:"TemplateIndex",components:{addTable:n["default"]},data(){return{dialogVisible:!1,listLoading:!0,dayList:[],timeList:[],courseList:[],max_week:localStorage.getItem("term_weeks"),roomList:[{name:"网络运维",value:1},{name:"组装实验室",value:2}],weekList:[],queryForm:{room_id:"",week:"",term_id:localStorage.getItem("term_id")},layout:"total, sizes, prev, pager, next, jumper",total:0,room_name:"",today:"",week:"",detail:"",list:[]}},computed:{...Object(i["c"])({weeks:"user/weeks"})},methods:{transformAuth:l["transformAuth"],handleEdit(){this.$refs["add-table"].showEdit({teacher_admin_id:this.detail.teacher?this.detail.teacher.id:"",lesson_id:this.detail.lesson?this.detail.lesson.id:"",grade_id:this.detail.grade?this.detail.grade.id:"",class_id:this.detail.id,edit_type:1})},transformWeek:l["transformWeek"],handleClose(){this.queryForm={room_id:"",week:"",term_id:localStorage.getItem("term_id")},this.dialogVisible=!1},async showEdit(e){this.detail=e,this.queryForm.lesson_teacher_id=e.id,this.weekList=[];let t=localStorage.getItem("roomList")?JSON.parse(localStorage.getItem("roomList")):[];t.length?this.roomList=t.length?t:[]:await this.getRoomaList(),await this.getList(),await this.getWeeks(),this.dialogVisible=!0},async getList(){this.listLoading=!0;const{data:e}=await Object(r["scheduleList"])(this.queryForm);this.list=e.list;const{pagination:t}=e.meta;this.total=t.total,this.listLoading=!1},handleSizeChange(e){this.queryForm.per_page=e,this.getList()},handleCurrentChange(e){this.queryForm.page=e,this.getList()},queryData(){this.queryForm.page=1,this.getList()},changeWeeks(e){console.log(e,"eeeeeeeee"),this.queryForm.page=1,this.queryForm.week=e,this.getList()},stop_detail(e,t){let s=e.week_index,a={week_index:s,week:e.week,room_id:this.queryForm.room_id,time_id:this.timeList[t].id};this.$refs["stopdetail"].showEdit(a),console.log(a,"=======")},getWeeks(){console.log(this.weeks,"-------------");let e=localStorage.getItem("term_weeks");for(let t=1;t<=e;t++)this.weekList.push({name:"第"+t+"周",value:t})},checkOld(e){var t=Number(this.today.replace(/-/g,"")),s=Number(e.replace(/-/g,""));return t==s},async getRoomaList(){const{data:e}=await Object(r["getRoomaList"])();this.roomList=e.length?e:[],this.room_name=e.length?e[0].name:"",this.queryForm.room_id=e.length?e[0].id:0,localStorage.setItem("roomList",e.length?JSON.stringify(e):"")},showDetail(e,t){t?this.$refs["dialog"].showEdit(e,"is_maintain"):this.$refs["dialog"].showEdit(e)},cancelRepair(){this.$baseConfirm("你确定要对当前教室的维护吗?",null,async()=>{})},changeRoom(e){this.queryForm.room_id=e,this.roomList.map(t=>{t.id==e&&(this.room_name=t.name)}),this.getCalendar()}}},u=d,c=(s("240b"),s("0b56")),m=Object(c["a"])(u,a,o,!1,null,"3ea97664",null);t["default"]=m.exports},"88ca":function(e,t,s){},9343:function(e,t,s){"use strict";s.r(t);var a=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"content"},[s("vab-query-form",[s("vab-query-form-left-panel",{attrs:{span:8}},[s("el-button",{attrs:{icon:"el-icon-plus",type:"primary"},on:{click:e.handleEdit}},[e._v(" 添加 ")]),s("el-button",{attrs:{icon:"el-icon-download",type:"success"},on:{click:e.handleDownloadModel}},[e._v(" 导出老师授课模版 ")]),s("el-button",{attrs:{icon:"el-icon-upload2",type:"warning"},on:{click:e.modelImport}},[e._v(" 导入老师授课模版 ")])],1),s("vab-query-form-right-panel",{attrs:{span:16}},[s("el-form",{attrs:{inline:!0,model:e.queryForm},nativeOn:{submit:function(e){e.preventDefault()}}},[s("el-form-item",[s("el-input",{attrs:{clearable:"",placeholder:"请输入课程名称"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.queryData(t)}},model:{value:e.queryForm.lesson_name,callback:function(t){e.$set(e.queryForm,"lesson_name","string"===typeof t?t.trim():t)},expression:"queryForm.lesson_name"}})],1),s("el-form-item",[s("el-input",{attrs:{clearable:"",placeholder:"请输入教师名称"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.queryData(t)}},model:{value:e.queryForm.teacher_name,callback:function(t){e.$set(e.queryForm,"teacher_name","string"===typeof t?t.trim():t)},expression:"queryForm.teacher_name"}})],1),s("el-form-item",[s("el-input",{attrs:{clearable:"",placeholder:"请输入班级名称"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.queryData(t)}},model:{value:e.queryForm.grade_name,callback:function(t){e.$set(e.queryForm,"grade_name","string"===typeof t?t.trim():t)},expression:"queryForm.grade_name"}})],1),s("el-form-item",{attrs:{prop:"id"}},[s("el-select",{attrs:{clearable:"",placeholder:"请选择课程状态"},model:{value:e.queryForm.status,callback:function(t){e.$set(e.queryForm,"status",t)},expression:"queryForm.status"}},e._l(e.statusList,(function(e){return s("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),s("el-form-item",[s("el-button",{attrs:{icon:"el-icon-search",type:"primary"},on:{click:e.queryData}},[e._v(" 查询 ")])],1)],1)],1)],1),s("div",[s("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{border:"",data:e.list},on:{"selection-change":e.setSelectRows}},[s("el-table-column",{attrs:{"show-overflow-tooltip":"",type:"selection"}}),s("el-table-column",{attrs:{align:"center",label:"序号",prop:"date",type:"index",width:"50"}}),s("el-table-column",{attrs:{align:"center",label:"课程名称","min-width":"250",prop:"lesson"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[s("span",[e._v(e._s(a.lesson?a.lesson.name:"--"))])]}}])}),s("el-table-column",{attrs:{align:"center",label:"课程所在院系","min-width":"200",prop:"lesson"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[s("span",[e._v(" "+e._s(a.lesson_department?a.lesson_department.name:"--")+" ")])]}}])}),s("el-table-column",{attrs:{align:"center",label:"任课教师","min-width":"90",prop:"course"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[s("span",[e._v(e._s(a.teacher?a.teacher.name:"--"))])]}}])}),s("el-table-column",{attrs:{align:"center",label:"班级","min-width":"200",prop:"lesson","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[s("span",[e._v(e._s(a.grade?a.grade.name:"--"))])]}}])}),s("el-table-column",{attrs:{align:"center",label:"专业所在院系","min-width":"200",prop:"lesson"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[s("span",[e._v(" "+e._s(a.grade_department?a.grade_department.name:"--")+" ")])]}}])}),s("el-table-column",{attrs:{align:"center",label:"人数","min-width":"60",prop:"student_nums"}}),s("el-table-column",{attrs:{align:"center",label:"课程进度(已完成/总课时)","min-width":"270",prop:"progress"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[s("span",[s("el-progress",{attrs:{percentage:a.progress}})],1),s("span",{staticStyle:{display:"inline"}},[e._v(" ("+e._s(0==a.lesson.lesson_hour?0:Math.round(a.lesson.lesson_hour/a.progress))+"/"+e._s(a.lesson?a.lesson.lesson_hour:"--")+") ")])]}}])}),s("el-table-column",{attrs:{align:"center",label:"状态",prop:"status","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[1==a.status?s("el-tag",[e._v("正常")]):e._e(),0==a.status?s("el-tag",{attrs:{type:"danger"}},[e._v("隐藏")]):e._e()]}}])}),s("el-table-column",{attrs:{align:"center",fixed:"right",label:"操作","min-width":"180"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[s("el-button",{attrs:{type:"text"},on:{click:function(t){return e.lookShedule(a,0)}}},[e._v(" 查看课表 ")]),1==a.status?s("el-button",{attrs:{type:"text"},on:{click:function(t){return e.handlePause(a,0)}}},[e._v(" 隐藏 ")]):e._e(),0==a.status?s("el-button",{attrs:{type:"text"},on:{click:function(t){return e.handlePause(a,1)}}},[e._v(" 启用 ")]):e._e()]}}])})],1),s("el-pagination",{attrs:{background:"","current-page":e.queryForm.page,layout:e.layout,"page-size":e.queryForm.per_page,"page-sizes":[15,20,30,40,50,100],total:e.total},on:{"current-change":e.handleCurrentChange,"size-change":e.handleSizeChange}})],1),s("doEdit",{ref:"edit",on:{"fetch-data":e.getCourseList}}),s("courseTimetable",{ref:"time-table"}),s("importClassModel",{ref:"import-model"})],1)},o=[],r=s("84a5"),i=s("22a4"),l=s("b34e"),n=s("6c50"),d=s("aaca"),u={components:{doEdit:l["default"],courseTimetable:r["default"],importClassModel:d["default"]},data(){return{listLoading:!0,layout:"total, sizes, prev, pager, next, jumper",total:1,queryForm:{page:1,per_page:15},list:[],selectRows:[],statusList:[{id:1,name:"正常"},{id:0,name:"禁用"}]}},created(){this.getCourseList()},methods:{modelImport(){this.$refs["import-model"].showEdit()},handleDownloadModel(){let e={term_id:localStorage.getItem("term_id")};Object(n["fileDownLoad"])(e,"/school/lesson-teacher/export","get","教师授课列表模版")},async getCourseList(){const{data:e}=await Object(i["courseList"])(this.queryForm);this.list=e.list;const{pagination:t}=e.meta;this.total=t.total,this.listLoading=!1},queryData(){this.queryForm.page=1,this.getCourseList()},handleSizeChange(e){this.queryForm.per_page=e,this.getCourseList()},handleCurrentChange(e){this.queryForm.page=e,this.getCourseList()},setSelectRows(e){this.selectRows=e},handleEdit(e){e.id?this.$refs["edit"].showEdit(e):this.$refs["edit"].showEdit()},handleDelete(e){if(e.id)this.$baseConfirm("您确定要删除当前课程吗",null,async()=>{const{message:t}=await Object(i["doDelete"])(e.id);this.$baseMessage(t,"success",!1,"vab-hey-message-success"),await this.getCourseList()});else if(this.selectRows.length>0){let e=this.selectRows.map(e=>e.id);this.$baseConfirm("你确定要删除选中课程吗",null,async()=>{const{message:t}=await Object(i["doDelete"])({ids:e});this.$baseMessage(t,"success",!1,"vab-hey-message-success"),await this.getCourseList()})}else this.$baseMessage("请先选择要删除的项!","error",!1,"vab-hey-message-error")},handlePause(e,t){this.$baseConfirm("您确定要"+(1==t?"启用":"禁用")+"当前课程吗",null,async()=>{const{message:s}=await Object(i["doPause"])({id:e.id,type:t});this.$baseMessage(s,"success",!1,"vab-hey-message-success"),await this.getCourseList()})},lookShedule(e){this.$refs["time-table"].showEdit(e)}}},c=u,m=(s("c484"),s("0b56")),h=Object(m["a"])(c,a,o,!1,null,"3e1eeec1",null);t["default"]=h.exports},a57d:function(e,t,s){},aaca:function(e,t,s){"use strict";s.r(t);var a=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("el-dialog",{attrs:{"before-close":e.handleClose,title:"教师授课列表模版导入",visible:e.dialogVisible,width:"800px"},on:{"update:visible":function(t){e.dialogVisible=t}}},[s("div",{staticClass:"content_1"},[s("el-form",{ref:"form",attrs:{"label-width":"120px",model:e.form}},[s("el-form-item",{attrs:{label:"上传文件:"}},[s("span",{staticClass:"star"},[e._v("*")]),s("el-upload",{staticClass:"upload-demo",attrs:{accept:".xls,.xlsx",action:e.action,data:e.uploadData,drag:"","file-list":e.fileList,"on-error":e.uploadError,"on-remove":e.handleRemove,"on-success":e.uploadSuccess}},[s("i",{staticClass:"el-icon-upload"}),s("div",{staticClass:"el-upload__text"},[e._v(" 将文件拖到此处,或 "),s("em",[e._v("点击上传")])])]),1!==e.type?s("div",{staticClass:"el-upload__text upload-tips"},[e._v(" 注意:请按照模版进行数据填写 ")]):e._e()],1)],1)],1),s("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[s("el-button",{on:{click:e.handleClose}},[e._v("取 消")]),s("el-button",{attrs:{type:"primary"},on:{click:e.sureImport}},[e._v("确定导入")])],1)])},o=[],r=s("f121"),i=s("22a4"),l={name:"TemplateClassdialog",data(){return{action:"",fileList:[],uploadData:{file_type:"file",type:"lesson_model"},limit:1,dialogVisible:!1,termList:[],form:{id:""},model_url:"",tips:"",type:1}},created(){this.action=r["baseURL"]+"/common/upload",this.fileList=[]},methods:{handleClose(){this.form={id:""},this.fileList=[],this.dialogVisible=!1},showEdit(){this.dialogVisible=!0},sureImport(){this.$refs["form"].validate(async e=>{if(e){const{message:e}=await Object(i["teacherLessonModelImport"])(this.form);this.$baseMessage(e,"success",!1,"vab-hey-message-success"),this.$emit("fetch-data"),this.$refs["form"].resetFields(),this.handleClose()}})},uploadError(){this.fileList=[],this.$message.error("文件上传失败,请重新上传")},uploadSuccess(e){console.log(e,"文件上传成功"),this.form.id=e.data.id},handleRemove(){this.fileList=[],this.form={id:""}}}},n=l,d=(s("f9b1"),s("0b56")),u=Object(d["a"])(n,a,o,!1,null,"2ebad8b2",null);t["default"]=u.exports},b34e:function(e,t,s){"use strict";s.r(t);var a=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("el-dialog",{attrs:{"before-close":e.handleClose,title:1==e.type?"添加":"编辑",visible:e.dialogVisible,width:"800px"},on:{"update:visible":function(t){e.dialogVisible=t}}},[s("div",{staticClass:"content_1"},[s("el-form",{ref:"form",attrs:{"label-width":"120px",model:e.form,rules:e.rules}},[s("el-form-item",{attrs:{label:"课程",prop:"lesson_id"}},[s("el-select",{attrs:{clearable:"",placeholder:"请选择课程"},model:{value:e.form.lesson_id,callback:function(t){e.$set(e.form,"lesson_id",t)},expression:"form.lesson_id"}},e._l(e.lessonList,(function(e){return s("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),s("el-form-item",{attrs:{label:"教师",prop:"teacher_admin_id"}},[s("el-select",{attrs:{clearable:"",placeholder:"请选择教师"},model:{value:e.form.teacher_admin_id,callback:function(t){e.$set(e.form,"teacher_admin_id",t)},expression:"form.teacher_admin_id"}},e._l(e.teacherList,(function(e){return s("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),s("el-form-item",{attrs:{label:"班级",prop:"grade_id"}},[s("el-select",{attrs:{clearable:"",placeholder:"请选择课程","popper-append-to-body":!1,"popper-class":"selectStyle"},model:{value:e.form.grade_id,callback:function(t){e.$set(e.form,"grade_id",t)},expression:"form.grade_id"}},e._l(e.gradeList,(function(e){return s("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),s("el-form-item",{attrs:{label:"学生人数",prop:"student_nums"}},[s("el-input",{attrs:{placeholder:"请输入学生人数"},model:{value:e.form.student_nums,callback:function(t){e.$set(e.form,"student_nums",t)},expression:"form.student_nums"}})],1),s("el-form-item",{attrs:{label:"状态:",prop:"status"}},[s("el-radio-group",{model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}},[s("el-radio",{attrs:{label:1}},[e._v("正常")]),s("el-radio",{attrs:{label:0}},[e._v("禁用")])],1)],1)],1)],1),s("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[s("el-button",{on:{click:e.handleClose}},[e._v("取 消")]),2==e.type?s("el-button",{attrs:{type:"primary"},on:{click:e.sureEdit}},[e._v(" 保 存 ")]):e._e(),1==e.type?s("el-button",{attrs:{type:"primary"},on:{click:e.sureAdd}},[e._v(" 添 加 ")]):e._e()],1)])},o=[],r=s("22a4"),i=s("d12b"),l={name:"TemplateClassdialog",data(){return{lessonList:[],type:1,dialogVisible:!1,form:{status:1,teacher_admin_id:"",lesson_id:"",type:2},categoryList:[],termList:[],teacherList:[],grade_rules:"",gradeList:[],rules:{teacher_admin_id:[{required:!0,trigger:"blur",message:"请选择任课教师"}],lesson_id:[{required:!0,trigger:"blur",message:"请选择课程"}],grade_id:[{required:!0,trigger:"blur",message:"请选择班级"}],student_nums:[{required:!0,trigger:"blur",message:"学生人数"}],name:[{required:!0,trigger:"blur",message:"请输入教室名称"}],lesson_hour:[{required:!0,trigger:"blur",message:"请输入总学时"}],credit:[{required:!0,trigger:"blur",message:"请输入学分"}],status:[{required:!0,trigger:"blur",message:"请选择状态"}]}}},methods:{async getLessonList(){const{data:e}=await Object(r["getLessonList"])({status:1});this.lessonList=e},async graderListOption(){const{data:e}=await Object(r["graderListOption"])({status:1});this.gradeList=e},getTnyMac(e){this.form.body=e},handleClose(){this.form={status:1,teacher_admin_id:"",lesson_id:"",type:2},this.$refs["form"].resetFields(),this.$refs["form"].clearValidate(),this.dialogVisible=!1},showEdit(e){e?(this.type=2,this.form=Object.assign({},e),this.form.grade_rules=e.grade_rules?e.grade_rules:""):this.type=1,this.getTeacherList(),this.getLessonList(),this.graderListOption(),this.dialogVisible=!0},async getTermList(){const{data:e}=await Object(r["getTermList"])();this.termList=e},async getCategoryList(){let e=Object(i["getKey"])("课程类型");const{data:t}=await Object(r["getCategoryList"])({key:e});this.categoryList=t},async getTeacherList(){const{data:e}=await Object(r["getTeacherList"])({role_name:"teacher"});this.teacherList=e},addGradeRules(){this.grade_rules&&(this.form.grade_rules.push(this.grade_rules),this.grade_rules="")},deleteGradeRules(e){this.form.grade_rules=this.form.grade_rules.filter((t,s)=>(console.log(s),s!=e))},sureEdit(){this.$refs["form"].validate(async e=>{var t=new RegExp("^[0-9]*[1-9][0-9]*$");if(e){if(console.log(this.form.lesson_hour,"ppp"),0!==this.form.student_nums&&!t.test(this.form.student_nums))return this.$message.warning("学生数必须为大于0整数!"),void(this.form.student_nums="");const{message:e}=await Object(r["doEdit"])(this.form);this.$baseMessage(e,"success",!1,"vab-hey-message-success"),this.$emit("fetch-data"),this.$refs["form"].resetFields(),this.handleClose()}})},sureAdd(){this.$refs["form"].validate(async e=>{var t=new RegExp("^[0-9]*[1-9][0-9]*$");if(e){if(0!==this.form.student_nums&&!t.test(this.form.student_nums))return this.$message.warning("学生数必须为大于0整数!"),void(this.form.student_nums="");const{message:e}=await Object(r["doAdd"])(this.form);this.$baseMessage(e,"success",!1,"vab-hey-message-success"),this.$emit("fetch-data"),this.$refs["form"].resetFields(),this.handleClose()}})}}},n=l,d=(s("353a"),s("0b56")),u=Object(d["a"])(n,a,o,!1,null,"34cf720a",null);t["default"]=u.exports},c484:function(e,t,s){"use strict";s("88ca")},e994:function(e,t,s){},f9b1:function(e,t,s){"use strict";s("e994")}}]);