Browse Source

增加角色管理页面

zuohuaijun 3 years ago
parent
commit
548fc5f4cd

+ 0 - 40
Admin.NET/Admin.NET.Core/Admin.NET.Core.xml

@@ -6011,31 +6011,6 @@
             <param name="input"></param>
             <returns></returns>
         </member>
-        <member name="P:Admin.NET.Core.Service.RoleInput.Name">
-            <summary>
-            名称
-            </summary>
-        </member>
-        <member name="P:Admin.NET.Core.Service.RoleInput.Code">
-            <summary>
-            编码
-            </summary>
-        </member>
-        <member name="P:Admin.NET.Core.Service.RoleInput.Order">
-            <summary>
-            排序
-            </summary>
-        </member>
-        <member name="P:Admin.NET.Core.Service.RoleInput.DataScope">
-            <summary>
-            数据范围类型
-            </summary>
-        </member>
-        <member name="P:Admin.NET.Core.Service.RoleInput.Remark">
-            <summary>
-            备注
-            </summary>
-        </member>
         <member name="P:Admin.NET.Core.Service.RoleInput.Status">
             <summary>
             状态
@@ -6051,21 +6026,6 @@
             编码
             </summary>
         </member>
-        <member name="P:Admin.NET.Core.Service.PageRoleInput.DataScope">
-            <summary>
-            数据范围类型
-            </summary>
-        </member>
-        <member name="P:Admin.NET.Core.Service.PageRoleInput.Remark">
-            <summary>
-            备注
-            </summary>
-        </member>
-        <member name="P:Admin.NET.Core.Service.PageRoleInput.Status">
-            <summary>
-            状态
-            </summary>
-        </member>
         <member name="P:Admin.NET.Core.Service.AddRoleInput.Name">
             <summary>
             名称

+ 4 - 47
Admin.NET/Admin.NET.Core/Service/Role/Dto/RoleInput.cs

@@ -2,35 +2,10 @@
 
 public class RoleInput : BaseIdInput
 {
-    /// <summary>
-    /// 名称
-    /// </summary>
-    public virtual string Name { get; set; }
-
-    /// <summary>
-    /// 编码
-    /// </summary>
-    public virtual string Code { get; set; }
-
-    /// <summary>
-    /// 排序
-    /// </summary>
-    public virtual int Order { get; set; }
-
-    /// <summary>
-    /// 数据范围类型
-    /// </summary>
-    public virtual int DataScope { get; set; }
-
-    /// <summary>
-    /// 备注
-    /// </summary>
-    public virtual string Remark { get; set; }
-
     /// <summary>
     /// 状态
     /// </summary>
-    public int Status { get; set; }
+    public virtual StatusEnum Status { get; set; }
 }
 
 public class PageRoleInput : BasePageInput
@@ -44,29 +19,10 @@ public class PageRoleInput : BasePageInput
     /// 编码
     /// </summary>
     public virtual string Code { get; set; }
-
-    ///// <summary>
-    ///// 排序
-    ///// </summary>
-    //public virtual int Order { get; set; }
-
-    /// <summary>
-    /// 数据范围类型
-    /// </summary>
-    public virtual int DataScope { get; set; }
-
-    /// <summary>
-    /// 备注
-    /// </summary>
-    public virtual string Remark { get; set; }
-
-    /// <summary>
-    /// 状态
-    /// </summary>
-    public virtual int Status { get; set; }
 }
 
-public class AddRoleInput : RoleInput
+[NotTable]
+public class AddRoleInput : SysRole
 {
     /// <summary>
     /// 名称
@@ -75,6 +31,7 @@ public class AddRoleInput : RoleInput
     public override string Name { get; set; }
 }
 
+[NotTable]
 public class UpdateRoleInput : AddRoleInput
 {
 }

+ 1 - 1
Admin.NET/Admin.NET.Core/Service/Role/SysRoleService.cs

@@ -40,8 +40,8 @@ public class SysRoleService : IDynamicApiController, ITransient
     public async Task<SqlSugarPagedList<SysRole>> GetRolePage([FromQuery] PageRoleInput input)
     {
         return await _sysRoleRep.AsQueryable()
-            .WhereIF(input.Status > 0, u => u.Status == (StatusEnum)input.Status)
             .WhereIF(!string.IsNullOrWhiteSpace(input.Name), u => u.Name.Contains(input.Name))
+            .WhereIF(!string.IsNullOrWhiteSpace(input.Code), u => u.Code.Contains(input.Code))
             .OrderBy(u => u.Order)
             .ToPagedListAsync(input.Page, input.PageSize);
     }

+ 1 - 1
Admin.NET/Admin.NET.Core/Service/User/Dto/UserInput.cs

@@ -5,7 +5,7 @@ public class UserInput : BaseIdInput
     /// <summary>
     /// 状态
     /// </summary>
-    public virtual int Status { get; set; }
+    public virtual StatusEnum Status { get; set; }
 }
 
 public class PageUserInput : BasePageInput

+ 1 - 0
Admin.NET/Admin.NET.Core/Service/User/SysUserService.cs

@@ -47,6 +47,7 @@ public class SysUserService : IDynamicApiController, ITransient
             .WhereIF(orgList != null, u => orgList.Contains(u.OrgId))
             .WhereIF(!string.IsNullOrWhiteSpace(input.UserName), u => u.UserName.Contains(input.UserName))
             .WhereIF(!string.IsNullOrWhiteSpace(input.Phone), u => u.Phone.Contains(input.Phone))
+            .OrderBy(u => u.Order)
             .ToPagedListAsync(input.Page, input.PageSize);
     }
 

+ 30 - 133
vue-next-admin/src/api-services/apis/sys-role-api.ts

@@ -26,6 +26,7 @@ import { DeleteRoleInput } from '../models';
 import { RoleInput } from '../models';
 import { RoleMenuInput } from '../models';
 import { RoleOrgInput } from '../models';
