Jelajahi Sumber

修改权限模块及添加用户选定自完成组件

luocaiyang 3 tahun lalu
induk
melakukan
4a78d8af10

+ 25 - 5
wispro.sp.api/Controllers/AccountController.cs

@@ -21,17 +21,19 @@ namespace wispro.sp.api.Controllers
     {
         private static List<Staff> CacheList = new List<Staff>();
         public IConfiguration Configuration { get; }
+        spDbContext dbContext;
 
-        public AccountController(IConfiguration configuration)
+        public AccountController(IConfiguration configuration,spDbContext _dbContext)
         {
             Configuration = configuration;
+            dbContext = _dbContext;
         }
         
         [HttpGet,HttpPost,Route("Login")]
         public userToken Login(loginDto loginUser)
         {
             //添加验证代码
-            spDbContext dbContext = new spDbContext();
+            
             Staff staff = dbContext.Staffs.Where<Staff>(s => s.Account == loginUser.Name && s.Password == utility.MD5Utility.GetMD5(loginUser.Password)).FirstOrDefault();
 
             if(staff != null)
@@ -77,14 +79,21 @@ namespace wispro.sp.api.Controllers
 
         private userToken GetToken(Staff staff)
         {
-            var claims = new Claim[]
+            
+
+            var claims = new List<Claim>()
             {
                 new Claim("Id",staff.Id.ToString()),
                 new Claim(ClaimTypes.Name,staff.Name),
                 new Claim(ClaimTypes.Email,(staff.Mail==null)?"":staff.Mail),
-                //new Claim(ClaimTypes.Role,"Admin"),
+                
             };
 
+            var positions = dbContext.DepartmentPositions.Where<DepartmentPosition>(dp => dp.StaffId == staff.Id).ToList();
+            foreach (var p in positions)
+            {
+                claims.Add(new Claim(ClaimTypes.Role, $"[{p.departmentId}]-[{p.PositionId}]"));
+            }
 
             var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(Configuration["jwt:Key"]));
             var credential = new SigningCredentials(key, SecurityAlgorithms.HmacSha256);
@@ -93,7 +102,7 @@ namespace wispro.sp.api.Controllers
             var token = new JwtSecurityToken(
                 issuer: Configuration["jwt:Issuer"],
                 audience: Configuration["jwt:Audience"],
-                claims: claims,
+                claims: claims.ToArray(),
                 notBefore: DateTime.Now,
                 expires: expireTime,                
                 signingCredentials: credential);
@@ -114,6 +123,17 @@ namespace wispro.sp.api.Controllers
             return userToken;
 
         }
+
+        [HttpGet, HttpPost, Route("GetRoles")]
+        public List<string> GetRoles(string ResourceId)
+        {
+            if(ResourceId == "AddProjectJX")
+            {
+                return new List<string> { "[35]-[2]" };
+            }
+
+            return new List<string>();
+        }
     }
     
 }

+ 2 - 0
wispro.sp.api/Controllers/IPEasyController.cs

@@ -97,6 +97,7 @@ namespace wispro.sp.api.Controllers
                 Item.CaseNo = retObj.CaseNo;
                 Item.Customer = new Customer();
                 Item.Customer.Name = retObj.CustomerName;
+                Item.Customer.Name = Item.Customer.Name.Replace("(null)", "");
                 Item.ApplicationType = retObj.ApplicationType;
                 Item.BusinessType = retObj.BusinessType;
                 Item.CaseCoefficient = retObj.CaseCoefficient;
@@ -126,6 +127,7 @@ namespace wispro.sp.api.Controllers
                 Item.CustomerLimitDate = string.IsNullOrEmpty(retObj.CustomerLimitDate) ? null : DateTime.Parse(retObj.CustomerLimitDate);
                 Item.Customer = new Customer();
                 Item.Customer.Name = retObj.CustomerName;
+                Item.Customer.Name = Item.Customer.Name.Replace("(null)", "");
                 Item.DoItemCoefficient = retObj.DoItemCoefficient;
                 Item.DoItemMemo = retObj.DoItemMemo;
                 Item.DoItemState = retObj.DoItemState;

+ 1 - 0
wispro.sp.api/Controllers/PerformanceItemController.cs

@@ -714,6 +714,7 @@ namespace wispro.sp.api.Controllers
                                 }
                             }
                         }
+                        t.Commit();
                     }
                     catch(Exception ex)
                     {

+ 16 - 10
wispro.sp.api/Controllers/StaffController.cs

@@ -190,20 +190,26 @@ namespace wispro.sp.api.Controllers
                             editObject.Status = staff.Status;
                             editObject.Tel = staff.Tel;
                             editObject.WorkPlace = staff.WorkPlace;
+                            Context.SaveChanges();
 
                             var temDP = Context.DepartmentPositions
-                                .FirstOrDefault<DepartmentPosition>(d =>
+                                .Where<DepartmentPosition>(d =>
                                     d.departmentId == saveUser.deptId &&
-                                    d.PositionId == saveUser.positionId &&
-                                    d.StaffId == editObject.Id);
-                            if (temDP == null)
+                                    d.StaffId == editObject.Id).ToList<DepartmentPosition>();
+
+                            foreach (var depPosition in temDP)
                             {
-                                DepartmentPosition dp = new DepartmentPosition();
-                                dp.departmentId = saveUser.deptId;
-                                dp.PositionId = saveUser.deptId;
-                                dp.StaffId = editObject.Id;
-                                Context.DepartmentPositions.Add(dp);
+                                Context.DepartmentPositions.Remove(depPosition);
                             }
+                            Context.SaveChanges();
+
+                            DepartmentPosition dp = new DepartmentPosition();
+                            dp.departmentId = saveUser.deptId;
+                            dp.PositionId = saveUser.positionId;
+                            dp.StaffId = editObject.Id;
+                            Context.DepartmentPositions.Add(dp);
+                            Context.SaveChanges();
+
                         }
                         else
                         {
@@ -213,7 +219,7 @@ namespace wispro.sp.api.Controllers
 
                     }
 
-                    Context.SaveChanges();
+                    
                     t.Commit();
                     ret.Success = true;
 

+ 0 - 2
wispro.sp.web/Auth/JwtAuthenticationStateProvider.cs

@@ -33,14 +33,12 @@ namespace wispro.sp.web.Auth
             
             if (tokenInLocalStorage == null)
             {
-                Console.WriteLine($"Token:匿名!");
                 //沒有的話,回傳匿名使用者
                 return anonymous;
             }
             
             //將token取出轉為claim
             var claims = JwtParser.ParseClaimsFromJwt(tokenInLocalStorage.Token);
-            Console.WriteLine($"Token:{tokenInLocalStorage.Token}");
             //在每次request的header中帶入bearer token
             httpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("bearer", tokenInLocalStorage.Token);
 

+ 0 - 1
wispro.sp.web/Components/RightMenuTreeNode.razor.cs

@@ -54,7 +54,6 @@ namespace wispro.sp.web.Components
         
         private  void ShowMenu(bool isShowmenu)
         {
-            Console.WriteLine($"ShowMenu:{isShowmenu}");
             menuVisiable = isShowmenu;
         }
 

+ 10 - 0
wispro.sp.web/Components/StaffAutoComplete.razor

@@ -0,0 +1,10 @@
+<AutoComplete Options="ShowStaffs" OnInput="OnInput" TOption="Staff" AllowFilter="false" OnSelectionChange="OnSelectionChange">
+    <ChildContent>
+        <AutoCompleteSearch Placeholder="请输入..." @bind-Value="@SelectName"/>
+    </ChildContent>
+    <OptionTemplate Context="option">
+        <AutoCompleteOption Style="display: flex;" Value="@option.Value.Name">
+            @option.Value.Name
+        </AutoCompleteOption>
+    </OptionTemplate>
+</AutoComplete>

