chunk-260509c8.4f60294d.js 6.7 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-260509c8"],{"1a42":function(t,e,a){"use strict";var i=a("d744"),s=a.n(i);s.a},"277b":function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"template-center"},[a("div",{staticClass:"template-type"},[t._m(0),a("TemplateItem",{attrs:{templateList:t.templateList},on:{copy:t.handleCopyClick,deLeTe:t.handleDelClick,reName:t.handReNameClick,toPath:t.toSet}})],1),a("DiaLog",{attrs:{dialogVisble:t.dialogVisble,dialogWidth:t.dialogWidth,delText:t.delText,handleType:t.handleType,templateName:t.params.template_name},on:{inputEvent:t.changeName,close:t.handleDiaClose,submit:t.handleSubTemplate}})],1)},s=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"template-type-title"},[a("h2",[t._v("个性化学习宝模板")])])}],n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"template-list"},t._l(t.templateList,(function(e,i){return a("div",{key:e.template_id,staticClass:"template-item"},[a("div",{staticClass:"item-block"},[t._m(0,!0),a("div",{staticClass:"text"},[a("p",{staticClass:"template-name-output template-name"},[t._v(" "+t._s(e.template_name)+" ")])])]),a("div",{staticClass:"set-block"},[a("span",{staticClass:"set-text",attrs:{id:"copy"},on:{click:function(a){return t.sendCopy(e)}}},[t._v("复制")]),a("span",{staticClass:"set-text",attrs:{id:"change"},on:{click:function(a){return t.sendReName(e,i)}}},[t._v("改名")]),a("span",{staticClass:"set-text",attrs:{id:"del"},on:{click:function(a){return t.sendDel(e)}}},[t._v("删除")]),a("span",{staticClass:"set-text",attrs:{id:"set"},on:{click:function(a){return t.sendToPath(e)}}},[t._v("设置")])])])})),0)])},l=[function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"pic"},[i("img",{attrs:{src:a("3ef0"),alt:""}})])}],c={name:"TemplateItem",props:{templateList:{type:Array,default:function(){return[]}}},methods:{sendCopy:function(t,e){this.$emit("copy",t,e)},sendReName:function(t,e,a){this.$emit("reName",t,e,a)},sendDel:function(t,e){this.$emit("deLeTe",t,e)},sendToPath:function(t){this.$emit("toPath",t)}}},o=c,d=(a("a649"),a("2877")),m=Object(d["a"])(o,n,l,!1,null,"a6b4f560",null),p=m.exports,r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-dialog",{attrs:{title:t.handleType,width:t.dialogWidth,center:"",visible:t.dialogVisble,"before-close":t.handleClose},on:{"update:visible":function(e){t.dialogVisble=e}}},["提示"===t.handleType?a("span",[t._v(t._s(t.delText))]):t._e(),"编辑名称"===t.handleType?a("el-input",{attrs:{type:"text",placeholder:"请输入内容",maxlength:"15","show-word-limit":""},on:{change:function(e){return t.inputEvent(t.inputText)}},model:{value:t.inputText,callback:function(e){t.inputText=e},expression:"inputText"}}):t._e(),"编辑"===t.handleType?a("div",[a("span",{staticClass:"dialog-text"},[t._v(t._s(t.delText))]),a("div",{staticClass:"template-list-block"},[a("ul",t._l(t.dataList,(function(e,i){return a("li",{key:i,class:[e.template_id===t.currentId?"current":""],on:{click:function(a){return t.handleClick(e,i)}}},[t._v(" "+t._s(e.template_name)+" ")])})),0)])]):t._e(),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:t.handleDialogClose}},[t._v("取 消")]),a("el-button",{on:{click:t.handleDiaSub}},[t._v(t._s(t.submitBtnText))])],1)],1)],1)},u=[],h={name:"DiaLog",props:{dialogVisble:{type:Boolean,default:!1},dialogWidth:{type:String,default:""},handleType:{type:String,default:""},templateName:{type:String,default:""},delText:{type:String,default:""},dataList:{type:Array,default:function(){return[]}},currentId:{type:String,default:""}},data:function(){return{inputText:"",submitBtnText:""}},watch:{handleType:{handler:function(t){"提示"==this.handleType||"编辑"==this.handleType?this.submitBtnText="确定":this.submitBtnText="保存"}},templateName:{handler:function(t){this.inputText=t}}},created:function(){},methods:{handleDialogClose:function(){this.$emit("close",this.dialogVisble)},handleDiaSub:function(){this.$emit("submit",this.handleType)},handleClose:function(){this.$emit("close",this.dialogVisble)},inputEvent:function(t){this.$emit("inputEvent",t)},handleClick:function(t,e){this.$emit("handleClick",t,e)}}},f=h,g=(a("1a42"),Object(d["a"])(f,r,u,!1,null,null,null)),_=g.exports,T=a("7660"),v={name:"TemplateCenter",components:{TemplateItem:p,DiaLog:_},data:function(){return{templateList:[{template_id:"",template_name:"班级模板"}],dialogVisble:!1,dialogWidth:"",delText:"",handleType:"",params:{template_id:"",template_name:""}}},created:function(){},mounted:function(){},methods:{getTemplate:function(){var t=this;teachingTemplateList().then((function(e){t.templateList=e.data}))},handleCopyClick:function(t){var e=this;if(this.templateList.length>11)return this.$message({type:"error",message:"模板数量已达上限"}),!1;var a={template_id:t.template_id},i=Object(T["c"])(a);teachingTemplateCopy(i).then((function(t){1===t.status?(e.$message({type:"success",message:"复制成功"}),e.getTemplate()):e.$message({type:"error",message:t.msg})}))},handleDelClick:function(t){this.handleType="提示",this.dialogWidth="30%",1==t.is_default?this.$message({type:"error",message:"默认模板不可删除!"}):(this.dialogVisble=!0,this.params.template_id=t.template_id,this.delText="确认删除该模版吗?",this.delStatus=t.is_default)},handReNameClick:function(t){this.handleType="编辑名称",this.dialogWidth="20%",this.dialogVisble=!0,this.params.template_name=t.template_name,this.params.template_id=t.template_id},changeName:function(t){this.params.template_name=t},handleSubTemplate:function(t){var e=this;if(this.dialogVisble=!1,"编辑名称"===t){var a={template_id:this.params.template_id,template_name:this.params.template_name},i=Object(T["c"])(a);teachingTemplateChangeName(i).then((function(t){1==t.status?(e.$message({type:"success",message:"操作成功"}),e.getTemplate()):e.$message({type:"error",message:t.msg})}))}else{var s={template_id:this.params.template_id},n=Object(T["c"])(s);teachingTemplateDel(n).then((function(t){1===t.status?(e.$message({type:"success",message:"删除成功"}),e.getTemplate()):e.$message({type:"error",message:t.msg})}))}},handleDiaClose:function(){this.dialogVisble=!1},toSet:function(t){this.$router.push({path:"/JuniorProductSet/ClassTemplate"})}}},y=v,b=(a("afc0"),Object(d["a"])(y,i,s,!1,null,"463e33b8",null));e["default"]=b.exports},"3ef0":function(t,e,a){t.exports=a.p+"img/template-cover.39014e72.png"},7767:function(t,e,a){},a649:function(t,e,a){"use strict";var i=a("7767"),s=a.n(i);s.a},afc0:function(t,e,a){"use strict";var i=a("ddbd"),s=a.n(i);s.a},d744:function(t,e,a){},ddbd:function(t,e,a){}}]);