+import { StatusEnum } from '../models';
 import { UpdateRoleInput } from '../models';
 /**
  * SysRoleApi - axios parameter creator
@@ -237,16 +238,11 @@ export const SysRoleApiAxiosParamCreator = function (configuration?: Configurati
          * 
          * @summary 根据角色Id获取菜单树(前端区分父子节点)
          * @param {number} id 主键Id
-         * @param {string} [name] 名称
-         * @param {string} [code] 编码
-         * @param {number} [order] 排序
-         * @param {number} [dataScope] 数据范围类型
-         * @param {string} [remark] 备注
-         * @param {number} [status] 状态
+         * @param {StatusEnum} [status] 状态
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        sysRoleOwnMenuGet: async (id: number, name?: string, code?: string, order?: number, dataScope?: number, remark?: string, status?: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
+        sysRoleOwnMenuGet: async (id: number, status?: StatusEnum, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
             // verify required parameter 'id' is not null or undefined
             if (id === null || id === undefined) {
                 throw new RequiredError('id','Required parameter id was null or undefined when calling sysRoleOwnMenuGet.');
@@ -264,26 +260,6 @@ export const SysRoleApiAxiosParamCreator = function (configuration?: Configurati
 
             // authentication Bearer required
 
-            if (name !== undefined) {
-                localVarQueryParameter['Name'] = name;
-            }
-
-            if (code !== undefined) {
-                localVarQueryParameter['Code'] = code;
-            }
-
-            if (order !== undefined) {
-                localVarQueryParameter['Order'] = order;
-            }
-
-            if (dataScope !== undefined) {
-                localVarQueryParameter['DataScope'] = dataScope;
-            }
-
-            if (remark !== undefined) {
-                localVarQueryParameter['Remark'] = remark;
-            }
-
             if (status !== undefined) {
                 localVarQueryParameter['Status'] = status;
             }
@@ -312,16 +288,11 @@ export const SysRoleApiAxiosParamCreator = function (configuration?: Configurati
          * 
          * @summary 根据角色Id获取机构Id集合
          * @param {number} id 主键Id
-         * @param {string} [name] 名称
-         * @param {string} [code] 编码
-         * @param {number} [order] 排序
-         * @param {number} [dataScope] 数据范围类型
-         * @param {string} [remark] 备注
-         * @param {number} [status] 状态
+         * @param {StatusEnum} [status] 状态
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        sysRoleOwnOrgGet: async (id: number, name?: string, code?: string, order?: number, dataScope?: number, remark?: string, status?: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
+        sysRoleOwnOrgGet: async (id: number, status?: StatusEnum, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
             // verify required parameter 'id' is not null or undefined
             if (id === null || id === undefined) {
                 throw new RequiredError('id','Required parameter id was null or undefined when calling sysRoleOwnOrgGet.');
@@ -339,26 +310,6 @@ export const SysRoleApiAxiosParamCreator = function (configuration?: Configurati
 
             // authentication Bearer required
 
-            if (name !== undefined) {
-                localVarQueryParameter['Name'] = name;
-            }
-
-            if (code !== undefined) {
-                localVarQueryParameter['Code'] = code;
-            }
-
-            if (order !== undefined) {
-                localVarQueryParameter['Order'] = order;
-            }
-
-            if (dataScope !== undefined) {
-                localVarQueryParameter['DataScope'] = dataScope;
-            }
-
-            if (remark !== undefined) {
-                localVarQueryParameter['Remark'] = remark;
-            }
-
             if (status !== undefined) {
                 localVarQueryParameter['Status'] = status;
             }
@@ -388,9 +339,6 @@ export const SysRoleApiAxiosParamCreator = function (configuration?: Configurati
          * @summary 获取角色分页列表
          * @param {string} [name] 名称
          * @param {string} [code] 编码
-         * @param {number} [dataScope] 数据范围类型
-         * @param {string} [remark] 备注
-         * @param {number} [status] 状态
          * @param {number} [page] 当前页码
          * @param {number} [pageSize] 页码容量
          * @param {string} [field] 排序字段
@@ -399,7 +347,7 @@ export const SysRoleApiAxiosParamCreator = function (configuration?: Configurati
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        sysRolePageGet: async (name?: string, code?: string, dataScope?: number, remark?: string, status?: number, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
+        sysRolePageGet: async (name?: string, code?: string, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
             const localVarPath = `/sysRole/page`;
             // use dummy base URL string because the URL constructor only accepts absolute URLs.
             const localVarUrlObj = new URL(localVarPath, 'https://example.com');
@@ -421,18 +369,6 @@ export const SysRoleApiAxiosParamCreator = function (configuration?: Configurati
                 localVarQueryParameter['Code'] = code;
             }
 
-            if (dataScope !== undefined) {
-                localVarQueryParameter['DataScope'] = dataScope;
-            }
-
-            if (remark !== undefined) {
-                localVarQueryParameter['Remark'] = remark;
-            }
-
-            if (status !== undefined) {
-                localVarQueryParameter['Status'] = status;
-            }
-
             if (page !== undefined) {
                 localVarQueryParameter['Page'] = page;
             }
@@ -633,17 +569,12 @@ export const SysRoleApiFp = function(configuration?: Configuration) {
          * 
          * @summary 根据角色Id获取菜单树(前端区分父子节点)
          * @param {number} id 主键Id
-         * @param {string} [name] 名称
-         * @param {string} [code] 编码
-         * @param {number} [order] 排序
-         * @param {number} [dataScope] 数据范围类型
-         * @param {string} [remark] 备注
-         * @param {number} [status] 状态
+         * @param {StatusEnum} [status] 状态
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async sysRoleOwnMenuGet(id: number, name?: string, code?: string, order?: number, dataScope?: number, remark?: string, status?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListSysMenu>>> {
-            const localVarAxiosArgs = await SysRoleApiAxiosParamCreator(configuration).sysRoleOwnMenuGet(id, name, code, order, dataScope, remark, status, options);
+        async sysRoleOwnMenuGet(id: number, status?: StatusEnum, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListSysMenu>>> {
+            const localVarAxiosArgs = await SysRoleApiAxiosParamCreator(configuration).sysRoleOwnMenuGet(id, status, options);
             return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                 const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                 return axios.request(axiosRequestArgs);
@@ -653,17 +584,12 @@ export const SysRoleApiFp = function(configuration?: Configuration) {
          * 
          * @summary 根据角色Id获取机构Id集合
          * @param {number} id 主键Id
-         * @param {string} [name] 名称
-         * @param {string} [code] 编码
-         * @param {number} [order] 排序
-         * @param {number} [dataScope] 数据范围类型
-         * @param {string} [remark] 备注
-         * @param {number} [status] 状态
+         * @param {StatusEnum} [status] 状态
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async sysRoleOwnOrgGet(id: number, name?: string, code?: string, order?: number, dataScope?: number, remark?: string, status?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListInt64>>> {
-            const localVarAxiosArgs = await SysRoleApiAxiosParamCreator(configuration).sysRoleOwnOrgGet(id, name, code, order, dataScope, remark, status, options);
+        async sysRoleOwnOrgGet(id: number, status?: StatusEnum, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListInt64>>> {
+            const localVarAxiosArgs = await SysRoleApiAxiosParamCreator(configuration).sysRoleOwnOrgGet(id, status, options);
             return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                 const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                 return axios.request(axiosRequestArgs);
@@ -674,9 +600,6 @@ export const SysRoleApiFp = function(configuration?: Configuration) {
          * @summary 获取角色分页列表
          * @param {string} [name] 名称
          * @param {string} [code] 编码
-         * @param {number} [dataScope] 数据范围类型
-         * @param {string} [remark] 备注
-         * @param {number} [status] 状态
          * @param {number} [page] 当前页码
          * @param {number} [pageSize] 页码容量
          * @param {string} [field] 排序字段
@@ -685,8 +608,8 @@ export const SysRoleApiFp = function(configuration?: Configuration) {
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async sysRolePageGet(name?: string, code?: string, dataScope?: number, remark?: string, status?: number, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSqlSugarPagedListSysRole>>> {
-            const localVarAxiosArgs = await SysRoleApiAxiosParamCreator(configuration).sysRolePageGet(name, code, dataScope, remark, status, page, pageSize, field, order, descStr, options);
+        async sysRolePageGet(name?: string, code?: string, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSqlSugarPagedListSysRole>>> {
+            const localVarAxiosArgs = await SysRoleApiAxiosParamCreator(configuration).sysRolePageGet(name, code, page, pageSize, field, order, descStr, options);
             return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                 const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                 return axios.request(axiosRequestArgs);
@@ -782,42 +705,29 @@ export const SysRoleApiFactory = function (configuration?: Configuration, basePa
          * 
          * @summary 根据角色Id获取菜单树(前端区分父子节点)
          * @param {number} id 主键Id
-         * @param {string} [name] 名称
-         * @param {string} [code] 编码
-         * @param {number} [order] 排序
-         * @param {number} [dataScope] 数据范围类型
-         * @param {string} [remark] 备注
-         * @param {number} [status] 状态
+         * @param {StatusEnum} [status] 状态
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async sysRoleOwnMenuGet(id: number, name?: string, code?: string, order?: number, dataScope?: number, remark?: string, status?: number, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListSysMenu>> {
-            return SysRoleApiFp(configuration).sysRoleOwnMenuGet(id, name, code, order, dataScope, remark, status, options).then((request) => request(axios, basePath));
+        async sysRoleOwnMenuGet(id: number, status?: StatusEnum, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListSysMenu>> {
+            return SysRoleApiFp(configuration).sysRoleOwnMenuGet(id, status, options).then((request) => request(axios, basePath));
         },
         /**
          * 
          * @summary 根据角色Id获取机构Id集合
          * @param {number} id 主键Id
-         * @param {string} [name] 名称
-         * @param {string} [code] 编码
-         * @param {number} [order] 排序
-         * @param {number} [dataScope] 数据范围类型
-         * @param {string} [remark] 备注
-         * @param {number} [status] 状态
+         * @param {StatusEnum} [status] 状态
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async sysRoleOwnOrgGet(id: number, name?: string, code?: string, order?: number, dataScope?: number, remark?: string, status?: number, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListInt64>> {
-            return SysRoleApiFp(configuration).sysRoleOwnOrgGet(id, name, code, order, dataScope, remark, status, options).then((request) => request(axios, basePath));
+        async sysRoleOwnOrgGet(id: number, status?: StatusEnum, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListInt64>> {
+            return SysRoleApiFp(configuration).sysRoleOwnOrgGet(id, status, options).then((request) => request(axios, basePath));
         },
         /**
          * 
          * @summary 获取角色分页列表
          * @param {string} [name] 名称
          * @param {string} [code] 编码
-         * @param {number} [dataScope] 数据范围类型
-         * @param {string} [remark] 备注
-         * @param {number} [status] 状态
          * @param {number} [page] 当前页码
          * @param {number} [pageSize] 页码容量
          * @param {string} [field] 排序字段
@@ -826,8 +736,8 @@ export const SysRoleApiFactory = function (configuration?: Configuration, basePa
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async sysRolePageGet(name?: string, code?: string, dataScope?: number, remark?: string, status?: number, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSqlSugarPagedListSysRole>> {
-            return SysRoleApiFp(configuration).sysRolePageGet(name, code, dataScope, remark, status, page, pageSize, field, order, descStr, options).then((request) => request(axios, basePath));
+        async sysRolePageGet(name?: string, code?: string, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSqlSugarPagedListSysRole>> {
+            return SysRoleApiFp(configuration).sysRolePageGet(name, code, page, pageSize, field, order, descStr, options).then((request) => request(axios, basePath));
         },
         /**
          * 
@@ -917,44 +827,31 @@ export class SysRoleApi extends BaseAPI {
      * 
      * @summary 根据角色Id获取菜单树(前端区分父子节点)
      * @param {number} id 主键Id
-     * @param {string} [name] 名称
-     * @param {string} [code] 编码
-     * @param {number} [order] 排序
-     * @param {number} [dataScope] 数据范围类型
-     * @param {string} [remark] 备注
-     * @param {number} [status] 状态
+     * @param {StatusEnum} [status] 状态
      * @param {*} [options] Override http request option.
      * @throws {RequiredError}
      * @memberof SysRoleApi
      */
