直播数据中心

39.b6726221c8c3c44a352b.js 4.6KB

1
  1. webpackJsonp([39],{Dgg9:function(t,i){},Pjd4:function(t,i,e){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var a={render:function(){var t=this,i=t.$createElement,e=t._self._c||i;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[e("div",{staticClass:"commonInfo operation_container"},[e("button",{staticClass:"addButton",on:{click:function(i){return t.addEvent()}}},[t._v("添加团队")])]),t._v(" "),e("div",{staticClass:"table_div"},[e("table",[t._m(0),t._v(" "),e("tbody",t._l(t.infoList,function(i){return e("tr",{key:i.id,staticClass:"pointer"},[e("td",[t._v(t._s(i.id))]),t._v(" "),e("td",[e("span",[t._v(t._s(i.team_name?i.team_name:"-"))])]),t._v(" "),e("td",[e("el-button",{staticClass:"modifybtn",attrs:{size:"mini"},on:{click:function(e){return t.editEvent(i)}}},[t._v("编 辑")]),t._v(" "),e("el-button",{staticClass:"delebtn",attrs:{size:"mini"},on:{click:function(e){return t.deleteFlagEvent(i)}}},[t._v("删 除")])],1)])}),0)])]),t._v(" "),t.loading||0!=t.infoList.length?t._e():e("div",{staticClass:"noHaveDate"},[t._v("暂无数据")]),t._v(" "),e("div",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total>0"}],staticClass:"bottom"},[e("el-pagination",{attrs:{background:"","current-page":t.page,layout:"prev, pager, next","page-count":Number(t.pages)},on:{"current-change":t.handleCurrentChange}})],1),t._v(" "),e("el-dialog",{attrs:{title:(t.isEdit?"编辑":"添加")+"团队",visible:t.dialogFlag,width:"500px","close-on-click-modal":!1,left:""},on:{"update:visible":function(i){t.dialogFlag=i}}},[e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"dialogBox"},[e("div",{staticClass:"dialogitem"},[e("label",[t._v("团队名称:")]),t._v(" "),e("el-input",{staticStyle:{width:"56%"},attrs:{placeholder:"请输入团队名称",size:"small",clearable:""},model:{value:t.team_name,callback:function(i){t.team_name="string"==typeof i?i.trim():i},expression:"team_name"}})],1)]),t._v(" "),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{attrs:{size:"mini"},on:{click:function(i){t.dialogFlag=!1}}},[t._v("取 消")]),t._v(" "),e("el-button",{attrs:{type:"primary",size:"mini"},on:{click:t.roomEdit}},[t._v("提 交")])],1)])],1)},staticRenderFns:[function(){var t=this.$createElement,i=this._self._c||t;return i("thead",[i("tr",[i("th",[i("div",{staticClass:"th_title"},[this._v("团队ID")])]),this._v(" "),i("th",[i("div",{staticClass:"th_title"},[this._v("团队名称")])]),this._v(" "),i("th",{staticStyle:{"margin-right":"20px"}},[i("div",{staticClass:"th_title"},[this._v("\n 操作\n ")])])])])}]};var n=e("VU/8")({data:function(){return{total:0,page:1,pages:0,page_size:20,loading:!1,infoList:[],dialogFlag:!1,isEdit:!1,edit_id:"",team_name:""}},created:function(){this.init(1)},methods:{addEvent:function(){this.dialogFlag=!0,this.isEdit=!1,this.team_name="",this.edit_id=""},editEvent:function(t){this.dialogFlag=!0,this.isEdit=!0,this.edit_id=t.id,this.team_name=t.team_name},roomEdit:function(){var t=this;if(""!=this.team_name&&this.team_name){var i=this.URL.addTeam,e={team_name:this.team_name};this.isEdit&&(i=this.URL.editTeam,e.id=this.edit_id),this.$loading(this.$loadingConfig),this.$axios.post(this.URL.BASEURL+i,e).then(function(i){i=i.data,t.$loading(t.$loadingConfig).close(),i&&0==i.errno?(t.$message({message:t.isEdit?"编辑成功":"添加成功",type:"success"}),t.dialogFlag=!1,t.init(t.page)):4002!=i.errno&&t.$message({message:i.err,type:"warning"})}).catch(function(i){t.$loading(t.$loadingConfig).close()})}else this.$message({message:"请输入团队名称",type:"warning"})},deleteFlagEvent:function(t){var i=this;this.$confirm("确定要删除该团队?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){i.$loading(i.$loadingConfig),i.$axios.post(i.URL.BASEURL+i.URL.delTeam,{id:t.id}).then(function(t){t=t.data,i.$loading(i.$loadingConfig).close(),t&&0==t.errno?i.init(i.page):i.$message({message:t.rst,type:"warning"})}).catch(function(){i.$loading(i.$loadingConfig).close()})}).catch(function(){})},init:function(t){var i=this;this.page=t||this.page,this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.teamsList,{params:{page:this.page,page_size:this.page_size}}).then(function(t){t=t.data,i.loading=!1,t&&0==t.errno?(i.infoList=t.rst.data,i.total=t.rst.pageInfo.total,i.pages=t.rst.pageInfo.pages):4002!=t.errno&&i.$message({message:t.err,type:"warning"})}).catch(function(t){i.loading=!1})},handleCurrentChange:function(t){this.init(t)}}},a,!1,function(t){e("Dgg9")},"data-v-8f57c08c",null);i.default=n.exports}});