فهرست منبع

feat: API添加types

wanggaokun 1 سال پیش
والد
کامیت
17d667db03

+ 59 - 0
src/api/interface/login.ts

@@ -0,0 +1,59 @@
+/**
+ * 注册
+ */
+export type RegisterForm = {
+  tenantId: number
+  username: string
+  password: string
+  confirmPassword?: string
+  code?: string
+  uuid?: string
+  userType?: string
+}
+
+/**
+ * 登录请求
+ */
+export interface LoginData {
+  tenantId?: number
+  username?: string
+  password?: string
+  rememberMe?: boolean
+  socialCode?: string
+  socialState?: string
+  source?: string
+  code?: string
+  uuid?: string
+  clientId: string
+  grantType: string
+}
+
+/**
+ * 登录响应
+ */
+export interface LoginResult {
+  access_token: string
+}
+
+/**
+ * 验证码返回
+ */
+export interface VerifyCodeResult {
+  captchaEnabled: boolean
+  uuid?: string
+  img?: string
+}
+
+/**
+ * 租户
+ */
+export interface TenantVO {
+  companyName: string
+  domain: any
+  tenantId: string
+}
+
+export interface TenantInfo {
+  tenantEnabled: boolean
+  voList: TenantVO[]
+}

+ 71 - 0
src/api/interface/system/menu.ts

@@ -0,0 +1,71 @@
+import { MenuTypeEnum } from '@/enums/MenuTypeEnum'
+import { BaseEntity } from '@/api/interface/index'
+
+/**
+ * 菜单树形结构类型
+ */
+export interface MenuTreeOption {
+  id: string | number
+  label: string
+  parentId: string | number
+  weight: number
+  children?: MenuTreeOption[]
+}
+
+export interface RoleMenuTree {
+  menus: MenuTreeOption[]
+  checkedKeys: string[]
+}
+
+/**
+ * 菜单查询参数类型
+ */
+export interface MenuQuery {
+  keywords?: string
+  menuName?: string
+  status?: string
+}
+
+/**
+ * 菜单视图对象类型
+ */
+export interface MenuVO extends BaseEntity {
+  parentName: string
+  parentId: string | number
+  children: MenuVO[]
+  menuId: string | number
+  menuName: string
+  orderNum: number
+  path: string
+  component: string
+  queryParam: string
+  isFrame: string
+  isCache: string
+  menuType: MenuTypeEnum
+  visible: string
+  status: string
+  icon: string
+  remark: string
+}
+
+export interface MenuForm {
+  parentName?: string
+  parentId?: string | number
+  children?: MenuForm[]
+  menuId?: string | number
+  menuName: string
+  orderNum: number
+  path: string
+  component?: string
+  queryParam?: string
+  isFrame?: string
+  isCache?: string
+  menuType?: MenuTypeEnum
+  visible?: string
+  status?: string
+  icon?: string
+  remark?: string
+  query?: string
+  perms?: string
+  version?: number
+}

+ 11 - 9
src/api/modules/login.ts

@@ -1,12 +1,14 @@
-import { Login } from '@/api/interface/index'
+import { UserInfo } from '@/api/interface/system/user'
+import { LoginData, LoginResult, VerifyCodeResult } from '@/api/interface/login'
 import http from '@/api'
 
 /**
- * @name 登录模块
+ *
+ * 用户登录
+ * @param data {LoginData}
  */
