| | |
| | | } |
| | | }, |
| | | { |
| | | name: "ä¿®æ¹ç¶æ", |
| | | icon: '', |
| | | class: '', |
| | | value: 'UpdateStatus', |
| | | type: 'danger', |
| | | onClick: function () { |
| | | } |
| | | }, |
| | | { |
| | | name: "ä»»å¡å®æ", |
| | | icon: '', |
| | | class: '', |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <vol-box |
| | | v-model="showDetialBox" |
| | | :lazy="true" |
| | | width="500px" |
| | | :padding="15" |
| | | title="ä¿®æ¹è´§ä½ç¶æ" |
| | | > |
| | | <el-form ref="form" :model="form" label-width="80px"> |
| | | <el-form-item label="è´§ä½ç¼å·"> |
| | | <el-input v-model="form.locationCode" disabled></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="è´§ä½ç¶æ"> |
| | | <el-select v-model="form.locationStatus" placeholder="è¯·éæ©è´§ä½ç¶æ"> |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> </el-select |
| | | ></el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <el-button type="primary" size="small" @click="updateLocationStatus" |
| | | >ç¡®å®</el-button |
| | | > |
| | | <el-button type="danger" size="small" @click="showDetialBox = false" |
| | | >åæ¶</el-button |
| | | > |
| | | </template> |
| | | </vol-box> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import VolBox from "@/components/basic/VolBox.vue"; |
| | | export default { |
| | | components: { VolBox }, |
| | | data() { |
| | | return { |
| | | form: { |
| | | locationCode: "", |
| | | locationStatus: "", |
| | | }, |
| | | row: {}, |
| | | showDetialBox: false, |
| | | height: "200px", |
| | | options: [], |
| | | value: "", |
| | | }; |
| | | }, |
| | | methods: { |
| | | open(row) { |
| | | this.row = row; |
| | | this.showDetialBox = true; |
| | | this.form.locationCode = row.locationCode; |
| | | //this.form.locationStatus = row.locationStatus; |
| | | }, |
| | | getOptions() { |
| | | this.http |
| | | .post("/api/LocationInfo/GetLocationStatusDic", {}, true) |
| | | .then((x) => { |
| | | if (!x.status) return this.$message.error(x.message); |
| | | |
| | | this.options = x.data; |
| | | }); |
| | | }, |
| | | updateLocationStatus() { |
| | | this.http |
| | | .post( |
| | | "/api/LocationInfo/UpdateLocationStatus?key=" + |
| | | this.row.id + |
| | | "&locationStatus=" + |
| | | this.row.locationStatus, |
| | | {}, |
| | | "æ°æ®å¤çä¸" |
| | | ) |
| | | .then((x) => { |
| | | if (!x.status) return this.$message.error(x.message); |
| | | this.$message.success("æä½æå"); |
| | | this.showDetialBox = false; |
| | | }); |
| | | }, |
| | | }, |
| | | created() { |
| | | this.getOptions(); |
| | | console.log("created"); |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .el-col { |
| | | border-radius: 4px; |
| | | } |
| | | .grid-content { |
| | | border-radius: 4px; |
| | | min-height: 36px; |
| | | } |
| | | .content-text { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .right-text { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: flex-end; |
| | | } |
| | | </style> |
| | | <style> |
| | | .el-table .warning-row { |
| | | background: #fcf1e2; |
| | | } |
| | | |
| | | .el-table .success-row { |
| | | background: #f0f9eb; |
| | | } |
| | | |
| | | .el-table .error-row { |
| | | background: #fde2e2; |
| | | } |
| | | </style> |
| | |
| | | |
| | | import gridBody from './extend/updateStatus.vue' |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: '', |
| | | gridBody: '', |
| | | gridBody: gridBody, |
| | | gridFooter: '', |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | | modelHeader: '', |
| | |
| | | } |
| | | } |
| | | |
| | | this.columns.push({ |
| | | field: 'æä½', |
| | | title: 'æä½', |
| | | width: 90, |
| | | fixed: 'right', |
| | | align: 'center', |
| | | formatter: (row) => { |
| | | return ( |
| | | '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-view">æ¥çæç»</i>' |
| | | ); |
| | | }, |
| | | click: (row) => { |
| | | this.$refs.gridBody.open(row); |
| | | let updateStatusBtn = this.buttons.find(x => x.value == 'UpdateStatus'); |
| | | if (updateStatusBtn) { |
| | | updateStatusBtn.onClick = function () { |
| | | let rows = this.$refs.table.getSelected(); |
| | | if (rows.length == 0 || rows.length > 1) return this.$error("è¯·éæ©ä¸è¡æ°æ®"); |
| | | this.$refs.gridBody.open(rows[0]); |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | |
| | | icon: "", |
| | | orderNo: "", |
| | | enable: 1, |
| | | createDate: "", |
| | | creator: "", |
| | | modifyDate: "", |
| | | menuType: 1 |
| | | }); |
| | | |
| | | const actionFields = ref({ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Common.CommonEnum; |
| | |
| | | |
| | | public override WebResponseContent AddData(SaveModel saveModel) |
| | | { |
| | | saveModel.MainData.Add(nameof(Dt_LocationInfo.EnableStatus), EnableStatusEnum.Normal.ObjToInt()); |
| | | saveModel.MainData.Add(nameof(Dt_LocationInfo.LocationStatus), LocationStatusEnum.Free.ObjToInt()); |
| | | Dt_LocationInfo locationInfo = saveModel.MainData.DicToModel<Dt_LocationInfo>(); |
| | | locationInfo.LocationCode = $"R{locationInfo.RoadwayNo.PadLeft(2, '0')}-{locationInfo.Row.ToString().PadLeft(3, '0')}-{locationInfo.Column.ToString().PadLeft(3, '0')}-{locationInfo.Layer.ToString().PadLeft(3, '0')}-{locationInfo.Depth.ToString().PadLeft(2, '0')}"; |
| | | locationInfo.LocationName = $"R{locationInfo.RoadwayNo.PadLeft(2, '0')}å··é{locationInfo.Row.ToString().PadLeft(3, '0')}è¡{locationInfo.Column.ToString().PadLeft(3, '0')}å{locationInfo.Layer.ToString().PadLeft(3, '0')}å±{locationInfo.Depth.ToString().PadLeft(2, '0')}æ·±"; |
| | | |
| | | return base.AddData(locationInfo); |
| | | } |
| | | |
| | |
| | | return LocationDisableStatus(new int[] { key }); |
| | | } |
| | | |
| | | public WebResponseContent GetLocationStatusDic() |
| | | { |
| | | try |
| | | { |
| | | List<object> data = new List<object>(); |
| | | Type type = typeof(LocationStatusEnum); |
| | | List<int> enums = Enum.GetValues(typeof(LocationStatusEnum)).Cast<int>().ToList(); |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(LocationStatusEnum).GetField(((LocationStatusEnum)item).ToString()); |
| | | if (fieldInfo != null) |
| | | { |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | | data.Add(new { value = item.ToString(), label = description.Description }); |
| | | } |
| | | else |
| | | { |
| | | data.Add(new { value = item.ToString(), label = item.ToString() }); |
| | | } |
| | | } |
| | | } |
| | | return WebResponseContent.Instance.OK(data: data); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return WebResponseContent.Instance.Error(e.Message); |
| | | } |
| | | |
| | | } |
| | | |
| | | public WebResponseContent UpdateLocationStatus(int key, int locationStatus) |
| | | { |
| | | try |
| | | { |
| | | Dt_LocationInfo locationInfo = Repository.QueryFirst(x => x.Id == key); |
| | | if (locationInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è´§ä½ä¿¡æ¯"); |
| | | } |
| | | locationInfo.LocationStatus = locationStatus; |
| | | Repository.UpdateData(locationInfo); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | |
| | | } |
| | | |
| | | public WebResponseContent InitializationLocation(InitializationLocationDTO initializationLocationDTO) |
| | | { |
| | | try |
| | |
| | | WebResponseContent LocationEnableStatus(int key); |
| | | |
| | | WebResponseContent LocationDisableStatus(int key); |
| | | |
| | | WebResponseContent GetLocationStatusDic(); |
| | | |
| | | WebResponseContent UpdateLocationStatus(int key, int locationStatus); |
| | | } |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_DTO.System; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_Model.Models; |
| | |
| | | { |
| | | public interface ISys_MenuRepository : IRepository<Sys_Menu> |
| | | { |
| | | List<Sys_Menu> GetAllMenu(); |
| | | List<MenuDTO> GetAllMenu(); |
| | | |
| | | object GetSuperAdminMenu(); |
| | | |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_DTO.System; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_Model.Models; |
| | |
| | | object GetCurrentMenuActionList(); |
| | | object GetMenuActionList(int roleId); |
| | | |
| | | List<Sys_Menu> GetUserMenuList(int roleId); |
| | | List<MenuDTO> GetUserMenuList(int roleId); |
| | | |
| | | List<Sys_Actions> GetActions(int menuId, List<Sys_Actions> menuActions, List<Permissions> permissions, int roleId); |
| | | List<ActionDTO> GetActions(int menuId, List<ActionDTO> menuActions, List<Permissions> permissions, int roleId); |
| | | |
| | | object GetMenu(); |
| | | |
| | |
| | | /// <summary> |
| | | /// æåºå· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true,ColumnDescription ="æåºå·")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æåºå·")] |
| | | public int? OrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "èåç±»å")] |
| | | public int? MenuType { get; set; } |
| | | |
| | | [Navigate(NavigateType.OneToMany, nameof(ParentId), nameof(MenuId)), SugarColumn(IsIgnore = true, IsNullable = true)] |
| | | public List<Sys_Menu> Menus { get; set; } |
| | | |
| | | [SugarColumn(IsIgnore = true)] |
| | | public List<Sys_Actions> Actions { get; set; } |
| | | } |
| | | } |
| | |
| | | _repository = repository; |
| | | } |
| | | |
| | | [HttpPost, Route("InitializationLocation"),AllowAnonymous] |
| | | [HttpPost, Route("GetLocationStatusDic")] |
| | | public WebResponseContent GetLocationStatusDic() |
| | | { |
| | | return Service.GetLocationStatusDic(); |
| | | } |
| | | |
| | | [HttpPost, Route("UpdateLocationStatus")] |
| | | public WebResponseContent UpdateLocationStatus(int key, int locationStatus) |
| | | { |
| | | return Service.UpdateLocationStatus(key, locationStatus); |
| | | } |
| | | |
| | | [HttpPost, Route("InitializationLocation")] |
| | | public WebResponseContent InitializationLocation([FromBody] InitializationLocationDTO initializationLocationDTO) |
| | | { |
| | | return Service.InitializationLocation(initializationLocationDTO); |
| | |
| | | using WIDESEAWCS_Core.Caches; |
| | | using WIDESEAWCS_QuartzJob.DeviceEnum; |
| | | using WIDESEAWCS_Core.Enums; |
| | | using WIDESEAWCS_Common.CommonEnum; |
| | | using WIDESEAWCS_Common.LocationEnum; |
| | | using WIDESEAWCS_Common.OrderEnum; |
| | | using WIDESEAWCS_Common.StockEnum; |
| | | |
| | | namespace WIDESEAWCS_WCSServer.Controllers.System |
| | | { |
| | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "outboundStatusEnum": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | Type type = typeof(OutboundStatusEnum); |
| | | List<int> enums = Enum.GetValues(typeof(OutboundStatusEnum)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(OutboundStatusEnum).GetField(((OutboundStatusEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | | data.Add(new { key = item.ToString(), value = description.Description }); |
| | | } |
| | | else |
| | | { |
| | | data.Add(new { key = item.ToString(), value = item.ToString() }); |
| | | } |
| | | index++; |
| | | } |
| | | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "outOrderType": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | |
| | | { |
| | | Type type = typeof(OutOrderTypeEnum); |
| | | List<int> enums = Enum.GetValues(typeof(OutOrderTypeEnum)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(OutOrderTypeEnum).GetField(((OutOrderTypeEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | | data.Add(new { key = item.ToString(), value = description.Description }); |
| | | } |
| | | else |
| | | { |
| | | data.Add(new { key = item.ToString(), value = item.ToString() }); |
| | | } |
| | | index++; |
| | | } |
| | | } |
| | | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "orderDetailStatusEnum": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | |
| | | { |
| | | Type type = typeof(OrderDetailStatusEnum); |
| | | List<int> enums = Enum.GetValues(typeof(OrderDetailStatusEnum)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(OrderDetailStatusEnum).GetField(((OrderDetailStatusEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | | data.Add(new { key = item.ToString(), value = description.Description }); |
| | | } |
| | | else |
| | | { |
| | | data.Add(new { key = item.ToString(), value = item.ToString() }); |
| | | } |
| | | index++; |
| | | } |
| | | } |
| | | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "enableEnum": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | |
| | | { |
| | | Type type = typeof(EnableEnum); |
| | | List<int> enums = Enum.GetValues(typeof(EnableEnum)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(EnableEnum).GetField(((EnableEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | | data.Add(new { key = item.ToString(), value = description.Description }); |
| | | } |
| | | else |
| | | { |
| | | data.Add(new { key = item.ToString(), value = item.ToString() }); |
| | | } |
| | | index++; |
| | | } |
| | | } |
| | | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "enableStatusEnum": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | |
| | | { |
| | | Type type = typeof(EnableStatusEnum); |
| | | List<int> enums = Enum.GetValues(typeof(EnableStatusEnum)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(EnableStatusEnum).GetField(((EnableStatusEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | | data.Add(new { key = item.ToString(), value = description.Description }); |
| | | } |
| | | else |
| | | { |
| | | data.Add(new { key = item.ToString(), value = item.ToString() }); |
| | | } |
| | | index++; |
| | | } |
| | | } |
| | | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "locationStatusEnum": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | |
| | | { |
| | | Type type = typeof(LocationStatusEnum); |
| | | List<int> enums = Enum.GetValues(typeof(LocationStatusEnum)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(LocationStatusEnum).GetField(((LocationStatusEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | | data.Add(new { key = item.ToString(), value = description.Description }); |
| | | } |
| | | else |
| | | { |
| | | data.Add(new { key = item.ToString(), value = item.ToString() }); |
| | | } |
| | | index++; |
| | | } |
| | | } |
| | | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "stockStatusEmun": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | Type type = typeof(StockStatusEmun); |
| | | List<int> enums = Enum.GetValues(typeof(StockStatusEmun)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(StockStatusEmun).GetField(((StockStatusEmun)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | | data.Add(new { key = item.ToString(), value = description.Description }); |
| | | } |
| | | else |
| | | { |
| | | data.Add(new { key = item.ToString(), value = item.ToString() }); |
| | | } |
| | | index++; |
| | | } |
| | | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | } |
| | | return result; |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_DTO.System; |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob.DTO; |
| | |
| | | /// </summary> |
| | | public CustomProfile() |
| | | { |
| | | CreateMap<Sys_Menu, MenuDTO>(); |
| | | CreateMap<Dt_DeviceInfo,DeviceInfoDTO>(); |
| | | CreateMap<WMSTaskDTO, Dt_Task>().ForMember(a => a.WMSId, b => b.MapFrom(b => b.Id)); |
| | | CreateMap<Dt_Task, ConveyorLineTaskCommand>().ForMember(a => a.TargetAddress, b => b.MapFrom(b => b.NextAddress)).ForMember(a => a.Barcode, b => b.MapFrom(b => b.PalletCode)).ForMember(a => a.TaskNum, b => b.MapFrom(b => b.TaskNum)); |
| | |
| | | "Microsoft.AspNetCore": "Warning" |
| | | } |
| | | }, |
| | | "dics": "deviceType,devicePlcType,jobAssembly,jobClassName,deviceStatus,taskType,taskState,inOutType", |
| | | "dics": "deviceType,devicePlcType,jobAssembly,jobClassName,deviceStatus,taskType,taskState,inOutType,orderDetailStatusEnum,enableEnum,enableStatusEnum,locationStatusEnum,stockStatusEmun", |
| | | "AllowedHosts": "*", |
| | | "ConnectionStringsEncryption": false, |
| | | "MainDB": "DB_WIDESEA", //å½å项ç®ç主åºï¼æå¯¹åºçè¿æ¥å符串çEnabledå¿
须为true |
| | | //è¿æ¥å符串 |
| | | //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=", |
| | | "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWCS_TEST;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWCS_GuoDian;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //è·¨å |
| | | "Cors": { |
| | | "PolicyName": "CorsIpAccess", //çç¥åç§° |
| | |
| | | using SqlSugar; |
| | | using AutoMapper; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Concurrent; |
| | | using System.Collections.Generic; |
| | | using System.Drawing; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_DTO.System; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_Core.Helper; |
| | |
| | | { |
| | | public class Sys_MenuRepository : RepositoryBase<Sys_Menu>, ISys_MenuRepository |
| | | { |
| | | public Sys_MenuRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) |
| | | private readonly IMapper _mapper; |
| | | public Sys_MenuRepository(IUnitOfWorkManage unitOfWorkManage, IMapper mapper) : base(unitOfWorkManage) |
| | | { |
| | | _mapper = mapper; |
| | | } |
| | | |
| | | public List<Sys_Menu> GetAllMenu() |
| | | public List<MenuDTO> GetAllMenu() |
| | | { |
| | | List<Sys_Menu> _menus = base.QueryData(x => x.Enable == 1 || x.Enable == 2).OrderByDescending(a => a.OrderNo).ThenByDescending(q => q.ParentId).ToList(); |
| | | |
| | | List<Sys_Menu> menus = base.QueryData(x => x.Enable == 1 || x.Enable == 2).OrderByDescending(a => a.OrderNo).ThenByDescending(q => q.ParentId).ToList(); |
| | | List<MenuDTO> _menus = _mapper.Map<List<MenuDTO>>(menus); |
| | | _menus.ForEach(x => |
| | | { |
| | | x.MenuType ??= 0; |
| | |
| | | { |
| | | try |
| | | { |
| | | x.Actions = x.Auth.DeserializeObject<List<Sys_Actions>>(); |
| | | x.Actions = x.Auth.DeserializeObject<List<ActionDTO>>(); |
| | | } |
| | | catch { } |
| | | } |
| | | x.Actions ??= new List<Sys_Actions>(); |
| | | x.Actions ??= new List<ActionDTO>(); |
| | | }); |
| | | string test = _menus.Serialize(); |
| | | return _menus; |
| | |
| | | using System.Reflection; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_Core.Caches; |
| | |
| | | List<string> cacheDicNos = new List<string>(); |
| | | foreach (string n in dicNos) |
| | | { |
| | | string str = _cacheService.Get(n); |
| | | string? str = _cacheService.Get(n); |
| | | if (!string.IsNullOrEmpty(str)) |
| | | { |
| | | VueDictionaryDTO? vueDictionary = JsonConvert.DeserializeObject<VueDictionaryDTO>(str); |
| | |
| | | vueDictionaryDTOs.AddRange(selectDics); |
| | | } |
| | | |
| | | //object GetSourceData(string dicNo, string dbSql, object data) |
| | | //{ |
| | | // if (string.IsNullOrEmpty(dbSql)) |
| | | // { |
| | | // return data; |
| | | // } |
| | | // return BaseDal.QueryObjectDataBySql(dbSql, null); |
| | | //} |
| | | //List<VueDictionaryDTO> vueDictionaryDTOs = dicConfig.Select(item => new VueDictionaryDTO |
| | | //{ |
| | | // DicNo = item.dicNo, |
| | | // Config = item.config, |
| | | // Data = GetSourceData(item.dicNo, item.dbSql, item.list) |
| | | //}).ToList(); |
| | | |
| | | |
| | | return vueDictionaryDTOs; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_DTO.System; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | |
| | | } |
| | | |
| | | |
| | | public List<Sys_Menu> GetUserMenuList(int roleId) |
| | | public List<MenuDTO> GetUserMenuList(int roleId) |
| | | { |
| | | if (App.User.IsRoleIdSuperAdmin(roleId)) |
| | | { |
| | |
| | | return BaseDal.GetAllMenu().Where(x => menuIds.Contains(x.MenuId)).ToList(); |
| | | } |
| | | |
| | | public List<Sys_Actions> GetActions(int menuId, List<Sys_Actions> menuActions, List<Permissions> permissions, int roleId) |
| | | public List<ActionDTO> GetActions(int menuId, List<ActionDTO> menuActions, List<Permissions> permissions, int roleId) |
| | | { |
| | | if (App.User.IsRoleIdSuperAdmin(roleId)) |
| | | { |
| | |
| | | //è·åç¨æ·æé |
| | | List<Permissions> permissions = _MenuRepository.GetPermissions(roleId); |
| | | //æéç¨æ·æéæ¥è¯¢ææçèåä¿¡æ¯ |
| | | List<Sys_Menu> menus = _MenuService.GetUserMenuList(roleId); |
| | | List<MenuDTO> menus = _MenuService.GetUserMenuList(roleId); |
| | | //è·åå½åç¨æ·æéå¦:(Add,Search)对åºçæ¾ç¤ºææ¬ä¿¡æ¯å¦:Addï¼æ·»å ï¼Search:æ¥è¯¢ |
| | | var data = menus.Select(x => new |
| | | { |
| | |
| | | { |
| | | s.UserName, |
| | | s.UserTrueName, |
| | | s.Address, |
| | | s.PhoneNo, |
| | | s.Email, |
| | | //s.Address, |
| | | //s.PhoneNo, |
| | | //s.Email, |
| | | s.Remark, |
| | | s.Gender, |
| | | //s.Gender, |
| | | s.RoleName, |
| | | s.HeadImageUrl, |
| | | s.CreateDate |