lepu-test-platform-web/dist/static/js/15.889f7b2bb5d5d0f90428.js

2 lines
20 KiB
JavaScript
Raw Normal View History

webpackJsonp([15],{FTz3:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a("mvHQ"),o=a.n(l),r={data:function(){return{roleOptions:[],departmentOptions:[],labelOptions:[],roleForm:{},editForm:{},detailForm:{},editPasswordForm:{},queryInfo:{authorityId:JSON.parse(localStorage.getItem("userInfo")).authorityId,username:"",nick:"",phone:"",pageNum:1,pageSize:10},currUserAuthorityId:JSON.parse(localStorage.getItem("userInfo")).authorityId,currpage:1,userList:[],total:0,addDialogVisible:!1,editDialogVisible:!1,detailDialogVisible:!1,editPasswordDialogVisible:!1,addForm:{username:"",password:"",nick:"",phone:"",email:"",authorityId:"",department:"",label:"",comments:""},addFormRules:{username:[{required:!0,message:"请输入用户名",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 20 个字符",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"},{min:6,max:16,message:"长度在 6 到 16 个字符",trigger:"blur"}],nick:[{required:!0,message:"请输入姓名",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 20 个字符",trigger:"blur"}],authorityId:[{required:!0,message:"请选择角色",trigger:"blur"}],department:[{required:!0,message:"请选择部门",trigger:"blur"}],label:[{required:!0,message:"请选择标签",trigger:"blur"}],phone:[{required:!0,message:"请输入手机号",trigger:"blur"},{validator:function(e,t,a){if(/^1(3|4|5|6|7|8|9)\d{9}$/.test(t))return a();a(new Error("请输入合法的手机号"))},trigger:"blur",max:11}],email:[{required:!0,message:"请输入电子邮箱",trigger:"blur"},{validator:function(e,t,a){if(/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t))return a();a(new Error("请输入合法的邮箱"))},trigger:"blur",max:100}],comments:[{required:!1,message:"请输入备注",trigger:"blur"},{min:0,max:255,message:"长度在 0 到 255 个字符",trigger:"blur"}]},editPasswordFormRules:{password:[{required:!0,message:"请输入密码",trigger:"blur"},{min:6,max:16,message:"长度在 6 到 16 个字符",trigger:"blur"}],confirmPassword:[{required:!0,message:"请输入确认密码",trigger:"blur"},{min:6,max:16,message:"长度在 6 到 16 个字符",trigger:"blur"}]}}},mounted:function(){this.getRoleNameList()},created:function(){this.getUsersList(),this.getDepartmentAndLabelList()},methods:{getDepartmentAndLabelList:function(){var e=this;this.$api.dict.queryAllDataDict().then(function(t){e.departmentOptions=t.data.data.userDepartment,e.labelOptions=t.data.data.userLabel}).catch(function(){})},editPasswordDialogClose:function(){this.$refs.editPasswordFormRef.resetFields(),this.editPasswordDialogVisible=!1},showEditPasswordDialog:function(e){this.editPasswordDialogVisible=!0,this.editPasswordForm.id=e},setEditPasswordFormInputStyle:function(){document.querySelectorAll(".edit-password-input").forEach(function(e){e.style.border="1px solid red",e.style.borderRadius="5px"})},editPassword:function(){var e=this;this.$refs.editPasswordFormRef.validate(function(t){t&&(e.editPasswordForm.password==e.editPasswordForm.confirmPassword?e.$api.user.editPassword2(o()(e.editPasswordForm)).then(function(t){e.$notify({type:"success",message:t.data.msg}),e.editPasswordDialogVisible=!1,e.$refs.editPasswordFormRef.resetFields()}).catch(function(){}):e.$notify({type:"warning",message:"两次输入的密码不一致"}))})},editPasswordCancel:function(){this.$refs.editPasswordFormRef.resetFields(),this.editPasswordDialogVisible=!1},detailDialogClose:function(){this.detailDialogVisible=!1},showDetailDialog:function(e){var t=this;this.detailDialogVisible=!0,this.$api.user.queryUserById(e).then(function(e){t.detailForm=e.data.data}).catch(function(){})},getRoleName:function(e){return e.forEach(function(e){roleOptions.forEach(function(t){e.authorityId==t.roleId&&(e.authorityId=t.roleName)})}),e},getRoleNameList:function(){var e=this;this.$api.role.queryAllRole().then(function(t){var a=t.data.data;a.forEach(function(e,t,a){e.roleId<JSON.pa
//# sourceMappingURL=15.889f7b2bb5d5d0f90428.js.map