12 |
- webpackJsonp([8],{"24Mo":function(t,e){},DH2y:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"userList"},[a("div",{staticClass:"btn"},[a("button",{staticClass:"button",on:{click:function(e){t.addFlag=!0}}},[t._v("添加账户")])]),t._v(" "),a("el-table",{staticStyle:{width:"98%",margin:"auto"},attrs:{border:"",data:t.list}},[a("el-table-column",{attrs:{align:"center",label:"用户ID",prop:"id"}}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"用户名","show-overflow-tooltip":"",prop:"name"}}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"创建时间",prop:"created_at"}}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"手机号",prop:"phone"}}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"是否启用"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(1==e.row.enable?"启用":"禁用")+"\n ")]}}])}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{disabled:1==e.row.enable,type:"text"},on:{click:function(a){return t.enable(e.row.id)}}},[t._v("启用")]),t._v(" "),a("el-button",{attrs:{disabled:0==e.row.enable,type:"text"},on:{click:function(a){return t.disable(e.row.id)}}},[t._v("禁用")])]}}])})],1),t._v(" "),t.list.length>0?a("div",{staticClass:"bottom",staticStyle:{position:"relative"}},[a("div"),t._v(" "),a("el-pagination",{attrs:{background:"","current-page":t.page,"page-size":t.page_size,layout:"prev, pager, next",total:t.total},on:{"current-change":t.handleCurrentChange}})],1):t._e(),t._v(" "),a("my-dialog",{attrs:{visible:t.addFlag,width:"30%",minWidth:"500px"},on:{"update:visible":function(e){t.addFlag=e}}},[a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loadingSave,expression:"loadingSave"}],staticClass:"toast"},[a("h3",[t._v("添加账户")]),t._v(" "),a("div",{staticClass:"toastMain"},[a("div",{staticClass:"inputItem"},[a("label",{staticClass:"label"},[t._v("用户名")]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.name,expression:"name"}],staticClass:"toInput",attrs:{type:"text",placeholder:"请输入用户名"},domProps:{value:t.name},on:{input:function(e){e.target.composing||(t.name=e.target.value)}}})]),t._v(" "),a("div",{staticClass:"inputItem"},[a("label",{staticClass:"label"},[t._v("手机号")]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.phone,expression:"phone"}],staticClass:"toInput",attrs:{type:"text",placeholder:"请输入手机号"},domProps:{value:t.phone},on:{input:function(e){e.target.composing||(t.phone=e.target.value)}}})]),t._v(" "),a("div",{staticClass:"inputItem"},[a("label",{staticClass:"label"},[t._v("密码")]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.password,expression:"password"}],staticClass:"toInput",attrs:{type:"text",placeholder:"请输入密码"},domProps:{value:t.password},on:{input:function(e){e.target.composing||(t.password=e.target.value)}}})])]),t._v(" "),a("div",{staticClass:"toastBtn"},[a("el-button",{attrs:{size:"mini"},on:{click:function(e){t.addFlag=!1}}},[t._v("取消")]),t._v(" "),a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(e){return t.create()}}},[t._v("确定")])],1)])])],1)},staticRenderFns:[]};var s=a("C7Lr")({data:function(){return{loading:!1,list:[],page_size:1,total:1,addFlag:!1,password:"",phone:"",name:"",loadingSave:!1}},created:function(){this.init()},methods:{create:function(){var t=this;this.loadingSave=!0,this.$axios.post(this.URL.BASEURL+this.URL.create,{name:this.name,password:this.password,phone:this.phone}).then(function(e){e=e.data,t.loadingSave=!1,e&&0==e.errno?(t.$message.success("成功创建用户"),t.addFlag=!1,t.init()):t.$message({message:e.err,type:"warning"})}).catch(function(){t.loadingSave=!1})},init:function(t){var e=this;this.page=t,this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.userIndex,{params:{name:this.name,password:this.password,phone:this.phone}}).then(function(t){t=t.data,e.loading=!1,t&&0==t.errno?(e.list=t.rst.data,e.page_size=t.rst.pageInfo.size,e.total=t.rst.pageInfo.total,e.pages=t.rst.pageInfo.pages):e.$message({message:t.err,type:"warning"})}).catch(function(){e.loadingSave=!1})},handleCurrentChange:function(t){this.init(t)},disable:function(t){var e=this;this.loading=!0,this.$axios.post(this.URL.BASEURL+this.URL.disable,{id:t}).then(function(t){t=t.data,e.loading=!1,t&&0==t.errno?(e.$message.success("账户禁用成功"),e.init(1)):e.$message({message:t.err,type:"warning"})}).catch(function(){e.loadingSave=!1})},enable:function(t){var e=this;this.loading=!0,this.$axios.post(this.URL.BASEURL+this.URL.enable,{id:t}).then(function(t){t=t.data,e.loading=!1,t&&0==t.errno?(e.$message.success("账户启用成功"),e.init(1)):e.$message({message:t.err,type:"warning"})}).catch(function(){e.loadingSave=!1})}}},n,!1,function(t){a("24Mo")},"data-v-f80e91a8",null);e.default=s.exports}});
- //# sourceMappingURL=8.3160afde18f496b719f0.js.map
|