chunk-6ff76bca.391c1729.js
18.4 KB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6ff76bca"],{"09f4":function(t,e,i){"use strict";i.d(e,"a",(function(){return o})),Math.easeInOutQuad=function(t,e,i,a){return t/=a/2,t<1?i/2*t*t+e:(t--,-i/2*(t*(t-2)-1)+e)};var a=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function n(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}function r(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function o(t,e,i){var o=r(),s=t-o,l=20,c=0;e="undefined"===typeof e?500:e;var u=function t(){c+=l;var r=Math.easeInOutQuad(c,o,s,e);n(r),c<e?a(t):i&&"function"===typeof i&&i()};u()}},"3bb8":function(t,e,i){"use strict";i.d(e,"e",(function(){return n})),i.d(e,"a",(function(){return r})),i.d(e,"b",(function(){return o})),i.d(e,"p",(function(){return s})),i.d(e,"f",(function(){return l})),i.d(e,"m",(function(){return c})),i.d(e,"l",(function(){return u})),i.d(e,"c",(function(){return d})),i.d(e,"h",(function(){return p})),i.d(e,"i",(function(){return h})),i.d(e,"k",(function(){return f})),i.d(e,"n",(function(){return m})),i.d(e,"o",(function(){return g})),i.d(e,"g",(function(){return b})),i.d(e,"j",(function(){return w})),i.d(e,"d",(function(){return v}));var a=i("b775");function n(t){return Object(a["a"])({url:"/api/admin/cartoon/create",method:"post",data:t})}function r(t){return Object(a["a"])({url:"/api/admin/cartoon/cartoon_list",method:"get",params:t})}function o(t){return Object(a["a"])({url:"/api/admin/cartoon/chapter_list",method:"get",params:t})}function s(t){return Object(a["a"])({url:"/api/admin/cartoon/update",method:"post",data:t})}function l(t){return Object(a["a"])({url:"/api/admin/cartoon/createChapter",method:"post",data:t})}function c(t){return Object(a["a"])({url:"/api/admin/cartoon/updateChapter",method:"post",data:t})}function u(t){return Object(a["a"])({url:"/api/admin/cartoon/update_all",method:"post",data:t})}function d(t){return Object(a["a"])({url:"/api/admin/cartoon/check_cartoon",method:"post",data:t})}function p(t){return Object(a["a"])({url:"/api/admin/cartoon/delete",method:"post",data:t})}function h(t){return Object(a["a"])({url:"/api/admin/cartoon/deleteChapter",method:"post",data:t})}function f(t){return Object(a["a"])({url:"/api/admin/cartoon/type_list",method:"get",params:t})}function m(t){return Object(a["a"])({url:"/api/admin/cartoon/update_type",method:"post",data:t})}function g(t){return Object(a["a"])({url:"/api/admin/cartoon/update_type_all",method:"post",data:t})}function b(t){return Object(a["a"])({url:"/api/admin/cartoon/create_type",method:"post",data:t})}function w(t){return Object(a["a"])({url:"/api/admin/cartoon/delete_type",method:"post",data:t})}function v(t){return Object(a["a"])({url:"/api/admin/cache/clearCartoonCache",method:"get",params:t})}},6724:function(t,e,i){"use strict";i("8d41");var a="@@wavesContext";function n(t,e){function i(i){var a=Object.assign({},e.value),n=Object.assign({ele:t,type:"hit",color:"rgba(0, 0, 0, 0.15)"},a),r=n.ele;if(r){r.style.position="relative",r.style.overflow="hidden";var o=r.getBoundingClientRect(),s=r.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",r.appendChild(s)),n.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=(i.pageY-o.top-s.offsetHeight/2-document.documentElement.scrollTop||document.body.scrollTop)+"px",s.style.left=(i.pageX-o.left-s.offsetWidth/2-document.documentElement.scrollLeft||document.body.scrollLeft)+"px"}return s.style.backgroundColor=n.color,s.className="waves-ripple z-active",!1}}return t[a]?t[a].removeHandle=i:t[a]={removeHandle:i},i}var r={bind:function(t,e){t.addEventListener("click",n(t,e),!1)},update:function(t,e){t.removeEventListener("click",t[a].removeHandle,!1),t.addEventListener("click",n(t,e),!1)},unbind:function(t){t.removeEventListener("click",t[a].removeHandle,!1),t[a]=null,delete t[a]}},o=function(t){t.directive("waves",r)};window.Vue&&(window.waves=r,Vue.use(o)),r.install=o;e["a"]=r},"8d41":function(t,e,i){},deeb:function(t,e,i){"use strict";i.r(e);var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"app-container"},[i("div",{staticClass:"filter-container"},[i("el-input",{staticClass:"filter-item",staticStyle:{width:"200px"},attrs:{placeholder:"ID"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleFilter(e)}},model:{value:t.listQuery.id,callback:function(e){t.$set(t.listQuery,"id",e)},expression:"listQuery.id"}}),i("el-input",{staticClass:"filter-item",staticStyle:{width:"200px"},attrs:{placeholder:"漫画名字"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleFilter(e)}},model:{value:t.listQuery.name,callback:function(e){t.$set(t.listQuery,"name",e)},expression:"listQuery.name"}}),i("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:t.handleFilter}},[t._v(" 搜索 ")]),i("el-select",{staticClass:"filter-item",staticStyle:{width:"130px"},attrs:{placeholder:"分类",clearable:""},model:{value:t.listQuery.video_type,callback:function(e){t.$set(t.listQuery,"video_type",e)},expression:"listQuery.video_type"}},t._l(t.typesOptions,(function(t){return i("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1),t.openSort?t._e():i("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-edit"},on:{click:t.handleSort}},[t._v(" 排序 ")]),t.openSort?i("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"success",icon:"el-icon-edit"},on:{click:t.handleSortConfirm}},[t._v(" 确认 ")]):t._e(),t.openSort?i("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"danger",icon:"el-icon-edit"},on:{click:t.handleSortCancel}},[t._v(" 取消 ")]):t._e(),i("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-edit"},on:{click:t.handleCreate}},[t._v(" 创建 ")]),i("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"danger",icon:"el-icon-delete"},on:{click:t.handleClearCache}},[t._v(" 清除缓存 ")])],1),i("el-table",{key:t.tableKey,staticStyle:{width:"100%"},attrs:{"v-loading":t.listLoading,data:t.list,border:"",fit:"","highlight-current-row":""},on:{"row-dblclick":t.handleOpenChapter,"sort-change":t.sortChange}},[i("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 a=e.row;return[i("span",[t._v(t._s(a.id))])]}}])}),i("el-table-column",{attrs:{width:"70px",label:"排序",align:"center",prop:"list_sort",sortable:"custom"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[t.openSort?[i("el-input",{staticClass:"edit-input",attrs:{size:"small"},model:{value:a.list_sort,callback:function(e){t.$set(a,"list_sort",e)},expression:"row.list_sort"}})]:i("span",[t._v(t._s(a.list_sort))])]}}])}),i("el-table-column",{attrs:{label:"漫画名字","min-width":"150px",align:"center",to:"/404"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[i("span",[t._v(t._s(a.title))])]}}])}),i("el-table-column",{attrs:{label:"状态",align:"center",width:"80","class-name":"small-padding fixed-width",prop:"is_check",sortable:"custom"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[1==a.is_check?i("el-button",{attrs:{size:"mini",type:"success"},on:{click:function(e){return t.handleCheckStatus(a,0)}}},[t._v(" "+t._s(t._f("isCheckFilter")(a.is_check))+" ")]):t._e(),0==a.is_check?i("el-button",{attrs:{size:"mini",type:"draft"},on:{click:function(e){return t.handleCheckStatus(a,1)}}},[t._v(" "+t._s(t._f("isCheckFilter")(a.is_check))+" ")]):t._e()]}}])}),i("el-table-column",{attrs:{label:"发布时间",width:"150px",align:"center",prop:"release_time",sortable:"custom"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[i("span",[t._v(t._s(t._f("parseTime")(a.release_time,"{y}-{m}-{d} {h}:{i}")))])]}}])}),i("el-table-column",{attrs:{label:"操作",align:"center",width:"300","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row,n=e.$index;return[i("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(e){return t.handleUpdate(a)}}},[t._v(" 编辑 ")]),i("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(e){return t.handleCreateChapter(a)}}},[t._v(" 添加章节 ")]),0===a.delete?i("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(e){return t.handleDelete(a,n)}}},[t._v(" 删除 ")]):t._e()]}}])})],1),i("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}}),i("el-dialog",{attrs:{title:t.textMap[t.dialogStatus],visible:t.dialogFormVisible,"close-on-click-modal":!1},on:{"update:visible":function(e){t.dialogFormVisible=e}}},[i("el-form",{ref:"dataForm",staticStyle:{width:"400px","margin-left":"50px"},attrs:{rules:t.rules,model:t.newVideo,"label-position":"left","label-width":"70px"}},[i("el-form-item",{attrs:{label:"漫画名字",prop:"title"}},[i("el-input",{model:{value:t.newVideo.title,callback:function(e){t.$set(t.newVideo,"title",e)},expression:"newVideo.title"}})],1),i("el-form-item",{attrs:{label:"分类",prop:"tid"}},[i("el-checkbox-group",{model:{value:t.newVideo.tid,callback:function(e){t.$set(t.newVideo,"tid",e)},expression:"newVideo.tid"}},t._l(t.typesOptions,(function(e){return i("el-checkbox",{key:e.id,attrs:{label:e.id,"true-label":""}},[t._v(t._s(e.name))])})),1)],1),i("el-form-item",{attrs:{label:"作者",prop:"actors"}},[i("el-input",{model:{value:t.newVideo.actor,callback:function(e){t.$set(t.newVideo,"actor",e)},expression:"newVideo.actor"}})],1),i("el-form-item",{attrs:{label:"浏览次数",prop:"views"}},[i("el-input",{model:{value:t.newVideo.views,callback:function(e){t.$set(t.newVideo,"views",e)},expression:"newVideo.views"}})],1),i("el-form-item",{attrs:{label:"封面",prop:"img"}},[i("el-input",{model:{value:t.newVideo.img,callback:function(e){t.$set(t.newVideo,"img",e)},expression:"newVideo.img"}}),0!==t.percentage?i("el-progress",{attrs:{percentage:t.percentage}}):t._e(),i("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.handleSuccess}},[t.newVideo.img?i("img",{attrs:{width:"150",height:"150",src:t.newVideo.img,alt:""}}):i("i",{staticClass:"el-icon-plus"})]),i("el-dialog",{attrs:{visible:t.dialogVisible},on:{"update:visible":function(e){t.dialogVisible=e}}},[i("img",{attrs:{width:"100%",src:t.newVideo.img,alt:""}})])],1),i("el-form-item",{attrs:{label:"简介"}},[i("el-input",{attrs:{autosize:{minRows:2,maxRows:4},type:"textarea",placeholder:"输入简介.."},model:{value:t.newVideo.describe,callback:function(e){t.$set(t.newVideo,"describe",e)},expression:"newVideo.describe"}})],1)],1),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(e){t.dialogFormVisible=!1}}},[t._v(" 取消 ")]),i("el-button",{attrs:{type:"primary"},on:{click:function(e){"create"===t.dialogStatus?t.createData():t.updateData()}}},[t._v(" 提交 ")])],1)],1),i("el-dialog",{attrs:{title:"章节",visible:t.chapterDialogFormVisible,"close-on-click-modal":!1},on:{"update:visible":function(e){t.chapterDialogFormVisible=e}}},[i("el-form",{ref:"chapterForm",staticStyle:{width:"400px","margin-left":"50px"},attrs:{rules:t.chapterRules,model:t.newChapter,"label-position":"left","label-width":"70px"}},[i("el-form-item",{attrs:{label:"章节名字",prop:"chapter_title"}},[i("el-input",{model:{value:t.newChapter.chapter_title,callback:function(e){t.$set(t.newChapter,"chapter_title",e)},expression:"newChapter.chapter_title"}})],1),i("el-form-item",{attrs:{label:"章节顺序",prop:"chapter_sort"}},[i("el-input",{model:{value:t.newChapter.chapter_sort,callback:function(e){t.$set(t.newChapter,"chapter_sort",e)},expression:"newChapter.chapter_sort"}})],1),i("el-form-item",{attrs:{label:"封面",prop:"chapter_img"}},[i("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?i("el-progress",{attrs:{percentage:t.percentage}}):t._e(),i("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?i("img",{attrs:{width:"150",height:"150",src:t.newChapter.chapter_img,alt:""}}):i("i",{staticClass:"el-icon-plus"})])],1)],1),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(e){t.chapterDialogFormVisible=!1}}},[t._v(" 取消 ")]),i("el-button",{attrs:{type:"primary"},on:{click:function(e){"create"===t.chapterDialogStatus?t.CreateChapter():t.updateChapter()}}},[t._v(" 提交 ")])],1)],1)],1)},n=[],r=(i("c740"),i("a434"),i("3bb8")),o=i("6724"),s=i("333d"),l=["下线","上线"],c=["普通","推荐"],u={name:"CartoonList",components:{Pagination:s["a"]},directives:{waves:o["a"]},filters:{isCheckFilter:function(t){return l[t]},betterShowFilter:function(t){return c[t]}},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:"",typesOptions:[],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"}]}}},created:function(){this.getList()},methods:{getList:function(){var t=this;this.listLoading=!0,Object(r["a"])(this.listQuery).then((function(e){t.total=e.data.total,t.list=e.data.list,t.typesOptions=e.data.types,t.listLoading=!1}))},handleFilter:function(){this.listQuery.page=1,this.getList()},sortChange:function(t){var e=t.prop,i=t.order;this.listQuery.sort="ascending"===i?e:e+" desc",this.handleFilter()},handleUpdate:function(t){var e=this;this.newVideo=Object.assign({},t),this.newVideo.release_time=new Date(this.newVideo.release_time),this.dialogStatus="update",this.dialogFormVisible=!0,this.percentage=0,this.$nextTick((function(){e.$refs["dataForm"].clearValidate()}))},updateData:function(){var t=this;this.$refs["dataForm"].validate((function(e){if(e){var i=Object.assign({},t.newVideo);i.release_time=+new Date(i.release_time),Object(r["p"])(i).then((function(){var e=t.list.findIndex((function(e){return e.id===t.newVideo.id}));t.list.splice(e,1,t.newVideo),t.dialogFormVisible=!1,t.$notify({title:"Success",message:"操作成功",type:"success",duration:2e3})}))}}))},handleDelete:function(t,e){var i=this;this.listLoading=!0,Object(r["h"])(t).then((function(){i.list.splice(e,1),i.listLoading=!1,i.$notify({title:"Success",message:"操作成功",type:"success",duration:2e3})})).catch((function(){i.listLoading=!1}))},getSortClass:function(){var t=this.listQuery.sort;return"id"===t?"ascending":"descending"},handleCheckStatus:function(t,e){var i=this;this.listLoading=!0,t.is_check=e,Object(r["c"])(t).then((function(){i.listLoading=!1,i.$notify({title:"Success",message:"操作成功",type:"success",duration:2e3})})).catch((function(){i.listLoading=!1}))},handleSort:function(){this.openSort=!0},handleSortCancel:function(){this.getList(),this.openSort=!1},handleSortConfirm:function(){var t=this;if(this.listLoading=!0,this.list){var e=Object.assign({},this.list);Object(r["l"])(e).then((function(e){t.openSort=!1,t.listLoading=!1,t.$notify({title:"成功",message:e.message,type:"success",duration:2e3})})).catch((function(){t.listLoading=!1}))}},handleCreate:function(t,e){var i=this;this.newVideo={tid:[]},this.dialogStatus="create",this.dialogFormVisible=!0,this.percentage=0,this.$nextTick((function(){i.$refs["dataForm"].clearValidate()}))},createData:function(){var t=this;this.$refs["dataForm"].validate((function(e){e&&Object(r["e"])(t.newVideo).then((function(){t.dialogFormVisible=!1,t.getList(),t.$notify({title:"Success",message:"创建成功",type:"success",duration:2e3})}))}))},handleClearCache:function(){var t=this;Object(r["d"])().then((function(){t.$notify({title:"Success",message:"清除成功",type:"success",duration:2e3})}))},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(r["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 i=Object.assign({},t.newChapter);Object(r["m"])(i).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="https://t.ztgfgroup.com/"+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},handleOpenChapter:function(t,e,i){this.$router.push({path:"cartoon-chapter",query:{cartoon_id:t.id}})}}},d=u,p=i("2877"),h=Object(p["a"])(d,a,n,!1,null,null,null);e["default"]=h.exports}}]);