-// 用户登录
-export const loginApi = (params: Login.ReqLoginForm) => {
-  return http.post<Login.ResLogin>('/auth/login', params, { loading: true, isEncrypt: true }) // 正常 post json 请求  ==>  application/json
+export const loginApi = (data: LoginData) => {
+  return http.post<LoginResult>('/auth/login', data, { loading: true, isEncrypt: true }) // 正常 post json 请求  ==>  application/json
 }
 
 // 用户退出登录
@@ -14,11 +16,11 @@ export const logoutApi = () => {
   return http.post('/auth/logout', {}, { loading: false })
 }
 
-// 用户退出登录
+// 获取用户详细信息
 export const getInfoApi = () => {
-  return http.get('/system/user/getInfo', {}, { loading: false })
+  return http.get<UserInfo>('/system/user/getInfo', {}, { loading: false })
 }
-// 用户退出登录
+// 获取验证码
 export const getCodeImg = () => {
-  return http.get('/captchaImage', {}, { loading: false })
+  return http.get<VerifyCodeResult>('/captchaImage', {}, { loading: false })
 }

+ 7 - 31
src/api/modules/system/dept.ts

@@ -1,11 +1,11 @@
 import http from '@/api'
-
+import { DeptForm, DeptQuery, DeptVO } from '@/api/interface/system/dept'
 /**
  * @name 查询部门列表
  * @param query 参数
  * @returns 返回列表
  */
-export const listDeptApi = (query: any) => {
+export const listDeptApi = (query: DeptQuery) => {
   return http.get<any>('/system/dept/list', query, { loading: true })
 }
 
@@ -14,8 +14,8 @@ export const listDeptApi = (query: any) => {
  * @param deptId deptId
  * @returns returns
  */
-export const getDeptApi = (deptId: any) => {
-  return http.get<any>(`/system/dept/${deptId}`)
+export const getDeptApi = (deptId: string | number) => {
+  return http.get<DeptVO>(`/system/dept/${deptId}`)
 }
 
 /**
@@ -23,7 +23,7 @@ export const getDeptApi = (deptId: any) => {
  * @param data data
  * @returns returns
  */
-export const addDeptApi = (data: any) => {
+export const addDeptApi = (data: DeptForm) => {
   return http.post<any>('/system/dept', data, { loading: false })
 }
 
@@ -32,7 +32,7 @@ export const addDeptApi = (data: any) => {
  * @param data data
  * @returns returns
  */
-export const updateDeptApi = (data: any) => {
+export const updateDeptApi = (data: DeptForm) => {
   return http.put<any>('/system/dept', data, { loading: false })
 }
 
@@ -41,30 +41,6 @@ export const updateDeptApi = (data: any) => {
  * @param deptId deptId
  * @returns returns
  */
-export const delDeptApi = (deptId: any) => {
+export const delDeptApi = (deptId: number | string) => {
   return http.delete<any>(`/system/dept/${deptId}`)
 }
-
-/**
- * @name 下载模板
- * @returns returns
- */
-export const importTemplateApi = () => {
-  return http.downloadPost('/system/dept/importTemplate', {})
-}
-
-/**
- * @name 导入数据
- * @returns returns
- */
-export const importDataApi = (data: any) => {
-  return http.post('/system/dept/importData', data)
-}
-
-/**
- * @name 导出数据
- * @returns returns
- */
-export const exportApi = (data: any) => {
-  return http.downloadPost('/system/dept/export', data)
-}

+ 13 - 22
src/api/modules/system/dict.ts

@@ -1,12 +1,12 @@
 import http from '@/api'
-
+import { DictTypeForm, DictTypeVO, DictTypeQuery } from '@/api/interface/system/type'
 /**
  * @name 查询字典类型列表
  * @param query 参数
  * @returns 返回列表
  */
-export const listDictApi = (query: any) => {
-  return http.get<any>('/system/dict/type/list', query, { loading: false })
+export const listDictApi = (query: DictTypeQuery) => {
+  return http.get<DictTypeVO[]>('/system/dict/type/list', query, { loading: false })
 }
 
 /**
@@ -14,7 +14,7 @@ export const listDictApi = (query: any) => {
  * @param dictId dictId
  * @returns returns
  */
-export const getDictApi = (dictId: any) => {
+export const getDictApi = (dictId: string | number) => {
   return http.get<any>(`/system/dict/type/${dictId}`)
 }
 
@@ -23,7 +23,7 @@ export const getDictApi = (dictId: any) => {
  * @param data data
  * @returns returns
  */
-export const addDictApi = (data: any) => {
+export const addDictApi = (data: DictTypeForm) => {
   return http.post<any>('/system/dict/type', data, { loading: false })
 }
 
@@ -32,7 +32,7 @@ export const addDictApi = (data: any) => {
  * @param data data
  * @returns returns
  */
-export const updateDictApi = (data: any) => {
+export const updateDictApi = (data: DictTypeForm) => {
   return http.put<any>('/system/dict/type', data, { loading: false })
 }
 
@@ -41,32 +41,23 @@ export const updateDictApi = (data: any) => {
  * @param dictId dictId
  * @returns returns
  */
-export const delDictApi = (id: any) => {
+export const delDictApi = (id: string | number | Array<string | number>) => {
   return http.delete<any>(`/system/dict/type/${id}`)
 }
 
 /**
- * @name 下载模板
- * @returns returns
- */
-export const importTemplateApi = () => {
-  return http.downloadPost('/system/dict/type/importTemplate', {})
-}
-
-/**
- * @name 导入数据
+ * @name 导出数据
  * @returns returns
  */
-export const importDataApi = (data: any) => {
-  return http.post('/system/dict/type/importData', data)
+export const exportApi = (data: any) => {
+  return http.downloadPost('/system/dict/type/export', data)
 }
-
 /**
- * @name 导出数据
+ * @name 刷新字典缓存
  * @returns returns
  */
-export const exportApi = (data: any) => {
-  return http.downloadPost('/system/dict/type/export', data)
+export const refreshCacheApi = () => {
+  return http.delete<any>(`system/dict/type/refreshCache`)
 }
 
 /**

+ 9 - 9
src/api/modules/system/dictData.ts

@@ -1,12 +1,12 @@
 import http from '@/api'
-
+import { DictDataForm, DictDataQuery, DictDataVO } from '@/api/interface/system/data'
 /**
  * @name 查询字典数据列表
  * @param query 参数
  * @returns 返回列表
  */
-export const listDataApi = (query: any) => {
-  return http.get<any>('/system/dict/data/list', query, { loading: true })
+export const listDataApi = (query: DictDataQuery) => {
+  return http.get<DictDataVO[]>('/system/dict/data/list', query, { loading: true })
 }
 
 /**
@@ -14,8 +14,8 @@ export const listDataApi = (query: any) => {
  * @param dictCode dictCode
  * @returns returns
  */
-export const getDataApi = (dictCode: any) => {
-  return http.get<any>(`/system/dict/data/${dictCode}`)
+export const getDataApi = (dictCode: string | number) => {
+  return http.get<DictDataVO>(`/system/dict/data/${dictCode}`)
 }
 
 /**
@@ -24,7 +24,7 @@ export const getDataApi = (dictCode: any) => {
  * @returns returns
  */
 export const getDictsApi = (dictType: string) => {
-  return http.get<any>(`/system/dict/data/type/${dictType}`)
+  return http.get<DictDataVO[]>(`/system/dict/data/type/${dictType}`)
 }
 
 /**
@@ -32,7 +32,7 @@ export const getDictsApi = (dictType: string) => {
  * @param data data
  * @returns returns
  */
-export const addDataApi = (data: any) => {
+export const addDataApi = (data: DictDataForm) => {
   return http.post<any>('/system/dict/data', data, { loading: false })
 }
 
@@ -41,7 +41,7 @@ export const addDataApi = (data: any) => {
  * @param data data
  * @returns returns
  */
-export const updateDataApi = (data: any) => {
+export const updateDataApi = (data: DictDataForm) => {
   return http.put<any>('/system/dict/data', data, { loading: false })
 }
 
@@ -50,7 +50,7 @@ export const updateDataApi = (data: any) => {
  * @param dictCode dictCode
  * @returns returns
  */
-export const delDataApi = (id: any) => {
+export const delDataApi = (id: string | number | Array<string | number>) => {
   return http.delete<any>(`/system/dict/data/${id}`)
 }
 

+ 13 - 36
src/api/modules/system/menu.ts

@@ -1,8 +1,9 @@
 import http from '@/api'
-
+import { MenuQuery, MenuVO, MenuForm, MenuTreeOption, RoleMenuTree } from '@/api/interface/system/menu'
+import { RouteRecordRaw } from 'vue-router'
 // 获取路由
 export const getRoutersApi = () => {
-  return http.get<Menu.MenuOptions[]>('/system/menu/getRouters', {}, { loading: false })
+  return http.get<RouteRecordRaw[]>('/system/menu/getRouters', {}, { loading: false })
 }
 
 /**
@@ -10,8 +11,8 @@ export const getRoutersApi = () => {
  * @param query 参数
  * @returns 返回列表
  */
-export const listMenuApi = (query?: any) => {
-  return http.get<any>('/system/menu/list', query, { loading: true })
+export const listMenuApi = (query?: MenuQuery) => {
+  return http.get<MenuVO[]>('/system/menu/list', query, { loading: true })
 }
 
 /**
@@ -19,8 +20,8 @@ export const listMenuApi = (query?: any) => {
  * @param menuId menuId
  * @returns returns
  */
-export const getMenuApi = (menuId: any) => {
-  return http.get<any>(`/system/menu/${menuId}`)
+export const getMenuApi = (menuId: string | number) => {
+  return http.get<MenuVO>(`/system/menu/${menuId}`)
 }
 
 /**
@@ -28,7 +29,7 @@ export const getMenuApi = (menuId: any) => {
  * @param data data
  * @returns returns
  */
-export const addMenuApi = (data: any) => {
+export const addMenuApi = (data: MenuForm) => {
   return http.post<any>('/system/menu', data, { loading: false })
 }
 
@@ -37,7 +38,7 @@ export const addMenuApi = (data: any) => {
  * @param data data
  * @returns returns
  */
-export const updateMenuApi = (data: any) => {
+export const updateMenuApi = (data: MenuForm) => {
   return http.put<any>('/system/menu', data, { loading: false })
 }
 
@@ -46,40 +47,16 @@ export const updateMenuApi = (data: any) => {
  * @param menuId menuId
  * @returns returns
  */
-export const delMenuApi = (menuId: any) => {
+export const delMenuApi = (menuId: string | number) => {
   return http.delete<any>(`/system/menu/${menuId}`)
 }
 
-/**
- * @name 下载模板
- * @returns returns
- */
-export const importTemplateApi = () => {
-  return http.downloadPost('/system/menu/importTemplate', {})
-}
-
-/**
- * @name 导入数据
- * @returns returns
- */
-export const importDataApi = (data: any) => {
-  return http.post('/system/menu/importData', data)
-}
-
-/**
- * @name 导出数据
- * @returns returns
- */
-export const exportApi = (data: any) => {
-  return http.downloadPost('/system/menu/export', data)
-}
-
 /**
  * @name 查询菜单下拉树结构
  * @returns returns
  */
 export const treeSelectApi = () => {
-  return http.get<any>(`/system/menu/treeselect`)
+  return http.get<MenuTreeOption[]>(`/system/menu/treeselect`)
 }
 
 /**
@@ -87,6 +64,6 @@ export const treeSelectApi = () => {
  * @param roleId roleId
  * @returns returns
  */
-export const roleMenuTreeselectApi = (roleId: any) => {
-  return http.get<any>(`/system/menu/roleMenuTreeselect/${roleId}`)
+export const roleMenuTreeselectApi = (roleId: string | number) => {
+  return http.get<RoleMenuTree>(`/system/menu/roleMenuTreeselect/${roleId}`)
 }

+ 6 - 56
src/api/modules/system/oss.ts

@@ -1,47 +1,21 @@
 import http from '@/api'
-
+import { OssQuery, OssVO } from '@/api/interface/system/oss'
 /**
  * @name 查询OSS对象存储列表
  * @param query 参数
  * @returns 返回列表
  */
-export const listOssApi = (query: any) => {
-  return http.get<any>('/resource/oss/list', query, { loading: true })
+export const listOssApi = (query: OssQuery) => {
+  return http.get<OssVO[]>('/resource/oss/list', query, { loading: true })
 }
 
-/**
- * @name 查询OSS对象存储详细
- * @param ossId ossId
- * @returns returns
- */
-export const getOssApi = (ossId: any) => {
-  return http.get<any>(`/resource/oss/${ossId}`)
-}
 /**
  * @name 查询OSS对象基于id串
  * @param ossId ossId
  * @returns returns
  */
-export const getListByIdsApi = (ossIds: any) => {
-  return http.get<any>(`/resource/oss/listByIds/${ossIds}`)
-}
-
-/**
- * @name 新增OSS对象存储
- * @param data data
- * @returns returns
- */
-export const addOssApi = (data: any) => {
-  return http.post<any>('/resource/oss', data, { loading: false })
-}
-
-/**
- * @name 修改OSS对象存储
- * @param data data
- * @returns returns
- */
-export const updateOssApi = (data: any) => {
-  return http.put<any>('/resource/oss', data, { loading: false })
+export const getListByIdsApi = (ossIds: string | number) => {
+  return http.get<OssVO[]>(`/resource/oss/listByIds/${ossIds}`)
 }
 
 /**
@@ -49,30 +23,6 @@ export const updateOssApi = (data: any) => {
  * @param ossId ossId
  * @returns returns
  */
-export const delOssApi = (ossId: any) => {
+export const delOssApi = (ossId: string | number | Array<string | number>) => {
   return http.delete<any>(`/resource/oss/${ossId}`)
 }
-
-/**
- * @name 下载模板
- * @returns returns
- */
-export const importTemplateApi = () => {
-  return http.downloadPost('/resource/oss/importTemplate', {})
-}
-
-/**
- * @name 导入数据
- * @returns returns
- */
-export const importOssDataApi = (data: any) => {
-  return http.post('/resource/oss/importData', data)
-}
-
-/**
- * @name 导出数据
- * @returns returns
- */
-export const exportOssApi = (data: any) => {
-  return http.downloadPost('/resource/oss/export', data)
-}

+ 9 - 24
src/api/modules/system/ossConfig.ts

@@ -1,11 +1,12 @@
 import http from '@/api'
+import { OssConfigForm, OssConfigQuery, OssConfigVO } from '@/api/interface/system/ossConfig'
 /**
  * @name 查询对象存储配置列表
  * @param query 参数
  * @returns 返回列表
  */
-export const listOssConfigApi = (query: any) => {
-  return http.get<any>('/resource/oss/config/list', query, { loading: true })
+export const listOssConfigApi = (query: OssConfigQuery) => {
+  return http.get<OssConfigVO[]>('/resource/oss/config/list', query, { loading: true })
 }
 
 /**
@@ -13,8 +14,8 @@ export const listOssConfigApi = (query: any) => {
  * @param ossConfigId ossConfigId
  * @returns returns
  */
-export const getOssConfigApi = (ossConfigId: any) => {
-  return http.get<any>(`/resource/oss/config/${ossConfigId}`)
+export const getOssConfigApi = (ossConfigId: string | number) => {
+  return http.get<OssConfigVO>(`/resource/oss/config/${ossConfigId}`)
 }
 
 /**
@@ -22,7 +23,7 @@ export const getOssConfigApi = (ossConfigId: any) => {
  * @param data data
  * @returns returns
  */
-export const addOssConfigApi = (data: any) => {
+export const addOssConfigApi = (data: OssConfigForm) => {
   return http.post<any>('/resource/oss/config', data, { loading: false })
 }
 
@@ -31,7 +32,7 @@ export const addOssConfigApi = (data: any) => {
  * @param data data
  * @returns returns
  */
-export const updateOssConfigApi = (data: any) => {
+export const updateOssConfigApi = (data: OssConfigForm) => {
   return http.put<any>('/resource/oss/config', data, { loading: false })
 }
 /**
@@ -39,7 +40,7 @@ export const updateOssConfigApi = (data: any) => {
  * @param data data
  * @returns returns
  */
-export const changeOssConfigStatusApi = (data: any) => {
+export const changeOssConfigStatusApi = (data: { ossConfigId: string | number; version: number; status: string; configKey: string }) => {
   return http.put<any>('/resource/oss/config/changeStatus', data, { loading: false })
 }
 
@@ -48,7 +49,7 @@ export const changeOssConfigStatusApi = (data: any) => {
  * @param ossConfigId ossConfigId
  * @returns returns
  */
-export const delOssConfigApi = (ossConfigId: any) => {
+export const delOssConfigApi = (ossConfigId: string | number | Array<string | number>) => {
   return http.delete<any>(`/resource/oss/config/${ossConfigId}`)
 }
 
@@ -59,19 +60,3 @@ export const delOssConfigApi = (ossConfigId: any) => {
 export const importTemplateApi = () => {
   return http.downloadPost('/resource/oss/config/importTemplate', {})
 }
-
-/**
- * @name 导入数据
- * @returns returns
- */
-export const importOssConfigDataApi = (data: any) => {
-  return http.post('/resource/oss/config/importData', data)
-}
-
-/**
- * @name 导出数据
- * @returns returns
- */
-export const exportOssConfigApi = (data: any) => {
-  return http.downloadPost('/resource/oss/config/export', data)
-}

+ 7 - 6
src/api/modules/system/post.ts

@@ -1,12 +1,13 @@
 import http from '@/api'
+import { PostForm, PostQuery, PostVO } from '@/api/interface/system/post'
 
 /**
  * @name 查询岗位信息列表
  * @param query 参数
  * @returns 返回列表
  */
-export const listPostApi = (query: any) => {
-  return http.get<any>('/system/post/list', query, { loading: true })
+export const listPostApi = (query: PostQuery) => {
+  return http.get<PostVO[]>('/system/post/list', query, { loading: true })
 }
 
 /**
@@ -14,7 +15,7 @@ export const listPostApi = (query: any) => {
  * @param postId postId
  * @returns returns
  */
-export const getPostApi = (postId: any) => {
+export const getPostApi = (postId: string | number) => {
   return http.get<any>(`/system/post/${postId}`)
 }
 
@@ -23,7 +24,7 @@ export const getPostApi = (postId: any) => {
  * @param data data
  * @returns returns
  */
-export const addPostApi = (data: any) => {
+export const addPostApi = (data: PostForm) => {
   return http.post<any>('/system/post', data, { loading: false })
 }
 
@@ -32,7 +33,7 @@ export const addPostApi = (data: any) => {
  * @param data data
  * @returns returns
  */
-export const updatePostApi = (data: any) => {
+export const updatePostApi = (data: PostForm) => {
   return http.put<any>('/system/post', data, { loading: false })
 }
 
@@ -41,7 +42,7 @@ export const updatePostApi = (data: any) => {
  * @param postId postId
  * @returns returns
  */
-export const delPostApi = (postId: any) => {
+export const delPostApi = (postId: string | number | (string | number)[]) => {
   return http.delete<any>(`/system/post/${postId}`)
 }
 

+ 16 - 14
src/api/modules/system/role.ts

@@ -1,12 +1,14 @@
 import http from '@/api'
-
+import { RoleQuery, RoleVO, RoleDeptTree } from '@/api/interface/system/role'
+import { UserVO, UserQuery } from '@/api/interface/system/user'
+import { RoleMenuTree } from '@/api/interface/system/menu'
 /**
  * @name 查询角色信息列表
  * @param query 参数
  * @returns 返回列表
  */
-export const listRoleApi = (query: any) => {
-  return http.get<any>('/system/role/list', query, { loading: true })
+export const listRoleApi = (query: RoleQuery) => {
+  return http.get<RoleVO[]>('/system/role/list', query, { loading: true })
 }
 
 /**
@@ -14,8 +16,8 @@ export const listRoleApi = (query: any) => {
  * @param roleId 角色Id
  * @returns 返回列表
  */
-export const deptTreeSelectApi = (roleId: any) => {
-  return http.get<any>(`/system/role/deptTree/${roleId}`)
+export const deptTreeSelectApi = (roleId: string | number) => {
+  return http.get<RoleDeptTree>(`/system/role/deptTree/${roleId}`)
 }
 
 /**
@@ -24,7 +26,7 @@ export const deptTreeSelectApi = (roleId: any) => {
  * @returns 返回列表
  */
 export const roleMenuTreeSelectApi = (roleId: any) => {
-  return http.get<any>(`/system/menu/roleMenuTreeselect/${roleId}`)
+  return http.get<RoleMenuTree>(`/system/menu/roleMenuTreeselect/${roleId}`)
 }
 
 /**
@@ -32,8 +34,8 @@ export const roleMenuTreeSelectApi = (roleId: any) => {
  * @param roleId roleId
  * @returns returns
  */
-export const getRoleApi = (roleId: any) => {
-  return http.get<any>(`/system/role/${roleId}`)
+export const getRoleApi = (roleId: string | number) => {
+  return http.get<RoleVO>(`/system/role/${roleId}`)
 }
 
 /**
@@ -68,7 +70,7 @@ export const dataScopeApi = (data: any) => {
  * @param data data
  * @returns returns
  */
-export const changeStatusApi = (data: any) => {
+export const changeStatusApi = (data: { roleId: string | number; version: number; status: string }) => {
   return http.put<any>('/system/role/changeStatus', data, { loading: false })
 }
 
@@ -77,7 +79,7 @@ export const changeStatusApi = (data: any) => {
  * @param roleId roleId
  * @returns returns
  */
-export const delRoleApi = (roleId: any) => {
+export const delRoleApi = (roleId: Array<string | number> | string | number) => {
   return http.delete<any>(`/system/role/${roleId}`)
 }
 
@@ -110,8 +112,8 @@ export const exportApi = (data: any) => {
  * @param query 参数
  * @returns 返回列表
  */
-export const allocatedUserListApi = (query: any) => {
-  return http.get<any>(`/system/role/authUser/allocatedList`, query, { loading: true })
+export const allocatedUserListApi = (query: UserQuery) => {
+  return http.get<UserVO[]>(`/system/role/authUser/allocatedList`, query, { loading: true })
 }
 
 /**
@@ -119,8 +121,8 @@ export const allocatedUserListApi = (query: any) => {
  * @param query 参数
  * @returns 返回列表
  */
-export const unallocatedUserListApi = (query: any) => {
-  return http.get<any>(`/system/role/authUser/unallocatedList`, query, { loading: true })
+export const unallocatedUserListApi = (query: UserQuery) => {
+  return http.get<UserVO[]>(`/system/role/authUser/unallocatedList`, query, { loading: true })
 }
 
 /**

+ 14 - 13
src/api/modules/system/user.ts

@@ -1,13 +1,14 @@
 import http from '@/api'
 import { parseStrEmpty } from '@/utils/common'
-
+import { UserForm, UserQuery, UserVO, UserInfoVO } from '@/api/interface/system/user'
+import { DeptVO } from '@/api/interface/system/dept'
 /**
  * @name 查询用户列表
  * @param query 参数
  * @returns 返回列表
  */
-export const listUserApi = (query: any) => {
-  return http.get<any>('/system/user/list', query, { loading: true })
+export const listUserApi = (query: UserQuery) => {
+  return http.get<UserVO[]>('/system/user/list', query, { loading: true })
 }
 
 /**
@@ -15,8 +16,8 @@ export const listUserApi = (query: any) => {
  * @param userId userId
  * @returns returns
  */
-export const getUserApi = (userId?: string) => {
-  return http.get<any>(`/system/user/` + parseStrEmpty(userId))
+export const getUserApi = (userId?: string | number) => {
+  return http.get<UserInfoVO>(`/system/user/` + parseStrEmpty(userId))
 }
 
 /**
@@ -24,14 +25,14 @@ export const getUserApi = (userId?: string) => {
  * @returns returns
  */
 export const deptTreeSelectApi = () => {
-  return http.get<any>(`/system/user/deptTree`)
+  return http.get<DeptVO[]>(`/system/user/deptTree`)
 }
 
 /**
  * @name 新增用户
  * @returns returns
  */
-export const addUserApi = (data: any) => {
+export const addUserApi = (data: UserForm) => {
   return http.post<any>('/system/user', data, { loading: false })
 }
 
@@ -39,7 +40,7 @@ export const addUserApi = (data: any) => {
  * @name 修改用户
  * @returns returns
  */
-export const updateUserApi = (data: any) => {
+export const updateUserApi = (data: UserForm) => {
   return http.put<any>('/system/user', data, { loading: false })
 }
 
@@ -47,7 +48,7 @@ export const updateUserApi = (data: any) => {
  * @name 删除用户
  * @returns returns
  */
-export const delUserApi = (userId: any) => {
+export const delUserApi = (userId: Array<string | number> | string | number) => {
   return http.delete<any>(`/system/user/${userId}`)
 }
 
@@ -57,7 +58,7 @@ export const delUserApi = (userId: any) => {
  * @param status status
  * @returns returns
  */
-export const changeUserStatus = (data: any) => {
+export const changeUserStatus = (data: { userId: number | string; version: number; status: string }) => {
   return http.put<any>('/system/user/changeStatus', data, { loading: false })
 }
 
@@ -108,7 +109,7 @@ export const uploadAvatarApi = (params: FormData) => {
  * @returns returns
  */
 export const getUserProfileApi = () => {
-  return http.get<any>(`/system/user/profile`)
+  return http.get<UserInfoVO>(`/system/user/profile`)
 }
 
 /**
@@ -116,7 +117,7 @@ export const getUserProfileApi = () => {
  * @param data data
  * @returns returns
  */
-export const updateUserProfileApi = (data: any) => {
+export const updateUserProfileApi = (data: UserForm) => {
   return http.put<any>('/system/user/profile', data, { loading: false })
 }
 /**
@@ -124,6 +125,6 @@ export const updateUserProfileApi = (data: any) => {
  * @param data data
  * @returns returns
  */
-export const updateUserPwdApi = (data: any) => {
+export const updateUserPwdApi = (data: { oldPassword: string; newPassword: string }) => {
   return http.put<any>('system/user/profile/updatePwd', data, { loading: false })
 }

+ 17 - 17
src/api/modules/tool/gen.ts

@@ -1,12 +1,12 @@
 import http from '@/api'
-
+import { DbTableQuery, DbTableVO, TableQuery, TableVO, GenTableVO, DbTableForm } from '@/api/interface/tool/gen'
 /**
  * @name 查询生成表数据
- * @param query 参数
+ * @param query {TableQuery} 参数
  * @returns 返回列表
  */
-export const listTableApi = (query: any) => {
-  return http.get<any>('/tool/gen/list', query, { loading: true })
+export const listTableApi = (query: TableQuery) => {
+  return http.get<TableVO[]>('/tool/gen/list', query, { loading: true })
 }
 
 /**
@@ -14,8 +14,8 @@ export const listTableApi = (query: any) => {
  * @param query 参数
  * @returns 返回列表
  */
-export const listDbTableApi = (query: any) => {
-  return http.get<any>('/tool/gen/db/list', query, { loading: true })
+export const listDbTableApi = (query: DbTableQuery) => {
+  return http.get<DbTableVO[]>('/tool/gen/db/list', query, { loading: true })
 }
 
 /**
@@ -23,8 +23,8 @@ export const listDbTableApi = (query: any) => {
  * @param tableId tableId
  * @returns returns
  */
-export const getTableApi = (tableId: any) => {
-  return http.get<any>(`/tool/gen/${tableId}`)
+export const getTableApi = (tableId: string | number) => {
+  return http.get<GenTableVO>(`/tool/gen/${tableId}`)
 }
 
 /**
@@ -32,8 +32,8 @@ export const getTableApi = (tableId: any) => {
  * @param data data
  * @returns returns
  */
-export const updateGenTableApi = (data: any) => {
-  return http.put<any>('/tool/gen', data, { loading: false })
+export const updateGenTableApi = (data: DbTableForm) => {
+  return http.put<GenTableVO>('/tool/gen', data, { loading: false })
 }
 
 /**
@@ -41,8 +41,8 @@ export const updateGenTableApi = (data: any) => {
  * @param data data
  * @returns returns
  */
-export const importTableApi = (data: any) => {
-  return http.post<any>('/tool/gen/importTable', data, { loading: false })
+export const importTableApi = (data: { tables: string }) => {
+  return http.post<GenTableVO>('/tool/gen/importTable', data, { loading: false })
 }
 
 /**
@@ -50,7 +50,7 @@ export const importTableApi = (data: any) => {
  * @param tableId tableId
  * @returns returns
  */
-export const previewTableApi = (tableId: any) => {
+export const previewTableApi = (tableId: string | number) => {
   return http.get<any>(`/tool/gen/preview/${tableId}`)
 }
 
@@ -59,7 +59,7 @@ export const previewTableApi = (tableId: any) => {
  * @param tableId tableId
  * @returns returns
  */
-export const delTableApi = (tableId: any) => {
+export const delTableApi = (tableId: string | number | Array<string | number>) => {
   return http.delete<any>(`/tool/gen/${tableId}`)
 }
 
@@ -68,7 +68,7 @@ export const delTableApi = (tableId: any) => {
  * @param tableId tableId
  * @returns returns
  */
-export const genCodeApi = (tableId: any) => {
+export const genCodeApi = (tableId: string | number) => {
   return http.get<any>(`/tool/gen/genCode/${tableId}`)
 }
 
@@ -77,7 +77,7 @@ export const genCodeApi = (tableId: any) => {
  * @param tableId tableName
  * @returns returns
  */
-export const synchDbApi = (tableId: any) => {
+export const synchDbApi = (tableId: string | number) => {
   return http.get<any>(`/tool/gen/syncDb/${tableId}`)
 }
 
@@ -86,6 +86,6 @@ export const synchDbApi = (tableId: any) => {
  * @param tableId tableId
  * @returns returns
  */
-export const batchGenCodeApi = (tableId: any) => {
+export const batchGenCodeApi = (tableId: string | number) => {
   return http.downloadGet(`/tool/gen/batchGenCode?tables=${tableId}`)
 }

+ 3 - 4
src/components/ProTable/index.vue

@@ -11,9 +11,9 @@
       </div>
       <div v-if="toolButton" class="header-button-ri">
         <slot name="toolButton">
-          <el-button v-if="showToolButton('refresh')" :icon="Refresh" circle @click="getTableList" />
-          <el-button v-if="showToolButton('setting') && columns.length" :icon="Operation" circle @click="openColSetting" />
-          <el-button v-if="showToolButton('search') && searchColumns?.length" :icon="Search" circle @click="isShowSearch = !isShowSearch" />
+          <el-button v-if="showToolButton('refresh')" icon="Refresh" circle @click="getTableList" />
+          <el-button v-if="showToolButton('setting') && columns.length" icon="Operation" circle @click="openColSetting" />
+          <el-button v-if="showToolButton('search') && searchColumns?.length" icon="Search" circle @click="isShowSearch = !isShowSearch" />
         </slot>
       </div>
     </div>
@@ -82,7 +82,6 @@ import { useTable } from '@/hooks/useTable'
 import { useSelection } from '@/hooks/useSelection'
 import { BreakPoint } from '@/components/Grid/interface'
 import { ColumnProps, TypeProps } from '@/components/ProTable/interface'
-import { Refresh, Operation, Search } from '@element-plus/icons-vue'
 import { handleProp } from '@/utils'
 import SearchForm from '@/components/SearchForm/index.vue'
 import Pagination from './components/Pagination.vue'

+ 3 - 3
src/components/SearchForm/index.vue

@@ -18,8 +18,8 @@
         </GridItem>
         <GridItem suffix>
           <div class="operation">
-            <el-button type="primary" :icon="Search" @click="search"> 搜索 </el-button>
-            <el-button :icon="Delete" @click="reset"> 重置 </el-button>
+            <el-button type="primary" icon="Search" @click="search"> 搜索 </el-button>
+            <el-button icon="Delete" @click="reset"> 重置 </el-button>
             <el-button v-if="showCollapse" type="primary" link class="search-isOpen" @click="collapsed = !collapsed">
               {{ collapsed ? '展开' : '合并' }}
               <el-icon class="el-icon--right">
@@ -36,7 +36,7 @@
 import { computed, ref } from 'vue'
 import { ColumnProps } from '@/components/ProTable/interface'
 import { BreakPoint } from '@/components/Grid/interface'
-import { Delete, Search, ArrowDown, ArrowUp } from '@element-plus/icons-vue'
+import { ArrowDown, ArrowUp } from '@element-plus/icons-vue'
 import SearchFormItem from './components/SearchFormItem.vue'
 import Grid from '@/components/Grid/index.vue'
 import GridItem from '@/components/Grid/components/GridItem.vue'

+ 1 - 1
src/components/SelectIcon/index.vue

@@ -10,7 +10,7 @@
       @click="openDialog"
     >
       <template #append>
-        <el-button :icon="customIcons[iconValue]" />
+        <el-button icon="customIcons[iconValue]" />
       </template>
     </el-input>
     <el-dialog v-model="dialogVisible" :title="placeholder" top="10%" width="40%">

+ 3 - 3
src/components/Upload/File.vue

@@ -16,7 +16,7 @@
       :accept="fileType.join(',')"
       :headers="headers"
     >
-      <el-button :icon="icon" type="primary">{{ text }}</el-button>
+      <el-button icon="icon" type="primary">{{ text }}</el-button>
     </el-upload>
     <!-- 上传提示 -->
     <div class="el-upload__tip" v-if="showTip">
@@ -55,7 +55,7 @@ import { OssVO } from '@/api/interface/system/oss'
 import { getListByIdsApi, delOssApi } from '@/api/modules/system/oss'
 import { listToString } from '@/utils/common'
 interface UploadFileProps {
-  modelValue?: string | object | Array<any>
+  modelValue?: string | number
   disabled?: boolean // 是否禁用上传组件 ==> 非必传(默认为 false)
   drag?: boolean // 是否支持拖拽上传 ==> 非必传(默认为 true)
   limit?: number // 最大图片上传数 ==> 非必传(默认为 5张)
@@ -102,7 +102,7 @@ const _fileList = ref<any[]>([])
 // 监听 props.modelValue 列表默认值改变
 watch(
   () => props.modelValue,
-  async (val: string | object | Array<any>) => {
+  async (val: string | number) => {
     if (val) {
       let temp = 1
       // 首先将值转为数组

+ 3 - 3
src/components/Upload/FileS3.vue

@@ -16,7 +16,7 @@
       :accept="fileType.join(',')"
       :headers="headers"
     >
-      <el-button :icon="icon" type="primary">{{ text }}</el-button>
+      <el-button icon="icon" type="primary">{{ text }}</el-button>
     </el-upload>
     <!-- 上传提示 -->
     <div class="el-upload__tip" v-if="showTip">
@@ -55,7 +55,7 @@ import { OssVO } from '@/api/interface/system/oss'
 import { getListByIdsApi, delOssApi } from '@/api/modules/system/oss'
 import { listToString } from '@/utils/common'
 interface UploadFileProps {
-  modelValue?: string | object | Array<any>
+  modelValue?: string | number
   disabled?: boolean // 是否禁用上传组件 ==> 非必传(默认为 false)
   drag?: boolean // 是否支持拖拽上传 ==> 非必传(默认为 true)
   limit?: number // 最大图片上传数 ==> 非必传(默认为 5张)
@@ -102,7 +102,7 @@ const _fileList = ref<any[]>([])
 // 监听 props.modelValue 列表默认值改变
 watch(
   () => props.modelValue,
-  async (val: string | object | Array<any>) => {
+  async (val: string | number) => {
     if (val) {
       let temp = 1
       // 首先将值转为数组

+ 2 - 2
src/components/Upload/Imgs.vue

@@ -66,7 +66,7 @@ import { globalHeaders } from '@/api'
 import { getListByIdsApi, delOssApi } from '@/api/modules/system/oss'
 import { ResultData } from '@/api/interface'
 interface UploadFileProps {
-  modelValue: string | object | Array<any>
+  modelValue: string | number
   drag?: boolean // 是否支持拖拽上传 ==> 非必传(默认为 true)
   disabled?: boolean // 是否禁用上传组件 ==> 非必传(默认为 false)
   limit?: number // 最大图片上传数 ==> 非必传(默认为 5张)
@@ -114,7 +114,7 @@ const imageUploadRef = ref<ElUploadInstance>()
 // 监听 props.modelValue 列表默认值改变
 watch(
   () => props.modelValue,
-  async (val: string | object | Array<any>) => {
+  async (val: string | number) => {
     if (val) {
       // 首先将值转为数组
       let list: OssVO[] = []

+ 2 - 2
src/components/Upload/ImgsS3.vue

@@ -66,7 +66,7 @@ import { globalHeaders } from '@/api'
 import { getListByIdsApi, delOssApi } from '@/api/modules/system/oss'
 import { ResultData } from '@/api/interface'
 interface UploadFileProps {
-  modelValue: string | object | Array<any>
+  modelValue: string | number
   drag?: boolean // 是否支持拖拽上传 ==> 非必传(默认为 true)
   disabled?: boolean // 是否禁用上传组件 ==> 非必传(默认为 false)
   limit?: number // 最大图片上传数 ==> 非必传(默认为 5张)
@@ -114,7 +114,7 @@ const imageUploadRef = ref<ElUploadInstance>()
 // 监听 props.modelValue 列表默认值改变
 watch(
   () => props.modelValue,
-  async (val: string | object | Array<any>) => {
+  async (val: string | number) => {
     if (val) {
       // 首先将值转为数组
       let list: OssVO[] = []

+ 1 - 1
src/utils/common.ts

@@ -112,7 +112,7 @@ export function tansParams(params: { [x: string]: any }) {
 }
 
 // 转换字符串,undefined,null等转化为""
-export function parseStrEmpty(str: string | undefined) {
+export function parseStrEmpty(str: string | number | undefined) {
   if (!str || str === 'undefined' || str === 'null') {
     return ''
   }

+ 2 - 3
src/views/login/components/LoginForm.vue

@@ -25,8 +25,8 @@
     <el-checkbox v-model="loginForm.rememberMe">记住密码</el-checkbox>
   </el-form>
   <div class="login-btn">
-    <el-button :icon="CircleClose" round size="large" @click="resetForm(loginFormRef)"> 重置 </el-button>
-    <el-button :icon="UserFilled" round size="large" type="primary" :loading="loading" @click="handleLogin(loginFormRef)"> 登录 </el-button>
+    <el-button icon="CircleClose" round size="large" @click="resetForm(loginFormRef)"> 重置 </el-button>
+    <el-button icon="UserFilled" round size="large" type="primary" :loading="loading" @click="handleLogin(loginFormRef)"> 登录 </el-button>
   </div>
 </template>
 
@@ -42,7 +42,6 @@ import { useUserStore } from '@/stores/modules/user'
 import { useTabsStore } from '@/stores/modules/tabs'
 import { useKeepAliveStore } from '@/stores/modules/keepAlive'
 import { initDynamicRouter } from '@/routers/modules/dynamicRouter'
-import { CircleClose, UserFilled } from '@element-plus/icons-vue'
 import type { ElForm } from 'element-plus'
 // import md5 from 'md5'
 import { lodashFunc } from '@/utils/common'

+ 4 - 7
src/views/system/dept/index.vue

@@ -12,15 +12,13 @@
     >
       <!-- 表格 header 按钮 -->
       <template #tableHeader>
-        <el-button type="primary" v-auth="['system:dept:add']" :icon="CirclePlus" @click="openDialog(1, '部门新增')"> 新增 </el-button>
+        <el-button type="primary" v-auth="['system:dept:add']" icon="CirclePlus" @click="openDialog(1, '部门新增')"> 新增 </el-button>
       </template>
       <!-- 表格操作 -->
       <template #operation="scope">
-        <el-button type="primary" link :icon="EditPen" v-auth="['system:dept:edit']" @click="openDialog(2, '部门编辑', scope.row)"> 编辑 </el-button>
-        <el-button type="primary" link :icon="CirclePlus" v-auth="['system:dept:add']" @click="openDialog(4, '部门新增', scope.row)">
-          新增
-        </el-button>
-        <el-button v-if="scope.row.parentId != 0" type="primary" link :icon="Delete" v-auth="['system:dept:remove']" @click="deleteDept(scope.row)">
+        <el-button type="primary" link icon="EditPen" v-auth="['system:dept:edit']" @click="openDialog(2, '部门编辑', scope.row)"> 编辑 </el-button>
+        <el-button type="primary" link icon="CirclePlus" v-auth="['system:dept:add']" @click="openDialog(4, '部门新增', scope.row)"> 新增 </el-button>
+        <el-button v-if="scope.row.parentId != 0" type="primary" link icon="Delete" v-auth="['system:dept:remove']" @click="deleteDept(scope.row)">
           删除
         </el-button>
       </template>
@@ -37,7 +35,6 @@ import ProTable from '@/components/ProTable/index.vue'
 import ImportExcel from '@/components/ImportExcel/index.vue'
 import FormDialog from '@/components/FormDialog/index.vue'
 import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
-import { Delete, EditPen, CirclePlus } from '@element-plus/icons-vue'
 import { handleTree } from '@/utils/common'
 import { listDeptApi, delDeptApi, addDeptApi, updateDeptApi } from '@/api/modules/system/dept'
 import { getDictsApi } from '@/api/modules/system/dictData'

+ 6 - 7
src/views/system/dict/data.vue

@@ -4,11 +4,11 @@
       <!-- 表格 header 按钮 -->
       <template #tableHeader="scope">
         <el-button type="primary" v-auth="['system/dict:data:add']" @click="openDialog(1, '字典数据新增')">新增</el-button>
-        <el-button type="primary" v-auth="['system/dict:data:export']" :icon="Download" plain @click="downloadFile"> 导出 </el-button>
+        <el-button type="primary" v-auth="['system/dict:data:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
         <el-button
           type="danger"
           v-auth="['system:user:remove']"
-          :icon="Delete"
+          icon="Delete"
           plain
           :disabled="!scope.isSelected"
           @click="batchDelete(scope.selectedListIds)"
@@ -18,13 +18,13 @@
       </template>
       <!-- 表格操作 -->
       <template #operation="scope">
-        <el-button type="primary" link :icon="View" v-auth="['system/dict:data:query']" @click="openDialog(3, '字典数据查看', scope.row)">
+        <el-button type="primary" link icon="View" v-auth="['system/dict:data:query']" @click="openDialog(3, '字典数据查看', scope.row)">
           查看
         </el-button>
-        <el-button type="primary" link :icon="EditPen" v-auth="['system/dict:data:edit']" @click="openDialog(2, '字典数据编辑', scope.row)">
+        <el-button type="primary" link icon="EditPen" v-auth="['system/dict:data:edit']" @click="openDialog(2, '字典数据编辑', scope.row)">
           编辑
         </el-button>
-        <el-button type="primary" link :icon="Delete" v-auth="['system/dict:data:remove']" @click="deleteDictData(scope.row)"> 删除 </el-button>
+        <el-button type="primary" link icon="Delete" v-auth="['system/dict:data:remove']" @click="deleteDictData(scope.row)"> 删除 </el-button>
       </template>
     </ProTable>
     <FormDialog ref="formDialogRef" />
@@ -41,7 +41,6 @@ import ProTable from '@/components/ProTable/index.vue'
 import ImportExcel from '@/components/ImportExcel/index.vue'
 import FormDialog from '@/components/FormDialog/index.vue'
 import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
-import { Delete, EditPen, Download, View } from '@element-plus/icons-vue'
 import { listDataApi, delDataApi, addDataApi, updateDataApi, getDataApi, exportApi } from '@/api/modules/system/dictData'
 import { getDictApi } from '@/api/modules/system/dict'
 
@@ -64,7 +63,7 @@ const listClassOptions = ref([
 
 const defaultDictType = ref('')
 const getTableList = async (params: any) => {
-  const res = await getDictApi(route.params.dictId)
+  const res = await getDictApi(route.params && (route.params.dictId as string))
   params.dictType = res.data.dictType
   defaultDictType.value = res.data.dictType
   return listDataApi(params)

+ 4 - 5
src/views/system/dict/index.vue

@@ -4,11 +4,11 @@
       <!-- 表格 header 按钮 -->
       <template #tableHeader="scope">
         <el-button type="primary" v-auth="['system:dict:add']" @click="openDialog(1, '字典类型新增')">新增</el-button>
-        <el-button type="primary" v-auth="['system:dict:export']" :icon="Download" plain @click="downloadFile">导出</el-button>
+        <el-button type="primary" v-auth="['system:dict:export']" icon="Download" plain @click="downloadFile">导出</el-button>
         <el-button
           type="danger"
           v-auth="['system:user:remove']"
-          :icon="Delete"
+          icon="Delete"
           plain
           :disabled="!scope.isSelected"
           @click="batchDelete(scope.selectedListIds)"
@@ -18,10 +18,10 @@
       </template>
       <!-- 表格操作 -->
       <template #operation="scope">
-        <el-button type="primary" link :icon="EditPen" v-auth="['system:dict:edit']" @click="openDialog(2, '字典类型编辑', scope.row)">
+        <el-button type="primary" link icon="EditPen" v-auth="['system:dict:edit']" @click="openDialog(2, '字典类型编辑', scope.row)">
           编辑
         </el-button>
-        <el-button type="primary" link :icon="Delete" v-auth="['system:dict:remove']" @click="deleteDict(scope.row)"> 删除 </el-button>
+        <el-button type="primary" link icon="Delete" v-auth="['system:dict:remove']" @click="deleteDict(scope.row)"> 删除 </el-button>
       </template>
     </ProTable>
     <FormDialog ref="formDialogRef" />
@@ -39,7 +39,6 @@ import ProTable from '@/components/ProTable/index.vue'
 import ImportExcel from '@/components/ImportExcel/index.vue'
 import FormDialog from '@/components/FormDialog/index.vue'
 import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
-import { Delete, EditPen, Download } from '@element-plus/icons-vue'
 import { listDictApi, delDictApi, addDictApi, updateDictApi, exportApi, getDictApi } from '@/api/modules/system/dict'
 
 // ProTable 实例

+ 3 - 4
src/views/system/menu/index.vue

@@ -22,9 +22,9 @@
       </template>
       <!-- 表格操作 -->
       <template #operation="scope">
-        <el-button type="primary" link :icon="EditPen" v-auth="['system:menu:edit']" @click="openDialog(2, '菜单编辑', scope.row)"> 编辑 </el-button>
-        <el-button type="primary" link :icon="CirclePlus" v-auth="['system:menu:add']" @click="openDialog(1, '菜单新增')"> 新增 </el-button>
-        <el-button type="primary" link :icon="Delete" v-auth="['system:menu:remove']" @click="deleteMenu(scope.row)"> 删除 </el-button>
+        <el-button type="primary" link icon="EditPen" v-auth="['system:menu:edit']" @click="openDialog(2, '菜单编辑', scope.row)"> 编辑 </el-button>
+        <el-button type="primary" link icon="CirclePlus" v-auth="['system:menu:add']" @click="openDialog(1, '菜单新增')"> 新增 </el-button>
+        <el-button type="primary" link icon="Delete" v-auth="['system:menu:remove']" @click="deleteMenu(scope.row)"> 删除 </el-button>
       </template>
     </ProTable>
     <FormDialog ref="formDialogRef" />
@@ -37,7 +37,6 @@ import { useHandleData } from '@/hooks/useHandleData'
 import ProTable from '@/components/ProTable/index.vue'
 import FormDialog from '@/components/FormDialog/index.vue'
 import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
-import { Delete, EditPen, CirclePlus } from '@element-plus/icons-vue'
 import { handleTree } from '@/utils/common'
 import { listMenuApi, delMenuApi, addMenuApi, updateMenuApi, getMenuApi } from '@/api/modules/system/menu'
 import { getDictsApi } from '@/api/modules/system/dictData'

+ 7 - 10
src/views/system/post/index.vue

@@ -3,13 +3,13 @@
     <ProTable ref="proTable" :columns="columns" row-key="postId" :request-api="listPostApi">
       <!-- 表格 header 按钮 -->
       <template #tableHeader="scope">
-        <el-button type="primary" v-auth="['system:post:add']" :icon="CirclePlus" @click="openDialog(1, '岗位信息新增')"> 新增 </el-button>
-        <el-button type="primary" v-auth="['system:post:import']" :icon="Upload" plain @click="batchAdd"> 导入 </el-button>
-        <el-button type="primary" v-auth="['system:post:export']" :icon="Download" plain @click="downloadFile"> 导出 </el-button>
+        <el-button type="primary" v-auth="['system:post:add']" icon="CirclePlus" @click="openDialog(1, '岗位信息新增')"> 新增 </el-button>
+        <el-button type="primary" v-auth="['system:post:import']" icon="Upload" plain @click="batchAdd"> 导入 </el-button>
+        <el-button type="primary" v-auth="['system:post:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
         <el-button
           type="danger"
           v-auth="['system:user:remove']"
-          :icon="Delete"
+          icon="Delete"
           plain
           :disabled="!scope.isSelected"
           @click="batchDelete(scope.selectedListIds)"
@@ -19,13 +19,11 @@
       </template>
       <!-- 表格操作 -->
       <template #operation="scope">
-        <el-button type="primary" link :icon="View" v-auth="['system:post:query']" @click="openDialog(3, '岗位信息查看', scope.row)">
-          查看
-        </el-button>
-        <el-button type="primary" link :icon="EditPen" v-auth="['system:post:edit']" @click="openDialog(2, '岗位信息编辑', scope.row)">
+        <el-button type="primary" link icon="View" v-auth="['system:post:query']" @click="openDialog(3, '岗位信息查看', scope.row)"> 查看 </el-button>
+        <el-button type="primary" link icon="EditPen" v-auth="['system:post:edit']" @click="openDialog(2, '岗位信息编辑', scope.row)">
           编辑
         </el-button>
-        <el-button type="primary" link :icon="Delete" v-auth="['system:post:remove']" @click="deletePost(scope.row)"> 删除 </el-button>
+        <el-button type="primary" link icon="Delete" v-auth="['system:post:remove']" @click="deletePost(scope.row)"> 删除 </el-button>
       </template>
     </ProTable>
     <FormDialog ref="formDialogRef" />
@@ -42,7 +40,6 @@ import ProTable from '@/components/ProTable/index.vue'
 import ImportExcel from '@/components/ImportExcel/index.vue'
 import FormDialog from '@/components/FormDialog/index.vue'
 import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
-import { Delete, EditPen, Download, Upload, View, CirclePlus } from '@element-plus/icons-vue'
 import {
   listPostApi,
   delPostApi,

+ 4 - 5
src/views/system/role/authUser.vue

@@ -3,22 +3,22 @@
     <ProTable ref="proTable" :columns="columns" row-key="userId" :request-api="allocatedUserListApi" :init-param="initParam">
       <!-- 表格 header 按钮 -->
       <template #tableHeader="scope">
-        <el-button type="primary" v-auth="['system:role:add']" :icon="CirclePlus" @click="addUser"> 添加用户 </el-button>
+        <el-button type="primary" v-auth="['system:role:add']" icon="CirclePlus" @click="addUser"> 添加用户 </el-button>
         <el-button
           type="danger"
           v-auth="['system:role:import']"
           :disabled="!scope.isSelected"
-          :icon="CircleClose"
+          icon="CircleClose"
           plain
           @click="cancelAuthUserAll(scope.selectedListIds)"
         >
           批量取消授权
         </el-button>
-        <el-button type="warning" v-auth="['system:role:export']" :icon="Close" plain @click="closeCurrentTab"> 关闭 </el-button>
+        <el-button type="warning" v-auth="['system:role:export']" icon="Close" plain @click="closeCurrentTab"> 关闭 </el-button>
       </template>
       <!-- 表格操作 -->
       <template #operation="scope">
-        <el-button type="primary" link :icon="CircleClose" v-auth="['system:role:query']" @click="cancelAuthUser(scope.row)"> 取消授权 </el-button>
+        <el-button type="primary" link icon="CircleClose" v-auth="['system:role:query']" @click="cancelAuthUser(scope.row)"> 取消授权 </el-button>
       </template>
     </ProTable>
     <TableDialog ref="tableDialogRef" @submit-form="submitForm" />
@@ -31,7 +31,6 @@ import { useHandleData } from '@/hooks/useHandleData'
 import ProTable from '@/components/ProTable/index.vue'
 import TableDialog from '@/components/TableDialog/index.vue'
 import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
-import { CircleClose, Close, CirclePlus } from '@element-plus/icons-vue'
 import {
   allocatedUserListApi,
   unallocatedUserListApi,

+ 8 - 9
src/views/system/role/index.vue

@@ -3,13 +3,13 @@
     <ProTable ref="proTable" :columns="columns" row-key="roleId" :request-api="listRoleApi">
       <!-- 表格 header 按钮 -->
       <template #tableHeader="scope">
-        <el-button type="primary" v-auth="['system:role:add']" :icon="CirclePlus" @click="openDialog(1, '角色信息新增')"> 新增 </el-button>
-        <el-button type="primary" v-auth="['system:role:import']" :icon="Upload" plain @click="batchAdd"> 导入 </el-button>
-        <el-button type="primary" v-auth="['system:role:export']" :icon="Download" plain @click="downloadFile"> 导出 </el-button>
+        <el-button type="primary" v-auth="['system:role:add']" icon="CirclePlus" @click="openDialog(1, '角色信息新增')"> 新增 </el-button>
+        <el-button type="primary" v-auth="['system:role:import']" icon="Upload" plain @click="batchAdd"> 导入 </el-button>
+        <el-button type="primary" v-auth="['system:role:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
         <el-button
           type="danger"
           v-auth="['system:user:remove']"
-          :icon="Delete"
+          icon="Delete"
           plain
           :disabled="!scope.isSelected"
           @click="batchDelete(scope.selectedListIds)"
@@ -23,26 +23,26 @@
           type="primary"
           v-if="scope.row.roleId !== 1"
           link
-          :icon="EditPen"
+          icon="EditPen"
           v-auth="['system:role:edit']"
           @click="openDialog(2, '角色编辑', scope.row)"
         >
           编辑
         </el-button>
-        <el-button type="primary" v-if="scope.row.roleId !== 1" link :icon="Delete" v-auth="['system:role:remove']" @click="deleteRole(scope.row)">
+        <el-button type="primary" v-if="scope.row.roleId !== 1" link icon="Delete" v-auth="['system:role:remove']" @click="deleteRole(scope.row)">
           删除
         </el-button>
         <el-button
           type="primary"
           v-if="scope.row.roleId !== 1"
           link
-          :icon="CircleCheck"
+          icon="CircleCheck"
           v-auth="['system:role:edit']"
           @click="openDataDialog(3, '数据权限', scope.row)"
         >
           数据权限
         </el-button>
-        <el-button type="primary" v-if="scope.row.roleId !== 1" link :icon="User" v-auth="['system:role:edit']" @click="handleAuthUser(scope.row)">
+        <el-button type="primary" v-if="scope.row.roleId !== 1" link icon="User" v-auth="['system:role:edit']" @click="handleAuthUser(scope.row)">
           分配用户
         </el-button>
       </template>
@@ -112,7 +112,6 @@ import ImportExcel from '@/components/ImportExcel/index.vue'
 import FormDialog from '@/components/CustomDialog/index.vue'
 import ProFrom from '@/components/ProForm/index.vue'
 import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
-import { Delete, EditPen, Download, Upload, CircleCheck, User, CirclePlus } from '@element-plus/icons-vue'
 import {
   listRoleApi,
   delRoleApi,

+ 7 - 8
src/views/system/user/index.vue

@@ -14,13 +14,13 @@
       >
         <!-- 表格 header 按钮 -->
         <template #tableHeader="scope">
-          <el-button type="primary" v-auth="['system:user:add']" :icon="CirclePlus" @click="openDialog(1, '用户新增')"> 新增 </el-button>
-          <el-button type="primary" v-auth="['system:user:import']" :icon="Upload" plain @click="batchAdd">导入</el-button>
-          <el-button type="primary" v-auth="['system:user:export']" :icon="Download" plain @click="downloadFile">导出</el-button>
+          <el-button type="primary" v-auth="['system:user:add']" icon="CirclePlus" @click="openDialog(1, '用户新增')"> 新增 </el-button>
+          <el-button type="primary" v-auth="['system:user:import']" icon="Upload" plain @click="batchAdd">导入</el-button>
+          <el-button type="primary" v-auth="['system:user:export']" icon="Download" plain @click="downloadFile">导出</el-button>
           <el-button
             type="danger"
             v-auth="['system:user:remove']"
-            :icon="Delete"
+            icon="Delete"
             plain
             :disabled="!scope.isSelected"
             @click="batchDelete(scope.selectedListIds)"
@@ -30,9 +30,9 @@
         </template>
         <!-- 表格操作 -->
         <template #operation="scope">
-          <el-button type="primary" link v-if="scope.row.userId !== 1" :icon="EditPen" @click="openDialog(2, '用户编辑', scope.row)">编辑</el-button>
-          <el-button type="primary" link v-if="scope.row.userId !== 1" :icon="Delete" @click="deleteAccount(scope.row)">删除</el-button>
-          <el-button type="primary" link v-if="scope.row.userId !== 1" :icon="View" @click="handleResetPwd(scope.row)">重置密码</el-button>
+          <el-button type="primary" link v-if="scope.row.userId !== 1" icon="EditPen" @click="openDialog(2, '用户编辑', scope.row)">编辑</el-button>
+          <el-button type="primary" link v-if="scope.row.userId !== 1" icon="Delete" @click="deleteAccount(scope.row)">删除</el-button>
+          <el-button type="primary" link v-if="scope.row.userId !== 1" icon="View" @click="handleResetPwd(scope.row)">重置密码</el-button>
         </template>
       </ProTable>
       <FormDialog ref="formDialogRef" />
@@ -51,7 +51,6 @@ import ProTable from '@/components/ProTable/index.vue'
 import TreeFilter from '@/components/TreeFilter/index.vue'
 import ImportExcel from '@/components/ImportExcel/index.vue'
 import FormDialog from '@/components/FormDialog/index.vue'
-import { CirclePlus, Download, Upload, View, Delete, EditPen } from '@element-plus/icons-vue'
 import { ColumnProps, ProTableInstance } from '@/components/ProTable/interface'
 import {
   listUserApi,

+ 8 - 9
src/views/tool/gen/index.vue

@@ -3,14 +3,14 @@
     <ProTable ref="proTable" :columns="columns" row-key="tableId" :request-api="listTableApi">
       <!-- 表格 header 按钮 -->
       <template #tableHeader="scope">
-        <el-button type="primary" v-auth="['tool:gen:code']" :disabled="!scope.isSelected" :icon="CirclePlus" @click="handleGenTable()">
+        <el-button type="primary" v-auth="['tool:gen:code']" :disabled="!scope.isSelected" icon="CirclePlus" @click="handleGenTable()">
           生成
         </el-button>
-        <el-button type="primary" v-auth="['tool:gen:import']" :icon="Upload" plain @click="batchAdd"> 导入表 </el-button>
+        <el-button type="primary" v-auth="['tool:gen:import']" icon="Upload" plain @click="batchAdd"> 导入表 </el-button>
         <el-button
           type="danger"
           v-auth="['system:user:remove']"
-          :icon="Delete"
+          icon="Delete"
           plain
           :disabled="!scope.isSelected"
           @click="batchDelete(scope.selectedListIds)"
@@ -20,11 +20,11 @@
       </template>
       <!-- 表格操作 -->
       <template #operation="scope">
-        <el-button type="primary" link :icon="View" v-auth="['tool:gen:query']" @click="openDialog(1, '代码预览', scope.row)"> 预览 </el-button>
-        <el-button type="primary" link :icon="EditPen" v-auth="['tool:gen:edit']" @click="toDetail(scope.row)"> 编辑 </el-button>
-        <el-button type="primary" link :icon="Delete" v-auth="['tool:gen:remove']" @click="deleteRole(scope.row)"> 删除 </el-button>
-        <el-button type="primary" link :icon="Refresh" v-auth="['tool:gen:edit']" @click="handleSyncDb(scope.row)"> 同步 </el-button>
-        <el-button type="primary" link :icon="Download" v-auth="['tool:gen:code']" @click="handleGenTable(scope.row)"> 生成代码 </el-button>
+        <el-button type="primary" link icon="View" v-auth="['tool:gen:query']" @click="openDialog(1, '代码预览', scope.row)"> 预览 </el-button>
+        <el-button type="primary" link icon="EditPen" v-auth="['tool:gen:edit']" @click="toDetail(scope.row)"> 编辑 </el-button>
+        <el-button type="primary" link icon="Delete" v-auth="['tool:gen:remove']" @click="deleteRole(scope.row)"> 删除 </el-button>
+        <el-button type="primary" link icon="Refresh" v-auth="['tool:gen:edit']" @click="handleSyncDb(scope.row)"> 同步 </el-button>
+        <el-button type="primary" link icon="Download" v-auth="['tool:gen:code']" @click="handleGenTable(scope.row)"> 生成代码 </el-button>
       </template>
     </ProTable>
     <FormDialog ref="formDialogRef">
@@ -70,7 +70,6 @@ import ProTable from '@/components/ProTable/index.vue'
 import FormDialog from '@/components/CustomDialog/index.vue'
 import TableDialog from '@/components/TableDialog/index.vue'
 import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
-import { Delete, EditPen, Download, Upload, Refresh, View, CirclePlus } from '@element-plus/icons-vue'
 import PreviewCode from '@/components/Highlight/index.vue'
 import { listTableApi, batchGenCodeApi, listDbTableApi, importTableApi, previewTableApi, delTableApi, synchDbApi } from '@/api/modules/tool/gen'
 // ProTable 实例