+ 62 - 0
wispro.sp.web/Components/StaffAutoComplete.razor.cs

@@ -0,0 +1,62 @@
+using AntDesign;
+using Microsoft.AspNetCore.Components;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using wispro.sp.entity;
+using wispro.sp.web.Services;
+
+namespace wispro.sp.web.Components
+{
+    public partial class StaffAutoComplete
+    {
+        
+        private List<Staff> ShowStaffs = new List<Staff>();
+
+        [Parameter]
+        public string SelectName { get; set; }
+
+        [Parameter]
+        public EventCallback<string> SelectNameChanged { get; set; }
+
+        [Parameter]
+        public List<Staff> Staffs { get; set; }
+
+        [Parameter]
+        public EventCallback<Staff> OnSelected { get; set; }
+
+        [Inject] IUserService _UserService { get; set; }
+
+        protected override async System.Threading.Tasks.Task OnInitializedAsync()
+        {
+            base.OnInitialized();
+            if (Staffs == null)
+            {
+                Staffs = await _UserService.GetAll();
+                ShowStaffs = Staffs;
+            }
+        }
+
+        
+        void OnSelectionChange(AutoCompleteOption item)
+        {
+            SelectNameChanged.InvokeAsync(item.Value.ToString());
+
+            if (OnSelected.HasDelegate)
+            {
+                Staff obj = ShowStaffs.FirstOrDefault<Staff>(p => p.Name == item.Value.ToString());
+                OnSelected.InvokeAsync(obj);
+            }
+        }
+
+        void OnInput(ChangeEventArgs e)
+        {
+            var v = e.Value.ToString();
+            
+            this.ShowStaffs = Staffs.Where<Staff>(s => s.Name.Contains(v)).ToList();
+            
+        }
+
+    }
+}

+ 53 - 67
wispro.sp.web/Layouts/BasicLayout.razor

@@ -49,66 +49,52 @@
             Key = "index",
             Icon = "home",
         },
-        //new MenuDataItem
-        //{
-        //    Path = "/StartPerformanceCalculation",
-        //    Name = "开启绩效计算",
-        //    Key = "startCal",
-        //    Icon = "play-circle",
-        //},
-        //new MenuDataItem
-        //{
-        //    Path = "/PerformanceList",
-        //    Name = "我的绩效",
-        //    Key = "PerformanceList",
-        //    Icon = "ordered-list",
-        //},
         new MenuDataItem
         {
-            Name="我的申请案",
+            Name="我的绩效",
             Key="appManager",
             Icon ="copy",
             Path="/MyCaselist",
 
         },
-        new MenuDataItem
-        {
-            Name = "我的专案",
-            Key = "staffManager",
-            Icon = "setting",
-            Children= new MenuDataItem[]
-            {
-                new MenuDataItem
-                {
-                    Path ="/Project/ReadMessage",
-                    Name ="专案点数分配系统通知",
-                    Key= "project_readMsg",
-                    Icon = ""
-                },
-                new MenuDataItem
-                {
-                    Path ="/Project/AssignPoint/1",
-                    Name ="分配专案点数",
-                    Key= "project_assignpoint",
-                    Icon = ""
-                },
-                new MenuDataItem
-                {
-                    Path ="/Project/ReadAssignPointMsg",
-                    Name ="专案点数分配通知阅读",
-                    Key= "ReadAssignPointMsg",
-                    Icon = ""
-                },
-                new MenuDataItem
-                {
-                    Path ="/Project/ConfirmProjectPoint",
-                    Name ="代理人确认",
-                    Key= "project_point_confirm",
-                    Icon = ""
-                }
+        //new MenuDataItem
+        //{
+        //    Name = "我的专案",
+        //    Key = "staffManager",
+        //    Icon = "setting",
+        //    Children= new MenuDataItem[]
+        //    {
+        //        //new MenuDataItem
+        //        //{
+        //        //    Path ="/Project/ReadMessage",
+        //        //    Name ="专案点数分配系统通知",
+        //        //    Key= "project_readMsg",
+        //        //    Icon = ""
+        //        //},
+        //        new MenuDataItem
+        //        {
+        //            Path ="/Project/AssignPoint",
+        //            Name ="分配专案点数",
+        //            Key= "project_assignpoint",
+        //            Icon = ""
+        //        },
+        //        //new MenuDataItem
+        //        //{
+        //        //    Path ="/Project/ReadAssignPointMsg",
+        //        //    Name ="专案点数分配通知阅读",
+        //        //    Key= "ReadAssignPointMsg",
+        //        //    Icon = ""
+        //        //},
+        //        //new MenuDataItem
+        //        //{
+        //        //    Path ="/Project/ConfirmProjectPoint",
+        //        //    Name ="代理人确认",
+        //        //    Key= "project_point_confirm",
+        //        //    Icon = ""
+        //        //}
 
-            }
-        },
+        //    }
+        //},
         new MenuDataItem
         {
             Name = "基本资料管理",
@@ -137,21 +123,21 @@
                     Key= "sg",
                     Icon = ""
                 },
