From e03e36768bba73112d0c7bc7499b11b6e4206c87 Mon Sep 17 00:00:00 2001 From: MonstorUncle <295228902@qq.com> Date: Fri, 18 Dec 2020 11:14:00 +0800 Subject: [PATCH 1/4] =?UTF-8?q?1.8.0=20=E6=9B=B4=E6=96=B0=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E5=A4=9A=E9=80=89=E5=8D=95=E9=80=89=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E4=BB=A5=E5=8F=8Asoultable=20common=E5=92=8CcommonTable?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=A1=8C=E9=80=89=E4=B8=AD=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Template/SingleTableTemplate.cs | 104 +--- .../ContentManage/ArticleNewsService.cs | 14 +- .../FileManage/UploadfileService.cs | 13 +- .../FlowManage/FlowinstanceService.cs | 13 +- .../InfoManage/MessageService.cs | 15 +- .../DataPrivilegeRuleService.cs | 9 +- .../SystemOrganize/NoticeService.cs | 9 +- .../SystemOrganize/RoleService.cs | 22 +- .../SystemOrganize/UserService.cs | 15 +- .../Controllers/ArticleNewsController.cs | 18 +- .../Views/ArticleCategory/Index.cshtml | 63 +-- .../Views/ArticleNews/Index.cshtml | 105 +--- .../Controllers/UploadfileController.cs | 16 +- .../FileManage/Views/Uploadfile/Index.cshtml | 77 ++- .../Controllers/FlowinstanceController.cs | 16 +- .../Views/Flowinstance/DoneFlow.cshtml | 98 ++-- .../Views/Flowinstance/Index.cshtml | 97 +++- .../Views/Flowinstance/ToDoFlow.cshtml | 358 ++++++-------- .../Views/Flowinstance/Verification.cshtml | 371 ++++++++------ .../Controllers/MessageController.cs | 18 +- .../InfoManage/Views/Message/Index.cshtml | 72 ++- .../SystemManage/Views/Area/Index.cshtml | 78 ++- .../Views/CodeGenerator/Index.cshtml | 64 ++- .../Views/Flowscheme/Index.cshtml | 31 +- .../SystemManage/Views/Form/Index.cshtml | 33 +- .../SystemManage/Views/ItemsData/Index.cshtml | 31 +- .../SystemManage/Views/ItemsType/Index.cshtml | 146 ++++-- .../SystemManage/Views/Module/Index.cshtml | 456 ++++++++++-------- .../Views/ModuleButton/Index.cshtml | 81 +++- .../Views/ModuleFields/Index.cshtml | 144 +++--- .../DataPrivilegeRuleController.cs | 18 +- .../Controllers/NoticeController.cs | 17 +- .../Controllers/RoleController.cs | 17 +- .../Controllers/UserController.cs | 18 +- .../Views/DataPrivilegeRule/Form.cshtml | 80 ++- .../Views/DataPrivilegeRule/Index.cshtml | 76 +-- .../SystemOrganize/Views/Duty/Import.cshtml | 23 +- .../SystemOrganize/Views/Duty/Index.cshtml | 73 ++- .../SystemOrganize/Views/Notice/Index.cshtml | 87 +++- .../Views/Organize/Index.cshtml | 72 ++- .../SystemOrganize/Views/Role/Index.cshtml | 85 +++- .../Views/SystemSet/Index.cshtml | 56 ++- .../SystemOrganize/Views/User/Index.cshtml | 135 ++++-- .../SystemSecurity/Views/AppLog/Index.cshtml | 58 ++- .../Views/FilterIP/Index.cshtml | 82 +++- .../Views/OpenJobs/Index.cshtml | 138 ++++-- .../js/lay-module/waterCloud/common.js | 79 +++ .../js/lay-module/waterCloud/commonTable.js | 86 ++++ 48 files changed, 2356 insertions(+), 1431 deletions(-) diff --git a/WaterCloud.CodeGenerator/Template/SingleTableTemplate.cs b/WaterCloud.CodeGenerator/Template/SingleTableTemplate.cs index 29197646..2e222bc3 100644 --- a/WaterCloud.CodeGenerator/Template/SingleTableTemplate.cs +++ b/WaterCloud.CodeGenerator/Template/SingleTableTemplate.cs @@ -591,22 +591,22 @@ namespace WaterCloud.CodeGenerator if (baseConfigModel.PageIndex.ButtonList.Contains("add")) { KeyValue button = list.Where(p => p.Key == "add").FirstOrDefault(); - sb.AppendLine(" "); + sb.AppendLine(" "); } if (baseConfigModel.PageIndex.ButtonList.Contains("edit")) { KeyValue button = list.Where(p => p.Key == "edit").FirstOrDefault(); - sb.AppendLine(" "); + sb.AppendLine(" "); } if (baseConfigModel.PageIndex.ButtonList.Contains("delete")) { KeyValue button = list.Where(p => p.Key == "delete").FirstOrDefault(); - sb.AppendLine(" "); + sb.AppendLine(" "); } if (baseConfigModel.PageIndex.ButtonList.Contains("details")) { KeyValue button = list.Where(p => p.Key == "details").FirstOrDefault(); - sb.AppendLine(" "); + sb.AppendLine(" "); } sb.AppendLine(" "); sb.AppendLine(" "); @@ -622,11 +622,11 @@ namespace WaterCloud.CodeGenerator } if (baseConfigModel.PageIndex.ButtonList.Contains("delete")) { - sb.AppendLine(" "); + sb.AppendLine(" "); } if (baseConfigModel.PageIndex.ButtonList.Contains("details")) { - sb.AppendLine(" "); + sb.AppendLine(" "); } sb.AppendLine(" "); } @@ -663,7 +663,7 @@ namespace WaterCloud.CodeGenerator sb.AppendLine(" url: '/" + baseConfigModel.OutputConfig.OutputModule + "/" + baseConfigModel.FileConfig.ClassPrefix + "/GetTreeGridJson'+(!queryJson ? '' : '?keyword=' + queryJson),"); sb.AppendLine(" sqlkey: '" + idColumn + "',//数据库主键"); sb.AppendLine(" cols: [["); sb.AppendLine(" //此处需修改"); - sb.AppendLine(" { type: \"checkbox\", width: 50 },"); + sb.AppendLine(" { type: \"radio\", width: 50 },"); int cout = 1; foreach (var item in baseConfigModel.PageIndex.ColumnList) { @@ -757,85 +757,18 @@ namespace WaterCloud.CodeGenerator sb.AppendLine(" });"); } sb.AppendLine(" wcLoading.close();"); - sb.AppendLine(" //行点击事件"); + sb.AppendLine(" //行点击事件监听,控制按钮显示"); if (baseConfigModel.PageIndex.IsTree == 1) { - sb.AppendLine(" treeTable.on('row(currentTableId)', function (obj) {"); - sb.AppendLine(" obj.tr.find(\"div.layui-unselect.layui-form-checkbox\")[0].click();"); - sb.AppendLine(" })"); + sb.AppendLine(" var oneList = [\"NF-edit\", \"NF-details\", \"NF-delete\"];//选择1条显示"); + sb.AppendLine(" common.treeTableRowClick(\"radio\", rendertree, \"currentTableId\", oneList);"); } else { - sb.AppendLine(" $(document).on(\"click\", \".layui-table-body table.layui-table tbody tr\", function () {"); - sb.AppendLine(" var index = $(this).attr('data-index');"); - sb.AppendLine(" var tableBox = $(this).parents('.layui-table-box');"); - sb.AppendLine(" //存在固定列"); - sb.AppendLine(" if (tableBox.find(\".layui-table-fixed.layui-table-fixed-l\").length > 0) {"); - sb.AppendLine(" tableDiv = tableBox.find(\".layui-table-fixed.layui-table-fixed-l\");"); - sb.AppendLine(" } else {"); - sb.AppendLine(" tableDiv = tableBox.find(\".layui-table-body.layui-table-main\");"); - sb.AppendLine(" }"); - sb.AppendLine(" //单选checkbox换成radio"); - sb.AppendLine(" var checkCell = tableDiv.find(\"tr[data-index=\" + index + \"]\").find(\"td div.laytable-cell-checkbox div.layui-form-checkbox I\");"); - sb.AppendLine(" if (checkCell.length > 0) {"); - sb.AppendLine(" checkCell.click();"); - sb.AppendLine(" }"); - sb.AppendLine(" });"); - sb.AppendLine(" $(document).on(\"click\", \"td div.laytable-cell-checkbox div.layui-form-checkbox\", function (e) {"); - sb.AppendLine(" e.stopPropagation();"); - sb.AppendLine(" });"); + sb.AppendLine(" var oneList = [\"NF-edit\", \"NF-details\"];//选择1条显示"); + sb.AppendLine(" var morerList = [\"NF-delete\"];//选中1条以上显示"); + sb.AppendLine(" commonTable.tableRowClick(\"checkbox\", \"currentTableFilter\", \"currentTableId\", oneList, morerList);"); } - sb.AppendLine(" //多选监听事件"); - if (baseConfigModel.PageIndex.IsTree == 1) - { - sb.AppendLine(" treeTable.on('checkbox(currentTableId)', function (obj) {"); - sb.AppendLine(" var data = rendertree.checkStatus(false);"); - sb.AppendLine(" if (obj.type==\"all\") {"); - sb.AppendLine(" if (obj.checked && rendertree.options.data.length!=0) {"); - sb.AppendLine(" if (rendertree.options.data.length>1) {"); - } - else - { - sb.AppendLine(" table.on('checkbox(currentTableFilter)', function (obj) {"); - sb.AppendLine(" var data = table.checkStatus('currentTableId').data"); - sb.AppendLine(" if (obj.type==\"all\") {"); - sb.AppendLine(" if (obj.checked && table.cache.currentTableId.length!=0) {"); - sb.AppendLine(" if (table.cache.currentTableId.length>1) {"); - } - sb.AppendLine(" $('[name=\"NF-edit\"]').addClass(\"layui-hide\");"); - sb.AppendLine(" $('[name=\"NF-details\"]').addClass(\"layui-hide\");"); - sb.AppendLine(" $('[name=\"NF-delete\"]').removeClass(\"layui-hide\");"); - sb.AppendLine(" }"); - sb.AppendLine(" else {"); - sb.AppendLine(" $('[name=\"NF-edit\"]').removeClass(\"layui-hide\");"); - sb.AppendLine(" $('[name=\"NF-details\"]').removeClass(\"layui-hide\");"); - sb.AppendLine(" $('[name=\"NF-delete\"]').removeClass(\"layui-hide\");"); - sb.AppendLine(" }"); - sb.AppendLine(" }"); - sb.AppendLine(" else {"); - sb.AppendLine(" $('[name=\"NF-edit\"]').addClass(\"layui-hide\");"); - sb.AppendLine(" $('[name=\"NF-details\"]').addClass(\"layui-hide\");"); - sb.AppendLine(" $('[name=\"NF-delete\"]').addClass(\"layui-hide\");"); - sb.AppendLine(" }"); - sb.AppendLine(" }"); - sb.AppendLine(" else {"); - sb.AppendLine(" if (data.length > 1) {"); - sb.AppendLine(" $('[name=\"NF-edit\"]').addClass(\"layui-hide\");"); - sb.AppendLine(" $('[name=\"NF-details\"]').addClass(\"layui-hide\");"); - sb.AppendLine(" $('[name=\"NF-delete\"]').removeClass(\"layui-hide\");"); - sb.AppendLine(" }"); - sb.AppendLine(" else if (data.length == 1) {"); - sb.AppendLine(" $('[name=\"NF-edit\"]').removeClass(\"layui-hide\");"); - sb.AppendLine(" $('[name=\"NF-details\"]').removeClass(\"layui-hide\");"); - sb.AppendLine(" $('[name=\"NF-delete\"]').removeClass(\"layui-hide\");"); - sb.AppendLine(" }"); - sb.AppendLine(" else {"); - sb.AppendLine(" $('[name=\"NF-edit\"]').addClass(\"layui-hide\");"); - sb.AppendLine(" $('[name=\"NF-details\"]').addClass(\"layui-hide\");"); - sb.AppendLine(" $('[name=\"NF-delete\"]').addClass(\"layui-hide\");"); - sb.AppendLine(" }"); - sb.AppendLine(" }"); - sb.AppendLine(" });"); sb.AppendLine(" //toolbar监听事件"); if (baseConfigModel.PageIndex.IsTree == 1) { @@ -847,6 +780,7 @@ namespace WaterCloud.CodeGenerator sb.AppendLine(" table.on('toolbar(currentTableFilter)', function (obj) { "); sb.AppendLine(" var data = table.checkStatus('currentTableId').data;"); } + sb.AppendLine(" var id = data.length > 0 ? data[0]."+ idColumn + " : null;"); sb.AppendLine(" if (obj.event === 'add') { // 监听添加操作"); sb.AppendLine(" common.modalOpen({"); sb.AppendLine(" title: \"添加界面\","); @@ -879,7 +813,7 @@ namespace WaterCloud.CodeGenerator sb.AppendLine(" }"); sb.AppendLine(" common.modalOpen({"); sb.AppendLine(" title: \"编辑界面\","); - sb.AppendLine(" url: \"/" + baseConfigModel.OutputConfig.OutputModule + "/" + baseConfigModel.FileConfig.ClassPrefix + "/Form?keyValue=\" + data[0]." + idColumn + ","); + sb.AppendLine(" url: \"/" + baseConfigModel.OutputConfig.OutputModule + "/" + baseConfigModel.FileConfig.ClassPrefix + "/Form?keyValue=\" + id,"); sb.AppendLine(" width: \"500px\","); sb.AppendLine(" height: \"500px\","); sb.AppendLine(" });"); @@ -891,7 +825,7 @@ namespace WaterCloud.CodeGenerator sb.AppendLine(" }"); sb.AppendLine(" common.modalOpen({"); sb.AppendLine(" title: \"查看界面\","); - sb.AppendLine(" url: \"/" + baseConfigModel.OutputConfig.OutputModule + "/" + baseConfigModel.FileConfig.ClassPrefix + "/Details?keyValue=\" + data[0]." + idColumn + ","); + sb.AppendLine(" url: \"/" + baseConfigModel.OutputConfig.OutputModule + "/" + baseConfigModel.FileConfig.ClassPrefix + "/Details?keyValue=\" + id,"); sb.AppendLine(" width: \"500px\","); sb.AppendLine(" height: \"500px\","); sb.AppendLine(" btn: []"); @@ -919,6 +853,8 @@ namespace WaterCloud.CodeGenerator { sb.AppendLine(" table.on('tool(currentTableFilter)', function (obj) {"); } + + sb.AppendLine(" var id = obj.data." + idColumn+";"); sb.AppendLine(" if (obj.event === 'delete') {"); sb.AppendLine(" common.deleteForm({"); sb.AppendLine(" url: \"/" + baseConfigModel.OutputConfig.OutputModule + "/" + baseConfigModel.FileConfig.ClassPrefix + "/DeleteForm\","); @@ -931,7 +867,7 @@ namespace WaterCloud.CodeGenerator sb.AppendLine(" else if (obj.event === 'edit') {"); sb.AppendLine(" common.modalOpen({"); sb.AppendLine(" title: \"编辑界面\","); - sb.AppendLine(" url: \"/" + baseConfigModel.OutputConfig.OutputModule + "/" + baseConfigModel.FileConfig.ClassPrefix + "/Form?keyValue=\" + obj.data." + idColumn + ","); + sb.AppendLine(" url: \"/" + baseConfigModel.OutputConfig.OutputModule + "/" + baseConfigModel.FileConfig.ClassPrefix + "/Form?keyValue=\" + id,"); sb.AppendLine(" width: \"500px\","); sb.AppendLine(" height: \"500px\","); sb.AppendLine(" });"); @@ -939,7 +875,7 @@ namespace WaterCloud.CodeGenerator sb.AppendLine(" else if (obj.event === 'details') {"); sb.AppendLine(" common.modalOpen({"); sb.AppendLine(" title: \"查看界面\","); - sb.AppendLine(" url: \"/" + baseConfigModel.OutputConfig.OutputModule + "/" + baseConfigModel.FileConfig.ClassPrefix + "/Details?keyValue=\" +obj.data." + idColumn + ","); + sb.AppendLine(" url: \"/" + baseConfigModel.OutputConfig.OutputModule + "/" + baseConfigModel.FileConfig.ClassPrefix + "/Details?keyValue=\" +id,"); sb.AppendLine(" width: \"500px\","); sb.AppendLine(" height: \"500px\","); sb.AppendLine(" btn: []"); diff --git a/WaterCloud.Service/ContentManage/ArticleNewsService.cs b/WaterCloud.Service/ContentManage/ArticleNewsService.cs index 4a930762..d7ea1099 100644 --- a/WaterCloud.Service/ContentManage/ArticleNewsService.cs +++ b/WaterCloud.Service/ContentManage/ArticleNewsService.cs @@ -33,8 +33,20 @@ namespace WaterCloud.Service.ContentManage return cachedata.Where(t => t.F_DeleteMark == false).OrderByDescending(t => t.F_CreatorTime).ToList(); } - public async Task> GetLookList(Pagination pagination,string keyword = "", string CategoryId="") + public async Task> GetLookList(SoulPage pagination, string keyword = "", string CategoryId="") { + //反格式化显示只能用"等于",其他不支持 + Dictionary> dic = new Dictionary>(); + Dictionary enabledTemp = new Dictionary(); + enabledTemp.Add("有效", "1"); + enabledTemp.Add("无效", "0"); + dic.Add("F_EnabledMark", enabledTemp); + Dictionary isTrue = new Dictionary(); + enabledTemp.Add("是", "1"); + enabledTemp.Add("否", "0"); + dic.Add("F_IsTop", isTrue); + dic.Add("F_IsHot", isTrue); + pagination = ChangeSoulData(dic, pagination); //获取新闻列表 var query = repository.IQueryable(a => a.F_EnabledMark == true) .LeftJoin((a, b) => a.F_CategoryId == b.F_Id && b.F_EnabledMark == true) diff --git a/WaterCloud.Service/FileManage/UploadfileService.cs b/WaterCloud.Service/FileManage/UploadfileService.cs index c7e8028a..8ea32bf6 100644 --- a/WaterCloud.Service/FileManage/UploadfileService.cs +++ b/WaterCloud.Service/FileManage/UploadfileService.cs @@ -50,8 +50,19 @@ namespace WaterCloud.Service.FileManage return data; } - public async Task> GetLookList(Pagination pagination,string keyword = "") + public async Task> GetLookList(SoulPage pagination, string keyword = "") { + //反格式化显示只能用"等于",其他不支持 + Dictionary> dic = new Dictionary>(); + Dictionary enabledTemp = new Dictionary(); + enabledTemp.Add("有效", "1"); + enabledTemp.Add("无效", "0"); + dic.Add("F_EnabledMark", enabledTemp); + Dictionary fileTypeTemp = new Dictionary(); + fileTypeTemp.Add("图片", "1"); + fileTypeTemp.Add("文件", "0"); + dic.Add("F_FileType", fileTypeTemp); + pagination = ChangeSoulData(dic, pagination); //获取数据权限 var list = GetDataPrivilege("u","", GetQuery()); if (!string.IsNullOrEmpty(keyword)) diff --git a/WaterCloud.Service/FlowManage/FlowinstanceService.cs b/WaterCloud.Service/FlowManage/FlowinstanceService.cs index dc2f09e3..ee063f12 100644 --- a/WaterCloud.Service/FlowManage/FlowinstanceService.cs +++ b/WaterCloud.Service/FlowManage/FlowinstanceService.cs @@ -70,9 +70,18 @@ namespace WaterCloud.Service.FlowManage return GetFieldsFilterData(list.Where(a => a.F_EnabledMark == true).OrderByDescending(t => t.F_CreatorTime).ToList()); } - public async Task> GetLookList(Pagination pagination, string type = "", string keyword = "") + public async Task> GetLookList(SoulPage pagination, string type = "", string keyword = "") { - //获取数据权限 + //反格式化显示只能用"等于",其他不支持 + Dictionary> dic = new Dictionary>(); + Dictionary enabledTemp = new Dictionary(); + enabledTemp.Add("正在运行", "0"); + enabledTemp.Add("审批通过", "1"); + //enabledTemp.Add("审批通过", "2"); + enabledTemp.Add("不同意", "3"); + enabledTemp.Add("被驳回", "4"); + dic.Add("F_IsFinish", enabledTemp); + pagination = ChangeSoulData(dic, pagination); var list = GetDataPrivilege("u"); if (!string.IsNullOrEmpty(keyword)) { diff --git a/WaterCloud.Service/InfoManage/MessageService.cs b/WaterCloud.Service/InfoManage/MessageService.cs index 3ede6d4a..bb9879e6 100644 --- a/WaterCloud.Service/InfoManage/MessageService.cs +++ b/WaterCloud.Service/InfoManage/MessageService.cs @@ -7,6 +7,7 @@ using Chloe; using WaterCloud.Domain.InfoManage; using Microsoft.AspNetCore.SignalR; using WaterCloud.Domain.SystemOrganize; +using WaterCloud.Service.SystemManage; namespace WaterCloud.Service.InfoManage { @@ -21,8 +22,10 @@ namespace WaterCloud.Service.InfoManage private string cacheHubKey = "watercloud_hubuserinfo_"; private readonly IHubContext _messageHub; + private ItemsDataService itemsApp; public MessageService(IDbContext context, IHubContext messageHub) : base(context) { + itemsApp = new ItemsDataService(context); _messageHub = messageHub; } #region 获取数据 @@ -66,8 +69,18 @@ namespace WaterCloud.Service.InfoManage return GetFieldsFilterData(query.OrderByDesc(t => t.F_CreatorTime).ToList()); } - public async Task> GetLookList(Pagination pagination,string keyword = "") + public async Task> GetLookList(SoulPage pagination, string keyword = "") { + //反格式化显示只能用"等于",其他不支持 + Dictionary> dic = new Dictionary>(); + var setList = await itemsApp.GetItemList("MessageType"); + Dictionary messageTypeTemp = new Dictionary(); + foreach (var item in setList) + { + messageTypeTemp.Add(item.F_ItemName, item.F_ItemCode); + } + dic.Add("F_MessageType", messageTypeTemp); + pagination = ChangeSoulData(dic, pagination); //获取数据权限 var list = GetDataPrivilege("u"); if (!string.IsNullOrEmpty(keyword)) diff --git a/WaterCloud.Service/SystemOrganize/DataPrivilegeRuleService.cs b/WaterCloud.Service/SystemOrganize/DataPrivilegeRuleService.cs index 601bea65..8c553bb4 100644 --- a/WaterCloud.Service/SystemOrganize/DataPrivilegeRuleService.cs +++ b/WaterCloud.Service/SystemOrganize/DataPrivilegeRuleService.cs @@ -33,8 +33,15 @@ namespace WaterCloud.Service.SystemOrganize return list.Where(t => t.F_DeleteMark == false).OrderByDescending(t => t.F_CreatorTime).ToList(); } - public async Task> GetLookList(Pagination pagination,string keyword = "") + public async Task> GetLookList(SoulPage pagination, string keyword = "") { + //反格式化显示只能用"等于",其他不支持 + Dictionary> dic = new Dictionary>(); + Dictionary enabledTemp = new Dictionary(); + enabledTemp.Add("有效", "1"); + enabledTemp.Add("无效", "0"); + dic.Add("F_EnabledMark", enabledTemp); + pagination = ChangeSoulData(dic, pagination); //获取数据权限 var list = GetDataPrivilege("u"); if (!string.IsNullOrEmpty(keyword)) diff --git a/WaterCloud.Service/SystemOrganize/NoticeService.cs b/WaterCloud.Service/SystemOrganize/NoticeService.cs index 59e55117..9dfc2fae 100644 --- a/WaterCloud.Service/SystemOrganize/NoticeService.cs +++ b/WaterCloud.Service/SystemOrganize/NoticeService.cs @@ -53,8 +53,15 @@ namespace WaterCloud.Service.SystemOrganize //} return list.Where(a => a.F_DeleteMark == false).ToList(); } - public async Task> GetLookList(Pagination pagination, string keyword = "") + public async Task> GetLookList(SoulPage pagination, string keyword = "") { + //ʽʾֻ""֧ + Dictionary> dic = new Dictionary>(); + Dictionary enabledTemp = new Dictionary(); + enabledTemp.Add("Ч", "1"); + enabledTemp.Add("Ч", "0"); + dic.Add("F_EnabledMark", enabledTemp); + pagination = ChangeSoulData(dic, pagination); //ȡȨ var list = GetDataPrivilege("u"); if (!string.IsNullOrEmpty(keyword)) diff --git a/WaterCloud.Service/SystemOrganize/RoleService.cs b/WaterCloud.Service/SystemOrganize/RoleService.cs index f487f3f0..d8a5dc15 100644 --- a/WaterCloud.Service/SystemOrganize/RoleService.cs +++ b/WaterCloud.Service/SystemOrganize/RoleService.cs @@ -19,7 +19,8 @@ namespace WaterCloud.Service.SystemOrganize { private ModuleService moduleApp; private ModuleButtonService moduleButtonApp; - private ModuleFieldsService moduleFieldsApp; + private ModuleFieldsService moduleFieldsApp; + private ItemsDataService itemsApp; /// /// 缓存操作类 /// @@ -34,6 +35,7 @@ namespace WaterCloud.Service.SystemOrganize moduleApp = new ModuleService(context); moduleButtonApp = new ModuleButtonService(context); moduleFieldsApp = new ModuleFieldsService(context); + itemsApp = new ItemsDataService(context); } public async Task> GetList( string keyword = "") @@ -45,8 +47,22 @@ namespace WaterCloud.Service.SystemOrganize } return cachedata.ToList(); } - public async Task> GetLookList(Pagination pagination, string keyword = "") - { + public async Task> GetLookList(SoulPage pagination, string keyword = "") + { + //反格式化显示只能用"等于",其他不支持 + Dictionary> dic = new Dictionary>(); + Dictionary enabledTemp = new Dictionary(); + enabledTemp.Add("有效", "1"); + enabledTemp.Add("无效", "0"); + dic.Add("F_EnabledMark", enabledTemp); + var setList = await itemsApp.GetItemList("RoleType"); + Dictionary messageTypeTemp = new Dictionary(); + foreach (var item in setList) + { + messageTypeTemp.Add(item.F_ItemName, item.F_ItemCode); + } + dic.Add("F_Type", messageTypeTemp); + pagination = ChangeSoulData(dic, pagination); //获取数据权限 var list = GetDataPrivilege("u","", GetQuery()); if (!string.IsNullOrEmpty(keyword)) diff --git a/WaterCloud.Service/SystemOrganize/UserService.cs b/WaterCloud.Service/SystemOrganize/UserService.cs index 92b38732..81be71a0 100644 --- a/WaterCloud.Service/SystemOrganize/UserService.cs +++ b/WaterCloud.Service/SystemOrganize/UserService.cs @@ -31,8 +31,19 @@ namespace WaterCloud.Service.SystemOrganize syssetApp = new SystemSetService(context); } - public async Task> GetLookList(Pagination pagination, string keyword) - { + public async Task> GetLookList(SoulPage pagination, string keyword) + { + //反格式化显示只能用"等于",其他不支持 + Dictionary> dic = new Dictionary>(); + Dictionary enabledTemp = new Dictionary(); + enabledTemp.Add("有效", "1"); + enabledTemp.Add("无效", "0"); + dic.Add("F_EnabledMark", enabledTemp); + Dictionary sexTemp = new Dictionary(); + sexTemp.Add("男", "1"); + sexTemp.Add("女", "0"); + dic.Add("F_Gender", sexTemp); + pagination = ChangeSoulData(dic, pagination); //获取数据权限 var list = GetDataPrivilege("u","", GetQuery().Where(u => u.F_IsAdmin == false)); if (!string.IsNullOrEmpty(keyword)) diff --git a/WaterCloud.Web/Areas/ContentManage/Controllers/ArticleNewsController.cs b/WaterCloud.Web/Areas/ContentManage/Controllers/ArticleNewsController.cs index f5e4d94d..ae0aad1c 100644 --- a/WaterCloud.Web/Areas/ContentManage/Controllers/ArticleNewsController.cs +++ b/WaterCloud.Web/Areas/ContentManage/Controllers/ArticleNewsController.cs @@ -48,21 +48,17 @@ namespace WaterCloud.Web.Areas.ContentManage.Controllers return View(); } #region 获取数据 - [HttpGet] [HandlerAjaxOnly] - public async Task GetGridJson(Pagination pagination, string keyword,string CategoryId) + [IgnoreAntiforgeryToken] + public async Task GetGridJson(SoulPage pagination, string keyword,string CategoryId) { - //此处需修改 - pagination.order = "desc"; - pagination.sort = "F_CreatorTime desc"; - //导出全部页使用 - if (pagination.rows == 0 && pagination.page == 0) + if (string.IsNullOrEmpty(pagination.field)) { - pagination.rows = 99999999; - pagination.page = 1; + pagination.field = "F_CreatorTime"; + pagination.order = "desc"; } - var data = await _service.GetLookList(pagination,keyword,CategoryId); - return Success(pagination.records, data); + var data = await _service.GetLookList(pagination, keyword); + return Content(pagination.setData(data).ToJson()); } [HttpGet] diff --git a/WaterCloud.Web/Areas/ContentManage/Views/ArticleCategory/Index.cshtml b/WaterCloud.Web/Areas/ContentManage/Views/ArticleCategory/Index.cshtml index c44610cc..f6547bf2 100644 --- a/WaterCloud.Web/Areas/ContentManage/Views/ArticleCategory/Index.cshtml +++ b/WaterCloud.Web/Areas/ContentManage/Views/ArticleCategory/Index.cshtml @@ -60,8 +60,7 @@ getIcon: 'ew-tree-icon-style2', }, cols: [[ - { type: "checkbox", width: 50 }, - //此处需修改 + { type: "radio", width: 50 }, { field: 'F_FullName', title: '类别名称', width: 200 }, { field: 'F_SortCode', title: '排序', width: 80 }, { field: 'F_Description', title: '描述', minWidth: 220 }, @@ -101,51 +100,15 @@ }); return false; }); - treeTable.on('checkbox(currentTableId)', function (obj) { - //控制按钮 - var data = rendertree.checkStatus(false); - if (obj.type=="all") { - if (obj.checked && rendertree.options.data.length!=0) { - if (rendertree.options.data.length>1) { - $('[name="NF-edit"]').addClass("layui-hide"); - $('[name="NF-details"]').addClass("layui-hide"); - $('[name="NF-delete"]').removeClass("layui-hide"); - } - else { - $('[name="NF-edit"]').removeClass("layui-hide"); - $('[name="NF-details"]').removeClass("layui-hide"); - $('[name="NF-delete"]').removeClass("layui-hide"); - } - } - else { - $('[name="NF-edit"]').addClass("layui-hide"); - $('[name="NF-details"]').addClass("layui-hide"); - $('[name="NF-delete"]').addClass("layui-hide"); - } - } - else { - if (data.length > 1) { - $('[name="NF-edit"]').addClass("layui-hide"); - $('[name="NF-details"]').addClass("layui-hide"); - $('[name="NF-delete"]').removeClass("layui-hide"); - } - else if (data.length == 1) { - $('[name="NF-edit"]').removeClass("layui-hide"); - $('[name="NF-details"]').removeClass("layui-hide"); - $('[name="NF-delete"]').removeClass("layui-hide"); - } - else { - $('[name="NF-edit"]').addClass("layui-hide"); - $('[name="NF-details"]').addClass("layui-hide"); - $('[name="NF-delete"]').addClass("layui-hide"); - } - } - }); - treeTable.on('row(currentTableId)', function (obj) { - obj.tr.find("div.layui-unselect.layui-form-checkbox")[0].click(); - }) + //行点击事件监听,控制按钮显示 + var oneList = ["NF-edit", "NF-details", "NF-delete"];//选择1条显示 + //var morerList = ["NF-delete"];//选中1条以上 + common.treeTableRowClick("radio", rendertree, "currentTableId", oneList); + //common.treeTableRowClick("radio", rendertree, "currentTableId", oneList, morerList); //toolbar监听事件 treeTable.on('toolbar(currentTableId)', function (obj) { + var data = rendertree.checkStatus(false); + var id = data.length > 0 ? data[0].F_Id : null; if (obj.event === 'add') { // 监听添加操作 common.modalOpen({ title: "添加界面", @@ -155,7 +118,6 @@ }); } else if (obj.event === 'delete') { - var data = rendertree.checkStatus(false); if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; @@ -184,7 +146,7 @@ } common.modalOpen({ title: "编辑界面", - url: "/ContentManage/ArticleCategory/Form?keyValue=" + data[0].F_Id, + url: "/ContentManage/ArticleCategory/Form?keyValue=" + id, width: "500px", height: "500px", data: data[0], @@ -202,7 +164,7 @@ } common.modalOpen({ title: "查看界面", - url: "/ContentManage/ArticleCategory/Details?keyValue=" + data[0].F_Id, + url: "/ContentManage/ArticleCategory/Details?keyValue=" + id, width: "500px", height: "500px", data: data[0], @@ -221,6 +183,7 @@ }); //toolbar监听事件 treeTable.on('tool(currentTableId)', function (obj) { + var id = obj.data.F_Id; if (obj.event === 'delete') { common.deleteForm({ url: "/ContentManage/ArticleCategory/DeleteForm", @@ -233,7 +196,7 @@ else if (obj.event === 'edit') { common.modalOpen({ title: "编辑界面", - url: "/ContentManage/ArticleCategory/Form?keyValue=" + obj.data.F_Id, + url: "/ContentManage/ArticleCategory/Form?keyValue=" + id, width: "500px", height: "500px", data: obj.data, @@ -242,7 +205,7 @@ else if (obj.event === 'details') { common.modalOpen({ title: "查看界面", - url: "/ContentManage/ArticleCategory/Details?keyValue=" + obj.data.F_Id, + url: "/ContentManage/ArticleCategory/Details?keyValue=" + id, width: "500px", height: "500px", data: obj.data, diff --git a/WaterCloud.Web/Areas/ContentManage/Views/ArticleNews/Index.cshtml b/WaterCloud.Web/Areas/ContentManage/Views/ArticleNews/Index.cshtml index 8f22cdb4..fc5427cc 100644 --- a/WaterCloud.Web/Areas/ContentManage/Views/ArticleNews/Index.cshtml +++ b/WaterCloud.Web/Areas/ContentManage/Views/ArticleNews/Index.cshtml @@ -61,11 +61,13 @@ elem: '#currentTableId', id: 'currentTableId', url: '/ContentManage/ArticleNews/GetGridJson', + filter: { + clearFilter: false, + }, cols: [[ { type: "checkbox", width: 50 }, - //此处需修改 - { field: 'F_CategoryName', title: '新闻类别', width: 120 }, - { field: 'F_Title', title: '标题', width: 160 }, + { field: 'F_CategoryName', title: '新闻类别', width: 120, filter: true }, + { field: 'F_Title', title: '标题', width: 160, filter: true }, { field: ' F_ImgUrl ', title: '封面', width: 60, templet: function (d) { @@ -78,10 +80,10 @@ } } }, - { field: 'F_Zhaiyao', title: '摘要', minWidth: 220 }, - { field: 'F_SortCode', title: '排序', width: 80 }, + { field: 'F_Zhaiyao', title: '摘要', minWidth: 220, filter: true }, + { field: 'F_SortCode', title: '排序', width: 80, filter: true }, { - field: 'F_IsTop', title: '置顶', width: 80, + field: 'F_IsTop', title: '置顶', width: 80, filter: true, templet: function (d) { if (d.F_IsTop == true) { return ""; @@ -91,7 +93,7 @@ } }, { - field: 'F_IsHot', title: '热门', width: 80, + field: 'F_IsHot', title: '热门', width: 80, filter: true, templet: function (d) { if (d.F_IsHot == true) { return ""; @@ -100,11 +102,11 @@ } } }, - { field: 'F_Click', title: '点击次数', width: 100 }, - { field: 'F_Source', title: '来源', width: 120 }, - { field: 'F_Author', title: '作者', width: 120 }, + { field: 'F_Click', title: '点击次数', width: 120, filter: true }, + { field: 'F_Source', title: '来源', width: 120, filter: true }, + { field: 'F_Author', title: '作者', width: 120, filter: true }, { - field: 'F_CreatorTime', title: '创建时间', width: 160, + field: 'F_CreatorTime', title: '创建时间', width: 160, filter: { type: 'date[yyyy-MM-dd HH:mm:ss]' }, templet: function (d) { if (d.F_CreatorTime) { var time = new Date(d.F_CreatorTime); @@ -113,7 +115,7 @@ return ''; } }, - { field: 'F_CreatorUserId', title: '创建人', width: 120, hide: true }, + { field: 'F_CreatorUserId', title: '创建人', width: 120, filter: true, hide: true }, { title: '操作', width: 170, toolbar: '#currentTableBar', align: "center" } ]] }); @@ -141,67 +143,14 @@ }); return false; }); - $(document).on("click", ".layui-table-body table.layui-table tbody tr", function () { - var index = $(this).attr('data-index'); - var tableBox = $(this).parents('.layui-table-box'); - //存在固定列 - if (tableBox.find(".layui-table-fixed.layui-table-fixed-l").length > 0) { - tableDiv = tableBox.find(".layui-table-fixed.layui-table-fixed-l"); - } else { - tableDiv = tableBox.find(".layui-table-body.layui-table-main"); - } - var checkCell = tableDiv.find("tr[data-index=" + index + "]").find("td div.laytable-cell-checkbox div.layui-form-checkbox I"); - if (checkCell.length > 0) { - checkCell.click(); - } - }); - //对td的单击事件进行拦截停止,防止事件冒泡再次触发上述的单击事件(Table的单击行事件不会拦截,依然有效) - $(document).on("click", "td div.laytable-cell-checkbox div.layui-form-checkbox", function (e) { - e.stopPropagation(); - }); - //多选框监听 - table.on('checkbox(currentTableFilter)', function (obj) { - //控制按钮 - var data = table.checkStatus('currentTableId').data; - if (obj.type == "all") { - if (obj.checked && table.cache.currentTableId.length != 0) { - if (table.cache.currentTableId.length > 1) { - $('[name="NF-edit"]').addClass("layui-hide"); - $('[name="NF-details"]').addClass("layui-hide"); - $('[name="NF-delete"]').removeClass("layui-hide"); - } - else { - $('[name="NF-edit"]').removeClass("layui-hide"); - $('[name="NF-details"]').removeClass("layui-hide"); - $('[name="NF-delete"]').removeClass("layui-hide"); - } - } - else { - $('[name="NF-edit"]').addClass("layui-hide"); - $('[name="NF-details"]').addClass("layui-hide"); - $('[name="NF-delete"]').addClass("layui-hide"); - } - } - else { - if (data.length > 1) { - $('[name="NF-edit"]').addClass("layui-hide"); - $('[name="NF-details"]').addClass("layui-hide"); - $('[name="NF-delete"]').removeClass("layui-hide"); - } - else if (data.length == 1) { - $('[name="NF-edit"]').removeClass("layui-hide"); - $('[name="NF-details"]').removeClass("layui-hide"); - $('[name="NF-delete"]').removeClass("layui-hide"); - } - else { - $('[name="NF-edit"]').addClass("layui-hide"); - $('[name="NF-details"]').addClass("layui-hide"); - $('[name="NF-delete"]').addClass("layui-hide"); - } - } - }); + //行点击事件监听,控制按钮显示 + var oneList = ["NF-edit", "NF-details"];//选择1条显示 + var morerList = ["NF-delete"];//选中1条以上显示 + commonTable.tableRowClick("checkbox", "currentTableFilter", "currentTableId", oneList, morerList); //toolbar监听事件 table.on('toolbar(currentTableFilter)', function (obj) { + var data = table.checkStatus('currentTableId').data; + var id = data.length > 0 ?data[0].F_Id:null; if (obj.event === 'add') { // 监听添加操作 common.openNewTabByIframe({ title: "添加文章", @@ -209,7 +158,6 @@ }); } else if (obj.event === 'delete') { - var data = table.checkStatus('currentTableId').data; if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; @@ -227,7 +175,6 @@ }); } else if (obj.event === 'edit') { - var data = table.checkStatus('currentTableId').data; if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; @@ -238,11 +185,10 @@ } common.openNewTabByIframe({ title: "编辑文章", - href: "/ContentManage/ArticleNews/Form?keyValue=" + data[0].F_Id, + href: "/ContentManage/ArticleNews/Form?keyValue=" + id, }); } else if (obj.event === 'details') { - var data = table.checkStatus('currentTableId').data; if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; @@ -253,7 +199,7 @@ } common.openNewTabByIframe({ title: "查看文章", - href: "/ContentManage/ArticleNews/Details?keyValue=" + data[0].F_Id, + href: "/ContentManage/ArticleNews/Details?keyValue=" + id, }); } else if (obj.event === 'TABLE_SEARCH') { @@ -268,10 +214,11 @@ }); //toolrow监听事件 table.on('tool(currentTableFilter)', function (obj) { + var id = obj.data.F_Id; if (obj.event === 'delete') { common.deleteForm({ url: "/ContentManage/ArticleNews/DeleteForm", - param: { keyValue: obj.data.F_Id }, + param: { keyValue: id }, success: function () { obj.del(); } @@ -280,13 +227,13 @@ else if (obj.event === 'edit') { common.openNewTabByIframe({ title: "编辑文章", - href: "/ContentManage/ArticleNews/Form?keyValue=" + obj.data.F_Id, + href: "/ContentManage/ArticleNews/Form?keyValue=" + id, }); } else if (obj.event === 'details') { common.openNewTabByIframe({ title: "查看文章", - href: "/ContentManage/ArticleNews/Details?keyValue=" + obj.data.F_Id, + href: "/ContentManage/ArticleNews/Details?keyValue=" + id, }); } return false; diff --git a/WaterCloud.Web/Areas/FileManage/Controllers/UploadfileController.cs b/WaterCloud.Web/Areas/FileManage/Controllers/UploadfileController.cs index 3ee4dc32..2d83013f 100644 --- a/WaterCloud.Web/Areas/FileManage/Controllers/UploadfileController.cs +++ b/WaterCloud.Web/Areas/FileManage/Controllers/UploadfileController.cs @@ -26,21 +26,17 @@ namespace WaterCloud.Web.Areas.FileManage.Controllers public SystemSetService _setService { get; set; } #region 获取数据 - [HttpGet] [HandlerAjaxOnly] - public async Task GetGridJson(Pagination pagination, string keyword) + [IgnoreAntiforgeryToken] + public async Task GetGridJson(SoulPage pagination, string keyword) { - //此处需修改 - pagination.order = "desc"; - pagination.sort = "F_CreatorTime desc"; - //导出全部页使用 - if (pagination.rows == 0 && pagination.page == 0) + if (string.IsNullOrEmpty(pagination.field)) { - pagination.rows = 99999999; - pagination.page = 1; + pagination.field = "F_CreatorTime"; + pagination.order = "desc"; } var data = await _service.GetLookList(pagination,keyword); - return Success(pagination.records, data); + return Content(pagination.setData(data).ToJson()); } [HttpGet] diff --git a/WaterCloud.Web/Areas/FileManage/Views/Uploadfile/Index.cshtml b/WaterCloud.Web/Areas/FileManage/Views/Uploadfile/Index.cshtml index b020f0d7..64573768 100644 --- a/WaterCloud.Web/Areas/FileManage/Views/Uploadfile/Index.cshtml +++ b/WaterCloud.Web/Areas/FileManage/Views/Uploadfile/Index.cshtml @@ -23,10 +23,14 @@ +
@@ -36,19 +40,24 @@ table = layui.table, commonTable = layui.commonTable, common = layui.common; - var entity; //权限控制(js是值传递) + currentTableBar.innerHTML = common.authorizeButtonNew(currentTableBar.innerHTML); toolbarDemo.innerHTML = common.authorizeButtonNew(toolbarDemo.innerHTML); commonTable.rendertable({ elem: '#currentTableId', id: 'currentTableId', - url: '/FileManage/Uploadfile/GetGridJson', + url: '/FileManage/Uploadfile/GetGridJson', + filter: { + clearFilter: false, + //数据量大,data就不需要了 + items: ['column', 'condition', 'editCondition', 'excel'] + }, cols: [[ - //此处需修改 - { field: 'F_FilePath', title: '文件路径', width: 120, sort: true, hide: true }, - { field: 'F_FileName', title: '文件名称', width: 180, sort: true }, + { type: "radio", width: 50 }, + { field: 'F_FilePath', title: '文件路径', width: 120, sort: true, hide: true, filter: true }, + { field: 'F_FileName', title: '文件名称', width: 180, sort: true, filter: true }, { - field: 'F_FileType', title: '文件类型', width: 120, sort: true, + field: 'F_FileType', title: '文件类型', width: 120, sort: true, filter: true, templet: function (d) { if (d.F_FileType == 0) { return "文件"; @@ -57,14 +66,14 @@ } } }, - { field: 'F_FileSize', title: '文件大小', width: 100, sort: true, hide: true }, - { field: 'F_FileExtension', title: '文件扩展名', width: 120, sort: true, hide: true }, - { field: 'F_FileBy', title: '文件所属', width: 120, sort: true }, + { field: 'F_FileSize', title: '文件大小', width: 100, sort: true, hide: true, filter: true }, + { field: 'F_FileExtension', title: '文件扩展名', width: 120, sort: true, hide: true, filter: true }, + { field: 'F_FileBy', title: '文件所属', width: 120, sort: true, filter: true }, { - field: 'F_OrganizeName', title: '所属部门', width: 120, sort: true + field: 'F_OrganizeName', title: '所属部门', width: 120, sort: true, filter: true }, { - field: 'F_EnabledMark', title: '状态', width: 80, + field: 'F_EnabledMark', title: '状态', width: 80, filter: true, templet: function (d) { if (d.F_EnabledMark == true) { return "有效"; @@ -74,7 +83,7 @@ } }, { - field: 'F_CreatorTime', title: '创建时间', width: 120, sort: true, + field: 'F_CreatorTime', title: '创建时间', width: 120, sort: true, filter: { type: 'date[yyyy-MM-dd]' }, templet: function (d) { if (d.F_CreatorTime) { var time = new Date(d.F_CreatorTime); @@ -83,8 +92,9 @@ return ''; } }, - { field: 'F_CreatorUserName', title: '创建用户', width: 120, sort: true }, - { field: 'F_Description', title: '文件备注', minWidth: 150, sort: true }, + { field: 'F_CreatorUserName', title: '创建用户', width: 120, sort: true, filter: true }, + { field: 'F_Description', title: '文件备注', minWidth: 150, sort: true, filter: true }, + { title: '操作', width: 130, toolbar: '#currentTableBar', align: "center" } ]] }); // 监听搜索操作 @@ -95,31 +105,30 @@ curr: 1, where: { keyword: data.field.txt_keyword} }); - entity = null; return false; }); wcLoading.close(); - table.on('row(currentTableFilter)', function (obj) { - obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click"); - entity = obj; - }) + //行点击事件监听,控制按钮显示 + var oneList = ["NF-download", "NF-details"];//选择1条显示 + commonTable.tableRowClick("radio", "currentTableFilter", "currentTableId", oneList); //toolbar监听事件 table.on('toolbar(currentTableFilter)', function (obj) { + var data = table.checkStatus('currentTableId').data; if (obj.event === 'download') { - if (entity == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } - window.open('/FileManage/Uploadfile/Download?keyValue=' + entity.data.F_Id); + window.open('/FileManage/Uploadfile/Download?keyValue=' + data[0].F_Id); } else if (obj.event === 'details') { - if (entity == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "查看文件", - url: "/FileManage/Uploadfile/Details?keyValue=" + entity.data.F_Id, + url: "/FileManage/Uploadfile/Details?keyValue=" + data[0].F_Id, width: "500px", height: "500px", btn: [] @@ -134,6 +143,22 @@ } } return false; - }); + }); + //toolrow监听事件 + table.on('tool(currentTableFilter)', function (obj) { + if (obj.event === 'download') { + window.open('/FileManage/Uploadfile/Download?keyValue=' + obj.data.F_Id); + } + else if (obj.event === 'details') { + common.modalOpen({ + title: "查看文件", + url: "/FileManage/Uploadfile/Details?keyValue=" + obj.data.F_Id, + width: "500px", + height: "500px", + btn: [] + }); + } + return false; + }); }); diff --git a/WaterCloud.Web/Areas/FlowManage/Controllers/FlowinstanceController.cs b/WaterCloud.Web/Areas/FlowManage/Controllers/FlowinstanceController.cs index aa083989..9f300e14 100644 --- a/WaterCloud.Web/Areas/FlowManage/Controllers/FlowinstanceController.cs +++ b/WaterCloud.Web/Areas/FlowManage/Controllers/FlowinstanceController.cs @@ -52,21 +52,17 @@ namespace WaterCloud.Web.Areas.FlowManage.Controllers var data =await _service.QueryHistories(keyValue); return Success(data.Count, data); } - [HttpGet] [HandlerAjaxOnly] - public async Task GetGridJson(Pagination pagination,string type, string keyword) + [IgnoreAntiforgeryToken] + public async Task GetGridJson(SoulPage pagination, string type, string keyword) { - //此处需修改 - pagination.order = "desc"; - pagination.sort = "F_CreatorTime desc"; - //导出全部页使用 - if (pagination.rows == 0 && pagination.page == 0) + if (string.IsNullOrEmpty(pagination.field)) { - pagination.rows = 99999999; - pagination.page = 1; + pagination.field = "F_CreatorTime"; + pagination.order = "desc"; } var data = await _service.GetLookList(pagination, type, keyword); - return Success(pagination.records, data); + return Content(pagination.setData(data).ToJson()); } [HttpGet] diff --git a/WaterCloud.Web/Areas/FlowManage/Views/Flowinstance/DoneFlow.cshtml b/WaterCloud.Web/Areas/FlowManage/Views/Flowinstance/DoneFlow.cshtml index 0b03c839..81754e38 100644 --- a/WaterCloud.Web/Areas/FlowManage/Views/Flowinstance/DoneFlow.cshtml +++ b/WaterCloud.Web/Areas/FlowManage/Views/Flowinstance/DoneFlow.cshtml @@ -6,15 +6,15 @@
-
+
- +
-
+
@@ -23,29 +23,33 @@
+
+ else if (obj.event === 'TABLE_SEARCH') { + var _that = $("#searchField"); + if (_that.hasClass("layui-hide")) { + _that.removeClass('layui-hide'); + } else { + _that.addClass('layui-hide'); + } + } + return false; + }); + //toolrow监听事件 + table.on('tool(currentTableFilter)', function (obj) { + if (obj.event === 'details') { + common.modalOpen({ + title: "查看进度", + url: "/FlowManage/Flowinstance/Details?keyValue=" + obj.data.F_Id, + width: "700px", + height: "600px", + btn: [] + }); + } + return false; + }); + }); + diff --git a/WaterCloud.Web/Areas/FlowManage/Views/Flowinstance/Index.cshtml b/WaterCloud.Web/Areas/FlowManage/Views/Flowinstance/Index.cshtml index 9eecde2e..0489e6b5 100644 --- a/WaterCloud.Web/Areas/FlowManage/Views/Flowinstance/Index.cshtml +++ b/WaterCloud.Web/Areas/FlowManage/Views/Flowinstance/Index.cshtml @@ -23,12 +23,17 @@ +
@@ -38,16 +43,17 @@ table = layui.table, commonTable = layui.commonTable, common = layui.common; - var entity; //权限控制(js是值传递) + currentTableBar.innerHTML = common.authorizeButtonNew(currentTableBar.innerHTML); toolbarDemo.innerHTML = common.authorizeButtonNew(toolbarDemo.innerHTML); commonTable.rendertable({ elem: '#currentTableId', id: 'currentTableId', url: '/FlowManage/Flowinstance/GetGridJson', cols: [[ + { type: "radio", width: 50 }, { - field: 'F_IsFinish', title: '流程状态', width: 120, sort: true, + field: 'F_IsFinish', title: '流程状态', width: 120, sort: true, filter: true, templet: function (d) { if (d.F_IsFinish == 0) { return "正在运行"; @@ -63,13 +69,12 @@ } } }, - //此处需修改 - { field: 'F_Code', title: '实例编号', width: 150, sort: true }, - { field: 'F_CustomName', title: '实例名称', minWidth: 150, sort: true }, - { field: 'F_ActivityName', title: '当前节点名称', width: 120 }, - { field: 'F_Description', title: '实例备注', minWidth: 150 }, + { field: 'F_Code', title: '实例编号', width: 150, sort: true, filter: true }, + { field: 'F_CustomName', title: '实例名称', minWidth: 150, sort: true, filter: true }, + { field: 'F_ActivityName', title: '当前节点名称', width: 140, filter: true }, + { field: 'F_Description', title: '实例备注', minWidth: 150, filter: true }, { - field: 'F_CreatorTime', title: '创建时间', width: 120, + field: 'F_CreatorTime', title: '创建时间', width: 120, filter: { type: 'date[yyyy-MM-dd]' }, templet: function (d) { if (d.F_CreatorTime) { var time = new Date(d.F_CreatorTime); @@ -78,7 +83,8 @@ return ''; } }, - { field: 'F_CreatorUserName', title: '创建人', width: 120, sort: true }, + { field: 'F_CreatorUserName', title: '创建人', width: 120, sort: true, filter: true }, + { title: '操作', width: 170, toolbar: '#currentTableBar', align: "center" } ]] }); // 监听搜索操作 @@ -93,12 +99,12 @@ return false; }); wcLoading.close(); - table.on('row(currentTableFilter)', function (obj) { - obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click"); - entity = obj; - }) + //行点击事件监听,控制按钮显示 + var oneList = ["NF-edit", "NF-details", "NF-delete"];//选择1条显示 + commonTable.tableRowClick("radio", "currentTableFilter", "currentTableId", oneList); //toolbar监听事件 table.on('toolbar(currentTableFilter)', function (obj) { + var data = table.checkStatus('currentTableId').data; if (obj.event === 'add') { // 监听添加操作 common.openNewTabByIframe({ title: "添加申请", @@ -106,17 +112,17 @@ }); } else if (obj.event === 'delete') { - if (entity == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } - if (entity.data.F_IsFinish != 4) { + if (data[0].F_IsFinish != 4) { common.modalMsg("申请已处理,无法删除", "warning"); return false; } common.deleteForm({ url: "/FlowManage/Flowinstance/DeleteForm", - param: { keyValue: entity.data.F_Id }, + param: { keyValue: data[0].F_Id }, success: function () { common.reload('data-search-btn'); entity = null; @@ -124,29 +130,29 @@ }); } else if (obj.event === 'edit') { - if (entity == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } var userJsonStr = sessionStorage.getItem('currentUser'); var userId = JSON.parse(userJsonStr).F_Id; - if (entity.data.F_IsFinish != 4 || entity.data.F_MakerList.indexOf(userId)<0 ) { + if (data[0].F_IsFinish != 4 || data[0].F_MakerList.indexOf(userId)<0 ) { common.modalMsg("申请已处理,无法修改", "warning"); return false; } common.openNewTabByIframe({ title: "修改申请", - href: "/FlowManage/Flowinstance/Form?keyValue=" + entity.data.F_Id, + href: "/FlowManage/Flowinstance/Form?keyValue=" + data[0].F_Id, }); } else if (obj.event === 'details') { - if (entity == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "查看进度", - url: "/FlowManage/Flowinstance/Details?keyValue=" + entity.data.F_Id, + url: "/FlowManage/Flowinstance/Details?keyValue=" + data[0].F_Id, width: "700px", height: "600px", btn: [] @@ -161,6 +167,45 @@ } } return false; - }); + }); + //toolrow监听事件 + table.on('tool(currentTableFilter)', function (obj) { + if (obj.event === 'delete') { + if (obj.data.F_IsFinish != 4) { + common.modalMsg("申请已处理,无法删除", "warning"); + return false; + } + common.deleteForm({ + url: "/FlowManage/Flowinstance/DeleteForm", + param: { keyValue: obj.data.F_Id }, + success: function () { + common.reload('data-search-btn'); + entity = null; + } + }); + } + else if (obj.event === 'edit') { + var userJsonStr = sessionStorage.getItem('currentUser'); + var userId = JSON.parse(userJsonStr).F_Id; + if (obj.data.F_IsFinish != 4 || obj.data.F_MakerList.indexOf(userId) < 0) { + common.modalMsg("申请已处理,无法修改", "warning"); + return false; + } + common.openNewTabByIframe({ + title: "修改申请", + href: "/FlowManage/Flowinstance/Form?keyValue=" + obj.data.F_Id, + }); + } + else if (obj.event === 'details') { + common.modalOpen({ + title: "查看进度", + url: "/FlowManage/Flowinstance/Details?keyValue=" + obj.data.F_Id, + width: "700px", + height: "600px", + btn: [] + }); + } + return false; + }); }); diff --git a/WaterCloud.Web/Areas/FlowManage/Views/Flowinstance/ToDoFlow.cshtml b/WaterCloud.Web/Areas/FlowManage/Views/Flowinstance/ToDoFlow.cshtml index 19005a35..fb43f88d 100644 --- a/WaterCloud.Web/Areas/FlowManage/Views/Flowinstance/ToDoFlow.cshtml +++ b/WaterCloud.Web/Areas/FlowManage/Views/Flowinstance/ToDoFlow.cshtml @@ -1,234 +1,170 @@ @{ - ViewBag.Title = "Details"; - Layout = "~/Views/Shared/_Form.cshtml"; + ViewBag.Title = "Index"; + Layout = "~/Views/Shared/_Index.cshtml"; } - -@**@ - +
+
+
+
+ +
+
+ +
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
- -
-
-
-
-
-
-
    -
  • 流程信息
  • -
  • 表单信息
  • -
