webpackJsonp([34],{jdAG:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={data:function(){return{visible:!1,dataForm:{id:0,bookId:"",chapter:"",content:"",voices:"",createTime:"",updateTime:"",sort:"",delFlag:""},dataRule:{bookId:[{required:!0,message:"图书id不能为空",trigger:"blur"}],chapter:[{required:!0,message:"章节不能为空",trigger:"blur"}],content:[{required:!0,message:"内容不能为空",trigger:"blur"}],voices:[{required:!0,message:"音频文件地址不能为空",trigger:"blur"}],createTime:[{required:!0,message:"不能为空",trigger:"blur"}],updateTime:[{required:!0,message:"不能为空",trigger:"blur"}],sort:[{required:!0,message:"不能为空",trigger:"blur"}],delFlag:[{required:!0,message:"不能为空",trigger:"blur"}]}}},methods:{init:function(e){var t=this;this.dataForm.id=e||0,this.visible=!0,this.$nextTick(function(){t.$refs.dataForm.resetFields(),t.dataForm.id&&t.$http({url:t.$http.adornUrl("/book/bookchapter/info/"+t.dataForm.id),method:"get",params:t.$http.adornParams()}).then(function(e){var a=e.data;a&&0===a.code&&(t.dataForm.bookId=a.bookChapter.bookId,t.dataForm.chapter=a.bookChapter.chapter,t.dataForm.content=a.bookChapter.content,t.dataForm.voices=a.bookChapter.voices,t.dataForm.createTime=a.bookChapter.createTime,t.dataForm.updateTime=a.bookChapter.updateTime,t.dataForm.sort=a.bookChapter.sort,t.dataForm.delFlag=a.bookChapter.delFlag)})})},dataFormSubmit:function(){var e=this;this.$refs.dataForm.validate(function(t){t&&e.$http({url:e.$http.adornUrl("/book/bookchapter/"+(e.dataForm.id?"update":"save")),method:"post",data:e.$http.adornData({id:e.dataForm.id||void 0,bookId:e.dataForm.bookId,chapter:e.dataForm.chapter,content:e.dataForm.content,voices:e.dataForm.voices,createTime:e.dataForm.createTime,updateTime:e.dataForm.updateTime,sort:e.dataForm.sort,delFlag:e.dataForm.delFlag})}).then(function(t){var a=t.data;a&&0===a.code?e.$message({message:"操作成功",type:"success",duration:1500,onClose:function(){e.visible=!1,e.$emit("refreshDataList")}}):e.$message.error(a.msg)})})}}},o={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{title:e.dataForm.id?"修改":"新增","close-on-click-modal":!1,visible:e.visible},on:{"update:visible":function(t){e.visible=t}}},[a("el-form",{ref:"dataForm",attrs:{model:e.dataForm,rules:e.dataRule,"label-width":"80px"},nativeOn:{keyup:function(t){if(!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter"))return null;e.dataFormSubmit()}}},[a("el-form-item",{attrs:{label:"章节",prop:"chapter"}},[a("el-input",{attrs:{placeholder:"章节"},model:{value:e.dataForm.chapter,callback:function(t){e.$set(e.dataForm,"chapter",t)},expression:"dataForm.chapter"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"内容",prop:"content"}},[a("el-input",{attrs:{placeholder:"内容",type:"textarea",rows:"10"},model:{value:e.dataForm.content,callback:function(t){e.$set(e.dataForm,"content",t)},expression:"dataForm.content"}})],1)],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.visible=!1}}},[e._v("取消")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){e.dataFormSubmit()}}},[e._v("确定")])],1)],1)},staticRenderFns:[]},i=a("VU/8")(r,o,!1,null,null,null);t.default=i.exports}});