chunk-64662486.b83f64ab.js 11.3 KB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-64662486"],{"09f4":function(t,e,a){"use strict";a.d(e,"a",(function(){return o})),Math.easeInOutQuad=function(t,e,a,n){return t/=n/2,t<1?a/2*t*t+e:(t--,-a/2*(t*(t-2)-1)+e)};var n=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function r(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}function i(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function o(t,e,a){var o=i(),s=t-o,c=20,l=0;e="undefined"===typeof e?500:e;var u=function t(){l+=c;var i=Math.easeInOutQuad(l,o,s,e);r(i),l<e?n(t):a&&"function"===typeof a&&a()};u()}},"3bb8":function(t,e,a){"use strict";a.d(e,"e",(function(){return r})),a.d(e,"a",(function(){return i})),a.d(e,"b",(function(){return o})),a.d(e,"p",(function(){return s})),a.d(e,"f",(function(){return c})),a.d(e,"m",(function(){return l})),a.d(e,"l",(function(){return u})),a.d(e,"c",(function(){return p})),a.d(e,"h",(function(){return d})),a.d(e,"i",(function(){return h})),a.d(e,"k",(function(){return m})),a.d(e,"n",(function(){return f})),a.d(e,"o",(function(){return g})),a.d(e,"g",(function(){return b})),a.d(e,"j",(function(){return v})),a.d(e,"d",(function(){return w}));var n=a("b775");function r(t){return Object(n["a"])({url:"/api/admin/cartoon/create",method:"post",data:t})}function i(t){return Object(n["a"])({url:"/api/admin/cartoon/cartoon_list",method:"get",params:t})}function o(t){return Object(n["a"])({url:"/api/admin/cartoon/chapter_list",method:"get",params:t})}function s(t){return Object(n["a"])({url:"/api/admin/cartoon/update",method:"post",data:t})}function c(t){return Object(n["a"])({url:"/api/admin/cartoon/createChapter",method:"post",data:t})}function l(t){return Object(n["a"])({url:"/api/admin/cartoon/updateChapter",method:"post",data:t})}function u(t){return Object(n["a"])({url:"/api/admin/cartoon/update_all",method:"post",data:t})}function p(t){return Object(n["a"])({url:"/api/admin/cartoon/check_cartoon",method:"post",data:t})}function d(t){return Object(n["a"])({url:"/api/admin/cartoon/delete",method:"post",data:t})}function h(t){return Object(n["a"])({url:"/api/admin/cartoon/deleteChapter",method:"post",data:t})}function m(t){return Object(n["a"])({url:"/api/admin/cartoon/type_list",method:"get",params:t})}function f(t){return Object(n["a"])({url:"/api/admin/cartoon/update_type",method:"post",data:t})}function g(t){return Object(n["a"])({url:"/api/admin/cartoon/update_type_all",method:"post",data:t})}function b(t){return Object(n["a"])({url:"/api/admin/cartoon/create_type",method:"post",data:t})}function v(t){return Object(n["a"])({url:"/api/admin/cartoon/delete_type",method:"post",data:t})}function w(t){return Object(n["a"])({url:"/api/admin/cache/clearCartoonCache",method:"get",params:t})}},"4a17":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-container"},[a("div",{staticClass:"filter-container"},[a("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"danger",icon:"el-icon-back",circle:""},on:{click:t.handleOpenCartoon}})],1),a("el-table",{key:t.tableKey,staticStyle:{width:"100%"},attrs:{"v-loading":t.listLoading,data:t.list,border:"",fit:"","highlight-current-row":""},on:{"sort-change":t.sortChange}},[a("el-table-column",{attrs:{label:"ID",prop:"id",sortable:"custom",align:"center",width:"80","class-name":t.getSortClass()},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[a("span",[t._v(t._s(n.id))])]}}])}),a("el-table-column",{attrs:{width:"70px",label:"章节",align:"center",prop:"chapter_sort",sortable:"custom"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[t.openSort?[a("el-input",{staticClass:"edit-input",attrs:{size:"small"},model:{value:n.listorder,callback:function(e){t.$set(n,"listorder",e)},expression:"row.listorder"}})]:a("span",[t._v(t._s(n.chapter_sort))])]}}])}),a("el-table-column",{attrs:{label:"章节名字","min-width":"150px",align:"center",to:"/404"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[a("span",[t._v(t._s(n.chapter_title))])]}}])}),a("el-table-column",{attrs:{label:"上架时间",width:"150px",align:"center",prop:"chapter_time",sortable:"custom"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[a("span",[t._v(t._s(t._f("parseTime")(n.chapter_time,"{y}-{m}-{d} {h}:{i}")))])]}}])}),a("el-table-column",{attrs:{label:"操作",align:"center",width:"300","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row,r=e.$index;return[a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(e){return t.handleUpdateChapter(n)}}},[t._v(" 编辑 ")]),0===n.delete?a("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(e){return t.handleDelete(n,r)}}},[t._v(" 删除 ")]):t._e()]}}])})],1),a("pagination",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total>0"}],attrs:{total:t.total,page:t.listQuery.page,limit:t.listQuery.limit},on:{"update:page":function(e){return t.$set(t.listQuery,"page",e)},"update:limit":function(e){return t.$set(t.listQuery,"limit",e)},pagination:t.getList}}),a("el-dialog",{attrs:{title:"章节",visible:t.chapterDialogFormVisible,"close-on-click-modal":!1},on:{"update:visible":function(e){t.chapterDialogFormVisible=e}}},[a("el-form",{ref:"chapterForm",staticStyle:{width:"400px","margin-left":"50px"},attrs:{rules:t.chapterRules,model:t.newChapter,"label-position":"left","label-width":"70px"}},[a("el-form-item",{attrs:{label:"章节名字",prop:"chapter_title"}},[a("el-input",{model:{value:t.newChapter.chapter_title,callback:function(e){t.$set(t.newChapter,"chapter_title",e)},expression:"newChapter.chapter_title"}})],1),a("el-form-item",{attrs:{label:"章节顺序",prop:"chapter_sort"}},[a("el-input",{model:{value:t.newChapter.chapter_sort,callback:function(e){t.$set(t.newChapter,"chapter_sort",e)},expression:"newChapter.chapter_sort"}})],1),a("el-form-item",{attrs:{label:"封面",prop:"chapter_img"}},[a("el-input",{model:{value:t.newChapter.chapter_img,callback:function(e){t.$set(t.newChapter,"chapter_img",e)},expression:"newChapter.chapter_img"}}),0!==t.percentage?a("el-progress",{attrs:{percentage:t.percentage}}):t._e(),a("el-upload",{attrs:{action:"http://up.haoxiao189.com/index/index/api","list-type":"picture-card","show-file-list":!1,"on-progress":t.handleProgress,"on-success":t.handleChapterSuccess}},[t.newChapter.chapter_img?a("img",{attrs:{width:"150",height:"150",src:t.newChapter.chapter_img,alt:""}}):a("i",{staticClass:"el-icon-plus"})])],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.chapterDialogFormVisible=!1}}},[t._v(" 取消 ")]),a("el-button",{attrs:{type:"primary"},on:{click:function(e){"create"===t.chapterDialogStatus?t.CreateChapter():t.updateChapter()}}},[t._v(" 提交 ")])],1)],1)],1)},r=[],i=(a("c740"),a("a434"),a("3bb8")),o=a("6724"),s=a("333d"),c={name:"CartoonChapter",components:{Pagination:s["a"]},directives:{waves:o["a"]},data:function(){return{tableKey:0,list:[],total:0,listLoading:!0,listQuery:{page:1,limit:20,name:void 0,sort:"id desc"},openSort:!1,newVideo:{},newChapter:{},dialogFormVisible:!1,dialogStatus:"",chapterDialogFormVisible:!1,chapterDialogStatus:"",textMap:{update:"编辑",create:"创建"},percentage:0,dialogVisible:!1,rules:{title:[{required:!0,message:"请输入漫画名字",trigger:"blur"}],img:[{required:!0,message:"请上传封面",trigger:"blur"}]},chapterRules:{chapter_title:[{required:!0,message:"请输入漫画名字",trigger:"blur"}],chapter_img:[{required:!0,message:"请上传封面",trigger:"blur"}]}}},activated:function(){this.listQuery.cartoon_id=this.$route.query.cartoon_id,this.getList()},methods:{getList:function(){var t=this;this.listLoading=!0,Object(i["b"])(this.listQuery).then((function(e){t.total=e.data.total,t.list=e.data.list,t.listLoading=!1}))},handleFilter:function(){this.listQuery.page=1,this.getList()},sortChange:function(t){var e=t.prop,a=t.order;this.listQuery.sort="ascending"===a?e:e+" desc",this.handleFilter()},handleDelete:function(t,e){var a=this;this.listLoading=!0,Object(i["i"])(t).then((function(){a.list.splice(e,1),a.listLoading=!1,a.$notify({title:"Success",message:"操作成功",type:"success",duration:2e3})})).catch((function(){a.listLoading=!1}))},getSortClass:function(){var t=this.listQuery.sort;return"id"===t?"ascending":"descending"},handleCreateChapter:function(t){var e=this;this.newChapter={cartoon_id:t.id},this.chapterDialogStatus="create",this.chapterDialogFormVisible=!0,this.percentage=0,this.$nextTick((function(){e.$refs["chapterForm"].clearValidate()}))},CreateChapter:function(){var t=this;this.$refs["chapterForm"].validate((function(e){e&&Object(i["f"])(t.newChapter).then((function(){t.chapterDialogFormVisible=!1,t.getList(),t.$notify({title:"Success",message:"创建成功",type:"success",duration:2e3})}))}))},handleUpdateChapter:function(t){var e=this;this.newChapter=Object.assign({},t),this.chapterDialogStatus="update",this.chapterDialogFormVisible=!0,this.percentage=0,this.$nextTick((function(){e.$refs["chapterForm"].clearValidate()}))},updateChapter:function(){var t=this;this.$refs["chapterForm"].validate((function(e){if(e){var a=Object.assign({},t.newChapter);Object(i["m"])(a).then((function(){var e=t.list.findIndex((function(e){return e.id===t.newChapter.id}));t.list.splice(e,1,t.newChapter),t.chapterDialogFormVisible=!1,t.$notify({title:"Success",message:"操作成功",type:"success",duration:2e3})}))}}))},handleSuccess:function(t){var e=t.filepath;this.$set(this.newVideo,"img",e)},handleChapterSuccess:function(t){var e=t.filepath;this.$set(this.newChapter,"chapter_img",e)},handleProgress:function(t){this.percentage=t.percent},handleOpenCartoon:function(t,e,a){this.$router.push({path:"cartoon-list"})}}},l=c,u=a("2877"),p=Object(u["a"])(l,n,r,!1,null,null,null);e["default"]=p.exports},6724:function(t,e,a){"use strict";a("8d41");var n="@@wavesContext";function r(t,e){function a(a){var n=Object.assign({},e.value),r=Object.assign({ele:t,type:"hit",color:"rgba(0, 0, 0, 0.15)"},n),i=r.ele;if(i){i.style.position="relative",i.style.overflow="hidden";var o=i.getBoundingClientRect(),s=i.querySelector(".waves-ripple");switch(s?s.className="waves-ripple":(s=document.createElement("span"),s.className="waves-ripple",s.style.height=s.style.width=Math.max(o.width,o.height)+"px",i.appendChild(s)),r.type){case"center":s.style.top=o.height/2-s.offsetHeight/2+"px",s.style.left=o.width/2-s.offsetWidth/2+"px";break;default:s.style.top=(a.pageY-o.top-s.offsetHeight/2-document.documentElement.scrollTop||document.body.scrollTop)+"px",s.style.left=(a.pageX-o.left-s.offsetWidth/2-document.documentElement.scrollLeft||document.body.scrollLeft)+"px"}return s.style.backgroundColor=r.color,s.className="waves-ripple z-active",!1}}return t[n]?t[n].removeHandle=a:t[n]={removeHandle:a},a}var i={bind:function(t,e){t.addEventListener("click",r(t,e),!1)},update:function(t,e){t.removeEventListener("click",t[n].removeHandle,!1),t.addEventListener("click",r(t,e),!1)},unbind:function(t){t.removeEventListener("click",t[n].removeHandle,!1),t[n]=null,delete t[n]}},o=function(t){t.directive("waves",i)};window.Vue&&(window.waves=i,Vue.use(o)),i.install=o;e["a"]=i},"8d41":function(t,e,a){}}]);