diff --git a/PDA/PDA/pages/index/index.vue b/PDA/PDA/pages/index/index.vue index 5825c01..1eee1db 100644 --- a/PDA/PDA/pages/index/index.vue +++ b/PDA/PDA/pages/index/index.vue @@ -115,6 +115,9 @@ saveConfig('userName', this.userName); saveConfig('passWord', this.passWord); + console.log(res.data.data.getRoles[0].authNames); + saveConfig('roleName', res.data.data.getRoles[0].authNames); + //重定向 直接就不能返回这个页面了 uni.redirectTo({ url: '/pages/main/main' diff --git a/PDA/PDA/pages/main/main.vue b/PDA/PDA/pages/main/main.vue index 7537131..60d4eb4 100644 --- a/PDA/PDA/pages/main/main.vue +++ b/PDA/PDA/pages/main/main.vue @@ -12,28 +12,28 @@ - + 物料绑定 - + - + 绑定查询 - + - + 产线呼叫 - + @@ -41,28 +41,28 @@ - + 货架送回 - + - + 库存盘点 - + - + 任务管理 - + @@ -70,12 +70,12 @@ - + 货架位置绑定解绑 - + @@ -90,14 +90,67 @@ diff --git a/PDA/PDA/unpackage/dist/dev/app-plus/app-service.js b/PDA/PDA/unpackage/dist/dev/app-plus/app-service.js index b480af6..904638a 100644 --- a/PDA/PDA/unpackage/dist/dev/app-plus/app-service.js +++ b/PDA/PDA/unpackage/dist/dev/app-plus/app-service.js @@ -207,6 +207,8 @@ if (uni.restoreGlobal) { }); saveConfig("userName", this.userName); saveConfig("passWord", this.passWord); + formatAppLog("log", "at pages/index/index.vue:118", res.data.data.getRoles[0].authNames); + saveConfig("roleName", res.data.data.getRoles[0].authNames); uni.redirectTo({ url: "/pages/main/main" }); @@ -229,7 +231,7 @@ if (uni.restoreGlobal) { }); }, complete: (event) => { - formatAppLog("log", "at pages/index/index.vue:144", "请求完成", event); + formatAppLog("log", "at pages/index/index.vue:147", "请求完成", event); } }); } @@ -392,9 +394,56 @@ if (uni.restoreGlobal) { const _imports_7 = "/static/shelfLocation.png"; const _sfc_main$f = { data() { - return {}; + return { + hasPermission: true + }; }, - methods: {} + methods: { + handleNavigatorTap: function(pageName) { + var roleName = getConfig("roleName", ""); + var requiredRole = "PDA" + pageName; + formatAppLog("log", "at pages/main/main.vue:107", "roleName:", roleName); + formatAppLog("log", "at pages/main/main.vue:108", "requiredRole:", requiredRole); + this.hasPermission = roleName.includes(requiredRole); + let url = ""; + switch (pageName) { + case "物料绑定": + url = "../bind/bind"; + break; + case "绑定查询": + url = "../queryBindList/queryBindList"; + break; + case "产线呼叫": + url = "../productionLineCallIn/productionLineCallIn"; + break; + case "货架送回": + url = "../productionLineCallOut/productionLineCallOut"; + break; + case "库存盘点": + url = "../stockTaking/stockTaking"; + break; + case "任务管理": + url = "../agvTasks/agvTasks"; + break; + case "货架位置绑定解绑": + url = "../shelfLocationBindUnbind/shelfLocationBindUnbind"; + break; + default: + url = ""; + } + if (this.hasPermission) { + wx.navigateTo({ + url + }); + } else { + wx.showToast({ + title: "您没有权限进行此操作", + icon: "none", + duration: 2e3 + }); + } + } + } }; function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("view", { class: "bg-image" }, [ @@ -418,9 +467,9 @@ if (uni.restoreGlobal) { class: "uni-flex uni-column", style: { "flex": "5" } }, [ - vue.createElementVNode("navigator", { - url: "../bind/bind", - "hover-class": "navigator-hover" + vue.createElementVNode("view", { + "hover-class": "navigator-hover", + onClick: _cache[0] || (_cache[0] = ($event) => $options.handleNavigatorTap("物料绑定")) }, [ vue.createElementVNode("view", { class: "uni-flex uni-row", @@ -438,9 +487,9 @@ if (uni.restoreGlobal) { class: "uni-flex uni-column", style: { "flex": "5" } }, [ - vue.createElementVNode("navigator", { - url: "../queryBindList/queryBindList", - "hover-class": "navigator-hover" + vue.createElementVNode("view", { + "hover-class": "navigator-hover", + onClick: _cache[1] || (_cache[1] = ($event) => $options.handleNavigatorTap("绑定查询")) }, [ vue.createElementVNode("view", { class: "uni-flex uni-row", @@ -458,9 +507,9 @@ if (uni.restoreGlobal) { class: "uni-flex uni-column", style: { "flex": "5" } }, [ - vue.createElementVNode("navigator", { - url: "../productionLineCallIn/productionLineCallIn", - "hover-class": "navigator-hover" + vue.createElementVNode("view", { + "hover-class": "navigator-hover", + onClick: _cache[2] || (_cache[2] = ($event) => $options.handleNavigatorTap("产线呼叫")) }, [ vue.createElementVNode("view", { class: "uni-flex uni-row", @@ -482,9 +531,9 @@ if (uni.restoreGlobal) { class: "uni-flex uni-column", style: { "flex": "5" } }, [ - vue.createElementVNode("navigator", { - url: "../productionLineCallOut/productionLineCallOut", - "hover-class": "navigator-hover" + vue.createElementVNode("view", { + "hover-class": "navigator-hover", + onClick: _cache[3] || (_cache[3] = ($event) => $options.handleNavigatorTap("货架送回")) }, [ vue.createElementVNode("view", { class: "uni-flex uni-row", @@ -502,9 +551,9 @@ if (uni.restoreGlobal) { class: "uni-flex uni-column", style: { "flex": "5" } }, [ - vue.createElementVNode("navigator", { - url: "../stockTaking/stockTaking", - "hover-class": "navigator-hover" + vue.createElementVNode("view", { + "hover-class": "navigator-hover", + onClick: _cache[4] || (_cache[4] = ($event) => $options.handleNavigatorTap("库存盘点")) }, [ vue.createElementVNode("view", { class: "uni-flex uni-row", @@ -522,9 +571,9 @@ if (uni.restoreGlobal) { class: "uni-flex uni-column", style: { "flex": "5" } }, [ - vue.createElementVNode("navigator", { - url: "../agvTasks/agvTasks", - "hover-class": "navigator-hover" + vue.createElementVNode("view", { + "hover-class": "navigator-hover", + onClick: _cache[5] || (_cache[5] = ($event) => $options.handleNavigatorTap("任务管理")) }, [ vue.createElementVNode("view", { class: "uni-flex uni-row", @@ -546,9 +595,9 @@ if (uni.restoreGlobal) { class: "uni-flex uni-column", style: { "flex": "5" } }, [ - vue.createElementVNode("navigator", { - url: "../shelfLocationBindUnbind/shelfLocationBindUnbind", - "hover-class": "navigator-hover" + vue.createElementVNode("view", { + "hover-class": "navigator-hover", + onClick: _cache[6] || (_cache[6] = ($event) => $options.handleNavigatorTap("货架位置绑定解绑")) }, [ vue.createElementVNode("view", { class: "uni-flex uni-row", diff --git a/WCS.BLL/Services/Service/UserService.cs b/WCS.BLL/Services/Service/UserService.cs index 0fdd5f1..ec572be 100644 --- a/WCS.BLL/Services/Service/UserService.cs +++ b/WCS.BLL/Services/Service/UserService.cs @@ -253,6 +253,7 @@ namespace WCS.BLL.Services.Service Role.IsAdmin = request.Role.IsAdmin; Role.Name = request.Role.Name; Role.Auths = request.Role.Auths; + Role.AuthNames = request.Role.AuthNames; Role.Time = request.Role.Time; var rowNum = await AuthDbHelp.db.Updateable(Role).ExecuteCommandAsync(); if (rowNum == 0) diff --git a/WCS.DAL/Db/AuthDb/AuthModels.cs b/WCS.DAL/Db/AuthDb/AuthModels.cs index 1780d79..584315d 100644 --- a/WCS.DAL/Db/AuthDb/AuthModels.cs +++ b/WCS.DAL/Db/AuthDb/AuthModels.cs @@ -76,8 +76,7 @@ namespace WCS.DAL.Db.AuthDb /// /// 认证模块名称 /// - [SugarColumn(IsIgnore = true)] - public List AuthNames { get => Auths == null || !Auths.Any() ? new List() : EnumHelps.GetEnumDescriptionList(typeof(AuthEnum), true).Where(o => Auths.Contains(o.Item1)).Select(o => o.Item3).ToList(); } + public string AuthNames { get; set; } /// /// 是否最大权限 /// diff --git a/WCS.Model/ApiModel/User/AuthModels.cs b/WCS.Model/ApiModel/User/AuthModels.cs index 060a4ba..3c0bb4c 100644 --- a/WCS.Model/ApiModel/User/AuthModels.cs +++ b/WCS.Model/ApiModel/User/AuthModels.cs @@ -52,7 +52,7 @@ namespace WCS.Model.ApiModel public List Auths { get; set; } = new List(); - public List AuthNames { get => (Auths == null || !Auths.Any()) ? new List() : EnumHelps.GetEnumDescriptionList(typeof(AuthEnum), true).Where(o => Auths.Contains(o.Item1)).Select(o => o.Item3).ToList(); } + public string AuthNames { get; set; } /// /// 是否最大权限 /// diff --git a/货架标准上位机/Models/AuthEnum.cs b/货架标准上位机/Models/AuthEnum.cs index 424b95b..07f544c 100644 --- a/货架标准上位机/Models/AuthEnum.cs +++ b/货架标准上位机/Models/AuthEnum.cs @@ -13,21 +13,24 @@ namespace 智慧物流软件系统 /// public enum AuthEnum { - //主页 = 1000, - 物料入库 = 2000, - 出库单据 = 3000, - 物料出库 = 4000, - 盘点单据 = 5000, - 物料盘点 = 6000, - 库存查询 = 7000, - 出入记录 = 8000, - 库位管理 = 9000, - 物料维护 = 10000, - 物料明细 = 11000, - 接口记录 = 12000, - 权限 = 13000, - 调试 = 14000, - 设置 = 15000, + 货架存量 = 1000, + 位置管理 = 2000, + 物料管理 = 3000, + 货架管理 = 4000, + 库存盘点 = 5000, + 物料绑定 = 6000, + 数据记录 = 7000, + 任务管理 = 8000, + 接口记录 = 9000, + 权限 = 10000, + 设置 = 11000, + PDA物料绑定 = 12000, + PDA绑定查询 = 13000, + PDA产线呼叫 = 14000, + PDA货架送回 = 15000, + PDA库存盘点 = 16000, + PDA任务管理 = 17000, + PDA货架位置绑定解绑 = 18000, } public class EnumTreeAttribute : Attribute diff --git a/货架标准上位机/Views/MainWindows/MainWindow1.xaml b/货架标准上位机/Views/MainWindows/MainWindow1.xaml index 47ff8ed..17f1ab9 100644 --- a/货架标准上位机/Views/MainWindows/MainWindow1.xaml +++ b/货架标准上位机/Views/MainWindows/MainWindow1.xaml @@ -130,7 +130,7 @@ --> - + @@ -144,7 +144,7 @@ + Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.位置管理},Converter={StaticResource AuthVisConverter}}"> + Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.物料管理},Converter={StaticResource AuthVisConverter}}"> + Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.货架管理},Converter={StaticResource AuthVisConverter}}"> + Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.库存盘点},Converter={StaticResource AuthVisConverter}}"> + Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.物料绑定},Converter={StaticResource AuthVisConverter}}"> - + @@ -230,7 +230,7 @@ + Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.任务管理},Converter={StaticResource AuthVisConverter}}"> o.IsSelect).Select(o => o.Name).ToList(); + var antuNameStr = string.Join(",", antuNames); RoleModel newRole = new RoleModel() { Id = roleBase.Id, IsAdmin = roleBase.IsAdmin, Name = view.textBox.Text.Trim(), Auths = treeNode.Where(o => o.IsSelect).Select(o => (int)o.Id).ToList(), + AuthNames = antuNameStr, Time = roleBase.Time, }; if (crudEnum == CrudEnum.Update)