Files
2022-08-17 17:22:31 +08:00

1 line
19 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
webpackJsonp([19,35],{"6Dqv":function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o={data:function(){return{dataForm:{key:""},query:{bookName:"",publisherName:"",authorName:""},dataList:[],state:!1,pageIndex:1,pageSize:10,totalPage:0,dataListLoading:!1,dataListSelections:[],addOrUpdateVisible:!1}},components:{AddOrUpdate:a("GURI").default},activated:function(){null!=this.$route.query.upPageInde&&(this.pageIndex=this.$route.query.upPageIndex,console.log(this.pageIndex)),this.getDataList()},methods:{getDataList:function(){var t=this;this.dataListLoading=!0,this.$http({url:this.$http.adornUrl("/book/book/list"),method:"get",params:this.$http.adornParams({page:this.pageIndex,limit:this.pageSize,bookName:this.query.bookName,publisherName:this.query.publisherName,authorName:this.query.authorName})}).then(function(e){var a=e.data;a&&0===a.code?(t.dataList=a.page.list,t.totalPage=a.page.totalCount):(t.dataList=[],t.totalPage=0),t.dataListLoading=!1})},sizeChangeHandle:function(t){this.pageSize=t,this.pageIndex=1,this.getDataList()},currentChangeHandle:function(t){this.pageIndex=t,this.getDataList()},selectionChangeHandle:function(t){this.dataListSelections=t},addOrUpdateHandle:function(t){var e=this;this.addOrUpdateVisible=!0,this.$nextTick(function(){e.$refs.addOrUpdate.init(t)})},deleteHandle:function(t){var e=this,a=t?[t]:this.dataListSelections.map(function(t){return t.id});this.$confirm("确定对[id="+a.join(",")+"]进行["+(t?"删除":"批量删除")+"]操作?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){e.$http({url:e.$http.adornUrl("/book/book/delete"),method:"post",data:e.$http.adornData(a,!1)}).then(function(t){var a=t.data;a&&0===a.code?e.$message({message:"操作成功",type:"success",duration:1500,onClose:function(){e.getDataList()}}):e.$message.error(a.msg)})})},SwitchChange:function(t){var e=this,a={state:t.state,id:t.id};this.$http({url:this.$http.adornUrl("/book/book/update"),method:"post",data:a}).then(function(t){e.$message({message:"成功",type:"success"}),e.loading=!1,e.getDataList()}).catch(function(t){e.loading=!1,console.log(t)}),console.log(t)},chapterHandle:function(t){var e=this;this.$http({url:this.$http.adornUrl("/book/book/getChapter"),method:"get",params:this.$http.adornParams({id:t})}).then(function(t){e.$message({message:"成功",type:"success"}),e.loading=!1,e.getDataList()})},contentHandle:function(t){var e=this;this.$http({url:this.$http.adornUrl("/book/bookchaptercontent/getBookVoices"),method:"get",params:this.$http.adornParams({id:t})}).then(function(t){e.$message({message:"成功",type:"success"}),e.loading=!1,e.getDataList()})},voicesHandle:function(t){var e=this;this.$http({url:this.$http.adornUrl("/book/bookchaptercontent/allVoices"),method:"get",params:this.$http.adornParams({id:t})}).then(function(t){e.$message({message:"成功",type:"success"}),e.loading=!1,e.getDataList()})}}},l={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"mod-config"},[a("el-form",{attrs:{inline:!0,model:t.dataForm},nativeOn:{keyup:function(e){if(!("button"in e)&&t._k(e.keyCode,"enter",13,e.key,"Enter"))return null;t.getDataList()}}},[a("el-form-item",{attrs:{label:"图书名称"}},[a("el-input",{attrs:{placeholder:"图书名称",clearable:""},model:{value:t.query.bookName,callback:function(e){t.$set(t.query,"bookName",e)},expression:"query.bookName"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"出版社名称"}},[a("el-input",{attrs:{placeholder:"出版社名称",clearable:""},model:{value:t.query.publisherName,callback:function(e){t.$set(t.query,"publisherName",e)},expression:"query.publisherName"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"作者姓名"}},[a("el-input",{attrs:{placeholder:"作者姓名",clearable:""},model:{value:t.query.authorName,callback:function(e){t.$set(t.query,"authorName",e)},expression:"query.authorName"}})],1),t._v(" "),a("el-form-item",[a("el-button",{on:{click:function(e){t.getDataList()}}},[t._v("查询")]),t._v(" "),t.isAuth("book:book:save")?a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.addOrUpdateHandle()}}},[t._v("新增")]):t._e(),t._v(" "),t.isAuth("book:book:delete")?a("el-button",{attrs:{type:"danger",disabled:t.dataListSelections.length<=0},on:{click:function(e){t.deleteHandle()}}},[t._v("批量删除")]):t._e()],1)],1),t._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.dataListLoading,expression:"dataListLoading"}],staticStyle:{width:"100%"},attrs:{data:t.dataList,border:""},on:{"selection-change":t.selectionChangeHandle}},[a("el-table-column",{attrs:{type:"selection","header-align":"center",align:"center",width:"50"}}),t._v(" "),a("el-table-column",{attrs:{label:"序号",width:"70",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s((t.pageIndex-1)*t.pageSize+e.$index+1)+"\n ")]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"state","header-align":"center",align:"center",label:"状态"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-switch",{staticStyle:{display:"block"},attrs:{"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949","active-text":"上架","inactive-text":"下架"},on:{change:function(a){t.SwitchChange(e.row)}},model:{value:e.row.state,callback:function(a){t.$set(e.row,"state",a)},expression:"scope.row.state"}})]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"name","header-align":"center",align:"center",label:"书名"}}),t._v(" "),a("el-table-column",{attrs:{prop:"authorName","header-align":"center",align:"center",label:"作者姓名"}}),t._v(" "),a("el-table-column",{attrs:{"header-align":"center",align:"center",label:"插图"},scopedSlots:t._u([{key:"default",fn:function(e){return[""!=e.row.images?a("img",{staticClass:"tableImg",attrs:{src:e.row.images,width:"70",height:"100"}}):t._e()]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"description","header-align":"center",align:"center","show-overflow-tooltip":!0,label:"简介"}}),t._v(" "),a("el-table-column",{attrs:{prop:"type","header-align":"center",align:"center",label:"类型"}}),t._v(" "),a("el-table-column",{attrs:{prop:"price","header-align":"center",align:"center",label:"价格"}}),t._v(" "),a("el-table-column",{attrs:{prop:"publisherName","header-align":"center",align:"center",label:"出版商名称"}}),t._v(" "),a("el-table-column",{attrs:{prop:"chapterStatus","header-align":"center",align:"center",label:"章节拆分"},scopedSlots:t._u([{key:"default",fn:function(e){return["成功"==e.row.chapterStatus?a("span",{staticStyle:{color:"blue"}},[t._v(t._s(e.row.chapterStatus))]):t._e(),t._v(" "),"失败"==e.row.chapterStatus?a("span",{staticStyle:{color:"red"}},[t._v(t._s(e.row.chapterStatus))]):t._e(),t._v(" "),"处理中"==e.row.chapterStatus?a("span",[t._v(t._s(e.row.chapterStatus))]):t._e(),t._v(" "),"未处理"==e.row.chapterStatus?a("span",[t._v(t._s(e.row.chapterStatus))]):t._e()]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"contentStatus","header-align":"center",align:"center",label:"单句拆分"},scopedSlots:t._u([{key:"default",fn:function(e){return["成功"==e.row.contentStatus?a("span",{staticStyle:{color:"blue"}},[t._v(t._s(e.row.contentStatus))]):t._e(),t._v(" "),"失败"==e.row.contentStatus?a("span",{staticStyle:{color:"red"}},[t._v(t._s(e.row.contentStatus))]):t._e(),t._v(" "),"处理中"==e.row.contentStatus?a("span",[t._v(t._s(e.row.contentStatus))]):t._e(),t._v(" "),"未处理"==e.row.contentStatus?a("span",[t._v(t._s(e.row.contentStatus))]):t._e()]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"voicesStatus","header-align":"center",align:"center",label:"音频处理"},scopedSlots:t._u([{key:"default",fn:function(e){return["成功"==e.row.voicesStatus?a("span",{staticStyle:{color:"blue"}},[t._v(t._s(e.row.voicesStatus))]):t._e(),t._v(" "),"失败"==e.row.voicesStatus?a("span",{staticStyle:{color:"red"}},[t._v(t._s(e.row.voicesStatus))]):t._e(),t._v(" "),"处理中"==e.row.voicesStatus?a("span",[t._v(t._s(e.row.voicesStatus))]):t._e(),t._v(" "),"未处理"==e.row.voicesStatus?a("span",[t._v(t._s(e.row.voicesStatus))]):t._e()]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"createTime","header-align":"center",align:"center",label:"创建日期"}}),t._v(" "),a("el-table-column",{attrs:{prop:"updateTime","header-align":"center",align:"center",label:"更新日期"}}),t._v(" "),a("el-table-column",{attrs:{fixed:"right","header-align":"center",align:"center",width:"150",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("router-link",{attrs:{to:{path:"book-bookchapter",query:{id:e.row.id,pageIndex:t.pageIndex}}}},["成功"==e.row.chapterStatus?a("el-button",{attrs:{type:"text",size:"small"}},[t._v("章节列表")]):t._e()],1),t._v(" "),"未处理"==e.row.chapterStatus||"失败"==e.row.chapterStatus?a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){t.chapterHandle(e.row.id)}}},[t._v("章节拆分")]):t._e(),t._v(" "),"成功"!=e.row.chapterStatus||"未处理"!=e.row.contentStatus&&"失败"!=e.row.contentStatus?t._e():a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){t.contentHandle(e.row.id)}}},[t._v("单句拆分")]),t._v(" "),"成功"!=e.row.contentStatus||"未处理"!=e.row.voicesStatus&&"失败"!=e.row.voicesStatus?t._e():a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){t.voicesHandle(e.row.id)}}},[t._v("音频处理")]),t._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){t.addOrUpdateHandle(e.row.id)}}},[t._v("修改")]),t._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){t.deleteHandle(e.row.id)}}},[t._v("删除")])]}}])})],1),t._v(" "),a("el-pagination",{staticStyle:{padding:"30px 0","text-align":"center"},attrs:{"current-page":t.pageIndex,"page-sizes":[10,20,50,100],"page-size":t.pageSize,total:t.totalPage,layout:"total, sizes, prev, pager, next, jumper"},on:{"size-change":t.sizeChangeHandle,"current-change":t.currentChangeHandle}}),t._v(" "),t.addOrUpdateVisible?a("add-or-update",{ref:"addOrUpdate",on:{refreshDataList:t.getDataList}}):t._e()],1)},staticRenderFns:[]},r=a("VU/8")(o,l,!1,null,null,null);e.default=r.exports},GURI:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o={data:function(){return{visible:!1,bookList:[],props:{dictType:"",dictValue:""},authorList:[],restaurants:[],author:"",publisherList:[],fileList:[],fileListNovel:[],dialogImageUrl:"",dialogVisible:!1,dataForm:{id:0,name:"",authorId:[],description:"",title:"",content:"",type:[],price:"",istop:"",publisherId:[],images:"",pid:"",level:"",createTime:"",updateTime:"",sort:"",delFlag:"",novel:""},dataRule:{}}},created:function(){this.getBookList(),this.loadAll()},mounted:function(){},methods:{init:function(t){var e=this;this.fileList=[],this.dataForm.id=t||0,this.visible=!0,this.$nextTick(function(){e.$refs.dataForm.resetFields(),e.dataForm.id&&e.$http({url:e.$http.adornUrl("/book/book/info/"+e.dataForm.id),method:"get",params:e.$http.adornParams()}).then(function(t){var a=t.data;if(a&&0===a.code){e.dataForm.name=a.book.name,e.dataForm.description=a.book.description,e.dataForm.title=a.book.title,e.dataForm.content=a.book.content,e.dataForm.price=a.book.price,e.dataForm.istop=a.book.istop,e.dataForm.images=a.book.images,e.dataForm.pid=a.book.pid,e.dataForm.level=a.book.level,e.dataForm.createTime=a.book.createTime,e.dataForm.updateTime=a.book.updateTime,e.dataForm.sort=a.book.sort,e.dataForm.delFlag=a.book.delFlag,e.dataForm.novel=a.book.novel;var o=a.book.type,l=a.book.authorId,r=a.book.publisherId;if(e.dataForm.publisherId=r.split(","),e.dataForm.type=o.split(","),e.dataForm.authorId=l.split(","),console.log(e.dataForm.type),""!=a.book.images){var i={name:"",url:a.book.images};(n=[]).push(i),e.fileList=n}if(""!=a.book.novel&&null!=a.book.novel&&"undefined"!=a.book.novel){var n,s={name:"电子书文件",url:a.book.novel};(n=[]).push(s),e.fileListNovel=n}}})})},dataFormSubmit:function(){var t=this;this.$refs.dataForm.validate(function(e){e&&t.$http({url:t.$http.adornUrl("/book/book/"+(t.dataForm.id?"update":"save")),method:"post",data:t.$http.adornData({id:t.dataForm.id||void 0,name:t.dataForm.name,authorId:t.dataForm.authorId.join(","),description:t.dataForm.description,title:t.dataForm.title,content:t.dataForm.content,type:t.dataForm.type.join(","),price:t.dataForm.price,istop:t.dataForm.istop,publisherId:t.dataForm.publisherId.join(","),images:t.dataForm.images,pid:t.dataForm.pid,level:t.dataForm.level,createTime:t.dataForm.createTime,updateTime:t.dataForm.updateTime,sort:t.dataForm.sort,delFlag:t.dataForm.delFlag,novel:t.dataForm.novel})}).then(function(e){var a=e.data;a&&0===a.code?t.$message({message:"操作成功",type:"success",duration:1500,onClose:function(){t.visible=!1,t.$emit("refreshDataList")}}):t.$message.error(a.msg)})})},handlePicSuccess:function(t,e){"success"==t.msg?(this.dataForm.images=t.url,this.$message.success("上传成功")):this.$message.error("上传失败")},getBookList:function(){var t=this;this.$http({url:this.$http.adornUrl("/book/sysdictdata/selectByType/book_type"),method:"get"}).then(function(e){var a=e.data;console.log(a),t.bookList=a.dataList})},handleRemove:function(t){this.dataForm.images=""},handlePictureCardPreview:function(t){this.dataForm.images=t.url,this.dialogVisible=!0},handleDownload:function(t){console.log(t)},handlereset:function(){this.fileList=[],this.fileListNovel=[],this.visible=!1},handlePreview:function(t){console.log(t)},handleExceed:function(t,e){this.$message.warning("当前限制选择 3 个文件,本次选择了 "+t.length+" 个文件,共选择了 "+(t.length+e.length)+" 个文件")},beforeRemove:function(t,e){return this.$confirm("确定移除 "+t.name+"")},handleRemoveNovel:function(t){this.dataForm.novel=""},handleNovelSuccess:function(t){this.dataForm.novel=t.url},loadAll:function(){var t=this;this.$http({url:this.$http.adornUrl("/book/author/bookAuthorList"),method:"get"}).then(function(e){var a=e.data;t.authorList=a.list}),this.$http({url:this.$http.adornUrl("/book/publisher/publisherList"),method:"get"}).then(function(e){var a=e.data;t.publisherList=a.list})}}},l={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{attrs:{title:t.dataForm.id?"修改":"新增","close-on-click-modal":!1,visible:t.visible},on:{"update:visible":function(e){t.visible=e},close:t.handlereset}},[a("el-form",{ref:"dataForm",attrs:{model:t.dataForm,rules:t.dataRule,"label-width":"80px"},nativeOn:{keyup:function(e){if(!("button"in e)&&t._k(e.keyCode,"enter",13,e.key,"Enter"))return null;t.dataFormSubmit()}}},[a("el-form-item",{attrs:{label:"书名",prop:"name"}},[a("el-input",{attrs:{placeholder:"书名"},model:{value:t.dataForm.name,callback:function(e){t.$set(t.dataForm,"name",e)},expression:"dataForm.name"}})],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"作者",prop:"authorId"}},[a("el-select",{attrs:{multiple:"",filterable:"","allow-create":"",size:"small","default-first-option":"",placeholder:"请输入作者姓名"},model:{value:t.dataForm.authorId,callback:function(e){t.$set(t.dataForm,"authorId",e)},expression:"dataForm.authorId"}},t._l(t.authorList,function(t){return a("el-option",{key:t.value+"",attrs:{label:t.value,value:t.id+""}})}))],1)],1),t._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"出版社",prop:"publisherId"}},[a("el-select",{attrs:{multiple:"",filterable:"","allow-create":"","default-first-option":"",placeholder:"请输入作者姓名"},model:{value:t.dataForm.publisherId,callback:function(e){t.$set(t.dataForm,"publisherId",e)},expression:"dataForm.publisherId"}},t._l(t.publisherList,function(t){return a("el-option",{key:t.value+"",attrs:{label:t.value,value:t.id+""}})}))],1)],1)],1),t._v(" "),a("el-form-item",{attrs:{label:"序言",prop:"title"}},[a("el-input",{attrs:{placeholder:"序言",rows:3,type:"textarea"},model:{value:t.dataForm.title,callback:function(e){t.$set(t.dataForm,"title",e)},expression:"dataForm.title"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"目录",prop:"content"}},[a("el-input",{attrs:{placeholder:"目录",rows:5,type:"textarea"},model:{value:t.dataForm.content,callback:function(e){t.$set(t.dataForm,"content",e)},expression:"dataForm.content"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"简介",prop:"description"}},[a("el-input",{attrs:{placeholder:"简介",rows:5,type:"textarea"},model:{value:t.dataForm.description,callback:function(e){t.$set(t.dataForm,"description",e)},expression:"dataForm.description"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"图书分类",prop:"type"}},[a("el-checkbox-group",{model:{value:t.dataForm.type,callback:function(e){t.$set(t.dataForm,"type",e)},expression:"dataForm.type"}},t._l(t.bookList,function(e){return a("el-checkbox",{key:e.dictType,attrs:{label:e.dictType,value:e.dictType}},[t._v(t._s(e.dictValue))])}))],1),t._v(" "),a("el-form-item",{attrs:{label:"价格",prop:"price"}},[a("el-input",{attrs:{placeholder:"价格"},model:{value:t.dataForm.price,callback:function(e){t.$set(t.dataForm,"price",e)},expression:"dataForm.price"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"置顶",prop:"istop"}},[a("el-radio-group",{model:{value:t.dataForm.istop,callback:function(e){t.$set(t.dataForm,"istop",e)},expression:"dataForm.istop"}},[a("el-radio",{attrs:{label:1}},[t._v("是")]),t._v(" "),a("el-radio",{attrs:{label:0}},[t._v("否")])],1)],1),t._v(" "),a("el-form-item",{attrs:{label:"文件上传",prop:"novel"}},[a("el-upload",{staticClass:"upload-demo",attrs:{action:"http://localhost:9100/pb/oss/fileoss","on-preview":t.handlePreview,"on-remove":t.handleRemove,"before-remove":t.beforeRemove,"on-success":t.handleNovelSuccess,multiple:"",limit:3,"on-exceed":t.handleExceed,"file-list":t.fileListNovel}},[a("el-button",{attrs:{size:"small",type:"primary"}},[t._v("点击上传")])],1)],1),t._v(" "),a("el-form-item",{attrs:{label:"插图",prop:"images"}},[a("el-upload",{attrs:{action:"http://localhost:9100/pb/oss/fileoss","list-type":"picture-card","on-preview":t.handlePictureCardPreview,"file-list":t.fileList,"on-success":t.handlePicSuccess,"on-remove":t.handleRemove}},[a("i",{staticClass:"el-icon-plus"})]),t._v(" "),a("el-dialog",{attrs:{visible:t.dialogVisible,"append-to-body":!0},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("img",{attrs:{width:"100%",src:t.dataForm.images,alt:""}})])],1),t._v(" "),a("el-form-item",{attrs:{label:"排序",prop:"sort"}},[a("el-input",{attrs:{placeholder:"排序"},model:{value:t.dataForm.sort,callback:function(e){t.$set(t.dataForm,"sort",e)},expression:"dataForm.sort"}})],1)],1),t._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:t.handlereset}},[t._v("取消")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.dataFormSubmit()}}},[t._v("确定")])],1)],1)},staticRenderFns:[]},r=a("VU/8")(o,l,!1,null,null,null);e.default=r.exports}});