12 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7b04c026"],{"129d":function(e,t,a){"use strict";a("b94e")},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}})},o=[],l={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(){}},s=l,n=(a("129d"),a("4ac2")),i=Object(n["a"])(s,r,o,!1,null,null,null);t["a"]=i.exports},b94e:function(e,t,a){},e382: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":"40px"}},[a("el-row",[a("el-col",{attrs:{span:4}},[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:8}},[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:"primary",plain:"",icon:"el-icon-plus",size:"mini"},on:{click:e.handleAdd}},[e._v("新增用户")]),a("el-button",{attrs:{type:"primary",icon:"el-icon-plus",size:"mini"},on:{click:e.handleFastAdd}},[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:"date",label:"绑定"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.is_bind?a("span",[e._v("已绑定")]):a("span",[e._v("未绑定")])]}}])}),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:"username"}},[a("el-input",{attrs:{clearable:"",placeholder:"请输入用户名"},model:{value:e.form.username,callback:function(t){e.$set(e.form,"username",t)},expression:"form.username"}})],1),a("el-form-item",{attrs:{label:"用户代码",prop:"usercode"}},[a("el-input",{attrs:{clearable:"",placeholder:"请输入代码"},model:{value:e.form.usercode,callback:function(t){e.$set(e.form,"usercode",t)},expression:"form.usercode"}})],1),e.form.id?a("el-form-item",{attrs:{label:"用户代码"}},[a("el-select",{attrs:{placeholder:"请选择比赛分组"},model:{value:e.form.is_bind,callback:function(t){e.$set(e.form,"is_bind",t)},expression:"form.is_bind"}},[a("el-option",{attrs:{label:"已绑定",value:1}}),a("el-option",{attrs:{label:"未绑定",value:0}})],1)],1):e._e()],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),a("el-dialog",{attrs:{title:e.title,visible:e.open1,width:"500px","append-to-body":""},on:{"update:visible":function(t){e.open1=t}}},[a("el-form",{ref:"form1",attrs:{model:e.form1,rules:e.rules1,"label-width":"80px"}},[a("el-form-item",{attrs:{label:"用户名",prop:"username"}},[a("el-input",{attrs:{clearable:"",placeholder:"请输入用户名"},model:{value:e.form1.username,callback:function(t){e.$set(e.form1,"username",t)},expression:"form1.username"}})],1),a("el-form-item",{attrs:{label:"用户代码",prop:"usercode"}},[a("el-input",{attrs:{clearable:"",placeholder:"请输入用户代码"},model:{value:e.form1.usercode,callback:function(t){e.$set(e.form1,"usercode",t)},expression:"form1.usercode"}})],1),a("el-form-item",{attrs:{label:"初始资金",prop:"fund"}},[a("el-input",{attrs:{clearable:"",placeholder:"请输入初始资金"},model:{value:e.form1.fund,callback:function(t){e.$set(e.form1,"fund",t)},expression:"form1.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.form1.match_id,callback:function(t){e.$set(e.form1,"match_id",t)},expression:"form1.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.form1.match_group,callback:function(t){e.$set(e.form1,"match_group",t)},expression:"form1.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.form1.match_status,callback:function(t){e.$set(e.form1,"match_status",t)},expression:"form1.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.fastSavePlayer}},[e._v("确 定")]),a("el-button",{on:{click:function(t){e.open1=!1}}},[e._v("取 消")])],1)],1)],1)},o=[],l=a("9973"),s={components:{Page:l["a"]},data:function(){return{loading:!1,queryParams:{page:1},form:{},form1:{},list:[{},{}],total:0,title:"新增用户",open:!1,open1:!1,matchList:[],groupList:[],rules:{username:[{required:!0,message:"请输入用户名",trigger:"blur"}]},rules1:{fund:[{required:!0,message:"请输入比赛资金",trigger:"blur"}],match_id:[{required:!0,message:"请选择比赛",trigger:"change"}],username:[{required:!0,message:"请输入用户名",trigger:"blur"}],match_group:[{required:!0,message:"请选择分组",trigger:"change"}],match_status:[{required:!0,message:"请选择参数状态",trigger:"change"}]}}},methods:{del:function(e){var t=this;this.$confirm("删除用户会删除相关数据,确定删除吗?","提示",{type:"warning"}).then((function(){t.$api.delUser({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.getUserList(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={}},handleFastAdd:function(){this.open1=!0,this.title="新增选手",this.form1={match_status:1,match_id:this.matchList[0].id}},edit:function(e){var t=this;this.title="编辑用户",this.$api.getUserInfo({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.editUser(e.form).then((function(t){0==t.data.code?(e.msgSuccess("成功!"),e.open=!1,e.getData()):e.msgError(t.data.message)})):e.$api.addUser(e.form).then((function(t){0==t.data.code?(e.msgSuccess("成功!"),e.open=!1,e.getData()):e.msgError(t.data.message)})))}))},fastSavePlayer:function(){var e=this;this.$refs["form1"].validate((function(t){t&&(null!=e.form1.id?e.$api.fastSavePlayer(e.form1).then((function(t){0==t.data.code?(e.msgSuccess("成功!"),e.open=!1,e.getData()):e.msgError(t.data.message)})):e.$api.fastSavePlayer(e.form1).then((function(t){0==t.data.code?(e.msgSuccess("成功!"),e.open1=!1,e.getData()):e.msgError(t.data.message)})))}))}},created:function(){this.getData()}},n=s,i=a("4ac2"),c=Object(i["a"])(n,r,o,!1,null,null,null);t["default"]=c.exports}}]);
- //# sourceMappingURL=chunk-7b04c026.e4295a14.js.map
|