-                new MenuDataItem
-                {
-                    Path ="/VerifyCeofficient",
-                    Name ="核稿系数设定",
-                    Key="vc",
-                    Icon = ""
-                }
-                ,
-                new MenuDataItem
-                {
-                    Path ="/VerifyCeofficient",
-                    Name ="案件难度系数设定",
-                    Key="vc",
-                    Icon = ""
-                },
+                //new MenuDataItem
+                //{
+                //    Path ="/VerifyCeofficient",
+                //    Name ="核稿系数设定",
+                //    Key="vc",
+                //    Icon = ""
+                //}
+                //,
+                //new MenuDataItem
+                //{
+                //    Path ="/VerifyCeofficient",
+                //    Name ="案件难度系数设定",
+                //    Key="vc",
+                //    Icon = ""
+                //},
                 new MenuDataItem
                 {
                     Path ="/CustomerList",

+ 223 - 219
wispro.sp.web/Pages/AppCase/MyCaselist.razor

@@ -3,6 +3,7 @@
 @using wispro.sp.share 
 
 @inject IAgentFeedBackMemoItemsService _afService; 
+@inject IAuthService _authService;
 
 <PageContainer TabList="@tabList" OnTabChange="OnTabChange">
     <Breadcrumb>
@@ -18,243 +19,246 @@
     </Breadcrumb>
     
 
-        <ChildContent>
+    <ChildContent>
 
-            <Card>
-                @*<Pagination @bind-Current="@_pageIndex" @bind-Total="@_total" ShowSizeChanger OnChange="OnChange" />*@
-                @if (_Datas == null)
+        <Card>
+            @*<Pagination @bind-Current="@_pageIndex" @bind-Total="@_total" ShowSizeChanger OnChange="OnChange" />*@
+            @if (_Datas == null)
+            {
+                <center><Spin /></center>
+            }
+            else
+            {
+                if (_CurrentKey == "myList")
                 {
-                    <center><Spin /></center>
-                }
-                else
-                {
-                    if (_CurrentKey == "myList")
-                    {
-                        <PageHeader>
-                            <PageHeaderTitle>基础点数统计</PageHeaderTitle>
-                            <PageHeaderExtra>
-                                <Button Type="@ButtonType.Primary" OnClick="()=>goAssignPoint()">添加项目绩效</Button>
-                                @foreach (AppealType at in apTypeService.GetItems(1))
-                                {
-                                    <Button Type="@ButtonType.Primary" OnClick="()=>ShowModel(null,at)">@at.Name</Button>
-                                }
+                    <PageHeader>
+                        <PageHeaderTitle>基础点数统计</PageHeaderTitle>
+                        <PageHeaderExtra>
+                            <AuthorizeView Roles="@strAddProjectJX">
+                                
+                            <Button Type="@ButtonType.Primary" OnClick="()=>goAssignPoint()">添加项目绩效</Button>
+                            </AuthorizeView>
+                            @foreach (AppealType at in apTypeService.GetItems(1))
+                            {
+                                <Button Type="@ButtonType.Primary" OnClick="()=>ShowModel(null,at)">@at.Name</Button>
+                            }
 
-                            </PageHeaderExtra>
-                            <PageHeaderContent>
-                                <div style="border:1px solid #000000">
-                                    <AntDesign.Row Align="center" Justify="center">
-                                        <AntDesign.Col Span="2" style="border-left:1px solid #000000"><center></center></AntDesign.Col>
-                                        <AntDesign.Col Span="4" style="border:1px solid #000000"><center>新申请</center></AntDesign.Col>
-                                        <AntDesign.Col Span="4" style="border:1px solid #000000"><center>OA(国内、涉外)</center></AntDesign.Col>
-                                        <AntDesign.Col Span="4" style="border:1px solid #000000"><center>其它</center></AntDesign.Col>
-                                        <AntDesign.Col Span="2" style="border:1px solid #000000"></AntDesign.Col>
-                                        <AntDesign.Col Span="4" style="border:1px solid #000000">一次OA授权</AntDesign.Col>
-                                        <AntDesign.Col Span="4" style="border:1px solid #000000"></AntDesign.Col>
-                                    </AntDesign.Row>
-                                    <AntDesign.Row>
-                                        <AntDesign.Col Span="2" style="border:1px solid #000000"><center>代理人</center></AntDesign.Col>
-                                        <AntDesign.Col Span="2" style="border:1px solid #000000"><center>承办</center></AntDesign.Col>
-                                        <AntDesign.Col Span="2" style="border:1px solid #000000"><center>核稿</center></AntDesign.Col>
-                                        <AntDesign.Col Span="2" style="border:1px solid #000000"><center>承办</center></AntDesign.Col>
-                                        <AntDesign.Col Span="2" style="border:1px solid #000000"><center>核稿</center></AntDesign.Col>
-                                        <AntDesign.Col Span="2" style="border:1px solid #000000"><center>承办</center></AntDesign.Col>
-                                        <AntDesign.Col Span="2" style="border:1px solid #000000"><center>核稿</center></AntDesign.Col>
-                                        <AntDesign.Col Span="2" style="border:1px solid #000000"><center>调查案</center></AntDesign.Col>
-                                        <AntDesign.Col Span="2" style="border:1px solid #000000"><center>承办人</center></AntDesign.Col>
-                                        <AntDesign.Col Span="2" style="border:1px solid #000000"><center>审核人</center></AntDesign.Col>
-                                        <AntDesign.Col Span="4" style="border:1px solid #000000"><center>总计</center></AntDesign.Col>
-                                    </AntDesign.Row>
-                                    <AntDesign.Row>
-                                        <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@_user.Name</center></AntDesign.Col>
-                                        <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("新申请处理")</center></AntDesign.Col>
-                                        <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("新申请审核")</center></AntDesign.Col>
-                                        <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("OA处理")</center></AntDesign.Col>
-                                        <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("OA审核")</center></AntDesign.Col>
-                                        <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("其它处理")</center></AntDesign.Col>
-                                        <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("其它审核")</center></AntDesign.Col>
-                                        <AntDesign.Col Span="2" style="border:1px solid #000000"><center></center></AntDesign.Col>
-                                        <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("一次OA授权处理")</center></AntDesign.Col>
-                                        <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("一次OA授权审核")</center></AntDesign.Col>
-                                        <AntDesign.Col Span="4" style="border:1px solid #000000"><center>@GetStatistics("ALL")</center></AntDesign.Col>
-                                    </AntDesign.Row>
+                        </PageHeaderExtra>
+                        <PageHeaderContent>
+                            <div style="border:1px solid #000000">
+                                <AntDesign.Row Align="center" Justify="center">
+                                    <AntDesign.Col Span="2" style="border-left:1px solid #000000"><center></center></AntDesign.Col>
+                                    <AntDesign.Col Span="4" style="border:1px solid #000000"><center>新申请</center></AntDesign.Col>
+                                    <AntDesign.Col Span="4" style="border:1px solid #000000"><center>OA(国内、涉外)</center></AntDesign.Col>
+                                    <AntDesign.Col Span="4" style="border:1px solid #000000"><center>其它</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"></AntDesign.Col>
+                                    <AntDesign.Col Span="4" style="border:1px solid #000000">一次OA授权</AntDesign.Col>
+                                    <AntDesign.Col Span="4" style="border:1px solid #000000"></AntDesign.Col>
+                                </AntDesign.Row>
+                                <AntDesign.Row>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>代理人</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>承办</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>核稿</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>承办</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>核稿</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>承办</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>核稿</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>调查案</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>承办人</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>审核人</center></AntDesign.Col>
+                                    <AntDesign.Col Span="4" style="border:1px solid #000000"><center>总计</center></AntDesign.Col>
+                                </AntDesign.Row>
+                                <AntDesign.Row>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@_user.Name</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("新申请处理")</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("新申请审核")</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("OA处理")</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("OA审核")</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("其它处理")</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("其它审核")</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center></center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("一次OA授权处理")</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("一次OA授权审核")</center></AntDesign.Col>
+                                    <AntDesign.Col Span="4" style="border:1px solid #000000"><center>@GetStatistics("ALL")</center></AntDesign.Col>
+                                </AntDesign.Row>
 
-                                </div>
-                            </PageHeaderContent>
-                        </PageHeader>
+                            </div>
+                        </PageHeaderContent>
+                    </PageHeader>
 
-                        <AntDesign.Table DataSource="_Datas" TItem="PerformanceItem" @ref="@table"
-                                         @bind-PageIndex="_pageIndex"
-                                         @bind-PageSize="_pageSize"
-                                         Total="_total"
-                                         ScrollX="1150" Size="TableSize.Small" Bordered
-                                         @bind-SelectedRows="selectedItems"
-                                         OnRow="OnRow"
-                                         Loading="_loading"
-                                         RowClassName="@(x => x.Data.isDanger() ? "danger" : "")"
-                                         OnChange="HandleTableChange" RemoteDataSource>
-                            <RowTemplate>
-                                <AntDesign.Selection Key="@(context.Id.ToString())" Width="50" Fixed="left" />
-                                <AntDesign.Column Title="序号" TData="int" Width="50" Fixed="left">
-                                    @serialNumber(_pageIndex, _pageSize, context.Id)
-                                </AntDesign.Column>
-                                <AntDesign.Column Title="基础点数" TData="string" Width="120">@(context.BasePoint == null ? "" : context.BasePoint)</AntDesign.Column>
-                                <AntDesign.Column Title="我方文号" @bind-Field="@context.CaseNo" Width="150" Sortable Filterable />
-                                <AntDesign.Column Title="案件类型" @bind-Field="@context.CaseType" Width="120" Sortable Filterable />
-                                <AntDesign.Column Title="申请类型" @bind-Field="@context.ApplicationType" Width="120" Sortable Filterable/>
-                                <AntDesign.Column Title="案件系数"
-                                                  @bind-Field="@context.CaseCoefficient" Width="100"
-                                                  Filters="CaseCoeFilters"
-                                                  FilterMultiple="false"
-                                                  OnFilter="((value,name)=>name.StartsWith(value))"
-                                                  Sortable />
-                                <AntDesign.Column Title="处理事项" @bind-Field="@context.DoItem" Width="150" Sortable Filterable />
-                                <AntDesign.Column Title="处理事项系数" @bind-Field="@context.DoItemCoefficient" Width="150" Sortable Filterable />
-                                <AntDesign.Column Title="案件阶段" @bind-Field="@context.CaseStage" Width="100"></AntDesign.Column>
-                                <AntDesign.Column Title="处理人" TData="string" DataIndex="@nameof(context.ItemStaffs)" Width="150">
-                                    @if (context.ItemStaffs != null)
+                    <AntDesign.Table DataSource="_Datas" TItem="PerformanceItem" @ref="@table"
+                                        @bind-PageIndex="_pageIndex"
+                                        @bind-PageSize="_pageSize"
+                                        Total="_total"
+                                        ScrollX="1150" Size="TableSize.Small" Bordered
+                                        @bind-SelectedRows="selectedItems"
+                                        OnRow="OnRow"
+                                        Loading="_loading"
+                                        RowClassName="@(x => x.Data.isDanger() ? "danger" : "")"
+                                        OnChange="HandleTableChange" RemoteDataSource>
+                        <RowTemplate>
+                            <AntDesign.Selection Key="@(context.Id.ToString())" Width="50" Fixed="left" />
+                            <AntDesign.Column Title="序号" TData="int" Width="50" Fixed="left">
+                                @serialNumber(_pageIndex, _pageSize, context.Id)
+                            </AntDesign.Column>
+                            <AntDesign.Column Title="基础点数" TData="string" Width="120">@(context.BasePoint == null ? "" : context.BasePoint)</AntDesign.Column>
+                            <AntDesign.Column Title="我方文号" @bind-Field="@context.CaseNo" Width="150" Sortable Filterable />
+                            <AntDesign.Column Title="案件类型" @bind-Field="@context.CaseType" Width="120" Sortable Filterable />
+                            <AntDesign.Column Title="申请类型" @bind-Field="@context.ApplicationType" Width="120" Sortable Filterable/>
+                            <AntDesign.Column Title="案件系数"
+                                                @bind-Field="@context.CaseCoefficient" Width="100"
+                                                Filters="CaseCoeFilters"
+                                                FilterMultiple="false"
+                                                OnFilter="((value,name)=>name.StartsWith(value))"
+                                                Sortable />
+                            <AntDesign.Column Title="处理事项" @bind-Field="@context.DoItem" Width="150" Sortable Filterable />
+                            <AntDesign.Column Title="处理事项系数" @bind-Field="@context.DoItemCoefficient" Width="150" Sortable Filterable />
+                            <AntDesign.Column Title="案件阶段" @bind-Field="@context.CaseStage" Width="100"></AntDesign.Column>
+                            <AntDesign.Column Title="处理人" TData="string" DataIndex="@nameof(context.ItemStaffs)" Width="150">
+                                @if (context.ItemStaffs != null)
+                                {
+                                    foreach (ItemStaff itemStaff in context.ItemStaffs)
                                     {
-                                        foreach (ItemStaff itemStaff in context.ItemStaffs)
-                                        {
-                                            <span>@(itemStaff.DoPerson.Name)&nbsp;</span>
-                                        }
+                                        <span>@(itemStaff.DoPerson.Name)&nbsp;</span>
                                     }
-                                </AntDesign.Column>
-                                <AntDesign.Column Title="核稿人" TData="string" Width="100">@(context.Reviewer == null ? "" : context.Reviewer.Name)</AntDesign.Column>
+                                }
+                            </AntDesign.Column>
+                            <AntDesign.Column Title="核稿人" TData="string" Width="100">@(context.Reviewer == null ? "" : context.Reviewer.Name)</AntDesign.Column>
 
-                                <ActionColumn Fixed="right" Title="操作" Width="50" Style="text-align:right">
-                                    <Space>
-                                        <SpaceItem>
-                                            @{
-                                                var menuItems = apTypeService.GetItems(context);
-                                                if (menuItems.Count > 0)
-                                                {
-                                                    <AntDesign.Dropdown>
-                                                        <Overlay>
-                                                            <Menu>
-                                                                @foreach (var apType in menuItems)
-                                                                {
-                                                                    <MenuItem @key="@($"{context.Id}-{apType.Id}")" OnClick="()=>ShowModel(context,apType)">@apType.Name</MenuItem>
-                                                                }
+                            <ActionColumn Fixed="right" Title="操作" Width="50" Style="text-align:right">
+                                <Space>
+                                    <SpaceItem>
+                                        @{
+                                            var menuItems = apTypeService.GetItems(context);
+                                            if (menuItems.Count > 0)
+                                            {
+                                                <AntDesign.Dropdown>
+                                                    <Overlay>
+                                                        <Menu>
+                                                            @foreach (var apType in menuItems)
+                                                            {
+                                                                <MenuItem @key="@($"{context.Id}-{apType.Id}")" OnClick="()=>ShowModel(context,apType)">@apType.Name</MenuItem>
+                                                            }
 
-                                                            </Menu>
-                                                        </Overlay>
-                                                        <ChildContent>
-                                                            <Button Type="Primary" Icon="down" Style="background: #f6ffed;"></Button>
-                                                        </ChildContent>
-                                                    </AntDesign.Dropdown>
-                                                }
+                                                        </Menu>
+                                                    </Overlay>
+                                                    <ChildContent>
+                                                        <Button Type="Primary" Icon="down" Style="background: #f6ffed;"></Button>
+                                                    </ChildContent>
+                                                </AntDesign.Dropdown>
                                             }
+                                        }
 
-                                        </SpaceItem>
-                                    </Space>
+                                    </SpaceItem>
+                                </Space>
 
-                                </ActionColumn>
-                            </RowTemplate>
-                            <ExpandTemplate>
-                                <div style="width:1000px;margin-left:30px;">
-                                    <Card Title=@("详情")>
-                                        <Body>
-                                            <Descriptions Bordered Size="@DescriptionsSize.Small">
-                                                <DescriptionsItem Title="绩效特殊字段" Span="3">
-                                                    <Select DataSource="@_afService.GetItems(context.Data)"
-                                                            @bind-Value="@context.Data.AgentFeedbackMemo"
-                                                            LabelName="@nameof(Reason.Name)"
-                                                            ValueName="@nameof(Reason.Value)"
-                                                            Placeholder="请选项一项"
-                                                            DefaultActiveFirstItem="false"
-                                                            EnableSearch="true"
-                                                            AllowClear="true"
-                                                            Style="width:220px;"
-                                                            OnSelectedItemChanged="SelectChanged"
-                                                            OnClearSelected="() => ClearSelect(context.Data.Id)"
-                                                            OnFocus="() => OnFocus(context.Data)">
-                                                    </Select>
-                                                </DescriptionsItem>
-                                                <DescriptionsItem Title="完成时间">@(context.Data.FinishedDate.HasValue ? context.Data.FinishedDate.Value.ToString("yyyy-MM-dd") : "")</DescriptionsItem>
-                                                <DescriptionsItem Title="返稿日">@(context.Data.ReturnDate.HasValue ? context.Data.ReturnDate.Value.ToString("yyyy-MM-dd") : "")</DescriptionsItem>
-                                                <DescriptionsItem Title="客户期限">@(context.Data.CustomerLimitDate.HasValue ? context.Data.CustomerLimitDate.Value.ToString("yyyy-MM-dd") : "")</DescriptionsItem>
-                                                <DescriptionsItem Title="初稿日">@(context.Data.FirstDraftDate.HasValue ? context.Data.FirstDraftDate.Value.ToString("yyyy-MM-dd") : "")</DescriptionsItem>
-                                                <DescriptionsItem Title="内部期限">@(context.Data.InternalDate.HasValue ? context.Data.InternalDate.Value.ToString("yyyy-MM-dd") : "")</DescriptionsItem>
-                                                <DescriptionsItem Title="案件状态">@context.Data.CaseState</DescriptionsItem>
-                                                <DescriptionsItem Title="处理事项备注">@context.Data.DoItemMemo</DescriptionsItem>
-                                                <DescriptionsItem Title="案件名称" Span="2">@context.Data.CaseName</DescriptionsItem>
-                                                <DescriptionsItem Title="申请人" Span="3">@context.Data.ApplicationName</DescriptionsItem>
-                                                <DescriptionsItem Title="备注" Span="3">@context.Data.CaseMemo</DescriptionsItem>
+                            </ActionColumn>
+                        </RowTemplate>
+                        <ExpandTemplate>
+                            <div style="width:1000px;margin-left:30px;">
+                                <Card Title=@("详情")>
+                                    <Body>
+                                        <Descriptions Bordered Size="@DescriptionsSize.Small">
+                                            <DescriptionsItem Title="绩效特殊字段" Span="3">
+                                                <Select DataSource="@_afService.GetItems(context.Data)"
+                                                        @bind-Value="@context.Data.AgentFeedbackMemo"
+                                                        LabelName="@nameof(Reason.Name)"
+                                                        ValueName="@nameof(Reason.Value)"
+                                                        Placeholder="请选项一项"
+                                                        DefaultActiveFirstItem="false"
+                                                        EnableSearch="true"
+                                                        AllowClear="true"
+                                                        Style="width:220px;"
+                                                        OnSelectedItemChanged="SelectChanged"
+                                                        OnClearSelected="() => ClearSelect(context.Data.Id)"
+                                                        OnFocus="() => OnFocus(context.Data)">
+                                                </Select>
+                                            </DescriptionsItem>
+                                            <DescriptionsItem Title="完成时间">@(context.Data.FinishedDate.HasValue ? context.Data.FinishedDate.Value.ToString("yyyy-MM-dd") : "")</DescriptionsItem>
+                                            <DescriptionsItem Title="返稿日">@(context.Data.ReturnDate.HasValue ? context.Data.ReturnDate.Value.ToString("yyyy-MM-dd") : "")</DescriptionsItem>
+                                            <DescriptionsItem Title="客户期限">@(context.Data.CustomerLimitDate.HasValue ? context.Data.CustomerLimitDate.Value.ToString("yyyy-MM-dd") : "")</DescriptionsItem>
+                                            <DescriptionsItem Title="初稿日">@(context.Data.FirstDraftDate.HasValue ? context.Data.FirstDraftDate.Value.ToString("yyyy-MM-dd") : "")</DescriptionsItem>
+                                            <DescriptionsItem Title="内部期限">@(context.Data.InternalDate.HasValue ? context.Data.InternalDate.Value.ToString("yyyy-MM-dd") : "")</DescriptionsItem>
+                                            <DescriptionsItem Title="案件状态">@context.Data.CaseState</DescriptionsItem>
+                                            <DescriptionsItem Title="处理事项备注">@context.Data.DoItemMemo</DescriptionsItem>
+                                            <DescriptionsItem Title="案件名称" Span="2">@context.Data.CaseName</DescriptionsItem>
+                                            <DescriptionsItem Title="申请人" Span="3">@context.Data.ApplicationName</DescriptionsItem>
+                                            <DescriptionsItem Title="备注" Span="3">@context.Data.CaseMemo</DescriptionsItem>
 
-                                            </Descriptions>
-                                        </Body>
-                                    </Card>
-                                </div>
-                            </ExpandTemplate>
-                        </AntDesign.Table>
-                    }
-                    else
-                    {
-                        <AntDesign.Table DataSource="_Datas" TItem="PerformanceItem" @ref="@table"
-                                         @bind-PageIndex="_pageIndex"
-                                         @bind-PageSize="_pageSize"
-                                         Total="_total" ScrollX="1200"
-                                         Size="TableSize.Small" Bordered
-                                         @bind-SelectedRows="selectedItems"
-                                         OnRow="OnRow"
-                                         Loading="_loading"
-                                         OnChange="HandleTableChange" RemoteDataSource>
-                            <RowTemplate>
-                                <AntDesign.Selection Key="@(context.Id.ToString())" Width="50" Fixed="left" />
-                                <AntDesign.Column Title="序号" TData="int" Width="50" Fixed="left">
-                                    @serialNumber(_pageIndex, _pageSize, context.Id)
-                                </AntDesign.Column>
+                                        </Descriptions>
+                                    </Body>
+                                </Card>
+                            </div>
+                        </ExpandTemplate>
+                    </AntDesign.Table>
+                }
+                else
+                {
+                    <AntDesign.Table DataSource="_Datas" TItem="PerformanceItem" @ref="@table"
+                                        @bind-PageIndex="_pageIndex"
+                                        @bind-PageSize="_pageSize"
+                                        Total="_total" ScrollX="1200"
+                                        Size="TableSize.Small" Bordered
+                                        @bind-SelectedRows="selectedItems"
+                                        OnRow="OnRow"
+                                        Loading="_loading"
+                                        OnChange="HandleTableChange" RemoteDataSource>
+                        <RowTemplate>
+                            <AntDesign.Selection Key="@(context.Id.ToString())" Width="50" Fixed="left" />
+                            <AntDesign.Column Title="序号" TData="int" Width="50" Fixed="left">
+                                @serialNumber(_pageIndex, _pageSize, context.Id)
+                            </AntDesign.Column>
 
-                                <AntDesign.Column Title="基础点数" TData="string" Width="100">@(context.BasePoint == null ? "" : context.BasePoint)</AntDesign.Column>
-                                <AntDesign.Column Title="我方文号" @bind-Field="@context.CaseNo" Width="150" Sortable Filterable />
-                                <AntDesign.Column Title="案件类型" @bind-Field="@context.CaseType" Width="120" Sortable Filterable />
-                                <AntDesign.Column Title="案件系数"
-                                                  @bind-Field="@context.CaseCoefficient" Width="120"
-                                                  Filters="CaseCoeFilters"
-                                                  FilterMultiple="false"
-                                                  OnFilter="((value,name)=>name.StartsWith(value))"
-                                                  Sortable />
-                                <AntDesign.Column Title="处理事项" @bind-Field="@context.DoItem" Width="150" Sortable Filterable />
-                                <AntDesign.Column Title="处理事项系数" @bind-Field="@context.DoItemCoefficient" Width="150" Sortable Filterable />
-                                <AntDesign.Column Title="绩效特殊字段" @bind-Field="@context.AgentFeedbackMemo" Width="250" />
-                                <AntDesign.Column Title="案件阶段" @bind-Field="@context.CaseStage" Width="100"></AntDesign.Column>
-                                <AntDesign.Column Title="处理人" TData="string" DataIndex="@nameof(context.ItemStaffs)" Width="150">
-                                    @if (context.ItemStaffs != null)
+                            <AntDesign.Column Title="基础点数" TData="string" Width="100">@(context.BasePoint == null ? "" : context.BasePoint)</AntDesign.Column>
+                            <AntDesign.Column Title="我方文号" @bind-Field="@context.CaseNo" Width="150" Sortable Filterable />
+                            <AntDesign.Column Title="案件类型" @bind-Field="@context.CaseType" Width="120" Sortable Filterable />
+                            <AntDesign.Column Title="案件系数"
+                                                @bind-Field="@context.CaseCoefficient" Width="120"
+                                                Filters="CaseCoeFilters"
+                                                FilterMultiple="false"
+                                                OnFilter="((value,name)=>name.StartsWith(value))"
+                                                Sortable />
+                            <AntDesign.Column Title="处理事项" @bind-Field="@context.DoItem" Width="150" Sortable Filterable />
+                            <AntDesign.Column Title="处理事项系数" @bind-Field="@context.DoItemCoefficient" Width="150" Sortable Filterable />
+                            <AntDesign.Column Title="绩效特殊字段" @bind-Field="@context.AgentFeedbackMemo" Width="250" />
+                            <AntDesign.Column Title="案件阶段" @bind-Field="@context.CaseStage" Width="100"></AntDesign.Column>
+                            <AntDesign.Column Title="处理人" TData="string" DataIndex="@nameof(context.ItemStaffs)" Width="150">
+                                @if (context.ItemStaffs != null)
+                                {
+                                    foreach (ItemStaff itemStaff in context.ItemStaffs)
                                     {
-                                        foreach (ItemStaff itemStaff in context.ItemStaffs)
-                                        {
-                                            <span>@(itemStaff.DoPerson.Name)&nbsp;</span>
-                                        }
+                                        <span>@(itemStaff.DoPerson.Name)&nbsp;</span>
                                     }
-                                </AntDesign.Column>
-                                <AntDesign.Column Title="核稿人" TData="string" Width="100">@(context.Reviewer == null ? "" : context.Reviewer.Name)</AntDesign.Column>
-                            </RowTemplate>
-                            <ExpandTemplate>
-                                <div style="width:1000px;margin-left:30px;">
-                                    <Card Title=@("详情")>
-                                        <Body>
-                                            <Descriptions Bordered Size="@DescriptionsSize.Small">
-                                                <DescriptionsItem Title="完成时间">@(context.Data.FinishedDate.HasValue ? context.Data.FinishedDate.Value.ToString("yyyy-MM-dd") : "")</DescriptionsItem>
-                                                <DescriptionsItem Title="返稿日">@(context.Data.ReturnDate.HasValue ? context.Data.ReturnDate.Value.ToString("yyyy-MM-dd") : "")</DescriptionsItem>
-                                                <DescriptionsItem Title="客户期限">@(context.Data.CustomerLimitDate.HasValue ? context.Data.CustomerLimitDate.Value.ToString("yyyy-MM-dd") : "")</DescriptionsItem>
-                                                <DescriptionsItem Title="初稿日">@(context.Data.FirstDraftDate.HasValue ? context.Data.FirstDraftDate.Value.ToString("yyyy-MM-dd") : "")</DescriptionsItem>
-                                                <DescriptionsItem Title="内部期限">@(context.Data.InternalDate.HasValue ? context.Data.InternalDate.Value.ToString("yyyy-MM-dd") : "")</DescriptionsItem>
-                                                <DescriptionsItem Title="案件状态">@context.Data.CaseState</DescriptionsItem>
-                                                <DescriptionsItem Title="处理事项备注">@context.Data.DoItemMemo</DescriptionsItem>
-                                                <DescriptionsItem Title="案件名称" Span="2">@context.Data.CaseName</DescriptionsItem>
-                                                <DescriptionsItem Title="申请人" Span="3">@context.Data.ApplicationName</DescriptionsItem>
-                                                <DescriptionsItem Title="备注" Span="3">@context.Data.CaseMemo</DescriptionsItem>
-                                            </Descriptions>
-                                        </Body>
-                                    </Card>
-                                </div>
-                            </ExpandTemplate>
-                        </AntDesign.Table>
-                    }
+                                }
+                            </AntDesign.Column>
+                            <AntDesign.Column Title="核稿人" TData="string" Width="100">@(context.Reviewer == null ? "" : context.Reviewer.Name)</AntDesign.Column>
+                        </RowTemplate>
+                        <ExpandTemplate>
+                            <div style="width:1000px;margin-left:30px;">
+                                <Card Title=@("详情")>
+                                    <Body>
+                                        <Descriptions Bordered Size="@DescriptionsSize.Small">
+                                            <DescriptionsItem Title="完成时间">@(context.Data.FinishedDate.HasValue ? context.Data.FinishedDate.Value.ToString("yyyy-MM-dd") : "")</DescriptionsItem>
+                                            <DescriptionsItem Title="返稿日">@(context.Data.ReturnDate.HasValue ? context.Data.ReturnDate.Value.ToString("yyyy-MM-dd") : "")</DescriptionsItem>
+                                            <DescriptionsItem Title="客户期限">@(context.Data.CustomerLimitDate.HasValue ? context.Data.CustomerLimitDate.Value.ToString("yyyy-MM-dd") : "")</DescriptionsItem>
+                                            <DescriptionsItem Title="初稿日">@(context.Data.FirstDraftDate.HasValue ? context.Data.FirstDraftDate.Value.ToString("yyyy-MM-dd") : "")</DescriptionsItem>
+                                            <DescriptionsItem Title="内部期限">@(context.Data.InternalDate.HasValue ? context.Data.InternalDate.Value.ToString("yyyy-MM-dd") : "")</DescriptionsItem>
+                                            <DescriptionsItem Title="案件状态">@context.Data.CaseState</DescriptionsItem>
+                                            <DescriptionsItem Title="处理事项备注">@context.Data.DoItemMemo</DescriptionsItem>
+                                            <DescriptionsItem Title="案件名称" Span="2">@context.Data.CaseName</DescriptionsItem>
+                                            <DescriptionsItem Title="申请人" Span="3">@context.Data.ApplicationName</DescriptionsItem>
+                                            <DescriptionsItem Title="备注" Span="3">@context.Data.CaseMemo</DescriptionsItem>
+                                        </Descriptions>
+                                    </Body>
+                                </Card>
+                            </div>
+                        </ExpandTemplate>
+                    </AntDesign.Table>
                 }
-            </Card>
+            }
+        </Card>
 
-        </ChildContent>
+    </ChildContent>
    
 </PageContainer>
 

+ 6 - 0
wispro.sp.web/Pages/AppCase/MyCaselist.razor.cs

@@ -67,10 +67,16 @@ namespace wispro.sp.web.Pages.AppCase
         private bool isFirstInit = true;
         private Table<PerformanceItem> table;
         private CurrentUser _user;
+        private  string strAddProjectJX ="";
         protected async override Task OnInitializedAsync()
         {
             if (isFirstInit)
             {
+                var Roles = await _authService.GetRoles("AddProjectJX");
+                foreach(var role in Roles)
+                {
+                    strAddProjectJX = (string.IsNullOrEmpty(strAddProjectJX)) ? role : $"{strAddProjectJX},{role}";
+                }
 
                 _loading = true;
                 await RefreshMyStatistics();

+ 1 - 1
wispro.sp.web/Pages/CustomerList.razor

@@ -5,7 +5,7 @@
 @inject MessageService _message
 @using System.ComponentModel
 @using wispro.sp.share
-@attribute [Authorize]
+@attribute [Authorize(Roles = "Admin")]
 
 <PageContainer>
     <Breadcrumb>

+ 2 - 1
wispro.sp.web/Pages/Organization/Department.razor

@@ -131,7 +131,8 @@
     <Form Model="EditingStaff" LabelColSpan="6"
           WrapperColSpan="16">
         <FormItem Label="姓名">
-            <Input @bind-Value="@context.Name" />
+            <wispro.sp.web.Components.StaffAutoComplete OnSelected="UserSelected" @bind-SelectName="@context.Name"/>
+            @*<Input @bind-Value="@context.Name" />*@
         </FormItem>
         <FormItem Label="岗位状态">
             <Input @bind-Value="@context.Status" />

+ 8 - 13
wispro.sp.web/Pages/Organization/Department.razor.cs

@@ -86,9 +86,7 @@ namespace wispro.sp.web.Pages.Organization
         private async System.Threading.Tasks.Task NewOk(MouseEventArgs e)
         {
             newModal = false;
-            //Console.WriteLine(JsonSerializer.Serialize(_editDepartment)); 
             var retObj = await orgService.SaveDept(_editDepartment);
-            //Console.WriteLine(JsonSerializer.Serialize(retObj)); 
             departments = await orgService.GetDepartments();
             StateHasChanged();
         }
@@ -102,7 +100,6 @@ namespace wispro.sp.web.Pages.Organization
         async Task OnSelect(TreeEventArgs<entity.Department> e)
         {
             _editDepartment = e.Node.DataItem;
-            //Console.WriteLine($"OnSelect:{JsonSerializer.Serialize(_editDepartment)}" );
             _loading = true;
             var data = await orgService.GetStaffs(_editDepartment, 1, 1000);
             forecasts = data.Results;
@@ -118,23 +115,16 @@ namespace wispro.sp.web.Pages.Organization
             if(dept == null)
             {
                 var retList = departments.Where<wispro.sp.entity.Department>(x => x.parentId == null).OrderBy(x=>x.order_num).ToList();
-                Console.WriteLine(JsonSerializer.Serialize(retList));
                 return retList;
             }
             else
             {
                 var retList = departments.Where<wispro.sp.entity.Department>(x => x.parentId == dept.Id).OrderBy(x => x.order_num).ToList();
-                Console.WriteLine(JsonSerializer.Serialize(retList));
                 return retList;
             }
             
         }
 
-        void HandleRightClick(MouseEventArgs args)
-        {
-            if (args.Button == 2)
-                Console.WriteLine("This is a right click");
-        }
 
         #region 职员操作
         private List<Staff> forecasts;
@@ -147,7 +137,6 @@ namespace wispro.sp.web.Pages.Organization
         
 
         Staff EditingStaff = null;
-        bool _visible = false;
 
         bool _isAdd = false;
 
@@ -155,7 +144,6 @@ namespace wispro.sp.web.Pages.Organization
 
         string[] _places = new string[] { "深圳", "苏州", "南通", "西安", "北京", "杭州", "武汉" };
 
-        int _SelectGradeId;
 
         bool _newUserModal = false;
         private void AddNewUser()
@@ -191,10 +179,13 @@ namespace wispro.sp.web.Pages.Organization
         {
             EditingStaff = staff;
             selectPosition = await orgService.getPosition(staff, _editDepartment);
+
+            
             if(selectPosition == null)
             {
                 selectPosition = new Position();
             }
+            Console.WriteLine($"Edit:{JsonSerializer.Serialize(selectPosition)}");
             PositionId = selectPosition.Id;
             _isAdd = false;
             _newUserModal  = true;
@@ -223,7 +214,6 @@ namespace wispro.sp.web.Pages.Organization
         {
             if (!_loading)
             {
-                Console.WriteLine($"OnChange:{JsonSerializer.Serialize(queryModel)}");
                 _loading = true;
                 ListApiResponse<Staff> data = await orgService.GetStaffs(_editDepartment, queryModel); //Http.GetFromJsonAsync<ListApiResponse<Staff>>("http://localhost:39476/api/Staff/Query?" + GetRandomuserParams(queryModel));
 
@@ -285,6 +275,11 @@ namespace wispro.sp.web.Pages.Organization
             selectPosition  = value;
             //PositionIdChanged.InvokeAsync(_SelectedItem.Id);
         }
+
+        void UserSelected(Staff staff)
+        {
+            EditingStaff = staff;
+        }
         #endregion
     }
 }

+ 18 - 1
wispro.sp.web/Pages/Project/AssignPoint.razor

@@ -18,13 +18,30 @@
                 <Form Model="task">
                     <FormItem Label="我方文号">
                         <Input @bind-Value="@context.CaseNo" />
+                        <Button Icon="refresh" @onclick="()=>GetProjectInfo()" Loading="@loading">获取专案信息</Button>
                     </FormItem>
                     <FormItem Label="案件名称">
                         <Input @bind-Value="@context.CaseName" />
                     </FormItem>
                     <FormItem Label="分配说明">
-                        <TextArea  @bind-Value="@context.Reason" Rows="4"/>
+                        <TextArea @bind-Value="@context.Reason" Rows="4" />
                     </FormItem>
+                    @if (Item != null)
+                    {
+                        <Collapse DefaultActiveKey="@(new[]{"1"})">
+                            <Panel Header="项目详情" Key="1">
+                                <FormItem Label="客户">
+                                    <span>@Item.Customer.Name</span>
+                                </FormItem>
+                                <FormItem Label="案件状态">
+                                    <span>@Item.CaseState</span>
+                                </FormItem>
+                                <FormItem Label="案件备注">
+                                    <span>@Item.CaseMemo</span>
+                                </FormItem>
+                            </Panel>
+                        </Collapse>
+                    }
                 </Form>
             </Card>
             <Card>

+ 43 - 26
wispro.sp.web/Pages/Project/AssignPoint.razor.cs

@@ -26,24 +26,24 @@ namespace wispro.sp.web.Pages.Project
         ProjectPointRecord task = new()
         {
             
-            CaseNo = "S2112394",
-            CaseName = "美的-洗碗机专利调查",
+            //CaseNo = "S2112394",
+            //CaseName = "美的-洗碗机专利调查",
                 
-             ProjectDoItemPoints = new List<ProjectDoItemPoint>()
-             {
-                new ProjectDoItemPoint(){ DoItem="检索策略评估",  DoItemCoefficient="B", 
-                    PersonPoints=new List<PersonPoint>{
-                        new PersonPoint(){Id="1", Person ="李申", Point=1.0 },
-                        new PersonPoint(){Id="2", Person ="张三", Point=1.0 },
-                        new PersonPoint(){Id="3", Person ="李四", Point=1.0 },
-                    }},
-                new ProjectDoItemPoint(){ DoItem="专利分类",  DoItemCoefficient="A", 
-                    PersonPoints=new List<PersonPoint>{
-                        new PersonPoint(){Id="1",  Person ="李申", Point=2.0 },
-                        new PersonPoint(){Id="2",  Person ="张三", Point=1.50 },
-                        new PersonPoint(){Id="3",  Person ="李四", Point=2.5 },
-                    }},
-             }
+            // ProjectDoItemPoints = new List<ProjectDoItemPoint>()
+            // {
+            //    new ProjectDoItemPoint(){ DoItem="检索策略评估",  DoItemCoefficient="B", 
+            //        PersonPoints=new List<PersonPoint>{
+            //            new PersonPoint(){Id="1", Person ="李申", Point=1.0 },
+            //            new PersonPoint(){Id="2", Person ="张三", Point=1.0 },
+            //            new PersonPoint(){Id="3", Person ="李四", Point=1.0 },
+            //        }},
+            //    new ProjectDoItemPoint(){ DoItem="专利分类",  DoItemCoefficient="A", 
+            //        PersonPoints=new List<PersonPoint>{
+            //            new PersonPoint(){Id="1",  Person ="李申", Point=2.0 },
+            //            new PersonPoint(){Id="2",  Person ="张三", Point=1.50 },
+            //            new PersonPoint(){Id="3",  Person ="李四", Point=2.5 },
+            //        }},
+            // }
         };
 
         ProjectDoItemPoint addDoItem;
@@ -72,7 +72,6 @@ namespace wispro.sp.web.Pages.Project
 
         private void HandleCancel(MouseEventArgs e)
         {
-            //Console.WriteLine(e);
             _visible = false;
             model.Dispose();
         }
@@ -93,13 +92,11 @@ namespace wispro.sp.web.Pages.Project
         void stopEdit()
         {
             //var editedData = addDoItem.AddprojectPoints.FirstOrDefault(x => x.person == editId);
-            //Console.WriteLine(JsonSerializer.Serialize(editedData));
             editId = null;
         }
 
         void Delete(string doItem, string person)
         {
-            Console.WriteLine(JsonSerializer.Serialize(task));
             if (_visible)
             {
                 var editedData = addDoItem.PersonPoints.FirstOrDefault(x => x.Person  == person);
@@ -109,14 +106,11 @@ namespace wispro.sp.web.Pages.Project
             {
                 
                 var editedData = task.ProjectDoItemPoints .FirstOrDefault(x => x.DoItem  == doItem);
-                Console.WriteLine(JsonSerializer.Serialize(editedData));
                 var personPoint = editedData.PersonPoints.FirstOrDefault(x => x.Id  == person);
-                Console.WriteLine(JsonSerializer.Serialize(personPoint));
                 editedData.PersonPoints.Remove(personPoint);
                 
             }
 
-            Console.WriteLine(JsonSerializer.Serialize(task));
             StateHasChanged();
         }
 
@@ -169,9 +163,17 @@ namespace wispro.sp.web.Pages.Project
         async Task OnSave()
         {
             //添加保存代码
-            await _itemService.AddProjectPerformanctItem(task);
-            await MsgSvr.Info("项目绩效保存成功!");
-            _NavigationManager.NavigateTo("/MyCaseList");
+            var response = await _itemService.AddProjectPerformanctItem(task);
+
+            if (response.Success)
+            {
+                await MsgSvr.Info("项目绩效保存成功!");
+                _NavigationManager.NavigateTo("/MyCaseList");
+            }
+            else
+            {
+                await MsgSvr.Error(response.ErrorMessage);
+            }
 
         }
 
@@ -179,6 +181,21 @@ namespace wispro.sp.web.Pages.Project
         {
             _NavigationManager.NavigateTo("/MyCaseList");
         }
+
+        private PerformanceItem Item;
+        private bool loading = false;
+        async Task GetProjectInfo()
+        {
+            loading = true;
+            Item = await _itemService.GetProjectInfo(task.CaseNo);
+
+            if(Item != null)
+            {
+                task.CaseName = Item.CaseName;
+                task.CaseNo = Item.CaseNo;
+            }
+            loading = false;
+        }
     }
 
     

+ 1 - 1
wispro.sp.web/Pages/StaffGrade.razor

@@ -6,7 +6,7 @@
 @using System.ComponentModel
 @using wispro.sp.share
 
-@attribute [Authorize]
+@attribute [Authorize(Roles = "Admin")]
 <PageContainer>
     <Breadcrumb>
         <Breadcrumb>

+ 1 - 1
wispro.sp.web/Pages/StaffList.razor

@@ -4,7 +4,7 @@
 @inject MessageService _message
 @using System.ComponentModel
 @using wispro.sp.share;
-@attribute [Authorize]
+@attribute [Authorize(Roles ="Admin")]
 <PageContainer>
     <Breadcrumb>
         <Breadcrumb>

+ 0 - 3
wispro.sp.web/Pages/Welcome.razor

@@ -90,15 +90,12 @@
                 </Card>
             </AntDesign.Col>
             <AntDesign.Col Xl="8" Lg="24" Md="24" Sm="24" Xs="24">
-
-
                 <Card Style="margin-bottom: 24px;"
                       Title="绩效数据统计">
                     <div class="chart">
                         <wispro.sp.web.Components.Radar HasLegend="false" />
                     </div>
                 </Card>
-
             </AntDesign.Col>
         </Row>
     </ChildContent>

+ 3 - 4
wispro.sp.web/Pages/Welcome.razor.cs

@@ -44,14 +44,12 @@ namespace wispro.sp.web.Pages
             await base.OnInitializedAsync();
             _CurrentUser =await _userService.GetUser();
 
-            //Console.WriteLine(JsonSerializer.Serialize(_CurrentUser));
 
             if (_CurrentUser != null)
             {
                 //_projectNotice = await ProjectService.GetProjectNoticeAsync();
                 //_activities = await ProjectService.GetActivitiesAsync();
                 AppealRecords = await _atService.GetUserAppeals(_CurrentUser.Userid);
-                //Console.WriteLine(JsonSerializer.Serialize(AppealRecords));
                 if (AppealRecords != null)
                 {
                     //_user = await _userService.GetUser();
@@ -99,13 +97,11 @@ namespace wispro.sp.web.Pages
 
             _modalRef.OnOpen = () =>
             {
-                //Console.WriteLine("ModalRef OnOpen");
                 return Task.CompletedTask;
             };
 
             _modalRef.OnOk = async () =>
             {
-                //Console.WriteLine(JsonSerializer.Serialize(templateOptions));
                 try
                 {
                     await _atService.ReviewerAppeal(templateOptions);
@@ -166,5 +162,8 @@ namespace wispro.sp.web.Pages
             };
             StateHasChanged();
         }
+
+        
+        
     }
 }

+ 8 - 0
wispro.sp.web/Services/AuthService.cs

@@ -54,5 +54,13 @@ namespace wispro.sp.web.Services
             ((JwtAuthenticationStateProvider)authenticationStateProvider).NotifyUserLogOut();
             //httpClient.DefaultRequestHeaders.Authorization = null;
         }
+
+        public async Task<List<string>> GetRoles(string resourceId)
+        {
+            
+            var httpResponse = await httpClient.Get<List<string>>($"account/GetRoles?ResourceId={resourceId}");
+            return httpResponse;
+            
+        }
     }
 }

+ 1 - 1
wispro.sp.web/Services/HttpService.cs

@@ -82,7 +82,7 @@ namespace wispro.sp.web.Services
                 }
             }
             catch(Exception ex) {
-                Console.WriteLine(ex.ToString());
+                //Console.WriteLine(ex.ToString());
             }
 
             using HttpResponseMessage response = await _httpClient.SendAsync(request);

