From 7db04cf06679855672c57fcd3c4e3b4ee2761b92 Mon Sep 17 00:00:00 2001 From: xingyu Date: Tue, 15 Nov 2022 23:44:08 +0800 Subject: [PATCH] refactor: user --- .../src/api/system/user/index.ts | 36 ++- .../src/api/system/user/types.ts | 16 -- .../src/views/system/user/index.vue | 180 +++++++------- .../src/views/system/user/user.data.ts | 223 ++++++------------ 4 files changed, 194 insertions(+), 261 deletions(-) delete mode 100644 yudao-ui-admin-vue3/src/api/system/user/types.ts diff --git a/yudao-ui-admin-vue3/src/api/system/user/index.ts b/yudao-ui-admin-vue3/src/api/system/user/index.ts index 3c989d881..f5324c98c 100644 --- a/yudao-ui-admin-vue3/src/api/system/user/index.ts +++ b/yudao-ui-admin-vue3/src/api/system/user/index.ts @@ -1,8 +1,38 @@ import request from '@/config/axios' -import type { UserVO } from './types' +export type UserVO = { + id: number + username: string + nickname: string + deptId: number + postIds: string[] + email: string + mobile: string + sex: number + avatar: string + loginIp: string + status: number + remark: string + loginDate: string + createTime: string +} + +export interface UserPageReqVO extends PageParam { + deptId?: number + username?: string + mobile?: string + status?: number + createTime?: string[] +} + +export interface UserExportReqVO { + code?: string + name?: string + status?: number + createTime?: string[] +} // 查询用户管理列表 -export const getUserPageApi = (params) => { +export const getUserPageApi = (params: UserPageReqVO) => { return request.get({ url: '/system/user/page', params }) } @@ -27,7 +57,7 @@ export const deleteUserApi = (id: number) => { } // 导出用户 -export const exportUserApi = (params) => { +export const exportUserApi = (params: UserExportReqVO) => { return request.download({ url: '/system/user/export', params }) } diff --git a/yudao-ui-admin-vue3/src/api/system/user/types.ts b/yudao-ui-admin-vue3/src/api/system/user/types.ts deleted file mode 100644 index 2102bbe99..000000000 --- a/yudao-ui-admin-vue3/src/api/system/user/types.ts +++ /dev/null @@ -1,16 +0,0 @@ -export type UserVO = { - id: number - username: string - nickname: string - deptId: number - postIds: string[] - email: string - mobile: string - sex: number - avatar: string - loginIp: string - status: number - remark: string - loginDate: string - createTime: string -} diff --git a/yudao-ui-admin-vue3/src/views/system/user/index.vue b/yudao-ui-admin-vue3/src/views/system/user/index.vue index 522a8efb9..cbdc68ddb 100644 --- a/yudao-ui-admin-vue3/src/views/system/user/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/user/index.vue @@ -20,56 +20,38 @@ @node-click="handleDeptNodeClick" /> - - - -
- - - -
- + + + - -