Commit b40b11df by wang

update

parent 9e0067a9
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><meta name=renderer content=webkit><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><link rel=icon href=/favicon.ico><title>Vue Element Admin</title><link href=/static/css/chunk-libs.5cf311f0.css rel=stylesheet><link href=/static/css/app.850c09c7.css rel=stylesheet></head><body><div id=app></div><script src=/static/js/chunk-elementUI.e18388bc.js></script><script src=/static/js/chunk-libs.a49098e1.js></script><script>(function(e){function t(t){for(var r,u,a=t[0],i=t[1],f=t[2],d=0,l=[];d<a.length;d++)u=a[d],c[u]&&l.push(c[u][0]),c[u]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);s&&s(t);while(l.length)l.shift()();return o.push.apply(o,f||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,u=1;u<n.length;u++){var a=n[u];0!==c[a]&&(r=!1)}r&&(o.splice(t--,1),e=i(i.s=n[0]))}return e}var r={},u={runtime:0},c={runtime:0},o=[];function a(e){return i.p+"static/js/"+({}[e]||e)+"."+{"chunk-0575145a":"4adc987b","chunk-05a99c67":"be1a1e89","chunk-19593038":"a3a45bac","chunk-2d2105d3":"7106a610","chunk-2d230fe7":"446e67d8","chunk-667d2d85":"2d4f045d","chunk-91584750":"7dfdef5c","chunk-bf0cb8b0":"3b6ff76b"}[e]+".js"}function i(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.e=function(e){var t=[],n={"chunk-0575145a":1,"chunk-05a99c67":1,"chunk-19593038":1,"chunk-667d2d85":1,"chunk-91584750":1,"chunk-bf0cb8b0":1};u[e]?t.push(u[e]):0!==u[e]&&n[e]&&t.push(u[e]=new Promise((function(t,n){for(var r="static/css/"+({}[e]||e)+"."+{"chunk-0575145a":"40f76b5c","chunk-05a99c67":"d0296c60","chunk-19593038":"40f76b5c","chunk-2d2105d3":"31d6cfe0","chunk-2d230fe7":"31d6cfe0","chunk-667d2d85":"d1c64e6f","chunk-91584750":"b043920c","chunk-bf0cb8b0":"40f76b5c"}[e]+".css",c=i.p+r,o=document.getElementsByTagName("link"),a=0;a<o.length;a++){var f=o[a],d=f.getAttribute("data-href")||f.getAttribute("href");if("stylesheet"===f.rel&&(d===r||d===c))return t()}var l=document.getElementsByTagName("style");for(a=0;a<l.length;a++){f=l[a],d=f.getAttribute("data-href");if(d===r||d===c)return t()}var s=document.createElement("link");s.rel="stylesheet",s.type="text/css",s.onload=t,s.onerror=function(t){var r=t&&t.target&&t.target.src||c,o=new Error("Loading CSS chunk "+e+" failed.\n("+r+")");o.request=r,delete u[e],s.parentNode.removeChild(s),n(o)},s.href=c;var h=document.getElementsByTagName("head")[0];h.appendChild(s)})).then((function(){u[e]=0})));var r=c[e];if(0!==r)if(r)t.push(r[2]);else{var o=new Promise((function(t,n){r=c[e]=[t,n]}));t.push(r[2]=o);var f,d=document.createElement("script");d.charset="utf-8",d.timeout=120,i.nc&&d.setAttribute("nonce",i.nc),d.src=a(e),f=function(t){d.onerror=d.onload=null,clearTimeout(l);var n=c[e];if(0!==n){if(n){var r=t&&("load"===t.type?"missing":t.type),u=t&&t.target&&t.target.src,o=new Error("Loading chunk "+e+" failed.\n("+r+": "+u+")");o.type=r,o.request=u,n[1](o)}c[e]=void 0}};var l=setTimeout((function(){f({type:"timeout",target:d})}),12e4);d.onerror=d.onload=f,document.head.appendChild(d)}return Promise.all(t)},i.m=e,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/",i.oe=function(e){throw console.error(e),e};var f=window["webpackJsonp"]=window["webpackJsonp"]||[],d=f.push.bind(f);f.push=t,f=f.slice();for(var l=0;l<f.length;l++)t(f[l]);var s=d;n()})([]);</script><script src=/static/js/app.a7226b64.js></script></body></html> <!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><meta name=renderer content=webkit><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><link rel=icon href=/favicon.ico><title>Vue Element Admin</title><link href=/static/css/chunk-libs.5cf311f0.css rel=stylesheet><link href=/static/css/app.850c09c7.css rel=stylesheet></head><body><div id=app></div><script src=/static/js/chunk-elementUI.e18388bc.js></script><script src=/static/js/chunk-libs.a49098e1.js></script><script>(function(e){function t(t){for(var r,u,a=t[0],i=t[1],f=t[2],d=0,l=[];d<a.length;d++)u=a[d],c[u]&&l.push(c[u][0]),c[u]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);s&&s(t);while(l.length)l.shift()();return o.push.apply(o,f||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,u=1;u<n.length;u++){var a=n[u];0!==c[a]&&(r=!1)}r&&(o.splice(t--,1),e=i(i.s=n[0]))}return e}var r={},u={runtime:0},c={runtime:0},o=[];function a(e){return i.p+"static/js/"+({}[e]||e)+"."+{"chunk-0575145a":"4adc987b","chunk-05a99c67":"be1a1e89","chunk-19593038":"9593576c","chunk-2d2105d3":"7106a610","chunk-2d230fe7":"446e67d8","chunk-667d2d85":"2d4f045d","chunk-91584750":"7dfdef5c","chunk-bf0cb8b0":"3b6ff76b"}[e]+".js"}function i(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.e=function(e){var t=[],n={"chunk-0575145a":1,"chunk-05a99c67":1,"chunk-19593038":1,"chunk-667d2d85":1,"chunk-91584750":1,"chunk-bf0cb8b0":1};u[e]?t.push(u[e]):0!==u[e]&&n[e]&&t.push(u[e]=new Promise((function(t,n){for(var r="static/css/"+({}[e]||e)+"."+{"chunk-0575145a":"40f76b5c","chunk-05a99c67":"d0296c60","chunk-19593038":"40f76b5c","chunk-2d2105d3":"31d6cfe0","chunk-2d230fe7":"31d6cfe0","chunk-667d2d85":"d1c64e6f","chunk-91584750":"b043920c","chunk-bf0cb8b0":"40f76b5c"}[e]+".css",c=i.p+r,o=document.getElementsByTagName("link"),a=0;a<o.length;a++){var f=o[a],d=f.getAttribute("data-href")||f.getAttribute("href");if("stylesheet"===f.rel&&(d===r||d===c))return t()}var l=document.getElementsByTagName("style");for(a=0;a<l.length;a++){f=l[a],d=f.getAttribute("data-href");if(d===r||d===c)return t()}var s=document.createElement("link");s.rel="stylesheet",s.type="text/css",s.onload=t,s.onerror=function(t){var r=t&&t.target&&t.target.src||c,o=new Error("Loading CSS chunk "+e+" failed.\n("+r+")");o.request=r,delete u[e],s.parentNode.removeChild(s),n(o)},s.href=c;var h=document.getElementsByTagName("head")[0];h.appendChild(s)})).then((function(){u[e]=0})));var r=c[e];if(0!==r)if(r)t.push(r[2]);else{var o=new Promise((function(t,n){r=c[e]=[t,n]}));t.push(r[2]=o);var f,d=document.createElement("script");d.charset="utf-8",d.timeout=120,i.nc&&d.setAttribute("nonce",i.nc),d.src=a(e),f=function(t){d.onerror=d.onload=null,clearTimeout(l);var n=c[e];if(0!==n){if(n){var r=t&&("load"===t.type?"missing":t.type),u=t&&t.target&&t.target.src,o=new Error("Loading chunk "+e+" failed.\n("+r+": "+u+")");o.type=r,o.request=u,n[1](o)}c[e]=void 0}};var l=setTimeout((function(){f({type:"timeout",target:d})}),12e4);d.onerror=d.onload=f,document.head.appendChild(d)}return Promise.all(t)},i.m=e,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/",i.oe=function(e){throw console.error(e),e};var f=window["webpackJsonp"]=window["webpackJsonp"]||[],d=f.push.bind(f);f.push=t,f=f.slice();for(var l=0;l<f.length;l++)t(f[l]);var s=d;n()})([]);</script><script src=/static/js/app.a7226b64.js></script></body></html>
\ No newline at end of file \ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-19593038"],{"333d":function(e,t,a){"use strict";var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"pagination-container",class:{hidden:e.hidden}},[a("el-pagination",e._b({attrs:{background:e.background,"current-page":e.currentPage,"page-size":e.pageSize,layout:e.layout,"page-sizes":e.pageSizes,total:e.total},on:{"update:currentPage":function(t){e.currentPage=t},"update:current-page":function(t){e.currentPage=t},"update:pageSize":function(t){e.pageSize=t},"update:page-size":function(t){e.pageSize=t},"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}},"el-pagination",e.$attrs,!1))],1)},l=[];a("c5f6");Math.easeInOutQuad=function(e,t,a,i){return e/=i/2,e<1?a/2*e*e+t:(e--,-a/2*(e*(e-2)-1)+t)};var n=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function o(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function s(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function r(e,t,a){var i=s(),l=e-i,r=20,u=0;t="undefined"===typeof t?500:t;var c=function e(){u+=r;var s=Math.easeInOutQuad(u,i,l,t);o(s),u<t?n(e):a&&"function"===typeof a&&a()};c()}var u={name:"Pagination",props:{total:{required:!0,type:Number},page:{type:Number,default:1},limit:{type:Number,default:20},pageSizes:{type:Array,default:function(){return[10,20,30,50]}},layout:{type:String,default:"total, sizes, prev, pager, next, jumper"},background:{type:Boolean,default:!0},autoScroll:{type:Boolean,default:!0},hidden:{type:Boolean,default:!1}},computed:{currentPage:{get:function(){return this.page},set:function(e){this.$emit("update:page",e)}},pageSize:{get:function(){return this.limit},set:function(e){this.$emit("update:limit",e)}}},methods:{handleSizeChange:function(e){this.$emit("pagination",{page:this.currentPage,limit:e}),this.autoScroll&&r(0,800)},handleCurrentChange:function(e){this.$emit("pagination",{page:e,limit:this.pageSize}),this.autoScroll&&r(0,800)}}},c=u,d=(a("e498"),a("2877")),f=Object(d["a"])(c,i,l,!1,null,"6af373ef",null);t["a"]=f.exports},7456:function(e,t,a){},e498:function(e,t,a){"use strict";var i=a("7456"),l=a.n(i);l.a},f603:function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("div",{staticClass:"filter-container"},[a("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.title,callback:function(t){e.$set(e.listQuery,"title",t)},expression:"listQuery.title"}}),e._v(" "),a("el-select",{staticClass:"width-full",attrs:{placeholder:"请选择抖音账号",filterable:"",clearable:""},model:{value:e.listQuery.account_id,callback:function(t){e.$set(e.listQuery,"account_id",t)},expression:"listQuery.account_id"}},e._l(e.accountList,(function(e){return a("el-option",{key:e.id,attrs:{label:e.nick_name,value:e.id}})})),1),e._v(" "),a("el-select",{staticClass:"width-full",attrs:{placeholder:"是否置顶",filterable:"",clearable:""},model:{value:e.listQuery.is_top,callback:function(t){e.$set(e.listQuery,"is_top",t)},expression:"listQuery.is_top"}},e._l(e.topOptions,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1),e._v(" "),a("el-select",{staticClass:"width-full",attrs:{placeholder:"是否审核",filterable:"",clearable:""},model:{value:e.listQuery.is_reviewed,callback:function(t){e.$set(e.listQuery,"is_reviewed",t)},expression:"listQuery.is_reviewed"}},e._l(e.reviewedOptions,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1),e._v(" "),a("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:e.handleFilter}},[e._v("\n 搜索\n ")]),e._v(" "),a("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-edit"},on:{click:e.createVideo}},[e._v("\n 上传视频\n ")])],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],attrs:{data:e.list,"element-loading-text":"Loading",border:"",fit:"","highlight-current-row":""}},[a("el-table-column",{attrs:{align:"center",label:"ID",width:"95"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.$index)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"标题"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.title)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"视频id"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.item_id)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"封面"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("el-image",{staticStyle:{width:"50px",height:"50px"},attrs:{src:e.row.cover,fit:"fill"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"是否置顶"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.is_top?"是":"否")+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"审核结束"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.is_reviewed?"是":"否")+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"创建时间"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.create_time)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"数据展示"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("评论数:"+t.row.comment_count+"\n点赞数:"+t.row.digg_count+"\n下载数:"+t.row.download_count+"\n播放数:"+t.row.play_count+"\n分享数:"+t.row.share_count+"\n转发数:"+t.row.forward_count)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"操作",align:"center",width:"230","class-name":"small-padding fixed-width"}},[a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.deleteVideo}},[e._v("\n 删除\n ")])],1)],1),e._v(" "),a("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.fetchData}}),e._v(" "),a("el-dialog",{staticClass:"el-dialog-medium",attrs:{title:e.title,visible:e.dialogTableVisible,"close-on-click-modal":!1,"close-on-press-escape":!1},on:{"update:visible":function(t){e.dialogTableVisible=t}}},[a("el-form",{ref:"form",attrs:{rules:e.rules,model:e.form,"label-position":"left","label-width":"80px"}},[a("el-form-item",{attrs:{label:"抖音账号",prop:"account_id"}},[a("el-select",{staticClass:"width-full",attrs:{placeholder:"请选择",filterable:"",clearable:""},model:{value:e.form.account_id,callback:function(t){e.$set(e.form,"account_id",t)},expression:"form.account_id"}},e._l(e.accountList,(function(e){return a("el-option",{key:e.id,attrs:{label:e.nick_name,value:e.id}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"上传视频",prop:"video"}},[a("el-upload",{staticClass:"avatar-uploader",attrs:{action:e.actionUrl,"show-file-list":!1,"on-success":e.handleVideoSuccess,"before-upload":e.beforeUploadVideo}},[e.form.video?a("video",{staticClass:"avatar",attrs:{src:e.form.video}}):a("i",{staticClass:"el-icon-plus avatar-uploader-icon"}),e._v(" "),e.load?a("p",[e._v(" 上传中")]):e._e(),e._v(" "),a("P",{staticStyle:{color:"#000000"}},[e._v("请保证视频格式正确,且不超过20M")])],1)],1)],1),e._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.dialogTableVisible=!1}}},[e._v("取 消")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.saveVideo("form")}}},[e._v("确 定")])],1)],1)],1)},l=[],n=a("2801"),o=a("333d"),s={name:"Accounts",components:{Pagination:o["a"]},filters:{},data:function(){return{actionUrl:"http://douyin-fe.kaibawang.cn/api/douyin/save-video",dialogTableVisible:!1,list:null,listLoading:!0,total:0,title:"",listQuery:{page:1,limit:15,title:"",is_top:"",is_reviewed:"",account_id:""},form:{account_id:"",video:""},rules:{account_id:[{required:!0,message:"抖音账号必须",trigger:"blur"}],video:[{required:!0,message:"视频必须",trigger:"blur"}]},timer:null,accountList:[],topOptions:[{value:1,label:"是"},{value:0,label:"否"}],reviewedOptions:[{value:1,label:"是"},{value:0,label:"否"}],load:!1,isShowUploadVideo:!0}},created:function(){this.fetchData(),this.fetchAccount()},methods:{saveVideo:function(){var e=this;this.$refs[form].validate((function(t){t&&Object(n["f"])(e.form).then((function(t){e.$message({message:"新建成功!",type:"success"}),e.dialogTableVisible=!1})),e.fetchData()}))},createVideo:function(){this.title="新建",this.dialogTableVisible=!0},beforeUploadVideo:function(e){var t=e.size/1024/1024<30;return-1===["video/mp4"].indexOf(e.type)?(this.$message.error("请上传正确的视频格式"),!1):t?(this.isShowUploadVideo=!1,void(this.load=!0)):(this.$message.error("上传视频大小不能超过20MB哦!"),!1)},handleVideoSuccess:function(e,t){this.form.video=e.data.video_url,"ok"===e.message?this.load=!1:this.$message.error("视频上传失败,请重新上传!")},deleteVideo:function(e){var t=this;this.$confirm("确定删除视频吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){Object(n["a"])({id:e}).then((function(e){t.$message({message:"操作成功!",type:"success"}),t.dialogTableVisible=!1}))})).catch((function(){t.$message({type:"error",message:"取消当前操作"})}))},fetchAccount:function(){var e=this;Object(n["d"])({}).then((function(t){e.accountList=t.data.data}))},fetchData:function(){var e=this;this.listLoading=!0,Object(n["e"])(this.listQuery).then((function(t){e.list=t.data.data,e.total=t.data.meta.total,setTimeout((function(){e.listLoading=!1}),500)}))},handleFilter:function(){this.listQuery.page=1,this.fetchData()}}},r=s,u=a("2877"),c=Object(u["a"])(r,i,l,!1,null,null,null);t["default"]=c.exports}}]); (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-19593038"],{"333d":function(e,t,a){"use strict";var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"pagination-container",class:{hidden:e.hidden}},[a("el-pagination",e._b({attrs:{background:e.background,"current-page":e.currentPage,"page-size":e.pageSize,layout:e.layout,"page-sizes":e.pageSizes,total:e.total},on:{"update:currentPage":function(t){e.currentPage=t},"update:current-page":function(t){e.currentPage=t},"update:pageSize":function(t){e.pageSize=t},"update:page-size":function(t){e.pageSize=t},"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}},"el-pagination",e.$attrs,!1))],1)},l=[];a("c5f6");Math.easeInOutQuad=function(e,t,a,i){return e/=i/2,e<1?a/2*e*e+t:(e--,-a/2*(e*(e-2)-1)+t)};var n=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function o(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function s(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function r(e,t,a){var i=s(),l=e-i,r=20,u=0;t="undefined"===typeof t?500:t;var c=function e(){u+=r;var s=Math.easeInOutQuad(u,i,l,t);o(s),u<t?n(e):a&&"function"===typeof a&&a()};c()}var u={name:"Pagination",props:{total:{required:!0,type:Number},page:{type:Number,default:1},limit:{type:Number,default:20},pageSizes:{type:Array,default:function(){return[10,20,30,50]}},layout:{type:String,default:"total, sizes, prev, pager, next, jumper"},background:{type:Boolean,default:!0},autoScroll:{type:Boolean,default:!0},hidden:{type:Boolean,default:!1}},computed:{currentPage:{get:function(){return this.page},set:function(e){this.$emit("update:page",e)}},pageSize:{get:function(){return this.limit},set:function(e){this.$emit("update:limit",e)}}},methods:{handleSizeChange:function(e){this.$emit("pagination",{page:this.currentPage,limit:e}),this.autoScroll&&r(0,800)},handleCurrentChange:function(e){this.$emit("pagination",{page:e,limit:this.pageSize}),this.autoScroll&&r(0,800)}}},c=u,d=(a("e498"),a("2877")),f=Object(d["a"])(c,i,l,!1,null,"6af373ef",null);t["a"]=f.exports},7456:function(e,t,a){},e498:function(e,t,a){"use strict";var i=a("7456"),l=a.n(i);l.a},f603:function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("div",{staticClass:"filter-container"},[a("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.title,callback:function(t){e.$set(e.listQuery,"title",t)},expression:"listQuery.title"}}),e._v(" "),a("el-select",{staticClass:"width-full",attrs:{placeholder:"请选择抖音账号",filterable:"",clearable:""},model:{value:e.listQuery.account_id,callback:function(t){e.$set(e.listQuery,"account_id",t)},expression:"listQuery.account_id"}},e._l(e.accountList,(function(e){return a("el-option",{key:e.id,attrs:{label:e.nick_name,value:e.id}})})),1),e._v(" "),a("el-select",{staticClass:"width-full",attrs:{placeholder:"是否置顶",filterable:"",clearable:""},model:{value:e.listQuery.is_top,callback:function(t){e.$set(e.listQuery,"is_top",t)},expression:"listQuery.is_top"}},e._l(e.topOptions,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1),e._v(" "),a("el-select",{staticClass:"width-full",attrs:{placeholder:"是否审核",filterable:"",clearable:""},model:{value:e.listQuery.is_reviewed,callback:function(t){e.$set(e.listQuery,"is_reviewed",t)},expression:"listQuery.is_reviewed"}},e._l(e.reviewedOptions,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1),e._v(" "),a("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:e.handleFilter}},[e._v("\n 搜索\n ")]),e._v(" "),a("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-edit"},on:{click:e.createVideo}},[e._v("\n 上传视频\n ")])],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],attrs:{data:e.list,"element-loading-text":"Loading",border:"",fit:"","highlight-current-row":""}},[a("el-table-column",{attrs:{align:"center",label:"ID",width:"95"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.$index)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"标题"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.title)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"视频id"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.item_id)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"封面"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("el-image",{staticStyle:{width:"50px",height:"50px"},attrs:{src:e.row.cover,fit:"fill"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"是否置顶"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.is_top?"是":"否")+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"审核结束"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.is_reviewed?"是":"否")+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"创建时间"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.create_time)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"数据展示"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("评论数:"+t.row.comment_count+"\n点赞数:"+t.row.digg_count+"\n下载数:"+t.row.download_count+"\n播放数:"+t.row.play_count+"\n分享数:"+t.row.share_count+"\n转发数:"+t.row.forward_count)+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"操作",align:"center",width:"230","class-name":"small-padding fixed-width"}},[a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.deleteVideo}},[e._v("\n 删除\n ")])],1)],1),e._v(" "),a("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.fetchData}}),e._v(" "),a("el-dialog",{staticClass:"el-dialog-medium",attrs:{title:e.title,visible:e.dialogTableVisible,"close-on-click-modal":!1,"close-on-press-escape":!1},on:{"update:visible":function(t){e.dialogTableVisible=t}}},[a("el-form",{ref:"form",attrs:{rules:e.rules,model:e.form,"label-position":"left","label-width":"80px"}},[a("el-form-item",{attrs:{label:"抖音账号",prop:"account_id"}},[a("el-select",{staticClass:"width-full",attrs:{placeholder:"请选择",filterable:"",clearable:""},model:{value:e.form.account_id,callback:function(t){e.$set(e.form,"account_id",t)},expression:"form.account_id"}},e._l(e.accountList,(function(e){return a("el-option",{key:e.id,attrs:{label:e.nick_name,value:e.id}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"上传视频",prop:"video"}},[a("el-upload",{staticClass:"avatar-uploader",attrs:{action:e.actionUrl,"show-file-list":!1,"on-success":e.handleVideoSuccess,"before-upload":e.beforeUploadVideo}},[e.form.video?a("video",{staticClass:"avatar",attrs:{src:e.form.video}}):a("i",{staticClass:"el-icon-plus avatar-uploader-icon"}),e._v(" "),e.load?a("p",[e._v(" 上传中")]):e._e(),e._v(" "),a("P",{staticStyle:{color:"#000000"}},[e._v("请保证视频格式正确,且不超过20M")])],1)],1)],1),e._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.dialogTableVisible=!1}}},[e._v("取 消")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.saveVideo("form")}}},[e._v("确 定")])],1)],1)],1)},l=[],n=a("2801"),o=a("333d"),s={name:"Accounts",components:{Pagination:o["a"]},filters:{},data:function(){return{actionUrl:"http://douyin-fe.kaibawang.cn/api/douyin/save-video",dialogTableVisible:!1,list:null,listLoading:!0,total:0,title:"",listQuery:{page:1,limit:15,title:"",is_top:"",is_reviewed:"",account_id:""},form:{account_id:"",video:""},rules:{account_id:[{required:!0,message:"抖音账号必须",trigger:"blur"}],video:[{required:!0,message:"视频必须",trigger:"blur"}]},timer:null,accountList:[],topOptions:[{value:1,label:"是"},{value:0,label:"否"}],reviewedOptions:[{value:1,label:"是"},{value:0,label:"否"}],load:!1,isShowUploadVideo:!0}},created:function(){this.fetchData(),this.fetchAccount()},methods:{saveVideo:function(e){var t=this;this.$refs[e].validate((function(e){e&&Object(n["f"])(t.form).then((function(e){t.$message({message:"新建成功!",type:"success"}),t.dialogTableVisible=!1})),t.fetchData()}))},createVideo:function(){this.title="新建",this.dialogTableVisible=!0},beforeUploadVideo:function(e){var t=e.size/1024/1024<30;return-1===["video/mp4"].indexOf(e.type)?(this.$message.error("请上传正确的视频格式"),!1):t?(this.isShowUploadVideo=!1,void(this.load=!0)):(this.$message.error("上传视频大小不能超过20MB哦!"),!1)},handleVideoSuccess:function(e,t){this.form.video=e.data.video_url,"ok"===e.message?this.load=!1:this.$message.error("视频上传失败,请重新上传!")},deleteVideo:function(e){var t=this;this.$confirm("确定删除视频吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){Object(n["a"])({id:e}).then((function(e){t.$message({message:"操作成功!",type:"success"}),t.dialogTableVisible=!1}))})).catch((function(){t.$message({type:"error",message:"取消当前操作"})}))},fetchAccount:function(){var e=this;Object(n["d"])({}).then((function(t){e.accountList=t.data.data}))},fetchData:function(){var e=this;this.listLoading=!0,Object(n["e"])(this.listQuery).then((function(t){e.list=t.data.data,e.total=t.data.meta.total,setTimeout((function(){e.listLoading=!1}),500)}))},handleFilter:function(){this.listQuery.page=1,this.fetchData()}}},r=s,u=a("2877"),c=Object(u["a"])(r,i,l,!1,null,null,null);t["default"]=c.exports}}]);
\ No newline at end of file \ No newline at end of file
...@@ -224,7 +224,7 @@ export default { ...@@ -224,7 +224,7 @@ export default {
this.fetchAccount() this.fetchAccount()
}, },
methods: { methods: {
saveVideo() { saveVideo(form) {
this.$refs[form].validate((valid) => { this.$refs[form].validate((valid) => {
if (valid) { if (valid) {
uploadVideo(this.form).then(response => { uploadVideo(this.form).then(response => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment