企微助手 ,仓库名 短剧

83.9ce89d15b563ab37f975.js 6.2KB

1
  1. webpackJsonp([83],{"4iU6":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={components:{selfInput:a("McOJ").a},data:function(){return{loading:!1,input_keyword:"",page:1,pages:0,total:0,page_size:20,tableData:[],desCol:[{prop:"name",label:"短剧名称"},{prop:"created_at",label:"创建时间"},{prop:"enable",label:"状态"}],height:"",dialogFlag:!1,drama_name:"",drama_id:"",enable:!0}},created:function(){this.height=document.documentElement.clientHeight-200>400?document.documentElement.clientHeight-200:400,this.init(1)},methods:{enableEvent:function(e,t){var a=this;this.loading=!0;var i={drama_name:e.name,drama_id:e.id,enable:t};this.$axios.post(this.URL.BASEURL+this.URL.pitcher_dramaEdit,i).then(function(e){e=e.data;a.loading=!1,e&&0==e.errno?a.init(a.page):4002!=e.errno&&a.$message({message:e.err,type:"warning"})}).catch(function(e){a.loading=!1})},submitEvent:function(){var e=this;if(""!=this.drama_name){this.$loading(this.$loadingConfig);var t=this.URL.pitcher_dramaAdd,a={drama_name:this.drama_name};this.drama_id&&""!=this.drama_id&&(t=this.URL.pitcher_dramaEdit,a.drama_id=this.drama_id,a.enable=this.enable?1:0),this.$axios.post(this.URL.BASEURL+t,a).then(function(t){t=t.data;e.$loading(e.$loadingConfig).close(),t&&0==t.errno?(e.drama_id&&""!=e.drama_id?e.init(e.page):e.init(1),e.dialogFlag=!1):4002!=t.errno&&e.$message({message:t.err,type:"warning"})}).catch(function(t){e.$loading(e.$loadingConfig).close()})}else this.$message({message:"请输入短剧名称",type:"warning"})},addDrama:function(){this.enable=!0,this.drama_id="",this.drama_name="",this.dialogFlag=!0},editDrama:function(e){this.enable=1==e.enable,this.drama_name=e.name,this.drama_id=e.id,this.dialogFlag=!0},init:function(e,t){var a=this;if("export"!=t)this.page=e||this.page;else if(0==this.total)return void this.$message({message:"暂无数据可导出",type:"warning"});this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.pitcher_dramaList,{params:{keyword:this.input_keyword,is_select:0,page:"export"==t?1:this.page,page_size:"export"==t?this.$store.state.exportNumber:this.page_size}}).then(function(e){e=e.data;if(a.loading=!1,e&&0==e.errno)if("export"==t)a.exportEvent(e.rst.data);else{if(a.total=e.rst.pageInfo.total,a.pages=e.rst.pageInfo.pages,!e.rst.data||0==e.rst.data.length)return;a.tableData=e.rst.data}else 4002!=e.errno&&a.$message({message:e.err,type:"warning"})}).catch(function(e){a.loading=!1})},handleCurrentChange:function(e){this.init(e)},exportEvent:function(e){var t=e,a=this.desCol.map(function(e){return e.label}),i=[],n=[];this.desCol.forEach(function(e){"extra"==e.self_type?(i.push("slef_"+e.prop),n.push(e.prop)):i.push(e.prop)}),t.forEach(function(e){n.forEach(function(t){e["slef_"+t]=e.retrieveInfo[t]})});var s=[{tHeader:a,filterVal:i,tableDatas:t,sheetName:""}];this.$exportOrder({excelDatas:s,name:"运营数据(导出时间:"+this.$getDay(0)+")"})},onChangeKeyword:function(e){this.input_keyword=e,this.init(1)}}},n={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}]},[a("div",{staticClass:"screenBox flex"},[a("div",{staticClass:"flex"},[a("selfInput",{attrs:{label_name:"搜索短剧"},on:{inputChange:e.onChangeKeyword}})],1),e._v(" "),a("div",{staticClass:"right"},[a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.addDrama}},[e._v("添加短剧")])],1)]),e._v(" "),a("el-table",{ref:"multipleTable",staticStyle:{width:"100%","margin-top":"10px"},attrs:{height:e.height,data:e.tableData,"tooltip-effect":"dark"}},[e._l(e.desCol,function(t,i){return a("el-table-column",{key:i+"des",attrs:{"min-width":"160",prop:t.prop,label:t.label,"show-overflow-tooltip":"",align:"center",fixed:"date"==t.prop&&"left"},scopedSlots:e._u([{key:"default",fn:function(i){return["enable"==t.prop?[1==i.row.enable?a("span",{staticClass:"c-448AFF"},[e._v("启用")]):a("span",{staticClass:"c-F03F5C"},[e._v("禁用")])]:a("span",[e._v(e._s(i.row[t.prop]))])]}}],null,!0)})}),e._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"160",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(a){return e.editDrama(t.row)}}},[e._v("编辑")]),e._v(" "),1==t.row.enable?a("el-button",{attrs:{type:"danger",size:"mini"},on:{click:function(a){return e.enableEvent(t.row,0)}}},[e._v("禁用")]):a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(a){return e.enableEvent(t.row,1)}}},[e._v("启用")])]}}])})],2),e._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total>0"}],staticClass:"pagination"},[a("el-pagination",{attrs:{background:"","current-page":e.page,layout:"prev, pager, next","page-count":Number(e.pages)},on:{"current-change":e.handleCurrentChange}})],1),e._v(" "),a("el-dialog",{attrs:{title:e.drama_id?"编辑短剧":"添加短剧",visible:e.dialogFlag,"append-to-body":!0,width:"400px"},on:{"update:visible":function(t){e.dialogFlag=t}}},[a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{"margin-top":"-20px"}},[a("div",{staticClass:"dialogCon"},[a("div",{staticClass:"itemBox",staticStyle:{"margin-top":"15px"}},[a("div",{staticClass:"name"},[a("em",[e._v("*")]),e._v("短剧名称")]),e._v(" "),a("el-input",{attrs:{size:"small",placeholder:"请输入短剧名称",clearable:""},model:{value:e.drama_name,callback:function(t){e.drama_name=t},expression:"drama_name"}})],1),e._v(" "),e.drama_id?a("div",{staticClass:"itemBox",staticStyle:{"margin-top":"15px"}},[a("div",{staticClass:"name"},[a("em",[e._v("*")]),e._v("是否启用:")]),e._v(" "),a("el-switch",{attrs:{"active-color":"#43B083","inactive-color":"#ccc"},model:{value:e.enable,callback:function(t){e.enable=t},expression:"enable"}})],1):e._e()]),e._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"mini"},on:{click:function(t){e.dialogFlag=!1}}},[e._v("取 消")]),e._v(" "),a("el-button",{attrs:{size:"mini",type:"primary"},on:{click:e.submitEvent}},[e._v("确 定")])],1)])])],1)},staticRenderFns:[]};var s=a("VU/8")(i,n,!1,function(e){a("vVId")},"data-v-705d5aca",null);t.default=s.exports},vVId:function(e,t){}});