chunk-1b54c302.ffe36fdb.js 9.42 KB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1b54c302"],{"09f4":function(e,t,i){"use strict";i.d(t,"a",(function(){return l})),Math.easeInOutQuad=function(e,t,i,n){return e/=n/2,e<1?i/2*e*e+t:(e--,-i/2*(e*(e-2)-1)+t)};var n=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function a(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function o(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function l(e,t,i){var l=o(),s=e-l,r=20,c=0;t="undefined"===typeof t?500:t;var u=function e(){c+=r;var o=Math.easeInOutQuad(c,l,s,t);a(o),c<t?n(e):i&&"function"===typeof i&&i()};u()}},6724:function(e,t,i){"use strict";i("8d41");var n="@@wavesContext";function a(e,t){function i(i){var n=Object.assign({},t.value),a=Object.assign({ele:e,type:"hit",color:"rgba(0, 0, 0, 0.15)"},n),o=a.ele;if(o){o.style.position="relative",o.style.overflow="hidden";var l=o.getBoundingClientRect(),s=o.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(l.width,l.height)+"px",o.appendChild(s)),a.type){case"center":s.style.top=l.height/2-s.offsetHeight/2+"px",s.style.left=l.width/2-s.offsetWidth/2+"px";break;default:s.style.top=(i.pageY-l.top-s.offsetHeight/2-document.documentElement.scrollTop||document.body.scrollTop)+"px",s.style.left=(i.pageX-l.left-s.offsetWidth/2-document.documentElement.scrollLeft||document.body.scrollLeft)+"px"}return s.style.backgroundColor=a.color,s.className="waves-ripple z-active",!1}}return e[n]?e[n].removeHandle=i:e[n]={removeHandle:i},i}var o={bind:function(e,t){e.addEventListener("click",a(e,t),!1)},update:function(e,t){e.removeEventListener("click",e[n].removeHandle,!1),e.addEventListener("click",a(e,t),!1)},unbind:function(e){e.removeEventListener("click",e[n].removeHandle,!1),e[n]=null,delete e[n]}},l=function(e){e.directive("waves",o)};window.Vue&&(window.waves=o,Vue.use(l)),o.install=l;t["a"]=o},"8d41":function(e,t,i){},fa39:function(e,t,i){"use strict";i.r(t);var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;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(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleFilter(t)}},model:{value:e.listQuery.id,callback:function(t){e.$set(e.listQuery,"id",t)},expression:"listQuery.id"}}),i("el-input",{staticClass:"filter-item",staticStyle:{width:"200px"},attrs:{placeholder:"名字"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleFilter(t)}},model:{value:e.listQuery.name,callback:function(t){e.$set(e.listQuery,"name",t)},expression:"listQuery.name"}}),i("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:e.handleFilter}},[e._v(" 搜索 ")]),i("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-edit"},on:{click:e.handleCreate}},[e._v(" 创建 ")])],1),i("el-table",{key:e.tableKey,staticStyle:{width:"100%"},attrs:{"v-loading":e.listLoading,data:e.list,border:"",fit:"","highlight-current-row":""},on:{"sort-change":e.sortChange}},[i("el-table-column",{attrs:{label:"ID",prop:"id",sortable:"custom",align:"center",width:"80","class-name":e.getSortClass()},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[i("span",[e._v(e._s(n.id))])]}}])}),i("el-table-column",{attrs:{label:"名字","min-width":"150px",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[i("span",[e._v(e._s(n.name))])]}}])}),i("el-table-column",{attrs:{label:"路由","min-width":"150px",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[i("span",[e._v(e._s(n.path))])]}}])}),i("el-table-column",{attrs:{label:"操作",align:"center",width:"300","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row,a=t.$index;return[i("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(t){return e.handleUpdate(n)}}},[e._v(" 编辑 ")]),1===n.status?i("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(t){return e.handleDelete(n,a)}}},[e._v(" 删除 ")]):e._e()]}}])})],1),i("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total>0"}],attrs:{total:e.total,page:e.listQuery.page,limit:e.listQuery.limit},on:{"update:page":function(t){return e.$set(e.listQuery,"page",t)},"update:limit":function(t){return e.$set(e.listQuery,"limit",t)},pagination:e.getList}}),i("el-dialog",{attrs:{title:e.textMap[e.dialogStatus],visible:e.dialogFormVisible,"close-on-click-modal":!1},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[i("el-form",{ref:"dataForm",staticStyle:{width:"400px","margin-left":"50px"},attrs:{rules:e.rules,model:e.newVideo,"label-position":"left","label-width":"70px"}},[i("el-form-item",{attrs:{label:"名字",prop:"name"}},[i("el-input",{model:{value:e.newVideo.name,callback:function(t){e.$set(e.newVideo,"name",t)},expression:"newVideo.name"}})],1),i("el-form-item",{attrs:{label:"上级ID",prop:"parentid"}},[i("el-input",{attrs:{type:"number"},model:{value:e.newVideo.parentid,callback:function(t){e.$set(e.newVideo,"parentid",t)},expression:"newVideo.parentid"}})],1),i("el-form-item",{attrs:{label:"路由",prop:"path"}},[i("el-input",{model:{value:e.newVideo.path,callback:function(t){e.$set(e.newVideo,"path",t)},expression:"newVideo.path"}})],1)],1),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(t){e.dialogFormVisible=!1}}},[e._v(" 取消 ")]),i("el-button",{attrs:{type:"primary"},on:{click:function(t){"create"===e.dialogStatus?e.createData():e.updateData()}}},[e._v(" 提交 ")])],1)],1)],1)},a=[],o=(i("c740"),i("a434"),i("b775"));function l(e){return Object(o["a"])({url:"/api/admin/menu/getList",method:"get",params:e})}function s(e){return Object(o["a"])({url:"/api/admin/menu/create",method:"post",data:e})}function r(e){return Object(o["a"])({url:"/api/admin/menu/update",method:"post",data:e})}function c(e){return Object(o["a"])({url:"/api/admin/menu/delete",method:"post",data:e})}var u=i("6724"),d=i("333d"),p=["下线","上线"],m=["普通","推荐"],f={name:"MenuList",components:{Pagination:d["a"]},directives:{waves:u["a"]},filters:{isCheckFilter:function(e){return p[e]},betterShowFilter:function(e){return m[e]}},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 e=this;this.listLoading=!0,l(this.listQuery).then((function(t){e.total=t.data.total,e.list=t.data.list,e.typesOptions=t.data.types,e.listLoading=!1}))},handleFilter:function(){this.listQuery.page=1,this.getList()},sortChange:function(e){var t=e.prop,i=e.order;this.listQuery.sort="ascending"===i?t:t+" desc",this.handleFilter()},handleUpdate:function(e){var t=this;this.newVideo=Object.assign({},e),this.newVideo.release_time=new Date(this.newVideo.release_time),this.dialogStatus="update",this.dialogFormVisible=!0,this.percentage=0,this.$nextTick((function(){t.$refs["dataForm"].clearValidate()}))},updateData:function(){var e=this;this.$refs["dataForm"].validate((function(t){if(t){var i=Object.assign({},e.newVideo);i.release_time=+new Date(i.release_time),r(i).then((function(){var t=e.list.findIndex((function(t){return t.id===e.newVideo.id}));e.list.splice(t,1,e.newVideo),e.dialogFormVisible=!1,e.$notify({title:"Success",message:"操作成功",type:"success",duration:2e3})}))}}))},handleDelete:function(e,t){var i=this;this.$confirm("此操作将回收, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){i.listLoading=!0,c(e).then((function(){i.list.splice(t,1),i.listLoading=!1,i.$notify({title:"Success",message:"操作成功",type:"success",duration:2e3})})).catch((function(){i.listLoading=!1}))})).catch((function(){i.$message({type:"info",message:"已取消删除"})}))},getSortClass:function(){var e=this.listQuery.sort;return"id"===e?"ascending":"descending"},handleSort:function(){this.openSort=!0},handleSortCancel:function(){this.getList(),this.openSort=!1},handleCreate:function(e,t){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 e=this;this.$refs["dataForm"].validate((function(t){t&&s(e.newVideo).then((function(){e.dialogFormVisible=!1,e.getList(),e.$notify({title:"Success",message:"创建成功",type:"success",duration:2e3})}))}))}}},h=f,g=i("2877"),y=Object(g["a"])(h,n,a,!1,null,null,null);t["default"]=y.exports}}]);