webpackJsonp([54],{ZsnM:function(t,a){},pILI:function(t,a){},qPPN:function(t,a,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var n=e("Xxa5"),i=e.n(n),o=e("exGp"),s=e.n(o),l=e("//Fk"),r=e.n(l),c=e("Dd8w"),u=e.n(c),d={name:"addAccountDialog",props:{dialogVisible:{type:Boolean,default:function(){return!1}},accountInfo:{type:Object,default:function(){return{}}}},data:function(){return{loading:!1,platformOptions:[],form:{account:"",platform_id:"",description:"",status:1}}},computed:{isEdit:function(){return this.accountInfo&&this.accountInfo.account_id},dialogTitle:function(){return this.isEdit?"编辑账号":"添加账号"}},watch:{dialogVisible:function(t){t&&(this.handleGetPlatformOptions(),this.handleInitData())}},methods:{handleGetPlatformOptions:function(){var t=this;return s()(i.a.mark(function a(){var e,n,o;return i.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,t.$axios.post(t.URL.BASEURL+t.URL.getPlatformOptions,{});case 2:e=a.sent,n=e.data,(o=void 0===n?{}:n)&&0==o.errno?t.platformOptions=o.rst:4002!=o.errno&&t.$message.warning(o.err);case 6:case"end":return a.stop()}},a,t)}))()},handleInitData:function(){if(this.loading=!1,this.isEdit){var t=this.accountInfo,a=t.account,e=t.platform_id,n=t.description,i=t.status;this.form.account=a,this.form.platform_id=e,this.form.description=n,this.form.status=i}else this.form.account="",this.form.platform_id="",this.form.description="",this.form.status=1},handleConfirm:function(){var t=this;return s()(i.a.mark(function a(){var e,n,o,s,l;return i.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,t.handleFormValidate();case 3:return e=""+t.URL.BASEURL+t.URL.accountManage_addAccount,n=u()({},t.form),t.isEdit&&(e=""+t.URL.BASEURL+t.URL.accountManage_editAccount,n.account_id=t.accountInfo.account_id),t.loading=!0,a.next=9,t.$axios.post(e,n);case 9:o=a.sent,s=o.data,(l=void 0===s?{}:s)&&0==l.errno?(t.$message.success("操作成功"),t.$emit("confirm",{isEdit:t.isEdit})):4002!=l.errno&&t.$message.warning(l.err||"操作失败"),a.next=18;break;case 15:a.prev=15,a.t0=a.catch(0),console.log(a.t0);case 18:return a.prev=18,t.loading=!1,a.finish(18);case 21:case"end":return a.stop()}},a,t,[[0,15,18,21]])}))()},handleCancel:function(){this.$emit("cancel")},handleFormValidate:function(){var t=this;return new r.a(function(a,e){var n=t.form,i=n.account,o=n.platform_id;i?o?a("表单校验通过"):(t.$message.warning("请选择平台"),e("表单校验未通过")):(t.$message.warning("请输入账号"),e("表单校验未通过"))})}}},p={render:function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("el-dialog",{staticClass:"addAccount-dialog",attrs:{visible:t.dialogVisible,"before-close":t.handleCancel,title:t.dialogTitle,width:"450px"},on:{"update:visible":function(a){t.dialogVisible=a}}},[e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"form-wrap"},[e("div",{staticClass:"form-item"},[e("span",{staticClass:"lable"},[e("em",[t._v("*")]),t._v("账号")]),t._v(" "),e("el-input",{attrs:{size:"small",placeholder:"请输入账号",clearable:""},model:{value:t.form.account,callback:function(a){t.$set(t.form,"account",a)},expression:"form.account"}})],1),t._v(" "),e("div",{staticClass:"form-item"},[e("span",{staticClass:"lable"},[e("em",[t._v("*")]),t._v("平台")]),t._v(" "),e("el-select",{attrs:{size:"small",placeholder:"请选择平台",clearable:"",filterable:""},model:{value:t.form.platform_id,callback:function(a){t.$set(t.form,"platform_id",a)},expression:"form.platform_id"}},t._l(t.platformOptions,function(t){return e("el-option",{key:t.platform_id,attrs:{label:t.platform_name,value:t.platform_id}})}),1)],1),t._v(" "),e("div",{staticClass:"form-item"},[e("span",{staticClass:"lable"},[t._v("描述")]),t._v(" "),e("el-input",{attrs:{size:"small",placeholder:"请输入描述",clearable:""},model:{value:t.form.description,callback:function(a){t.$set(t.form,"description",a)},expression:"form.description"}})],1),t._v(" "),e("div",{staticClass:"form-item"},[e("span",{staticClass:"lable"},[e("em",[t._v("*")]),t._v("是否启用")]),t._v(" "),e("el-switch",{attrs:{"active-color":"#43B083","active-value":1,"inactive-color":"#ccc","inactive-value":2},model:{value:t.form.status,callback:function(a){t.$set(t.form,"status",a)},expression:"form.status"}})],1)]),t._v(" "),e("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{attrs:{size:"mini"},on:{click:t.handleCancel}},[t._v("取 消")]),t._v(" "),e("el-button",{attrs:{size:"mini",type:"primary",disabled:t.loading},on:{click:t.handleConfirm}},[t._v("确 定")])],1)])},staticRenderFns:[]};var f=e("VU/8")(d,p,!1,function(t){e("ZsnM")},"data-v-febc73d6",null).exports,g={components:{selfInput:e("McOJ").a},props:{dialogVisible:{type:Boolean,default:function(){return!1}},accountInfo:{type:Object,default:function(){return{}}}},data:function(){return{height:500,loading:!1,pagination:{page:1,page_size:20,pages:0,total:0},filter:{keyword:""},list:[]}},computed:{dialogTitle:function(){return"关联短剧列表"}},watch:{dialogVisible:function(t){t&&(this.pagination.page=1,this.filter.keyword="",this.handleInitList(),this.handleGetList())}},methods:{handleGetList:function(){var t=this;return s()(i.a.mark(function a(){var e,n,o,s,l;return i.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,t.loading=!0,e=""+t.URL.BASEURL+t.URL.playletManage_playletList,n={platform_id:t.accountInfo.platform_id,account_id:t.accountInfo.account_id,keyword:t.filter.keyword,page:t.pagination.page,page_size:t.pagination.page_size},a.next=6,t.$axios.get(e,{params:n});case 6:o=a.sent,s=o.data,(l=void 0===s?{}:s)&&0==l.errno&&Array.isArray(l.rst.data)?(t.list=l.rst.data,t.pagination.total=l.rst.pageInfo.total,t.pagination.pages=l.rst.pageInfo.pages,t.$refs.tableDom.bodyWrapper.scrollTop=0):4002!=l.errno&&(t.$message.warning(l.err),t.handleInitList()),a.next=16;break;case 12:a.prev=12,a.t0=a.catch(0),console.log(a.t0),t.handleInitList();case 16:return a.prev=16,t.loading=!1,a.finish(16);case 19:case"end":return a.stop()}},a,t,[[0,12,16,19]])}))()},handleCurrentChange:function(t){this.pagination.page=t,this.handleGetList()},onInputKeyword:function(t){this.filter.keyword=t||"",this.pagination.page=1,this.handleGetList()},handleInitList:function(){this.list=[],this.pagination.total=0,this.pagination.pages=0},handleCancel:function(){this.$emit("close")}}},m={render:function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("el-dialog",{staticClass:"playletList-dialog",attrs:{visible:t.dialogVisible,"before-close":t.handleCancel,title:t.dialogTitle,width:"900px"},on:{"update:visible":function(a){t.dialogVisible=a}}},[e("div",[e("selfInput",{attrs:{label_name:"搜索剧集"},on:{inputChange:t.onInputKeyword}})],1),t._v(" "),e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"form-wrap"},[e("el-table",{ref:"tableDom",staticStyle:{width:"100%"},attrs:{height:t.height,data:t.list,"tooltip-effect":"dark"}},[e("el-table-column",{attrs:{label:"剧名",prop:"name","min-width":"160",align:"center",fixed:"left"}}),t._v(" "),e("el-table-column",{attrs:{label:"封面",prop:"name","min-width":"160",align:"center"},scopedSlots:t._u([{key:"default",fn:function(t){var a=t.row;return[e("el-image",{staticStyle:{width:"40px",height:"60px"},attrs:{src:a.cover_url,"preview-src-list":[a.cover_url]}})]}}])}),t._v(" "),e("el-table-column",{attrs:{label:"平台",prop:"platform_name","min-width":"160",align:"center"},scopedSlots:t._u([{key:"default",fn:function(a){var n=a.row;return[e("span",[t._v(t._s(n.platform_name))])]}}])}),t._v(" "),e("el-table-column",{attrs:{label:"账号",prop:"account","min-width":"160",align:"center"}}),t._v(" "),e("el-table-column",{attrs:{label:"分类",prop:"category","min-width":"160",align:"center"},scopedSlots:t._u([{key:"default",fn:function(a){var n=a.row;return[e("span",[t._v(t._s(n.category||"-"))])]}}])}),t._v(" "),e("el-table-column",{attrs:{label:"集数",prop:"section_count","min-width":"160",align:"center"}}),t._v(" "),e("el-table-column",{attrs:{label:"发布时间",prop:"create_date","min-width":"160",align:"center"}}),t._v(" "),e("el-table-column",{attrs:{label:"状态","min-width":"160",align:"center"},scopedSlots:t._u([{key:"default",fn:function(a){return[1==a.row.finish_state?e("span",{staticClass:"status"},[t._v("已完结")]):e("span",{staticClass:"status"},[t._v("连载中")])]}}])})],1),t._v(" "),e("div",{directives:[{name:"show",rawName:"v-show",value:t.pagination.total>0,expression:"pagination.total > 0"}],staticClass:"pagination"},[e("el-pagination",{attrs:{background:"","current-page":t.pagination.page,layout:"prev, pager, next","page-count":Number(t.pagination.pages)},on:{"current-change":t.handleCurrentChange}})],1)],1),t._v(" "),e("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"})])},staticRenderFns:[]};var h={name:"accountManage",components:{addAccountDialog:f,playletListDialog:e("VU/8")(g,m,!1,function(t){e("yBRA")},"data-v-3457d004",null).exports},data:function(){return{height:"",loading:!1,pagination:{page:1,page_size:20,pages:0,total:0},accountList:[],addAccountDialogVisible:!1,currentAccountInfo:{},playletListDialogVisible:!1}},created:function(){this.height=document.documentElement.clientHeight-200>400?document.documentElement.clientHeight-200:400,this.handleGetAccount()},methods:{handleGetAccount:function(){var t=this;return s()(i.a.mark(function a(){var e,n,o,s,l;return i.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,t.loading=!0,e=""+t.URL.BASEURL+t.URL.accountManage_accountIndex,n={page:t.pagination.page,page_size:t.pagination.page_size},a.next=6,t.$axios.post(e,n);case 6:o=a.sent,s=o.data,(l=void 0===s?{}:s)&&0==l.errno&&Array.isArray(l.rst.data)?(t.accountList=l.rst.data,t.pagination.total=l.rst.pageInfo.total,t.pagination.pages=l.rst.pageInfo.pages):4002!=l.errno&&(t.$message.warning(l.err),t.accountList=[],t.pagination.total=0,t.pagination.pages=0),a.next=18;break;case 12:a.prev=12,a.t0=a.catch(0),console.log(a.t0),t.accountList=[],t.pagination.total=0,t.pagination.pages=0;case 18:return a.prev=18,t.loading=!1,a.finish(18);case 21:case"end":return a.stop()}},a,t,[[0,12,18,21]])}))()},handleCurrentChange:function(t){this.pagination.page=t,this.handleGetAccount()},onClickAddAccount:function(){this.currentAccountInfo={},this.addAccountDialogVisible=!0},onClickEditAccount:function(t){this.currentAccountInfo=t,this.addAccountDialogVisible=!0},handleAddAccountConfirm:function(t){var a=t.isEdit;this.addAccountDialogVisible=!1,a||(this.pagination.page=1),this.handleGetAccount()},handleAddAccountCancel:function(){this.addAccountDialogVisible=!1},onClickPlayletList:function(t){t.playlet_num>0&&(this.currentAccountInfo=t,this.playletListDialogVisible=!0)},handlePlayletListClose:function(){this.playletListDialogVisible=!1},onClickEnable:function(t,a){var e=this;return s()(i.a.mark(function n(){var o;return i.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,o=e.$createElement,n.next=4,e.$confirm("",{message:o("div",null,[o("span",null,"确定"+(2===a?"禁用":"启用")),o("span",{style:"color: #32B38A;"},""+t.account),o("span",null,"吗?")]),confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});case 4:e.handleEnable(t,a),n.next=10;break;case 7:n.prev=7,n.t0=n.catch(0),console.log(n.t0);case 10:case"end":return n.stop()}},n,e,[[0,7]])}))()},handleEnable:function(t,a){var e=this;return s()(i.a.mark(function n(){var o,s,l,r,c;return i.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,o=""+e.URL.BASEURL+e.URL.accountManage_editAccount,s={account_id:t.account_id,platform_id:t.platform_id,account:t.account,description:t.description,status:a},e.loading=!0,n.next=6,e.$axios.post(o,s);case 6:l=n.sent,r=l.data,(c=void 0===r?{}:r)&&0==c.errno?(e.$message.success("操作成功"),e.handleGetAccount()):4002!=c.errno&&e.$message.warning(c.err||"操作失败"),n.next=15;break;case 12:n.prev=12,n.t0=n.catch(0),console.log(n.t0);case 15:return n.prev=15,e.loading=!1,n.finish(15);case 18:case"end":return n.stop()}},n,e,[[0,12,15,18]])}))()}}},v={render:function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"accountManage-wrap"},[e("div",{staticClass:"screenBox flex"},[e("div"),t._v(" "),e("div",{staticClass:"right"},[e("el-button",{attrs:{type:"primary",size:"mini"},on:{click:t.onClickAddAccount}},[t._v("添加账号")])],1)]),t._v(" "),e("el-table",{staticStyle:{width:"100%","margin-top":"10px"},attrs:{height:t.height,data:t.accountList,"tooltip-effect":"dark"}},[e("el-table-column",{attrs:{label:"账号","min-width":"200",align:"center"},scopedSlots:t._u([{key:"default",fn:function(a){var n=a.row;return[e("span",[t._v(t._s(n.account))]),t._v(" "),0==n.active_status?e("el-tooltip",{attrs:{content:"账号未激活,请联系开发人员激活账号",placement:"top"}},[e("span",[e("i",{staticClass:"el-icon-warning-outline",staticStyle:{color:"red"}})])]):t._e()]}}])}),t._v(" "),e("el-table-column",{attrs:{label:"平台",prop:"platform_name","min-width":"160",align:"center"}}),t._v(" "),e("el-table-column",{attrs:{label:"描述",prop:"description","min-width":"160",align:"center"},scopedSlots:t._u([{key:"default",fn:function(a){var n=a.row;return[e("span",[t._v(t._s(n.description||"-"))])]}}])}),t._v(" "),e("el-table-column",{attrs:{label:"状态","min-width":"160",align:"center"},scopedSlots:t._u([{key:"default",fn:function(a){return[1==a.row.status?e("span",{staticClass:"c-448AFF"},[t._v("启用")]):e("span",{staticClass:"c-F03F5C"},[t._v("禁用")])]}}])}),t._v(" "),e("el-table-column",{attrs:{label:"关联短剧数量","min-width":"160",align:"center"},scopedSlots:t._u([{key:"default",fn:function(a){var n=a.row;return[e("span",{class:{"playlet-num":n.playlet_num>0},on:{click:function(a){return t.onClickPlayletList(n)}}},[t._v(t._s(n.playlet_num))])]}}])}),t._v(" "),e("el-table-column",{attrs:{label:"操作","min-width":"160",align:"center"},scopedSlots:t._u([{key:"default",fn:function(a){var n=a.row;return[e("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(a){return t.onClickEditAccount(n)}}},[t._v("编辑")]),t._v(" "),1==n.status?e("el-button",{attrs:{type:"danger",size:"mini"},on:{click:function(a){return t.onClickEnable(n,2)}}},[t._v("禁用")]):e("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(a){return t.onClickEnable(n,1)}}},[t._v("启用")])]}}])})],1),t._v(" "),e("div",{directives:[{name:"show",rawName:"v-show",value:t.pagination.total>0,expression:"pagination.total > 0"}],staticClass:"pagination"},[e("el-pagination",{attrs:{background:"","current-page":t.pagination.page,layout:"prev, pager, next","page-count":Number(t.pagination.pages)},on:{"current-change":t.handleCurrentChange}})],1),t._v(" "),e("addAccountDialog",{attrs:{dialogVisible:t.addAccountDialogVisible,accountInfo:t.currentAccountInfo},on:{confirm:t.handleAddAccountConfirm,cancel:t.handleAddAccountCancel}}),t._v(" "),e("playletListDialog",{attrs:{dialogVisible:t.playletListDialogVisible,accountInfo:t.currentAccountInfo},on:{close:t.handlePlayletListClose}})],1)},staticRenderFns:[]};var _=e("VU/8")(h,v,!1,function(t){e("pILI")},"data-v-62376292",null);a.default=_.exports},yBRA:function(t,a){}});