Explorar el Código

去掉数据资源管理相关

zuohuaijun hace 3 años
padre
commit
8e03eb3f6f

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

@@ -532,51 +532,6 @@
             备注
             </summary>
         </member>
-        <member name="T:Admin.NET.Core.SysDataResource">
-             <summary>
-              数据资源表
-            </summary>
-        </member>
-        <member name="P:Admin.NET.Core.SysDataResource.Pid">
-             <summary>
-             父节点Id
-            </summary>
-        </member>
-        <member name="P:Admin.NET.Core.SysDataResource.Name">
-             <summary>
-             名称
-            </summary>
-        </member>
-        <member name="P:Admin.NET.Core.SysDataResource.Value">
-             <summary>
-             值
-            </summary>
-        </member>
-        <member name="P:Admin.NET.Core.SysDataResource.Code">
-             <summary>
-             节点编码
-            </summary>
-        </member>
-        <member name="P:Admin.NET.Core.SysDataResource.Order">
-             <summary>
-             排序
-            </summary>
-        </member>
-        <member name="P:Admin.NET.Core.SysDataResource.Remark">
-             <summary>
-             备注
-            </summary>
-        </member>
-        <member name="P:Admin.NET.Core.SysDataResource.Status">
-             <summary>
-             状态
-            </summary>
-        </member>
-        <member name="P:Admin.NET.Core.SysDataResource.Children">
-            <summary>
-            数据资源子项
-            </summary>
-        </member>
         <member name="T:Admin.NET.Core.SysDictData">
             <summary>
             系统字典值表
@@ -3517,17 +3472,6 @@
             </summary>
             <returns></returns>
         </member>
-        <member name="T:Admin.NET.Core.SysDataResourceSeedData">
-            <summary>
-            系统数据资源种子数据
-            </summary>
-        </member>
-        <member name="M:Admin.NET.Core.SysDataResourceSeedData.HasData">
-            <summary>
-            种子数据
-            </summary>
-            <returns></returns>
-        </member>
         <member name="T:Admin.NET.Core.SysDictDataSeedData">
             <summary>
             系统字典值表种子数据
@@ -4720,106 +4664,6 @@
             <param name="input"></param>
             <returns></returns>
         </member>
-        <member name="P:Admin.NET.Core.Service.DataResourcesTreeInput.RootValue">
-            <summary>
-            根节点值
-            </summary>
-        </member>
-        <member name="P:Admin.NET.Core.Service.DataResourcesTreeInput.ChildName">
-            <summary>
-            对应根节点下的名称
-            </summary>
-        </member>
-        <member name="P:Admin.NET.Core.Service.DataResourcesTreeInput.IsContainSelf">
-            <summary>
-            是否包含自己,默认不包含
-            </summary>
-        </member>
-        <member name="P:Admin.NET.Core.Service.DataResourceInput.Pid">
-            <summary>
-            父Id
-            </summary>
-        </member>
-        <member name="P:Admin.NET.Core.Service.DataResourceInput.Name">
-            <summary>
-            名称
-            </summary>
-        </member>
-        <member name="P:Admin.NET.Core.Service.DataResourceInput.Value">
-             <summary>
-             值
-            </summary>
-        </member>
-        <member name="P:Admin.NET.Core.Service.DataResourceInput.Code">
-            <summary>
-            编码
-            </summary>
-        </member>
-        <member name="P:Admin.NET.Core.Service.DataResourceInput.Order">
-            <summary>
-            排序
-            </summary>
-        </member>
-        <member name="P:Admin.NET.Core.Service.DataResourceInput.Remark">
-            <summary>
-            备注
-            </summary>
-        </member>
-        <member name="P:Admin.NET.Core.Service.DataResourceInput.Status">
-            <summary>
-            状态
-            </summary>
-        </member>
-        <member name="P:Admin.NET.Core.Service.AddDataResourceInput.Name">
-            <summary>
-            名称
-            </summary>
-        </member>
-        <member name="T:Admin.NET.Core.Service.SysDataResourceService">
-            <summary>
-            系统数据资源服务
-            </summary>
-        </member>
-        <member name="M:Admin.NET.Core.Service.SysDataResourceService.GetDataResourceTree(Admin.NET.Core.Service.DataResourcesTreeInput)">
-            <summary>
-            获取数据资源树结构列表
-            </summary>
-            <returns></returns>
-        </member>
-        <member name="M:Admin.NET.Core.Service.SysDataResourceService.GetDataResourceList(Admin.NET.Core.Service.DataResourceInput)">
-            <summary>
-            获取数据资源列表
-            </summary>
-            <returns></returns>
-        </member>
-        <member name="M:Admin.NET.Core.Service.SysDataResourceService.AddDataResource(Admin.NET.Core.Service.AddDataResourceInput)">
-            <summary>
-            增加数据资源
-            </summary>
-            <param name="input"></param>
-            <returns></returns>
-        </member>
-        <member name="M:Admin.NET.Core.Service.SysDataResourceService.UpdateDataResource(Admin.NET.Core.Service.UpdateDataResourceInput)">
-            <summary>
-            更新数据资源
-            </summary>
-            <param name="input"></param>
-            <returns></returns>
-        </member>
-        <member name="M:Admin.NET.Core.Service.SysDataResourceService.DeleteDataResource(Admin.NET.Core.Service.DeleteDataResourceInput)">
-            <summary>
-            删除数据资源
-            </summary>
-            <param name="input"></param>
-            <returns></returns>
-        </member>
-        <member name="M:Admin.NET.Core.Service.SysDataResourceService.GetChildIdListWithSelfById(System.Int64)">
-            <summary>
-            根据节点Id获取子节点Id集合(包含自己)
-            </summary>
-            <param name="pid"></param>
-            <returns></returns>
-        </member>
         <member name="P:Admin.NET.Core.Service.DictDataInput.Status">
             <summary>
             状态

+ 0 - 60
Admin.NET/Admin.NET.Core/Entity/SysDataResource.cs

@@ -1,60 +0,0 @@
-namespace Admin.NET.Core;
-
-/// <summary>
-///  数据资源表
-///</summary>
-[SugarTable("sys_data_resource", "数据资源表")]
-public class SysDataResource : EntityBase
-{
-    /// <summary>
-    /// 父节点Id
-    ///</summary>
-    [SugarColumn(ColumnDescription = "父Id")]
-    public long Pid { get; set; }
-
-    /// <summary>
-    /// 名称
-    ///</summary>
-    [SugarColumn(ColumnDescription = "名称", Length = 128)]
-    [MaxLength(128)]
-    public string Name { get; set; }
-
-    /// <summary>
-    /// 值
-    ///</summary>
-    [SugarColumn(ColumnDescription = "值", Length = 256)]
-    [MaxLength(256)]
-    public string Value { get; set; }
-
-    /// <summary>
-    /// 节点编码
-    ///</summary>
-    [SugarColumn(ColumnDescription = "节点编码", Length = 128)]
-    [MaxLength(128)]
-    public string Code { get; set; }
-
-    /// <summary>
-    /// 排序
-    ///</summary>
-    [SugarColumn(ColumnDescription = "排序")]
-    public int Order { get; set; } = 100;
-
-    /// <summary>
-    /// 备注
-    ///</summary>
-    [SugarColumn(ColumnDescription = "备注", Length = 256)]
-    [MaxLength(256)]
-    public string Remark { get; set; }
-
-    /// <summary>
-    /// 状态
-    ///</summary>
-    [SugarColumn(ColumnDescription = "状态")]
-    public StatusEnum Status { get; set; } = StatusEnum.Enable;
-
-    /// <summary>
-    /// 数据资源子项
-    /// </summary>
-    [SugarColumn(IsIgnore = true)]
-    public List<SysDataResource> Children { get; set; }
-}

+ 0 - 24
Admin.NET/Admin.NET.Core/SeedData/SysDataResourceSeedData.cs