+ 2 - 0
wispro.sp.web/Services/IAuthService.cs

@@ -11,5 +11,7 @@ namespace wispro.sp.web.Services
         Task<bool> LoginAsync(loginDto userInfo);
 
         Task LogoutAsync();
+
+        Task<List<string>> GetRoles(string ResourceId);
     }
 }

+ 6 - 0
wispro.sp.web/Services/PerformanceItemServices.cs

@@ -131,6 +131,12 @@ namespace wispro.sp.web.Services
             return data;
         }
 
+        public async  Task<PerformanceItem> GetProjectInfo(string caseNo)
+        {
+            var data = await _httpClient.Get<PerformanceItem>($"IPEasy/GetCaseInfo?CaseNo={caseNo}");
+            return data;
+        }
+
         public async Task<ApiSaveResponse> AddProjectPerformanctItem(ProjectPointRecord projectPoint)
         {
             var data = await _httpClient.Post<ApiSaveResponse>($"PerformanceItem/AddProjectPerformance",projectPoint);

+ 22 - 2
wispro.sp.web/Utils/JwtPaser.cs

@@ -13,10 +13,30 @@ namespace wispro.sp.web.Utils
         {
             var claims = new List<Claim>();
             var payload = jwt.Split('.')[1];
-
             var jsonBytes = ParseBase64WithoutPadding(payload);
-
             var keyValuePairs = JsonSerializer.Deserialize<Dictionary<string, object>>(jsonBytes);
+
+            keyValuePairs.TryGetValue(ClaimTypes.Role, out object roles);
+
+            if (roles != null)
+            {
+                if (roles.ToString().Trim().StartsWith(","))
+                {
+                    var parsedRoles = JsonSerializer.Deserialize<string[]>(roles.ToString());
+
+                    foreach (var parsedRole in parsedRoles)
+                    {
+                        claims.Add(new Claim(ClaimTypes.Role, parsedRole));
+                    }
+                }
+                else
+                {
+                    claims.Add(new Claim(ClaimTypes.Role, roles.ToString()));
+                }
+
+                keyValuePairs.Remove(ClaimTypes.Role);
+            }
+
             claims.AddRange(keyValuePairs.Select(kvp => new Claim(kvp.Key, kvp.Value.ToString())));
             return claims;
         }

+ 25 - 0
wospro.sp.entity/UserDefine.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace wispro.sp.entity
+{
+    public class UserDefine
+    {
+        public UserDefineFieldTypes FieldType { get; set; }
+
+        public string Value { get; set; }
+
+        public UserDefine Next { get; set; }
+    }
+
+    public enum UserDefineFieldTypes
+    {
+        Department,
+        Position,
+        User,
+        Role,
+    }
+}