(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1fbe82b1"],{"498a":function(e,t,r){"use strict";var a=r("23e7"),n=r("58a8").trim,s=r("c8d2");a({target:"String",proto:!0,forced:s("trim")},{trim:function(){return n(this)}})},"7bcb":function(e,t,r){},a403:function(e,t,r){"use strict";r("7bcb")},c8d2:function(e,t,r){var a=r("d039"),n=r("5899"),s="​…᠎";e.exports=function(e){return a((function(){return!!n[e]()||s[e]()!=s||n[e].name!==e}))}},f4b5:function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("div",{directives:[{name:"show",rawName:"v-show",value:"courseStep"===e.$route.name,expression:"$route.name === 'courseStep'"}]},[r("div",{staticClass:"btn-box flex"},[r("a-button",{staticClass:"btn",attrs:{icon:"plus",type:"primary"},on:{click:function(t){e.modalVisible=!0}}},[e._v("新建阶段")]),r("a-button",{staticClass:"btn",attrs:{type:"primary"},on:{click:function(t){e.describeVisible=!0}}},[e._v("阶段描述文案")])],1),r("a-table",{attrs:{columns:e.columns,"data-source":e.tableData,"row-key":"stageNo",pagination:!1,loading:e.tableLoading},scopedSlots:e._u([{key:"number",fn:function(t,a,n){return r("span",{},[r("span",[e._v(e._s(n+1))])])}},{key:"operation",fn:function(t,a){return r("span",{},[r("a",{staticClass:"margin_right20",on:{click:function(t){return e.onPut(a)}}},[e._v(e._s(a.status?"下架":"上架"))]),r("a",{staticClass:"margin_right20",on:{click:function(t){return e.showModal(a)}}},[e._v("编辑")]),r("router-link",{staticClass:"margin_right20",attrs:{to:{name:"secondTags",params:{courseNo:e.courseNo,stageNo:a.stageNo}}}},[e._v("标签管理")])],1)}}])}),r("a-modal",{attrs:{title:"添加/编辑",visible:e.modalVisible,"confirm-loading":e.confirmLoading,footer:null,"destroy-on-close":!0},on:{cancel:e.onCancel}},[r("a-form-model",{ref:"ruleForm",attrs:{model:e.ruleForm,rules:e.rules,"label-col":e.labelCol,"wrapper-col":e.wrapperCol}},[r("a-form-model-item",{ref:"stageTitle",attrs:{label:"阶段名称",prop:"stageTitle"}},[r("a-input",{attrs:{placeholder:"请输入阶段名称"},model:{value:e.ruleForm.stageTitle,callback:function(t){e.$set(e.ruleForm,"stageTitle",t)},expression:"ruleForm.stageTitle"}})],1),r("a-form-model-item",{ref:"sort",attrs:{label:"排序",prop:"sort"}},[r("a-input",{attrs:{placeholder:"数字越大,顺序越靠前"},model:{value:e.ruleForm.sort,callback:function(t){e.$set(e.ruleForm,"sort",t)},expression:"ruleForm.sort"}})],1),r("a-form-model-item",{ref:"status",attrs:{label:"上架设置",prop:"status"}},[r("a-radio-group",{model:{value:e.ruleForm.status,callback:function(t){e.$set(e.ruleForm,"status",t)},expression:"ruleForm.status"}},[r("a-radio",{attrs:{value:0}},[e._v(" 暂不上架 ")]),r("a-radio",{attrs:{value:1}},[e._v(" 立即上架 ")])],1)],1),r("a-form-model-item",{attrs:{"wrapper-col":{span:14,offset:4}}},[r("a-button",{attrs:{type:"primary"},on:{click:function(t){return e.submitForm("ruleForm")}}},[e._v(" 确定 ")]),r("a-button",{staticStyle:{"margin-left":"10px"},on:{click:e.onCancel}},[e._v(" 取消 ")])],1)],1)],1),r("a-modal",{attrs:{title:"描述文案",visible:e.describeVisible,"destroy-on-close":!0},on:{cancel:e.onCancel,ok:e.onSaveDescribe}},[r("a-textarea",{attrs:{placeholder:"请输入描述文案"},model:{value:e.describe,callback:function(t){e.describe=t},expression:"describe"}}),r("div",{directives:[{name:"show",rawName:"v-show",value:!e.describe.trim(),expression:"!describe.trim()"}],staticStyle:{color:"red"}},[e._v("请输入描述文案")])],1),r("UploadImage",{attrs:{"is-show":e.showUpdateImgModal,"tag-no":e.ruleForm.tagNo,title:e.ruleForm.modalTitle},on:{close:function(){return e.showUpdateImgModal=!1}}})],1),r("router-view")],1)},n=[],s=r("5530"),o=r("1da1"),i=(r("498a"),r("96cf"),r("300c")),c=r("0c4b"),u=r("0abd"),l=r("f64c"),d=function(e,t,r){""===t?r(new Error("请输入排序")):isNaN(+t)?r(new Error("请输入合法数字")):r()},m={name:"StudyPlan",components:{UploadImage:u["a"]},data:function(){return{describe:"",describeVisible:!1,showUpdateImgModal:!1,courseNo:this.$route.params.courseNo,moduleId:this.$route.params.moduleId,columns:c["g"],tableLoading:!1,tableData:[],modalVisible:!1,confirmLoading:!1,ruleForm:{tagTitle:"",sort:0,status:1},labelCol:{span:4},wrapperCol:{span:14},rules:{tagTitle:[{required:!0,message:"请输入标签名称",trigger:"blur"}],sort:[{required:!0,validator:d,trigger:"change"}],status:[{required:!0}]}}},created:function(){this.fetchData(),this.getDesc()},methods:{getDesc:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var r,a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(i["vb"])({moduleId:e.moduleId});case 2:if(r=t.sent,a=r.code,n=r.data,200===a){t.next=7;break}return t.abrupt("return");case 7:e.describe=n.descb;case 8:case"end":return t.stop()}}),t)})))()},fetchData:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var r,a,n,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return r={moduleId:e.moduleId},t.next=3,Object(i["kb"])(r);case 3:if(a=t.sent,n=a.code,s=a.data,200===n){t.next=8;break}return t.abrupt("return");case 8:e.tableData=s;case 9:case"end":return t.stop()}}),t)})))()},showModal:function(e){this.ruleForm=Object(s["a"])({},e),this.modalVisible=!0},submitForm:function(e){var t=this;this.$refs[e].validate((function(e){if(!e)return console.log("error submit!!"),!1;+t.ruleForm.stageNo?t.edit():t.add()}))},add:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var r,a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return r=Object(s["a"])(Object(s["a"])({moduleId:e.moduleId},e.ruleForm),{},{sort:+e.ruleForm.sort}),t.next=3,Object(i["Z"])(r);case 3:if(a=t.sent,n=a.code,200===n){t.next=7;break}return t.abrupt("return");case 7:e.$message.success("添加成功"),e.onCancel(),e.fetchData();case 10:case"end":return t.stop()}}),t)})))()},edit:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var r,a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return r=Object(s["a"])(Object(s["a"])({},e.ruleForm),{},{sort:+e.ruleForm.sort}),t.next=3,Object(i["rb"])(r);case 3:if(a=t.sent,n=a.code,200===n){t.next=7;break}return t.abrupt("return");case 7:e.$message.success("修改成功"),e.onCancel(),e.fetchData();case 10:case"end":return t.stop()}}),t)})))()},onCancel:function(){this.ruleForm={tagTitle:"",sort:0,status:1},this.modalVisible=!1,this.describeVisible=!1},onPut:function(e){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function r(){var a,n,s,o;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return a={stageNo:e.stageNo,status:e.status?0:1},r.next=3,Object(i["Sb"])(a);case 3:if(n=r.sent,s=n.code,200===s){r.next=7;break}return r.abrupt("return");case 7:o=e.status?"下架":"上架",t.$message.success("".concat(o,"成功")),e.status=e.status?0:1;case 10:case"end":return r.stop()}}),r)})))()},onSaveDescribe:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var r,a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.describe.trim()){t.next=2;break}return t.abrupt("return");case 2:return r={moduleId:e.moduleId,descb:e.describe},t.next=5,Object(i["Bb"])(r);case 5:if(a=t.sent,n=a.code,200===n){t.next=9;break}return t.abrupt("return");case 9:l["a"].success("添加成功"),e.onCancel();case 11:case"end":return t.stop()}}),t)})))()}},filters:{getTagType:function(e){var t="";switch(e){case 1:t="课程-不分章节";break;case 2:t="课程-分章节";break;case 3:t="图片";break;case 4:t="跳转圈子";break}return t}}},b=m,p=(r("a403"),r("2877")),f=Object(p["a"])(b,a,n,!1,null,"144ecc3d",null);t["default"]=f.exports}}]); //# sourceMappingURL=chunk-1fbe82b1.ff42a6cc.js.map