| | |
| | | </el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作"> |
| | | <el-table-column :label="$t('langOperation')"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="primary" icon="el-icon-refresh" @click="resetPassword(scope.row)"> |
| | | |
| | |
| | | }); |
| | | }, |
| | | resetPassword (info) { |
| | | this.$confirm('确认重置密码为默认值吗?', '重置密码', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | this.$confirm(this.$t('confirmResetPassword'), this.$t('resetPassword'), { |
| | | confirmButtonText: this.$t('confirm'), |
| | | cancelButtonText: this.$t('cancel'), |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | resetPass(info).then(() => { |
| | | this.$message.success('密码已重置为默认值'); |
| | | this.$message.success(this.$t('passwordResetSuccess')); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | |
| | | this.editDialogVisible = true; |
| | | }); |
| | | |
| | | |
| | | select().then(res => { |
| | | this.roleList = res.data; |
| | | }); |
| | | }, |
| | | removeUserById (user) { |
| | | // 弹框询问用户是否删除分类 |
| | | this.$confirm('此操作将永久删除该分类, 是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | this.$confirm(this.$t('confirmDeleteCategory'), this.$t('prompt'), { |
| | | confirmButtonText: this.$t('confirm'), |
| | | cancelButtonText: this.$t('cancel'), |
| | | type: 'warning' |
| | | }).then(() => { |
| | | removeById({ id: user.id }).then(() => { |
| | | // 重新获取分类列表 |
| | | this.getUserList(); |
| | | this.$message.success("删除用户成功"); |
| | | this.$message.success(this.$t('userDeleteSuccess')); |
| | | }); |
| | | }).catch(() => { |
| | | this.$message.info('已取消删除'); |
| | | this.$message.info(this.$t('deleteCanceled')); |
| | | }); |
| | | }, |
| | | handleSizeChange (newSize) { |
| | |
| | | this.$refs.addUserRef.validate(async valid => { |
| | | if (!valid) return; |
| | | saveOrUpdate(this.addUserForm).then(() => { |
| | | this.$message.success("添加用户成功"); |
| | | const successMessage = this.$t('addUserSuccess'); |
| | | this.$message.success(successMessage); |
| | | // 隐藏添加分类对话框 |
| | | this.addDialogVisible = false; |
| | | // 重新获取分类列表 |
| | |
| | | if (!valid) return; |
| | | |
| | | saveOrUpdate(this.editUserForm).then(() => { |
| | | const 修改用户成功 = this.$t('修改用户成功'); |
| | | this.$message.success(修改用户成功); |
| | | const successMessage = this.$t('editUserSuccess'); |
| | | this.$message.success(successMessage); |
| | | // 隐藏添加分类对话框 |
| | | this.editDialogVisible = false; |
| | | // 重新获取分类列表 |