chunk-5a241b3e.6bebf663.js 8.3 KB

12
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5a241b3e"],{"129d":function(e,t,a){"use strict";a("b94e")},"62b6":function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("section",{staticClass:"content"},[a("h4",[e._v("选手管理")]),a("el-divider"),a("el-form",{staticClass:"filter-form",attrs:{"label-width":"80px"}},[a("el-row",[a("el-col",{attrs:{span:5}},[a("el-form-item",{attrs:{label:"用户"}},[a("el-input",{attrs:{clearable:"",placeholder:"请输入用户名/代码",size:"mini"},on:{clear:function(t){return e.getData()}},model:{value:e.queryParams.username,callback:function(t){e.$set(e.queryParams,"username",t)},expression:"queryParams.username"}})],1)],1),a("el-col",{attrs:{span:5}},[a("el-form-item",{attrs:{label:"比赛名称",prop:"match_id"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择比赛",size:"mini"},on:{change:function(t){return e.getData()}},model:{value:e.queryParams.match_id,callback:function(t){e.$set(e.queryParams,"match_id",t)},expression:"queryParams.match_id"}},e._l(e.matchList,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1)],1),a("el-col",{attrs:{span:5}},[a("el-form-item",{attrs:{label:"比赛分组"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择比赛分组",size:"mini"},on:{change:function(t){return e.getData()}},model:{value:e.queryParams.groupId,callback:function(t){e.$set(e.queryParams,"groupId",t)},expression:"queryParams.groupId"}},e._l(e.groupList,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1)],1),a("el-col",{attrs:{span:4}},[a("el-form-item",{staticStyle:{"margin-left":"10px"},attrs:{"label-width":"10"}},[a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.getData}},[e._v("筛选")]),a("el-button",{attrs:{type:"nomal",size:"mini"},on:{click:function(t){e.queryParams={},e.getData()}}},[e._v("重置")]),a("el-button",{attrs:{type:"primary",plain:"",icon:"el-icon-plus",size:"mini"},on:{click:e.handleAdd}},[e._v("新增选手")])],1)],1)],1)],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%","margin-top":"10px"},attrs:{data:e.list,height:"50vh"}},[a("el-table-column",{attrs:{align:"center",prop:"usercode",label:"选手代码"}}),a("el-table-column",{attrs:{align:"center",prop:"username",label:"选手名称"}}),a("el-table-column",{attrs:{align:"center",prop:"match_name",label:"比赛名称"}}),a("el-table-column",{attrs:{align:"center",prop:"match_group_name",label:"比赛分组"}}),a("el-table-column",{attrs:{align:"center",prop:"fund",label:"初始资金(万元)"}}),a("el-table-column",{attrs:{align:"center",prop:"date",label:"参赛状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[1==t.row.match_status?a("span",[e._v("参赛中")]):e._e(),0==t.row.match_status?a("span",[e._v("暂停")]):e._e(),-1==t.row.match_status?a("span",[e._v("退赛")]):e._e()]}}])}),a("el-table-column",{attrs:{align:"center",prop:"date",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{size:"mini",type:"warning"},on:{click:function(a){return e.edit(t.row.id)}}},[e._v("编辑")]),a("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(a){return e.del(t.row.id)}}},[e._v("删除")])]}}])})],1),a("Page",{ref:"pageButton",attrs:{current:e.form.page,page_size:e.form.page_size,total:e.total},on:{pageChange:e.gopage}}),a("el-dialog",{attrs:{title:e.title,visible:e.open,width:"500px","append-to-body":""},on:{"update:visible":function(t){e.open=t}}},[a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"80px"}},[a("el-form-item",{attrs:{label:"选手代码",prop:"user_id"}},[a("el-select",{attrs:{filterable:"",placeholder:"请选择用户代码"},model:{value:e.form.user_id,callback:function(t){e.$set(e.form,"user_id",t)},expression:"form.user_id"}},e._l(e.userList,(function(e){return a("el-option",{key:e.id,attrs:{label:e.label,value:e.id}})})),1)],1),a("el-form-item",{attrs:{label:"初始资金",prop:"fund"}},[a("el-input",{attrs:{clearable:"",placeholder:"请输入初始资金"},model:{value:e.form.fund,callback:function(t){e.$set(e.form,"fund",t)},expression:"form.fund"}},[a("template",{slot:"append"},[e._v("万元")])],2)],1),a("el-form-item",{attrs:{label:"比赛名称",prop:"match_id"}},[a("el-select",{attrs:{placeholder:"请选择比赛"},model:{value:e.form.match_id,callback:function(t){e.$set(e.form,"match_id",t)},expression:"form.match_id"}},e._l(e.matchList,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),a("el-form-item",{attrs:{label:"比赛分组",prop:"match_group"}},[a("el-select",{attrs:{placeholder:"请选择比赛分组"},model:{value:e.form.match_group,callback:function(t){e.$set(e.form,"match_group",t)},expression:"form.match_group"}},e._l(e.groupList,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),a("el-form-item",{attrs:{label:"参数状态",prop:"match_status"}},[a("el-select",{attrs:{placeholder:"请选择参数状态"},model:{value:e.form.match_status,callback:function(t){e.$set(e.form,"match_status",t)},expression:"form.match_status"}},[a("el-option",{key:"1",attrs:{label:"参赛中",value:1}}),a("el-option",{key:"0",attrs:{label:"暂停",value:0}}),a("el-option",{key:"-1",attrs:{label:"已退赛",value:-1}})],1)],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("确 定")]),a("el-button",{on:{click:function(t){e.open=!1}}},[e._v("取 消")])],1)],1)],1)},l=[],n=a("9973"),i={components:{Page:n["a"]},data:function(){return{loading:!1,queryParams:{page:1,page_size:10},form:{match_status:1},list:[{},{}],total:0,title:"新增选手",open:!1,rules:{user_id:[{required:!0,message:"请选择选手",trigger:"change"}],fund:[{required:!0,message:"请输入比赛资金",trigger:"blur"}],match_id:[{required:!0,message:"请选择比赛",trigger:"change"}],usercode:[{required:!0,message:"请输入用户代码",trigger:"blur"}],match_group:[{required:!0,message:"请选择分组",trigger:"change"}],match_status:[{required:!0,message:"请选择参数状态",trigger:"change"}]},matchList:[],groupList:[],userList:[]}},methods:{del:function(e){var t=this;this.$confirm("删除选手会删除相关数据,确定删除吗?","提示",{type:"warning"}).then((function(){t.$api.delPlayer({id:e}).then((function(e){t.$message({message:"删除成功",type:"success"}),t.getData()}))}))},gopage:function(e){e&&(this.queryParams.page_size=e),this.queryParams.page=this.$refs.pageButton.page,this.getData()},getData:function(){var e=this;this.loading=!0,this.$api.getMatchList().then((function(t){e.matchList=t.data.data})),this.$api.getGroupList().then((function(t){e.groupList=t.data.data})),this.$api.getUserSearch().then((function(t){e.userList=t.data.data})),this.$api.getPlayers(this.queryParams).then((function(t){e.list=t.data.data.list,e.total=t.data.data.total,e.loading=!1}))},handleAdd:function(){this.open=!0,this.title="新增选手",this.form={}},edit:function(e){var t=this;this.title="编辑选手",this.$api.getPlayerInfo({id:e}).then((function(e){t.form=e.data.data,t.open=!0}))},submitForm:function(){var e=this;this.$refs["form"].validate((function(t){t&&(null!=e.form.id?e.$api.updatePlayer(e.form).then((function(t){e.msgSuccess("修改成功"),e.open=!1,e.getData()})):e.$api.addPlayer(e.form).then((function(t){e.msgSuccess("新增成功"),e.open=!1,e.getData()})))}))}},created:function(){this.getData()}},s=i,o=a("4ac2"),u=Object(o["a"])(s,r,l,!1,null,null,null);t["default"]=u.exports},9973:function(e,t,a){"use strict";var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-pagination",{attrs:{background:"","page-size":e.page_size?e.page_size:20,"current-page":e.current,"page-sizes":[10,20,30,40,50,60,70,80,90,100],layout:"total,sizes,prev, pager, next",total:e.total},on:{"current-change":e.getData,"size-change":e.handleSizeChange}})},l=[],n={data:function(){return{page:1}},props:{total:"",page_size:"",current:""},methods:{getData:function(e){this.page=e,this.$emit("pageChange")},handleSizeChange:function(e){this.$emit("pageChange",e)}},created:function(){}},i=n,s=(a("129d"),a("4ac2")),o=Object(s["a"])(i,r,l,!1,null,null,null);t["a"]=o.exports},b94e:function(e,t,a){}}]);
  2. //# sourceMappingURL=chunk-5a241b3e.6bebf663.js.map