(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7b04c026"],{"129d":function(e,t,a){"use strict";a("b94e")},9973:function(e,t,a){"use strict";var n=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}})},r=[],i={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(){}},o=i,s=(a("129d"),a("4ac2")),l=Object(s["a"])(o,n,r,!1,null,null,null);t["a"]=l.exports},b94e:function(e,t,a){},e382:function(e,t,a){"use strict";a.r(t);var n=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: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:"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:"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)],1)},r=[],i=a("9973"),o={components:{Page:i["a"]},data:function(){return{loading:!1,queryParams:{page:1},form:{},list:[{},{}],total:0,title:"新增用户",open:!1,rules:{username:[{required:!0,message:"请输入用户名",trigger:"blur"}]}}},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.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={}},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)})))}))}},created:function(){this.getData()}},s=o,l=a("4ac2"),c=Object(l["a"])(s,n,r,!1,null,null,null);t["default"]=c.exports}}]); //# sourceMappingURL=chunk-7b04c026.cfc68146.js.map