12 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d914966"],{"129d":function(t,e,a){"use strict";a("b94e")},9973:function(t,e,a){"use strict";var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-pagination",{attrs:{background:"","page-size":t.page_size?t.page_size:20,"current-page":t.current,"page-sizes":[10,20,30,40,50,60,70,80,90,100],layout:"total,sizes,prev, pager, next",total:t.total},on:{"current-change":t.getData,"size-change":t.handleSizeChange}})},i=[],r={data:function(){return{page:1}},props:{total:"",page_size:"",current:""},methods:{getData:function(t){this.page=t,this.$emit("pageChange")},handleSizeChange:function(t){this.$emit("pageChange",t)}},created:function(){}},l=r,o=(a("129d"),a("4ac2")),s=Object(o["a"])(l,n,i,!1,null,null,null);e["a"]=s.exports},"9f50":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("section",{staticClass:"content"},[a("h4",[t._v("赛事管理")]),a("el-divider"),a("el-form",{staticClass:"filter-form",attrs:{"label-width":"80px"}},[a("el-row",[a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"赛事名称"}},[a("el-input",{attrs:{clearable:"",placeholder:"请输入赛事名称",size:"mini"},on:{clear:function(e){return t.getData()}},model:{value:t.queryParams.name,callback:function(e){t.$set(t.queryParams,"name",e)},expression:"queryParams.name"}})],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:t.getData}},[t._v("筛选")]),a("el-button",{attrs:{type:"primary",plain:"",icon:"el-icon-plus",size:"mini"},on:{click:t.handleAdd}},[t._v("新增赛事")])],1)],1)],1)],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%","margin-top":"10px"},attrs:{data:t.list,height:"50vh"}},[a("el-table-column",{attrs:{align:"center",prop:"name",label:"赛事名称"}}),a("el-table-column",{attrs:{align:"center",prop:"join_count",label:"参赛人数"}}),a("el-table-column",{attrs:{align:"center",prop:"out_count",label:"退赛人数"}}),a("el-table-column",{attrs:{align:"center",prop:"groups",label:"比赛分组"}}),a("el-table-column",{attrs:{align:"center",prop:"start_time",label:"开始时间"}}),a("el-table-column",{attrs:{align:"center",prop:"end_time",label:"结束时间"}}),a("el-table-column",{attrs:{align:"center",prop:"date",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{size:"mini",type:"warning"},on:{click:function(a){t.title="编辑赛事",t.open=!0,t.form=e.row}}},[t._v("编辑")]),a("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(a){return t.del(e.row.id)}}},[t._v("删除")])]}}])})],1),a("Page",{ref:"pageButton",attrs:{current:t.form.page,page_size:t.form.page_size,total:t.total},on:{pageChange:t.gopage}}),a("el-dialog",{attrs:{title:t.title,visible:t.open,width:"500px","append-to-body":""},on:{"update:visible":function(e){t.open=e}}},[a("el-form",{ref:"form",attrs:{model:t.form,rules:t.rules,"label-width":"80px"}},[a("el-form-item",{attrs:{label:"比赛名称",prop:"name"}},[a("el-input",{attrs:{clearable:"",placeholder:"请输入比赛名称"},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),a("el-form-item",{attrs:{label:"开始时间",prop:"start_time"}},[a("el-date-picker",{attrs:{type:"date",placeholder:"选择日期",format:"yyyy-MM-dd","value-format":"yyyy-MM-dd",size:"mini"},model:{value:t.form.start_time,callback:function(e){t.$set(t.form,"start_time",e)},expression:"form.start_time"}})],1),a("el-form-item",{attrs:{label:"结束时间",prop:"end_time"}},[a("el-date-picker",{attrs:{type:"date",placeholder:"选择日期",format:"yyyy-MM-dd","value-format":"yyyy-MM-dd",size:"mini"},model:{value:t.form.end_time,callback:function(e){t.$set(t.form,"end_time",e)},expression:"form.end_time"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:t.submitForm}},[t._v("确 定")]),a("el-button",{on:{click:function(e){t.open=!1}}},[t._v("取 消")])],1)],1)],1)},i=[],r=a("9973"),l={components:{Page:r["a"]},data:function(){return{loading:!1,queryParams:{page:1},form:{},list:[{},{}],total:0,title:"新增赛事",open:!1,rules:{name:[{required:!0,message:"请输入比赛名称",trigger:"blur"}],start_time:[{required:!0,message:"请输入开始时间",trigger:"blur"}],end_time:[{required:!0,message:"请输入结束时间",trigger:"blur"}]},matchList:[],groupList:[],userList:[]}},methods:{del:function(t){var e=this;this.$confirm("确定删除吗?","提示",{type:"warning"}).then((function(){e.$api.delMatch({id:t}).then((function(t){e.$message({message:"删除成功",type:"success"}),e.getData()}))}))},gopage:function(t){t&&(this.queryParams.page_size=t),this.queryParams.page=this.$refs.pageButton.page,this.getData()},getData:function(){var t=this;this.loading=!0,this.$api.getMatchList().then((function(e){t.matchList=e.data.data})),this.$api.getGroupList().then((function(e){t.groupList=e.data.data})),this.$api.getUserSearch().then((function(e){t.userList=e.data.data})),this.$api.getMatchs(this.queryParams).then((function(e){t.list=e.data.data.list,t.total=e.data.data.total,t.loading=!1}))},handleAdd:function(){this.open=!0,this.title="新增赛事",this.form={}},submitForm:function(){var t=this;this.$refs["form"].validate((function(e){e&&(null!=t.form.id?t.$api.updateMatch(t.form).then((function(e){t.msgSuccess("修改成功"),t.open=!1,t.getData()})):t.$api.addMatch(t.form).then((function(e){t.msgSuccess("新增成功"),t.open=!1,t.getData()})))}))}},created:function(){this.getData()}},o=l,s=a("4ac2"),c=Object(s["a"])(o,n,i,!1,null,null,null);e["default"]=c.exports},b94e:function(t,e,a){}}]);
- //# sourceMappingURL=chunk-2d914966.d9966fb6.js.map
|