From 5028451710700f740167da5ba3fbe773b91d0520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E4=B8=83=E5=B9=B4=E5=A4=8F?= <2098833867@qq.com> Date: Fri, 12 May 2023 15:53:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=B4=A6=E6=88=B7=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=A1=B5=E9=9D=A2=EF=BC=8C=E4=BF=AE=E5=A4=8D=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + eslintrc/.eslintrc-auto-import.json | 1 + mock/excel.ts | 2 +- src/api/roleManagement.ts | 18 +- src/api/user.ts | 10 + src/api/userManagement.ts | 42 +++ src/layout/app-main/Navbar.vue | 4 +- src/layout/app-main/component/Debugger.vue | 34 ++ src/store/basic.ts | 4 +- src/store/debuger.ts | 18 + src/utils/validate.ts | 337 ++++++++++++++++++ src/views/login/index.vue | 14 +- .../components/UserManagementEdit.vue | 264 ++++++++++++++ src/views/system/userManagement/index.vue | 231 ++++++++++++ ts-out-dir/package.json | 124 ------- ts-out-dir/src/api/user.d.ts | 3 - ts-out-dir/src/api/user.js | 26 -- ts-out-dir/src/directives/button-codes.d.ts | 5 - ts-out-dir/src/directives/button-codes.js | 22 -- .../src/directives/codes-permission.d.ts | 5 - ts-out-dir/src/directives/codes-permission.js | 22 -- ts-out-dir/src/directives/index.d.ts | 1 - ts-out-dir/src/directives/index.js | 8 - .../src/directives/roles-permission.d.ts | 5 - ts-out-dir/src/directives/roles-permission.js | 22 -- ts-out-dir/src/hooks/use-common.d.ts | 10 - ts-out-dir/src/hooks/use-common.js | 31 -- ts-out-dir/src/hooks/use-element.d.ts | 67 ---- ts-out-dir/src/hooks/use-element.js | 158 -------- ts-out-dir/src/hooks/use-error-log.d.ts | 1 - ts-out-dir/src/hooks/use-error-log.js | 27 -- ts-out-dir/src/hooks/use-layout.d.ts | 2 - ts-out-dir/src/hooks/use-layout.js | 38 -- ts-out-dir/src/hooks/use-permission.d.ts | 15 - ts-out-dir/src/hooks/use-permission.js | 146 -------- ts-out-dir/src/hooks/use-self-router.d.ts | 4 - ts-out-dir/src/hooks/use-self-router.js | 40 --- ts-out-dir/src/hooks/use-table.d.ts | 15 - ts-out-dir/src/hooks/use-table.js | 105 ------ ts-out-dir/src/lib/element-plus.d.ts | 1 - ts-out-dir/src/lib/element-plus.js | 7 - ts-out-dir/src/main.d.ts | 6 - ts-out-dir/src/main.js | 22 -- ts-out-dir/src/permission.d.ts | 1 - ts-out-dir/src/permission.js | 44 --- ts-out-dir/src/router/index.d.ts | 6 - ts-out-dir/src/router/index.js | 203 ----------- ts-out-dir/src/settings.d.ts | 3 - ts-out-dir/src/settings.js | 21 -- ts-out-dir/src/store/basic.d.ts | 41 --- ts-out-dir/src/store/basic.js | 122 ------- ts-out-dir/src/store/tagsView.d.ts | 8 - ts-out-dir/src/store/tagsView.js | 59 --- ts-out-dir/src/utils/axios-req.d.ts | 1 - ts-out-dir/src/utils/axios-req.js | 56 --- ts-out-dir/src/utils/bus.d.ts | 2 - ts-out-dir/src/utils/bus.js | 2 - ts-out-dir/src/utils/common-util.d.ts | 16 - ts-out-dir/src/utils/common-util.js | 66 ---- ts-out-dir/src/views/redirect/index.d.ts | 2 - ts-out-dir/src/views/redirect/index.jsx | 13 - typings/auto-imports.d.ts | 1 + 62 files changed, 963 insertions(+), 1622 deletions(-) create mode 100644 src/api/userManagement.ts create mode 100644 src/layout/app-main/component/Debugger.vue create mode 100644 src/store/debuger.ts create mode 100644 src/utils/validate.ts create mode 100644 src/views/system/userManagement/components/UserManagementEdit.vue create mode 100644 src/views/system/userManagement/index.vue delete mode 100644 ts-out-dir/package.json delete mode 100644 ts-out-dir/src/api/user.d.ts delete mode 100644 ts-out-dir/src/api/user.js delete mode 100644 ts-out-dir/src/directives/button-codes.d.ts delete mode 100644 ts-out-dir/src/directives/button-codes.js delete mode 100644 ts-out-dir/src/directives/codes-permission.d.ts delete mode 100644 ts-out-dir/src/directives/codes-permission.js delete mode 100644 ts-out-dir/src/directives/index.d.ts delete mode 100644 ts-out-dir/src/directives/index.js delete mode 100644 ts-out-dir/src/directives/roles-permission.d.ts delete mode 100644 ts-out-dir/src/directives/roles-permission.js delete mode 100644 ts-out-dir/src/hooks/use-common.d.ts delete mode 100644 ts-out-dir/src/hooks/use-common.js delete mode 100644 ts-out-dir/src/hooks/use-element.d.ts delete mode 100644 ts-out-dir/src/hooks/use-element.js delete mode 100644 ts-out-dir/src/hooks/use-error-log.d.ts delete mode 100644 ts-out-dir/src/hooks/use-error-log.js delete mode 100644 ts-out-dir/src/hooks/use-layout.d.ts delete mode 100644 ts-out-dir/src/hooks/use-layout.js delete mode 100644 ts-out-dir/src/hooks/use-permission.d.ts delete mode 100644 ts-out-dir/src/hooks/use-permission.js delete mode 100644 ts-out-dir/src/hooks/use-self-router.d.ts delete mode 100644 ts-out-dir/src/hooks/use-self-router.js delete mode 100644 ts-out-dir/src/hooks/use-table.d.ts delete mode 100644 ts-out-dir/src/hooks/use-table.js delete mode 100644 ts-out-dir/src/lib/element-plus.d.ts delete mode 100644 ts-out-dir/src/lib/element-plus.js delete mode 100644 ts-out-dir/src/main.d.ts delete mode 100644 ts-out-dir/src/main.js delete mode 100644 ts-out-dir/src/permission.d.ts delete mode 100644 ts-out-dir/src/permission.js delete mode 100644 ts-out-dir/src/router/index.d.ts delete mode 100644 ts-out-dir/src/router/index.js delete mode 100644 ts-out-dir/src/settings.d.ts delete mode 100644 ts-out-dir/src/settings.js delete mode 100644 ts-out-dir/src/store/basic.d.ts delete mode 100644 ts-out-dir/src/store/basic.js delete mode 100644 ts-out-dir/src/store/tagsView.d.ts delete mode 100644 ts-out-dir/src/store/tagsView.js delete mode 100644 ts-out-dir/src/utils/axios-req.d.ts delete mode 100644 ts-out-dir/src/utils/axios-req.js delete mode 100644 ts-out-dir/src/utils/bus.d.ts delete mode 100644 ts-out-dir/src/utils/bus.js delete mode 100644 ts-out-dir/src/utils/common-util.d.ts delete mode 100644 ts-out-dir/src/utils/common-util.js delete mode 100644 ts-out-dir/src/views/redirect/index.d.ts delete mode 100644 ts-out-dir/src/views/redirect/index.jsx diff --git a/.gitignore b/.gitignore index b5e33a8..fac26af 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,4 @@ pnpm* #auto-imports.d.ts #components.d.ts stats.html +ts-out-dir diff --git a/eslintrc/.eslintrc-auto-import.json b/eslintrc/.eslintrc-auto-import.json index f840826..d09f22a 100644 --- a/eslintrc/.eslintrc-auto-import.json +++ b/eslintrc/.eslintrc-auto-import.json @@ -89,6 +89,7 @@ "useConfigStore": true, "useCssModule": true, "useCssVars": true, + "useDebuggerStore": true, "useElement": true, "useErrorLog": true, "useLink": true, diff --git a/mock/excel.ts b/mock/excel.ts index c5ca37b..b4631a7 100644 --- a/mock/excel.ts +++ b/mock/excel.ts @@ -44,7 +44,7 @@ export default [ { order_no: '@guid()', timestamp: +Mock.Random.date('T'), - userName: '@name()', + username: '@name()', price: '@float(1000, 15000, 0, 2)', 'status|1': ['success', 'pending'] } diff --git a/src/api/roleManagement.ts b/src/api/roleManagement.ts index 4704059..9a477f4 100644 --- a/src/api/roleManagement.ts +++ b/src/api/roleManagement.ts @@ -4,7 +4,7 @@ export function getList(data) { return request({ url: '/role/queryRoleByPage', method: 'post', - data, + data }) } @@ -12,14 +12,14 @@ export function doAdd(data) { return request({ url: '/role/create', method: 'post', - data, + data }) } export function doUpdate(data) { return request({ url: '/role/update', method: 'post', - data, + data }) } @@ -27,7 +27,7 @@ export function doDelete(data) { return request({ url: '/role/destroy', method: 'post', - data, + data }) } /** @@ -37,7 +37,7 @@ export function doDelete(data) { export function getRoleList() { return request({ url: '/role/list', - method: 'get', + method: 'post' }) } @@ -47,9 +47,9 @@ export function getRoleList() { export function getRoleByUserId(userId) { return request({ url: '/userRole/getByUserId', - method: 'get', - params: { - userId, - }, + method: 'post', + data: { + userId + } }) } diff --git a/src/api/user.ts b/src/api/user.ts index 21e82d9..eb5001e 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -1,5 +1,6 @@ //获取用户信息 import { post } from '@/utils/request' + export interface IUser { id: string userName: string @@ -36,3 +37,12 @@ export async function login(data): Promise { export async function logout(): Promise { return post('/logout') } + +/** + * 按照文本搜索前十条用户 + * @param keys + * @return {Promise} + */ +export function userSearching(keys) { + return post('user/searching', { keys }) +} diff --git a/src/api/userManagement.ts b/src/api/userManagement.ts new file mode 100644 index 0000000..34adc84 --- /dev/null +++ b/src/api/userManagement.ts @@ -0,0 +1,42 @@ +import request from '@/utils/request' + +export function getList(data) { + return request({ + url: '/user/list', + method: 'post', + data + }) +} + +export function doEdit(data) { + return request({ + url: '/user/edit', + method: 'post', + data + }) +} + +export function doCreate(data) { + return request({ + url: '/user/create', + method: 'post', + data + }) +} + +export function doDelete(data) { + return request({ + url: '/user/delete', + method: 'post', + data + }) +} + +// 查询学生信息 +export function getStudentInfoByStudentId(data) { + return request({ + url: '/user/getStudentInfoByStudentId', + method: 'post', + data + }) +} diff --git a/src/layout/app-main/Navbar.vue b/src/layout/app-main/Navbar.vue index cc3d802..31bae1a 100644 --- a/src/layout/app-main/Navbar.vue +++ b/src/layout/app-main/Navbar.vue @@ -30,14 +30,14 @@ -
+
用户头像