@@ -1,24 +0,0 @@
-namespace Admin.NET.Core;
-
-/// <summary>
-/// 系统数据资源种子数据
-/// </summary>
-public class SysDataResourceSeedData : ISqlSugarEntitySeedData<SysDataResource>
-{
-    /// <summary>
-    /// 种子数据
-    /// </summary>
-    /// <returns></returns>
-    public IEnumerable<SysDataResource> HasData()
-    {
-        return new[]
-        {
-            new SysDataResource{ Id=243848612100001, Pid=0, Name="行政区",Value="district", Code="1001", CreateTime=DateTime.Parse("2022-05-30 00:00:00"), Remark="行政区"},
-            new SysDataResource{ Id=243848612100002, Pid=243848612100001, Name="北京市",Value="110000", Code="1001001", CreateTime=DateTime.Parse("2022-05-30 00:00:00"), Remark="北京市"},
-            new SysDataResource{ Id=243848612100003, Pid=243848612100002, Name="东城区",Value="110101", Code="1001001001", CreateTime=DateTime.Parse("2022-05-30 00:00:00"), Remark="东城区"},
-            new SysDataResource{ Id=243848612100004, Pid=0, Name="行业",Value="industry", Code="1002", CreateTime=DateTime.Parse("2022-05-30 00:00:00"), Remark="行业"},
-            new SysDataResource{ Id=243848612100005, Pid=243848612100004, Name="一产",Value="一产", Code="1002001", CreateTime=DateTime.Parse("2022-05-30 00:00:00"), Remark="一产"},
-            new SysDataResource{ Id=243848612100006, Pid=243848612100005, Name="农、林、牧、渔",Value="农、林、牧、渔", Code="1002001001", CreateTime=DateTime.Parse("2022-05-30 00:00:00"), Remark="农、林、牧、渔"},
-        };
-    }
-}

+ 1 - 7
Admin.NET/Admin.NET.Core/SeedData/SysMenuSeedData.cs

@@ -95,12 +95,6 @@ public class SysMenuSeedData : ISqlSugarEntitySeedData<SysMenu>
             new SysMenu{ Id=252885263002371, Pid=252885263002370, Title="缓存查询", Permission="cache:page", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Order=100 },
             new SysMenu{ Id=252885263002372, Pid=252885263002370, Title="缓存删除", Permission="cache:delete", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Order=100 },
 
