|
|
|
|
webpackJsonp([1],{"/75w":function(t,e,r){"use strict";r.d(e,"a",function(){return a}),r.d(e,"b",function(){return s});var a=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("FormDlg",{ref:"dlg",attrs:{title:"编辑用户",disabled:t.errors.any()},on:{hide:t.onHide,submit:t.onSubmit}},[t.form.id?t._e():r("div",{staticClass:"alert alert-success alert-dismissible"},[r("small",[t._v("新增用户, 初始默认密码是 "+t._s(t.defaultPwd))]),t._v(" "),r("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"alert","aria-label":"Close"}},[r("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])])]),t._v(" "),r("input",{directives:[{name:"model",rawName:"v-model.trim",value:t.form.id,expression:"form.id",modifiers:{trim:!0}}],attrs:{type:"hidden",name:"id"},domProps:{value:t.form.id},on:{input:function(e){e.target.composing||t.$set(t.form,"id",e.target.value.trim())},blur:function(e){t.$forceUpdate()}}}),t._v(" "),r("div",{class:["form-group",{"has-error":t.errors.has("name")}]},[r("label",{staticClass:"col-sm-3 control-label",attrs:{for:"input-name"}},[r("span",{staticClass:"text-red"},[t._v("*")]),t._v(" 用户名")]),t._v(" "),r("div",{staticClass:"col-sm-7"},[r("input",{directives:[{name:"validate",rawName:"v-validate",value:"required",expression:"'required'"},{name:"model",rawName:"v-model.trim",value:t.form.name,expression:"form.name",modifiers:{trim:!0}}],staticClass:"form-control",attrs:{type:"text",id:"input-name",name:"name","data-vv-as":"用户名"},domProps:{value:t.form.name},on:{keydown:function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?(e.preventDefault(),t.onSubmit(e)):null},input:function(e){e.target.composing||t.$set(t.form,"name",e.target.value.trim())},blur:function(e){t.$forceUpdate()}}}),t._v(" "),r("span",{staticClass:"help-block"},[t._v(t._s(t.errors.first("name")))])])])])},s=[]},"3GEF":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=r("pQ0r"),s=r.n(a);for(var n in a)"default"!==n&&function(t){r.d(e,t,function(){return a[t]})}(n);var i=r("/75w"),o=r("PrYt"),u=Object(o.a)(s.a,i.a,i.b,!1,null,null,null);e.default=u.exports},Cs4j:function(t,e,r){"use strict";function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var s=r("3GEF"),n=a(s),i=r("0iPh"),o=a(i);e.default={props:{page:{type:Number,default:1},q:{type:String,default:""}},data:function(){return{query:"",defaultPwd:"",pageSize:10,total:0,users:[]}},activated:function(){this.$refs.search.focus()},components:{UserFormDlg:n.default},mounted:function(){var t=this;this.query=this.q,this.$refs.search.focus(),this.load(),o.default.get("/user/defaultPwd").then(function(e){t.defaultPwd=e})},computed:{},methods:{load:function(){var t=this;o.default.get("/user/list",{q:this.q,start:(this.currentPage-1)*this.pageSize,limit:this.pageSize}).then(function(e){t.total=e.total,t.users=e.rows})},remove:function(t){var e=this;this.$confirm("确认删除用户 "+t.name+" ?","提示").then(function(){o.default.get("/user/remove",{id:t.id}).always(function(){e.load()})}).catch(function(){})},resetPwd:function(t){var e=this;this.$confirm("确认要重置用户 "+t.name+" 登录密码为默认密码 "+this.defaultPwd+" 吗?","提示").then(function(){o.default.get("/user/resetPwd",{id:t.id}).then(function(t){e.$message({type:"success",message:"密码重置成功"})})}).catch(function(){})},doSearch:function(){this.$router.push("/users/"+this.page+(this.query?"?q="+this.query:""))}},beforeRouteEnter:function(t,e,r){return t.params.page?(t.params.page=parseInt(t.params.page)||1,t.params.q=t.query.q,r()):r({path:"/users/1",replace:!0})},beforeRouteUpdate:function(t,e,r){var a=this;if(!t.params.page)return r({path:"/users/1",replace:!0});t.params.page=parseInt(t.params.page)||1,t.params.q=t.query.q,r(),this.$nextTick(function(){a.query=a.q,a.load()})}}},m5jp:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=r("Cs4j"),s=r.n(a);for(var n in a)"default"!==n&&function(t){r.d(e,t,function(){return a[t]})}(n);var i=r("uy0E
|