-    public async sysRoleOwnMenuGet(id: number, name?: string, code?: string, order?: number, dataScope?: number, remark?: string, status?: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListSysMenu>> {
-        return SysRoleApiFp(this.configuration).sysRoleOwnMenuGet(id, name, code, order, dataScope, remark, status, options).then((request) => request(this.axios, this.basePath));
+    public async sysRoleOwnMenuGet(id: number, status?: StatusEnum, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListSysMenu>> {
+        return SysRoleApiFp(this.configuration).sysRoleOwnMenuGet(id, status, options).then((request) => request(this.axios, this.basePath));
     }
     /**
      * 
      * @summary 根据角色Id获取机构Id集合
      * @param {number} id 主键Id
-     * @param {string} [name] 名称
-     * @param {string} [code] 编码
-     * @param {number} [order] 排序
-     * @param {number} [dataScope] 数据范围类型
-     * @param {string} [remark] 备注
-     * @param {number} [status] 状态
+     * @param {StatusEnum} [status] 状态
      * @param {*} [options] Override http request option.
      * @throws {RequiredError}
      * @memberof SysRoleApi
      */
-    public async sysRoleOwnOrgGet(id: number, name?: string, code?: string, order?: number, dataScope?: number, remark?: string, status?: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListInt64>> {
-        return SysRoleApiFp(this.configuration).sysRoleOwnOrgGet(id, name, code, order, dataScope, remark, status, options).then((request) => request(this.axios, this.basePath));
+    public async sysRoleOwnOrgGet(id: number, status?: StatusEnum, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListInt64>> {
+        return SysRoleApiFp(this.configuration).sysRoleOwnOrgGet(id, status, options).then((request) => request(this.axios, this.basePath));
     }
     /**
      * 
      * @summary 获取角色分页列表
      * @param {string} [name] 名称
      * @param {string} [code] 编码
-     * @param {number} [dataScope] 数据范围类型
-     * @param {string} [remark] 备注
-     * @param {number} [status] 状态
      * @param {number} [page] 当前页码
      * @param {number} [pageSize] 页码容量
      * @param {string} [field] 排序字段
@@ -964,8 +861,8 @@ export class SysRoleApi extends BaseAPI {
      * @throws {RequiredError}
      * @memberof SysRoleApi
      */
-    public async sysRolePageGet(name?: string, code?: string, dataScope?: number, remark?: string, status?: number, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSqlSugarPagedListSysRole>> {
-        return SysRoleApiFp(this.configuration).sysRolePageGet(name, code, dataScope, remark, status, page, pageSize, field, order, descStr, options).then((request) => request(this.axios, this.basePath));
+    public async sysRolePageGet(name?: string, code?: string, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSqlSugarPagedListSysRole>> {
+        return SysRoleApiFp(this.configuration).sysRolePageGet(name, code, page, pageSize, field, order, descStr, options).then((request) => request(this.axios, this.basePath));
     }
     /**
      * 

+ 17 - 16
vue-next-admin/src/api-services/apis/sys-user-api.ts

@@ -24,6 +24,7 @@ import { AdminResultSysUser } from '../models';
 import { ChangePwdInput } from '../models';
 import { DeleteUserInput } from '../models';
 import { ResetPwdUserInput } from '../models';
+import { StatusEnum } from '../models';
 import { UpdateUserInput } from '../models';
 import { UserInput } from '../models';
 import { UserOrgInput } from '../models';
@@ -284,11 +285,11 @@ export const SysUserApiAxiosParamCreator = function (configuration?: Configurati
          * 
          * @summary 获取用户拥有机构
          * @param {number} id 主键Id
-         * @param {number} [status] 状态
+         * @param {StatusEnum} [status] 状态
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        sysUserOwnOrgGet: async (id: number, status?: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
+        sysUserOwnOrgGet: async (id: number, status?: StatusEnum, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
             // verify required parameter 'id' is not null or undefined
             if (id === null || id === undefined) {
                 throw new RequiredError('id','Required parameter id was null or undefined when calling sysUserOwnOrgGet.');
@@ -334,11 +335,11 @@ export const SysUserApiAxiosParamCreator = function (configuration?: Configurati
          * 
          * @summary 获取用户拥有角色
          * @param {number} id 主键Id
-         * @param {number} [status] 状态
+         * @param {StatusEnum} [status] 状态
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        sysUserOwnRoleGet: async (id: number, status?: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
+        sysUserOwnRoleGet: async (id: number, status?: StatusEnum, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
             // verify required parameter 'id' is not null or undefined
             if (id === null || id === undefined) {
                 throw new RequiredError('id','Required parameter id was null or undefined when calling sysUserOwnRoleGet.');
@@ -676,11 +677,11 @@ export const SysUserApiFp = function(configuration?: Configuration) {
          * 
          * @summary 获取用户拥有机构
          * @param {number} id 主键Id
-         * @param {number} [status] 状态
+         * @param {StatusEnum} [status] 状态
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async sysUserOwnOrgGet(id: number, status?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListInt64>>> {
+        async sysUserOwnOrgGet(id: number, status?: StatusEnum, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListInt64>>> {
             const localVarAxiosArgs = await SysUserApiAxiosParamCreator(configuration).sysUserOwnOrgGet(id, status, options);
             return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                 const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
@@ -691,11 +692,11 @@ export const SysUserApiFp = function(configuration?: Configuration) {
          * 
          * @summary 获取用户拥有角色
          * @param {number} id 主键Id
-         * @param {number} [status] 状态
+         * @param {StatusEnum} [status] 状态
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async sysUserOwnRoleGet(id: number, status?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListInt64>>> {
+        async sysUserOwnRoleGet(id: number, status?: StatusEnum, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListInt64>>> {
             const localVarAxiosArgs = await SysUserApiAxiosParamCreator(configuration).sysUserOwnRoleGet(id, status, options);
             return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                 const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
@@ -838,22 +839,22 @@ export const SysUserApiFactory = function (configuration?: Configuration, basePa
          * 
          * @summary 获取用户拥有机构
          * @param {number} id 主键Id
-         * @param {number} [status] 状态
+         * @param {StatusEnum} [status] 状态
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async sysUserOwnOrgGet(id: number, status?: number, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListInt64>> {
+        async sysUserOwnOrgGet(id: number, status?: StatusEnum, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListInt64>> {
             return SysUserApiFp(configuration).sysUserOwnOrgGet(id, status, options).then((request) => request(axios, basePath));
         },
         /**
          * 
          * @summary 获取用户拥有角色
          * @param {number} id 主键Id
-         * @param {number} [status] 状态
+         * @param {StatusEnum} [status] 状态
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async sysUserOwnRoleGet(id: number, status?: number, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListInt64>> {
+        async sysUserOwnRoleGet(id: number, status?: StatusEnum, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListInt64>> {
             return SysUserApiFp(configuration).sysUserOwnRoleGet(id, status, options).then((request) => request(axios, basePath));
         },
         /**
@@ -983,24 +984,24 @@ export class SysUserApi extends BaseAPI {
      * 
      * @summary 获取用户拥有机构
      * @param {number} id 主键Id
-     * @param {number} [status] 状态
+     * @param {StatusEnum} [status] 状态
      * @param {*} [options] Override http request option.
      * @throws {RequiredError}
      * @memberof SysUserApi
      */
-    public async sysUserOwnOrgGet(id: number, status?: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListInt64>> {
+    public async sysUserOwnOrgGet(id: number, status?: StatusEnum, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListInt64>> {
         return SysUserApiFp(this.configuration).sysUserOwnOrgGet(id, status, options).then((request) => request(this.axios, this.basePath));
     }
     /**
      * 
      * @summary 获取用户拥有角色
      * @param {number} id 主键Id
-     * @param {number} [status] 状态
+     * @param {StatusEnum} [status] 状态
      * @param {*} [options] Override http request option.
      * @throws {RequiredError}
      * @memberof SysUserApi
      */
-    public async sysUserOwnRoleGet(id: number, status?: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListInt64>> {
+    public async sysUserOwnRoleGet(id: number, status?: StatusEnum, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListInt64>> {
         return SysUserApiFp(this.configuration).sysUserOwnRoleGet(id, status, options).then((request) => request(this.axios, this.basePath));
     }
     /**

+ 46 - 8
vue-next-admin/src/api-services/models/add-role-input.ts

@@ -11,6 +11,8 @@
  * https://github.com/swagger-api/swagger-codegen.git
  * Do not edit the class manually.
  */
+import { DataScopeEnum } from './data-scope-enum';
+import { StatusEnum } from './status-enum';
 /**
  * 
  * @export
@@ -18,11 +20,47 @@
  */
 export interface AddRoleInput {
     /**
-     * 主键Id
+     * 雪花Id
      * @type {number}
      * @memberof AddRoleInput
      */
-    id: number;
+    id?: number;
+    /**
+     * 创建时间
+     * @type {Date}
+     * @memberof AddRoleInput
+     */
+    createTime?: Date | null;
+    /**
+     * 更新时间
+     * @type {Date}
+     * @memberof AddRoleInput
+     */
+    updateTime?: Date | null;
+    /**
+     * 创建者Id
+     * @type {number}
+     * @memberof AddRoleInput
+     */
+    createUserId?: number | null;
+    /**
+     * 修改者Id
+     * @type {number}
+     * @memberof AddRoleInput
+     */
+    updateUserId?: number | null;
+    /**
+     * 软删除
+     * @type {boolean}
+     * @memberof AddRoleInput
+     */
+    isDelete?: boolean;
+    /**
+     * 租户Id
+     * @type {number}
+     * @memberof AddRoleInput
+     */
+    tenantId?: number | null;
     /**
      * 编码
      * @type {string}
@@ -36,11 +74,11 @@ export interface AddRoleInput {
      */
     order?: number;
     /**
-     * 数据范围类型
-     * @type {number}
+     * 
+     * @type {DataScopeEnum}
      * @memberof AddRoleInput
      */
-    dataScope?: number;
+    dataScope?: DataScopeEnum;
     /**
      * 备注
      * @type {string}
@@ -48,11 +86,11 @@ export interface AddRoleInput {
      */
     remark?: string | null;
     /**
-     * 状态
-     * @type {number}
+     * 
+     * @type {StatusEnum}
      * @memberof AddRoleInput
      */
-    status?: number;
+    status?: StatusEnum;
     /**
      * 名称
      * @type {string}

+ 4 - 33
vue-next-admin/src/api-services/models/role-input.ts

@@ -11,6 +11,7 @@
  * https://github.com/swagger-api/swagger-codegen.git
  * Do not edit the class manually.
  */
+import { StatusEnum } from './status-enum';
 /**
  * 
  * @export
@@ -24,39 +25,9 @@ export interface RoleInput {
      */
     id: number;
     /**
-     * 名称
-     * @type {string}
+     * 
+     * @type {StatusEnum}
      * @memberof RoleInput
      */
-    name?: string | null;
-    /**
-     * 编码
-     * @type {string}
-     * @memberof RoleInput
-     */
-    code?: string | null;
-    /**
-     * 排序
-     * @type {number}
-     * @memberof RoleInput
-     */
-    order?: number;
-    /**
-     * 数据范围类型
-     * @type {number}
-     * @memberof RoleInput
-     */
-    dataScope?: number;
-    /**
-     * 备注
-     * @type {string}
-     * @memberof RoleInput
-     */
-    remark?: string | null;
-    /**
-     * 状态
-     * @type {number}
-     * @memberof RoleInput
-     */
-    status?: number;
+    status?: StatusEnum;
 }

+ 46 - 8
vue-next-admin/src/api-services/models/update-role-input.ts

@@ -11,6 +11,8 @@
  * https://github.com/swagger-api/swagger-codegen.git
  * Do not edit the class manually.
  */
+import { DataScopeEnum } from './data-scope-enum';
+import { StatusEnum } from './status-enum';
 /**
  * 
  * @export
@@ -18,11 +20,47 @@
  */
 export interface UpdateRoleInput {
     /**
-     * 主键Id
+     * 雪花Id
      * @type {number}
      * @memberof UpdateRoleInput
      */
-    id: number;
+    id?: number;
+    /**
+     * 创建时间
+     * @type {Date}
+     * @memberof UpdateRoleInput
+     */
+    createTime?: Date | null;
+    /**
+     * 更新时间
+     * @type {Date}
+     * @memberof UpdateRoleInput
+     */
+    updateTime?: Date | null;
+    /**
+     * 创建者Id
+     * @type {number}
+     * @memberof UpdateRoleInput
+     */
+    createUserId?: number | null;
+    /**
+     * 修改者Id
+     * @type {number}
+     * @memberof UpdateRoleInput
+     */
+    updateUserId?: number | null;
+    /**
+     * 软删除
+     * @type {boolean}
+     * @memberof UpdateRoleInput
+     */
+    isDelete?: boolean;
+    /**
+     * 租户Id
+     * @type {number}
+     * @memberof UpdateRoleInput
+     */
+    tenantId?: number | null;
     /**
      * 编码
      * @type {string}
@@ -36,11 +74,11 @@ export interface UpdateRoleInput {
      */
     order?: number;
     /**
-     * 数据范围类型
-     * @type {number}
+     * 
+     * @type {DataScopeEnum}
      * @memberof UpdateRoleInput
      */
-    dataScope?: number;
+    dataScope?: DataScopeEnum;
     /**
      * 备注
      * @type {string}
@@ -48,11 +86,11 @@ export interface UpdateRoleInput {
      */
     remark?: string | null;
     /**
-     * 状态
-     * @type {number}
+     * 
+     * @type {StatusEnum}
      * @memberof UpdateRoleInput
      */
-    status?: number;
+    status?: StatusEnum;
     /**
      * 名称
      * @type {string}

+ 4 - 3
vue-next-admin/src/api-services/models/user-input.ts

@@ -11,6 +11,7 @@
  * https://github.com/swagger-api/swagger-codegen.git
  * Do not edit the class manually.
  */
+import { StatusEnum } from './status-enum';
 /**
  * 
  * @export
@@ -24,9 +25,9 @@ export interface UserInput {
      */
     id: number;
     /**
-     * 状态
-     * @type {number}
+     * 
+     * @type {StatusEnum}
      * @memberof UserInput
      */
-    status?: number;
+    status?: StatusEnum;
 }

+ 9 - 11
vue-next-admin/src/views/system/menu/index.vue

@@ -64,16 +64,14 @@
         </el-table-column>
         <el-table-column label="操作" width="80" fixed="right" align="center" show-overflow-tooltip>
           <template #default="scope">
-            <el-button size="small" text type="primary" @click="openEditMenu(scope.row)">
-              <el-icon>
-                <ele-Edit />
-              </el-icon>
-            </el-button>
-            <el-button size="small" text type="primary" @click="delMenu(scope.row)">
-              <el-icon>
-                <ele-Delete />
-              </el-icon>
-            </el-button>
+            <el-tooltip content="菜单编辑">
+              <el-button icon="ele-Edit" size="small" text type="primary" @click="openEditMenu(scope.row)">
+              </el-button>
+            </el-tooltip>
+            <el-tooltip content="菜单删除">
+              <el-button icon="ele-Delete" size="small" text type="primary" @click="delMenu(scope.row)">
+              </el-button>
+            </el-tooltip>
           </template>
         </el-table-column>
       </el-table>
@@ -87,8 +85,8 @@ import { ref, toRefs, reactive, defineComponent, onMounted, getCurrentInstance,
 import { ElMessageBox, ElMessage } from 'element-plus';
 import EditMenu from '/@/views/system/menu/component/editMenu.vue';
 
-import { SysMenuApi } from '/@/api-services';
 import { getAPI } from '/@/utils/axios-utils';
+import { SysMenuApi } from '/@/api-services';
 
 export default defineComponent({
   name: 'sysMenu',

+ 1 - 1
vue-next-admin/src/views/system/org/component/orgTree.vue

@@ -39,7 +39,7 @@ import type { ElTree } from 'element-plus';
 import { Search, MoreFilled } from '@element-plus/icons-vue';
 
 import { getAPI } from '/@/utils/axios-utils';
-import { SysOrgApi } from '/@/api-services/apis/sys-org-api';
+import { SysOrgApi } from '/@/api-services/api';
 
 interface Tree {
   id: number;

+ 11 - 11
vue-next-admin/src/views/system/org/index.vue

@@ -57,16 +57,16 @@
 						<el-table-column prop="remark" label="备注" show-overflow-tooltip></el-table-column>
 						<el-table-column label="操作" width="80" fixed="right" align="center" show-overflow-tooltip>
 							<template #default="scope">
-								<el-button size="small" text type="primary" @click="openEditOrg(scope.row)">
-									<el-icon>
-										<ele-Edit />
-									</el-icon>
-								</el-button>
-								<el-button size="small" text type="primary" @click="delOrg(scope.row)">
-									<el-icon>
-										<ele-Delete />
-									</el-icon>
-								</el-button>
+								<el-tooltip content="机构编辑">
+									<el-button icon="ele-Edit" size="small" text type="primary"
+										@click="openEditOrg(scope.row)">
+									</el-button>
+								</el-tooltip>
+								<el-tooltip content="机构删除">
+									<el-button icon="ele-Delete" size="small" text type="primary"
+										@click="delOrg(scope.row)">
+									</el-button>
+								</el-tooltip>
 							</template>
 						</el-table-column>
 					</el-table>
@@ -84,7 +84,7 @@ import OrgTree from '/@/views/system/org/component/orgTree.vue';
 import EditOrg from '/@/views/system/org/component/editOrg.vue';
 
 import { getAPI } from '/@/utils/axios-utils';
-import { SysOrgApi } from '/@/api-services/apis/sys-org-api';
+import { SysOrgApi } from '/@/api-services/api';
 
 export default defineComponent({
 	name: 'sysOrg',

+ 8 - 10
vue-next-admin/src/views/system/pos/index.vue

@@ -48,16 +48,14 @@
 				<el-table-column prop="remark" label="备注" show-overflow-tooltip></el-table-column>
 				<el-table-column label="操作" width="80" fixed="right" align="center" show-overflow-tooltip>
 					<template #default="scope">
-						<el-button size="small" text type="primary" @click="openEditPos(scope.row)">
-							<el-icon>
-								<ele-Edit />
-							</el-icon>
-						</el-button>
-						<el-button size="small" text type="primary" @click="delPos(scope.row)">
-							<el-icon>
-								<ele-Delete />
-							</el-icon>
-						</el-button>
+						<el-tooltip content="职位编辑">
+							<el-button icon="ele-Edit" size="small" text type="primary" @click="openEditPos(scope.row)">
+							</el-button>
+						</el-tooltip>
+						<el-tooltip content="职位删除">
+							<el-button icon="ele-Delete" size="small" text type="primary" @click="delPos(scope.row)">
+							</el-button>
+						</el-tooltip>
 					</template>
 				</el-table-column>
 			</el-table>

+ 0 - 240
vue-next-admin/src/views/system/role/component/addRole.vue

@@ -1,240 +0,0 @@
-<template>
-	<div class="system-add-role-container">
-		<el-dialog title="新增角色" v-model="isShowDialog" width="769px">
-			<el-form :model="ruleForm" size="default" label-width="90px">
-				<el-row :gutter="35">
-					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
-						<el-form-item label="角色名称">
-							<el-input v-model="ruleForm.roleName" placeholder="请输入角色名称" clearable></el-input>
-						</el-form-item>
-					</el-col>
-					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
-						<el-form-item label="角色标识">
-							<template #label>
-								<el-tooltip effect="dark" content="用于 `router/route.ts` meta.roles" placement="top-start">
-									<span>角色标识</span>
-								</el-tooltip>
-							</template>
-							<el-input v-model="ruleForm.roleSign" placeholder="请输入角色标识" clearable></el-input>
-						</el-form-item>
-					</el-col>
-					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
-						<el-form-item label="排序">
-							<el-input-number v-model="ruleForm.sort" :min="0" :max="999" controls-position="right" placeholder="请输入排序" class="w100" />
-						</el-form-item>
-					</el-col>
-					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
-						<el-form-item label="角色状态">
-							<el-switch v-model="ruleForm.status" inline-prompt active-text="启" inactive-text="禁"></el-switch>
-						</el-form-item>
-					</el-col>
-					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
-						<el-form-item label="角色描述">
-							<el-input v-model="ruleForm.describe" type="textarea" placeholder="请输入角色描述" maxlength="150"></el-input>
-						</el-form-item>
-					</el-col>
-					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
-						<el-form-item label="菜单权限">
-							<el-tree :data="menuData" :props="menuProps" show-checkbox class="menu-data-tree" />
-						</el-form-item>
-					</el-col>
-				</el-row>
-			</el-form>
-			<template #footer>
-				<span class="dialog-footer">
-					<el-button @click="onCancel" size="default">取 消</el-button>
-					<el-button type="primary" @click="onSubmit" size="default">新 增</el-button>
-				</span>
-			</template>
-		</el-dialog>
-	</div>
-</template>
-
-<script lang="ts">
-import { reactive, toRefs, defineComponent } from 'vue';
-
-// 定义接口来定义对象的类型
-interface MenuDataTree {
-	id: number;
-	label: string;
-	children?: MenuDataTree[];
-}
-interface RoleState {
-	isShowDialog: boolean;
-	ruleForm: {
-		roleName: string;
-		roleSign: string;
-		sort: number;
-		status: boolean;
-		describe: string;
-	};
-	menuData: Array<MenuDataTree>;
-	menuProps: {
-		children: string;
-		label: string;
-	};
-}
-
-export default defineComponent({
-	name: 'systemAddRole',
-	setup() {
-		const state = reactive<RoleState>({
-			isShowDialog: false,
-			ruleForm: {
-				roleName: '', // 角色名称
-				roleSign: '', // 角色标识
-				sort: 0, // 排序
-				status: true, // 角色状态
-				describe: '', // 角色描述
-			},
-			menuData: [],
-			menuProps: {
-				children: 'children',
-				label: 'label',
-			},
-		});
-		// 打开弹窗
-		const openDialog = () => {
-			state.isShowDialog = true;
-			getMenuData();
-		};
-		// 关闭弹窗
-		const closeDialog = () => {
-			state.isShowDialog = false;
-		};
-		// 取消
-		const onCancel = () => {
-			closeDialog();
-		};
-		// 新增
-		const onSubmit = () => {
-			closeDialog();
-		};
-		// 获取菜单结构数据
-		const getMenuData = () => {
-			state.menuData = [
-				{
-					id: 1,
-					label: '系统管理',
-					children: [
-						{
-							id: 11,
-							label: '菜单管理',
-							children: [
-								{
-									id: 111,
-									label: '菜单新增',
-								},
-								{
-									id: 112,
-									label: '菜单修改',
-								},
-								{
-									id: 113,
-									label: '菜单删除',
-								},
-								{
-									id: 114,
-									label: '菜单查询',
-								},
-							],
-						},
-						{
-							id: 12,
-							label: '角色管理',
-							children: [
-								{
-									id: 121,
-									label: '角色新增',
-								},
-								{
-									id: 122,
-									label: '角色修改',
-								},
-								{
-									id: 123,
-									label: '角色删除',
-								},
-								{
-									id: 124,
-									label: '角色查询',
-								},
-							],
-						},
-						{
-							id: 13,
-							label: '用户管理',
-							children: [
-								{
-									id: 131,
-									label: '用户新增',
-								},
-								{
-									id: 132,
-									label: '用户修改',
-								},
-								{
-									id: 133,
-									label: '用户删除',
-								},
-								{
-									id: 134,
-									label: '用户查询',
-								},
-							],
-						},
-					],
-				},
-				{
-					id: 2,
-					label: '权限管理',
-					children: [
-						{
-							id: 21,
-							label: '前端控制',
-							children: [
-								{
-									id: 211,
-									label: '页面权限',
-								},
-								{
-									id: 212,
-									label: '页面权限',
-								},
-							],
-						},
-						{
-							id: 22,
-							label: '后端控制',
-							children: [
-								{
-									id: 221,
-									label: '页面权限',
-								},
-							],
-						},
-					],
-				},
-			];
-		};
-		return {
-			openDialog,
-			closeDialog,
-			onCancel,
-			onSubmit,
-			...toRefs(state),
-		};
-	},
-});
-</script>
-
-<style scoped lang="scss">
-.system-add-role-container {
-	.menu-data-tree {
-		width: 100%;
-		border: 1px solid var(--el-border-color);
-		border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
-		padding: 5px;
-	}
-}
-</style>

+ 72 - 188
vue-next-admin/src/views/system/role/component/editRole.vue

@@ -1,49 +1,49 @@
 <template>
-	<div class="system-edit-role-container">
-		<el-dialog title="修改角色" v-model="isShowDialog" width="769px">
-			<el-form :model="ruleForm" size="default" label-width="90px">
+	<div class="sys-role-container">
+		<el-dialog v-model="isShowDialog" width="500px">
+			<template #header>
+				<div style="font-size: large" v-drag="['.el-dialog','.el-dialog__header']">
+					{{ title }}
+				</div>
+			</template>
+			<el-form :model="ruleForm" :rules="ruleRules" ref="ruleFormRef" size="default" label-width="80px">
 				<el-row :gutter="35">
-					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
-						<el-form-item label="角色名称">
-							<el-input v-model="ruleForm.roleName" placeholder="请输入角色名称" clearable></el-input>
+					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
+						<el-form-item label="角色名称" prop="name">
+							<el-input v-model="ruleForm.name" placeholder="角色名称" clearable></el-input>
 						</el-form-item>
 					</el-col>
-					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
-						<el-form-item label="角色标识">
-							<template #label>
-								<el-tooltip effect="dark" content="用于 `router/route.ts` meta.roles" placement="top-start">
-									<span>角色标识</span>
-								</el-tooltip>
-							</template>
-							<el-input v-model="ruleForm.roleSign" placeholder="请输入角色标识" clearable></el-input>
+					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
+						<el-form-item label="角色编码" prop="code">
+							<el-input v-model="ruleForm.code" placeholder="角色编码" clearable></el-input>
 						</el-form-item>
 					</el-col>
-					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
+					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
 						<el-form-item label="排序">
-							<el-input-number v-model="ruleForm.sort" :min="0" :max="999" controls-position="right" placeholder="请输入排序" class="w100" />
-						</el-form-item>
-					</el-col>
-					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
-						<el-form-item label="角色状态">
-							<el-switch v-model="ruleForm.status" inline-prompt active-text="启" inactive-text="禁"></el-switch>
+							<el-input-number v-model="ruleForm.order" controls-position="right" placeholder="排序"
+								class="w100" />
 						</el-form-item>
 					</el-col>
 					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
-						<el-form-item label="角色描述">
-							<el-input v-model="ruleForm.describe" type="textarea" placeholder="请输入角色描述" maxlength="150"></el-input>
+						<el-form-item label="是否启用">
+							<el-radio-group v-model="ruleForm.status">
+								<el-radio :label="1">启用</el-radio>
+								<el-radio :label="2">不启用</el-radio>
+							</el-radio-group>
 						</el-form-item>
 					</el-col>
 					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
-						<el-form-item label="菜单权限">
-							<el-tree :data="menuData" :props="menuProps" :default-checked-keys="[112, 113]" node-key="id" show-checkbox class="menu-data-tree" />
+						<el-form-item label="备注">
+							<el-input v-model="ruleForm.remark" placeholder="请输入备注内容" clearable type="textarea">
+							</el-input>
 						</el-form-item>
 					</el-col>
 				</el-row>
 			</el-form>
 			<template #footer>
 				<span class="dialog-footer">
-					<el-button @click="onCancel" size="default">取 消</el-button>
-					<el-button type="primary" @click="onSubmit" size="default">修 改</el-button>
+					<el-button @click="cancel" size="default">取 消</el-button>
+					<el-button type="primary" @click="submit" size="default">确 定</el-button>
 				</span>
 			</template>
 		</el-dialog>
@@ -51,192 +51,76 @@
 </template>
 
 <script lang="ts">
-import { reactive, toRefs, defineComponent } from 'vue';
+import { reactive, toRefs, defineComponent, getCurrentInstance, ref, unref } from 'vue';
 
-// 定义接口来定义对象的类型
-interface MenuDataTree {
-	id: number;
-	label: string;
-	children?: MenuDataTree[];
-}
-interface DialogRow {
-	roleName: string;
-	roleSign: string;
-	sort: number;
-	status: boolean;
-	describe: string;
-}
-interface RoleState {
-	isShowDialog: boolean;
-	ruleForm: DialogRow;
-	menuData: Array<MenuDataTree>;
-	menuProps: {
-		children: string;
-		label: string;
-	};
-}
+import { getAPI } from '/@/utils/axios-utils';
+import { SysRoleApi } from '/@/api-services/api';
 
 export default defineComponent({
-	name: 'systemEditRole',
+	name: 'sysEditRole',
+	components: {},
+	props: {
+		// 弹窗标题
+		title: {
+			type: String,
+			default: () => "",
+		},
+	},
 	setup() {
-		const state = reactive<RoleState>({
+		const { proxy } = getCurrentInstance() as any;
+		const ruleFormRef = ref<HTMLElement | null>(null);
+		const state = reactive({
 			isShowDialog: false,
 			ruleForm: {
-				roleName: '', // 角色名称
-				roleSign: '', // 角色标识
-				sort: 0, // 排序
-				status: true, // 角色状态
-				describe: '', // 角色描述
+				id: 0, // Id
+				name: '', // 角色名称
+				code: '', // 角色编码
+				order: 10, // 排序
+				status: 1, // 是否启用
+				remark: '', // 备注
 			},
-			menuData: [],
-			menuProps: {
-				children: 'children',
-				label: 'label',
+			ruleRules: {
+				name: [{ required: true, message: "角色名称不能为空", trigger: "blur" }],
+				code: [{ required: true, message: "角色编码不能为空", trigger: "blur" }],
 			},
 		});
 		// 打开弹窗
-		const openDialog = (row: DialogRow) => {
+		const openDialog = (row: any) => {
 			state.ruleForm = row;
 			state.isShowDialog = true;
-			getMenuData();
 		};
 		// 关闭弹窗
 		const closeDialog = () => {
+			proxy.mittBus.emit("submitRefresh");
 			state.isShowDialog = false;
 		};
 		// 取消
-		const onCancel = () => {
-			closeDialog();
-		};
-		// 新增
-		const onSubmit = () => {
-			closeDialog();
+		const cancel = () => {
+			state.isShowDialog = false;
 		};
-		// 获取菜单结构数据
-		const getMenuData = () => {
-			state.menuData = [
-				{
-					id: 1,
-					label: '系统管理',
-					children: [
-						{
-							id: 11,
-							label: '菜单管理',
-							children: [
-								{
-									id: 111,
-									label: '菜单新增',
-								},
-								{
-									id: 112,
-									label: '菜单修改',
-								},
-								{
-									id: 113,
-									label: '菜单删除',
-								},
-								{
-									id: 114,
-									label: '菜单查询',
-								},
-							],
-						},
-						{
-							id: 12,
-							label: '角色管理',
-							children: [
-								{
-									id: 121,
-									label: '角色新增',
-								},
-								{
-									id: 122,
-									label: '角色修改',
-								},
-								{
-									id: 123,
-									label: '角色删除',
-								},
-								{
-									id: 124,
-									label: '角色查询',
-								},
-							],
-						},
-						{
-							id: 13,
-							label: '用户管理',
-							children: [
-								{
-									id: 131,
-									label: '用户新增',
-								},
-								{
-									id: 132,
-									label: '用户修改',
-								},
-								{
-									id: 133,
-									label: '用户删除',
-								},
-								{
-									id: 134,
-									label: '用户查询',
-								},
-							],
-						},
-					],
-				},
-				{
-					id: 2,
-					label: '权限管理',
-					children: [
-						{
-							id: 21,
-							label: '前端控制',
-							children: [
-								{
-									id: 211,
-									label: '页面权限',
-								},
-								{
-									id: 212,
-									label: '页面权限',
-								},
-							],
-						},
-						{
-							id: 22,
-							label: '后端控制',
-							children: [
-								{
-									id: 221,
-									label: '页面权限',
-								},
-							],
-						},
-					],
-				},
-			];
+		// 提交
+		const submit = () => {
+			const formWrap = unref(ruleFormRef) as any;
+			if (!formWrap) return;
+
+			formWrap.validate(async () => {
+				if (state.ruleForm.id != undefined && state.ruleForm.id > 0) {
+					await getAPI(SysRoleApi).sysRoleUpdatePost(state.ruleForm);
+				}
+				else {
+					await getAPI(SysRoleApi).sysRoleAddPost(state.ruleForm);
+				}
+				closeDialog();
+			})
 		};
 		return {
+			ruleFormRef,
 			openDialog,
 			closeDialog,
-			onCancel,
-			onSubmit,
+			cancel,
+			submit,
 			...toRefs(state),
 		};
 	},
 });
 </script>
-
-<style scoped lang="scss">
-.system-edit-role-container {
-	.menu-data-tree {
-		width: 100%;
-		border: 1px solid var(--el-border-color);
-		border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
-		padding: 5px;
-	}
-}
-</style>

+ 144 - 119
vue-next-admin/src/views/system/role/index.vue

@@ -1,162 +1,187 @@
 <template>
-	<div class="system-role-container">
+	<div class="sys-role-container">
 		<el-card shadow="hover">
-			<div class="system-user-search mb15">
-				<el-input size="default" placeholder="请输入角色名称" style="max-width: 180px"> </el-input>
-				<el-button size="default" type="primary" class="ml10">
-					<el-icon>
-						<ele-Search />
-					</el-icon>
-					查询
-				</el-button>
-				<el-button size="default" type="success" class="ml10" @click="onOpenAddRole">
-					<el-icon>
-						<ele-FolderAdd />
-					</el-icon>
-					新增角色
-				</el-button>
-			</div>
-			<el-table :data="tableData.data" style="width: 100%">
-				<el-table-column type="index" label="序号" width="60" />
-				<el-table-column prop="roleName" label="角色名称" show-overflow-tooltip></el-table-column>
-				<el-table-column prop="roleSign" label="角色标识" show-overflow-tooltip></el-table-column>
-				<el-table-column prop="sort" label="排序" show-overflow-tooltip></el-table-column>
-				<el-table-column prop="status" label="角色状态" show-overflow-tooltip>
+			<el-form :model="queryParams" ref="queryForm" :inline="true">
+				<el-form-item label="角色名称" prop="name">
+					<el-input placeholder="角色名称" clearable @keyup.enter="handleQuery" v-model="queryParams.name" />
+				</el-form-item>
+				<el-form-item label="角色编码" prop="code">
+					<el-input placeholder="角色编码" clearable @keyup.enter="handleQuery" v-model="queryParams.code" />
+				</el-form-item>
+				<el-form-item>
+					<el-button @click="resetQuery">
+						<el-icon>
+							<ele-Refresh />
+						</el-icon>
+						重置
+					</el-button>
+					<el-button type="primary" @click="handleQuery">
+						<el-icon>
+							<ele-Search />
+						</el-icon>
+						查询
+					</el-button>
+					<el-button @click="openAddRole">
+						<el-icon>
+							<ele-Plus />
+						</el-icon>
+						新增
+					</el-button>
+				</el-form-item>
+			</el-form>
+		</el-card>
+
+		<el-card shadow="hover" style="margin-top: 5px;">
+			<el-table :data="roleData" style="width: 100%;" v-loading="loading" border>
+				<el-table-column type="index" label="序号" width="55" align="center" fixed />
+				<el-table-column prop="name" label="角色名称" show-overflow-tooltip>
+				</el-table-column>
+				<el-table-column prop="code" label="角色编码" show-overflow-tooltip></el-table-column>
+				<el-table-column prop="order" label="排序" width="70" align="center" show-overflow-tooltip>
+				</el-table-column>
+				<el-table-column label="状态" width="70" align="center" show-overflow-tooltip>
 					<template #default="scope">
-						<el-tag type="success" v-if="scope.row.status">启用</el-tag>
-						<el-tag type="info" v-else>禁用</el-tag>
+						<el-tag type="success" v-if="scope.row.status === 1">启用</el-tag>
+						<el-tag type="danger" v-else>禁用</el-tag>
 					</template>
 				</el-table-column>
-				<el-table-column prop="describe" label="角色描述" show-overflow-tooltip></el-table-column>
-				<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip></el-table-column>
-				<el-table-column label="操作" width="100">
+				<el-table-column prop="createTime" label="修改时间" align="center" show-overflow-tooltip></el-table-column>
+				<el-table-column prop="remark" label="备注" show-overflow-tooltip></el-table-column>
+				<el-table-column label="操作" width="80" fixed="right" align="center" show-overflow-tooltip>
 					<template #default="scope">
-						<el-button :disabled="scope.row.roleName === '超级管理员'" size="small" text type="primary" @click="onOpenEditRole(scope.row)"
-							>修改</el-button
-						>
-						<el-button :disabled="scope.row.roleName === '超级管理员'" size="small" text type="primary" @click="onRowDel(scope.row)">删除</el-button>
+						<el-tooltip content="角色编辑">
+							<el-button icon="ele-Edit" size="small" text type="primary"
+								@click="openEditRole(scope.row)">
+							</el-button>
+						</el-tooltip>
+						<el-dropdown>
+							<span style="color: var(--el-color-primary);padding-top: 6px;">
+								<el-icon>
+									<ele-MoreFilled />
+								</el-icon>
+							</span>
+							<template #dropdown>
+								<el-dropdown-menu>
+									<el-tooltip content="角色编辑">
+										<el-dropdown-item icon="ele-OfficeBuilding" @click="delRole(scope.row)">
+											数据范围
+										</el-dropdown-item>
+									</el-tooltip>
+									<el-dropdown-item icon="ele-Delete" @click="delRole(scope.row)">
+										删除角色
+									</el-dropdown-item>
+								</el-dropdown-menu>
+							</template>
+						</el-dropdown>
 					</template>
 				</el-table-column>
 			</el-table>
-			<el-pagination
-				@size-change="onHandleSizeChange"
-				@current-change="onHandleCurrentChange"
-				class="mt15"
-				:pager-count="5"
-				:page-sizes="[10, 20, 30]"
-				v-model:current-page="tableData.param.pageNum"
-				background
-				v-model:page-size="tableData.param.pageSize"
-				layout="total, sizes, prev, pager, next, jumper"
-				:total="tableData.total"
-			>
-			</el-pagination>
+			<el-pagination v-model:currentPage="tableParams.page" v-model:page-size="tableParams.pageSize"
+				:total="tableParams.total" :page-sizes="[10, 20, 50, 100]" small background
+				@size-change="handleSizeChange" @current-change="handleCurrentChange"
+				layout="total, sizes, prev, pager, next, jumper" />
 		</el-card>
-		<AddRole ref="addRoleRef" />
-		<EditRole ref="editRoleRef" />
+
+		<EditRole ref="editRoleRef" :title="editRoleTitle" />
 	</div>
 </template>
 
 <script lang="ts">
-import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue';
+import { ref, toRefs, reactive, onMounted, defineComponent, getCurrentInstance, onUnmounted } from 'vue';
 import { ElMessageBox, ElMessage } from 'element-plus';
-import AddRole from '/@/views/system/role/component/addRole.vue';
 import EditRole from '/@/views/system/role/component/editRole.vue';
 
-// 定义接口来定义对象的类型
-interface TableData {
-	roleName: string;
-	roleSign: string;
-	describe: string;
-	sort: number;
-	status: boolean;
-	createTime: string;
-}
-interface TableDataState {
-	tableData: {
-		data: Array<TableData>;
-		total: number;
-		loading: boolean;
-		param: {
-			pageNum: number;
-			pageSize: number;
-		};
-	};
-}
+import { getAPI } from '/@/utils/axios-utils';
+import { SysRoleApi } from '/@/api-services/api';
 
 export default defineComponent({
 	name: 'sysRole',
-	components: { AddRole, EditRole },
+	components: { EditRole },
 	setup() {
-		const addRoleRef = ref();
+		const { proxy } = getCurrentInstance() as any;
 		const editRoleRef = ref();
-		const state = reactive<TableDataState>({
-			tableData: {
-				data: [],
-				total: 0,
-				loading: false,
-				param: {
-					pageNum: 1,
-					pageSize: 10,
-				},
+		const state = reactive({
+			loading: true,
+			roleData: [] as any,
+			queryParams: {
+				name: undefined,
+				code: undefined,
+
 			},
+			tableParams: {
+				page: 1,
+				pageSize: 10,
+				total: 0 as any,
+			},
+			editRoleTitle: "",
+		});
+		onMounted(async () => {
+			handleQuery();
+
+			proxy.mittBus.on("submitRefresh", () => {
+				handleQuery();
+			});
 		});
-		// 初始化表格数据
-		const initTableData = () => {
-			const data: Array<TableData> = [];
-			for (let i = 0; i < 2; i++) {
-				data.push({
-					roleName: i === 0 ? '超级管理员' : '普通用户',
-					roleSign: i === 0 ? 'admin' : 'common',
-					describe: `测试角色${i + 1}`,
-					sort: i,
-					status: true,
-					createTime: new Date().toLocaleString(),
-				});
-			}
-			state.tableData.data = data;
-			state.tableData.total = state.tableData.data.length;
+		onUnmounted(() => {
+			proxy.mittBus.off("submitRefresh");
+		});
+		// 查询操作
+		const handleQuery = async () => {
+			state.loading = true;
+			var res = await getAPI(SysRoleApi).sysRolePageGet(state.queryParams.name, state.queryParams.code, state.tableParams.page, state.tableParams.pageSize);
+			state.roleData = res.data.result?.items;
+			state.tableParams.total = res.data.result?.total;
+			state.loading = false;
+		};
+		// 重置操作
+		const resetQuery = () => {
+			state.queryParams.name = undefined;
+			state.queryParams.code = undefined;
+			handleQuery();
 		};
-		// 打开新增角色弹窗
-		const onOpenAddRole = () => {
-			addRoleRef.value.openDialog();
+		// 打开新增页面
+		const openAddRole = () => {
+			state.editRoleTitle = "添加角色";
+			editRoleRef.value.openDialog({});
 		};
-		// 打开修改角色弹窗
-		const onOpenEditRole = (row: Object) => {
+		// 打开编辑页面
+		const openEditRole = (row: any) => {
+			state.editRoleTitle = "编辑角色";
 			editRoleRef.value.openDialog(row);
 		};
-		// 删除角色
-		const onRowDel = (row: any) => {
-			ElMessageBox.confirm(`此操作将永久删除角色名称:“${row.roleName}”,是否继续?`, '提示', {
-				confirmButtonText: '确',
+		// 删除
+		const delRole = (row: any) => {
+			ElMessageBox.confirm(`确定删角色:【${row.name}】?`, '提示', {
+				confirmButtonText: '确',
 				cancelButtonText: '取消',
 				type: 'warning',
 			})
-				.then(() => {
+				.then(async () => {
+					await getAPI(SysRoleApi).sysRoleDeletePost({ id: row.id });
+					handleQuery();
 					ElMessage.success('删除成功');
 				})
-				.catch(() => {});
+				.catch(() => { });
 		};
 		// 分页改变
-		const onHandleSizeChange = (val: number) => {
-			state.tableData.param.pageSize = val;
+		const handleSizeChange = (val: number) => {
+			state.tableParams.pageSize = val;
+			handleQuery();
 		};
 		// 分页改变
-		const onHandleCurrentChange = (val: number) => {
-			state.tableData.param.pageNum = val;
+		const handleCurrentChange = (val: number) => {
+			state.tableParams.page = val;
+			handleQuery();
 		};
-		// 页面加载时
-		onMounted(() => {
-			initTableData();
-		});
 		return {
-			addRoleRef,
+			handleQuery,
+			resetQuery,
 			editRoleRef,
-			onOpenAddRole,
-			onOpenEditRole,
-			onRowDel,
-			onHandleSizeChange,
-			onHandleCurrentChange,
+			openAddRole,
+			openEditRole,
+			delRole,
+			handleSizeChange,
+			handleCurrentChange,
 			...toRefs(state),
 		};
 	},

+ 11 - 12
vue-next-admin/src/views/system/user/index.vue

@@ -80,16 +80,16 @@
 						<el-table-column prop="remark" label="备注" width="200" show-overflow-tooltip></el-table-column>
 						<el-table-column label="操作" width="80" align="center" fixed="right" show-overflow-tooltip>
 							<template #default="scope">
-								<el-button size="small" text type="primary" @click="openEditUser(scope.row)">
-									<el-icon>
-										<ele-Edit />
-									</el-icon>
-								</el-button>
-								<el-button size="small" text type="primary" @click="delUser(scope.row)">
-									<el-icon>
-										<ele-Delete />
-									</el-icon>
-								</el-button>
+								<el-tooltip content="用户编辑">
+									<el-button icon="ele-Edit" size="small" text type="primary"
+										@click="openEditUser(scope.row)">
+									</el-button>
+								</el-tooltip>
+								<el-tooltip content="用户删除">
+									<el-button icon="ele-Delete" size="small" text type="primary"
+										@click="delUser(scope.row)">
+									</el-button>
+								</el-tooltip>
 							</template>
 						</el-table-column>
 					</el-table>
@@ -112,8 +112,7 @@ import OrgTree from '/@/views/system/org/component/orgTree.vue';
 import EditUser from '/@/views/system/user/component/editUser.vue';
 
 import { getAPI } from '/@/utils/axios-utils';
-import { SysUserApi } from '/@/api-services/apis/sys-user-api';
-import { SysOrgApi } from '/@/api-services/apis/sys-org-api';
+import { SysUserApi, SysOrgApi } from '/@/api-services/api';
 
 export default defineComponent({
 	name: 'sysUser',