-            new SysMenu{ Id=252885263002380, Pid=252885263002300, Title="数据资源", Path="/platform/dataResource", Name="sysDataResource", Component="/system/dataResource/index", Icon="ele-TakeawayBox", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-05-30 00:00:00"), Order=170 },
-            new SysMenu{ Id=252885263002381, Pid=252885263002380, Title="资源查询", Permission="sysDataResource:page", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-05-30 00:00:00"), Order=100 },
-            new SysMenu{ Id=252885263002382, Pid=252885263002380, Title="资源编辑", Permission="sysDataResource:update", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-05-30 00:00:00"), Order=100 },
-            new SysMenu{ Id=252885263002383, Pid=252885263002380, Title="资源增加", Permission="sysDataResource:add", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-05-30 00:00:00"), Order=100 },
-            new SysMenu{ Id=252885263002384, Pid=252885263002380, Title="资源删除", Permission="sysDataResource:delete", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-05-30 00:00:00"), Order=100 },
-
             new SysMenu{ Id=252885263002390, Pid=252885263002300, Title="文件管理", Path="/platform/file", Name="sysFile", Component="/system/file/index", Icon="ele-Document", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Order=180 },
             new SysMenu{ Id=252885263002391, Pid=252885263002390, Title="文件查询", Permission="sysFile:page", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Order=100 },
             new SysMenu{ Id=252885263002392, Pid=252885263002390, Title="文件上传", Permission="sysFile:upload", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Order=100 },
@@ -123,7 +117,7 @@ public class SysMenuSeedData : ISqlSugarEntitySeedData<SysMenu>
 
             new SysMenu{ Id=252885263002600, Pid=0, Title="开发工具", Path="/develop", Name="develop", Component="Layout", Redirect="/develop/api", Icon="ele-Cpu", Type=MenuTypeEnum.Dir, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Order=400 },
             new SysMenu{ Id=252885263002610, Pid=252885263002600, Title="系统接口", Path="/develop/api", Name="sysApi", Component="layout/routerView/iframe", IsIframe=true, OutLink="https://localhost:44326/api/", Icon="ele-Help", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Order=100 },
-            new SysMenu{ Id=252885263002611, Pid=252885263002600, Title="表单设计", Path="/develop/formDesign", Name="sysFormDesign", Component="/system/formDesign/index", Icon="ele-Edit", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Order=101 },
+            new SysMenu{ Id=252885263002611, Pid=252885263002600, Title="表单设计", Path="/develop/formDes", Name="sysFormDes", Component="/system/formDes/index", Icon="ele-Edit", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Order=101 },
             new SysMenu{ Id=252885263002612, Pid=252885263002600, Title="代码生成", Path="/develop/codeGen", Name="sysCodeGen", Component="/system/codeGen/index", Icon="ele-Crop", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Order=102 },
             new SysMenu{ Id=252885263002613, Pid=252885263002600, Title="库表管理", Path="/develop/database", Name="sysDatabase", Component="/system/database/index",Icon="ele-Coin", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Order=103 },
 

+ 0 - 74
Admin.NET/Admin.NET.Core/Service/DataResource/Dto/DataResourceInput.cs

@@ -1,74 +0,0 @@
-namespace Admin.NET.Core.Service;
-
-public class DataResourcesTreeInput
-{
-    /// <summary>
-    /// 根节点值
-    /// </summary>
-    public string RootValue { get; set; }
-
-    /// <summary>
-    /// 对应根节点下的名称
-    /// </summary>
-    public string ChildName { get; set; }
-
-    /// <summary>
-    /// 是否包含自己,默认不包含
-    /// </summary>
-    public bool IsContainSelf { get; set; } = false;
-}
-
-public class DataResourceInput : BaseIdInput
-{
-    /// <summary>
-    /// 父Id
-    /// </summary>
-    public virtual long Pid { get; set; }
-
-    /// <summary>
-    /// 名称
-    /// </summary>
-    public virtual string Name { get; set; }
-
-    /// <summary>
-    /// 值
-    ///</summary>
-    public virtual string Value { get; set; }
-
-    /// <summary>
-    /// 编码
-    /// </summary>
-    public virtual string Code { get; set; }
-
-    /// <summary>
-    /// 排序
-    /// </summary>
-    public virtual int Order { get; set; }
-
-    /// <summary>
-    /// 备注
-    /// </summary>
-    public virtual string Remark { get; set; }
-
-    /// <summary>
-    /// 状态
-    /// </summary>
-    public virtual int Status { get; set; }
-}
-
-public class AddDataResourceInput : DataResourceInput
-{
-    /// <summary>
-    /// 名称
-    /// </summary>
-    [Required(ErrorMessage = "资源名称不能为空")]
-    public override string Name { get; set; }
-}
-
-public class UpdateDataResourceInput : AddDataResourceInput
-{
-}
-
-public class DeleteDataResourceInput : BaseIdInput
-{
-}

+ 0 - 190
Admin.NET/Admin.NET.Core/Service/DataResource/SysDataResourceService.cs

@@ -1,190 +0,0 @@
-namespace Admin.NET.Core.Service;
-
-/// <summary>
-/// 系统数据资源服务
-/// </summary>
-[ApiDescriptionSettings(Order = 189)]
-public class SysDataResourceService : IDynamicApiController, ITransient
-{
-    private readonly SqlSugarRepository<SysDataResource> _sysDataResourceRep;
-
-    public SysDataResourceService(SqlSugarRepository<SysDataResource> sysDataResourceRep)
-    {
-        _sysDataResourceRep = sysDataResourceRep;
-    }
-
-    /// <summary>
-    /// 获取数据资源树结构列表
-    /// </summary>
-    /// <returns></returns>
-    [HttpGet("/sysDataResource/tree")]
-    public async Task<List<SysDataResource>> GetDataResourceTree([FromQuery] DataResourcesTreeInput input)
-    {
-        //通过根节点值来获取当前节点下的树结构数据
-        var rootValue = !string.IsNullOrEmpty(input.RootValue?.Trim());
-        SysDataResource rootDataTree = null;
-        if (rootValue)
-        {
-            rootDataTree = await _sysDataResourceRep.AsQueryable()
-                .Where(u => u.Status == StatusEnum.Enable)
-                .Where(u => u.Value == input.RootValue && u.Pid == 0)
-                .FirstAsync();
-
-            var childName = !string.IsNullOrEmpty(input.ChildName?.Trim());
-            //获取根节点下对应的子节点名称id
-            if (childName && rootDataTree != null)
-            {
-                rootDataTree = await _sysDataResourceRep.AsQueryable()
-                    .Where(u => u.Status == StatusEnum.Enable)
-                    .Where(u => u.Code.Contains(rootDataTree.Code))
-                    .Where(u => u.Name == input.ChildName)
-                    .FirstAsync();
-            }
-        }
-
-        if (rootDataTree == null)
-            return null;
-
-        var idList = rootDataTree.Id > 0 ? await GetChildIdListWithSelfById(rootDataTree.Id) : new List<long>();
-        var iSugarQueryable = _sysDataResourceRep.AsQueryable()
-            .WhereIF(idList.Count > 0, u => idList.Contains(u.Id))
-            .Where(u => u.Status == StatusEnum.Enable)
-            .OrderBy(u => u.Order); // 非超级管理员限制
-        var tree = await iSugarQueryable.ToTreeAsync(u => u.Children, u => u.Pid, rootDataTree.Id > 0 ? rootDataTree.Id : 0);
-
-        //如果包含自己,则添加自己信息
-        if (input.IsContainSelf)
-        {
-            rootDataTree.Children = new List<SysDataResource>();
-            rootDataTree.Children.AddRange(tree);
-            return new List<SysDataResource>
-            {
-                rootDataTree
-            };
-        }
-        return tree;
-    }
-
-    /// <summary>
-    /// 获取数据资源列表
-    /// </summary>
-    /// <returns></returns>
-    [HttpGet("/sysDataResource/list")]
-    public async Task<List<SysDataResource>> GetDataResourceList([FromQuery] DataResourceInput input)
-    {
-        var idList = input.Id > 0 ? await GetChildIdListWithSelfById(input.Id) : new List<long>();
-        var iSugarQueryable = _sysDataResourceRep.AsQueryable().OrderBy(u => u.Order)
-            .WhereIF(idList.Count > 0, u => idList.Contains(u.Id)); // 非超级管理员限制
-
-        if (!string.IsNullOrWhiteSpace(input.Name) || !string.IsNullOrWhiteSpace(input.Code) || !string.IsNullOrWhiteSpace(input.Value) || input.Id > 0)
-        {
-            return await iSugarQueryable
-                .WhereIF(!string.IsNullOrWhiteSpace(input.Name), u => u.Name.Contains(input.Name))
-                .WhereIF(!string.IsNullOrWhiteSpace(input.Value), u => u.Value.Contains(input.Value))
-                .WhereIF(!string.IsNullOrWhiteSpace(input.Code), u => u.Code.Contains(input.Code))
-                .ToListAsync();
-        }
-        return await iSugarQueryable.ToTreeAsync(u => u.Children, u => u.Pid, input.Id > 0 ? input.Id : 0);
-    }
-
-    /// <summary>
-    /// 增加数据资源
-    /// </summary>
-    /// <param name="input"></param>
-    /// <returns></returns>
-    [HttpPost("/sysDataResource/add")]
-    public async Task<long> AddDataResource(AddDataResourceInput input)
-    {
-        var isExist = await _sysDataResourceRep.IsAnyAsync(u => u.Code == input.Code && u.Name == input.Name);
-        if (isExist)
-            throw Oops.Oh(ErrorCodeEnum.D1602);
-
-        var newCode = "";
-        // 生成编码Code和排序(每级2位编码)
-        var sysDataResource = await _sysDataResourceRep.AsQueryable().OrderByDescending(o => o.Code)
-            .FirstAsync(u => u.Pid == input.Pid);
-
-        if (sysDataResource != null)
-        {
-            newCode = sysDataResource.Code[0..^3] + string.Format("{0:d3}", int.Parse(sysDataResource.Code[^3..]) + 1);
-        }
-        else
-        {
-            //如果没有根节点,默认为1001
-            if (input.Pid == 0)
-            {
-                newCode = "1001";
-            }
-            else
-            {
-                sysDataResource = await _sysDataResourceRep.GetFirstAsync(u => u.Id == input.Pid);
-                newCode = sysDataResource.Code + "01";
-            }
-        }
-        var newDataResource = input.Adapt<SysDataResource>();
-        newDataResource.Code = newCode;
-        newDataResource.Order = int.Parse(newCode[^3..]);
-        newDataResource = await _sysDataResourceRep.AsInsertable(newDataResource).ExecuteReturnEntityAsync();
-
-        return newDataResource.Id;
-    }
-
-    /// <summary>
-    /// 更新数据资源
-    /// </summary>
-    /// <param name="input"></param>
-    /// <returns></returns>
-    [HttpPost("/sysDataResource/update")]
-    [UnitOfWork]
-    public async Task UpdateDataResource(UpdateDataResourceInput input)
-    {
-        if (input.Pid != 0)
-        {
-            var pDataResource = await _sysDataResourceRep.GetFirstAsync(u => u.Id == input.Pid);
-            _ = pDataResource ?? throw Oops.Oh(ErrorCodeEnum.D1600);
-        }
-        if (input.Id == input.Pid)
-            throw Oops.Oh(ErrorCodeEnum.D1601);
-
-        var sysDataResource = await _sysDataResourceRep.GetFirstAsync(u => u.Id == input.Id);
-        var isExist = await _sysDataResourceRep.IsAnyAsync(u => (u.Name == input.Name && u.Code == input.Code) && u.Id != sysDataResource.Id);
-        if (isExist)
-            throw Oops.Oh(ErrorCodeEnum.D1602);
-
-        // 父Id不能为自己的子节点
-        var childIdList = await GetChildIdListWithSelfById(input.Id);
-        if (childIdList.Contains(input.Pid))
-            throw Oops.Oh(ErrorCodeEnum.D1601);
-
-        await _sysDataResourceRep.AsUpdateable(input.Adapt<SysDataResource>()).IgnoreColumns(true).ExecuteCommandAsync();
-    }
-
-    /// <summary>
-    /// 删除数据资源
-    /// </summary>
-    /// <param name="input"></param>
-    /// <returns></returns>
-    [HttpPost("/sysDataResource/delete")]
-    public async Task DeleteDataResource(DeleteDataResourceInput input)
-    {
-        var sysDataResource = await _sysDataResourceRep.GetFirstAsync(u => u.Id == input.Id);
-
-        // 获取本节点对应所有子节点id列表
-        var treeList = await _sysDataResourceRep.AsQueryable().ToChildListAsync(u => u.Pid, input.Id);
-        var idList = treeList.Select(u => u.Id).ToList();
-
-        // 级联删除数据资源子节点
-        await _sysDataResourceRep.DeleteAsync(u => idList.Contains(u.Id));
-    }
-
-    /// <summary>
-    /// 根据节点Id获取子节点Id集合(包含自己)
-    /// </summary>
-    /// <param name="pid"></param>
-    /// <returns></returns>
-    private async Task<List<long>> GetChildIdListWithSelfById(long pid)
-    {
-        var treeList = await _sysDataResourceRep.AsQueryable().ToChildListAsync(u => u.Pid, pid);
-        return treeList.Select(u => u.Id).ToList();
-    }
-}

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

@@ -200,7 +200,7 @@ public class SysRoleService : IDynamicApiController, ITransient
     /// </summary>
     /// <param name="input"></param>
     /// <returns></returns>
-    [HttpGet("/sysRole/ownMenu")]
+    [HttpGet("/sysRole/ownMenuTree")]
     public async Task<List<SysMenu>> GetRoleOwnMenuTree([FromQuery] RoleInput input)
     {
         return await _sysRoleMenuService.GetRoleMenuTree(new List<long> { input.Id });

+ 2 - 14
Web/src/router/backEnd.ts

@@ -1,5 +1,4 @@
 import { RouteRecordRaw } from 'vue-router';
-//import { storeToRefs } from 'pinia';
 import pinia from '/@/stores/index';
 import { useUserInfo } from '/@/stores/userInfo';
 import { useRequestOldRoutes } from '/@/stores/requestOldRoutes';
@@ -9,11 +8,9 @@ import { dynamicRoutes, notFoundAndNoPower } from '/@/router/route';
 import { formatTwoStageRoutes, formatFlatteningRoutes, router } from '/@/router/index';
 import { useRoutesList } from '/@/stores/routesList';
 import { useTagsViewRoutes } from '/@/stores/tagsViewRoutes';
-//import { useMenuApi } from '/@/api/menu/index';
-import { getAPI } from '../utils/axios-utils';
-import { SysMenuApi } from '../api-services/apis/sys-menu-api';
 
-//const menuApi = useMenuApi();
+import { getAPI } from '../utils/axios-utils';
+import { SysMenuApi } from '../api-services/api';
 
 const layouModules: any = import.meta.glob('../layout/routerView/*.{vue,tsx}');
 const viewsModules: any = import.meta.glob('../views/**/*.{vue,tsx}');
@@ -106,15 +103,6 @@ export async function setAddRoute() {
 export async function getBackEndControlRoutes() {
 	var res = await getAPI(SysMenuApi).getMenuListGet();
 	return res.data.result;
-	
-	// // 模拟 admin 与 test
-	// const stores = useUserInfo(pinia);
-	// const { userInfos } = storeToRefs(stores);
-	// const auth = userInfos.value.roles[0];
-	// // 管理员 admin
-	// if (auth === 'admin') return menuApi.getMenuAdmin();
-	// // 其它用户 test
-	// else return menuApi.getMenuTest();
 }
 
 /**

+ 1 - 1099
Web/src/router/route.ts

@@ -30,1105 +30,7 @@ export const dynamicRoutes: Array<RouteRecordRaw> = [
 		meta: {
 			isKeepAlive: true,
 		},
-		children: [
-			// {
-			// 	path: '/home',
-			// 	name: 'home',
-			// 	component: () => import('/@/views/home/index.vue'),
-			// 	meta: {
-			// 		title: 'message.router.home',
-			// 		isLink: '',
-			// 		isHide: false,
-			// 		isKeepAlive: true,
-			// 		isAffix: true,
-			// 		isIframe: false,
-			// 		roles: ['admin', 'common'],
-			// 		icon: 'iconfont icon-shouye',
-			// 	},
-			// },
-			// {
-			// 	path: '/system',
-			// 	name: 'system',
-			// 	component: () => import('/@/layout/routerView/parent.vue'),
-			// 	redirect: '/system/menu',
-			// 	meta: {
-			// 		title: 'message.router.system',
-			// 		isLink: '',
-			// 		isHide: false,
-			// 		isKeepAlive: true,
-			// 		isAffix: false,
-			// 		isIframe: false,
-			// 		roles: ['admin'],
-			// 		icon: 'iconfont icon-xitongshezhi',
-			// 	},
-			// 	children: [
-			// 		{
-			// 			path: '/system/menu',
-			// 			name: 'systemMenu',
-			// 			component: () => import('/@/views/system/menu/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.systemMenu',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin'],
-			// 				icon: 'iconfont icon-caidan',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/system/role',
-			// 			name: 'systemRole',
-			// 			component: () => import('/@/views/system/role/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.systemRole',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin'],
-			// 				icon: 'ele-ColdDrink',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/system/user',
-			// 			name: 'systemUser',
-			// 			component: () => import('/@/views/system/user/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.systemUser',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin'],
-			// 				icon: 'iconfont icon-icon-',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/system/dept',
-			// 			name: 'systemDept',
-			// 			component: () => import('/@/views/system/dept/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.systemDept',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin'],
-			// 				icon: 'ele-OfficeBuilding',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/system/dic',
-			// 			name: 'systemDic',
-			// 			component: () => import('/@/views/system/dic/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.systemDic',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin'],
-			// 				icon: 'ele-SetUp',
-			// 			},
-			// 		},
-			// 	],
-			// },
-			// {
-			// 	path: '/limits',
-			// 	name: 'limits',
-			// 	component: () => import('/@/layout/routerView/parent.vue'),
-			// 	redirect: '/limits/frontEnd',
-			// 	meta: {
-			// 		title: 'message.router.limits',
-			// 		isLink: '',
-			// 		isHide: false,
-			// 		isKeepAlive: true,
-			// 		isAffix: false,
-			// 		isIframe: false,
-			// 		roles: ['admin', 'common'],
-			// 		icon: 'iconfont icon-quanxian',
-			// 	},
-			// 	children: [
-			// 		{
-			// 			path: '/limits/frontEnd',
-			// 			name: 'limitsFrontEnd',
-			// 			component: () => import('/@/layout/routerView/parent.vue'),
-			// 			redirect: '/limits/frontEnd/page',
-			// 			meta: {
-			// 				title: 'message.router.limitsFrontEnd',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: '',
-			// 			},
-			// 			children: [
-			// 				{
-			// 					path: '/limits/frontEnd/page',
-			// 					name: 'limitsFrontEndPage',
-			// 					component: () => import('/@/views/limits/frontEnd/page/index.vue'),
-			// 					meta: {
-			// 						title: 'message.router.limitsFrontEndPage',
-			// 						isLink: '',
-			// 						isHide: false,
-			// 						isKeepAlive: true,
-			// 						isAffix: false,
-			// 						isIframe: false,
-			// 						roles: ['admin', 'common'],
-			// 						icon: '',
-			// 					},
-			// 				},
-			// 				{
-			// 					path: '/limits/frontEnd/btn',
-			// 					name: 'limitsFrontEndBtn',
-			// 					component: () => import('/@/views/limits/frontEnd/btn/index.vue'),
-			// 					meta: {
-			// 						title: 'message.router.limitsFrontEndBtn',
-			// 						isLink: '',
-			// 						isHide: false,
-			// 						isKeepAlive: true,
-			// 						isAffix: false,
-			// 						isIframe: false,
-			// 						roles: ['admin', 'common'],
-			// 						icon: '',
-			// 					},
-			// 				},
-			// 			],
-			// 		},
-			// 		{
-			// 			path: '/limits/backEnd',
-			// 			name: 'limitsBackEnd',
-			// 			component: () => import('/@/layout/routerView/parent.vue'),
-			// 			meta: {
-			// 				title: 'message.router.limitsBackEnd',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: '',
-			// 			},
-			// 			children: [
-			// 				{
-			// 					path: '/limits/backEnd/page',
-			// 					name: 'limitsBackEndEndPage',
-			// 					component: () => import('/@/views/limits/backEnd/page/index.vue'),
-			// 					meta: {
-			// 						title: 'message.router.limitsBackEndEndPage',
-			// 						isLink: '',
-			// 						isHide: false,
-			// 						isKeepAlive: true,
-			// 						isAffix: false,
-			// 						isIframe: false,
-			// 						roles: ['admin', 'common'],
-			// 						icon: '',
-			// 					},
-			// 				},
-			// 			],
-			// 		},
-			// 	],
-			// },
-			// {
-			// 	path: '/menu',
-			// 	name: 'menu',
-			// 	component: () => import('/@/layout/routerView/parent.vue'),
-			// 	redirect: '/menu/menu1',
-			// 	meta: {
-			// 		title: 'message.router.menu',
-			// 		isLink: '',
-			// 		isHide: false,
-			// 		isKeepAlive: true,
-			// 		isAffix: false,
-			// 		isIframe: false,
-			// 		roles: ['admin', 'common'],
-			// 		icon: 'iconfont icon-caidan',
-			// 	},
-			// 	children: [
-			// 		{
-			// 			path: '/menu/menu1',
-			// 			name: 'menu1',
-			// 			component: () => import('/@/layout/routerView/parent.vue'),
-			// 			redirect: '/menu/menu1/menu11',
-			// 			meta: {
-			// 				title: 'message.router.menu1',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'iconfont icon-caidan',
-			// 			},
-			// 			children: [
-			// 				{
-			// 					path: '/menu/menu1/menu11',
-			// 					name: 'menu11',
-			// 					component: () => import('/@/views/menu/menu1/menu11/index.vue'),
-			// 					meta: {
-			// 						title: 'message.router.menu11',
-			// 						isLink: '',
-			// 						isHide: false,
-			// 						isKeepAlive: true,
-			// 						isAffix: false,
-			// 						isIframe: false,
-			// 						roles: ['admin', 'common'],
-			// 						icon: 'iconfont icon-caidan',
-			// 					},
-			// 				},
-			// 				{
-			// 					path: '/menu/menu1/menu12',
-			// 					name: 'menu12',
-			// 					component: () => import('/@/layout/routerView/parent.vue'),
-			// 					redirect: '/menu/menu1/menu12/menu121',
-			// 					meta: {
-			// 						title: 'message.router.menu12',
-			// 						isLink: '',
-			// 						isHide: false,
-			// 						isKeepAlive: true,
-			// 						isAffix: false,
-			// 						isIframe: false,
-			// 						roles: ['admin', 'common'],
-			// 						icon: 'iconfont icon-caidan',
-			// 					},
-			// 					children: [
-			// 						{
-			// 							path: '/menu/menu1/menu12/menu121',
-			// 							name: 'menu121',
-			// 							component: () => import('/@/views/menu/menu1/menu12/menu121/index.vue'),
-			// 							meta: {
-			// 								title: 'message.router.menu121',
-			// 								isLink: '',
-			// 								isHide: false,
-			// 								isKeepAlive: true,
-			// 								isAffix: false,
-			// 								isIframe: false,
-			// 								roles: ['admin', 'common'],
-			// 								icon: 'iconfont icon-caidan',
-			// 							},
-			// 						},
-			// 						{
-			// 							path: '/menu/menu1/menu12/menu122',
-			// 							name: 'menu122',
-			// 							component: () => import('/@/views/menu/menu1/menu12/menu122/index.vue'),
-			// 							meta: {
-			// 								title: 'message.router.menu122',
-			// 								isLink: '',
-			// 								isHide: false,
-			// 								isKeepAlive: true,
-			// 								isAffix: false,
-			// 								isIframe: false,
-			// 								roles: ['admin', 'common'],
-			// 								icon: 'iconfont icon-caidan',
-			// 							},
-			// 						},
-			// 					],
-			// 				},
-			// 				{
-			// 					path: '/menu/menu1/menu13',
-			// 					name: 'menu13',
-			// 					component: () => import('/@/views/menu/menu1/menu13/index.vue'),
-			// 					meta: {
-			// 						title: 'message.router.menu13',
-			// 						isLink: '',
-			// 						isHide: false,
-			// 						isKeepAlive: true,
-			// 						isAffix: false,
-			// 						isIframe: false,
-			// 						roles: ['admin', 'common'],
-			// 						icon: 'iconfont icon-caidan',
-			// 					},
-			// 				},
-			// 			],
-			// 		},
-			// 		{
-			// 			path: '/menu/menu2',
-			// 			name: 'menu2',
-			// 			component: () => import('/@/views/menu/menu2/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.menu2',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'iconfont icon-caidan',
-			// 			},
-			// 		},
-			// 	],
-			// },
-			// {
-			// 	path: '/fun',
-			// 	name: 'funIndex',
-			// 	component: () => import('/@/layout/routerView/parent.vue'),
-			// 	redirect: '/fun/tagsView',
-			// 	meta: {
-			// 		title: 'message.router.funIndex',
-			// 		isLink: '',
-			// 		isHide: false,
-			// 		isKeepAlive: true,
-			// 		isAffix: false,
-			// 		isIframe: false,
-			// 		roles: ['admin', 'common'],
-			// 		icon: 'iconfont icon-crew_feature',
-			// 	},
-			// 	children: [
-			// 		{
-			// 			path: '/fun/tagsView',
-			// 			name: 'funTagsView',
-			// 			component: () => import('/@/views/fun/tagsView/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.funTagsView',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'ele-Pointer',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/fun/countup',
-			// 			name: 'funCountup',
-			// 			component: () => import('/@/views/fun/countup/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.funCountup',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'ele-Odometer',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/fun/wangEditor',
-			// 			name: 'funWangEditor',
-			// 			component: () => import('/@/views/fun/wangEditor/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.funWangEditor',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'iconfont icon-fuwenbenkuang',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/fun/cropper',
-			// 			name: 'funCropper',
-			// 			component: () => import('/@/views/fun/cropper/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.funCropper',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'iconfont icon-caijian',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/fun/qrcode',
-			// 			name: 'funQrcode',
-			// 			component: () => import('/@/views/fun/qrcode/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.funQrcode',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'iconfont icon-ico',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/fun/echartsMap',
-			// 			name: 'funEchartsMap',
-			// 			component: () => import('/@/views/fun/echartsMap/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.funEchartsMap',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'iconfont icon-ditu',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/fun/printJs',
-			// 			name: 'funPrintJs',
-			// 			component: () => import('/@/views/fun/printJs/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.funPrintJs',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'ele-Printer',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/fun/clipboard',
-			// 			name: 'funClipboard',
-			// 			component: () => import('/@/views/fun/clipboard/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.funClipboard',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'ele-DocumentCopy',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/fun/gridLayout',
-			// 			name: 'funGridLayout',
-			// 			component: () => import('/@/views/fun/gridLayout/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.funGridLayout',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'iconfont icon-tuodong',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/fun/splitpanes',
-			// 			name: 'funSplitpanes',
-			// 			component: () => import('/@/views/fun/splitpanes/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.funSplitpanes',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'iconfont icon--chaifenlie',
-			// 			},
-			// 		},
-			// 	],
-			// },
-			// {
-			// 	path: '/pages',
-			// 	name: 'pagesIndex',
-			// 	component: () => import('/@/layout/routerView/parent.vue'),
-			// 	redirect: '/pages/filtering',
-			// 	meta: {
-			// 		title: 'message.router.pagesIndex',
-			// 		isLink: '',
-			// 		isHide: false,
-			// 		isKeepAlive: true,
-			// 		isAffix: false,
-			// 		isIframe: false,
-			// 		roles: ['admin', 'common'],
-			// 		icon: 'iconfont icon-fuzhiyemian',
-			// 	},
-			// 	children: [
-			// 		{
-			// 			path: '/pages/filtering',
-			// 			name: 'pagesFiltering',
-			// 			component: () => import('/@/views/pages/filtering/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.pagesFiltering',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'ele-Sell',
-			// 			},
-			// 			/**
-			// 			 * 注意此处详情写法:
-			// 			 * 1、嵌套进父级里时,面包屑显示为:首页/页面/过滤筛选组件/过滤筛选组件详情
-			// 			 * 2、不嵌套进父级时,面包屑显示为:首页/页面/过滤筛选组件/过滤筛选组件详情
-			// 			 * 3、想要父级不高亮,面包屑显示为:首页/页面/过滤筛选组件详情,设置路径为:/pages/filteringDetails
-			// 			 */
-			// 			children: [
-			// 				{
-			// 					path: '/pages/filtering/details',
-			// 					name: 'pagesFilteringDetails',
-			// 					component: () => import('/@/views/pages/filtering/details.vue'),
-			// 					meta: {
-			// 						title: 'message.router.pagesFilteringDetails',
-			// 						isLink: '',
-			// 						isHide: true,
-			// 						isKeepAlive: false,
-			// 						isAffix: false,
-			// 						isIframe: false,
-			// 						roles: ['admin', 'common'],
-			// 						icon: 'ele-Sunny',
-			// 					},
-			// 				},
-			// 			],
-			// 		},
-			// 		{
-			// 			path: '/pages/filtering/details1',
-			// 			name: 'pagesFilteringDetails1',
-			// 			component: () => import('/@/views/pages/filtering/details1.vue'),
-			// 			meta: {
-			// 				title: 'message.router.pagesFilteringDetails1',
-			// 				isLink: '',
-			// 				isHide: true,
-			// 				isKeepAlive: false,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'ele-Sunny',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/pages/iocnfont',
-			// 			name: 'pagesIocnfont',
-			// 			component: () => import('/@/views/pages/iocnfont/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.pagesIocnfont',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'ele-Present',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/pages/element',
-			// 			name: 'pagesElement',
-			// 			component: () => import('/@/views/pages/element/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.pagesElement',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'ele-Eleme',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/pages/awesome',
-			// 			name: 'pagesAwesome',
-			// 			component: () => import('/@/views/pages/awesome/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.pagesAwesome',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'ele-SetUp',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/pages/formAdapt',
-			// 			name: 'pagesFormAdapt',
-			// 			component: () => import('/@/views/pages/formAdapt/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.pagesFormAdapt',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'iconfont icon-biaodan',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/pages/tableRules',
-			// 			name: 'pagesTableRules',
-			// 			component: () => import('/@/views/pages/tableRules/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.pagesTableRules',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'iconfont icon-jiliandongxuanzeqi',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/pages/formI18n',
-			// 			name: 'pagesFormI18n',
-			// 			component: () => import('/@/views/pages/formI18n/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.pagesFormI18n',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'iconfont icon-diqiu',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/pages/formRules',
-			// 			name: 'pagesFormRules',
-			// 			component: () => import('/@/views/pages/formRules/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.pagesFormRules',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'iconfont icon-shuxing',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/pages/listAdapt',
-			// 			name: 'pagesListAdapt',
-			// 			component: () => import('/@/views/pages/listAdapt/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.pagesListAdapt',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'iconfont icon-chazhaobiaodanliebiao',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/pages/waterfall',
-			// 			name: 'pagesWaterfall',
-			// 			component: () => import('/@/views/pages/waterfall/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.pagesWaterfall',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'iconfont icon-zidingyibuju',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/pages/steps',
-			// 			name: 'pagesSteps',
-			// 			component: () => import('/@/views/pages/steps/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.pagesSteps',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'iconfont icon-step',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/pages/preview',
-			// 			name: 'pagesPreview',
-			// 			component: () => import('/@/views/pages/preview/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.pagesPreview',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'iconfont icon-15tupianyulan',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/pages/waves',
-			// 			name: 'pagesWaves',
-			// 			component: () => import('/@/views/pages/waves/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.pagesWaves',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'iconfont icon-bolangneng',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/pages/tree',
-			// 			name: 'pagesTree',
-			// 			component: () => import('/@/views/pages/tree/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.pagesTree',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'iconfont icon-shuxingtu',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/pages/drag',
-			// 			name: 'pagesDrag',
-			// 			component: () => import('/@/views/pages/drag/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.pagesDrag',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'ele-Pointer',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/pages/lazyImg',
-			// 			name: 'pagesLazyImg',
-			// 			component: () => import('/@/views/pages/lazyImg/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.pagesLazyImg',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin'],
-			// 				icon: 'ele-PictureFilled',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/pages/dynamicForm',
-			// 			name: 'pagesDynamicForm',
-			// 			component: () => import('/@/views/pages/dynamicForm/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.pagesDynamicForm',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin'],
-			// 				icon: 'iconfont icon-diannao',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/pages/workflow',
-			// 			name: 'pagesWorkflow',
-			// 			component: () => import('/@/views/pages/workflow/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.pagesWorkflow',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin'],
-			// 				icon: 'ele-Connection',
-			// 			},
-			// 		},
-			// 	],
-			// },
-			// {
-			// 	path: '/make',
-			// 	name: 'makeIndex',
-			// 	component: () => import('/@/layout/routerView/parent.vue'),
-			// 	redirect: '/make/selector',
-			// 	meta: {
-			// 		title: 'message.router.makeIndex',
-			// 		isLink: '',
-			// 		isHide: false,
-			// 		isKeepAlive: true,
-			// 		isAffix: false,
-			// 		isIframe: false,
-			// 		roles: ['admin'],
-			// 		icon: 'iconfont icon-siweidaotu',
-			// 	},
-			// 	children: [
-			// 		{
-			// 			path: '/make/selector',
-			// 			name: 'makeSelector',
-			// 			component: () => import('/@/views/make/selector/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.makeSelector',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'iconfont icon-xuanzeqi',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/make/noticeBar',
-			// 			name: 'makeNoticeBar',
-			// 			component: () => import('/@/views/make/noticeBar/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.makeNoticeBar',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'ele-Bell',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/make/svgDemo',
-			// 			name: 'makeSvgDemo',
-			// 			component: () => import('/@/views/make/svgDemo/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.makeSvgDemo',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin', 'common'],
-			// 				icon: 'fa fa-thumbs-o-up',
-			// 			},
-			// 		},
-			// 	],
-			// },
-			// {
-			// 	path: '/params',
-			// 	name: 'paramsIndex',
-			// 	component: () => import('/@/layout/routerView/parent.vue'),
-			// 	redirect: '/params/common',
-			// 	meta: {
-			// 		title: 'message.router.paramsIndex',
-			// 		isLink: '',
-			// 		isHide: false,
-			// 		isKeepAlive: true,
-			// 		isAffix: false,
-			// 		isIframe: false,
-			// 		roles: ['admin'],
-			// 		icon: 'iconfont icon-zhongduancanshu',
-			// 	},
-			// 	children: [
-			// 		{
-			// 			path: '/params/common',
-			// 			name: 'paramsCommon',
-			// 			component: () => import('/@/views/params/common/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.paramsCommon',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin'],
-			// 				icon: 'iconfont icon-putong',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/params/common/details',
-			// 			name: 'paramsCommonDetails',
-			// 			component: () => import('/@/views/params/common/details.vue'),
-			// 			meta: {
-			// 				title: 'message.router.paramsCommonDetails',
-			// 				isLink: '',
-			// 				isHide: true,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin'],
-			// 				icon: 'ele-Comment',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/params/dynamic',
-			// 			name: 'paramsDynamic',
-			// 			component: () => import('/@/views/params/dynamic/index.vue'),
-			// 			meta: {
-			// 				title: 'message.router.paramsDynamic',
-			// 				isLink: '',
-			// 				isHide: false,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin'],
-			// 				icon: 'iconfont icon-dongtai',
-			// 			},
-			// 		},
-			// 		/**
-			// 		 * tagsViewName 为要设置不同的 "tagsView 名称" 字段
-			// 		 * 如若需设置不同 "tagsView 名称",tagsViewName 字段必须要有
-			// 		 */
-			// 		{
-			// 			path: '/params/dynamic/details/:t/:id/:tagsViewName',
-			// 			name: 'paramsDynamicDetails',
-			// 			component: () => import('/@/views/params/dynamic/details.vue'),
-			// 			meta: {
-			// 				title: 'message.router.paramsDynamicDetails',
-			// 				isLink: '',
-			// 				isHide: true,
-			// 				isKeepAlive: true,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin'],
-			// 				icon: 'ele-Lightning',
-			// 			},
-			// 		},
-			// 	],
-			// },
-			// {
-			// 	path: '/visualizing',
-			// 	name: 'visualizingIndex',
-			// 	component: () => import('/@/layout/routerView/parent.vue'),
-			// 	redirect: '/visualizing/visualizingLinkDemo1',
-			// 	meta: {
-			// 		title: 'message.router.visualizingIndex',
-			// 		isLink: '',
-			// 		isHide: false,
-			// 		isKeepAlive: true,
-			// 		isAffix: false,
-			// 		isIframe: false,
-			// 		roles: ['admin'],
-			// 		icon: 'ele-ChatLineRound',
-			// 	},
-			// 	children: [
-			// 		{
-			// 			path: '/visualizing/visualizingLinkDemo1',
-			// 			name: 'visualizingLinkDemo1',
-			// 			component: () => import('/@/layout/routerView/link.vue'),
-			// 			meta: {
-			// 				title: 'message.router.visualizingLinkDemo1',
-			// 				isLink: `${import.meta.env.VITE_API_URL}#/visualizingDemo1`,
-			// 				isHide: false,
-			// 				isKeepAlive: false,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin'],
-			// 				icon: 'iconfont icon-caozuo-wailian',
-			// 			},
-			// 		},
-			// 		{
-			// 			path: '/visualizing/visualizingLinkDemo2',
-			// 			name: 'visualizingLinkDemo2',
-			// 			component: () => import('/@/layout/routerView/link.vue'),
-			// 			meta: {
-			// 				title: 'message.router.visualizingLinkDemo2',
-			// 				isLink: `${import.meta.env.VITE_API_URL}#/visualizingDemo2`,
-			// 				isHide: false,
-			// 				isKeepAlive: false,
-			// 				isAffix: false,
-			// 				isIframe: false,
-			// 				roles: ['admin'],
-			// 				icon: 'iconfont icon-caozuo-wailian',
-			// 			},
-			// 		},
-			// 	],
-			// },
-			// {
-			// 	path: '/chart',
-			// 	name: 'chartIndex',
-			// 	component: () => import('/@/views/chart/index.vue'),
-			// 	meta: {
-			// 		title: 'message.router.chartIndex',
-			// 		isLink: '',
-			// 		isHide: false,
-			// 		isKeepAlive: true,
-			// 		isAffix: false,
-			// 		isIframe: false,
-			// 		roles: ['admin', 'common'],
-			// 		icon: 'iconfont icon-ico_shuju',
-			// 	},
-			// },
-			// {
-			// 	path: '/personal',
-			// 	name: 'personal',
-			// 	component: () => import('/@/views/personal/index.vue'),
-			// 	meta: {
-			// 		title: 'message.router.personal',
-			// 		isLink: '',
-			// 		isHide: false,
-			// 		isKeepAlive: true,
-			// 		isAffix: false,
-			// 		isIframe: false,
-			// 		roles: ['admin', 'common'],
-			// 		icon: 'iconfont icon-gerenzhongxin',
-			// 	},
-			// },
-			// {
-			// 	path: '/tools',
-			// 	name: 'tools',
-			// 	component: () => import('/@/views/tools/index.vue'),
-			// 	meta: {
-			// 		title: 'message.router.tools',
-			// 		isLink: '',
-			// 		isHide: false,
-			// 		isKeepAlive: true,
-			// 		isAffix: false,
-			// 		isIframe: false,
-			// 		roles: ['admin', 'common'],
-			// 		icon: 'iconfont icon-gongju',
-			// 	},
-			// },
-			// {
-			// 	path: '/link',
-			// 	name: 'layoutLinkView',
-			// 	component: () => import('/@/layout/routerView/link.vue'),
-			// 	meta: {
-			// 		title: 'message.router.layoutLinkView',
-			// 		isLink: 'https://element-plus.gitee.io/#/zh-CN/component/installation',
-			// 		isHide: false,
-			// 		isKeepAlive: false,
-			// 		isAffix: false,
-			// 		isIframe: false,
-			// 		roles: ['admin'],
-			// 		icon: 'iconfont icon-caozuo-wailian',
-			// 	},
-			// },
-			// {
-			// 	path: '/iframes',
-			// 	name: 'layoutIfameView',
-			// 	component: () => import('/@/layout/routerView/iframes.vue'),
-			// 	meta: {
-			// 		title: 'message.router.layoutIfameView',
-			// 		isLink: 'https://nodejs.org/zh-cn/',
-			// 		isHide: false,
-			// 		isKeepAlive: false,
-			// 		isAffix: true,
-			// 		isIframe: true,
-			// 		roles: ['admin'],
-			// 		icon: 'iconfont icon-neiqianshujuchucun',
-			// 	},
-			// },
-		],
+		children: [],
 	},
 ];
 

+ 4 - 41
Web/src/stores/userInfo.ts

@@ -2,7 +2,7 @@ import { defineStore } from 'pinia';
 import { UserInfosStates } from './interface';
 import { Session } from '/@/utils/storage';
 import { getAPI } from '../utils/axios-utils';
-import { SysAuthApi } from '../api-services/apis/sys-auth-api';
+import { SysAuthApi } from '../api-services/api';
 
 /**
  * 用户信息
@@ -20,7 +20,7 @@ export const useUserInfo = defineStore('userInfo', {
 	}),
 	actions: {
 		async setUserInfos() {
-			// 存用户信息到浏览器缓存
+			// 存用户信息
 			if (Session.get('userInfo')) {
 				this.userInfos = Session.get('userInfo');
 			} else {
@@ -28,13 +28,12 @@ export const useUserInfo = defineStore('userInfo', {
 				this.userInfos = userInfos;
 			}
 		},
-		// 模拟接口数据
-		// https://gitee.com/lyt-top/vue-next-admin/issues/I5F1HP
+		// 获取当前用户信息
 		async getApiUserInfo() {
 			return new Promise((resolve) => {
 				getAPI(SysAuthApi)
 					.getUserInfoGet()
-					.then((res) => {
+					.then((res: any) => {
 						if (res.data.result == null) return;
 						var d = res.data.result;
 						const userInfos = {
@@ -46,42 +45,6 @@ export const useUserInfo = defineStore('userInfo', {
 						};
 						resolve(userInfos);
 					});
-
-				// setTimeout(() => {
-				// 	// 模拟数据,请求接口时,记得删除多余代码及对应依赖的引入
-				// 	const userName = Cookies.get('userName');
-				// 	// 模拟数据
-				// 	let defaultRoles: Array<string> = [];
-				// 	let defaultAuthBtnList: Array<string> = [];
-				// 	// admin 页面权限标识,对应路由 meta.roles,用于控制路由的显示/隐藏
-				// 	let adminRoles: Array<string> = ['admin'];
-				// 	// admin 按钮权限标识
-				// 	let adminAuthBtnList: Array<string> = ['btn.add', 'btn.del', 'btn.edit', 'btn.link'];
-				// 	// test 页面权限标识,对应路由 meta.roles,用于控制路由的显示/隐藏
-				// 	let testRoles: Array<string> = ['common'];
-				// 	// test 按钮权限标识
-				// 	let testAuthBtnList: Array<string> = ['btn.add', 'btn.link'];
-				// 	// 不同用户模拟不同的用户权限
-				// 	if (userName === 'admin') {
-				// 		defaultRoles = adminRoles;
-				// 		defaultAuthBtnList = adminAuthBtnList;
-				// 	} else {
-				// 		defaultRoles = testRoles;
-				// 		defaultAuthBtnList = testAuthBtnList;
-				// 	}
-				// 	// 用户信息模拟数据
-				// 	const userInfos = {
-				// 		userName: userName,
-				// 		photo:
-				// 			userName === 'admin'
-				// 				? 'https://img2.baidu.com/it/u=1978192862,2048448374&fm=253&fmt=auto&app=138&f=JPEG?w=504&h=500'
-				// 				: 'https://img2.baidu.com/it/u=2370931438,70387529&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
-				// 		time: new Date().getTime(),
-				// 		roles: defaultRoles,
-				// 		authBtnList: defaultAuthBtnList,
-				// 	};
-				// 	resolve(userInfos);
-				// }, 3000);
 			});
 		},
 	},

+ 4 - 3
Web/src/utils/axios-utils.ts

@@ -6,10 +6,11 @@
  */
 
 import globalAxios, { AxiosInstance } from 'axios';
-import { Configuration } from '/@/api-services';
-import { BaseAPI, BASE_PATH } from '/@/api-services/base';
+import { Configuration } from '../api-services';
+import { BaseAPI, BASE_PATH } from '../api-services/base';
+
 import { ElMessage } from 'element-plus';
-import { Local, Session } from '/@/utils/storage';
+import { Local, Session } from '../utils/storage';
 
 // 接口服务器配置
 export const serveConfig = new Configuration({

+ 2 - 2
Web/src/views/system/formDesign/index.vue → Web/src/views/system/formDes/index.vue

@@ -1,5 +1,5 @@
 <template>
-	<div class="sys-formDesign-container">
+	<div class="sys-formDes-container">
 		<v-form-designer ref="vFormDesignRef"></v-form-designer>
 	</div>
 </template>
@@ -8,7 +8,7 @@
 import { toRefs, reactive, defineComponent, ref } from 'vue';
 
 export default defineComponent({
-	name: 'sysFormDesign',
+	name: 'sysFormDes',
 	components: {},
 	setup() {
 		const vFormDesignRef = ref(null);

+ 14 - 6
Web/src/views/system/onlineUser/index.vue

@@ -27,7 +27,7 @@
 					<el-table-column prop="time" label="登录时间" show-overflow-tooltip></el-table-column>
 					<el-table-column label="操作" width="70" fixed="right" align="center" show-overflow-tooltip>
 						<template #default="scope">
-							<el-button icon="ele-CircleClose" size="small" text type="danger" v-auth="'sysUser:forceOffline'" @click="forceOffline(scope.row.connectionId)"> 下线 </el-button>
+							<el-button icon="ele-CircleClose" size="small" text type="danger" v-auth="'sysUser:forceOffline'" @click="forceOffline(scope.row)"> 下线 </el-button>
 						</template>
 					</el-table-column>
 				</el-table>
@@ -49,7 +49,7 @@
 
 <script setup lang="ts">
 import { reactive } from 'vue';
-import { ElNotification } from 'element-plus';
+import { ElMessageBox, ElNotification } from 'element-plus';
 import * as SignalR from '@microsoft/signalr';
 
 import { getAPI, getToken, clearAccessTokens } from '/@/utils/axios-utils';
@@ -151,10 +151,18 @@ const resetQuery = () => {
 	handleQuery();
 };
 // 强制下线
-const forceOffline = async (connectionId: any) => {
-	await connection.send('ForceOffline', { connectionId }).catch(function (err) {
-		console.log(err);
-	});
+const forceOffline = async (row: any) => {
+	ElMessageBox.confirm(`确定踢掉账号:【${row.realName}】?`, '提示', {
+		confirmButtonText: '确定',
+		cancelButtonText: '取消',
+		type: 'warning',
+	})
+		.then(async () => {
+			await connection.send('ForceOffline', { connectionId: row.connectionId }).catch(function (err) {
+				console.log(err);
+			});
+		})
+		.catch(() => {});
 };
 // 改变页面容量
 const handleSizeChange = (val: number) => {

+ 4 - 2
Web/src/views/system/role/index.vue

@@ -50,8 +50,8 @@
 							</span>
 							<template #dropdown>
 								<el-dropdown-menu>
-									<el-dropdown-item icon="ele-OfficeBuilding" @click="openGrantData(scope.row)" :v-auth="'sysRole:grantData'"> 数据范围 </el-dropdown-item>
-									<el-dropdown-item icon="ele-Delete" @click="delRole(scope.row)" :v-auth="'sysRole:delete'"> 删除角色 </el-dropdown-item>
+									<el-dropdown-item icon="ele-OfficeBuilding" @click="openGrantData(scope.row)" :disabled="!auth('sysRole:grantData')"> 数据范围 </el-dropdown-item>
+									<el-dropdown-item icon="ele-Delete" @click="delRole(scope.row)" divided :disabled="!auth('sysRole:delete')"> 删除角色 </el-dropdown-item>
 								</el-dropdown-menu>
 							</template>
 						</el-dropdown>
@@ -78,6 +78,7 @@
 <script lang="ts">
 import { ref, toRefs, reactive, onMounted, defineComponent, getCurrentInstance, onUnmounted } from 'vue';
 import { ElMessageBox, ElMessage } from 'element-plus';
+import { auth } from '/@/utils/authFunction';
 import EditRole from '/@/views/system/role/component/editRole.vue';
 import GrantData from '/@/views/system/role/component/grantData.vue';
 
@@ -178,6 +179,7 @@ export default defineComponent({
 			delRole,
 			handleSizeChange,
 			handleCurrentChange,
+			auth,
 			...toRefs(state),
 		};
 	},

+ 2 - 2
Web/src/views/system/user/component/grantOrg.vue

@@ -4,11 +4,11 @@
 			<template #header>
 				<div style="font-size: large" v-drag="['.el-dialog', '.el-dialog__header']">授权数据范围</div>
 			</template>
-			<el-form :model="ruleForm" size="default" label-width="80px">
+			<el-form :model="ruleForm" size="default" label-width="0">
 				<el-row :gutter="35">
 					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl1="24">
 						<el-form-item prop="orgIdList">
-							<OrgTree ref="orgTreeRef" />
+							<OrgTree ref="orgTreeRef" style="width: 100%" />
 						</el-form-item>
 					</el-col>
 				</el-row>

+ 5 - 3
Web/src/views/system/user/index.vue

@@ -67,9 +67,9 @@
 									</span>
 									<template #dropdown>
 										<el-dropdown-menu>
-											<el-dropdown-item icon="ele-OfficeBuilding" @click="openGrantOrg(scope.row)" :v-auth="'sysUser:grantData'"> 数据范围 </el-dropdown-item>
-											<el-dropdown-item icon="ele-RefreshLeft" @click="resetUserPwd(scope.row)" :v-auth="'sysUser:resetPwd'"> 重置密码 </el-dropdown-item>
-											<el-dropdown-item icon="ele-Delete" @click="delUser(scope.row)" :v-auth="'sysUser:delete'"> 删除账号 </el-dropdown-item>
+											<el-dropdown-item icon="ele-OfficeBuilding" @click="openGrantOrg(scope.row)" :disabled="!auth('sysUser:grantData')"> 数据范围 </el-dropdown-item>
+											<el-dropdown-item icon="ele-RefreshLeft" @click="resetUserPwd(scope.row)" :disabled="!auth('sysUser:resetPwd')"> 重置密码 </el-dropdown-item>
+											<el-dropdown-item icon="ele-Delete" @click="delUser(scope.row)" divided :disabled="!auth('sysUser:delete')"> 删除账号 </el-dropdown-item>
 										</el-dropdown-menu>
 									</template>
 								</el-dropdown>
@@ -99,6 +99,7 @@
 import { ref, toRefs, reactive, onMounted, defineComponent, getCurrentInstance, onUnmounted } from 'vue';
 import { ElMessageBox, ElMessage } from 'element-plus';
 import { formatDate } from '/@/utils/formatTime';
+import { auth } from '/@/utils/authFunction';
 import OrgTree from '/@/views/system/org/component/orgTree.vue';
 import EditUser from '/@/views/system/user/component/editUser.vue';
 import GrantOrg from '/@/views/system/user/component/grantOrg.vue';
@@ -241,6 +242,7 @@ export default defineComponent({
 			resetUserPwd,
 			nodeClick,
 			formatDate,
+			auth,
 			...toRefs(state),
 		};
 	},