From e12f5406525b1827618a05d17400c35a2f34af63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=C2=B7=C3=A6?= <279202647@qq.com> Date: Tue, 23 Nov 2021 18:13:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=AF=94=E4=BB=B7=E5=88=86?= =?UTF-8?q?=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HuiYan/pricetasklogController.cs | 84 ++++++++ .../Controllers/MDS/userController.cs | 65 +++++++ .../MDS/userdepartmentController.cs | 65 +++++++ .../Controllers/MDS/userroleController.cs | 65 +++++++ src/Coldairarrow.Api/Program.cs | 4 + src/Coldairarrow.Api/Startup.cs | 5 + src/Coldairarrow.Api/appsettings.json | 6 + .../HuiYan/catsBusiness.cs | 1 + .../HuiYan/pricetasklogBusiness.cs | 184 ++++++++++++++++++ .../HuiYan/teamitemsBusiness.cs | 12 +- src/Coldairarrow.Business/MDS/userBusiness.cs | 93 +++++++++ .../MDS/userdepartmentBusiness.cs | 66 +++++++ .../MDS/userroleBusiness.cs | 66 +++++++ src/Coldairarrow.Entity/DTO/PricetaskUser.cs | 32 +++ src/Coldairarrow.Entity/DTO/UserRoleDto.cs | 15 ++ src/Coldairarrow.Entity/Enum/teamItemState.cs | 39 ++++ .../HuiYan/pricetasklog.cs | 57 ++++++ src/Coldairarrow.Entity/HuiYan/teamitems.cs | 4 + src/Coldairarrow.Entity/MDS/user.cs | 95 +++++++++ src/Coldairarrow.Entity/MDS/userdepartment.cs | 46 +++++ src/Coldairarrow.Entity/MDS/userrole.cs | 56 ++++++ .../HuiYan/IpricetasklogBusiness.cs | 18 ++ .../MDS/IuserBusiness.cs | 20 ++ .../MDS/IuserdepartmentBusiness.cs | 16 ++ .../MDS/IuserroleBusiness.cs | 16 ++ .../DataAccess/IMDSDbAccessor.cs | 14 ++ .../views/HuiYan/pricetasklog/EditForm.vue | 89 +++++++++ .../src/views/HuiYan/pricetasklog/List.vue | 162 +++++++++++++++ .../src/views/MDS/user/EditForm.vue | 110 +++++++++++ .../src/views/MDS/user/List.vue | 172 ++++++++++++++++ .../src/views/MDS/userdepartment/EditForm.vue | 83 ++++++++ .../src/views/MDS/userdepartment/List.vue | 159 +++++++++++++++ .../src/views/MDS/userrole/EditForm.vue | 89 +++++++++ .../src/views/MDS/userrole/List.vue | 162 +++++++++++++++ .../齐越慧眼/齐越慧眼/BrowerHelper.cs | 47 +++++ .../UserControls/BrowerControl.xaml.cs | 6 +- .../UserControls/CatControl.xaml.cs | 12 +- .../UserControls/ItemControl.xaml.cs | 13 +- .../UserControls/SomeBrowerControl.xaml.cs | 3 +- 39 files changed, 2241 insertions(+), 10 deletions(-) create mode 100644 src/Coldairarrow.Api/Controllers/HuiYan/pricetasklogController.cs create mode 100644 src/Coldairarrow.Api/Controllers/MDS/userController.cs create mode 100644 src/Coldairarrow.Api/Controllers/MDS/userdepartmentController.cs create mode 100644 src/Coldairarrow.Api/Controllers/MDS/userroleController.cs create mode 100644 src/Coldairarrow.Business/HuiYan/pricetasklogBusiness.cs create mode 100644 src/Coldairarrow.Business/MDS/userBusiness.cs create mode 100644 src/Coldairarrow.Business/MDS/userdepartmentBusiness.cs create mode 100644 src/Coldairarrow.Business/MDS/userroleBusiness.cs create mode 100644 src/Coldairarrow.Entity/DTO/PricetaskUser.cs create mode 100644 src/Coldairarrow.Entity/DTO/UserRoleDto.cs create mode 100644 src/Coldairarrow.Entity/Enum/teamItemState.cs create mode 100644 src/Coldairarrow.Entity/HuiYan/pricetasklog.cs create mode 100644 src/Coldairarrow.Entity/MDS/user.cs create mode 100644 src/Coldairarrow.Entity/MDS/userdepartment.cs create mode 100644 src/Coldairarrow.Entity/MDS/userrole.cs create mode 100644 src/Coldairarrow.IBusiness/HuiYan/IpricetasklogBusiness.cs create mode 100644 src/Coldairarrow.IBusiness/MDS/IuserBusiness.cs create mode 100644 src/Coldairarrow.IBusiness/MDS/IuserdepartmentBusiness.cs create mode 100644 src/Coldairarrow.IBusiness/MDS/IuserroleBusiness.cs create mode 100644 src/Coldairarrow.Util/DataAccess/IMDSDbAccessor.cs create mode 100644 src/Coldairarrow.Web/src/views/HuiYan/pricetasklog/EditForm.vue create mode 100644 src/Coldairarrow.Web/src/views/HuiYan/pricetasklog/List.vue create mode 100644 src/Coldairarrow.Web/src/views/MDS/user/EditForm.vue create mode 100644 src/Coldairarrow.Web/src/views/MDS/user/List.vue create mode 100644 src/Coldairarrow.Web/src/views/MDS/userdepartment/EditForm.vue create mode 100644 src/Coldairarrow.Web/src/views/MDS/userdepartment/List.vue create mode 100644 src/Coldairarrow.Web/src/views/MDS/userrole/EditForm.vue create mode 100644 src/Coldairarrow.Web/src/views/MDS/userrole/List.vue create mode 100644 客户端/齐越慧眼/齐越慧眼/BrowerHelper.cs diff --git a/src/Coldairarrow.Api/Controllers/HuiYan/pricetasklogController.cs b/src/Coldairarrow.Api/Controllers/HuiYan/pricetasklogController.cs new file mode 100644 index 0000000..3c77bcd --- /dev/null +++ b/src/Coldairarrow.Api/Controllers/HuiYan/pricetasklogController.cs @@ -0,0 +1,84 @@ +using Coldairarrow.Business.HuiYan; +using Coldairarrow.Business.MDS; +using Coldairarrow.Entity.DTO; +using Coldairarrow.Entity.HuiYan; +using Coldairarrow.Entity.MDS; +using Coldairarrow.Util; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Threading.Tasks; + +namespace Coldairarrow.Api.Controllers.HuiYan +{ + [Route("/HuiYan/[controller]/[action]")] + public class pricetasklogController : BaseApiController + { + #region DI + + IuserBusiness _iuserBusiness; + public pricetasklogController(IpricetasklogBusiness pricetasklogBus, IuserBusiness iuserBusiness) + { + _iuserBusiness = iuserBusiness; + _pricetasklogBus = pricetasklogBus; + } + + IpricetasklogBusiness _pricetasklogBus { get; } + + #endregion + + #region 获取 + + [HttpPost] + public async Task> GetDataList(PageInput input) + { + return await _pricetasklogBus.GetDataListAsync(input); + } + + [HttpPost] + public async Task GetTheData(IdInputDTO input) + { + return await _pricetasklogBus.GetTheDataAsync(input.id); + } + + #endregion + + #region 提交 + + [HttpPost] + public async Task SaveData(pricetasklog data) + { + if (data.Id.IsNullOrEmpty()) + { + InitEntity(data); + + await _pricetasklogBus.AddDataAsync(data); + } + else + { + await _pricetasklogBus.UpdateDataAsync(data); + } + } + + [HttpPost] + public async Task DeleteData(List ids) + { + await _pricetasklogBus.DeleteDataAsync(ids); + } + + #endregion + + /// + /// 发布比价任务 + /// + /// + /// + [HttpGet, AllowAnonymous] + public AjaxResult AddTask(string id) + { + return _pricetasklogBus.AddTask(id); + } + } +} \ No newline at end of file diff --git a/src/Coldairarrow.Api/Controllers/MDS/userController.cs b/src/Coldairarrow.Api/Controllers/MDS/userController.cs new file mode 100644 index 0000000..1192ec3 --- /dev/null +++ b/src/Coldairarrow.Api/Controllers/MDS/userController.cs @@ -0,0 +1,65 @@ +using Coldairarrow.Business.MDS; +using Coldairarrow.Entity.MDS; +using Coldairarrow.Util; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Coldairarrow.Api.Controllers.MDS +{ + [Route("/MDS/[controller]/[action]")] + public class userController : BaseApiController + { + #region DI + + public userController(IuserBusiness userBus) + { + _userBus = userBus; + } + + IuserBusiness _userBus { get; } + + #endregion + + #region 获取 + + [HttpPost] + public async Task> GetDataList(PageInput input) + { + return await _userBus.GetDataListAsync(input); + } + + [HttpPost] + public async Task GetTheData(IdInputDTO input) + { + return await _userBus.GetTheDataAsync(input.id); + } + + #endregion + + #region 提交 + + [HttpPost] + public async Task SaveData(user data) + { + if (data.Id.IsNullOrEmpty()) + { + InitEntity(data); + + await _userBus.AddDataAsync(data); + } + else + { + await _userBus.UpdateDataAsync(data); + } + } + + [HttpPost] + public async Task DeleteData(List ids) + { + await _userBus.DeleteDataAsync(ids); + } + + #endregion + } +} \ No newline at end of file diff --git a/src/Coldairarrow.Api/Controllers/MDS/userdepartmentController.cs b/src/Coldairarrow.Api/Controllers/MDS/userdepartmentController.cs new file mode 100644 index 0000000..ebdb29a --- /dev/null +++ b/src/Coldairarrow.Api/Controllers/MDS/userdepartmentController.cs @@ -0,0 +1,65 @@ +using Coldairarrow.Business.MDS; +using Coldairarrow.Entity.MDS; +using Coldairarrow.Util; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Coldairarrow.Api.Controllers.MDS +{ + [Route("/MDS/[controller]/[action]")] + public class userdepartmentController : BaseApiController + { + #region DI + + public userdepartmentController(IuserdepartmentBusiness userdepartmentBus) + { + _userdepartmentBus = userdepartmentBus; + } + + IuserdepartmentBusiness _userdepartmentBus { get; } + + #endregion + + #region 获取 + + [HttpPost] + public async Task> GetDataList(PageInput input) + { + return await _userdepartmentBus.GetDataListAsync(input); + } + + [HttpPost] + public async Task GetTheData(IdInputDTO input) + { + return await _userdepartmentBus.GetTheDataAsync(input.id); + } + + #endregion + + #region 提交 + + [HttpPost] + public async Task SaveData(userdepartment data) + { + if (data.Id.IsNullOrEmpty()) + { + InitEntity(data); + + await _userdepartmentBus.AddDataAsync(data); + } + else + { + await _userdepartmentBus.UpdateDataAsync(data); + } + } + + [HttpPost] + public async Task DeleteData(List ids) + { + await _userdepartmentBus.DeleteDataAsync(ids); + } + + #endregion + } +} \ No newline at end of file diff --git a/src/Coldairarrow.Api/Controllers/MDS/userroleController.cs b/src/Coldairarrow.Api/Controllers/MDS/userroleController.cs new file mode 100644 index 0000000..5f5663d --- /dev/null +++ b/src/Coldairarrow.Api/Controllers/MDS/userroleController.cs @@ -0,0 +1,65 @@ +using Coldairarrow.Business.MDS; +using Coldairarrow.Entity.MDS; +using Coldairarrow.Util; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Coldairarrow.Api.Controllers.MDS +{ + [Route("/MDS/[controller]/[action]")] + public class userroleController : BaseApiController + { + #region DI + + public userroleController(IuserroleBusiness userroleBus) + { + _userroleBus = userroleBus; + } + + IuserroleBusiness _userroleBus { get; } + + #endregion + + #region 获取 + + [HttpPost] + public async Task> GetDataList(PageInput input) + { + return await _userroleBus.GetDataListAsync(input); + } + + [HttpPost] + public async Task GetTheData(IdInputDTO input) + { + return await _userroleBus.GetTheDataAsync(input.id); + } + + #endregion + + #region 提交 + + [HttpPost] + public async Task SaveData(userrole data) + { + if (data.Id.IsNullOrEmpty()) + { + InitEntity(data); + + await _userroleBus.AddDataAsync(data); + } + else + { + await _userroleBus.UpdateDataAsync(data); + } + } + + [HttpPost] + public async Task DeleteData(List ids) + { + await _userroleBus.DeleteDataAsync(ids); + } + + #endregion + } +} \ No newline at end of file diff --git a/src/Coldairarrow.Api/Program.cs b/src/Coldairarrow.Api/Program.cs index 44a88a0..06d11d0 100644 --- a/src/Coldairarrow.Api/Program.cs +++ b/src/Coldairarrow.Api/Program.cs @@ -1,4 +1,5 @@ using Coldairarrow.Util; +using Coldairarrow.Util.DataAccess; using Colder.Logging.Serilog; using EFCore.Sharding; using Microsoft.AspNetCore.Hosting; @@ -24,8 +25,11 @@ namespace Coldairarrow.Api config.SetEntityAssemblies(GlobalAssemblies.AllAssemblies); var dbOptions = hostContext.Configuration.GetSection("Database:BaseDb").Get(); + var dbmdsOptions = hostContext.Configuration.GetSection("MsdDatabase:BaseDb").Get(); config.UseDatabase(dbOptions.ConnectionString, dbOptions.DatabaseType); + + config.UseDatabase(dbmdsOptions.ConnectionString, dbmdsOptions.DatabaseType); }); }) .ConfigureWebHostDefaults(webBuilder => diff --git a/src/Coldairarrow.Api/Startup.cs b/src/Coldairarrow.Api/Startup.cs index 9083421..69d583d 100644 --- a/src/Coldairarrow.Api/Startup.cs +++ b/src/Coldairarrow.Api/Startup.cs @@ -1,4 +1,5 @@ using Coldairarrow.Util; +using Coldairarrow.Util.DataAccess; using EFCore.Sharding; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; @@ -22,6 +23,10 @@ namespace Coldairarrow.Api public void ConfigureServices(IServiceCollection services) { + services.AddEFCoreSharding(config => { + + }); + services.Configure(options => options.SuppressModelStateInvalidFilter = true); services.AddControllers(options => { diff --git a/src/Coldairarrow.Api/appsettings.json b/src/Coldairarrow.Api/appsettings.json index 4c35243..68a7afa 100644 --- a/src/Coldairarrow.Api/appsettings.json +++ b/src/Coldairarrow.Api/appsettings.json @@ -48,6 +48,12 @@ //"ConnectionString": "Data Source=127.0.0.1/ORCL;User ID=COLDER.ADMIN.ANTDVUE;Password=123456;Connect Timeout=3" } }, + "MsdDatabase": { + "BaseDb": { + "DatabaseType": "MySql", + "ConnectionString": "server=rm-bp1508okrh23710yfao.mysql.rds.aliyuncs.com;user id=qyroot;password=kaicn1132+-;persistsecurityinfo=True;database=mds;SslMode=none;AllowLoadLocalInfile=true;ConvertZeroDateTime=True" + } + }, //ѩId,,ԽΪλ,ͬIdͻIdͬʱظ "WorkerId": 1, //Id "WebRootUrl": "http://localhost:5000", //ӿڸַ, diff --git a/src/Coldairarrow.Business/HuiYan/catsBusiness.cs b/src/Coldairarrow.Business/HuiYan/catsBusiness.cs index 443dfd6..c86ec0f 100644 --- a/src/Coldairarrow.Business/HuiYan/catsBusiness.cs +++ b/src/Coldairarrow.Business/HuiYan/catsBusiness.cs @@ -19,6 +19,7 @@ namespace Coldairarrow.Business.HuiYan public catsBusiness(IDbAccessor db, IOperator @operator) : base(db) { + _operator = @operator; } diff --git a/src/Coldairarrow.Business/HuiYan/pricetasklogBusiness.cs b/src/Coldairarrow.Business/HuiYan/pricetasklogBusiness.cs new file mode 100644 index 0000000..633f393 --- /dev/null +++ b/src/Coldairarrow.Business/HuiYan/pricetasklogBusiness.cs @@ -0,0 +1,184 @@ +using Coldairarrow.Business.MDS; +using Coldairarrow.Entity.DTO; +using Coldairarrow.Entity.Enum; +using Coldairarrow.Entity.HuiYan; +using Coldairarrow.Entity.MDS; +using Coldairarrow.IBusiness; +using Coldairarrow.Util; +using EFCore.Sharding; +using LinqKit; +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Dynamic.Core; +using System.Linq.Expressions; +using System.Threading.Tasks; + +namespace Coldairarrow.Business.HuiYan +{ + public class pricetasklogBusiness : BaseBusiness, IpricetasklogBusiness, ITransientDependency + { + IuserBusiness _iuserBusiness; + readonly IOperator _operator; + public pricetasklogBusiness(IDbAccessor db, IuserBusiness iuserBusiness, + IOperator @operator) + : base(db) + { + _operator=@operator; + _iuserBusiness = iuserBusiness; + } + + #region 外部接口 + + public async Task> GetDataListAsync(PageInput input) + { + var q = GetIQueryable(); + var where = LinqHelper.True(); + var search = input.Search; + + //筛选 + if (!search.Condition.IsNullOrEmpty() && !search.Keyword.IsNullOrEmpty()) + { + var newWhere = DynamicExpressionParser.ParseLambda( + ParsingConfig.Default, false, $@"{search.Condition}.Contains(@0)", search.Keyword); + where = where.And(newWhere); + } + + return await q.Where(where).GetPageResultAsync(input); + } + + public async Task GetTheDataAsync(string id) + { + return await GetEntityAsync(id); + } + + public async Task AddDataAsync(pricetasklog data) + { + await InsertAsync(data); + } + + public async Task UpdateDataAsync(pricetasklog data) + { + await UpdateAsync(data); + } + + public async Task DeleteDataAsync(List ids) + { + await DeleteAsync(ids); + } + + #endregion + + public PageResult GetItems(PageInput input) + { + Expression> select = (a, b) => new TeamitemDto + { + GoodsId = b.GoodsId, + HasFilter = b.HasFilter, + Platform = b.Platform, + GoodsUrl = b.GoodsUrl, + Extensions = Newtonsoft.Json.JsonConvert.DeserializeObject>(a.ExtensionJson) + }; + + var search = input.Search; + select = select.BuildExtendSelectExpre(); + + var q_titem = Db.GetIQueryable(); + var q = from a in q_titem.AsExpandable() + join b in Db.GetIQueryable() on a.ItemId equals b.Id into ab + from b in ab.DefaultIfEmpty() + select @select.Invoke(a, b); + + //查询对应状态 + var where = LinqHelper.True().And(c => c.State == int.Parse(search.Keyword)); + + where = where.And(c => c.TeamId == _operator.TeamId); + + var list = q.Where(where).GetPageResultAsync(input).Result; + + return list; + + } + + /// + /// 添加比价任务 + /// + /// + public AjaxResult AddTask(string teamItemId) + { + var teamItem = Db.GetIQueryable().FirstOrDefault(c => c.Id == teamItemId&&c.UserId==_operator.UserId); + + if (teamItem == null) + { + return Error("任务不存在!"); + } + + var users = _iuserBusiness.GetPriceTaskUserList().ToList(); + + Expression> select = (a, b) => new PricetaskUser() + { + UserName = a.UserName, + MaxTaskCount = a.MaxPriceTaskCount, + Uid=a.Id + }; + + select = select.BuildExtendSelectExpre(); + + var q_User = Db.GetIQueryable().Where(c => c.CreateTime.Date == DateTime.Now.Date || c.CreateTime == DateTime.MinValue); + + var q = from a in users + join b in q_User on a.Id equals b.UserId into ab + from b in ab.DefaultIfEmpty() + select @select.Invoke(a, b); + + //获取当日可分配的一个用户 + var user = q.GroupBy(c => c.Uid).Where(c => c.Count() < c.FirstOrDefault()?.MaxTaskCount).Select(c => new { Id = c.Key, Count = c.Count() }).OrderBy(c => c.Count).FirstOrDefault(); + + if (user == null) + { + //钉钉推送 + return Error("当前任务量已超过任务池可用任务量!"); + } + + + var result = Db.RunTransaction(() => + { + int row= Db.Update(c => c.Id == teamItem.Id, (item) => { + item.PriceTaskUserId= user.Id; + item.State = (int)TeamItemState.已发布比价; + }); + + if (row <= 0) + throw new Exception("系统繁忙!"); + + row = Db.Insert(new pricetasklog() + { + CreateTime = DateTime.Now, + Id = IdHelper.GetId(), + CreatorId = _operator.UserId, + Deleted = false, + ItemId = teamItem.ItemId, + UserId = user.Id, + State = PriceTaskState.待比价, + TeamItemId = teamItem.Id + }); + + if (row <= 0) + throw new Exception("系统任务繁忙!"); + + }); + + if (result.Success) + { + return Success("发布任务成功!"); + } + + return Error(result.ex.Message); + } + + #region 私有成员 + + #endregion + } +} \ No newline at end of file diff --git a/src/Coldairarrow.Business/HuiYan/teamitemsBusiness.cs b/src/Coldairarrow.Business/HuiYan/teamitemsBusiness.cs index b2d08d5..b3bdda5 100644 --- a/src/Coldairarrow.Business/HuiYan/teamitemsBusiness.cs +++ b/src/Coldairarrow.Business/HuiYan/teamitemsBusiness.cs @@ -1,4 +1,5 @@ using Coldairarrow.Entity.DTO; +using Coldairarrow.Entity.Enum; using Coldairarrow.Entity.HuiYan; using Coldairarrow.IBusiness; using Coldairarrow.Util; @@ -89,8 +90,17 @@ namespace Coldairarrow.Business.HuiYan from b in ab.DefaultIfEmpty() select @select.Invoke(a, b); + int state = int.Parse(search.Keyword); + //查询对应状态 - var where = LinqHelper.True().And(c => c.State == int.Parse(search.Keyword)); + var where = LinqHelper.True(); + if (state == 0) + { + where = where.And(c => c.State == state || c.State == (int)TeamItemState.已发布比价); + } + else { + where = where.And(c => c.State == state); + } where = where.And(c => c.TeamId == _operator.TeamId); diff --git a/src/Coldairarrow.Business/MDS/userBusiness.cs b/src/Coldairarrow.Business/MDS/userBusiness.cs new file mode 100644 index 0000000..78f42b4 --- /dev/null +++ b/src/Coldairarrow.Business/MDS/userBusiness.cs @@ -0,0 +1,93 @@ +using Coldairarrow.Entity.DTO; +using Coldairarrow.Entity.MDS; +using Coldairarrow.Util; +using Coldairarrow.Util.DataAccess; +using EFCore.Sharding; +using LinqKit; +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Dynamic.Core; +using System.Linq.Expressions; +using System.Threading.Tasks; + +namespace Coldairarrow.Business.MDS +{ + public class userBusiness : BaseBusiness, IuserBusiness, ITransientDependency + { + public userBusiness(IMDSDbAccessor db) + : base(db) + { + } + + #region 外部接口 + + public async Task> GetDataListAsync(PageInput input) + { + var q = GetIQueryable(); + var where = LinqHelper.True(); + var search = input.Search; + + //筛选 + if (!search.Condition.IsNullOrEmpty() && !search.Keyword.IsNullOrEmpty()) + { + var newWhere = DynamicExpressionParser.ParseLambda( + ParsingConfig.Default, false, $@"{search.Condition}.Contains(@0)", search.Keyword); + where = where.And(newWhere); + } + + return await q.Where(where).GetPageResultAsync(input); + } + + public async Task GetTheDataAsync(string id) + { + return await GetEntityAsync(id); + } + + public async Task AddDataAsync(user data) + { + await InsertAsync(data); + } + + public async Task UpdateDataAsync(user data) + { + await UpdateAsync(data); + } + + public async Task DeleteDataAsync(List ids) + { + await DeleteAsync(ids); + } + + #endregion + + public IQueryable GetPriceTaskUserList() + { + string priceTeamId = "1463029355104964608"; + + Expression> select = (a, b) => new UserRoleDto() + { + DepartmentId = b.DepartmentId, + RoleId = b.Id, + }; + + select = select.BuildExtendSelectExpre(); + + var q_User = Db.GetIQueryable() ; + var q = from a in q_User.AsExpandable() + join b in Db.GetIQueryable() on a.RoleId equals b.Id into ab + from b in ab.DefaultIfEmpty() + select @select.Invoke(a, b); + + var list = q.Where(c=>c.DepartmentId==priceTeamId); + + return list; + + } + + #region 私有成员 + + #endregion + } +} \ No newline at end of file diff --git a/src/Coldairarrow.Business/MDS/userdepartmentBusiness.cs b/src/Coldairarrow.Business/MDS/userdepartmentBusiness.cs new file mode 100644 index 0000000..20ea3ce --- /dev/null +++ b/src/Coldairarrow.Business/MDS/userdepartmentBusiness.cs @@ -0,0 +1,66 @@ +using Coldairarrow.Entity.MDS; +using Coldairarrow.Util; +using Coldairarrow.Util.DataAccess; +using EFCore.Sharding; +using LinqKit; +using Microsoft.EntityFrameworkCore; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Dynamic.Core; +using System.Threading.Tasks; + +namespace Coldairarrow.Business.MDS +{ + public class userdepartmentBusiness : BaseBusiness, IuserdepartmentBusiness, ITransientDependency + { + public userdepartmentBusiness(IMDSDbAccessor db) + : base(db) + { + } + + #region 外部接口 + + public async Task> GetDataListAsync(PageInput input) + { + var q = GetIQueryable(); + var where = LinqHelper.True(); + var search = input.Search; + + //筛选 + if (!search.Condition.IsNullOrEmpty() && !search.Keyword.IsNullOrEmpty()) + { + var newWhere = DynamicExpressionParser.ParseLambda( + ParsingConfig.Default, false, $@"{search.Condition}.Contains(@0)", search.Keyword); + where = where.And(newWhere); + } + + return await q.Where(where).GetPageResultAsync(input); + } + + public async Task GetTheDataAsync(string id) + { + return await GetEntityAsync(id); + } + + public async Task AddDataAsync(userdepartment data) + { + await InsertAsync(data); + } + + public async Task UpdateDataAsync(userdepartment data) + { + await UpdateAsync(data); + } + + public async Task DeleteDataAsync(List ids) + { + await DeleteAsync(ids); + } + + #endregion + + #region 私有成员 + + #endregion + } +} \ No newline at end of file diff --git a/src/Coldairarrow.Business/MDS/userroleBusiness.cs b/src/Coldairarrow.Business/MDS/userroleBusiness.cs new file mode 100644 index 0000000..c45f3d5 --- /dev/null +++ b/src/Coldairarrow.Business/MDS/userroleBusiness.cs @@ -0,0 +1,66 @@ +using Coldairarrow.Entity.MDS; +using Coldairarrow.Util; +using Coldairarrow.Util.DataAccess; +using EFCore.Sharding; +using LinqKit; +using Microsoft.EntityFrameworkCore; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Dynamic.Core; +using System.Threading.Tasks; + +namespace Coldairarrow.Business.MDS +{ + public class userroleBusiness : BaseBusiness, IuserroleBusiness, ITransientDependency + { + public userroleBusiness(IMDSDbAccessor db) + : base(db) + { + } + + #region 外部接口 + + public async Task> GetDataListAsync(PageInput input) + { + var q = GetIQueryable(); + var where = LinqHelper.True(); + var search = input.Search; + + //筛选 + if (!search.Condition.IsNullOrEmpty() && !search.Keyword.IsNullOrEmpty()) + { + var newWhere = DynamicExpressionParser.ParseLambda( + ParsingConfig.Default, false, $@"{search.Condition}.Contains(@0)", search.Keyword); + where = where.And(newWhere); + } + + return await q.Where(where).GetPageResultAsync(input); + } + + public async Task GetTheDataAsync(string id) + { + return await GetEntityAsync(id); + } + + public async Task AddDataAsync(userrole data) + { + await InsertAsync(data); + } + + public async Task UpdateDataAsync(userrole data) + { + await UpdateAsync(data); + } + + public async Task DeleteDataAsync(List ids) + { + await DeleteAsync(ids); + } + + #endregion + + #region 私有成员 + + #endregion + } +} \ No newline at end of file diff --git a/src/Coldairarrow.Entity/DTO/PricetaskUser.cs b/src/Coldairarrow.Entity/DTO/PricetaskUser.cs new file mode 100644 index 0000000..bb774a2 --- /dev/null +++ b/src/Coldairarrow.Entity/DTO/PricetaskUser.cs @@ -0,0 +1,32 @@ +using Coldairarrow.Entity.HuiYan; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Coldairarrow.Entity.DTO +{ + public class PricetaskUser : pricetasklog + { + public string UserName { get; set; } + + private int? maxTaskCount; + /// + /// 用户ID + /// + public string Uid { get; set; } + + public int? MaxTaskCount + { + get + { + if (maxTaskCount == null) + return 30; + + return maxTaskCount.Value; + } + set { maxTaskCount = value; } + } + } +} diff --git a/src/Coldairarrow.Entity/DTO/UserRoleDto.cs b/src/Coldairarrow.Entity/DTO/UserRoleDto.cs new file mode 100644 index 0000000..2f1379c --- /dev/null +++ b/src/Coldairarrow.Entity/DTO/UserRoleDto.cs @@ -0,0 +1,15 @@ +using Coldairarrow.Entity.MDS; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Coldairarrow.Entity.DTO +{ + public class UserRoleDto:user + { + public string DepartmentId { get; set; } + + } +} diff --git a/src/Coldairarrow.Entity/Enum/teamItemState.cs b/src/Coldairarrow.Entity/Enum/teamItemState.cs new file mode 100644 index 0000000..2138d80 --- /dev/null +++ b/src/Coldairarrow.Entity/Enum/teamItemState.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Coldairarrow.Entity.Enum +{ + public enum TeamItemState + { + 待比价 = 0, + + 精选 = 1, + + 待上架 = 2, + + 已上架 = 3, + + 放弃 = 4, + + 已发布比价 = 5, + + 已比价 = 6, + + 待修改 = 7 + } + + + public enum PriceTaskState + { + 待比价 = 0, + + 已比价 = 1, + + 待修改 = 2, + + 比价完成=3 + } +} diff --git a/src/Coldairarrow.Entity/HuiYan/pricetasklog.cs b/src/Coldairarrow.Entity/HuiYan/pricetasklog.cs new file mode 100644 index 0000000..af5841e --- /dev/null +++ b/src/Coldairarrow.Entity/HuiYan/pricetasklog.cs @@ -0,0 +1,57 @@ +using Coldairarrow.Entity.Enum; +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Coldairarrow.Entity.HuiYan +{ + /// + /// 比价任务日志 + /// + [Table("pricetasklog")] + public class pricetasklog + { + + /// + /// 主键 + /// + [Key, Column(Order = 1)] + public String Id { get; set; } + + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + + /// + /// 创建人Id + /// + public String CreatorId { get; set; } + + /// + /// 否已删除 + /// + public Boolean Deleted { get; set; } + + /// + /// 分配的团队用户ID + /// + public String UserId { get; set; } + + /// + /// 团队商品的ID + /// + public String TeamItemId { get; set; } + + /// + /// 商品表ID + /// + public String ItemId { get; set; } + + /// + /// 比价状态 + /// + public PriceTaskState State { get; set; } + + } +} \ No newline at end of file diff --git a/src/Coldairarrow.Entity/HuiYan/teamitems.cs b/src/Coldairarrow.Entity/HuiYan/teamitems.cs index 6798857..e374810 100644 --- a/src/Coldairarrow.Entity/HuiYan/teamitems.cs +++ b/src/Coldairarrow.Entity/HuiYan/teamitems.cs @@ -107,5 +107,9 @@ namespace Coldairarrow.Entity.HuiYan /// public Int32? RivalPLCount { get; set; } + /// + /// 接比价任务的用户ID + /// + public string PriceTaskUserId { get; set; } } } \ No newline at end of file diff --git a/src/Coldairarrow.Entity/MDS/user.cs b/src/Coldairarrow.Entity/MDS/user.cs new file mode 100644 index 0000000..a376e86 --- /dev/null +++ b/src/Coldairarrow.Entity/MDS/user.cs @@ -0,0 +1,95 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Coldairarrow.Entity.MDS +{ + /// + /// user + /// + [Table("user")] + public class user + { + + /// + /// 主键 + /// + [Key, Column(Order = 1)] + public String Id { get; set; } + + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + + /// + /// 创建人Id + /// + public String CreatorId { get; set; } + + /// + /// 否已删除 + /// + public Boolean Deleted { get; set; } + + /// + /// 用户名 + /// + public String UserName { get; set; } + + /// + /// 用户密码 + /// + public String UserPwd { get; set; } + + /// + /// 角色ID + /// + public String RoleId { get; set; } + + /// + /// 用户积分 + /// + public Int32? UserIntegral { get; set; } + + /// + /// 花名 + /// + public String UserNick { get; set; } + + /// + /// 用户经验值 + /// + public Int32? UserExp { get; set; } + + /// + /// 当日冻结积分 + /// + public Int32? FreezeIntegral { get; set; } + + /// + /// 即将过期积分 + /// + public Int32? FailureIntegral { get; set; } + + /// + /// 最后积分检测日期 + /// + public DateTime? LastIntegralDate { get; set; } + + /// + /// 业务ID列表 + /// + public String BusinessIds { get; set; } + + /// + /// 登录IP + /// + public String LoginIp { get; set; } + + /// + /// 最大比价任务数量 + /// + public int? MaxPriceTaskCount { get; set; } + } +} \ No newline at end of file diff --git a/src/Coldairarrow.Entity/MDS/userdepartment.cs b/src/Coldairarrow.Entity/MDS/userdepartment.cs new file mode 100644 index 0000000..80497be --- /dev/null +++ b/src/Coldairarrow.Entity/MDS/userdepartment.cs @@ -0,0 +1,46 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Coldairarrow.Entity.MDS +{ + /// + /// userdepartment + /// + [Table("userdepartment")] + public class userdepartment + { + + /// + /// 主键 + /// + [Key, Column(Order = 1)] + public String Id { get; set; } + + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + + /// + /// 创建人Id + /// + public String CreatorId { get; set; } + + /// + /// 否已删除 + /// + public Boolean Deleted { get; set; } + + /// + /// 部门名称 + /// + public String DepartmentName { get; set; } + + /// + /// 上级部门 + /// + public String ParentDepartmentId { get; set; } + + } +} \ No newline at end of file diff --git a/src/Coldairarrow.Entity/MDS/userrole.cs b/src/Coldairarrow.Entity/MDS/userrole.cs new file mode 100644 index 0000000..f25a170 --- /dev/null +++ b/src/Coldairarrow.Entity/MDS/userrole.cs @@ -0,0 +1,56 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Coldairarrow.Entity.MDS +{ + /// + /// userrole + /// + [Table("userrole")] + public class userrole + { + + /// + /// 主键 + /// + [Key, Column(Order = 1)] + public String Id { get; set; } + + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + + /// + /// 创建人Id + /// + public String CreatorId { get; set; } + + /// + /// 否已删除 + /// + public Boolean Deleted { get; set; } + + /// + /// 角色名称 + /// + public String RoleName { get; set; } + + /// + /// 上级角色ID + /// + public String ParentRoleId { get; set; } + + /// + /// 部门ID + /// + public String DepartmentId { get; set; } + + /// + /// 是否管理岗位 + /// + public Boolean? IsManagement { get; set; } + + } +} \ No newline at end of file diff --git a/src/Coldairarrow.IBusiness/HuiYan/IpricetasklogBusiness.cs b/src/Coldairarrow.IBusiness/HuiYan/IpricetasklogBusiness.cs new file mode 100644 index 0000000..f2ec63d --- /dev/null +++ b/src/Coldairarrow.IBusiness/HuiYan/IpricetasklogBusiness.cs @@ -0,0 +1,18 @@ +using Coldairarrow.Entity.HuiYan; +using Coldairarrow.Util; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Coldairarrow.Business.HuiYan +{ + public interface IpricetasklogBusiness + { + Task> GetDataListAsync(PageInput input); + Task GetTheDataAsync(string id); + Task AddDataAsync(pricetasklog data); + Task UpdateDataAsync(pricetasklog data); + Task DeleteDataAsync(List ids); + + AjaxResult AddTask(string teamItemId); + } +} \ No newline at end of file diff --git a/src/Coldairarrow.IBusiness/MDS/IuserBusiness.cs b/src/Coldairarrow.IBusiness/MDS/IuserBusiness.cs new file mode 100644 index 0000000..a661cf3 --- /dev/null +++ b/src/Coldairarrow.IBusiness/MDS/IuserBusiness.cs @@ -0,0 +1,20 @@ +using Coldairarrow.Entity.DTO; +using Coldairarrow.Entity.MDS; +using Coldairarrow.Util; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Coldairarrow.Business.MDS +{ + public interface IuserBusiness + { + Task> GetDataListAsync(PageInput input); + Task GetTheDataAsync(string id); + Task AddDataAsync(user data); + Task UpdateDataAsync(user data); + Task DeleteDataAsync(List ids); + + IQueryable GetPriceTaskUserList(); + } +} \ No newline at end of file diff --git a/src/Coldairarrow.IBusiness/MDS/IuserdepartmentBusiness.cs b/src/Coldairarrow.IBusiness/MDS/IuserdepartmentBusiness.cs new file mode 100644 index 0000000..3453e5b --- /dev/null +++ b/src/Coldairarrow.IBusiness/MDS/IuserdepartmentBusiness.cs @@ -0,0 +1,16 @@ +using Coldairarrow.Entity.MDS; +using Coldairarrow.Util; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Coldairarrow.Business.MDS +{ + public interface IuserdepartmentBusiness + { + Task> GetDataListAsync(PageInput input); + Task GetTheDataAsync(string id); + Task AddDataAsync(userdepartment data); + Task UpdateDataAsync(userdepartment data); + Task DeleteDataAsync(List ids); + } +} \ No newline at end of file diff --git a/src/Coldairarrow.IBusiness/MDS/IuserroleBusiness.cs b/src/Coldairarrow.IBusiness/MDS/IuserroleBusiness.cs new file mode 100644 index 0000000..4a44fed --- /dev/null +++ b/src/Coldairarrow.IBusiness/MDS/IuserroleBusiness.cs @@ -0,0 +1,16 @@ +using Coldairarrow.Entity.MDS; +using Coldairarrow.Util; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Coldairarrow.Business.MDS +{ + public interface IuserroleBusiness + { + Task> GetDataListAsync(PageInput input); + Task GetTheDataAsync(string id); + Task AddDataAsync(userrole data); + Task UpdateDataAsync(userrole data); + Task DeleteDataAsync(List ids); + } +} \ No newline at end of file diff --git a/src/Coldairarrow.Util/DataAccess/IMDSDbAccessor.cs b/src/Coldairarrow.Util/DataAccess/IMDSDbAccessor.cs new file mode 100644 index 0000000..0699bf9 --- /dev/null +++ b/src/Coldairarrow.Util/DataAccess/IMDSDbAccessor.cs @@ -0,0 +1,14 @@ +using EFCore.Sharding; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Coldairarrow.Util.DataAccess +{ + public interface IMDSDbAccessor: IDbAccessor + { + + } +} diff --git a/src/Coldairarrow.Web/src/views/HuiYan/pricetasklog/EditForm.vue b/src/Coldairarrow.Web/src/views/HuiYan/pricetasklog/EditForm.vue new file mode 100644 index 0000000..aad05ec --- /dev/null +++ b/src/Coldairarrow.Web/src/views/HuiYan/pricetasklog/EditForm.vue @@ -0,0 +1,89 @@ + + + diff --git a/src/Coldairarrow.Web/src/views/HuiYan/pricetasklog/List.vue b/src/Coldairarrow.Web/src/views/HuiYan/pricetasklog/List.vue new file mode 100644 index 0000000..ad17409 --- /dev/null +++ b/src/Coldairarrow.Web/src/views/HuiYan/pricetasklog/List.vue @@ -0,0 +1,162 @@ + + + \ No newline at end of file diff --git a/src/Coldairarrow.Web/src/views/MDS/user/EditForm.vue b/src/Coldairarrow.Web/src/views/MDS/user/EditForm.vue new file mode 100644 index 0000000..8d031d2 --- /dev/null +++ b/src/Coldairarrow.Web/src/views/MDS/user/EditForm.vue @@ -0,0 +1,110 @@ + + + diff --git a/src/Coldairarrow.Web/src/views/MDS/user/List.vue b/src/Coldairarrow.Web/src/views/MDS/user/List.vue new file mode 100644 index 0000000..8d545e0 --- /dev/null +++ b/src/Coldairarrow.Web/src/views/MDS/user/List.vue @@ -0,0 +1,172 @@ + + + \ No newline at end of file diff --git a/src/Coldairarrow.Web/src/views/MDS/userdepartment/EditForm.vue b/src/Coldairarrow.Web/src/views/MDS/userdepartment/EditForm.vue new file mode 100644 index 0000000..6a242b0 --- /dev/null +++ b/src/Coldairarrow.Web/src/views/MDS/userdepartment/EditForm.vue @@ -0,0 +1,83 @@ + + + diff --git a/src/Coldairarrow.Web/src/views/MDS/userdepartment/List.vue b/src/Coldairarrow.Web/src/views/MDS/userdepartment/List.vue new file mode 100644 index 0000000..ff39a7f --- /dev/null +++ b/src/Coldairarrow.Web/src/views/MDS/userdepartment/List.vue @@ -0,0 +1,159 @@ + + + \ No newline at end of file diff --git a/src/Coldairarrow.Web/src/views/MDS/userrole/EditForm.vue b/src/Coldairarrow.Web/src/views/MDS/userrole/EditForm.vue new file mode 100644 index 0000000..b2648e0 --- /dev/null +++ b/src/Coldairarrow.Web/src/views/MDS/userrole/EditForm.vue @@ -0,0 +1,89 @@ + + + diff --git a/src/Coldairarrow.Web/src/views/MDS/userrole/List.vue b/src/Coldairarrow.Web/src/views/MDS/userrole/List.vue new file mode 100644 index 0000000..54a1d9f --- /dev/null +++ b/src/Coldairarrow.Web/src/views/MDS/userrole/List.vue @@ -0,0 +1,162 @@ + + + \ No newline at end of file diff --git a/客户端/齐越慧眼/齐越慧眼/BrowerHelper.cs b/客户端/齐越慧眼/齐越慧眼/BrowerHelper.cs new file mode 100644 index 0000000..7625882 --- /dev/null +++ b/客户端/齐越慧眼/齐越慧眼/BrowerHelper.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + +namespace 齐越慧眼 +{ + public class BrowerHelper + { + public enum ShowCommands : int + { + SW_HIDE = 0, + SW_SHOWNORMAL = 1, + SW_NORMAL = 1, + SW_SHOWMINIMIZED = 2, + SW_SHOWMAXIMIZED = 3, + SW_MAXIMIZE = 3, + SW_SHOWNOACTIVATE = 4, + SW_SHOW = 5, + SW_MINIMIZE = 6, + SW_SHOWMINNOACTIVE = 7, + SW_SHOWNA = 8, + SW_RESTORE = 9, + SW_SHOWDEFAULT = 10, + SW_FORCEMINIMIZE = 11, + SW_MAX = 11 + } + + [DllImport("shell32.dll")] + static extern IntPtr ShellExecute( + IntPtr hwnd, + string lpOperation, + string lpFile, + string lpParameters, + string lpDirectory, + ShowCommands nShowCmd); + + /// + /// 打开指定网址 + /// + /// + public static void OpenUrl(string url) + { + ShellExecute(IntPtr.Zero, "open", url, null, null, ShowCommands.SW_SHOWNORMAL); + } + } +} diff --git a/客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs b/客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs index 821f6e7..82fbc68 100644 --- a/客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs +++ b/客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs @@ -78,7 +78,7 @@ namespace 齐越慧眼.UserControls } int nowPatlom = 0; - + public void OnUrlEnd(string url) { if (url.Contains("s_new.php")) @@ -110,7 +110,9 @@ namespace 齐越慧眼.UserControls private void Web_StartNewWindow(object sender, NewWindowEventArgs e) { - MainWindow.Main.brower.NewTab(e.Url); + // WpfNoticeMsg.NoticeMessage.Show(e.Url); + BrowerHelper.OpenUrl(e.Url); + //MainWindow.Main.brower.NewTab(e.Url); //web.Load(e.Url); } diff --git a/客户端/齐越慧眼/齐越慧眼/UserControls/CatControl.xaml.cs b/客户端/齐越慧眼/齐越慧眼/UserControls/CatControl.xaml.cs index 6601354..0d523cb 100644 --- a/客户端/齐越慧眼/齐越慧眼/UserControls/CatControl.xaml.cs +++ b/客户端/齐越慧眼/齐越慧眼/UserControls/CatControl.xaml.cs @@ -13,6 +13,7 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using 齐越慧眼.cefhelper; namespace 齐越慧眼.UserControls { @@ -21,11 +22,11 @@ namespace 齐越慧眼.UserControls /// public partial class CatControl : UserControl { - ChromiumWebBrowser web; + ExtChromiumBrowser web; public CatControl() { InitializeComponent(); - web = new ChromiumWebBrowser("nacollector://home") + web = new ExtChromiumBrowser("nacollector://home") { BrowserSettings = { @@ -45,12 +46,17 @@ namespace 齐越慧眼.UserControls web.JavascriptObjectRepository.Register("hyCoreModel", new CatsAsyncJS(), BindingOptions.DefaultBinder); // web.WebBrowser.GetDevToolsClient().DOMStorage.SetDOMStorageItemAsync() - + web.StartNewWindow += Web_StartNewWindow; web.FrameLoadStart += Web_FrameLoadStart; } + private void Web_StartNewWindow(object sender, NewWindowEventArgs e) + { + BrowerHelper.OpenUrl(e.Url); + } + bool isInit = false; private void Web_FrameLoadStart(object sender, FrameLoadStartEventArgs e) diff --git a/客户端/齐越慧眼/齐越慧眼/UserControls/ItemControl.xaml.cs b/客户端/齐越慧眼/齐越慧眼/UserControls/ItemControl.xaml.cs index d72fb3c..5e77f87 100644 --- a/客户端/齐越慧眼/齐越慧眼/UserControls/ItemControl.xaml.cs +++ b/客户端/齐越慧眼/齐越慧眼/UserControls/ItemControl.xaml.cs @@ -16,6 +16,7 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using 齐越慧眼.cefhelper; namespace 齐越慧眼.UserControls { @@ -24,11 +25,11 @@ namespace 齐越慧眼.UserControls /// public partial class ItemControl : UserControl { - ChromiumWebBrowser web; + ExtChromiumBrowser web; public ItemControl() { InitializeComponent(); - web = new ChromiumWebBrowser("nacollector://home/item") + web = new ExtChromiumBrowser("nacollector://home/item") { BrowserSettings = { @@ -47,10 +48,16 @@ namespace 齐越慧眼.UserControls grid.Children.Add(web); // web.ExecuteScriptAsyncWhenPageLoaded(@$"localStorage.setItem('user', '{{""token"":""{ApiHelper.JwtToken}""}}');window.getDatas(0);"); web.FrameLoadStart += Web_FrameLoadStart; - + web.StartNewWindow += Web_StartNewWindow; grid.KeyDown += grid_KeyDown; } + private void Web_StartNewWindow(object sender, NewWindowEventArgs e) + { + // WpfNoticeMsg.NoticeMessage.Show(e.Url); + BrowerHelper.OpenUrl(e.Url); + } + bool isInit = false; private void grid_KeyDown(object sender, KeyEventArgs e) diff --git a/客户端/齐越慧眼/齐越慧眼/UserControls/SomeBrowerControl.xaml.cs b/客户端/齐越慧眼/齐越慧眼/UserControls/SomeBrowerControl.xaml.cs index d5eb950..4e9fd58 100644 --- a/客户端/齐越慧眼/齐越慧眼/UserControls/SomeBrowerControl.xaml.cs +++ b/客户端/齐越慧眼/齐越慧眼/UserControls/SomeBrowerControl.xaml.cs @@ -112,7 +112,8 @@ namespace 齐越慧眼.UserControls private void Web_StartNewWindow(object sender, NewWindowEventArgs e) { - MainWindow.Main.brower.NewTab(e.Url); + BrowerHelper.OpenUrl(e.Url); + //MainWindow.Main.brower.NewTab(e.Url); //web.Load(e.Url); }