chunk-da137afc.d03ab7cd.js
12.1 KB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-da137afc"],{"09f4":function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),Math.easeInOutQuad=function(e,t,n,i){return e/=i/2,e<1?n/2*e*e+t:(e--,-n/2*(e*(e-2)-1)+t)};var i=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 r(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function o(e,t,n){var o=r(),l=e-o,s=20,c=0;t="undefined"===typeof t?500:t;var d=function e(){c+=s;var r=Math.easeInOutQuad(c,o,l,t);a(r),c<t?i(e):n&&"function"===typeof n&&n()};d()}},"261f":function(e,t,n){"use strict";n.d(t,"q",(function(){return a})),n.d(t,"d",(function(){return r})),n.d(t,"l",(function(){return o})),n.d(t,"h",(function(){return l})),n.d(t,"m",(function(){return s})),n.d(t,"a",(function(){return c})),n.d(t,"i",(function(){return d})),n.d(t,"e",(function(){return u})),n.d(t,"p",(function(){return p})),n.d(t,"c",(function(){return f})),n.d(t,"k",(function(){return m})),n.d(t,"g",(function(){return h})),n.d(t,"o",(function(){return v})),n.d(t,"b",(function(){return b})),n.d(t,"j",(function(){return g})),n.d(t,"f",(function(){return w})),n.d(t,"n",(function(){return y}));var i=n("b775");function a(e){return Object(i["a"])({url:"/api/admin/advert/start_list",method:"get",params:e})}function r(e){return Object(i["a"])({url:"/api/admin/advert/create_start",method:"post",data:e})}function o(e){return Object(i["a"])({url:"/api/admin/advert/update_start",method:"post",data:e})}function l(e){return Object(i["a"])({url:"/api/admin/advert/delete_start",method:"post",data:e})}function s(e){return Object(i["a"])({url:"/api/admin/advert/banner_list",method:"get",params:e})}function c(e){return Object(i["a"])({url:"/api/admin/advert/create_banner",method:"post",data:e})}function d(e){return Object(i["a"])({url:"/api/admin/advert/update_banner",method:"post",data:e})}function u(e){return Object(i["a"])({url:"/api/admin/advert/delete_banner",method:"post",data:e})}function p(e){return Object(i["a"])({url:"/api/admin/advert/playerdown_list",method:"get",params:e})}function f(e){return Object(i["a"])({url:"/api/admin/advert/create_playerdown",method:"post",data:e})}function m(e){return Object(i["a"])({url:"/api/admin/advert/update_playerdown",method:"post",data:e})}function h(e){return Object(i["a"])({url:"/api/admin/advert/delete_playerdown",method:"post",data:e})}function v(e){return Object(i["a"])({url:"/api/admin/advert/mycentre_list",method:"get",params:e})}function b(e){return Object(i["a"])({url:"/api/admin/advert/create_mycentre",method:"post",data:e})}function g(e){return Object(i["a"])({url:"/api/admin/advert/update_mycentre",method:"post",data:e})}function w(e){return Object(i["a"])({url:"/api/admin/advert/delete_mycentre",method:"post",data:e})}function y(e){return Object(i["a"])({url:"/api/admin/cache/clearAdvertCache",method:"get",params:e})}},6724:function(e,t,n){"use strict";n("8d41");var i="@@wavesContext";function a(e,t){function n(n){var i=Object.assign({},t.value),a=Object.assign({ele:e,type:"hit",color:"rgba(0, 0, 0, 0.15)"},i),r=a.ele;if(r){r.style.position="relative",r.style.overflow="hidden";var o=r.getBoundingClientRect(),l=r.querySelector(".waves-ripple");switch(l?l.className="waves-ripple":(l=document.createElement("span"),l.className="waves-ripple",l.style.height=l.style.width=Math.max(o.width,o.height)+"px",r.appendChild(l)),a.type){case"center":l.style.top=o.height/2-l.offsetHeight/2+"px",l.style.left=o.width/2-l.offsetWidth/2+"px";break;default:l.style.top=(n.pageY-o.top-l.offsetHeight/2-document.documentElement.scrollTop||document.body.scrollTop)+"px",l.style.left=(n.pageX-o.left-l.offsetWidth/2-document.documentElement.scrollLeft||document.body.scrollLeft)+"px"}return l.style.backgroundColor=a.color,l.className="waves-ripple z-active",!1}}return e[i]?e[i].removeHandle=n:e[i]={removeHandle:n},n}var r={bind:function(e,t){e.addEventListener("click",a(e,t),!1)},update:function(e,t){e.removeEventListener("click",e[i].removeHandle,!1),e.addEventListener("click",a(e,t),!1)},unbind:function(e){e.removeEventListener("click",e[i].removeHandle,!1),e[i]=null,delete e[i]}},o=function(e){e.directive("waves",r)};window.Vue&&(window.waves=r,Vue.use(o)),r.install=o;t["a"]=r},"813e":function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-container"},[n("div",{staticClass:"filter-container"},[n("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-edit"},on:{click:e.handleCreate}},[e._v(" 创建 ")])],1),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],key:e.tableKey,staticStyle:{width:"100%"},attrs:{data:e.list,border:"",fit:"","highlight-current-row":""},on:{"sort-change":e.sortChange}},[n("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 i=t.row;return[n("span",[e._v(e._s(i.id))])]}}])}),n("el-table-column",{attrs:{label:"标题","min-width":"150px",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[n("span",[e._v(e._s(i.title))])]}}])}),n("el-table-column",{attrs:{label:"广告","min-width":"150px",align:"center"},scopedSlots:e._u([{key:"default",fn:function(e){var t=e.row;return[n("el-image",{staticStyle:{width:"100px",height:"100px"},attrs:{src:t.img,fit:"fill"}})]}}])}),n("el-table-column",{attrs:{label:"外链","min-width":"150px",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[n("span",[e._v(e._s(i.url))])]}}])}),n("el-table-column",{attrs:{label:"展示时间",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[n("span",[e._v(e._s(i.showtime))])]}}])}),n("el-table-column",{attrs:{label:"状态",align:"center",width:"80","class-name":"small-padding fixed-width",prop:"ischeck",sortable:"custom"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[1==i.ischeck?n("el-button",{attrs:{size:"mini",type:"success"},on:{click:function(t){return e.handleCheckStatus(i,0)}}},[e._v(" "+e._s(e._f("isCheckFilter")(i.ischeck))+" ")]):e._e(),0==i.ischeck?n("el-button",{attrs:{size:"mini",type:"draft"},on:{click:function(t){return e.handleCheckStatus(i,1)}}},[e._v(" "+e._s(e._f("isCheckFilter")(i.ischeck))+" ")]):e._e()]}}])}),n("el-table-column",{attrs:{label:"操作",align:"center",width:"200","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row,a=t.$index;return[n("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(t){return e.handleUpdate(i)}}},[e._v(" 编辑 ")]),n("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(t){return e.handleDelete(i,a)}}},[e._v(" 删除 ")])]}}])})],1),n("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}}),n("el-dialog",{attrs:{title:e.textMap[e.dialogStatus],visible:e.dialogFormVisible,"close-on-click-modal":!1},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[n("el-form",{ref:"dataForm",staticStyle:{width:"400px","margin-left":"50px"},attrs:{rules:e.rules,model:e.newVideo,"label-position":"right","label-width":"70px"}},[n("el-form-item",{attrs:{label:"标题",prop:"title"}},[n("el-input",{model:{value:e.newVideo.title,callback:function(t){e.$set(e.newVideo,"title",t)},expression:"newVideo.title"}})],1),n("el-form-item",{attrs:{label:"类型",prop:"type"}},[n("el-select",{staticClass:"filter-item",attrs:{placeholder:"选择一个类型"},model:{value:e.newVideo.type,callback:function(t){e.$set(e.newVideo,"type",t)},expression:"newVideo.type"}},[n("el-option",{key:"1",attrs:{label:"外链",value:"1"}}),n("el-option",{key:"2",attrs:{label:"影片",value:"2"}})],1)],1),n("el-form-item",{attrs:{label:"图片链接",prop:"img"}},[n("el-input",{model:{value:e.newVideo.img,callback:function(t){e.$set(e.newVideo,"img",t)},expression:"newVideo.img"}})],1),n("el-form-item",{attrs:{label:"外链",prop:"url"}},[n("el-input",{model:{value:e.newVideo.url,callback:function(t){e.$set(e.newVideo,"url",t)},expression:"newVideo.url"}})],1),n("el-form-item",{attrs:{label:"展示时间",prop:"showtime"}},[n("el-input",{model:{value:e.newVideo.showtime,callback:function(t){e.$set(e.newVideo,"showtime",t)},expression:"newVideo.showtime"}})],1),n("el-form-item",{attrs:{label:"开启",prop:"ischeck"}},[n("el-switch",{attrs:{"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949"},model:{value:e.newVideo.ischeck,callback:function(t){e.$set(e.newVideo,"ischeck",t)},expression:"newVideo.ischeck"}})],1)],1),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(t){e.dialogFormVisible=!1}}},[e._v(" 取消 ")]),n("el-button",{attrs:{type:"primary"},on:{click:function(t){"create"===e.dialogStatus?e.createData():e.updateData()}}},[e._v(" 提交 ")])],1)],1)],1)},a=[],r=(n("c740"),n("13d5"),n("a434"),n("261f")),o=n("6724"),l=n("333d"),s=["关闭","打开"],c=["普通","推荐"],d=["否","是"],u=[{key:"1",display_name:"外链"},{key:"2",display_name:"影片"}],p=u.reduce((function(e,t){return e[t.key]=t.display_name,e}),{}),f={name:"AdvertBanner",components:{Pagination:l["a"]},directives:{waves:o["a"]},filters:{isCheckFilter:function(e){return s[e]},betterShowFilter:function(e){return c[e]},homeShowFilter:function(e){return d[e]},typeFilter:function(e){return p[e]}},data:function(){return{tableKey:0,list:null,total:0,listLoading:!0,listQuery:{page:1,limit:20,view_type:void 0,video_type:void 0,name:void 0,sort:"id desc"},newVideo:{},dialogFormVisible:!1,dialogStatus:"",textMap:{update:"编辑",create:"创建"},openSort:!1,viewTypeOptions:u,rules:{content:[{required:!0,message:"请输入内容",trigger:"blur"}],type:[{required:!0,message:"请选择类型",trigger:"blur"}],pay_order:[{required:!0,message:"排序必须输入",trigger:"blur"}]}}},created:function(){this.getList()},methods:{getList:function(){var e=this;this.listLoading=!0,Object(r["m"])(this.listQuery).then((function(t){e.total=t.data.total,e.list=t.data.list,e.listLoading=!1}))},takeViewType:function(e){return p[e]},handleFilter:function(){this.listQuery.page=1,this.getList()},sortChange:function(e){var t=e.prop,n=e.order;this.listQuery.sort="ascending"===n?t:t+" desc",this.handleFilter()},handleUpdate:function(e){var t=this;this.newVideo=Object.assign({},e),this.dialogStatus="update",this.dialogFormVisible=!0,this.newVideo.show_view_type=this.takeViewType(this.newVideo.pay_type),this.$nextTick((function(){t.$refs["dataForm"].clearValidate()}))},updateData:function(){var e=this;this.$refs["dataForm"].validate((function(t){if(t){var n=Object.assign({},e.newVideo);Object(r["i"])(n).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 n=this;this.listLoading=!0,Object(r["e"])(e).then((function(){n.list.splice(t,1),n.listLoading=!1,n.$notify({title:"Success",message:"操作成功",type:"success",duration:2e3})})).catch((function(){n.listLoading=!1}))},handleCreate:function(e,t){var n=this;this.newVideo={},this.dialogStatus="create",this.dialogFormVisible=!0,this.$nextTick((function(){n.$refs["dataForm"].clearValidate()}))},createData:function(){var e=this;this.$refs["dataForm"].validate((function(t){t&&Object(r["a"])(e.newVideo).then((function(){e.dialogFormVisible=!1,e.getList(),e.$notify({title:"Success",message:"创建成功",type:"success",duration:2e3})}))}))},getSortClass:function(){var e=this.listQuery.sort;return"id"===e?"ascending":"descending"}}},m=f,h=n("2877"),v=Object(h["a"])(m,i,a,!1,null,null,null);t["default"]=v.exports},"8d41":function(e,t,n){}}]);