From fabbfb0e13fb4896a9b295af31f7631a7ef37126 Mon Sep 17 00:00:00 2001 From: panqihua Date: Thu, 26 Jan 2023 20:29:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=80=BB=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86=E7=BB=84=E4=BB=B6=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/platform/user.js | 841 +++++++++++++++++++++++++ src/views/manufacturer/index.vue | 15 + src/views/platform/user/baseForm.vue | 195 ++++++ src/views/platform/user/index.vue | 513 +++++++++++++++ src/views/platform/user/userAvatar.vue | 196 ++++++ 5 files changed, 1760 insertions(+) create mode 100644 src/api/platform/user.js create mode 100644 src/views/manufacturer/index.vue create mode 100644 src/views/platform/user/baseForm.vue create mode 100644 src/views/platform/user/index.vue create mode 100644 src/views/platform/user/userAvatar.vue diff --git a/src/api/platform/user.js b/src/api/platform/user.js new file mode 100644 index 0000000..51e9f90 --- /dev/null +++ b/src/api/platform/user.js @@ -0,0 +1,841 @@ +import request from '@/utils/request' + +// 查询用户列表 +export function listUser(query) { + return new Promise(resolve => { + resolve({ + 'total': 15, + 'rows': [ + { + 'createBy': 'admin', + 'createTime': '2023-01-11 09:24:46', + 'updateBy': null, + 'updateTime': null, + 'remark': '管理员', + 'userId': 1, + 'deptId': 103, + 'userName': 'admin', + 'nickName': '若依', + 'email': 'ry@163.com', + 'phonenumber': '15888888888', + 'sex': '1', + 'avatar': '/profile/avatar/2023/01/12/blob_20230112055008A001.png', + 'password': null, + 'status': '0', + 'delFlag': '0', + 'loginIp': '127.0.0.1', + 'loginDate': '2023-01-26T19:53:26.000+08:00', + 'dept': { + 'createBy': null, + 'createTime': null, + 'updateBy': null, + 'updateTime': null, + 'remark': null, + 'deptId': 103, + 'parentId': null, + 'ancestors': null, + 'deptName': '研发部门', + 'orderNum': null, + 'leader': '若依', + 'phone': null, + 'email': null, + 'status': null, + 'delFlag': null, + 'parentName': null, + 'children': [] + }, + 'roles': [], + 'roleIds': null, + 'postIds': null, + 'roleId': null, + 'wechatNickName': null, + 'balance': null, + 'referrerId': null, + 'referrerSysUser': null, + 'admin': true + }, + { + 'createBy': 'admin', + 'createTime': '2023-01-11 09:24:46', + 'updateBy': null, + 'updateTime': null, + 'remark': '测试员', + 'userId': 2, + 'deptId': 105, + 'userName': 'ry', + 'nickName': '若依', + 'email': 'ry@qq.com', + 'phonenumber': '15666666666', + 'sex': '1', + 'avatar': '', + 'password': null, + 'status': '1', + 'delFlag': '0', + 'loginIp': '127.0.0.1', + 'loginDate': '2023-01-11T09:24:46.000+08:00', + 'dept': { + 'createBy': null, + 'createTime': null, + 'updateBy': null, + 'updateTime': null, + 'remark': null, + 'deptId': 105, + 'parentId': null, + 'ancestors': null, + 'deptName': '测试部门', + 'orderNum': null, + 'leader': '若依', + 'phone': null, + 'email': null, + 'status': null, + 'delFlag': null, + 'parentName': null, + 'children': [] + }, + 'roles': [], + 'roleIds': null, + 'postIds': null, + 'roleId': null, + 'wechatNickName': null, + 'balance': null, + 'referrerId': null, + 'referrerSysUser': { + 'createBy': null, + 'createTime': null, + 'updateBy': null, + 'updateTime': null, + 'remark': null, + 'userId': null, + 'deptId': null, + 'userName': null, + 'nickName': '若依', + 'email': null, + 'phonenumber': null, + 'sex': null, + 'avatar': null, + 'password': null, + 'status': null, + 'delFlag': null, + 'loginIp': null, + 'loginDate': null, + 'dept': null, + 'roles': null, + 'roleIds': null, + 'postIds': null, + 'roleId': null, + 'wechatNickName': null, + 'balance': null, + 'referrerId': null, + 'referrerSysUser': null, + 'admin': false + }, + 'admin': false + }, + { + 'createBy': 'admin', + 'createTime': '2023-01-11 21:50:10', + 'updateBy': null, + 'updateTime': null, + 'remark': null, + 'userId': 115, + 'deptId': null, + 'userName': null, + 'nickName': 'dfsg345', + 'email': '', + 'phonenumber': '13250211954', + 'sex': '1', + 'avatar': '/profile/avatar/2023/01/12/blob_20230112055008A001.png', + 'password': null, + 'status': '1', + 'delFlag': '0', + 'loginIp': '', + 'loginDate': null, + 'dept': null, + 'roles': [], + 'roleIds': null, + 'postIds': null, + 'roleId': null, + 'wechatNickName': 'fuck222', + 'balance': 4.66, + 'referrerId': null, + 'referrerSysUser': { + 'createBy': null, + 'createTime': null, + 'updateBy': null, + 'updateTime': null, + 'remark': null, + 'userId': null, + 'deptId': null, + 'userName': null, + 'nickName': '若依', + 'email': null, + 'phonenumber': null, + 'sex': null, + 'avatar': null, + 'password': null, + 'status': null, + 'delFlag': null, + 'loginIp': null, + 'loginDate': null, + 'dept': null, + 'roles': null, + 'roleIds': null, + 'postIds': null, + 'roleId': null, + 'wechatNickName': null, + 'balance': null, + 'referrerId': null, + 'referrerSysUser': null, + 'admin': false + }, + 'admin': false + }, + { + 'createBy': 'admin', + 'createTime': '2023-01-12 09:16:00', + 'updateBy': null, + 'updateTime': null, + 'remark': null, + 'userId': 116, + 'deptId': null, + 'userName': null, + 'nickName': 'dsfgfd234234', + 'email': '', + 'phonenumber': '13250211978', + 'sex': '1', + 'avatar': '/profile/avatar/2023/01/12/blob_20230112055008A001.png', + 'password': null, + 'status': '0', + 'delFlag': '0', + 'loginIp': '', + 'loginDate': null, + 'dept': null, + 'roles': [], + 'roleIds': null, + 'postIds': null, + 'roleId': null, + 'wechatNickName': 'dfg345', + 'balance': 3.96, + 'referrerId': null, + 'referrerSysUser': { + 'createBy': null, + 'createTime': null, + 'updateBy': null, + 'updateTime': null, + 'remark': null, + 'userId': null, + 'deptId': null, + 'userName': null, + 'nickName': '若依', + 'email': null, + 'phonenumber': null, + 'sex': null, + 'avatar': null, + 'password': null, + 'status': null, + 'delFlag': null, + 'loginIp': null, + 'loginDate': null, + 'dept': null, + 'roles': null, + 'roleIds': null, + 'postIds': null, + 'roleId': null, + 'wechatNickName': null, + 'balance': null, + 'referrerId': null, + 'referrerSysUser': null, + 'admin': false + }, + 'admin': false + }, + { + 'createBy': 'admin', + 'createTime': '2023-01-12 09:22:33', + 'updateBy': null, + 'updateTime': null, + 'remark': null, + 'userId': 117, + 'deptId': null, + 'userName': null, + 'nickName': 'dgh345', + 'email': '', + 'phonenumber': '13225021194', + 'sex': '1', + 'avatar': '/profile/avatar/2023/01/12/blob_20230112055008A001.png', + 'password': null, + 'status': '1', + 'delFlag': '0', + 'loginIp': '', + 'loginDate': null, + 'dept': null, + 'roles': [], + 'roleIds': null, + 'postIds': null, + 'roleId': null, + 'wechatNickName': 'ertsdfg345', + 'balance': 3.99, + 'referrerId': null, + 'referrerSysUser': { + 'createBy': null, + 'createTime': null, + 'updateBy': null, + 'updateTime': null, + 'remark': null, + 'userId': null, + 'deptId': null, + 'userName': null, + 'nickName': '若依', + 'email': null, + 'phonenumber': null, + 'sex': null, + 'avatar': null, + 'password': null, + 'status': null, + 'delFlag': null, + 'loginIp': null, + 'loginDate': null, + 'dept': null, + 'roles': null, + 'roleIds': null, + 'postIds': null, + 'roleId': null, + 'wechatNickName': null, + 'balance': null, + 'referrerId': null, + 'referrerSysUser': null, + 'admin': false + }, + 'admin': false + }, + { + 'createBy': 'admin', + 'createTime': '2023-01-12 09:25:08', + 'updateBy': null, + 'updateTime': null, + 'remark': null, + 'userId': 118, + 'deptId': null, + 'userName': null, + 'nickName': 'ertert435', + 'email': '', + 'phonenumber': '13250211855', + 'sex': '1', + 'avatar': '/profile/avatar/2023/01/12/blob_20230112055008A001.png', + 'password': null, + 'status': '0', + 'delFlag': '0', + 'loginIp': '', + 'loginDate': null, + 'dept': null, + 'roles': [], + 'roleIds': null, + 'postIds': null, + 'roleId': null, + 'wechatNickName': 'dsfg345', + 'balance': 3.66, + 'referrerId': null, + 'referrerSysUser': { + 'createBy': null, + 'createTime': null, + 'updateBy': null, + 'updateTime': null, + 'remark': null, + 'userId': null, + 'deptId': null, + 'userName': null, + 'nickName': '若依', + 'email': null, + 'phonenumber': null, + 'sex': null, + 'avatar': null, + 'password': null, + 'status': null, + 'delFlag': null, + 'loginIp': null, + 'loginDate': null, + 'dept': null, + 'roles': null, + 'roleIds': null, + 'postIds': null, + 'roleId': null, + 'wechatNickName': null, + 'balance': null, + 'referrerId': null, + 'referrerSysUser': null, + 'admin': false + }, + 'admin': false + }, + { + 'createBy': 'admin', + 'createTime': '2023-01-12 09:26:10', + 'updateBy': null, + 'updateTime': null, + 'remark': null, + 'userId': 119, + 'deptId': null, + 'userName': null, + 'nickName': 'sdfasdf234', + 'email': '', + 'phonenumber': '13250519883', + 'sex': '0', + 'avatar': '/profile/avatar/2023/01/12/blob_20230112055008A001.png', + 'password': null, + 'status': '1', + 'delFlag': '0', + 'loginIp': '', + 'loginDate': null, + 'dept': null, + 'roles': [], + 'roleIds': null, + 'postIds': null, + 'roleId': null, + 'wechatNickName': 'sdfaf', + 'balance': null, + 'referrerId': null, + 'referrerSysUser': null, + 'admin': false + }, + { + 'createBy': 'admin', + 'createTime': '2023-01-12 09:27:51', + 'updateBy': null, + 'updateTime': null, + 'remark': null, + 'userId': 120, + 'deptId': null, + 'userName': null, + 'nickName': 'yutyu', + 'email': '', + 'phonenumber': '13250211444', + 'sex': '0', + 'avatar': '/profile/avatar/2023/01/12/blob_20230112055008A001.png', + 'password': null, + 'status': '0', + 'delFlag': '0', + 'loginIp': '', + 'loginDate': null, + 'dept': null, + 'roles': [], + 'roleIds': null, + 'postIds': null, + 'roleId': null, + 'wechatNickName': 'dsfgfd345', + 'balance': null, + 'referrerId': null, + 'referrerSysUser': null, + 'admin': false + }, + { + 'createBy': 'admin', + 'createTime': '2023-01-12 09:28:47', + 'updateBy': null, + 'updateTime': null, + 'remark': null, + 'userId': 121, + 'deptId': null, + 'userName': null, + 'nickName': '234dfgsfdg', + 'email': '', + 'phonenumber': '13248956546', + 'sex': '0', + 'avatar': '/profile/avatar/2023/01/12/blob_20230112055008A001.png', + 'password': null, + 'status': '0', + 'delFlag': '0', + 'loginIp': '', + 'loginDate': null, + 'dept': null, + 'roles': [], + 'roleIds': null, + 'postIds': null, + 'roleId': null, + 'wechatNickName': 'saf2345', + 'balance': null, + 'referrerId': null, + 'referrerSysUser': null, + 'admin': false + }, + { + 'createBy': 'admin', + 'createTime': '2023-01-12 09:30:38', + 'updateBy': null, + 'updateTime': null, + 'remark': null, + 'userId': 122, + 'deptId': null, + 'userName': null, + 'nickName': 'sdfaf234', + 'email': '', + 'phonenumber': '13250485465', + 'sex': '1', + 'avatar': '/profile/avatar/2023/01/12/blob_20230112055008A001.png', + 'password': null, + 'status': '0', + 'delFlag': '0', + 'loginIp': '', + 'loginDate': null, + 'dept': null, + 'roles': [], + 'roleIds': null, + 'postIds': null, + 'roleId': null, + 'wechatNickName': 'sdaf3425', + 'balance': 1.44, + 'referrerId': null, + 'referrerSysUser': null, + 'admin': false + } + ], + 'code': 200, + 'msg': '查询成功' + }) + }) +} + +// 查询用户详细 +export function getUser(userId) { + return new Promise(resolve => { + resolve({ + 'msg': '操作成功', + 'code': 200, + 'roleIds': [ + 2 + ], + 'data': { + 'createBy': 'admin', + 'createTime': '2023-01-11 09:24:46', + 'updateBy': null, + 'updateTime': null, + 'remark': '测试员', + 'userId': 2, + 'deptId': 105, + 'userName': 'ry', + 'nickName': '若依', + 'email': 'ry@qq.com', + 'phonenumber': '15666666666', + 'sex': '1', + 'avatar': '', + 'password': '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', + 'status': '1', + 'delFlag': '0', + 'loginIp': '127.0.0.1', + 'loginDate': '2023-01-11T09:24:46.000+08:00', + 'dept': { + 'createBy': null, + 'createTime': null, + 'updateBy': null, + 'updateTime': null, + 'remark': null, + 'deptId': 105, + 'parentId': 101, + 'ancestors': '0,100,101', + 'deptName': '测试部门', + 'orderNum': 3, + 'leader': '若依', + 'phone': null, + 'email': null, + 'status': '0', + 'delFlag': null, + 'parentName': null, + 'children': [] + }, + 'roles': [ + { + 'createBy': null, + 'createTime': null, + 'updateBy': null, + 'updateTime': null, + 'remark': null, + 'roleId': 2, + 'roleName': '普通角色', + 'roleKey': 'common', + 'roleSort': 2, + 'dataScope': '2', + 'menuCheckStrictly': false, + 'deptCheckStrictly': false, + 'status': '0', + 'delFlag': null, + 'flag': false, + 'menuIds': null, + 'deptIds': null, + 'permissions': null, + 'admin': false + } + ], + 'roleIds': null, + 'postIds': null, + 'roleId': null, + 'wechatNickName': null, + 'balance': null, + 'referrerId': 1, + 'referrerSysUser': { + 'createBy': null, + 'createTime': null, + 'updateBy': null, + 'updateTime': null, + 'remark': null, + 'userId': null, + 'deptId': null, + 'userName': null, + 'nickName': '若依', + 'email': null, + 'phonenumber': '15888888888', + 'sex': null, + 'avatar': null, + 'password': null, + 'status': null, + 'delFlag': null, + 'loginIp': null, + 'loginDate': null, + 'dept': null, + 'roles': null, + 'roleIds': null, + 'postIds': null, + 'roleId': null, + 'wechatNickName': null, + 'balance': null, + 'referrerId': null, + 'referrerSysUser': null, + 'admin': false + }, + 'admin': false + }, + 'postIds': [ + 2 + ], + 'roles': [ + { + 'createBy': null, + 'createTime': '2023-01-26 12:03:44', + 'updateBy': null, + 'updateTime': null, + 'remark': '厂商', + 'roleId': 101, + 'roleName': '厂商', + 'roleKey': 'manufacturer', + 'roleSort': 0, + 'dataScope': '1', + 'menuCheckStrictly': true, + 'deptCheckStrictly': true, + 'status': '0', + 'delFlag': '0', + 'flag': false, + 'menuIds': null, + 'deptIds': null, + 'permissions': null, + 'admin': false + }, + { + 'createBy': null, + 'createTime': '2023-01-11 09:24:46', + 'updateBy': null, + 'updateTime': null, + 'remark': '普通角色', + 'roleId': 2, + 'roleName': '普通角色', + 'roleKey': 'common', + 'roleSort': 2, + 'dataScope': '2', + 'menuCheckStrictly': true, + 'deptCheckStrictly': true, + 'status': '0', + 'delFlag': '0', + 'flag': false, + 'menuIds': null, + 'deptIds': null, + 'permissions': null, + 'admin': false + } + ], + 'posts': [ + { + 'createBy': 'admin', + 'createTime': '2023-01-11 09:24:46', + 'updateBy': null, + 'updateTime': null, + 'remark': '', + 'postId': 1, + 'postCode': 'ceo', + 'postName': '董事长', + 'postSort': 1, + 'status': '0', + 'flag': false + }, + { + 'createBy': 'admin', + 'createTime': '2023-01-11 09:24:46', + 'updateBy': null, + 'updateTime': null, + 'remark': '', + 'postId': 2, + 'postCode': 'se', + 'postName': '项目经理', + 'postSort': 2, + 'status': '0', + 'flag': false + }, + { + 'createBy': 'admin', + 'createTime': '2023-01-11 09:24:46', + 'updateBy': null, + 'updateTime': null, + 'remark': '', + 'postId': 3, + 'postCode': 'hr', + 'postName': '人力资源', + 'postSort': 3, + 'status': '0', + 'flag': false + }, + { + 'createBy': 'admin', + 'createTime': '2023-01-11 09:24:46', + 'updateBy': null, + 'updateTime': null, + 'remark': '', + 'postId': 4, + 'postCode': 'user', + 'postName': '普通员工', + 'postSort': 4, + 'status': '0', + 'flag': false + } + ] + }) + }) +} + +// 新增用户 +export function addUser(data) { + return request({ + url: '/system/user', + method: 'post', + data: data + }) +} + +// 修改用户 +export function updateUser(data) { + return request({ + url: '/system/user', + method: 'put', + data: data + }) +} + +// 删除用户 +export function delUser(userId) { + return request({ + url: '/system/user/' + userId, + method: 'delete' + }) +} + +// 用户密码重置 +export function resetUserPwd(userId, password) { + const data = { + userId, + password + } + return request({ + url: '/system/user/resetPwd', + method: 'put', + data: data + }) +} + +// 用户状态修改 +export function changeUserStatus(userId, status) { + const data = { + userId, + status + } + return request({ + url: '/system/user/changeStatus', + method: 'put', + data: data + }) +} + +// 查询用户个人信息 +export function getUserProfile() { + return request({ + url: '/system/user/profile', + method: 'get' + }) +} + +// 修改用户个人信息 +export function updateUserProfile(data) { + return request({ + url: '/system/user/profile', + method: 'put', + data: data + }) +} + +// 用户密码重置 +export function updateUserPwd(oldPassword, newPassword) { + const data = { + oldPassword, + newPassword + } + return request({ + url: '/system/user/profile/updatePwd', + method: 'put', + params: data + }) +} + +// 用户头像上传 +export function uploadAvatar(data) { + return request({ + url: '/system/user/profile/avatar', + method: 'post', + data: data + }) +} + +// 查询授权角色 +export function getAuthRole(userId) { + return request({ + url: '/system/user/authRole/' + userId, + method: 'get' + }) +} + +// 保存授权角色 +export function updateAuthRole(data) { + return request({ + url: '/system/user/authRole', + method: 'put', + params: data + }) +} + +// 查询部门下拉树结构 +export function deptTreeSelect() { + return request({ + url: '/system/user/deptTree', + method: 'get' + }) +} + +//根据手机号模糊查询 +export function phoneSelect(phonenumber) { + return request({ + url: `/system/user/phonenumber/${phonenumber}`, + method: 'get' + }) +} + +//批量更新状态 +export function updateStatus(data) { + return request({ + url: '/system/user/updateStatus', + method: 'put', + params: data + }) +} diff --git a/src/views/manufacturer/index.vue b/src/views/manufacturer/index.vue new file mode 100644 index 0000000..e5a575c --- /dev/null +++ b/src/views/manufacturer/index.vue @@ -0,0 +1,15 @@ + + + + + diff --git a/src/views/platform/user/baseForm.vue b/src/views/platform/user/baseForm.vue new file mode 100644 index 0000000..46de608 --- /dev/null +++ b/src/views/platform/user/baseForm.vue @@ -0,0 +1,195 @@ + + diff --git a/src/views/platform/user/index.vue b/src/views/platform/user/index.vue new file mode 100644 index 0000000..6a681c3 --- /dev/null +++ b/src/views/platform/user/index.vue @@ -0,0 +1,513 @@ + + + + diff --git a/src/views/platform/user/userAvatar.vue b/src/views/platform/user/userAvatar.vue new file mode 100644 index 0000000..27edde7 --- /dev/null +++ b/src/views/platform/user/userAvatar.vue @@ -0,0 +1,196 @@ + + + +