- -
-
- -
-
-
- -
-
-
- -
-
- -
-
- - -
- -
- -
-
- -
- -
- -
-
-
- -
-
-
-
-
-
\ No newline at end of file + \ No newline at end of file diff --git a/WaterCloud.Web/Areas/FlowManage/Views/Flowinstance/Verification.cshtml b/WaterCloud.Web/Areas/FlowManage/Views/Flowinstance/Verification.cshtml index c329beac..19005a35 100644 --- a/WaterCloud.Web/Areas/FlowManage/Views/Flowinstance/Verification.cshtml +++ b/WaterCloud.Web/Areas/FlowManage/Views/Flowinstance/Verification.cshtml @@ -1,141 +1,234 @@ @{ - ViewBag.Title = "Index"; - Layout = "~/Views/Shared/_Index.cshtml"; - } -
-
-
-
-
-
-
- -
- -
-
-
- -
-
-
-
-
- -
-
-
- + +
+
+
+
+
+
+
    +
  • 流程信息
  • +
  • 表单信息
  • +
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ +
+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+
+
+
+
+
\ No newline at end of file diff --git a/WaterCloud.Web/Areas/InfoManage/Controllers/MessageController.cs b/WaterCloud.Web/Areas/InfoManage/Controllers/MessageController.cs index bdb2f607..331a1e77 100644 --- a/WaterCloud.Web/Areas/InfoManage/Controllers/MessageController.cs +++ b/WaterCloud.Web/Areas/InfoManage/Controllers/MessageController.cs @@ -25,21 +25,17 @@ namespace WaterCloud.Web.Areas.InfoManage.Controllers return View(); } #region 获取数据 - [HttpGet] [HandlerAjaxOnly] - public async Task GetGridJson(Pagination pagination, string keyword) + [IgnoreAntiforgeryToken] + public async Task GetGridJson(SoulPage pagination, string keyword) { - //此处需修改 - pagination.order = "desc"; - pagination.sort = "F_CreatorTime desc"; - //导出全部页使用 - if (pagination.rows == 0 && pagination.page == 0) + if (string.IsNullOrEmpty(pagination.field)) { - pagination.rows = 99999999; - pagination.page = 1; + pagination.field = "F_CreatorTime"; + pagination.order = "desc"; } - var data = await _service.GetLookList(pagination,keyword); - return Success(pagination.records, data); + var data = await _service.GetLookList(pagination, keyword); + return Content(pagination.setData(data).ToJson()); } [HttpGet] [HandlerAjaxOnly] diff --git a/WaterCloud.Web/Areas/InfoManage/Views/Message/Index.cshtml b/WaterCloud.Web/Areas/InfoManage/Views/Message/Index.cshtml index f3be89f3..06d89348 100644 --- a/WaterCloud.Web/Areas/InfoManage/Views/Message/Index.cshtml +++ b/WaterCloud.Web/Areas/InfoManage/Views/Message/Index.cshtml @@ -6,15 +6,15 @@
-
+
- +
-
+
@@ -23,10 +23,13 @@
+
@@ -36,25 +39,31 @@ table = layui.table, commonTable = layui.commonTable, common = layui.common; - var entity; //权限控制(js是值传递) + currentTableBar.innerHTML = common.authorizeButtonNew(currentTableBar.innerHTML); toolbarDemo.innerHTML = common.authorizeButtonNew(toolbarDemo.innerHTML); commonTable.rendertable({ elem: '#currentTableId', id: 'currentTableId', - url: '/InfoManage/Message/GetGridJson', - cols: [[ + url: '/InfoManage/Message/GetGridJson', + filter: { + clearFilter: false, + //数据量大,data就不需要了 + items: ['column', 'condition', 'editCondition', 'excel'] + }, + cols: [[ + { type: "checkbox", width: 50 }, { - field: 'F_MessageType', title: '信息类型', width: 120, sort: true, + field: 'F_MessageType', title: '信息类型', width: 120, sort: true, filter: true, templet: function (d) { return top.clients.dataItems["MessageType"][d.F_MessageType] == undefined ? "" : top.clients.dataItems["MessageType"][d.F_MessageType] } }, - { field: 'F_ToUserId', title: '收件人主键', width: 120, sort: true, hide: true }, - { field: 'F_ToUserName', title: '收件人', width: 120, sort: true }, - { field: 'F_MessageInfo', title: '内容', minWidth: 150, sort: true }, + { field: 'F_ToUserId', title: '收件人主键', width: 120, sort: true, hide: true, filter: true }, + { field: 'F_ToUserName', title: '收件人', width: 120, sort: true, filter: true }, + { field: 'F_MessageInfo', title: '内容', minWidth: 150, sort: true, filter: true }, { - field: 'F_CreatorTime', title: '创建时间', width: 150, sort: true, + field: 'F_CreatorTime', title: '创建时间', width: 150, sort: true, filter: { type: 'date[yyyy-MM-dd HH:mm]' }, templet: function (d) { if (d.F_CreatorTime) { var time = new Date(d.F_CreatorTime); @@ -63,8 +72,9 @@ return ''; } }, - { field: 'F_CreatorUserId', title: '创建用户主键', width: 120, sort: true, hide: true }, - { field: 'F_CreatorUserName', title: '创建用户', width: 120, sort: true }, + { field: 'F_CreatorUserId', title: '创建用户主键', width: 120, sort: true, hide: true, filter: true }, + { field: 'F_CreatorUserName', title: '创建用户', width: 120, sort: true, filter: true }, + { title: '操作', width: 90, toolbar: '#currentTableBar', align: "center" } ]] }); // 监听搜索操作 @@ -75,16 +85,15 @@ curr: 1, where: { keyword: data.field.txt_keyword} }); - entity = null; return false; }); wcLoading.close(); - table.on('row(currentTableFilter)', function (obj) { - obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click"); - entity = obj; - }) + //行点击事件监听,控制按钮显示 + var morerList = ["NF-delete"];//选中1条以上显示 + commonTable.tableRowClick("checkbox", "currentTableFilter", "currentTableId", null, morerList); //toolbar监听事件 table.on('toolbar(currentTableFilter)', function (obj) { + var data = table.checkStatus('currentTableId').data; if (obj.event === 'add') { // 监听操作 common.modalOpen({ title: "添加通知", @@ -94,13 +103,17 @@ }); } else if (obj.event === 'delete') { - if (entity == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } + var ids = []; + for (var i = 0; i < data.length; i++) { + ids.push(data[i].F_Id); + } common.deleteForm({ url: "/InfoManage/Message/DeleteForm", - param: { keyValue: entity.data.F_Id }, + param: { keyValue: ids.join(',') }, success: function () { common.reload('data-search-btn'); entity = null; @@ -116,6 +129,19 @@ } } return false; - }); + }); + //toolrow监听事件 + table.on('tool(currentTableFilter)', function (obj) { + if (obj.event === 'delete') { + common.deleteForm({ + url: "/InfoManage/Message/DeleteForm", + param: { keyValue: obj.data.F_Id }, + success: function () { + obj.del(); + } + }); + } + return false; + }); }); diff --git a/WaterCloud.Web/Areas/SystemManage/Views/Area/Index.cshtml b/WaterCloud.Web/Areas/SystemManage/Views/Area/Index.cshtml index 78f02e68..2a831adf 100644 --- a/WaterCloud.Web/Areas/SystemManage/Views/Area/Index.cshtml +++ b/WaterCloud.Web/Areas/SystemManage/Views/Area/Index.cshtml @@ -14,13 +14,14 @@ //var loading = layer.load(0, { shade: false }); var queryJson = ''; //权限控制(js是值传递) + currentTableBar.innerHTML = common.authorizeButtonNew(currentTableBar.innerHTML); toolbarDemo.innerHTML = common.authorizeButtonNew(toolbarDemo.innerHTML); wcLoading.close(); var rendertree = common.rendertreetable({ elem: '#currentTableId', //懒加载设置 tree: { - iconIndex: 0, // 折叠图标显示在第几列 + iconIndex: 1, // 折叠图标显示在第几列 idName: 'F_Id', // id字段名称 arrowType: 'arrow2', getIcon: 'ew-tree-icon-style2', @@ -39,7 +40,8 @@ } }); }, - cols: [[ + cols: [[ + { type: "radio", width: 50 }, { field: 'F_FullName', title: '名称', width: 200 }, { field: 'F_EnCode', title: '编号', width: 150 }, { @@ -63,25 +65,24 @@ } }, { field: 'F_Description', title: '备注', minWidth: 150 }, + { title: '操作', width: 170, toolbar: '#currentTableBar', align: "center" } ]] }); // 监听搜索操作 form.on('submit(data-search-btn)', function (data) { common.reloadtreetable(rendertree, {}); - duty = null; return false; }); - var duty; - treeTable.on('row(currentTableId)', function (obj) { - obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click"); - duty = obj; - }) + //行点击事件监听,控制按钮显示 + var oneList = ["NF-edit", "NF-details", "NF-delete"];//选择1条显示 + common.treeTableRowClick("radio", rendertree, "currentTableId", oneList); /** * toolbar监听事件 */ treeTable.on('toolbar(currentTableId)', function (obj) { + var data = rendertree.checkStatus(); if (obj.event === 'add') { // 监听操作 - keyValue = !!duty ? duty.data.F_Id : null; + var keyValue = data.length==1 ? data[0].F_Id : null; common.modalOpen({ title: "添加区域", url: "/SystemManage/Area/Form?event=add&keyValue=" + keyValue, @@ -90,38 +91,38 @@ }); } else if (obj.event === 'delete') { - if (duty == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.deleteForm({ url: "/SystemManage/Area/DeleteForm", - param: { keyValue: duty.data.F_Id }, + param: { keyValue: data[0].F_Id }, success: function () { common.reload('data-search-btn'); } }); } else if (obj.event === 'edit') { - if (duty == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "编辑区域", - url: "/SystemManage/Area/Form?event=edit&keyValue=" + duty.data.F_Id, + url: "/SystemManage/Area/Form?event=edit&keyValue=" + data[0].F_Id, width: "450px", height: "450px", }); } else if (obj.event === 'details') { - if (duty == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "查看区域", - url: "/SystemManage/Area/Details?keyValue=" + duty.data.F_Id, + url: "/SystemManage/Area/Details?keyValue=" + data[0].F_Id, width: "450px", height: "450px", btn:[] @@ -137,6 +138,37 @@ } return false; }); + //toolbar监听事件 + treeTable.on('tool(currentTableId)', function (obj) { + if (obj.event === 'delete') { + common.deleteForm({ + url: "/SystemManage/Area/DeleteForm", + param: { keyValue: obj.data.F_Id }, + success: function () { + obj.del(); + } + }); + } + else if (obj.event === 'edit') { + common.modalOpen({ + title: "编辑区域", + url: "/SystemManage/Area/Form?event=edit&keyValue=" + obj.data.F_Id, + width: "450px", + height: "450px", + }); + } + else if (obj.event === 'details') { + common.modalOpen({ + title: "查看区域", + url: "/SystemManage/Area/Details?keyValue=" + obj.data.F_Id, + width: "500px", + height: "500px", + data: obj.data, + btn: [] + }); + } + return false; + }); });
@@ -161,13 +193,19 @@ +
+
diff --git a/WaterCloud.Web/Areas/SystemManage/Views/CodeGenerator/Index.cshtml b/WaterCloud.Web/Areas/SystemManage/Views/CodeGenerator/Index.cshtml index 082c82c4..5c146307 100644 --- a/WaterCloud.Web/Areas/SystemManage/Views/CodeGenerator/Index.cshtml +++ b/WaterCloud.Web/Areas/SystemManage/Views/CodeGenerator/Index.cshtml @@ -11,12 +11,14 @@ //加载数据 wcLoading.close(); //权限控制(js是值传递) + currentTableBar.innerHTML = common.authorizeButtonNew(currentTableBar.innerHTML); toolbarDemo.innerHTML = common.authorizeButtonNew(toolbarDemo.innerHTML); commonTable.rendertable({ elem: '#currentTableId', url: '/SystemManage/CodeGenerator/GetTablePageListJson', sqlkey: 'TableName',//数据库主键 cols: [[ + { type: "radio", width: 50 }, { field: 'TableName', title: '表名称', width: 200, sort: true }, { field: 'TableKeyName', title: '主键名称', minWidth: 250 }, { field: 'TableKey', title: '主键字段', width: 150 }, @@ -32,6 +34,7 @@ } }, { field: 'Remark', title: '备注', minWidth: 150 }, + { title: '操作', width: 170, toolbar: '#currentTableBar', align: "center" } ]] }); // 监听搜索操作 @@ -42,48 +45,46 @@ curr: 1, where: { keyword: data.field.txt_keyword} }); - entity = null; return false; }); - var entity; - table.on('row(currentTableFilter)', function (obj) { - obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click"); - entity = obj; - }) + //行点击事件监听,控制按钮显示 + var oneList = ["NF-entitycode", "NF-add", "NF-details"];//选择1条显示 + commonTable.tableRowClick("radio", "currentTableFilter", "currentTableId", oneList); /** * toolbar监听事件 */ table.on('toolbar(currentTableFilter)', function (obj) { + var data = table.checkStatus('currentTableId').data; if (obj.event === 'add') { // 监听删除操作 - if (entity == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.openNewTabByIframe({ title: "模板代码生成", - href: "/SystemManage/CodeGenerator/Form?keyValue=" + entity.data.TableName, + href: "/SystemManage/CodeGenerator/Form?keyValue=" + data[0].TableName, }); } else if (obj.event === 'entitycode') { - if (entity == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "实体类生成", - url: "/SystemManage/CodeGenerator/EntityCode?keyValue=" + entity.data.TableName, + url: "/SystemManage/CodeGenerator/EntityCode?keyValue=" + data[0].TableName, width: "700px", height: "600px", }); } else if (obj.event === 'details') { - if (entity == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "查看数据表", - url: "/SystemManage/CodeGenerator/Details?keyValue=" + entity.data.TableName, + url: "/SystemManage/CodeGenerator/Details?keyValue=" + data[0].TableName, width: "700px", height: "600px", btn: [] @@ -99,6 +100,33 @@ } return false; }); + //toolrow监听事件 + table.on('tool(currentTableFilter)', function (obj) { + if (obj.event === 'add') { // 监听 + common.openNewTabByIframe({ + title: "模板代码生成", + href: "/SystemManage/CodeGenerator/Form?keyValue=" + obj.data.TableName, + }); + } + else if (obj.event === 'entitycode') { + common.modalOpen({ + title: "实体类生成", + url: "/SystemManage/CodeGenerator/EntityCode?keyValue=" + obj.data.TableName, + width: "700px", + height: "600px", + }); + } + else if (obj.event === 'details') { + common.modalOpen({ + title: "查看数据表", + url: "/SystemManage/CodeGenerator/Details?keyValue=" + obj.data.TableName, + width: "700px", + height: "600px", + btn: [] + }); + } + return false; + }); });
@@ -124,12 +152,16 @@ - +
diff --git a/WaterCloud.Web/Areas/SystemManage/Views/Flowscheme/Index.cshtml b/WaterCloud.Web/Areas/SystemManage/Views/Flowscheme/Index.cshtml index 84e51d2b..b7f9a4a3 100644 --- a/WaterCloud.Web/Areas/SystemManage/Views/Flowscheme/Index.cshtml +++ b/WaterCloud.Web/Areas/SystemManage/Views/Flowscheme/Index.cshtml @@ -42,10 +42,10 @@
@@ -101,7 +101,7 @@ search: false, height: 'full-160', cols: [[ - //此处需修改 + { type: "radio", width: 50 }, { field: 'F_SchemeCode', title: '流程编号', width: 150, sort: true }, { field: 'F_SchemeName', title: '流程名称', width: 200, sort: true }, { field: 'F_SchemeVersion', title: '流程版本', width: 120, sort: true, hide: true }, @@ -137,7 +137,6 @@ where: { keyword: queryJson }, }); itemId = null; - entity = null; return false; }); // 监听搜索操作 @@ -156,10 +155,9 @@ return false; }); wcLoading.close(); - table.on('row(currentTableFilter)', function (obj) { - obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click"); - entity = obj; - }) + //行点击事件监听,控制按钮显示 + var oneList = ["NF-edit", "NF-delete", "NF-details"];//选择1条显示 + commonTable.tableRowClick("radio", "currentTableFilter", "currentTableId", oneList); treeTable.on('row(currentTable)', function (obj) { obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click"); ItemId = obj.data.F_Id; @@ -167,6 +165,7 @@ }) //toolbar监听事件 table.on('toolbar(currentTableFilter)', function (obj) { + var data = table.checkStatus('currentTableId').data; if (obj.event === 'add') { // 监听添加操作 common.openNewTabByIframe({ title: "添加流程", @@ -174,13 +173,13 @@ }); } else if (obj.event === 'delete') { - if (entity == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.deleteForm({ url: "/SystemManage/Flowscheme/DeleteForm", - param: { keyValue: entity.data.F_Id }, + param: { keyValue: data[0].F_Id }, success: function () { common.reload('data-search-btn'); entity = null; @@ -188,23 +187,23 @@ }); } else if (obj.event === 'edit') { - if (entity == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.openNewTabByIframe({ title: "编辑流程", - href: "/SystemManage/Flowscheme/Form?keyValue=" + entity.data.F_Id, + href: "/SystemManage/Flowscheme/Form?keyValue=" + data[0].F_Id, }); } else if (obj.event === 'details') { - if (entity == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.openNewTabByIframe({ title: "预览流程", - href: "/SystemManage/Flowscheme/Details?keyValue=" + entity.data.F_Id, + href: "/SystemManage/Flowscheme/Details?keyValue=" + data[0].F_Id, }); } return false; diff --git a/WaterCloud.Web/Areas/SystemManage/Views/Form/Index.cshtml b/WaterCloud.Web/Areas/SystemManage/Views/Form/Index.cshtml index 3cab8a8c..aebd2d06 100644 --- a/WaterCloud.Web/Areas/SystemManage/Views/Form/Index.cshtml +++ b/WaterCloud.Web/Areas/SystemManage/Views/Form/Index.cshtml @@ -42,10 +42,10 @@
@@ -60,7 +60,6 @@ commonTable = layui.commonTable, treeTable = layui.treeTable, common = layui.common; - var entity; var ItemId; //权限控制(js是值传递) toolbarDemo.innerHTML = common.authorizeButtonNew(toolbarDemo.innerHTML); @@ -101,7 +100,7 @@ search:false, height: 'full-160', cols: [[ - //此处需修改 + { type: "radio", width: 50 }, { field: 'F_Name', title: '表单名称', width: 150, sort: true }, { field: 'F_Description', title: '备注', minWidth: 250 }, { field: 'F_Fields', title: '字段数', width: 100, sort: true, hide: true }, @@ -141,7 +140,6 @@ where: { keyword: queryJson }, }); itemId = null; - entity = null; return false; }); // 监听搜索操作 @@ -155,7 +153,6 @@ }, where: { ItemId: ItemId,keyword: data.field.txt_keyword } }); - entity = null; return false; }); wcLoading.close(); @@ -164,12 +161,12 @@ ItemId = obj.data.F_Id; $('button[lay-filter="data-search-btn"]').click();//按钮刷新 }) - table.on('row(currentTableFilter)', function (obj) { - obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click"); - entity = obj; - }) + //行点击事件监听,控制按钮显示 + var oneList = ["NF-edit", "NF-delete", "NF-details"];//选择1条显示 + commonTable.tableRowClick("radio", "currentTableFilter", "currentTableId", oneList); //toolbar监听事件 table.on('toolbar(currentTableFilter)', function (obj) { + var data = table.checkStatus('currentTableId').data; if (obj.event === 'add') { // 监听添加操作 common.openNewTabByIframe({ title: "添加表单", @@ -177,13 +174,13 @@ }); } else if (obj.event === 'delete') { - if (entity == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.deleteForm({ url: "/SystemManage/Form/DeleteForm", - param: { keyValue: entity.data.F_Id }, + param: { keyValue: data[0].F_Id }, success: function () { common.reload('data-search-btn'); entity = null; @@ -191,23 +188,23 @@ }); } else if (obj.event === 'edit') { - if (entity == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.openNewTabByIframe({ title: "编辑表单", - href: "/SystemManage/Form/Form?keyValue=" + entity.data.F_Id, + href: "/SystemManage/Form/Form?keyValue=" + data[0].F_Id, }); } else if (obj.event === 'details') { - if (entity == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "预览表单", - url: "/SystemManage/Form/Details?keyValue=" + entity.data.F_Id, + url: "/SystemManage/Form/Details?keyValue=" + data[0].F_Id, width: "600px", height: "600px", btn: [] diff --git a/WaterCloud.Web/Areas/SystemManage/Views/ItemsData/Index.cshtml b/WaterCloud.Web/Areas/SystemManage/Views/ItemsData/Index.cshtml index 1c8c1fef..d84f889b 100644 --- a/WaterCloud.Web/Areas/SystemManage/Views/ItemsData/Index.cshtml +++ b/WaterCloud.Web/Areas/SystemManage/Views/ItemsData/Index.cshtml @@ -71,6 +71,7 @@ }, height: 'full-110', cols: [[ + { type: "radio", width: 50 }, { field: 'F_ItemName', title: '名称', width: 120 }, { field: 'F_ItemCode', title: '编号', width: 120 }, { field: 'F_SortCode', title: '排序', width: 60 }, @@ -126,7 +127,6 @@ keyword: data.field.txt_keyword, }, }); - item = null; return false; }); // 监听搜索操作 @@ -135,15 +135,14 @@ DemoTree.fuzzySearch(data.field.item_keyword); return false; }); - var item; - table.on('row(currentTableFilter)', function (obj) { - obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click"); - item = obj; - }) + //行点击事件监听,控制按钮显示 + var oneList = ["NF-edit", "NF-delete", "NF-details"];//选择1条显示 + commonTable.tableRowClick("radio", "currentTableFilter", "currentTableId", oneList); /** * toolbar监听事件 */ table.on('toolbar(currentTableFilter)', function (obj) { + var data = table.checkStatus('currentTableId').data; if (obj.event === 'add') { // 监听操作 if (!treeid) { return false; @@ -156,38 +155,38 @@ }); } else if (obj.event === 'delete') { - if (item == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.deleteForm({ url: "/SystemManage/ItemsData/DeleteForm", - param: { keyValue: item.data.F_Id }, + param: { keyValue: data[0].F_Id }, success: function () { common.reload('data-search-btn'); } }); } else if (obj.event === 'edit') { - if (item == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "编辑字典", - url: "/SystemManage/ItemsData/Form?itemId=" + treeid + "&keyValue=" + item.data.F_Id, + url: "/SystemManage/ItemsData/Form?itemId=" + treeid + "&keyValue=" + data[0].F_Id, width: "450px", height: "350px", }); } else if (obj.event === 'details') { - if (item == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "查看字典", - url: "/SystemManage/ItemsData/Details?keyValue=" + item.data.F_Id, + url: "/SystemManage/ItemsData/Details?keyValue=" + data[0].F_Id, width: "450px", height: "350px", btn: [] @@ -240,10 +239,10 @@ diff --git a/WaterCloud.Web/Areas/SystemManage/Views/ItemsType/Index.cshtml b/WaterCloud.Web/Areas/SystemManage/Views/ItemsType/Index.cshtml index 29ac6800..7f8bba23 100644 --- a/WaterCloud.Web/Areas/SystemManage/Views/ItemsType/Index.cshtml +++ b/WaterCloud.Web/Areas/SystemManage/Views/ItemsType/Index.cshtml @@ -13,61 +13,71 @@ //加载数据 wcLoading.close(); //权限控制(js是值传递) + currentTableBar.innerHTML = common.authorizeButtonNew(currentTableBar.innerHTML); toolbarDemo.innerHTML = common.authorizeButtonNew(toolbarDemo.innerHTML); var rendertree = common.rendertreetable({ - elem: '#currentTableId', - url: '/SystemManage/ItemsType/GetGridJson', - cols: [[ - { field: 'F_FullName', title: '名称', width: 200 }, - { field: 'F_EnCode', title: '编号', width: 120 }, - { field: 'F_SortCode', title: '排序', width: 60 }, - { - field: 'F_EnabledMark', title: '状态', width: 80, - templet: function (d) { - if (d.F_EnabledMark == true) { - return "有效"; - } else { - return "无效"; - } + elem: '#currentTableId', + url: '/SystemManage/ItemsType/GetGridJson', + tree: { + iconIndex: 1, // 折叠图标显示在第几列 + isPidData: true, // 是否是id、pid形式数据 + idName: 'F_Id', // id字段名称 + pidName: 'F_ParentId', // pid字段名称 + arrowType: 'arrow2', + getIcon: 'ew-tree-icon-style2', + }, + cols: [[ + { type: "radio", width: 50 }, + { field: 'F_FullName', title: '名称', width: 200 }, + { field: 'F_EnCode', title: '编号', width: 120 }, + { field: 'F_SortCode', title: '排序', width: 60 }, + { + field: 'F_EnabledMark', title: '状态', width: 80, + templet: function (d) { + if (d.F_EnabledMark == true) { + return "有效"; + } else { + return "无效"; } - }, - { - field: 'F_CreatorTime', title: '创建时间', width: 120, - templet: function (d) { - if (d.F_CreatorTime) { - var time = new Date(d.F_CreatorTime); - return time.Format("yyyy-MM-dd"); - } - return ''; + } + }, + { + field: 'F_CreatorTime', title: '创建时间', width: 120, + templet: function (d) { + if (d.F_CreatorTime) { + var time = new Date(d.F_CreatorTime); + return time.Format("yyyy-MM-dd"); } - }, - { field: 'F_Description', title: '备注', minWidth: 150 }, - ]], - done: function () { - //展开全部 - rendertree.expandAll(); - } + return ''; + } + }, + { field: 'F_Description', title: '备注', minWidth: 150 }, + { title: '操作', width: 170, toolbar: '#currentTableBar', align: "center" } + ]], + done: function () { + //展开全部 + rendertree.expandAll(); + } }); // 监听搜索操作 form.on('submit(data-search-btn)', function (data) { queryJson = data.field.txt_keyword; common.reloadtreetable(rendertree, { where: { keyword: queryJson }, - }); - item = null; + }); return false; }); - var item; - treeTable.on('row(currentTableId)', function (obj) { - obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click"); - item = obj; - }) + //行点击事件监听,控制按钮显示 + var oneList = ["NF-edit", "NF-details", "NF-delete"];//选择1条显示 + //var morerList = ["NF-delete"];//选中1条以上 + common.treeTableRowClick("radio", rendertree, "currentTableId", oneList); /** * toolbar监听事件 */ treeTable.on('toolbar(currentTableId)', function (obj) { + var data = rendertree.checkStatus(false); if (obj.event === 'add') { // 监听操作 - keyValue = !!item ? item.data.F_Id : null; + keyValue = data.length > 0 ? data[0].F_Id : null; common.modalOpen({ title: "添加分类", url: "/SystemManage/ItemsType/Form?event=add&keyValue=" + keyValue, @@ -76,38 +86,38 @@ }); } else if (obj.event === 'delete') { - if (item == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.deleteForm({ url: "/SystemManage/ItemsType/DeleteForm", - param: { keyValue: item.data.F_Id }, + param: { keyValue: data[0].F_Id }, success: function () { common.reload('data-search-btn'); } }); } else if (obj.event === 'edit') { - if (item == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "编辑分类", - url: "/SystemManage/ItemsType/Form?event=edit&keyValue=" + item.data.F_Id, + url: "/SystemManage/ItemsType/Form?event=edit&keyValue=" + data[0].F_Id, width: "450px", height: "380px", }); } else if (obj.event === 'details') { - if (item == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "查看分类", - url: "/SystemManage/ItemsType/Details?keyValue=" + item.data.F_Id, + url: "/SystemManage/ItemsType/Details?keyValue=" + data[0].F_Id, width: "450px", height: "380px", btn: [] @@ -123,6 +133,38 @@ } return false; }); + //toolbar监听事件 + treeTable.on('tool(currentTableId)', function (obj) { + if (obj.event === 'delete') { + common.deleteForm({ + url: "/SystemManage/ItemsType/DeleteForm", + param: { keyValue: obj.data.F_Id }, + success: function () { + obj.del(); + } + }); + } + else if (obj.event === 'edit') { + common.modalOpen({ + title: "编辑界面", + url: "/SystemManage/ItemsType/Form?event=edit&keyValue=" + obj.data.F_Id, + width: "500px", + height: "500px", + data: obj.data, + }); + } + else if (obj.event === 'details') { + common.modalOpen({ + title: "查看界面", + url: "/SystemManage/ItemsType/Details?keyValue=" + obj.data.F_Id, + width: "500px", + height: "500px", + data: obj.data, + btn: [] + }); + } + return false; + }); });
@@ -147,15 +189,19 @@ -
+
\ No newline at end of file diff --git a/WaterCloud.Web/Areas/SystemManage/Views/Module/Index.cshtml b/WaterCloud.Web/Areas/SystemManage/Views/Module/Index.cshtml index dcc381b3..d36e490a 100644 --- a/WaterCloud.Web/Areas/SystemManage/Views/Module/Index.cshtml +++ b/WaterCloud.Web/Areas/SystemManage/Views/Module/Index.cshtml @@ -2,218 +2,270 @@ ViewBag.Title = "Index"; Layout = "~/Views/Shared/_Index.cshtml"; } - + }); +
@@ -237,13 +289,19 @@ +
\ No newline at end of file diff --git a/WaterCloud.Web/Areas/SystemManage/Views/ModuleButton/Index.cshtml b/WaterCloud.Web/Areas/SystemManage/Views/ModuleButton/Index.cshtml index e3ac30c5..aea705f3 100644 --- a/WaterCloud.Web/Areas/SystemManage/Views/ModuleButton/Index.cshtml +++ b/WaterCloud.Web/Areas/SystemManage/Views/ModuleButton/Index.cshtml @@ -12,6 +12,7 @@ //加载数据 wcLoading.close(); //权限控制(js是值传递) + currentTableBar.innerHTML = common.authorizeButtonNew(currentTableBar.innerHTML); toolbarDemo.innerHTML = common.authorizeButtonNew(toolbarDemo.innerHTML); var moduleId = $.request("moduleId"); var modulename = $.request("modulename"); @@ -27,8 +28,10 @@ elem: '#currentTableId', id: 'currentTableId', url: "/SystemManage/ModuleButton/GetTreeGridJson?moduleId=" + moduleId, + height: 'full-110', cols: [[ - { field: 'F_FullName', title: '名称', width: 120 }, + { type: "radio", width: 50 }, + { field: 'F_FullName', title: '名称', width: 150 }, { field: 'F_Location', title: '位置', width: 60, templet: function (d) { @@ -60,7 +63,7 @@ return ""; } } - }, + }, { field: 'F_EnabledMark', title: '状态', width: 80, templet: function (d) { @@ -70,9 +73,10 @@ return "无效"; } } - }, + }, { field: 'F_SortCode', title: '排序', width: 60 }, { field: 'F_Description', title: '备注', minWidth: 100 }, + { title: '操作', width: 170, toolbar: '#currentTableBar', align: "center" } ]] }); // 监听搜索操作 @@ -87,58 +91,57 @@ module = null; return false; }); - var module; - table.on('row(currentTableFilter)', function (obj) { - obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click"); - module = obj; - }) + //行点击事件监听,控制按钮显示 + var oneList = ["NF-edit", "NF-delete", "NF-details"];//选择1条显示 + commonTable.tableRowClick("radio", "currentTableFilter", "currentTableId", oneList); /** * toolbar监听事件 */ table.on('toolbar(currentTableFilter)', function (obj) { + var data = table.checkStatus('currentTableId').data; if (obj.event === 'add') { // 监听操作 common.modalOpen({ title: "添加按钮", url: "/SystemManage/ModuleButton/Form?moduleId=" + moduleId, width: "500px", - height: "440px", + height: "600px", }); } else if (obj.event === 'delete') { - if (module == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.deleteForm({ url: "/SystemManage/ModuleButton/DeleteForm", - param: { keyValue: module.data.F_Id }, + param: { keyValue: data[0].F_Id }, success: function () { common.reload('data-search-btn'); } }); } else if (obj.event === 'edit') { - if (module == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "编辑按钮", - url: "/SystemManage/ModuleButton/Form?moduleId=" + moduleId+"&keyValue=" + module.data.F_Id, + url: "/SystemManage/ModuleButton/Form?moduleId=" + moduleId + "&keyValue=" + data[0].F_Id, width: "500px", - height: "440px", + height: "600px", }); } else if (obj.event === 'details') { - if (module == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "查看按钮", - url: "/SystemManage/ModuleButton/Details?keyValue=" + module.data.F_Id, + url: "/SystemManage/ModuleButton/Details?keyValue=" + data[0].F_Id, width: "500px", - height: "440px", + height: "600px", btn: [] }); } @@ -160,11 +163,40 @@ } return false; }); + table.on('tool(currentTableFilter)', function (obj) { + if (obj.event === 'delete') { + common.deleteForm({ + url: "/SystemManage/ModuleButton/DeleteForm", + param: { keyValue: obj.data.F_Id }, + success: function () { + common.reload('data-search-btn'); + } + }); + } + else if (obj.event === 'edit') { + common.modalOpen({ + title: "编辑按钮", + url: "/SystemManage/ModuleButton/Form?moduleId=" + moduleId + "&keyValue=" + obj.data.F_Id, + width: "500px", + height: "600px", + }); + } + else if (obj.event === 'details') { + common.modalOpen({ + title: "查看按钮", + url: "/SystemManage/ModuleButton/Details?keyValue=" + obj.data.F_Id, + width: "500px", + height: "600px", + btn: [] + }); + } + return false; + }); });
-
+
@*搜索信息*@
@@ -191,13 +223,18 @@ +
\ No newline at end of file diff --git a/WaterCloud.Web/Areas/SystemManage/Views/ModuleFields/Index.cshtml b/WaterCloud.Web/Areas/SystemManage/Views/ModuleFields/Index.cshtml index ce622acf..8d162895 100644 --- a/WaterCloud.Web/Areas/SystemManage/Views/ModuleFields/Index.cshtml +++ b/WaterCloud.Web/Areas/SystemManage/Views/ModuleFields/Index.cshtml @@ -4,9 +4,9 @@ }
-
+
- +
@@ -29,13 +29,18 @@
+
@@ -49,6 +54,7 @@ //加载数据 wcLoading.close(); //权限控制(js是值传递) + currentTableBar.innerHTML = common.authorizeButtonNew(currentTableBar.innerHTML); toolbarDemo.innerHTML = common.authorizeButtonNew(toolbarDemo.innerHTML); var moduleId = $.request("moduleId"); var modulename = $.request("modulename"); @@ -64,9 +70,11 @@ elem: '#currentTableId', id: 'currentTableId', url: '/SystemManage/ModuleFields/GetGridJson?moduleId=' + moduleId, + height: 'full-110', cols: [[ - { field: 'F_EnCode', title: '编号', width: 120 }, - { field: 'F_FullName', title: '名称', width: 120 }, + { type: "radio", width: 50 }, + { field: 'F_EnCode', title: '编号', width: 150 }, + { field: 'F_FullName', title: '名称', width: 150 }, { field: 'F_IsPublic', title: '公共', width: 80, templet: function (d) { @@ -76,7 +84,7 @@ return ""; } } - }, + }, { field: 'F_EnabledMark', title: '状态', width: 80, templet: function (d) { @@ -86,8 +94,9 @@ return "无效"; } } - }, - { field: 'F_Description', title: '备注', minWidth: 120 } + }, + { field: 'F_Description', title: '备注', minWidth: 120 }, + { title: '操作', width: 170, toolbar: '#currentTableBar', align: "center" } ]] }); // 监听搜索操作 @@ -96,18 +105,16 @@ commonTable.reloadtable({ elem: 'currentTableId', curr: 1, - where: { keyword: data.field.txt_keyword} + where: { keyword: data.field.txt_keyword } }); - entity = null; return false; }); - var entity; - table.on('row(currentTableFilter)', function (obj) { - obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click"); - entity = obj; - }) + //行点击事件监听,控制按钮显示 + var oneList = ["NF-edit", "NF-delete", "NF-details"];//选择1条显示 + commonTable.tableRowClick("radio", "currentTableFilter", "currentTableId", oneList); //toolbar监听事件 - table.on('toolbar(currentTableFilter)', function (obj) { + table.on('toolbar(currentTableFilter)', function (obj) { + var data = table.checkStatus('currentTableId').data; if (obj.event === 'add') { // 监听添加操作 common.modalOpen({ title: "添加界面", @@ -115,44 +122,44 @@ width: "500px", height: "400px", }); - } + } else if (obj.event === 'delete') { - if (entity == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.deleteForm({ url: "/SystemManage/ModuleFields/DeleteForm", - param: { keyValue: entity.data.F_Id }, + param: { keyValue: data[0].F_Id }, success: function () { common.reload('data-search-btn'); - } - }); - } - else if (obj.event === 'edit') { - if (entity == null) { - common.modalMsg("未选中数据", "warning"); - return false; - } - common.modalOpen({ - title: "编辑界面", - url: "/SystemManage/ModuleFields/Form?moduleId=" + moduleId +"&keyValue=" + entity.data.F_Id, - width: "500px", - height: "400px", - }); - } - else if (obj.event === 'details') { - if (entity == null) { - common.modalMsg("未选中数据", "warning"); - return false; - } - common.modalOpen({ - title: "查看界面", - url: "/SystemManage/ModuleFields/Details?keyValue=" + entity.data.F_Id, - width: "500px", - height: "400px", - btn: [] - }); + } + }); + } + else if (obj.event === 'edit') { + if (data.length == 0) { + common.modalMsg("未选中数据", "warning"); + return false; + } + common.modalOpen({ + title: "编辑界面", + url: "/SystemManage/ModuleFields/Form?moduleId=" + moduleId + "&keyValue=" + data[0].F_Id, + width: "500px", + height: "400px", + }); + } + else if (obj.event === 'details') { + if (data.length == 0) { + common.modalMsg("未选中数据", "warning"); + return false; + } + common.modalOpen({ + title: "查看界面", + url: "/SystemManage/ModuleFields/Details?keyValue=" + data[0].F_Id, + width: "500px", + height: "400px", + btn: [] + }); } else if (obj.event === 'clonefields') { common.modalOpen({ @@ -170,7 +177,36 @@ _that.addClass('layui-hide'); } } - return false; - }); - }); - + return false; + }); + table.on('tool(currentTableFilter)', function (obj) { + if (obj.event === 'delete') { + common.deleteForm({ + url: "/SystemManage/ModuleFields/DeleteForm", + param: { keyValue: obj.data.F_Id }, + success: function () { + common.reload('data-search-btn'); + } + }); + } + else if (obj.event === 'edit') { + common.modalOpen({ + title: "编辑按钮", + url: "/SystemManage/ModuleFields/Form?moduleId=" + moduleId + "&keyValue=" + obj.data.F_Id, + width: "500px", + height: "400px", + }); + } + else if (obj.event === 'details') { + common.modalOpen({ + title: "查看按钮", + url: "/SystemManage/ModuleFields/Details?keyValue=" + obj.data.F_Id, + width: "500px", + height: "400px", + btn: [] + }); + } + return false; + }); + }); + diff --git a/WaterCloud.Web/Areas/SystemOrganize/Controllers/DataPrivilegeRuleController.cs b/WaterCloud.Web/Areas/SystemOrganize/Controllers/DataPrivilegeRuleController.cs index 2b0efb6b..97b95fef 100644 --- a/WaterCloud.Web/Areas/SystemOrganize/Controllers/DataPrivilegeRuleController.cs +++ b/WaterCloud.Web/Areas/SystemOrganize/Controllers/DataPrivilegeRuleController.cs @@ -22,21 +22,17 @@ namespace WaterCloud.Web.Areas.SystemOrganize.Controllers public DataPrivilegeRuleService _service { get; set; } #region 获取数据 - [HttpGet] [HandlerAjaxOnly] - public async Task GetGridJson(Pagination pagination, string keyword) + [IgnoreAntiforgeryToken] + public async Task GetGridJson(SoulPage pagination, string keyword) { - //此处需修改 - pagination.order = "desc"; - pagination.sort = "F_CreatorTime desc"; - //导出全部页使用 - if (pagination.rows == 0 && pagination.page == 0) + if (string.IsNullOrEmpty(pagination.field)) { - pagination.rows = 99999999; - pagination.page = 1; + pagination.field = "F_CreatorTime"; + pagination.order = "desc"; } - var data = await _service.GetLookList(pagination,keyword); - return Success(pagination.records, data); + var data = await _service.GetLookList(pagination, keyword); + return Content(pagination.setData(data).ToJson()); } [HttpGet] diff --git a/WaterCloud.Web/Areas/SystemOrganize/Controllers/NoticeController.cs b/WaterCloud.Web/Areas/SystemOrganize/Controllers/NoticeController.cs index 361d69bd..e4315a23 100644 --- a/WaterCloud.Web/Areas/SystemOrganize/Controllers/NoticeController.cs +++ b/WaterCloud.Web/Areas/SystemOrganize/Controllers/NoticeController.cs @@ -20,20 +20,17 @@ namespace WaterCloud.Web.Areas.SystemOrganize.Controllers public NoticeService _service { get; set; } - [HttpGet] [HandlerAjaxOnly] - public async Task GetGridJson(Pagination pagination, string keyword) + [IgnoreAntiforgeryToken] + public async Task GetGridJson(SoulPage pagination, string keyword) { - pagination.order = "desc"; - pagination.sort = "F_CreatorTime desc"; - //导出全部页使用 - if (pagination.rows == 0 && pagination.page == 0) + if (string.IsNullOrEmpty(pagination.field)) { - pagination.rows = 99999999; - pagination.page = 1; + pagination.field = "F_CreatorTime"; + pagination.order = "desc"; } - var data =await _service.GetLookList(pagination,keyword); - return Success(pagination.records, data); + var data = await _service.GetLookList(pagination, keyword); + return Content(pagination.setData(data).ToJson()); } [HttpGet] [HandlerAjaxOnly] diff --git a/WaterCloud.Web/Areas/SystemOrganize/Controllers/RoleController.cs b/WaterCloud.Web/Areas/SystemOrganize/Controllers/RoleController.cs index 0f69771a..6b89655d 100644 --- a/WaterCloud.Web/Areas/SystemOrganize/Controllers/RoleController.cs +++ b/WaterCloud.Web/Areas/SystemOrganize/Controllers/RoleController.cs @@ -53,20 +53,17 @@ namespace WaterCloud.Web.Areas.SystemOrganize.Controllers } return Success(data.Count, data); } - [HttpGet] [HandlerAjaxOnly] - public async Task GetGridJson(Pagination pagination, string keyword) + [IgnoreAntiforgeryToken] + public async Task GetGridJson(SoulPage pagination, string keyword) { - pagination.order = "asc"; - pagination.sort = "F_EnCode"; - //导出全部页使用 - if (pagination.rows == 0 && pagination.page == 0) + if (string.IsNullOrEmpty(pagination.field)) { - pagination.rows = 99999999; - pagination.page = 1; + pagination.field = "F_CreatorTime"; + pagination.order = "desc"; } - var data =await _service.GetLookList(pagination,keyword); - return Success(pagination.records,data); + var data = await _service.GetLookList(pagination, keyword); + return Content(pagination.setData(data).ToJson()); } [HttpGet] [HandlerAjaxOnly] diff --git a/WaterCloud.Web/Areas/SystemOrganize/Controllers/UserController.cs b/WaterCloud.Web/Areas/SystemOrganize/Controllers/UserController.cs index f3cf7dc0..23438d97 100644 --- a/WaterCloud.Web/Areas/SystemOrganize/Controllers/UserController.cs +++ b/WaterCloud.Web/Areas/SystemOrganize/Controllers/UserController.cs @@ -26,21 +26,17 @@ namespace WaterCloud.Web.Areas.SystemOrganize.Controllers public ModuleService _moduleService { get; set; } public RoleService _roleService { get; set; } public OrganizeService _orgService { get; set; } - - [HttpGet] [HandlerAjaxOnly] - public async Task GetGridJson(Pagination pagination, string keyword) + [IgnoreAntiforgeryToken] + public async Task GetGridJson(SoulPage pagination, string keyword) { - pagination.order = "asc"; - pagination.sort = "F_DepartmentId asc"; - //导出全部页使用 - if (pagination.rows == 0 && pagination.page == 0) + if (string.IsNullOrEmpty(pagination.field)) { - pagination.rows = 99999999; - pagination.page = 1; + pagination.field = "F_DepartmentId"; + pagination.order = "asc"; } - var data =await _service.GetLookList(pagination, keyword); - return Success(pagination.records, data); + var data = await _service.GetLookList(pagination, keyword); + return Content(pagination.setData(data).ToJson()); } [HttpGet] public virtual ActionResult AddForm() diff --git a/WaterCloud.Web/Areas/SystemOrganize/Views/DataPrivilegeRule/Form.cshtml b/WaterCloud.Web/Areas/SystemOrganize/Views/DataPrivilegeRule/Form.cshtml index 3d4a3aa4..483ec1f8 100644 --- a/WaterCloud.Web/Areas/SystemOrganize/Views/DataPrivilegeRule/Form.cshtml +++ b/WaterCloud.Web/Areas/SystemOrganize/Views/DataPrivilegeRule/Form.cshtml @@ -56,20 +56,22 @@ }, height: 'full-150', cols: [[ + { type: "radio", width: 50 }, { field: 'Operation', title: '规则间条件', width: 120 }, { field: 'Filters', title: '规则内容', minWidth: 200 }, { field: 'Description', title: '规则备注', minWidth: 200 }, + { title: '操作', width: 130, toolbar: '#currentTableBar', align: "center" } ]] }); - var entity; - table.on('row(currentTableFilter)', function (obj) { - obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click"); - entity = obj; - }) + //行点击事件监听,控制按钮显示 + var oneList = ["NF-edit", "NF-delete"];//选择1条显示 + commonTable.tableRowClick("radio", "currentTableFilter", "currentTableId", oneList); //toolbar监听事件 table.on('toolbar(currentTableFilter)', function (obj) { + var data = table.checkStatus('currentTableId').data; + var id = data.length > 0 ? data[0].F_Id : null; + var module = $('#F_ModuleId').val(); if (obj.event === 'add') { // 监听删除操作 - var module = $('#F_ModuleId').val(); if (!module) { common.modalMsg("未选中模块", "warning"); return false; @@ -82,7 +84,7 @@ }); } else if (obj.event === 'delete') { - if (entity == null) { + if (id == null) { common.modalMsg("未选中数据", "warning"); return false; } @@ -94,7 +96,7 @@ try { var cachedata = table.cache.currentTableId; for (var i = 0; i < cachedata.length; i++) { - if (entity.data.F_Id == cachedata[i].F_Id) { + if (id == cachedata[i].F_Id) { cachedata.splice(i, 1); break; } @@ -115,18 +117,64 @@ }); } else if (obj.event === 'edit') { - if (entity == null) { + if (id == null) { common.modalMsg("未选中数据", "warning"); return false; } - var module = $('#F_ModuleId').val(); if (!module) { common.modalMsg("未选中模块", "warning"); return false; } common.modalOpen({ title: "编辑规则", - url: "/SystemOrganize/DataPrivilegeRule/RuleForm?keyValue=" + entity.data.F_Id + "&module=" + module, + url: "/SystemOrganize/DataPrivilegeRule/RuleForm?keyValue=" + id + "&module=" + module, + width: "750px", + height: "500px", + }); + } + return false; + }); + //toolrow监听事件 + table.on('tool(currentTableFilter)', function (obj) { + var id = obj.data.F_Id; + var module = $('#F_ModuleId').val(); + if (obj.event === 'delete') { + common.modalConfirm("注:您确定要删除该项数据吗?", function (r) { + if (r) { + var index = parent.layer.load(0, { + shade: [0.5, '#000'], //0.1透明度的背景 + }); + try { + var cachedata = table.cache.currentTableId; + for (var i = 0; i < cachedata.length; i++) { + if (id == cachedata[i].F_Id) { + cachedata.splice(i, 1); + break; + } + } + table.reload('currentTableId', { + data: cachedata + }); + entity = null; + common.modalMsg("操作成功", "success"); + } catch (e) { + alert(e); + } + parent.layer.close(index); + } + else { + return false; + } + }); + } + else if (obj.event === 'edit') { + if (!module) { + common.modalMsg("未选中模块", "warning"); + return false; + } + common.modalOpen({ + title: "编辑规则", + url: "/SystemOrganize/DataPrivilegeRule/RuleForm?keyValue=" + id + "&module=" + module, width: "750px", height: "500px", }); @@ -233,11 +281,15 @@ +
diff --git a/WaterCloud.Web/Areas/SystemOrganize/Views/DataPrivilegeRule/Index.cshtml b/WaterCloud.Web/Areas/SystemOrganize/Views/DataPrivilegeRule/Index.cshtml index 5f4efb12..fb18365f 100644 --- a/WaterCloud.Web/Areas/SystemOrganize/Views/DataPrivilegeRule/Index.cshtml +++ b/WaterCloud.Web/Areas/SystemOrganize/Views/DataPrivilegeRule/Index.cshtml @@ -23,11 +23,15 @@ +
@@ -44,12 +48,16 @@ elem: '#currentTableId', id: 'currentTableId', url: '/SystemOrganize/DataPrivilegeRule/GetGridJson', + filter: { + clearFilter: false + }, cols: [[ - { field: 'F_ModuleCode', title: '模块编号', width: 120 }, - { field: 'F_PrivilegeRules', title: '权限规则', width: 200 }, - { field: 'F_SortCode', title: '排序号', width: 120 }, + { type: "radio", width: 50 }, + { field: 'F_ModuleCode', title: '模块编号', width: 120, sort: true, filter: true }, + { field: 'F_PrivilegeRules', title: '权限规则', width: 200, sort: true, filter: true }, + { field: 'F_SortCode', title: '排序号', width: 120, sort: true, filter: true }, { - field: 'F_EnabledMark', title: '状态', width: 80, + field: 'F_EnabledMark', title: '状态', width: 80, sort: true, filter: true, templet: function (d) { if (d.F_EnabledMark == true) { return "有效"; @@ -59,7 +67,7 @@ } }, { - field: 'F_CreatorTime', title: '创建时间', width: 120, sort: true, + field: 'F_CreatorTime', title: '创建时间', width: 120, sort: true, filter: { type: 'date[yyyy-MM-dd]' }, templet: function (d) { if (d.F_CreatorTime) { var time = new Date(d.F_CreatorTime); @@ -68,7 +76,8 @@ return ''; } }, - { field: 'F_Description', title: '备注', minWidth: 150 } + { field: 'F_Description', title: '备注', minWidth: 150, sort: true, filter: true }, + { title: '操作', width: 130, toolbar: '#currentTableBar', align: "center" } ]] }); // 监听搜索操作 @@ -79,16 +88,15 @@ curr: 1, where: { keyword: data.field.txt_keyword} }); - entity = null; return false; }); - var entity; - table.on('row(currentTableFilter)', function (obj) { - obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click"); - entity = obj; - }) + //行点击事件监听,控制按钮显示 + var oneList = ["NF-edit", "NF-delete"];//选择1条显示 + commonTable.tableRowClick("radio", "currentTableFilter", "currentTableId", oneList); //toolbar监听事件 table.on('toolbar(currentTableFilter)', function (obj) { + var data = table.checkStatus('currentTableId').data; + var id = data.length > 0 ? data[0].F_Id : null; if (obj.event === 'add') { // 监听添加操作 common.openNewTabByIframe({ title: "新增规则", @@ -96,26 +104,26 @@ }); } else if (obj.event === 'delete') { - if (entity == null) { + if (id == null) { common.modalMsg("未选中数据", "warning"); return false; } common.deleteForm({ url: "/SystemOrganize/DataPrivilegeRule/DeleteForm", - param: { keyValue: entity.data.F_Id }, + param: { keyValue: id }, success: function () { common.reload('data-search-btn'); } }); } else if (obj.event === 'edit') { - if (entity == null) { + if (id == null) { common.modalMsg("未选中数据", "warning"); return false; } common.openNewTabByIframe({ title: "修改规则", - href: "/SystemOrganize/DataPrivilegeRule/Form?keyValue=" + entity.data.F_Id, + href: "/SystemOrganize/DataPrivilegeRule/Form?keyValue=" + id, }); } else if (obj.event === 'TABLE_SEARCH') { @@ -126,15 +134,27 @@ _that.addClass('layui-hide'); } } - else if (obj.event === 'TABLE_SEARCH') { - var _that = $("#searchField"); - if (_that.hasClass("layui-hide")) { - _that.removeClass('layui-hide'); - } else { - _that.addClass('layui-hide'); - } - } return false; - }); + }); + //toolrow监听事件 + table.on('tool(currentTableFilter)', function (obj) { + var id = obj.data.F_Id; + if (obj.event === 'delete') { + common.deleteForm({ + url: "/SystemOrganize/DataPrivilegeRule/DeleteForm", + param: { keyValue: id }, + success: function () { + obj.del(); + } + }); + } + else if (obj.event === 'edit') { + common.openNewTabByIframe({ + title: "修改规则", + href: "/SystemOrganize/DataPrivilegeRule/Form?keyValue=" + id, + }); + } + return false; + }); }); diff --git a/WaterCloud.Web/Areas/SystemOrganize/Views/Duty/Import.cshtml b/WaterCloud.Web/Areas/SystemOrganize/Views/Duty/Import.cshtml index 781d2520..3fdf03c6 100644 --- a/WaterCloud.Web/Areas/SystemOrganize/Views/Duty/Import.cshtml +++ b/WaterCloud.Web/Areas/SystemOrganize/Views/Duty/Import.cshtml @@ -10,7 +10,7 @@ @@ -104,24 +104,9 @@ } }); wcLoading.close(); - $(document).on("click", ".layui-table-body table.layui-table tbody tr", function () { - var index = $(this).attr('data-index'); - var tableBox = $(this).parents('.layui-table-box'); - //存在固定列 - if (tableBox.find(".layui-table-fixed.layui-table-fixed-l").length > 0) { - tableDiv = tableBox.find(".layui-table-fixed.layui-table-fixed-l"); - } else { - tableDiv = tableBox.find(".layui-table-body.layui-table-main"); - } - var checkCell = tableDiv.find("tr[data-index=" + index + "]").find("td div.laytable-cell-checkbox div.layui-form-checkbox I"); - if (checkCell.length > 0) { - checkCell.click(); - } - }); - //对td的单击事件进行拦截停止,防止事件冒泡再次触发上述的单击事件(Table的单击行事件不会拦截,依然有效) - $(document).on("click", "td div.laytable-cell-checkbox div.layui-form-checkbox", function (e) { - e.stopPropagation(); - }); + //行点击事件监听,控制按钮显示 + var morerList = ["NF-delete"];//选中1条以上显示 + commonTable.tableRowClick("checkbox", "currentTableFilter", "currentTableId", null, morerList); //监听提交 form.on('submit(download)', function (data) { window.open('/SystemOrganize/Duty/Download'); diff --git a/WaterCloud.Web/Areas/SystemOrganize/Views/Duty/Index.cshtml b/WaterCloud.Web/Areas/SystemOrganize/Views/Duty/Index.cshtml index 643cc0dc..fa31ce9b 100644 --- a/WaterCloud.Web/Areas/SystemOrganize/Views/Duty/Index.cshtml +++ b/WaterCloud.Web/Areas/SystemOrganize/Views/Duty/Index.cshtml @@ -19,6 +19,7 @@ clearFilter: false }, cols: [[ + { type: "checkbox", width: 50 }, { field: 'F_FullName', title: '岗位名称', width: 120, sort: true, filter: true }, { field: 'F_EnCode', title: '岗位编号', width: 120, sort: true, filter: true }, { @@ -45,6 +46,7 @@ } }, { field: 'F_Description', title: '备注', minWidth: 150, sort: true, filter: true }, + { title: '操作', width: 170, toolbar: '#currentTableBar', align: "center" } ]] }); wcLoading.close(); @@ -56,18 +58,18 @@ curr: 1, where: { keyword: data.field.txt_keyword } }); - duty = null; return false; }); - var duty; - table.on('row(currentTableFilter)', function (obj) { - obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click"); - duty = obj; - }) + //行点击事件监听,控制按钮显示 + var oneList = ["NF-edit", "NF-details"];//选择1条显示 + var morerList = ["NF-delete"];//选中1条以上显示 + commonTable.tableRowClick("checkbox", "currentTableFilter", "currentTableId", oneList, morerList); /** * toolbar监听事件 */ table.on('toolbar(currentTableFilter)', function (obj) { + var data = table.checkStatus('currentTableId').data; + var id = data.length > 0 ? data[0].F_Id : null; if (obj.event === 'add') { // 监听删除操作 common.modalOpen({ title: "添加岗位", @@ -77,38 +79,42 @@ }); } else if (obj.event === 'delete') { - if (duty == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } + var ids = []; + for (var i = 0; i < data.length; i++) { + ids.push(data[i].F_Id); + } common.deleteForm({ url: "/SystemOrganize/Duty/DeleteForm", - param: { keyValue: duty.data.F_Id }, + param: { keyValue: ids.join(',') }, success: function () { common.reload('data-search-btn'); } }); } else if (obj.event === 'edit') { - if (duty == null) { + if (id == null) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "编辑岗位", - url: "/SystemOrganize/Duty/Form?keyValue=" + duty.data.F_Id, + url: "/SystemOrganize/Duty/Form?keyValue=" + id, width: "500px", height: "450px", }); } else if (obj.event === 'details') { - if (duty == null) { + if (id == null) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "查看岗位", - url: "/SystemOrganize/Duty/Details?keyValue=" + duty.data.F_Id, + url: "/SystemOrganize/Duty/Details?keyValue=" + id, width: "500px", height: "450px", btn: [] @@ -135,6 +141,37 @@ } return false; }); + //toolrow监听事件 + table.on('tool(currentTableFilter)', function (obj) { + var id = obj.data.F_Id; + if (obj.event === 'delete') { + common.deleteForm({ + url: "/SystemOrganize/Duty/DeleteForm", + param: { keyValue: id }, + success: function () { + obj.del(); + } + }); + } + else if (obj.event === 'edit') { + common.modalOpen({ + title: "编辑岗位", + url: "/SystemOrganize/Duty/Form?keyValue=" + id, + width: "500px", + height: "450px", + }); + } + else if (obj.event === 'details') { + common.modalOpen({ + title: "查看岗位", + url: "/SystemOrganize/Duty/Details?keyValue=" + id, + width: "500px", + height: "450px", + btn: [] + }); + } + return false; + }); });
@@ -161,14 +198,18 @@ - +
diff --git a/WaterCloud.Web/Areas/SystemOrganize/Views/Notice/Index.cshtml b/WaterCloud.Web/Areas/SystemOrganize/Views/Notice/Index.cshtml index 5f5ab231..97a5ae45 100644 --- a/WaterCloud.Web/Areas/SystemOrganize/Views/Notice/Index.cshtml +++ b/WaterCloud.Web/Areas/SystemOrganize/Views/Notice/Index.cshtml @@ -16,11 +16,15 @@ elem: '#currentTableId', id: 'currentTableId', url: '/SystemOrganize/Notice/GetGridJson', + filter: { + clearFilter: false + }, cols: [[ - { field: 'F_Title', title: '标题', Width: 120 }, - { field: 'F_Content', title: '内容', Width: 250}, + { type: "checkbox", width: 50 }, + { field: 'F_Title', title: '标题', Width: 120, sort: true, filter: true }, + { field: 'F_Content', title: '内容', Width: 250, sort: true, filter: true}, { - field: 'F_EnabledMark', title: '状态', width: 80, sort: true, + field: 'F_EnabledMark', title: '状态', width: 80, sort: true, filter: true, templet: function (d) { if (d.F_EnabledMark == true) { return "有效"; @@ -30,10 +34,10 @@ } }, { - field: 'F_CreatorUserName', title: '创建人', Width: 100, sort: true, + field: 'F_CreatorUserName', title: '创建人', Width: 100, sort: true, filter: true, }, { - field: 'F_CreatorTime', title: '创建时间', minWidth: 120, sort: true, + field: 'F_CreatorTime', title: '创建时间', minWidth: 120, sort: true, filter: { type: 'date[yyyy-MM-dd]' }, templet: function (d) { if (d.F_CreatorTime) { var time = new Date(d.F_CreatorTime); @@ -41,7 +45,8 @@ } return ''; } - } + }, + { title: '操作', width: 170, toolbar: '#currentTableBar', align: "center" } ]] }); // 监听搜索操作 @@ -52,18 +57,18 @@ curr: 1, where: { keyword: data.field.txt_keyword} }); - duty = null; return false; }); - var duty; - table.on('row(currentTableFilter)', function (obj) { - obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click"); - duty = obj; - }) + //行点击事件监听,控制按钮显示 + var oneList = ["NF-edit", "NF-details"];//选择1条显示 + var morerList = ["NF-delete"];//选中1条以上显示 + commonTable.tableRowClick("checkbox", "currentTableFilter", "currentTableId", oneList, morerList); /** * toolbar监听事件 */ table.on('toolbar(currentTableFilter)', function (obj) { + var data = table.checkStatus('currentTableId').data; + var id = data.length > 0 ? data[0].F_Id : null; if (obj.event === 'add') { // 监听删除操作 common.modalOpen({ title: "添加公告", @@ -73,38 +78,42 @@ }); } else if (obj.event === 'delete') { - if (duty == null) { + if (id == null) { common.modalMsg("未选中数据", "warning"); return false; } + var ids = []; + for (var i = 0; i < data.length; i++) { + ids.push(data[i].F_Id); + } common.deleteForm({ url: "/SystemOrganize/Notice/DeleteForm", - param: { keyValue: duty.data.F_Id }, + param: { keyValue: ids.join(',') }, success: function () { common.reload('data-search-btn'); } }); } else if (obj.event === 'edit') { - if (duty == null) { + if (id == null) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "编辑公告", - url: "/SystemOrganize/Notice/Form?keyValue=" + duty.data.F_Id, + url: "/SystemOrganize/Notice/Form?keyValue=" + id, width: "400px", height: "350px", }); } else if (obj.event === 'details') { - if (duty == null) { + if (id == null) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "查看公告", - url: "/SystemOrganize/Notice/Details?keyValue=" + duty.data.F_Id, + url: "/SystemOrganize/Notice/Details?keyValue=" + id, width: "400px", height: "350px", btn: [] @@ -120,6 +129,37 @@ } return false; }); + //toolrow监听事件 + table.on('tool(currentTableFilter)', function (obj) { + var id = obj.data.F_Id; + if (obj.event === 'delete') { + common.deleteForm({ + url: "/SystemOrganize/Notice/DeleteForm", + param: { keyValue: id }, + success: function () { + obj.del(); + } + }); + } + else if (obj.event === 'edit') { + common.modalOpen({ + title: "编辑公告", + url: "/SystemOrganize/Notice/Form?keyValue=" + id, + width: "400px", + height: "350px", + }); + } + else if (obj.event === 'details') { + common.modalOpen({ + title: "查看公告", + url: "/SystemOrganize/Notice/Details?keyValue=" + id, + width: "400px", + height: "350px", + btn: [] + }); + } + return false; + }); });
@@ -146,11 +186,16 @@ +
diff --git a/WaterCloud.Web/Areas/SystemOrganize/Views/Organize/Index.cshtml b/WaterCloud.Web/Areas/SystemOrganize/Views/Organize/Index.cshtml index 51436b7f..b1e96371 100644 --- a/WaterCloud.Web/Areas/SystemOrganize/Views/Organize/Index.cshtml +++ b/WaterCloud.Web/Areas/SystemOrganize/Views/Organize/Index.cshtml @@ -16,8 +16,17 @@ toolbarDemo.innerHTML = common.authorizeButtonNew(toolbarDemo.innerHTML); var rendertree = common.rendertreetable({ elem: '#currentTableId', - url: '/SystemOrganize/Organize/GetTreeGridJson' , + url: '/SystemOrganize/Organize/GetTreeGridJson', + tree: { + iconIndex: 1, // 折叠图标显示在第几列 + isPidData: true, // 是否是id、pid形式数据 + idName: 'F_Id', // id字段名称 + pidName: 'F_ParentId', // pid字段名称 + arrowType: 'arrow2', + getIcon: 'ew-tree-icon-style2', + }, cols: [[ + { type: "radio", width: 50 }, { field: 'F_FullName', title: '名称', width: 250 }, { field: 'F_EnCode', title: '编号', width: 200 }, { @@ -47,6 +56,7 @@ } }, { field: 'F_Description', title: '备注', minWidth: 150 }, + { title: '操作', width: 170, toolbar: '#currentTableBar', align: "center" } ]], done: function () { //展开全部 @@ -63,17 +73,17 @@ duty = null; return false; }); - var duty; - treeTable.on('row(currentTableId)', function (obj) { - obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click"); - duty = obj; - }) + //行点击事件监听,控制按钮显示 + var oneList = ["NF-edit", "NF-details", "NF-delete"];//选择1条显示 + common.treeTableRowClick("radio", rendertree, "currentTableId", oneList); /** * toolbar监听事件 */ treeTable.on('toolbar(currentTableId)', function (obj) { + var data = rendertree.checkStatus(false); + var keyValue = data.length > 0 ? data[0].F_Id : null; + var duty = data.length > 0 ? data[0] : null; if (obj.event === 'add') { // 监听操作 - keyValue = !!duty ? duty.data.F_Id : null; common.modalOpen({ title: "添加机构", url: "/SystemOrganize/Organize/Form?event=add&keyValue=" + keyValue, @@ -101,7 +111,7 @@ } common.modalOpen({ title: "编辑机构", - url: "/SystemOrganize/Organize/Form?event=edit&keyValue=" + duty.data.F_Id, + url: "/SystemOrganize/Organize/Form?event=edit&keyValue=" + keyValue, width: "450px", height: "520px", }); @@ -113,7 +123,7 @@ } common.modalOpen({ title: "查看机构", - url: "/SystemOrganize/Organize/Details?keyValue=" + duty.data.F_Id, + url: "/SystemOrganize/Organize/Details?keyValue=" + keyValue, width: "450px", height: "520px", btn: [] @@ -129,6 +139,36 @@ } return false; }); + treeTable.on('tool(currentTableId)', function (obj) { + var keyValue = obj.data.F_Id; + if (obj.event === 'delete') { + common.deleteForm({ + url: "/SystemOrganize/Organize/DeleteForm", + param: { keyValue: keyValue }, + success: function () { + obj.del(); + } + }); + } + else if (obj.event === 'edit') { + common.modalOpen({ + title: "编辑机构", + url: "/SystemOrganize/Organize/Form?event=edit&keyValue=" + keyValue, + width: "450px", + height: "520px", + }); + } + else if (obj.event === 'details') { + common.modalOpen({ + title: "查看机构", + url: "/SystemOrganize/Organize/Details?keyValue=" + keyValue, + width: "450px", + height: "520px", + btn: [] + }); + } + return false; + }); });
@@ -154,13 +194,17 @@ - +
diff --git a/WaterCloud.Web/Areas/SystemOrganize/Views/Role/Index.cshtml b/WaterCloud.Web/Areas/SystemOrganize/Views/Role/Index.cshtml index e98220d3..21061d88 100644 --- a/WaterCloud.Web/Areas/SystemOrganize/Views/Role/Index.cshtml +++ b/WaterCloud.Web/Areas/SystemOrganize/Views/Role/Index.cshtml @@ -16,20 +16,24 @@ elem: '#currentTableId', id: 'currentTableId', url: '/SystemOrganize/Role/GetGridJson', + filter: { + clearFilter: false + }, cols: [[ - { field: 'F_FullName', title: '角色名称', width: 200, sort: true }, - { field: 'F_EnCode', title: '角色编号', width: 200, sort: true }, + { type: "radio", width: 50 }, + { field: 'F_FullName', title: '角色名称', width: 200, sort: true, filter: true }, + { field: 'F_EnCode', title: '角色编号', width: 200, sort: true, filter: true }, { - field: 'F_Type', title: '角色类型', width: 120, sort: true, + field: 'F_Type', title: '角色类型', width: 120, sort: true, filter: true, templet: function (d) { return top.clients.dataItems["RoleType"][d.F_Type] == undefined ? "" : top.clients.dataItems["RoleType"][d.F_Type]; } }, { - field: 'F_CompanyName', title: '归属公司', width: 120, sort: true, + field: 'F_CompanyName', title: '归属公司', width: 120, sort: true, filter: true, }, { - field: 'F_EnabledMark', title: '状态', width: 80, sort: true, + field: 'F_EnabledMark', title: '状态', width: 80, sort: true, filter: true, templet: function (d) { if (d.F_EnabledMark == true) { return "有效"; @@ -39,7 +43,7 @@ } }, { - field: 'F_CreatorTime', title: '创建时间', width: 120, sort: true, + field: 'F_CreatorTime', title: '创建时间', width: 120, sort: true, filter: true, templet: function (d) { if (d.F_CreatorTime) { var time = new Date(d.F_CreatorTime); @@ -48,12 +52,12 @@ return ''; } }, - { field: 'F_Description', title: '备注', minWidth: 150, sort: true }, + { field: 'F_Description', title: '备注', minWidth: 150, sort: true, filter: true }, + { title: '操作', width: 170, toolbar: '#currentTableBar', align: "center" } ]] }); // 监听搜索操作 form.on('submit(data-search-btn)', function (data) { - var queryJson = data.field.txt_keyword; //执行搜索重载 commonTable.reloadtable({ elem: 'currentTableId', @@ -63,15 +67,15 @@ role = null; return false; }); - var role; - table.on('row(currentTableFilter)', function (obj) { - obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click"); - role = obj; - }) + //行点击事件监听,控制按钮显示 + var oneList = ["NF-edit", "NF-details", "NF-delete"];//选择1条显示 + commonTable.tableRowClick("radio", "currentTableFilter", "currentTableId", oneList); /** * toolbar监听事件 */ table.on('toolbar(currentTableFilter)', function (obj) { + var data = table.checkStatus('currentTableId').data; + var id = data.length > 0 ? data[0].F_Id : null; if (obj.event === 'add') { // 监听操作 common.modalOpen({ title: "添加角色", @@ -82,39 +86,39 @@ }); } else if (obj.event === 'delete') { - if (role == null) { + if (id == null) { common.modalMsg("未选中数据", "warning"); return false; } common.deleteForm({ url: "/SystemOrganize/Role/DeleteForm", - param: { keyValue: role.data.F_Id }, + param: { keyValue: id }, success: function () { common.reload('data-search-btn'); } }); } else if (obj.event === 'edit') { - if (role == null) { + if (id == null) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "编辑角色", - url: "/SystemOrganize/Role/Form?keyValue=" + role.data.F_Id, + url: "/SystemOrganize/Role/Form?keyValue=" + id, width: "550px", height: "550px", btn: [] }); } else if (obj.event === 'details') { - if (role == null) { + if (id == null) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "查看角色", - url: "/SystemOrganize/Role/Details?keyValue=" + role.data.F_Id, + url: "/SystemOrganize/Role/Details?keyValue=" + id, width: "550px", height: "550px", btn: [] @@ -130,6 +134,38 @@ } return false; }); + //toolrow监听事件 + table.on('tool(currentTableFilter)', function (obj) { + var id = obj.data.F_Id; + if (obj.event === 'delete') { + common.deleteForm({ + url: "/SystemOrganize/Role/DeleteForm", + param: { keyValue: id }, + success: function () { + obj.del(); + } + }); + } + else if (obj.event === 'edit') { + common.modalOpen({ + title: "编辑角色", + url: "/SystemOrganize/Role/Form?keyValue=" + id, + width: "550px", + height: "550px", + btn: [] + }); + } + else if (obj.event === 'details') { + common.modalOpen({ + title: "查看角色", + url: "/SystemOrganize/Role/Details?keyValue=" + id, + width: "550px", + height: "550px", + btn: [] + }); + } + return false; + }); });
@@ -156,11 +192,16 @@ +
diff --git a/WaterCloud.Web/Areas/SystemOrganize/Views/SystemSet/Index.cshtml b/WaterCloud.Web/Areas/SystemOrganize/Views/SystemSet/Index.cshtml index 34ce006b..2d2dc581 100644 --- a/WaterCloud.Web/Areas/SystemOrganize/Views/SystemSet/Index.cshtml +++ b/WaterCloud.Web/Areas/SystemOrganize/Views/SystemSet/Index.cshtml @@ -6,15 +6,15 @@
-
+
- +
-
+
@@ -28,6 +28,10 @@
+
@@ -45,7 +49,7 @@ id: 'currentTableId', url: '/SystemOrganize/SystemSet/GetGridJson', cols: [[ - //此处需修改 + { type: "radio", width: 50 }, { field: 'F_ProjectName', title: '项目名称', width: 120, sort: true }, { field: 'F_CompanyName', title: '公司名称', width: 120, sort: true }, { field: 'F_PrincipalMan', title: '联系人', width: 120, sort: true }, @@ -85,7 +89,8 @@ } } }, - { field: 'F_Description', title: '备注', minWidth: 120, sort: true } + { field: 'F_Description', title: '备注', minWidth: 120, sort: true }, + { title: '操作', width: 170, toolbar: '#currentTableBar', align: "center" } ]] }); // 监听搜索操作 @@ -96,16 +101,15 @@ curr: 1, where: { keyword: data.field.txt_keyword } }); - entity = null; return false; }); - var entity; - table.on('row(currentTableFilter)', function (obj) { - obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click"); - entity = obj; - }) + //行点击事件监听,控制按钮显示 + var oneList = ["NF-edit", "NF-details", "NF-delete"];//选择1条显示 + commonTable.tableRowClick("radio", "currentTableFilter", "currentTableId", oneList); //toolbar监听事件 table.on('toolbar(currentTableFilter)', function (obj) { + var data = table.checkStatus('currentTableId').data; + var id = data.length > 0 ? data[0].F_Id : null; if (obj.event === 'add') { // 监听添加操作 common.modalOpen({ title: "添加界面", @@ -115,25 +119,25 @@ }); } else if (obj.event === 'edit') { - if (entity == null) { + if (id == null) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "编辑界面", - url: "/SystemOrganize/SystemSet/Form?keyValue=" + entity.data.F_Id, + url: "/SystemOrganize/SystemSet/Form?keyValue=" + id, width: "700px", height: "500px", }); } else if (obj.event === 'details') { - if (entity == null) { + if (id == null) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "查看界面", - url: "/SystemOrganize/SystemSet/Details?keyValue=" + entity.data.F_Id, + url: "/SystemOrganize/SystemSet/Details?keyValue=" + id, width: "700px", height: "500px", btn: [] @@ -149,5 +153,27 @@ } return false; }); + //toolrow监听事件 + table.on('tool(currentTableFilter)', function (obj) { + var id = obj.data.F_Id; + if (obj.event === 'edit') { + common.modalOpen({ + title: "编辑界面", + url: "/SystemOrganize/SystemSet/Form?keyValue=" + id, + width: "700px", + height: "500px", + }); + } + else if (obj.event === 'details') { + common.modalOpen({ + title: "查看界面", + url: "/SystemOrganize/SystemSet/Details?keyValue=" + id, + width: "700px", + height: "500px", + btn: [] + }); + } + return false; + }); }); diff --git a/WaterCloud.Web/Areas/SystemOrganize/Views/User/Index.cshtml b/WaterCloud.Web/Areas/SystemOrganize/Views/User/Index.cshtml index f770b81a..559eec13 100644 --- a/WaterCloud.Web/Areas/SystemOrganize/Views/User/Index.cshtml +++ b/WaterCloud.Web/Areas/SystemOrganize/Views/User/Index.cshtml @@ -17,10 +17,11 @@ id: 'currentTableId', url: '/SystemOrganize/User/GetGridJson', cols: [[ - { field: 'F_Account', title: '账户', width: 150, sort: true}, - { field: 'F_RealName', title: '姓名', width: 120, sort: true }, + { type: "radio", width: 50 }, + { field: 'F_Account', title: '账户', width: 150, sort: true, filter: true}, + { field: 'F_RealName', title: '姓名', width: 120, sort: true, filter: true }, { - field: 'F_Gender', title: '性别', width: 80, sort: true, + field: 'F_Gender', title: '性别', width: 80, sort: true, filter: true, templet: function (d) { if (d.F_Gender == true) { return "男"; @@ -29,18 +30,18 @@ } } }, - { field: 'F_MobilePhone', title: '手机', width: 120, sort: true }, + { field: 'F_MobilePhone', title: '手机', width: 120, sort: true, filter: true }, { - field: 'F_CompanyName', title: '公司名称', width: 150, sort: true + field: 'F_CompanyName', title: '公司名称', width: 150, sort: true, filter: true }, { - field: 'F_DepartmentName', title: '部门名称', width: 200, sort: true + field: 'F_DepartmentName', title: '部门名称', width: 200, sort: true, filter: true }, { - field: 'F_DutyName', title: '岗位名称', width: 120, sort: true + field: 'F_DutyName', title: '岗位名称', width: 120, sort: true, filter: true }, { - field: 'F_EnabledMark', title: '状态', width: 80, sort: true, + field: 'F_EnabledMark', title: '状态', width: 80, sort: true, filter: true, templet: function (d) { if (d.F_EnabledMark == true) { return "有效"; @@ -50,7 +51,7 @@ } }, { - field: 'F_CreatorTime', title: '创建时间', width: 120, sort: true, + field: 'F_CreatorTime', title: '创建时间', width: 120, sort: true, filter: { type: 'date[yyyy-MM-dd]' }, templet: function (d) { if (d.F_CreatorTime) { var time = new Date(d.F_CreatorTime); @@ -59,7 +60,8 @@ return ''; } }, - { field: 'F_Description', title: '备注', minWidth: 150, sort: true }, + { field: 'F_Description', title: '备注', minWidth: 150, sort: true, filter: true }, + { title: '操作', width: 250, toolbar: '#currentTableBar', align: "center" } ]] }); // 监听搜索操作 @@ -70,18 +72,17 @@ curr: 1, where: { keyword: data.field.txt_keyword } }); - user = null; return false; }); - var user; - table.on('row(currentTableFilter)', function (obj) { - obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click"); - user = obj; - }) + //行点击事件监听,控制按钮显示 + var oneList = ["NF-edit", "NF-details", "NF-revisepassword", "NF-disabled", "NF-enabled","NF-delete"];//选择1条显示 + commonTable.tableRowClick("radio", "currentTableFilter", "currentTableId", oneList); /** * toolbar监听事件 */ table.on('toolbar(currentTableFilter)', function (obj) { + var data = table.checkStatus('currentTableId').data; + var id = data.length > 0 ? data[0].F_Id : null; if (obj.event === 'add') { // 监听删除操作 common.modalOpen({ title: "添加用户", @@ -95,20 +96,20 @@ }); } else if (obj.event === 'delete') { - if (user == null) { + if (id == null) { common.modalMsg("未选中数据", "warning"); return false; } common.deleteForm({ url: "/SystemOrganize/User/DeleteForm", - param: { keyValue: user.data.F_Id }, + param: { keyValue: id }, success: function () { common.reload('data-search-btn'); } }); } else if (obj.event === 'disabled') { - if (user == null) { + if (id == null) { common.modalMsg("未选中数据", "warning"); return false; } @@ -116,7 +117,7 @@ if (r) { common.submitForm({ url: "/SystemOrganize/User/DisabledAccount", - param: { keyValue: user.data.F_Id }, + param: { keyValue: id }, close: false, success: function () { common.reload('data-search-btn'); @@ -126,7 +127,7 @@ }); } else if (obj.event === 'enabled') { - if (user == null) { + if (id == null) { common.modalMsg("未选中数据", "warning"); return false; } @@ -134,7 +135,7 @@ if (r) { common.submitForm({ url: "/SystemOrganize/User/EnabledAccount", - param: { keyValue: user.data.F_Id }, + param: { keyValue: id }, close: false, success: function () { common.reload('data-search-btn'); @@ -144,13 +145,13 @@ }); } else if (obj.event === 'edit') { - if (user == null) { + if (id == null) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "编辑用户", - url: "/SystemOrganize/User/Form?keyValue=" + user.data.F_Id, + url: "/SystemOrganize/User/Form?keyValue=" + id, width: "750px", height: "550px", //callBack: function (index) { @@ -160,13 +161,13 @@ }); } else if (obj.event === 'details') { - if (user == null) { + if (id == null) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "查看用户", - url: "/SystemOrganize/User/Details?keyValue=" + user.data.F_Id, + url: "/SystemOrganize/User/Details?keyValue=" + id, width: "750px", height: "550px", btn: [] @@ -177,13 +178,13 @@ }); } else if (obj.event === 'revisepassword') { - if (user == null) { + if (id == null) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "重置密码", - url: '/SystemOrganize/User/RevisePassword?keyValue=' + user.data.F_Id, + url: '/SystemOrganize/User/RevisePassword?keyValue=' + id, width: "400px", height: "300px", //callBack: function (index) { @@ -202,6 +203,64 @@ } return false; }); + //toolrow监听事件 + table.on('tool(currentTableFilter)', function (obj) { + var id = obj.data.F_Id; + if (obj.event === 'delete') { + common.deleteForm({ + url: "/SystemOrganize/User/DeleteForm", + param: { keyValue: id }, + success: function () { + common.reload('data-search-btn'); + } + }); + } + else if (obj.event === 'disabled') { + common.modalConfirm("注:您确定要【禁用】该项账户吗?", function (r) { + if (r) { + common.submitForm({ + url: "/SystemOrganize/User/DisabledAccount", + param: { keyValue: id }, + close: false, + success: function () { + common.reload('data-search-btn'); + } + }) + } + }); + } + else if (obj.event === 'enabled') { + common.modalConfirm("注:您确定要【启用】该项账户吗?", function (r) { + if (r) { + common.submitForm({ + url: "/SystemOrganize/User/EnabledAccount", + param: { keyValue: id }, + close: false, + success: function () { + common.reload('data-search-btn'); + } + }) + } + }); + } + else if (obj.event === 'edit') { + common.modalOpen({ + title: "编辑用户", + url: "/SystemOrganize/User/Form?keyValue=" + id, + width: "750px", + height: "550px", + }); + } + else if (obj.event === 'revisepassword') { + common.modalOpen({ + title: "重置密码", + url: '/SystemOrganize/User/RevisePassword?keyValue=' + id, + width: "400px", + height: "300px", + }); + } + return false; + }); });
@@ -228,15 +287,21 @@ - +
diff --git a/WaterCloud.Web/Areas/SystemSecurity/Views/AppLog/Index.cshtml b/WaterCloud.Web/Areas/SystemSecurity/Views/AppLog/Index.cshtml index 6a4d657f..a75e34ce 100644 --- a/WaterCloud.Web/Areas/SystemSecurity/Views/AppLog/Index.cshtml +++ b/WaterCloud.Web/Areas/SystemSecurity/Views/AppLog/Index.cshtml @@ -43,9 +43,12 @@ +
@@ -60,6 +63,7 @@ //加载数据 wcLoading.close(); //权限控制(js是值传递) + currentTableBar.innerHTML = common.authorizeButtonNew(currentTableBar.innerHTML); toolbarDemo.innerHTML = common.authorizeButtonNew(toolbarDemo.innerHTML); commonTable.rendertable({ elem: '#currentTableId', @@ -67,7 +71,9 @@ url: '/SystemSecurity/AppLog/GetGridJson', sqlkey: 'FileName',//数据库主键 cols: [[ + { type: "radio", width: 50 }, { field: 'FileName', title: '文件名称', minWidth: 100, sort: true }, + { title: '操作', width: 90, toolbar: '#currentTableBar', align: "center" } ]] }); //select验证 @@ -96,23 +102,22 @@ }); return false; }); - var entity; - table.on('row(currentTableFilter)', function (obj) { - obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click"); - entity = obj; - }); + //行点击事件监听,控制按钮显示 + var oneList = ["NF-details"];//选择1条显示 + commonTable.tableRowClick("radio", "currentTableFilter", "currentTableId", oneList); /** * toolbar监听事件 */ table.on('toolbar(currentTableFilter)', function (obj) { + var data = table.checkStatus('currentTableId').data; if (obj.event === 'details') { // 监听删除操作 - if (entity == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } var html = ""; //高度宽度超出就适应屏幕 - var _width = document.body.clientWidth >500 ? '500px' : document.body.clientWidth - 20 + 'px'; + var _width = document.body.clientWidth > 500 ? '500px' : document.body.clientWidth - 20 + 'px'; var _height = document.body.clientHeight > 500 ? '500px' : document.body.clientHeight - 20 + 'px'; if (common.currentWindow()) { _width = common.currentWindow().document.body.clientWidth > 500 ? '500px' : common.currentWindow().document.body.clientWidth - 20 + 'px'; @@ -121,7 +126,7 @@ common.ajax({ url: "/SystemSecurity/AppLog/GetFormJson", dataType: "json", - data: { keyValue: entity.data.FileName }, + data: { keyValue: data[0].FileName }, async: false, success: function (data) { html = "
" + data.data + "
"; @@ -150,6 +155,41 @@ } return false; }); + //toolrow监听事件 + table.on('tool(currentTableFilter)', function (obj) { + if (obj.event === 'details') { + var html = ""; + //高度宽度超出就适应屏幕 + var _width = document.body.clientWidth > 500 ? '500px' : document.body.clientWidth - 20 + 'px'; + var _height = document.body.clientHeight > 500 ? '500px' : document.body.clientHeight - 20 + 'px'; + if (common.currentWindow()) { + _width = common.currentWindow().document.body.clientWidth > 500 ? '500px' : common.currentWindow().document.body.clientWidth - 20 + 'px'; + _height = common.currentWindow().document.body.clientHeight > 500 ? '500px' : common.currentWindow().document.body.clientHeight - 20 + 'px'; + } + common.ajax({ + url: "/SystemSecurity/AppLog/GetFormJson", + dataType: "json", + data: { keyValue: obj.data.FileName }, + async: false, + success: function (data) { + html = "
" + data.data + "
"; + layer.open({ + type: 1, + shade: 0.3, + title: '查看日志', + isOutAnim: true,//关闭动画 + fix: false, + area: [_width, _height], + content: html, + success: function (layero, index) { + $(layero).addClass("scroll-wrapper");//苹果 iframe 滚动条失效解决方式 + }, + }); + } + }); + } + return false; + }); }); diff --git a/WaterCloud.Web/Areas/SystemSecurity/Views/FilterIP/Index.cshtml b/WaterCloud.Web/Areas/SystemSecurity/Views/FilterIP/Index.cshtml index 879ca29d..48157719 100644 --- a/WaterCloud.Web/Areas/SystemSecurity/Views/FilterIP/Index.cshtml +++ b/WaterCloud.Web/Areas/SystemSecurity/Views/FilterIP/Index.cshtml @@ -11,6 +11,7 @@ //加载数据 wcLoading.close(); //权限控制(js是值传递) + currentTableBar.innerHTML = common.authorizeButtonNew(currentTableBar.innerHTML); toolbarDemo.innerHTML = common.authorizeButtonNew(toolbarDemo.innerHTML); commonTable.rendertable({ elem: '#currentTableId', @@ -18,6 +19,7 @@ url: '/SystemSecurity/FilterIP/GetGridJson', page: false, cols: [[ + { type: "checkbox", width: 50 }, { field: 'F_Type', title: '策略类型', width: 120, sort: true, templet: function (d) { @@ -28,7 +30,7 @@ } } }, - { field: 'F_StartIP', title: '起始IP', width: 150, sort: true }, + { field: 'F_StartIP', title: '起始IP', width: 150, sort: true}, { field: 'F_EndIP', title: '结束IP', width: 150, sort: true }, { field: 'F_CreatorTime', title: '创建时间', width: 120, sort: true, @@ -51,6 +53,7 @@ } }, { field: 'F_Description', title: '备注', minWidth: 150 }, + { title: '操作', width: 170, toolbar: '#currentTableBar', align: "center" } ]] }); // 监听搜索操作 @@ -62,18 +65,17 @@ curr: 1, where: { keyword: data.field.txt_keyword } }); - fitlerIP = null; return false; }); - var fitlerIP; - table.on('row(currentTableFilter)', function (obj) { - obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click"); - fitlerIP = obj; - }) + //行点击事件监听,控制按钮显示 + var oneList = ["NF-edit", "NF-details"];//选择1条显示 + var morerList = ["NF-delete"];//选中1条以上显示 + commonTable.tableRowClick("checkbox", "currentTableFilter", "currentTableId", oneList, morerList); /** * toolbar监听事件 */ table.on('toolbar(currentTableFilter)', function (obj) { + var data = table.checkStatus('currentTableId').data; if (obj.event === 'add') { // 监听删除操作 common.modalOpen({ title: "添加策略", @@ -83,38 +85,42 @@ }); } else if (obj.event === 'delete') { - if (fitlerIP == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } + var ids = []; + for (var i = 0; i < data.length; i++) { + ids.push(data[i].F_Id); + } common.deleteForm({ url: "/SystemSecurity/FilterIP/DeleteForm", - param: { keyValue: fitlerIP.data.F_Id }, + param: { keyValue: ids.join(',') }, success: function () { common.reload('data-search-btn'); } }); } else if (obj.event === 'edit') { - if (fitlerIP == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ - title: "添加策略", - url: "/SystemSecurity/FilterIP/Form?keyValue=" + fitlerIP.data.F_Id, + title: "编辑策略", + url: "/SystemSecurity/FilterIP/Form?keyValue=" + data[0].F_Id, width: "450px", height: "480px", }); } else if (obj.event === 'details') { - if (fitlerIP == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "查看策略", - url: "/SystemSecurity/FilterIP/Details?keyValue=" + fitlerIP.data.F_Id, + url: "/SystemSecurity/FilterIP/Details?keyValue=" + data[0].F_Id, width: "450px", height: "450px", btn: [] @@ -134,6 +140,40 @@ } return false; }); + //toolrow监听事件 + table.on('tool(currentTableFilter)', function (obj) { + if (obj.event === 'delete') { + common.deleteForm({ + url: "/SystemSecurity/FilterIP/DeleteForm", + param: { keyValue: obj.data.F_Id }, + success: function () { + obj.del(); + } + }); + } + else if (obj.event === 'edit') { + common.modalOpen({ + title: "编辑策略", + url: "/SystemSecurity/FilterIP/Form?keyValue=" + obj.data.F_Id, + width: "450px", + height: "480px", + }); + } + else if (obj.event === 'details') { + common.modalOpen({ + title: "查看策略", + url: "/SystemSecurity/FilterIP/Details?keyValue=" + obj.data.F_Id, + width: "450px", + height: "450px", + btn: [] + //callBack: function (index) { + // var iframe = "layui-layer-iframe" + index; + // window.frames[iframe].submitForm(); + //} + }); + } + return false; + }); });
@@ -160,13 +200,17 @@ - +
diff --git a/WaterCloud.Web/Areas/SystemSecurity/Views/OpenJobs/Index.cshtml b/WaterCloud.Web/Areas/SystemSecurity/Views/OpenJobs/Index.cshtml index 55b7610b..47d2d844 100644 --- a/WaterCloud.Web/Areas/SystemSecurity/Views/OpenJobs/Index.cshtml +++ b/WaterCloud.Web/Areas/SystemSecurity/Views/OpenJobs/Index.cshtml @@ -18,10 +18,11 @@ url: '/SystemSecurity/OpenJobs/GetGridJson', page: false, cols: [[ - { field: 'F_JobName', title: '名称', width: 150 }, - { field: 'F_JobGroup', title: '组名', width: 150 }, - { field: 'F_FileName', title: '文件名', minWidth: 200 }, - { field: 'F_CronExpress', title: 'CRON', width: 180 }, + { type: "radio", width: 50 }, + { field: 'F_JobName', title: '名称', width: 120, sort: true }, + { field: 'F_JobGroup', title: '组名', width: 120, sort: true }, + { field: 'F_FileName', title: '文件名', width: 180, sort: true }, + { field: 'F_CronExpress', title: 'CRON', width: 150 }, { field: 'F_EnabledMark', title: '状态', width: 80, sort: true, templet: function (d) { @@ -33,7 +34,7 @@ } }, { - field: 'F_LastRunTime', title: '最近执行时间', width: 180, + field: 'F_LastRunTime', title: '最近执行时间', width: 180, sort: true, templet: function (d) { if (d.F_LastRunTime) { var time = new Date(d.F_LastRunTime); @@ -43,7 +44,7 @@ } }, { - field: 'F_StarRunTime', title: '最近启动时间', width: 180, + field: 'F_StarRunTime', title: '最近启动时间', width: 170, sort: true, templet: function (d) { if (d.F_StarRunTime) { var time = new Date(d.F_StarRunTime); @@ -53,7 +54,7 @@ } }, { - field: 'F_EndRunTime', title: '最近关闭时间', width: 180, + field: 'F_EndRunTime', title: '最近关闭时间', width: 170, sort: true, templet: function (d) { if (d.F_EndRunTime) { var time = new Date(d.F_EndRunTime); @@ -63,7 +64,8 @@ } }, - { field: 'F_Description', title: '备注', minWidth: 200 }, + { field: 'F_Description', title: '备注', minWidth: 200, sort: true }, + { title: '操作', width: 250, toolbar: '#currentTableBar', align: "center" } ]] }); // 监听搜索操作 @@ -75,18 +77,16 @@ curr: 1, where: { keyword: data.field.txt_keyword } }); - entity = null; return false; }); - var entity; - table.on('row(currentTableFilter)', function (obj) { - obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click"); - entity = obj; - }) + //行点击事件监听,控制按钮显示 + var oneList = ["NF-edit", "NF-disabled", "NF-enabled", "NF-edit", "NF-log"];//选择1条显示 + commonTable.tableRowClick("radio", "currentTableFilter", "currentTableId", oneList); /** * toolbar监听事件 */ table.on('toolbar(currentTableFilter)', function (obj) { + var data = table.checkStatus('currentTableId').data; if (obj.event === 'add') { // 监听删除操作 common.modalOpen({ title: "添加任务", @@ -96,36 +96,36 @@ }); } else if (obj.event === 'delete') { - if (entity == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.deleteForm({ url: "/SystemSecurity/OpenJobs/DeleteForm", - param: { keyValue: entity.data.F_Id }, + param: { keyValue: data[0].F_Id }, success: function () { common.reload('data-search-btn'); } }); } else if (obj.event === 'edit') { - if (entity == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "修改任务", - url: "/SystemSecurity/OpenJobs/Form?keyValue=" + entity.data.F_Id, + url: "/SystemSecurity/OpenJobs/Form?keyValue=" + data[0].F_Id, width: "550px", height: "500px", }); } else if (obj.event === 'disabled') { - if (entity == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } - if (entity.data.F_EnabledMark!=true) { + if (data[0].F_EnabledMark!=true) { common.modalMsg("任务未启动,无法关闭!", "warning"); return false; } @@ -133,7 +133,7 @@ if (r) { common.submitForm({ url: "/SystemSecurity/OpenJobs/ChangeStatus", - param: { keyValue: entity.data.F_Id, status: 0}, + param: { keyValue: data[0].F_Id, status: 0}, close: false, success: function () { common.reload('data-search-btn'); @@ -143,11 +143,11 @@ }); } else if (obj.event === 'enabled') { - if (entity == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } - if (entity.data.F_EnabledMark == true) { + if (data[0].F_EnabledMark == true) { common.modalMsg("任务已启动,无法启动!", "warning"); return false; } @@ -155,7 +155,7 @@ if (r) { common.submitForm({ url: "/SystemSecurity/OpenJobs/ChangeStatus", - param: { keyValue: entity.data.F_Id, status: 1 }, + param: { keyValue: data[0].F_Id, status: 1 }, close: false, success: function () { common.reload('data-search-btn'); @@ -165,13 +165,13 @@ }); } else if (obj.event === 'log') { - if (entity == null) { + if (data.length == 0) { common.modalMsg("未选中数据", "warning"); return false; } common.modalOpen({ title: "任务日志", - url: "/SystemSecurity/OpenJobs/Details?keyValue=" + entity.data.F_Id, + url: "/SystemSecurity/OpenJobs/Details?keyValue=" + data[0].F_Id, width: "700px", height: "600px", btn:[] @@ -187,6 +187,72 @@ } return false; }); + //toolrow监听事件 + table.on('tool(currentTableFilter)', function (obj) { + if (obj.event === 'delete') { + common.deleteForm({ + url: "/SystemSecurity/OpenJobs/DeleteForm", + param: { keyValue: obj.data.F_Id }, + success: function () { + obj.del(); + } + }); + } + else if (obj.event === 'edit') { + common.modalOpen({ + title: "修改任务", + url: "/SystemSecurity/OpenJobs/Form?keyValue=" + obj.data.F_Id, + width: "550px", + height: "500px", + }); + } + else if (obj.event === 'disabled') { + if (obj.data.F_EnabledMark != true) { + common.modalMsg("任务未启动,无法关闭!", "warning"); + return false; + } + common.modalConfirm("注:您确定要【关闭】该项任务吗?", function (r) { + if (r) { + common.submitForm({ + url: "/SystemSecurity/OpenJobs/ChangeStatus", + param: { keyValue: obj.data.F_Id, status: 0 }, + close: false, + success: function () { + common.reload('data-search-btn'); + } + }) + } + }); + } + else if (obj.event === 'enabled') { + if (obj.data.F_EnabledMark == true) { + common.modalMsg("任务已启动,无法启动!", "warning"); + return false; + } + common.modalConfirm("注:您确定要【启动】该项任务吗?", function (r) { + if (r) { + common.submitForm({ + url: "/SystemSecurity/OpenJobs/ChangeStatus", + param: { keyValue: obj.data.F_Id, status: 1 }, + close: false, + success: function () { + common.reload('data-search-btn'); + } + }) + } + }); + } + else if (obj.event === 'log') { + common.modalOpen({ + title: "任务日志", + url: "/SystemSecurity/OpenJobs/Details?keyValue=" + obj.data.F_Id, + width: "700px", + height: "600px", + btn: [] + }); + } + return false; + }); });
@@ -213,15 +279,21 @@ - +
diff --git a/WaterCloud.Web/wwwroot/js/lay-module/waterCloud/common.js b/WaterCloud.Web/wwwroot/js/lay-module/waterCloud/common.js index 262b0e32..35d8e352 100644 --- a/WaterCloud.Web/wwwroot/js/lay-module/waterCloud/common.js +++ b/WaterCloud.Web/wwwroot/js/lay-module/waterCloud/common.js @@ -814,6 +814,85 @@ layui.define(["jquery", "layer", 'table', 'treeTable', 'xmSelect', 'miniTab'], f }; return cols; }, + //treetable行点击事件及按钮显示控制 + treeTableRowClick: function (type, rendertree ,tableId, oneList, moreList) { + var oneList = !!oneList ? oneList : []; + var moreList = !!moreList ? moreList : []; + treeTable.on('row(' + tableId + ')', function (obj) { + obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click"); + obj.tr.find("div.layui-unselect.layui-form-" + type)[0].click(); + if (type =="radio") { + for (var i = 0; i < oneList.length; i++) { + $('[name="' + oneList[i] + '"]').removeClass("layui-hide"); + } + for (var i = 0; i < moreList.length; i++) { + $('[name="' + moreList[i] + '"]').removeClass("layui-hide"); + } + } + }) + if (type == "checkbox") { + //多选框监听 + treeTable.on(type + '(' + tableId + ')', function (obj) { + //控制按钮 + var data = rendertree.checkStatus(false); + if (obj.type == "all") { + if (obj.checked && rendertree.options.data.length != 0) { + if (rendertree.options.data.length > 1) { + for (var i = 0; i < oneList.length; i++) { + $('[name="' + oneList[i] + '"]').addClass("layui-hide"); + } + for (var i = 0; i < moreList.length; i++) { + $('[name="' + moreList[i] + '"]').removeClass("layui-hide"); + } + } + else { + for (var i = 0; i < oneList.length; i++) { + $('[name="' + oneList[i] + '"]').removeClass("layui-hide"); + } + for (var i = 0; i < moreList.length; i++) { + $('[name="' + moreList[i] + '"]').removeClass("layui-hide"); + } + } + } + else { + for (var i = 0; i < oneList.length; i++) { + $('[name="' + oneList[i] + '"]').addClass("layui-hide"); + } + for (var i = 0; i < moreList.length; i++) { + $('[name="' + moreList[i] + '"]').addClass("layui-hide"); + } + } + } + else { + if (data.length > 1) { + for (var i = 0; i < oneList.length; i++) { + $('[name="' + oneList[i] + '"]').addClass("layui-hide"); + } + for (var i = 0; i < moreList.length; i++) { + $('[name="' + moreList[i] + '"]').removeClass("layui-hide"); + } + } + else if (data.length == 1) { + for (var i = 0; i < oneList.length; i++) { + $('[name="' + oneList[i] + '"]').removeClass("layui-hide"); + } + for (var i = 0; i < moreList.length; i++) { + $('[name="' + moreList[i] + '"]').removeClass("layui-hide"); + } + } + else { + for (var i = 0; i < oneList.length; i++) { + $('[name="' + oneList[i] + '"]').addClass("layui-hide"); + } + for (var i = 0; i < moreList.length; i++) { + $('[name="' + moreList[i] + '"]').addClass("layui-hide"); + } + } + } + }); + } + + }, //表格单元格自动列宽 //tableResize: function (id) { // //动态监听表头高度变化,冻结行跟着改变高度 diff --git a/WaterCloud.Web/wwwroot/js/lay-module/waterCloud/commonTable.js b/WaterCloud.Web/wwwroot/js/lay-module/waterCloud/commonTable.js index 2e8c0563..ebac730e 100644 --- a/WaterCloud.Web/wwwroot/js/lay-module/waterCloud/commonTable.js +++ b/WaterCloud.Web/wwwroot/js/lay-module/waterCloud/commonTable.js @@ -181,6 +181,92 @@ layui.define(["jquery", "layer", 'table', 'soulTable','common'], function (expor //关闭加载 layer.closeAll('loading'); }, + //table行点击事件及按钮显示控制 + tableRowClick: function (type, tableFilter, tableId, oneList, moreList) { + var oneList = !!oneList ? oneList : []; + var moreList = !!moreList ? moreList : []; + //type是checkbox或者radio + $(document).on("click", ".layui-table-body table.layui-table tbody tr", function () { + var index = $(this).attr('data-index'); + var tableBox = $(this).parents('.layui-table-box'); + //存在固定列 + if (tableBox.find(".layui-table-fixed.layui-table-fixed-l").length > 0) { + tableDiv = tableBox.find(".layui-table-fixed.layui-table-fixed-l"); + } else { + tableDiv = tableBox.find(".layui-table-body.layui-table-main"); + } + var checkCell = tableDiv.find("tr[data-index=" + index + "]").find("td div.laytable-cell-" + type + " div.layui-form-" + type + " I"); + if (checkCell.length > 0) { + checkCell.click(); + } + }); + //对td的单击事件进行拦截停止,防止事件冒泡再次触发上述的单击事件(Table的单击行事件不会拦截,依然有效) + $(document).on("click", "td div.laytable-cell-" + type + " div.layui-form-" + type + "", function (e) { + e.stopPropagation(); + }); + table.on('row(' + tableFilter+')', function (obj) { + obj.tr.addClass('layui-table-click').siblings().removeClass('layui-table-click'); + }) + //多选框监听 + table.on(type+'(' + tableFilter + ')', function (obj) { + //控制按钮 + var data = table.checkStatus(tableId).data; + if (obj.type == "all") { + if (obj.checked && table.cache[tableId].length != 0) { + if (table.cache[tableId].length > 1) { + for (var i = 0; i < oneList.length; i++) { + $('[name="' + oneList[i]+'"]').addClass("layui-hide"); + } + for (var i = 0; i < moreList.length; i++) { + $('[name="' + moreList[i] + '"]').removeClass("layui-hide"); + } + } + else { + for (var i = 0; i < oneList.length; i++) { + $('[name="' + oneList[i] + '"]').removeClass("layui-hide"); + } + for (var i = 0; i < moreList.length; i++) { + $('[name="' + moreList[i] + '"]').removeClass("layui-hide"); + } + } + } + else { + for (var i = 0; i < oneList.length; i++) { + $('[name="' + oneList[i] + '"]').addClass("layui-hide"); + } + for (var i = 0; i < moreList.length; i++) { + $('[name="' + moreList[i] + '"]').addClass("layui-hide"); + } + } + } + else { + if (data.length > 1) { + for (var i = 0; i < oneList.length; i++) { + $('[name="' + oneList[i] + '"]').addClass("layui-hide"); + } + for (var i = 0; i < moreList.length; i++) { + $('[name="' + moreList[i] + '"]').removeClass("layui-hide"); + } + } + else if (data.length == 1) { + for (var i = 0; i < oneList.length; i++) { + $('[name="' + oneList[i] + '"]').removeClass("layui-hide"); + } + for (var i = 0; i < moreList.length; i++) { + $('[name="' + moreList[i] + '"]').removeClass("layui-hide"); + } + } + else { + for (var i = 0; i < oneList.length; i++) { + $('[name="' + oneList[i] + '"]').addClass("layui-hide"); + } + for (var i = 0; i < moreList.length; i++) { + $('[name="' + moreList[i] + '"]').addClass("layui-hide"); + } + } + } + }); + }, } exports("commonTable", obj); }); \ No newline at end of file -- Gitee From 8f301a13bc9f39be77bac7640a9bb8ff4f0bd100 Mon Sep 17 00:00:00 2001 From: MonstorUncle <295228902@qq.com> Date: Fri, 18 Dec 2020 11:47:22 +0800 Subject: [PATCH 2/4] =?UTF-8?q?1.8.0=20=E4=BF=AE=E5=A4=8D=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E5=AF=BB=E6=89=BE=E4=B8=8B=E4=B8=80=E8=8A=82=E7=82=B9?= =?UTF-8?q?=20=E5=BD=93=E5=89=8D=E9=83=A8=E9=97=A8=E4=B8=8D=E6=98=AF?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E4=BA=BA=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FlowManage/FlowinstanceService.cs | 47 ++++++++++--------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/WaterCloud.Service/FlowManage/FlowinstanceService.cs b/WaterCloud.Service/FlowManage/FlowinstanceService.cs index ee063f12..6d2fb637 100644 --- a/WaterCloud.Service/FlowManage/FlowinstanceService.cs +++ b/WaterCloud.Service/FlowManage/FlowinstanceService.cs @@ -27,6 +27,7 @@ namespace WaterCloud.Service.FlowManage private IHttpClientFactory _httpClientFactory; private string cacheKey = "watercloud_flowinstancedata_"; private MessageService messageApp; + private string flowCreator; private string className = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName.Split('.')[3]; public FlowinstanceService(IDbContext context, IHttpClientFactory httpClientFactory, IHubContext messageHub) : base(context) { @@ -42,17 +43,17 @@ namespace WaterCloud.Service.FlowManage //此处需修改 cachedata = cachedata.Where(t => t.F_Code.Contains(keyword) || t.F_CustomName.Contains(keyword)).ToList(); } - return cachedata.Where(a=>a.F_EnabledMark==true).OrderByDescending(t => t.F_CreatorTime).ToList(); + return cachedata.Where(a => a.F_EnabledMark == true).OrderByDescending(t => t.F_CreatorTime).ToList(); } public async Task> QueryHistories(string keyValue) { - return uniwork.IQueryable(u => u.F_InstanceId == keyValue).OrderBy(u => u.F_CreatorTime).ToList(); + return uniwork.IQueryable(u => u.F_InstanceId == keyValue).OrderBy(u => u.F_CreatorTime).ToList(); } public async Task> GetLookList(string keyword = "") { - var list =new List(); + var list = new List(); if (!CheckDataPrivilege()) { list = await repository.CheckCacheList(cacheKey + "list"); @@ -92,7 +93,7 @@ namespace WaterCloud.Service.FlowManage if (type == "todo") //待办事项 { - list = list.Where(u => ((u.F_MakerList == "1" || u.F_MakerList.Contains(user.UserId)))&& (u.F_IsFinish == 0|| u.F_IsFinish == 4) && u.F_ActivityType<3); + list = list.Where(u => ((u.F_MakerList == "1" || u.F_MakerList.Contains(user.UserId))) && (u.F_IsFinish == 0 || u.F_IsFinish == 4) && u.F_ActivityType < 3); } else if (type == "done") //已办事项(即我参与过的流程) { @@ -102,7 +103,7 @@ namespace WaterCloud.Service.FlowManage } else //我的流程 { - list = list.Where(u => u.F_CreatorUserId==user.UserId); + list = list.Where(u => u.F_CreatorUserId == user.UserId); } return GetFieldsFilterData(await repository.OrderList(list.Where(a => a.F_EnabledMark == true), pagination)); } @@ -130,7 +131,8 @@ namespace WaterCloud.Service.FlowManage { var user = currentuser; - FlowinstanceEntity flowInstance =await GetForm(reqest.F_FlowInstanceId); + FlowinstanceEntity flowInstance = await GetForm(reqest.F_FlowInstanceId); + flowCreator = flowInstance.F_CreatorUserId; FlowRuntime wfruntime = new FlowRuntime(flowInstance); @@ -186,10 +188,10 @@ namespace WaterCloud.Service.FlowManage + reqest.F_VerificationOpinion }); MessageEntity msg = new MessageEntity(); - if (resnode== wfruntime.startNodeId) + if (resnode == wfruntime.startNodeId) { msg.F_MessageInfo = flowInstance.F_CustomName + "--流程驳回"; - var module= uniwork.IQueryable(a => a.F_EnCode == className.Substring(0, className.Length - 7)).FirstOrDefault(); + var module = uniwork.IQueryable(a => a.F_EnCode == className.Substring(0, className.Length - 7)).FirstOrDefault(); msg.F_Href = module.F_UrlAddress; msg.F_HrefTarget = module.F_Target; msg.F_ToUserId = flowInstance.F_CreatorUserId; @@ -201,7 +203,7 @@ namespace WaterCloud.Service.FlowManage { msg.F_MessageInfo = flowInstance.F_CustomName + "--流程待处理"; var module = uniwork.IQueryable(a => a.F_EnCode == className.Substring(0, className.Length - 7)).FirstOrDefault(); - msg.F_Href = module.F_UrlAddress.Remove(module.F_UrlAddress.Length - 5, 5)+ "ToDoFlow"; + msg.F_Href = module.F_UrlAddress.Remove(module.F_UrlAddress.Length - 5, 5) + "ToDoFlow"; msg.F_HrefTarget = module.F_Target; msg.F_ToUserId = flowInstance.F_MakerList == "1" ? "" : flowInstance.F_MakerList; msg.F_ClickRead = false; @@ -210,10 +212,10 @@ namespace WaterCloud.Service.FlowManage msg.F_CreatorUserName = currentuser.UserName; msg.F_EnabledMark = true; msg.F_MessageType = 2; - var lastmsg= uniwork.IQueryable(a => a.F_ClickRead == false && a.F_KeyValue == flowInstance.F_Id).OrderByDesc(a=>a.F_CreatorTime).FirstOrDefault(); - if (lastmsg!=null&&uniwork.IQueryable(a => a.F_MessageId == lastmsg.F_Id).Count()==0) + var lastmsg = uniwork.IQueryable(a => a.F_ClickRead == false && a.F_KeyValue == flowInstance.F_Id).OrderByDesc(a => a.F_CreatorTime).FirstOrDefault(); + if (lastmsg != null && uniwork.IQueryable(a => a.F_MessageId == lastmsg.F_Id).Count() == 0) { - await messageApp.ReadMsgForm(lastmsg.F_Id); + await messageApp.ReadMsgForm(lastmsg.F_Id); } await messageApp.SubmitForm(msg); uniwork.Commit(); @@ -229,7 +231,8 @@ namespace WaterCloud.Service.FlowManage /// public async Task NodeVerification(string instanceId, Tag tag) { - FlowinstanceEntity flowInstance = GetForm(instanceId).Result; + FlowinstanceEntity flowInstance = await GetForm(instanceId); + flowCreator = flowInstance.F_CreatorUserId; FlowInstanceOperationHistory flowInstanceOperationHistory = new FlowInstanceOperationHistory { F_Id = Utils.GuId(), @@ -327,7 +330,7 @@ namespace WaterCloud.Service.FlowManage msg.F_EnabledMark = true; if (flowInstance.F_IsFinish == 1) { - msg.F_MessageInfo = flowInstance.F_CustomName + "--流程已完成"; + msg.F_MessageInfo = flowInstance.F_CustomName + "--流程已完成"; var module = uniwork.IQueryable(a => a.F_EnCode == className.Substring(0, className.Length - 7)).FirstOrDefault(); msg.F_Href = module.F_UrlAddress; msg.F_HrefTarget = module.F_Target; @@ -335,7 +338,7 @@ namespace WaterCloud.Service.FlowManage msg.F_ClickRead = true; msg.F_KeyValue = flowInstance.F_Id; } - else if(flowInstance.F_IsFinish == 3) + else if (flowInstance.F_IsFinish == 3) { msg.F_MessageInfo = flowInstance.F_CustomName + "--流程已终止"; var module = uniwork.IQueryable(a => a.F_EnCode == className.Substring(0, className.Length - 7)).FirstOrDefault(); @@ -504,7 +507,7 @@ namespace WaterCloud.Service.FlowManage var tempList = new List(); if (node.setInfo.NodeDesignateData.currentDepart) { - var currentDepartment = currentuser.DepartmentId.Split(',').ToList(); + var currentDepartment = uniwork.FindEntity(flowCreator).GetAwaiter().GetResult().F_DepartmentId.Split(',').ToList(); foreach (var user in temp) { var nextCurrentDepartment = user.F_DepartmentId.Split(',').ToList(); @@ -593,11 +596,11 @@ namespace WaterCloud.Service.FlowManage bool isReject = TagState.Reject.Equals((TagState)tag.Taged); if (isReject) //驳回 { - await NodeReject(entity); + await NodeReject(entity); } else { - await NodeVerification(entity.F_FlowInstanceId, tag); + await NodeVerification(entity.F_FlowInstanceId, tag); } await CacheHelper.Remove(cacheKey + entity.F_FlowInstanceId); await CacheHelper.Remove(cacheKey + "list"); @@ -641,6 +644,7 @@ namespace WaterCloud.Service.FlowManage entity.F_DbName = form.F_WebId; entity.F_FlowLevel = 0; entity.Create(); + flowCreator = currentuser.UserId; //创建运行实例 var wfruntime = new FlowRuntime(entity); var user = currentuser; @@ -663,7 +667,7 @@ namespace WaterCloud.Service.FlowManage var path = AppDomain.CurrentDomain.RelativeSearchPath ?? AppDomain.CurrentDomain.BaseDirectory; var referencedAssemblies = Directory.GetFiles(path, "*.dll").Select(Assembly.LoadFrom).ToArray(); var t = referencedAssemblies - .SelectMany(a => a.GetTypes().Where(t => t.FullName.Contains("WaterCloud.Service.") && t.FullName.Contains("."+entity.F_DbName + "Service"))).FirstOrDefault(); + .SelectMany(a => a.GetTypes().Where(t => t.FullName.Contains("WaterCloud.Service.") && t.FullName.Contains("." + entity.F_DbName + "Service"))).FirstOrDefault(); ICustomerForm icf = (ICustomerForm)GlobalContext.ServiceProvider.GetService(t); await icf.Add(entity.F_Id, entity.F_FrmData); } @@ -759,6 +763,7 @@ namespace WaterCloud.Service.FlowManage entity.F_InstanceSchemeId = ""; entity.F_DbName = form.F_WebId; entity.F_FlowLevel = 0; + flowCreator = currentuser.UserId; //创建运行实例 wfruntime = new FlowRuntime(entity); @@ -781,7 +786,7 @@ namespace WaterCloud.Service.FlowManage var path = AppDomain.CurrentDomain.RelativeSearchPath ?? AppDomain.CurrentDomain.BaseDirectory; var referencedAssemblies = Directory.GetFiles(path, "*.dll").Select(Assembly.LoadFrom).ToArray(); var t = referencedAssemblies - .SelectMany(a => a.GetTypes().Where(t => t.FullName.Contains("WaterCloud.Service.") && t.FullName.Contains("."+entity.F_DbName + "Service"))).FirstOrDefault(); + .SelectMany(a => a.GetTypes().Where(t => t.FullName.Contains("WaterCloud.Service.") && t.FullName.Contains("." + entity.F_DbName + "Service"))).FirstOrDefault(); ICustomerForm icf = (ICustomerForm)GlobalContext.ServiceProvider.GetService(t); await icf.Edit(entity.F_Id, entity.F_FrmData); } @@ -862,7 +867,7 @@ namespace WaterCloud.Service.FlowManage }); foreach (var item in ids) { - await CacheHelper.Remove(cacheKey + item); + await CacheHelper.Remove(cacheKey + item); } await CacheHelper.Remove(cacheKey + "list"); } -- Gitee From bb7b60e7b9d899ef44cae0d90946b20a217ffa87 Mon Sep 17 00:00:00 2001 From: MonstorUncle <295228902@qq.com> Date: Fri, 18 Dec 2020 12:19:43 +0800 Subject: [PATCH 3/4] =?UTF-8?q?1.8.0=20ResultDTree=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E6=94=B9=E6=88=90DTreeResult=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Areas/SystemManage/Controllers/FlowschemeController.cs | 2 +- .../Areas/SystemManage/Controllers/ItemsTypeController.cs | 2 +- .../Areas/SystemManage/Controllers/ModuleButtonController.cs | 2 +- .../Areas/SystemManage/Controllers/ModuleFieldsController.cs | 2 +- .../SystemOrganize/Controllers/RoleAuthorizeController.cs | 4 ++-- WaterCloud.Web/Controllers/ControllerBase.cs | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/WaterCloud.Web/Areas/SystemManage/Controllers/FlowschemeController.cs b/WaterCloud.Web/Areas/SystemManage/Controllers/FlowschemeController.cs index 06c392ee..9ee1808c 100644 --- a/WaterCloud.Web/Areas/SystemManage/Controllers/FlowschemeController.cs +++ b/WaterCloud.Web/Areas/SystemManage/Controllers/FlowschemeController.cs @@ -55,7 +55,7 @@ namespace WaterCloud.Web.Areas.SystemManage.Controllers treeModel.self = item; treeList.Add(treeModel); } - return ResultDTree(treeList.TreeList()); + return DTreeResult(treeList.TreeList()); } [HttpGet] [HandlerAjaxOnly] diff --git a/WaterCloud.Web/Areas/SystemManage/Controllers/ItemsTypeController.cs b/WaterCloud.Web/Areas/SystemManage/Controllers/ItemsTypeController.cs index 5578985f..917665f4 100644 --- a/WaterCloud.Web/Areas/SystemManage/Controllers/ItemsTypeController.cs +++ b/WaterCloud.Web/Areas/SystemManage/Controllers/ItemsTypeController.cs @@ -78,7 +78,7 @@ namespace WaterCloud.Web.Areas.SystemManage.Controllers //treeModel.self = item; treeList.Add(treeModel); } - return ResultDTree(treeList.TreeList()); + return DTreeResult(treeList.TreeList()); } [HttpGet] [HandlerAjaxOnly] diff --git a/WaterCloud.Web/Areas/SystemManage/Controllers/ModuleButtonController.cs b/WaterCloud.Web/Areas/SystemManage/Controllers/ModuleButtonController.cs index 8ca75364..a772749c 100644 --- a/WaterCloud.Web/Areas/SystemManage/Controllers/ModuleButtonController.cs +++ b/WaterCloud.Web/Areas/SystemManage/Controllers/ModuleButtonController.cs @@ -123,7 +123,7 @@ namespace WaterCloud.Web.Areas.SystemManage.Controllers //treeModel.self = item; treeList.Add(treeModel); } - return ResultDTree(treeList.TreeList()); + return DTreeResult(treeList.TreeList()); } [HttpPost] [HandlerAjaxOnly] diff --git a/WaterCloud.Web/Areas/SystemManage/Controllers/ModuleFieldsController.cs b/WaterCloud.Web/Areas/SystemManage/Controllers/ModuleFieldsController.cs index bbcdc3a0..d5525d86 100644 --- a/WaterCloud.Web/Areas/SystemManage/Controllers/ModuleFieldsController.cs +++ b/WaterCloud.Web/Areas/SystemManage/Controllers/ModuleFieldsController.cs @@ -126,7 +126,7 @@ namespace WaterCloud.Web.Areas.SystemManage.Controllers //treeModel.self = item; treeList.Add(treeModel); } - return ResultDTree(treeList.TreeList()); + return DTreeResult(treeList.TreeList()); } [HttpPost] [HandlerAjaxOnly] diff --git a/WaterCloud.Web/Areas/SystemOrganize/Controllers/RoleAuthorizeController.cs b/WaterCloud.Web/Areas/SystemOrganize/Controllers/RoleAuthorizeController.cs index f3b0bd42..e41e653a 100644 --- a/WaterCloud.Web/Areas/SystemOrganize/Controllers/RoleAuthorizeController.cs +++ b/WaterCloud.Web/Areas/SystemOrganize/Controllers/RoleAuthorizeController.cs @@ -90,7 +90,7 @@ namespace WaterCloud.Web.Areas.SystemOrganize.Controllers } treeList.Add(tree); } - return ResultDTree(treeList.TreeList()); + return DTreeResult(treeList.TreeList()); } [HttpPost] [IgnoreAntiforgeryToken] @@ -169,7 +169,7 @@ namespace WaterCloud.Web.Areas.SystemOrganize.Controllers } treeList.Add(tree); } - return ResultDTree(treeList.TreeList()); + return DTreeResult(treeList.TreeList()); } } } diff --git a/WaterCloud.Web/Controllers/ControllerBase.cs b/WaterCloud.Web/Controllers/ControllerBase.cs index 59b7bc44..59200787 100644 --- a/WaterCloud.Web/Controllers/ControllerBase.cs +++ b/WaterCloud.Web/Controllers/ControllerBase.cs @@ -91,7 +91,7 @@ namespace WaterCloud.Web { return Content(new AlwaysResult { state = 0, message = "", count = total, data = data }.ToJson()); } - protected virtual ActionResult ResultDTree(object data) + protected virtual ActionResult DTreeResult(object data) { return Content(new DTreeResult { status = new StatusInfo { code = 200, message = "操作成功" }, data = data }.ToJson()); } -- Gitee From a0cb4051c7bc9b9a14999f8aa7584d7cb97e584a Mon Sep 17 00:00:00 2001 From: MonstorUncle <295228902@qq.com> Date: Fri, 18 Dec 2020 14:04:59 +0800 Subject: [PATCH 4/4] =?UTF-8?q?1.8.0=20=E6=9B=B4=E6=96=B0api=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=EF=BC=8C=E7=BD=91=E7=AB=99=E5=90=AF=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WaterCloud.WebApi/Properties/launchSettings.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WaterCloud.WebApi/Properties/launchSettings.json b/WaterCloud.WebApi/Properties/launchSettings.json index c672d337..d02b45dc 100644 --- a/WaterCloud.WebApi/Properties/launchSettings.json +++ b/WaterCloud.WebApi/Properties/launchSettings.json @@ -12,7 +12,7 @@ "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, - "launchUrl": "api-doc", + "launchUrl": "http://localhost:5001/api-doc", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, @@ -21,7 +21,7 @@ "WaterCloud.WebApi": { "commandName": "Project", "launchBrowser": true, - "launchUrl": "api-doc", + "launchUrl": "http://localhost:5001/api-doc", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, -- Gitee