text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-a051fa78"],{"03e3":function(t,e,o){"use strict";o.r(e);var i=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("el-tabs",{attrs:{type:"border-card"}},[o("el-button",{staticStyle:{"margin-bottom":"10px"},attrs:{type:"primary",size:"medium"},on:{click:t.add_level}},[t._v("新增管理员\n\t\t")]),o("el-table",{staticStyle:{width:"100%"},attrs:{data:t.list,border:""}},[o("el-table-column",{attrs:{prop:"id",label:"id",width:"50px"}}),o("el-table-column",{attrs:{prop:"name",label:"账号"}}),o("el-table-column",{attrs:{prop:"create_time",label:"创建时间"}}),o("el-table-column",{attrs:{prop:"operation",label:"操作",width:"300px"},scopedSlots:t._u([{key:"default",fn:function(e){return[o("el-button",{attrs:{type:"danger",size:"mini"},on:{click:function(o){return t.qclose(e.row.id)}}},[t._v("删除")]),o("el-button",{attrs:{type:"success",size:"mini"},on:{click:function(o){return t.open(e.row.id)}}},[t._v("修改密码")])]}}])}),o("strong")],1)],1),o("el-dialog",{staticStyle:{"text-align":"left"},attrs:{title:"新增管理员",visible:t.dialogVisible,width:"30%"},on:{"update:visible":function(e){t.dialogVisible=e}}},[o("el-form",{ref:"form",attrs:{model:t.form,"label-width":"80px"}},[o("el-form-item",{attrs:{label:"用户名"}},[o("el-input",{attrs:{placeholder:"请输入用户名..."},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),o("el-form-item",{attrs:{label:"密码"}},[o("el-input",{attrs:{placeholder:"请输入密码...","show-password":""},model:{value:t.form.pwd,callback:function(e){t.$set(t.form,"pwd",e)},expression:"form.pwd"}})],1)],1),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(e){t.dialogVisible=!1}}},[t._v("取 消")]),o("el-button",{attrs:{type:"primary"},on:{click:t.admin_add}},[t._v("确 定")])],1)],1),o("el-dialog",{staticStyle:{"text-align":"left"},attrs:{title:"修改密码",visible:t.dialog2,width:"30%"},on:{"update:visible":function(e){t.dialog2=e}}},[o("el-form",{ref:"pwd_from",attrs:{model:t.pwd_from,"label-width":"80px"}},[o("el-form-item",{attrs:{label:"旧密码"}},[o("el-input",{attrs:{placeholder:"请输入旧密码...","show-password":""},model:{value:t.pwd_from.oldpwd,callback:function(e){t.$set(t.pwd_from,"oldpwd",e)},expression:"pwd_from.oldpwd"}})],1),o("el-form-item",{attrs:{label:"密码"}},[o("el-input",{attrs:{placeholder:"请输入密码...","show-password":""},model:{value:t.pwd_from.pwd,callback:function(e){t.$set(t.pwd_from,"pwd",e)},expression:"pwd_from.pwd"}})],1),o("el-form-item",{attrs:{label:"确认密码"}},[o("el-input",{attrs:{placeholder:"请输入密码...","show-password":""},model:{value:t.pwd_from.qpwd,callback:function(e){t.$set(t.pwd_from,"qpwd",e)},expression:"pwd_from.qpwd"}})],1)],1),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(e){t.dialog2=!1}}},[t._v("取 消")]),o("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.admin_ed()}}},[t._v("确 定")])],1)],1)],1)},l=[];o("981f");var a={data:function(){var t=this,e=function(e,o,i){""===o?i(new Error("请输入密码")):(""!==t.ruleForm.checkPass&&t.$refs.ruleForm.validateField("checkPass"),i())},o=function(e,o,i){""===o?i(new Error("请再次输入密码")):o!==t.ruleForm.pass?i(new Error("两次输入密码不一致!")):i()};return{form:{name:"",pwd:""},list:[],pwd_from:{id:"",oldpwd:"",pwd:"",qpwd:""},rules:{pass:[{validator:e,trigger:"blur"}],checkPass:[{validator:o,trigger:"blur"}]},operation:"4",dialogVisible:!1,dialog2:!1,keys:{key1:"",key2:"",key3:""}}},mounted:function(){this.http.get(this.$api.Admin.check),this.onload();var t=localStorage.getItem("token");""!=t&&t||(this.$message.error("token过期或者无效！"),this.$router.push({path:"/login"}))},methods:{open:function(t){this.dialog2=!0,this.pwd_from.id=t},onSubmit:function(){console.log("submit!")},add_level:function(){this.dialogVisible=!0},admin_add:function(){var t=this;this.http.post(this.$api.Admin.add,this.form).then((function(e){t.dialogVisible=!1,t.$message({showClose:!0,message:"添加成功",type:"success"}),t.onload()}))},admin_del:function(t){var e=this,o={id:t};this.http.post(this.$api.Admin.del,o).then((function(t){e.onload()}))},admin_ed:function(){var t=this;this.http.post(this.$api.Admin.pwd,this.pwd_from).then((function(e){t.$message({type:"success",message:"修改完成!"}),t.dialog2=!1}))},qclose:function(t){var e=this;this.$confirm("此操作将删除该管理, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){e.admin_del(t),e.$message({type:"success",message:"删除成功!"}),e.onload()}))},onload:function(){var t=this;this.http.get(this.$api.Admin.get,this.form).then((function(e){t.list=e.data}))}}},s=a,n=(o("ebc3"),o("2877")),r=Object(n["a"])(s,i,l,!1,null,null,null);e["default"]=r.exports},c848:function(t,e,o){},ebc3:function(t,e,o){"use strict";o("c848")}}]);