From e00efde0ad66ac87adb63ca92966210190c9b99a Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Mon, 22 Aug 2022 15:39:32 +0800 Subject: [PATCH 01/20] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91?= =?UTF-8?q?=E6=AF=95=E4=B8=9A=E8=AF=81=E8=B5=84=E6=A0=BC=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=EF=BC=9A=E6=AF=95=E4=B8=9A=E6=8C=89=E9=92=AE=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E5=90=8E=E5=88=97=E8=A1=A8=E5=9B=9E=E6=98=BE?= =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/StuScore/ScoreQueryAllIndex.js | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/ScoreQueryAllIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/ScoreQueryAllIndex.js index eadcd071b..698ecee82 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/ScoreQueryAllIndex.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/ScoreQueryAllIndex.js @@ -6,6 +6,7 @@ */ var selectedRow; var refreshGirdData; +var refreshGirdData2; //课程列 var LessonTemp = []; var bootstrap = function ($, learun) { @@ -46,12 +47,8 @@ var bootstrap = function ($, learun) { learun.layerConfirm('是否准许 ' + stuName + ' 毕业?', function (res) { if (res) { learun.getForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/AllowGraduate?stuNo=' + keyValue +'&status=1', function () { - refreshGirdData(); - //$('#btn_Search').trigger('click'); + refreshGirdData2(); }); - //learun.httpAsync('get', top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/AllowGraduate', { stuNo: keyValue, status: '1' }, function () { - // $('#btn_Search').trigger('click'); - //}); } }); } @@ -64,7 +61,7 @@ var bootstrap = function ($, learun) { learun.layerConfirm('是否不准 ' + stuName + ' 毕业?', function (res) { if (res) { learun.getForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/AllowGraduate?stuNo=' + keyValue + '&status=0', function () { - $('#btn_Search').trigger('click'); + refreshGirdData2(); }); } }); @@ -185,5 +182,18 @@ var bootstrap = function ($, learun) { refreshGirdData = function () { page.search(); }; + refreshGirdData2 = function () { + var p = {}; + p.DeptNo = $('#DeptNo').lrselectGet(); + p.MajorNo = $('#MajorNo').lrselectGet(); + p.ClassNo = $('#ClassNo').lrselectGet(); + p.StuNo = $('#StuNo').lrselectGet(); + if (p.ClassNo == null || p.ClassNo == "") { + learun.alert.warning("请选择班级!"); + return; + } + //page.initGird(); + page.search(p); + }; page.init(); } From 5bd0922d1b67c1f79235eac951fa910adad23552 Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Mon, 22 Aug 2022 16:44:14 +0800 Subject: [PATCH 02/20] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91?= =?UTF-8?q?=E6=AF=95=E4=B8=9A=E8=AF=81=E7=94=9F=E6=88=90=EF=BC=9A=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E6=9F=A5=E8=AF=A2=E6=96=87=E5=AD=97=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E5=B9=B4=E7=BA=A7=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/StuInfoBasic/CreateGraduateNo.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/CreateGraduateNo.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/CreateGraduateNo.cshtml index 0ab566ca4..edfd4c6db 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/CreateGraduateNo.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/CreateGraduateNo.cshtml @@ -19,7 +19,7 @@
-
第几级
+
年级
From 66993750431e0aad0ea937a5e883122eb5df933b Mon Sep 17 00:00:00 2001 From: liangkun Date: Mon, 22 Aug 2022 18:17:39 +0800 Subject: [PATCH 03/20] =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/AnnexesApiWx.cs | 260 +++++++++--------- .../components/learun-app/upload-file.vue | 2 +- .../LearunApp-2.2.0/config.js | 4 +- 3 files changed, 133 insertions(+), 133 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/AnnexesApiWx.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/AnnexesApiWx.cs index 4795d3d47..4054c0a35 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/AnnexesApiWx.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/AnnexesApiWx.cs @@ -7,136 +7,136 @@ using System.IO; namespace Learun.Application.WebApi.Modules { - public class AnnexesApiWx : BaseApi - { - public AnnexesApiWx() - : base("/learun/adms/annexes") + public class AnnexesApiWx : BaseApi { - Get["/wxlist"] = WxGetList; - Get["/wxdown"] = WxDownload; - Get["/wxfileinfo"] = WxFileInfo; - Post["/wxupload"] = WxUpload; - Post["/wxdelete"] = WxDeleteFile; + public AnnexesApiWx() + : base("/learun/adms/annexes") + { + Get["/wxlist"] = WxGetList; + Get["/wxdown"] = WxDownload; + Get["/wxfileinfo"] = WxFileInfo; + Post["/wxupload"] = WxUpload; + Post["/wxdelete"] = WxDeleteFile; + } + private AnnexesFileIBLL annexesFileIBLL = new AnnexesFileBLL(); + + /// + /// 获取附件列表 + /// + /// + /// + public Response WxGetList(dynamic _) + { + var keyValue = this.GetReqData(); + var list = annexesFileIBLL.GetList(keyValue); + + return Success(list); + } + + /// + /// 上传附件图片文件 + /// + /// + public Response WxUpload(dynamic _) + { + var files = (List)this.Context.Request.Files; + //var folderId = this.GetReqData(); + string folderId = Guid.NewGuid().ToString(); + string filePath = Config.GetValue("AnnexesFile"); + string uploadDate = DateTime.Now.ToString("yyyyMMdd"); + string fileEextension = Path.GetExtension(files[0].Name); + string fileType = fileEextension.Replace(".", ""); + string fileGuid = Guid.NewGuid().ToString(); + + string virtualPath = string.Format("{0}/{1}/{2}/{3}{4}", filePath, userInfo.userId, uploadDate, fileGuid, fileEextension); + + //创建文件夹 + string path = Path.GetDirectoryName(virtualPath); + Directory.CreateDirectory(path); + AnnexesFileEntity fileAnnexesEntity = new AnnexesFileEntity(); + if (!System.IO.File.Exists(virtualPath)) + { + byte[] bytes = new byte[files[0].Value.Length]; + files[0].Value.Read(bytes, 0, bytes.Length); + FileInfo file = new FileInfo(virtualPath); + FileStream fs = file.Create(); + fs.Write(bytes, 0, bytes.Length); + fs.Close(); + + //文件信息写入数据库 + fileAnnexesEntity.F_Id = fileGuid; + fileAnnexesEntity.F_FileName = files[0].Name; + fileAnnexesEntity.F_FilePath = virtualPath; + fileAnnexesEntity.F_FileSize = files[0].Value.Length.ToString(); + fileAnnexesEntity.F_FileExtensions = fileEextension; + fileAnnexesEntity.F_FileType = fileType; + fileAnnexesEntity.F_CreateUserId = userInfo.userId; + fileAnnexesEntity.F_CreateUserName = userInfo.realName; + + annexesFileIBLL.SaveEntity(folderId, fileAnnexesEntity); + } + + return SuccessString(folderId); + } + + /// + /// 获取文件信息 + /// + /// + /// + public Response WxFileInfo(dynamic _) + { + var fileId = this.GetReqData(); + var fileEntity = annexesFileIBLL.GetEntity(fileId); + + return Success(fileEntity); + } + + /// + /// 删除文件 + /// + /// + /// + public Response WxDeleteFile(dynamic _) + { + var fileId = this.GetReqData(); + AnnexesFileEntity fileInfoEntity = annexesFileIBLL.GetEntity(fileId); + annexesFileIBLL.DeleteEntity(fileId); + //删除文件 + if (System.IO.File.Exists(fileInfoEntity.F_FilePath)) + { + System.IO.File.Delete(fileInfoEntity.F_FilePath); + } + + return Success("删除成功"); + } + + /// + /// 下载文件,微信小程序用 + /// + /// 微信小程序可以预览图片、文档 + /// 支持的图片格式:.jpg .png .webp .gif + /// 支持的文档格式:.doc(x) .xls(x) .ppt(x) .pdf + /// + /// 对于其他格式的文件,微信小程序官方未提供打开或预览的 API,文件对用户来说不可访问 + /// + /// + /// + public Response WxDownload(dynamic _) + { + string name = this.GetReqData(); + string fileId = name.Split('.')[0]; + var fileEntity = annexesFileIBLL.GetEntity(fileId); + string filepath = fileEntity.F_FilePath; + + if (!FileDownHelper.FileExists(filepath)) + { + return 404; + } + + FileDownHelper.DownLoadWx(filepath, fileEntity.F_FileType); + + return Success(""); + } } - private AnnexesFileIBLL annexesFileIBLL = new AnnexesFileBLL(); - - /// - /// 获取附件列表 - /// - /// - /// - public Response WxGetList(dynamic _) - { - var keyValue = this.GetReqData(); - var list = annexesFileIBLL.GetList(keyValue); - - return Success(list); - } - - /// - /// 上传附件图片文件 - /// - /// - public Response WxUpload(dynamic _) - { - var files = (List)this.Context.Request.Files; - var folderId = this.GetReqData(); - - string filePath = Config.GetValue("AnnexesFile"); - string uploadDate = DateTime.Now.ToString("yyyyMMdd"); - string fileEextension = Path.GetExtension(files[0].Name); - string fileType = fileEextension.Replace(".", ""); - string fileGuid = Guid.NewGuid().ToString(); - - string virtualPath = string.Format("{0}/{1}/{2}/{3}{4}", filePath, userInfo.userId, uploadDate, fileGuid, fileEextension); - - //创建文件夹 - string path = Path.GetDirectoryName(virtualPath); - Directory.CreateDirectory(path); - AnnexesFileEntity fileAnnexesEntity = new AnnexesFileEntity(); - if (!System.IO.File.Exists(virtualPath)) - { - byte[] bytes = new byte[files[0].Value.Length]; - files[0].Value.Read(bytes, 0, bytes.Length); - FileInfo file = new FileInfo(virtualPath); - FileStream fs = file.Create(); - fs.Write(bytes, 0, bytes.Length); - fs.Close(); - - //文件信息写入数据库 - fileAnnexesEntity.F_Id = fileGuid; - fileAnnexesEntity.F_FileName = files[0].Name; - fileAnnexesEntity.F_FilePath = virtualPath; - fileAnnexesEntity.F_FileSize = files[0].Value.Length.ToString(); - fileAnnexesEntity.F_FileExtensions = fileEextension; - fileAnnexesEntity.F_FileType = fileType; - fileAnnexesEntity.F_CreateUserId = userInfo.userId; - fileAnnexesEntity.F_CreateUserName = userInfo.realName; - - annexesFileIBLL.SaveEntity(folderId, fileAnnexesEntity); - } - - return SuccessString(fileGuid); - } - - /// - /// 获取文件信息 - /// - /// - /// - public Response WxFileInfo(dynamic _) - { - var fileId = this.GetReqData(); - var fileEntity = annexesFileIBLL.GetEntity(fileId); - - return Success(fileEntity); - } - - /// - /// 删除文件 - /// - /// - /// - public Response WxDeleteFile(dynamic _) - { - var fileId = this.GetReqData(); - AnnexesFileEntity fileInfoEntity = annexesFileIBLL.GetEntity(fileId); - annexesFileIBLL.DeleteEntity(fileId); - //删除文件 - if (System.IO.File.Exists(fileInfoEntity.F_FilePath)) - { - System.IO.File.Delete(fileInfoEntity.F_FilePath); - } - - return Success("删除成功"); - } - - /// - /// 下载文件,微信小程序用 - /// - /// 微信小程序可以预览图片、文档 - /// 支持的图片格式:.jpg .png .webp .gif - /// 支持的文档格式:.doc(x) .xls(x) .ppt(x) .pdf - /// - /// 对于其他格式的文件,微信小程序官方未提供打开或预览的 API,文件对用户来说不可访问 - /// - /// - /// - public Response WxDownload(dynamic _) - { - string name = this.GetReqData(); - string fileId = name.Split('.')[0]; - var fileEntity = annexesFileIBLL.GetEntity(fileId); - string filepath = fileEntity.F_FilePath; - - if (!FileDownHelper.FileExists(filepath)) - { - return 404; - } - - FileDownHelper.DownLoadWx(filepath, fileEntity.F_FileType); - - return Success(""); - } - } } \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-app/upload-file.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-app/upload-file.vue index 969f835be..e2300312a 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-app/upload-file.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-app/upload-file.vue @@ -89,7 +89,7 @@ export default { // #endif // #ifndef MP-DINGTALK - uni.chooseImage({ + uni.chooseFile({ count: Number(this.number), sizeType: ['original', 'compressed'], sourceType: ['album', 'camera'], diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js index c0c228cb7..7670bf973 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js @@ -21,8 +21,8 @@ export default { // "http://192.168.2.98:8088/" // ], "apiHost": [ - "http://localhost:31173/" - // "http://192.168.10.85:8088/" + // "http://localhost:31173/" + "http://192.168.10.68:8002/" ], "webHost":"http://localhost:20472/", // 开发环境下自动填充登录账号密码,与接口地址一一对应,只在开发环境下显示 From 8f434f94129479e860ee84a1422f8981384c95a2 Mon Sep 17 00:00:00 2001 From: ndbs Date: Tue, 23 Aug 2022 09:53:12 +0800 Subject: [PATCH 04/20] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=AE=A1=E7=90=86--=E7=8F=AD=E4=B8=BB=E4=BB=BB=E8=AE=BE?= =?UTF-8?q?=E4=B8=BA=E5=BF=85=E5=A1=AB=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EducationalAdministration/Views/ClassInfo/Form.cshtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassInfo/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassInfo/Form.cshtml index abf2c24ad..9c0c6407f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassInfo/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassInfo/Form.cshtml @@ -32,8 +32,8 @@
-
班主任
-
+
班主任*
+
辅导员
From a51a3f15334163a715bdb64095934293b6dbcbe9 Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Tue, 23 Aug 2022 10:08:02 +0800 Subject: [PATCH 05/20] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E5=A5=96=E5=8A=B1=E7=AE=A1=E7=90=86=E3=80=81?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E5=A4=84=E5=88=86=E7=AE=A1=E7=90=86=EF=BC=9A?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=A4=9A=E6=9D=A1=E4=BB=B6=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/StuEncourgement/Index.cshtml | 22 +++++++++++++++++++ .../Views/StuEncourgement/Index.js | 3 +++ .../Views/StuPunishment/Index.cshtml | 22 +++++++++++++++++++ .../Views/StuPunishment/Index.js | 5 +++++ .../StuEncourgement/StuEncourgementService.cs | 10 +++++++++ .../StuPunishment/StuPunishmentService.cs | 11 ++++++++++ 6 files changed, 73 insertions(+) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEncourgement/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEncourgement/Index.cshtml index 82c9e514b..48982f154 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEncourgement/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEncourgement/Index.cshtml @@ -7,6 +7,28 @@
+
+
+
+
+
学号
+ +
+
+
姓名
+ +
+
+
奖励名称
+ +
+
+
奖励日期
+ +
+
+
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEncourgement/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEncourgement/Index.js index 1960822bb..8b5acb4bb 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEncourgement/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEncourgement/Index.js @@ -13,6 +13,9 @@ var bootstrap = function ($, learun) { page.bind(); }, bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 300, 400); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.cshtml index ca70f343d..67c53874f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.cshtml @@ -7,6 +7,28 @@
+
+
+
+
+
学号
+ +
+
+
姓名
+ +
+
+
处分名称
+
+
+
+
处分日期
+ +
+
+
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.js index beac0586f..9562bac1f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.js @@ -13,6 +13,11 @@ var bootstrap = function ($, learun) { page.bind(); }, bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 300, 400); + $('#PunishNo').lrDataItemSelect({ code: 'Punishment' }); + // 刷新 $('#lr_refresh').on('click', function () { location.reload(); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEncourgement/StuEncourgementService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEncourgement/StuEncourgementService.cs index 3157c8526..3f3de8b01 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEncourgement/StuEncourgementService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEncourgement/StuEncourgementService.cs @@ -77,6 +77,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); strSql.Append(" AND t.ClassNo = @ClassNo "); } + if (!queryParam["EncourgeName"].IsEmpty()) + { + dp.Add("EncourgeName", "%" + queryParam["EncourgeName"].ToString() + "%", DbType.String); + strSql.Append(" AND t.EncourgeName Like @EncourgeName "); + } + if (!queryParam["EncourgeDate"].IsEmpty()) + { + dp.Add("EncourgeDate", queryParam["EncourgeDate"].ToString(), DbType.String); + strSql.Append(" AND t.EncourgeDate = @EncourgeDate "); + } return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuPunishment/StuPunishmentService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuPunishment/StuPunishmentService.cs index 2193eb19f..2ec5e0fa2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuPunishment/StuPunishmentService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuPunishment/StuPunishmentService.cs @@ -71,6 +71,17 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); strSql.Append(" AND t.ClassNo = @ClassNo "); } + + if (!queryParam["PunishNo"].IsEmpty()) + { + dp.Add("PunishNo", queryParam["PunishNo"].ToString(), DbType.String); + strSql.Append(" AND t.PunishNo = @PunishNo "); + } + if (!queryParam["PunishDate"].IsEmpty()) + { + dp.Add("PunishDate", queryParam["PunishDate"].ToString(), DbType.String); + strSql.Append(" AND t.PunishDate = @PunishDate "); + } return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) From 90a887d52d8062dc3a3cbbfa5ce251347707cad0 Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Tue, 23 Aug 2022 10:17:34 +0800 Subject: [PATCH 06/20] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91?= =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E4=BF=A1=E6=81=AF=E7=AE=A1=E7=90=86=EF=BC=9A?= =?UTF-8?q?=E9=9A=90=E8=97=8F=E6=8C=89=E9=92=AE=E2=80=9C=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E2=80=9D=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EducationalAdministration/Views/ClassInfo/Index.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassInfo/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassInfo/Index.cshtml index 8e87fe741..710753557 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassInfo/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassInfo/Index.cshtml @@ -47,7 +47,7 @@ @* 班级类型设定*@
From 9fbf0fe3f6124abcb3fa990294f22544a495b77c Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Tue, 23 Aug 2022 10:40:58 +0800 Subject: [PATCH 07/20] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91?= =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E5=AD=A6=E7=B1=8D=E7=AE=A1=E7=90=86=EF=BC=9A?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E6=95=99=E5=B8=88=E7=99=BB=E5=BD=95=EF=BC=8C?= =?UTF-8?q?=E4=B8=80=E5=BC=80=E5=A7=8B=E4=B8=8D=E5=B1=95=E7=A4=BA=E6=89=80?= =?UTF-8?q?=E6=9C=89=E5=AD=A6=E7=94=9F=E5=88=97=E8=A1=A8=EF=BC=8C=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E7=8F=AD=E7=BA=A7=E5=90=8E=E6=89=8D=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/StuInfoBasic/MyClass.cshtml | 4 ++-- .../Views/StuInfoBasic/MyClass.js | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/MyClass.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/MyClass.cshtml index 1ffd38a1c..55fb56213 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/MyClass.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/MyClass.cshtml @@ -5,14 +5,14 @@
-
树形列表
+
班级列表
- 列表信息 + 学生列表信息
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/MyClass.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/MyClass.js index eca5946ba..fd03c5138 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/MyClass.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/MyClass.js @@ -48,7 +48,8 @@ var bootstrap = function ($, learun) { label: "出生日期", name: "Birthday", width: 100, align: "left", formatter: function (cellvalue) { return learun.formatDate(cellvalue, 'yyyy-MM-dd'); - } }, + } + }, { label: "身份证号", name: "IdentityCardNo", width: 150, align: "left" }, { label: "民族", name: "NationalityNo", width: 100, align: "left", @@ -170,6 +171,12 @@ var bootstrap = function ($, learun) { page.search(); }, search: function (param) { + if (learun.clientdata.get(['userinfo']).account.toLowerCase() != "system") {//登录用户是system时,列表展示所有学生;其他用户登录时,必须选择左侧班级才能查看学生; + if (Class == "" || Class == undefined || Class == null) { + learun.alert.warning("请选择左侧班级!"); + return false; + } + } param = param || {}; param.ClassNo = Class; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); From c42a49786bff2c2257f90f58716ae9456fa24711 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Tue, 23 Aug 2022 10:46:58 +0800 Subject: [PATCH 08/20] =?UTF-8?q?=E6=99=BA=E6=85=A7=E5=A4=A7=E8=84=91?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E6=95=B0=E6=8D=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DataCollection/DataCollectionService.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionService.cs index c24eb19b4..0beba6344 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionService.cs @@ -78,9 +78,12 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop var login_res_str = HttpMethods.Get(login_url); var login_res = JsonConvert.DeserializeObject(login_res_str); var login_data = login_res.data; - _redis.Write($"access_token", ((dynamic)login_data)?.access_token, TimeSpan.FromSeconds(200)); - _redis.Write($"client_secret", ((dynamic)login_data)?.client_secret, TimeSpan.FromSeconds(160000)); - _redis.Write($"refresh_token", ((dynamic)login_data)?.refresh_token, TimeSpan.FromSeconds(250)); + string access_token = ((dynamic)login_data)?.access_token; + string client_secret = ((dynamic)login_data)?.client_secret; + string refresh_token = ((dynamic)login_data)?.refresh_token; + _redis.Write($"access_token", access_token, TimeSpan.FromSeconds(200)); + _redis.Write($"client_secret", client_secret, TimeSpan.FromSeconds(160000)); + _redis.Write($"refresh_token", refresh_token, TimeSpan.FromSeconds(250)); } /// /// 刷新token @@ -101,8 +104,10 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop login(); return; } - _redis.Write($"access_token", ((dynamic)refresh_res)?.access_token, TimeSpan.FromSeconds(200)); - _redis.Write($"refresh_token", ((dynamic)refresh_res)?.refresh_token, TimeSpan.FromSeconds(250)); + string atoken = ((dynamic)refresh_res)?.access_token; + string rtoken = ((dynamic)refresh_res)?.refresh_token; + _redis.Write($"access_token", atoken, TimeSpan.FromSeconds(200)); + _redis.Write($"refresh_token", rtoken, TimeSpan.FromSeconds(250)); } /// /// 校区基础数据 From 6551e3f63f27c5cba9c1c718f7784fd36eaa1a4e Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Tue, 23 Aug 2022 11:05:23 +0800 Subject: [PATCH 09/20] =?UTF-8?q?=E6=99=BA=E6=85=A7=E5=A4=A7=E8=84=91?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LR_Desktop/DataCollection/DataCollectionService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionService.cs index 0beba6344..5886d116a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionService.cs @@ -44,8 +44,8 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop { try { - var refresh_token = _redis.Read("refresh_token"); - var access_token = _redis.Read("access_token"); + var refresh_token = _redis.Read("refresh_token") == "null" ? "" : _redis.Read("refresh_token"); + var access_token = _redis.Read("access_token") == "null" ? "" : _redis.Read("access_token"); if (string.IsNullOrEmpty(refresh_token) || string.IsNullOrEmpty(_redis.Read("access_token"))) { //用户授权 @@ -75,7 +75,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop private void login() { var login_url = InsUrl + "/prod-api/api/web/collect/oauth2/login?grant_type=password&client_id=" + client_id + "&username=" + username + "&password=" + password; - var login_res_str = HttpMethods.Get(login_url); + var login_res_str = HttpMethods.Post(login_url); var login_res = JsonConvert.DeserializeObject(login_res_str); var login_data = login_res.data; string access_token = ((dynamic)login_data)?.access_token; @@ -95,7 +95,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop var refresh_url = InsUrl + "/prod-api/api/web/collect/oauth2/refresh?grant_type=refresh_token&client_id=" + client_id + "&client_secret=" + client_secret + "&refresh_token=" + refresh_token; - var refresh_res_str = HttpMethods.Get(refresh_url); + var refresh_res_str = HttpMethods.Post(refresh_url); var refresh_res = JsonConvert.DeserializeObject(refresh_res_str); if (refresh_res == null || ((dynamic)refresh_res)?.code != 200) { From 1a30ef6ca5f22563a29a44a992c40e9e286eca3c Mon Sep 17 00:00:00 2001 From: ndbs Date: Tue, 23 Aug 2022 11:36:10 +0800 Subject: [PATCH 10/20] =?UTF-8?q?=E4=B8=80=E5=8D=A1=E9=80=9A=E6=B5=81?= =?UTF-8?q?=E6=B0=B4=20=E6=8E=92=E5=BA=8F;=E8=B6=85=E7=BA=A7=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=91=98=E6=9F=A5=E7=9C=8B=E4=B8=80=E5=8D=A1=E9=80=9A?= =?UTF-8?q?=E6=B5=81=E6=B0=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/MealCardRunTabApi.cs | 1 + .../MealCardRunTab/MealCardRunTabService.cs | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/MealCardRunTabApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/MealCardRunTabApi.cs index cfb5eaa8a..cf057c78d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/MealCardRunTabApi.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/MealCardRunTabApi.cs @@ -48,6 +48,7 @@ namespace Learun.Application.WebApi { ReqPageParam parameter = this.GetReqData(); var data = mealCardRunTabIBLL.GetPageList(parameter.pagination, parameter.queryJson); + data = data.OrderByDescending(x => x.centralTm); var jsonData = new { rows = data, diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MealCardRunTab/MealCardRunTabService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MealCardRunTab/MealCardRunTabService.cs index e9c8d7aa8..f4447cc5e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MealCardRunTab/MealCardRunTabService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MealCardRunTab/MealCardRunTabService.cs @@ -164,11 +164,19 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } if (!queryParam["accountName"].IsEmpty()) { - var IsPhone = queryParam["IsPhone"].ToString(); - if (IsPhone == "0") + var IsPhone = ""; + if (!queryParam["IsPhone"].IsEmpty()) { - dp.Add("accountName", queryParam["accountName"].ToString(), DbType.String); - strSql.Append(" AND t.accountName = @accountName "); + IsPhone = queryParam["IsPhone"].ToString(); + if (IsPhone == "0") + { + var accountName = queryParam["accountName"].ToString(); + if (accountName != "超级管理员") + { + dp.Add("accountName", queryParam["accountName"].ToString(), DbType.String); + strSql.Append(" AND t.accountName = @accountName "); + } + } } else { From 2ee349df232b958e6a070e0ec9a739bb2a6e96f0 Mon Sep 17 00:00:00 2001 From: liangkun Date: Tue, 23 Aug 2022 15:19:13 +0800 Subject: [PATCH 11/20] =?UTF-8?q?=E6=89=8B=E6=9C=BA=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/AnnexesApiWx.cs | 3 +- .../LearunApp-2.2.0/common/customform.js | 576 ++++++++-------- .../LearunApp-2.2.0/common/custompage.js | 1 - .../LearunApp-2.2.0/common/mixins.js | 17 +- .../LearunApp-2.2.0/config.js | 4 +- .../LearunApp-2.2.0/pages/msg.vue | 2 +- .../LearunApp-2.2.0/pages/msg/chat.vue | 2 +- .../LearunApp-2.2.0/pages/my.vue | 2 +- .../LearunApp-2.2.0/pages/my/info.vue | 2 +- .../LearunApp-2.2.0/pages/my/qrcode.vue | 2 +- .../pages/nworkflow/myflow/single.vue | 5 - .../pages/nworkflow/releasetask/single.vue | 7 +- .../pages/nworkflow/workflow.js | 648 ++++++++++-------- 13 files changed, 683 insertions(+), 588 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/AnnexesApiWx.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/AnnexesApiWx.cs index 4054c0a35..8d754269b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/AnnexesApiWx.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/AnnexesApiWx.cs @@ -40,8 +40,7 @@ namespace Learun.Application.WebApi.Modules public Response WxUpload(dynamic _) { var files = (List)this.Context.Request.Files; - //var folderId = this.GetReqData(); - string folderId = Guid.NewGuid().ToString(); + string folderId = Request.Form["folderId"]; string filePath = Config.GetValue("AnnexesFile"); string uploadDate = DateTime.Now.ToString("yyyyMMdd"); string fileEextension = Path.GetExtension(files[0].Name); diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/customform.js b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/customform.js index 791f44fb2..55fe2542c 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/customform.js +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/customform.js @@ -24,274 +24,310 @@ import moment from 'moment' */ export default { - methods: { - /** - * 获取一个 scheme 表单项的源数据 (加载表单时使用) - * 参数: 单个 schemeItem - * - * radio、select、checkbox、layer 这四种表单项,需要加载额外的选单数据 - * 选单数据有两种获取方式: - * 1、来自数据字典: - * 数据字典在 this.GET_GLOBAL('dataDictionary') - * 表单使用的字段在 schemeItem.itemCode - * 选单数据中的 text 字段作为显示, value 字段作为值 - * - * 2、来自数据源: - * 将 schemeItem.dataSourceId 按符号「,」逗号分割为数组,分割为: [code, displayField, valueField] - * 数据源需要请求 API 来获取,请求需要带上数据源的编号 code - * displayField、valueField 分别为展示字段和值绑定字段 - * - * 选单数据有两种格式: - * 1、对于 radio、select、checkbox 来说: - * 只需要一个数组,数组形如: [{ text: '选项文字', value: '选项值' }, ...] - * 将获取的数据绑定到组件的 range 属性上即可 - * 全局数据中默认是对象形式,使用 Object.values() 转化即可 - * - * 2、对于 layer 来说: - * 返回一个对象,形如 { source, layerData, selfField } - * source: 为弹层中列出的数据,是一个数组 - * layerData: 需要在弹层窗口中展示的字段及标题文字,形如: [{ name:'要展示的字段名', label:'标题文字' }] - * selfField: 该表单值绑定哪个字段,默认为绑定到自身的字段 - */ - async getSourceData(schemeItem) { - if (['radio', 'select', 'checkbox'].includes(schemeItem.type)) { - // radio select checkbox 三种情况 - if (!schemeItem.dataSource || Number(schemeItem.dataSource) === 0) { - // dataSource 为 0,使用 clientData - return Object - .values(this.GET_GLOBAL('dataDictionary')[schemeItem.itemCode]) - .map(t => ({ value: t.value, text: t.text })) - - } else { - // dataSource 不为 0,使用数据源,需要请求接口,并且提取出显示字段和实际字段 - const [code, displayField = schemeItem.showField, valueField = schemeItem.saveField] = schemeItem.dataSourceId - .split(',') - const sourceData = await this.FETCH_DATASOURCE(code) - if (!sourceData) { return [] } - - return sourceData.data.map(t => ({ text: t[displayField], value: t[valueField] })) - } - - } else if (['layer'].includes(schemeItem.type)) { - // layer 需要更多属性 - if (!schemeItem.dataSource || Number(schemeItem.dataSource) === 0) { - // dataSource 为 0,使用 clientData - // clientData 对象转数组后,隐含 key:item.text 和 value:item.value 的关系 - const [keyItem, valueItem] = schemeItem.layerData - const source = Object - .values(this.GET_GLOBAL('dataDictionary')[schemeItem.itemCode]) - .map(t => ({ value: t.value, text: t.text })) - - return { - source, - layerData: [ - { name: 'text', label: keyItem.label || '', value: keyItem.value || '' }, - { name: 'value', label: valueItem.label || '', value: valueItem.value || '' } - ] - } - } else { - // dataSource 不为 0,使用数据源,需要请求接口,并且提取出显示字段和实际字段 - const [code] = schemeItem.dataSourceId.split(',') - const sourceData = await this.FETCH_DATASOURCE(code) - if (!sourceData) { return [] } - - const source = sourceData.data - - return { source, layerData: schemeItem.layerData.filter(t => (!t.hide) && (t.value || t.label)) } - } - } - - return [] - }, - - /** - * 获取一个 scheme 表单项的默认值 (用户新建表单时使用,或是编辑草稿) - * 参数: 单个 schemeItem , { processId } - * - * 每种类别的表单项分别获取的默认值: - * - * currentInfo: 根据类别取当前用户/部门/公司/时间日期 - * datetime: 根据 dfValue 字段表示昨天/今天/明天,格式化为字符串 - * radio、select: 有 dfValue 则使用,否则取第一条 - * checkbox: 有 dfValue 则使用,否则为空数组 - * encode: 根据 rulecode 请求表单编码 - * upload: 空数组 - * guid: 赋值第二个参数中的 processId,但是如果在子表格中,赋空字符串 - * girdtable: 递归所有表格项 scheme 依次为它们生成默认值 - * datetimerange: 字符串 0 - */ - async getDefaultData(item, prop) { - const { processId } = prop - switch (item.type) { - case 'currentInfo': - switch (item.dataType) { - case 'user': - return this.GET_GLOBAL('loginUser').userId - case 'department': - return this.GET_GLOBAL('loginUser').departmentId - case 'company': - return this.GET_GLOBAL('loginUser').companyId - case 'time': - return moment().format('YYYY-MM-DD HH:mm:ss') - default: - return '' - } - - case 'datetime': - const datetimeFormat = item.table ? - (Number(item.dateformat) === 0 ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm:ss') : - (item.datetime === 'datetime' ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD') - const today = moment() - const dfDatetime = [ - today.subtract(1, 'day'), - today, - today.add(1, 'day') - ][Number(item.dfvalue)] || today - - return dfDatetime.format(datetimeFormat) || '' - - case 'radio': - case 'select': - const radioItem = item.__sourceData__.find(t => t.value === item.dfvalue) || item.__sourceData__[0] - return item.type === 'radio' ? radioItem.value : '' - - case 'checkbox': - if (!item.dfvalue) { - return [] - } - return item.dfvalue.split(',').filter(t => item.__sourceData__.find(s => s.value === t)) - - case 'encode': - const result = await this.FETCH_ENCODE(item.rulecode) - return result - - case 'upload': - return [] - - case 'guid': - return item.table ? processId : '' - - case 'girdtable': - const tableItemObj = {} - for (const fieldItem of item.fieldsData) { - tableItemObj[fieldItem.field] = await this.getDefaultData(fieldItem, prop) - } - return this.COPY(tableItemObj) - - case 'datetimerange': - return '0' - - default: - return item.dfvalue || '' - } - }, - - /** - * 将单条 formData 值转化为 formValue 值 (拉取表单数据时使用) - * 参数: 单个 schemeItem , 数据值 - * - * 具体执行逻辑: - * radio、select: 剔除无效值 - * checkbox: 分割成数组并剔除无效值 - * upload: 分割成数组,拉取其中所有文件的信息 - * datetime: 按照时间日期格式进行格式化字符串 - * 其他类型: 保留原值 - */ - async convertToFormValue(item, val) { - switch (item.type) { - case 'upload': - if (!val) { return [] } - const uidList = val.split(',') - const fileList = [] - - for (const uid of uidList || []) { - const fileInfo = await this.FETCH_FILEINFO(uid) - if (!fileInfo) { continue } - - const fileType = fileInfo.F_FileType - const fileSize = fileInfo.F_FileSize - - const path = this.API + '/annexes/wxdown?' + this.URL_QUERY(uid, true) - - fileList.push({ path, type: fileType, uid, size: fileSize }) - } - return fileList - - case 'select': - case 'radio': - if (!val || !item.__sourceData__.map(t => t.value).includes(val)) { - return '' - } - return val - - case 'checkbox': - const validValue = item.__sourceData__.map(t => t.value) - const checkboxVal = val.split(',') || [] - return checkboxVal.filter(t => validValue.includes(t)) - - case 'datetime': - if (!val) { - return '' - } - return moment(val).format( - Number(item.dateformat) === 0 || item.datetime === 'date' ? - 'YYYY-MM-DD' : - 'YYYY-MM-DD HH:mm:ss' - ) - - default: - return val || '' - } - }, - - /** - * 将一个 formValue 值转化为 post 提交值(提交表单数据时使用) - * 参数: 单个 schemeItem , 表单项值 , 所有 formValue , scheme - * - * 具体执行逻辑: - * checkbox: 将数组使用符号「,」逗号拼接成字符串 - * datetimerange: 获取开始日期、结束日期,计算差值天数并保留整数 - * datetime: 格式化为完整时间日期字符串 - * upload: 依次上传文件,将返回的文件 ID 使用符号「,」逗号拼接成字符串 - * 其他类型: 保留原值 - */ - async convertToPostData(item, val, formValue, scheme) { - switch (item.type) { - case 'checkbox': - return val ? val.join(',') : '' - - case 'datetimerange': - const startTime = get(formValue, scheme.find(t => t.id === item.startTime).__valuePath__, null) - const endTime = get(formValue, scheme.find(t => t.id === item.endTime).__valuePath__, null) - if (!startTime || !endTime || moment(endTime).isBefore(startTime)) { - return '' - } else { - return moment.duration(moment(endTime).diff(moment(startTime))).asDays().toFixed(0) - } - - case 'datetime': - return val ? moment(val).format('YYYY-MM-DD HH:mm:ss') : '' - - case 'upload': - const uploadUid = [] - - for (const item of val) { - if (item.uid) { - uploadUid.push(item.uid) - continue - } - - const fileId = await this.HTTP_UPLOAD(item.path||item) - if (fileId) { - uploadUid.push(fileId) - } - } - - return uploadUid.join(',') - - default: - return val || '' - } - } - } + methods: { + /** + * 获取一个 scheme 表单项的源数据 (加载表单时使用) + * 参数: 单个 schemeItem + * + * radio、select、checkbox、layer 这四种表单项,需要加载额外的选单数据 + * 选单数据有两种获取方式: + * 1、来自数据字典: + * 数据字典在 this.GET_GLOBAL('dataDictionary') + * 表单使用的字段在 schemeItem.itemCode + * 选单数据中的 text 字段作为显示, value 字段作为值 + * + * 2、来自数据源: + * 将 schemeItem.dataSourceId 按符号「,」逗号分割为数组,分割为: [code, displayField, valueField] + * 数据源需要请求 API 来获取,请求需要带上数据源的编号 code + * displayField、valueField 分别为展示字段和值绑定字段 + * + * 选单数据有两种格式: + * 1、对于 radio、select、checkbox 来说: + * 只需要一个数组,数组形如: [{ text: '选项文字', value: '选项值' }, ...] + * 将获取的数据绑定到组件的 range 属性上即可 + * 全局数据中默认是对象形式,使用 Object.values() 转化即可 + * + * 2、对于 layer 来说: + * 返回一个对象,形如 { source, layerData, selfField } + * source: 为弹层中列出的数据,是一个数组 + * layerData: 需要在弹层窗口中展示的字段及标题文字,形如: [{ name:'要展示的字段名', label:'标题文字' }] + * selfField: 该表单值绑定哪个字段,默认为绑定到自身的字段 + */ + async getSourceData(schemeItem) { + if (['radio', 'select', 'checkbox'].includes(schemeItem.type)) { + // radio select checkbox 三种情况 + if (!schemeItem.dataSource || Number(schemeItem.dataSource) === 0) { + // dataSource 为 0,使用 clientData + return Object + .values(this.GET_GLOBAL('dataDictionary')[schemeItem.itemCode]) + .map(t => ({ + value: t.value, + text: t.text + })) + + } else { + // dataSource 不为 0,使用数据源,需要请求接口,并且提取出显示字段和实际字段 + const [code, displayField = schemeItem.showField, valueField = schemeItem.saveField] = + schemeItem.dataSourceId + .split(',') + const sourceData = await this.FETCH_DATASOURCE(code) + if (!sourceData) { + return [] + } + + return sourceData.data.map(t => ({ + text: t[displayField], + value: t[valueField] + })) + } + + } else if (['layer'].includes(schemeItem.type)) { + // layer 需要更多属性 + if (!schemeItem.dataSource || Number(schemeItem.dataSource) === 0) { + // dataSource 为 0,使用 clientData + // clientData 对象转数组后,隐含 key:item.text 和 value:item.value 的关系 + const [keyItem, valueItem] = schemeItem.layerData + const source = Object + .values(this.GET_GLOBAL('dataDictionary')[schemeItem.itemCode]) + .map(t => ({ + value: t.value, + text: t.text + })) + + return { + source, + layerData: [{ + name: 'text', + label: keyItem.label || '', + value: keyItem.value || '' + }, + { + name: 'value', + label: valueItem.label || '', + value: valueItem.value || '' + } + ] + } + } else { + // dataSource 不为 0,使用数据源,需要请求接口,并且提取出显示字段和实际字段 + const [code] = schemeItem.dataSourceId.split(',') + const sourceData = await this.FETCH_DATASOURCE(code) + if (!sourceData) { + return [] + } + + const source = sourceData.data + + return { + source, + layerData: schemeItem.layerData.filter(t => (!t.hide) && (t.value || t.label)) + } + } + } + + return [] + }, + + /** + * 获取一个 scheme 表单项的默认值 (用户新建表单时使用,或是编辑草稿) + * 参数: 单个 schemeItem , { processId } + * + * 每种类别的表单项分别获取的默认值: + * + * currentInfo: 根据类别取当前用户/部门/公司/时间日期 + * datetime: 根据 dfValue 字段表示昨天/今天/明天,格式化为字符串 + * radio、select: 有 dfValue 则使用,否则取第一条 + * checkbox: 有 dfValue 则使用,否则为空数组 + * encode: 根据 rulecode 请求表单编码 + * upload: 空数组 + * guid: 赋值第二个参数中的 processId,但是如果在子表格中,赋空字符串 + * girdtable: 递归所有表格项 scheme 依次为它们生成默认值 + * datetimerange: 字符串 0 + */ + async getDefaultData(item, prop) { + const { + processId + } = prop + switch (item.type) { + case 'currentInfo': + switch (item.dataType) { + case 'user': + return this.GET_GLOBAL('loginUser').userId + case 'department': + return this.GET_GLOBAL('loginUser').departmentId + case 'company': + return this.GET_GLOBAL('loginUser').companyId + case 'time': + return moment().format('YYYY-MM-DD HH:mm:ss') + default: + return '' + } + + case 'datetime': + const datetimeFormat = item.table ? + (Number(item.dateformat) === 0 ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm:ss') : + (item.datetime === 'datetime' ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD') + const today = moment() + const dfDatetime = [ + today.subtract(1, 'day'), + today, + today.add(1, 'day') + ][Number(item.dfvalue)] || today + + return dfDatetime.format(datetimeFormat) || '' + + case 'radio': + case 'select': + const radioItem = item.__sourceData__.find(t => t.value === item.dfvalue) || item + .__sourceData__[0] + return item.type === 'radio' ? radioItem.value : '' + + case 'checkbox': + if (!item.dfvalue) { + return [] + } + return item.dfvalue.split(',').filter(t => item.__sourceData__.find(s => s.value === t)) + + case 'encode': + const result = await this.FETCH_ENCODE(item.rulecode) + return result + + case 'upload': + return [] + + case 'guid': + return item.table ? processId : '' + + case 'girdtable': + const tableItemObj = {} + for (const fieldItem of item.fieldsData) { + tableItemObj[fieldItem.field] = await this.getDefaultData(fieldItem, prop) + } + return this.COPY(tableItemObj) + + case 'datetimerange': + return '0' + + default: + return item.dfvalue || '' + } + }, + + /** + * 将单条 formData 值转化为 formValue 值 (拉取表单数据时使用) + * 参数: 单个 schemeItem , 数据值 + * + * 具体执行逻辑: + * radio、select: 剔除无效值 + * checkbox: 分割成数组并剔除无效值 + * upload: 分割成数组,拉取其中所有文件的信息 + * datetime: 按照时间日期格式进行格式化字符串 + * 其他类型: 保留原值 + */ + async convertToFormValue(item, val) { + switch (item.type) { + case 'upload': + if (!val) { + return [] + } + const uidList = val; + const fileList = [] + const wxlist = await this.FETCH_FILEList(uidList); + for (const wxfile of wxlist) { + const fileInfo = await this.FETCH_FILEINFO(wxfile.F_Id) + if (!fileInfo) { + continue + } + + const fileType = fileInfo.F_FileType + const fileSize = fileInfo.F_FileSize + + const path = this.API + '/learun/adms/annexes/wxdown?' + this.URL_QUERY(wxfile.F_Id, true) + fileList.push({ + path, + type: fileType, + uid:wxfile.F_Id, + folderId:wxfile.F_FolderId, + size: fileSize + }) + } + return fileList + + case 'select': + case 'radio': + if (!val || !item.__sourceData__.map(t => t.value).includes(val)) { + return '' + } + return val + + case 'checkbox': + const validValue = item.__sourceData__.map(t => t.value) + const checkboxVal = val.split(',') || [] + return checkboxVal.filter(t => validValue.includes(t)) + + case 'datetime': + if (!val) { + return '' + } + return moment(val).format( + Number(item.dateformat) === 0 || item.datetime === 'date' ? + 'YYYY-MM-DD' : + 'YYYY-MM-DD HH:mm:ss' + ) + + default: + return val || '' + } + }, + + /** + * 将一个 formValue 值转化为 post 提交值(提交表单数据时使用) + * 参数: 单个 schemeItem , 表单项值 , 所有 formValue , scheme + * + * 具体执行逻辑: + * checkbox: 将数组使用符号「,」逗号拼接成字符串 + * datetimerange: 获取开始日期、结束日期,计算差值天数并保留整数 + * datetime: 格式化为完整时间日期字符串 + * upload: 依次上传文件,将返回的文件 ID 使用符号「,」逗号拼接成字符串 + * 其他类型: 保留原值 + */ + async convertToPostData(item, val, formValue, scheme, guid) { + switch (item.type) { + case 'checkbox': + return val ? val.join(',') : '' + + case 'datetimerange': + const startTime = get(formValue, scheme.find(t => t.id === item.startTime).__valuePath__, null) + const endTime = get(formValue, scheme.find(t => t.id === item.endTime).__valuePath__, null) + if (!startTime || !endTime || moment(endTime).isBefore(startTime)) { + return '' + } else { + return moment.duration(moment(endTime).diff(moment(startTime))).asDays().toFixed(0) + } + + case 'datetime': + return val ? moment(val).format('YYYY-MM-DD HH:mm:ss') : '' + + case 'upload': + var uploadUid = ''; + + for (const item of val) { + if (item.uid) { + uploadUid = item.uid + continue + } + + const fileId = await this.HTTP_UPLOAD(item.path || item, undefined, guid || '') + if (fileId) { + uploadUid = fileId; + } + } + + return uploadUid; + + default: + return val || '' + } + } + } } diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/custompage.js b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/custompage.js index b48efc4f9..a1fca19e7 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/custompage.js +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/custompage.js @@ -257,7 +257,6 @@ export default { const fileSize = fileInfo.F_FileSize const path = this.API + '/learun/adms/annexes/wxdown?' + this.URL_QUERY(uid, true) - fileList.push({ path, type: fileType, uid, size: fileSize }) } return fileList diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/mixins.js b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/mixins.js index 4bbefbeea..c33aa8c52 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/mixins.js +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/mixins.js @@ -229,6 +229,14 @@ export default { return await this.HTTP_GET('learun/adms/annexes/wxfileinfo', fileId) }, + //获取文件夹下文件列表 + async FETCH_FILEList(folderId) { + if (!folderId) { + return null + } + + return await this.HTTP_GET('learun/adms/annexes/wxlist', folderId) + }, // 封装的 GET 请求,集成了验证信息 // 返回请求结果或 null @@ -258,8 +266,8 @@ export default { // url 为请求地址 // filePath 为临时文件的路径 // formData 为请求附带的提交数据 - async HTTP_UPLOAD(filePath, formData) { - const [err, res] = await this.UPLOAD('/learun/adms/annexes/wxupload', filePath, formData) + async HTTP_UPLOAD(filePath, formData,guid) { + const [err, res] = await this.UPLOAD('/learun/adms/annexes/wxupload', filePath, formData,guid) return this.handleResult(err, res) }, @@ -308,11 +316,12 @@ export default { // 返回结果是一个数组: [error, result] // error 表示错误,一般是网络错误,请求很可能根本没有发出 // result 包含 { statusCode, data } 分别表示状态码、接口返回的数据 - async UPLOAD(url, filePath, formData) { + async UPLOAD(url, filePath, formData,guid) { const uploadUrl = this.handleUrl(url) const query = { loginMark: this.getLoginMark(), - token: this.GET_GLOBAL('token') + token: this.GET_GLOBAL('token'), + folderId:guid } if (formData && typeof formData === 'object') { diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js index 7670bf973..6cf431e21 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js @@ -21,8 +21,8 @@ export default { // "http://192.168.2.98:8088/" // ], "apiHost": [ - // "http://localhost:31173/" - "http://192.168.10.68:8002/" + "http://localhost:31173/" + //"http://192.168.10.68:8002/" ], "webHost":"http://localhost:20472/", // 开发环境下自动填充登录账号密码,与接口地址一一对应,只在开发环境下显示 diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/msg.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/msg.vue index bd59cb137..58981285d 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/msg.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/msg.vue @@ -132,7 +132,7 @@ export default { return null } - return this.API + `/user/img?data=${item.F_OtherUserId}` + return this.API + `/learun/adms/user/img?data=${item.F_OtherUserId}` } }, diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/msg/chat.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/msg/chat.vue index 1b8e6bd8a..0cebe305f 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/msg/chat.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/msg/chat.vue @@ -186,7 +186,7 @@ export default { // 获取用户头像图片 url avatar(id) { - return id === this.chatUserId && this.isSystem ? null : this.API + `/user/img?data=${id}` + return id === this.chatUserId && this.isSystem ? null : this.API + `/learun/adms/user/img?data=${id}` } }, diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/my.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/my.vue index 0ae3c6381..7774d7de3 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/my.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/my.vue @@ -156,7 +156,7 @@ export default { return '' } - return this.API + `/user/img?data=${this.currentUser.userId}` + return this.API + `/learun/adms/user/img?data=${this.currentUser.userId}` } }, diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/my/info.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/my/info.vue index 1b87fb850..93b978381 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/my/info.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/my/info.vue @@ -34,7 +34,7 @@ export default { // 头像图片 url avatarSrc() { - return this.API + `/user/img?data=${this.currentUser.userId}` + return this.API + `/learun/adms/user/img?data=${this.currentUser.userId}` } } } diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/my/qrcode.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/my/qrcode.vue index 272bde806..3297a7881 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/my/qrcode.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/my/qrcode.vue @@ -30,7 +30,7 @@ export default { // 头像图片 url avatar() { - return this.API + `/user/img?data=${this.currentUser.userId}` + return this.API + `/learun/adms/user/img?data=${this.currentUser.userId}` }, // 用户公司部门 tag diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/myflow/single.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/myflow/single.vue index 565660754..3a505760c 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/myflow/single.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/myflow/single.vue @@ -95,7 +95,6 @@ export default { // t.formId 使用表单,根据这个 formId 来获取 scheme 等信息 // t.appurl 使用移动页面,直接跳转到本地的页面;表单结构等均写死在页面里 const { wfForms } = this.currentNode - console.log(wfForms); // 处理没有有效表单的情况,停止加载 if (!wfForms || wfForms.every(t => !t.formId && !t.appurl)) { @@ -144,7 +143,6 @@ export default { code: this.code, useDefault: true }) - console.log("formValue",formValue,"scheme",scheme) this.scheme = scheme this.formValue = formValue this.rel = rel @@ -152,8 +150,6 @@ export default { // 不是子流程,可以直接渲染 const schemeData = await this.fetchSchemeData(this.currentNode) const formData = await this.fetchFormData(this.currentNode, this.processId) - console.log(schemeData) - console.log(formData) const { formValue, scheme, rel } = await this.getCustomForm({ formData, schemeData, @@ -161,7 +157,6 @@ export default { processId: this.processId, code: null }) - console.log("formValue",formValue,"scheme",scheme) this.scheme = scheme this.formValue = formValue this.rel = rel diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/releasetask/single.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/releasetask/single.vue index 40d538e79..cbe42cb02 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/releasetask/single.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/releasetask/single.vue @@ -110,7 +110,9 @@ export default { this.needTitle = this.type !== 'again' && Number(currentNode.isTitle) === 1 const formData = await this.fetchFormData(currentNode, processId) + const schemeData = await this.fetchSchemeData(currentNode) + const { formValue, scheme, rel } = await this.getCustomForm({ schemeData, processId, @@ -119,14 +121,16 @@ export default { code: this.type === 'again' ? null : code, useDefault: true }) + this.rel = rel this.scheme = scheme this.formValue = formValue this.code = code this.processId = processId - +console.log(this.formValue,'=====',this.scheme ,) this.ready = true this.HIDE_LOADING() + }, // 提交草稿按钮 @@ -194,7 +198,6 @@ export default { verifyValue() { const errList = this.$refs.form.verifyValue() - console.log(errList,'errList') if (this.needTitle && !this.title) { errList.push(`流程的标题不能为空`) } diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/workflow.js b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/workflow.js index 89f253e06..54918f6f3 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/workflow.js +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/workflow.js @@ -32,301 +32,355 @@ import customForm from '@/common/customform.js' * (以上只是简单介绍;实际使用中,如果打开子流程,需要拉取父/子两个流程信息) */ export default { - mixins: [customForm], - - methods: { - /** - * 从流程信息中生成 scheme、formValue - * 参数: { schemeData (必填), processId, currentNode, formData (新建时为 null), code, useDefault } - * 返回: { scheme, formValue, rel } - * - * 参数: - * schemeData: 使用 fetchSchemeData 方法拉取到的原始 scheme 数据,未经过格式化处理 - * processId: 表单 GUID;如果是新建表单,可以用 this.GUID('-') 生成一个 - * currentNode: 使用 getCurrentNode 方法拉取到的当前节点信息,用于权限控制 - * formData: 填入表单的表单值,新建表单时此项为 null 即可 - * code: 表单编号 code,会被赋值到返回的 formValue.code;重新发起流程的场合赋 null - * useDefault: 如果 formData 中某一项为空,是否对这一项填入默认值;通常在编辑草稿时启用 - * - * 该方法返回的 scheme 项可能带有以下属性: - * __valuePath__: 表单值在 formValue 中的路径,使用 lodash 的 get、set 方法即可读写 - * __sourceData__: 表单值的选单数据 - * __defaultItem__: 类型为 girdtable 的表单项带有此属性,表示添加一行表格时候表格项的默认值 - * __schemeIndex__: (暂时用不到)表单项位于 schemeData 根级内的第几个子项中 - * __dataIndex__: (暂时用不到)表单项位于 F_Scheme.data 中的第几个子项中 - */ - async getCustomForm(prop) { - const { schemeData, formData, currentNode, code, processId, useDefault } = prop - console.log(prop,'prop') - // 处理字段之间的级联、绑定关系 - // 需要绑定 change 事件的: - // datetime: 修改后重新计算 datetimerange - // organize: 修改后重设级联到该组件的其他组件的值,user 一级无需处理 - // 需要绑定某值的: - // organize: 级联到某个组件,company 一级无需处理 - const schemeRef = {} - const refList = [] - - // 最终返回值:scheme、rel、formValue - const scheme = [] - const rel = {} - const formValue = { processId, formreq: [] } - if (code) { - formValue.code = code - } - - // 遍历 schemeData 中所有的 scheme - const schemeList = Array.isArray(schemeData) ? schemeData : Object.values(schemeData) - for (let schemeIndex = 0; schemeIndex < schemeList.length; ++schemeIndex) { - - const schemeItem = schemeList[schemeIndex] - schemeItem.F_Scheme = JSON.parse(schemeItem.F_Scheme) - // 已有表单值的时候,舍弃掉不存在表单值中的 scheme - if (formData && !formData[schemeItem.F_SchemeInfoId]) { - continue - } - - // 设置 formreq 的内容,非新建模式下需要设置 keyValue - const { formId, field } = get(currentNode, `wfForms.${schemeIndex}`, {}) - const formreqObj = { schemeInfoId: formId, processIdName: field, formData: {} } - if (formData) { - if (Object.values(get(formData, `${schemeItem.F_SchemeInfoId}`, {})).some(t => t && t.length > 0)) { - formreqObj.keyValue = processId - } - } - formValue.formreq[schemeIndex] = formreqObj - - for (let dataIndex = 0; dataIndex < schemeItem.F_Scheme.data.length; ++dataIndex) { - const { componts } = schemeItem.F_Scheme.data[dataIndex] - for (const t of componts) { - // 之后的 t 即表示每个 scheme 项 - t.__valuePath__ = `formreq.${schemeIndex}.formData.${t.id}` - // 以下两个属性暂时用不到 - t.__schemeIndex__ = schemeIndex - t.__dataIndex__ = dataIndex - - if (t.type === 'girdtable' && t.table) { - // 数据项是表格的情况 - // 先设置源数据,不然无法获取默认值 - for (const fieldItem of t.fieldsData) { - fieldItem.__sourceData__ = await this.getSourceData(fieldItem) - } - t.__defaultItem__ = await this.getDefaultData(t, prop) - if (formData) { - // 有表单值的情况,从表单值中获取数据 - const val = [] - for (const valueItem of get(formData, `${schemeItem.F_SchemeInfoId}.${t.table}`, [])) { - const tableItemValue = {} - for (const fieldItem of t.fieldsData.filter(t => t.field)) { - const formDataValue = get(valueItem, fieldItem.field.toLowerCase()) - tableItemValue[fieldItem.field] = await this.convertToFormValue(fieldItem, formDataValue) - } - - val.push(tableItemValue) - } - - // useDefault 表示在从 formData 取不到值的时候使用默认值 - if ((!val || val.length <= 0) && useDefault) { - set(formValue, t.__valuePath__, [this.COPY(t.__defaultItem__)]) - } else { - set(formValue, t.__valuePath__, val) - } - - } else { - // 无表单值的情况,默认值 - set(formValue, t.__valuePath__, [this.COPY(t.__defaultItem__)]) - } - - } else if (t.field) { - // 数据项不是表格的情况 - // 先设置源数据,不然无法获取默认值 - t.__sourceData__ = await this.getSourceData(t) - if (formData) { - // 有表单值的情况,从表单值中获取数据 - const path = `${schemeItem.F_SchemeInfoId}.${t.table}.${dataIndex}.${t.field.toLowerCase()}` - const formDataValue = get(formData, path) - - // useDefault 表示在从 formData 取不到值的时候使用默认值 - if (!formDataValue && useDefault) { - set(formValue, t.__valuePath__, await this.getDefaultData(t, prop)) - } else { - set(formValue, t.__valuePath__, await this.convertToFormValue(t, formDataValue)) - } - - } else { - // 无表单值的情况,默认值 - set(formValue, t.__valuePath__, await this.getDefaultData(t, prop)) - } - } - - // 权限控制 - const authObj = get(currentNode, `wfForms.${schemeIndex}.authorize.${t.id}`, {}) - t.edit = authObj.isEdit - if (Number(t.isHide) !== 1 && authObj.isLook !== 0) { - // 加入 scheme - scheme.push(t) - - // organize、datetime 可能作为其他 organize 或 datetimerange 的依赖项,引用它们 - if (['organize', 'datetime'].includes(t.type)) { - schemeRef[t.id] = t - } - - // datetimerange、带有 relation 级联字段的 organize,依赖其他项 - if ((t.type === 'datetimerange' && t.startTime && t.endTime) || (t.type === 'organize' && t.relation)) { - refList.push(t) - } - } - } - } - } - - // 依次处理表单关联 - refList.forEach(t => { - if (t.type === 'organize') { - // 处理组件结构级联 - // 给当前组件赋上级级联的值路径 __relationPath__ - const parent = schemeRef[t.relation] - t.__relationPath__ = parent.__valuePath__ - // 给上级级联的组件注册自动重置当前组件的 change 事件 - const relItem = { type: 'organize', id: t.id, path: t.__valuePath__ } - rel[parent.id] = rel[parent.id] ? rel[parent.id].concat(relItem) : [relItem] - - } else if (t.type === 'datetimerange') { - // 处理日期区间 - const start = schemeRef[t.startTime] - const end = schemeRef[t.endTime] - - const relItem = { - type: 'datetimerange', - path: t.__valuePath__, - id: t.id, - startPath: start.__valuePath__, - endPath: end.__valuePath__, - } - - rel[start.id] = rel[start.id] ? rel[start.id].concat(relItem) : [relItem] - rel[end.id] = rel[end.id] ? rel[end.id].concat(relItem) : [relItem] - - } - }) - - return { scheme, formValue, rel } - }, - - /** - * 获取最终需要 POST 的数据 - * 参数:formValue, scheme - * 返回:用于提交的数据 - * - * 遍历 formValue,将其中的表单值依次使用 convertToPostData 这个方法转化为提交值 - */ - async getPostData(originFormValue, scheme) { - const formValue = this.COPY(originFormValue) - - // 依次按照 scheme 项目遍历 - for (const item of scheme) { - if (item.field) { - // 不是表格的情况 - const path = item.__valuePath__ - const val = get(formValue, path) - console.log(val,'val=======') - const result = await this.convertToPostData(item, val, originFormValue, scheme) - set(formValue, path, result) - - } else if (item.table && item.fieldsData) { - // 是表格的情况 - const tableValue = get(formValue, item.__valuePath__, []) - for (let valueIndex = 0; valueIndex < tableValue.length; ++valueIndex) { - for (const schemeItem of item.fieldsData) { - const path = `${item.__valuePath__}.${valueIndex}.${schemeItem.field}` - const val = get(formValue, path) - - const result = await this.convertToPostData(schemeItem, val, originFormValue, scheme) - set(formValue, path, result) - } - } - } - } - - formValue.formreq.forEach(t => { t.formData = JSON.stringify(t.formData) }) - formValue.formreq = JSON.stringify(formValue.formreq) - - return formValue - }, - - /** - * 获取流程信息 - * 参数: { code, processId, taskId } - * - */ - async fetchProcessInfo({ code, processId, taskId }) { - const url = processId ? 'learun/adms/newwf/processinfo' : 'learun/adms/newwf/scheme' - const reqObj = { processId } - if (taskId) { - reqObj.taskId = taskId - } - const data = processId ? reqObj : code - const result = await this.HTTP_GET(url, data) - - if (!result) { return {} } - - if (result.info) { - result.info.Scheme = JSON.parse(result.info.Scheme) - } else if (result.F_Content) { - result.F_Content = JSON.parse(result.F_Content) - } - - return result - }, - - /** - * 从 processInfo 流程信息中,提取出 currentNode - * 参数: processInfo - * - */ - getCurrentNode(processInfo) { - if (processInfo.info) { - return processInfo.info.Scheme.nodes.find(t => t.id === processInfo.info.CurrentNodeId) - } else if (processInfo.F_Content) { - return processInfo.F_Content.nodes.find(t => t.type === 'startround') - } - - return {} - }, - - /** - * 拉取表单的 schemeData - * 参数: currentNode - * - * 从当前节点 currentNode 中提取出表单 id,然后自 API 地址 /form/scheme 中拉取表单数据并返回 - */ - async fetchSchemeData(currentNode, currentTask, type) { - const { wfForms } = currentNode - - const data = wfForms.filter(t => t.formId).map(t => ({ id: t.formId, ver: '' })) - const schemeData = await this.HTTP_GET('learun/adms/form/scheme', data) - - return schemeData || {} - }, - - /** - * 拉取表单的 formData - * 参数: currentNode, keyValue - * - * 提取当前节点信息、表单主键信息,从 API 地址 /form/data 中拉取表单数据 - */ - async fetchFormData({ wfForms }, keyValue) { - const reqData = wfForms - .filter(t => t.formId) - .map(t => ({ - schemeInfoId: t.formId, - processIdName: t.field, - keyValue - })) - - const formData = await this.HTTP_GET('learun/adms/form/data', reqData) - - return formData || {} - } - } + mixins: [customForm], + + methods: { + /** + * 从流程信息中生成 scheme、formValue + * 参数: { schemeData (必填), processId, currentNode, formData (新建时为 null), code, useDefault } + * 返回: { scheme, formValue, rel } + * + * 参数: + * schemeData: 使用 fetchSchemeData 方法拉取到的原始 scheme 数据,未经过格式化处理 + * processId: 表单 GUID;如果是新建表单,可以用 this.GUID('-') 生成一个 + * currentNode: 使用 getCurrentNode 方法拉取到的当前节点信息,用于权限控制 + * formData: 填入表单的表单值,新建表单时此项为 null 即可 + * code: 表单编号 code,会被赋值到返回的 formValue.code;重新发起流程的场合赋 null + * useDefault: 如果 formData 中某一项为空,是否对这一项填入默认值;通常在编辑草稿时启用 + * + * 该方法返回的 scheme 项可能带有以下属性: + * __valuePath__: 表单值在 formValue 中的路径,使用 lodash 的 get、set 方法即可读写 + * __sourceData__: 表单值的选单数据 + * __defaultItem__: 类型为 girdtable 的表单项带有此属性,表示添加一行表格时候表格项的默认值 + * __schemeIndex__: (暂时用不到)表单项位于 schemeData 根级内的第几个子项中 + * __dataIndex__: (暂时用不到)表单项位于 F_Scheme.data 中的第几个子项中 + */ + async getCustomForm(prop) { + const { + schemeData, + formData, + currentNode, + code, + processId, + useDefault + } = prop + // 处理字段之间的级联、绑定关系 + // 需要绑定 change 事件的: + // datetime: 修改后重新计算 datetimerange + // organize: 修改后重设级联到该组件的其他组件的值,user 一级无需处理 + // 需要绑定某值的: + // organize: 级联到某个组件,company 一级无需处理 + const schemeRef = {} + const refList = [] + + // 最终返回值:scheme、rel、formValue + const scheme = [] + const rel = {} + const formValue = { + processId, + formreq: [] + } + if (code) { + formValue.code = code + } + + // 遍历 schemeData 中所有的 scheme + const schemeList = Array.isArray(schemeData) ? schemeData : Object.values(schemeData) + for (let schemeIndex = 0; schemeIndex < schemeList.length; ++schemeIndex) { + + const schemeItem = schemeList[schemeIndex] + schemeItem.F_Scheme = JSON.parse(schemeItem.F_Scheme) + // 已有表单值的时候,舍弃掉不存在表单值中的 scheme + if (formData && !formData[schemeItem.F_SchemeInfoId]) { + continue + } + + // 设置 formreq 的内容,非新建模式下需要设置 keyValue + const { + formId, + field + } = get(currentNode, `wfForms.${schemeIndex}`, {}) + const formreqObj = { + schemeInfoId: formId, + processIdName: field, + formData: {} + } + if (formData) { + if (Object.values(get(formData, `${schemeItem.F_SchemeInfoId}`, {})).some(t => t && t.length > + 0)) { + formreqObj.keyValue = processId + } + } + formValue.formreq[schemeIndex] = formreqObj + + for (let dataIndex = 0; dataIndex < schemeItem.F_Scheme.data.length; ++dataIndex) { + const { + componts + } = schemeItem.F_Scheme.data[dataIndex] + for (const t of componts) { + // 之后的 t 即表示每个 scheme 项 + t.__valuePath__ = `formreq.${schemeIndex}.formData.${t.id}` + // 以下两个属性暂时用不到 + t.__schemeIndex__ = schemeIndex + t.__dataIndex__ = dataIndex + + if (t.type === 'girdtable' && t.table) { + // 数据项是表格的情况 + // 先设置源数据,不然无法获取默认值 + for (const fieldItem of t.fieldsData) { + fieldItem.__sourceData__ = await this.getSourceData(fieldItem) + } + t.__defaultItem__ = await this.getDefaultData(t, prop) + if (formData) { + // 有表单值的情况,从表单值中获取数据 + const val = [] + for (const valueItem of get(formData, `${schemeItem.F_SchemeInfoId}.${t.table}`, + [])) { + const tableItemValue = {} + for (const fieldItem of t.fieldsData.filter(t => t.field)) { + const formDataValue = get(valueItem, fieldItem.field.toLowerCase()) + tableItemValue[fieldItem.field] = await this.convertToFormValue(fieldItem, + formDataValue) + } + + val.push(tableItemValue) + } + + // useDefault 表示在从 formData 取不到值的时候使用默认值 + if ((!val || val.length <= 0) && useDefault) { + set(formValue, t.__valuePath__, [this.COPY(t.__defaultItem__)]) + } else { + set(formValue, t.__valuePath__, val) + } + + } else { + // 无表单值的情况,默认值 + set(formValue, t.__valuePath__, [this.COPY(t.__defaultItem__)]) + } + + } else if (t.field) { + // 数据项不是表格的情况 + // 先设置源数据,不然无法获取默认值 + t.__sourceData__ = await this.getSourceData(t) + if (formData) { + // 有表单值的情况,从表单值中获取数据 + const path = + `${schemeItem.F_SchemeInfoId}.${t.table}.${dataIndex}.${t.field.toLowerCase()}` + const formDataValue = get(formData, path) + + // useDefault 表示在从 formData 取不到值的时候使用默认值 + if (!formDataValue && useDefault) { + set(formValue, t.__valuePath__, await this.getDefaultData(t, prop)) + } else { + set(formValue, t.__valuePath__, await this.convertToFormValue(t, formDataValue)) + } + + } else { + // 无表单值的情况,默认值 + set(formValue, t.__valuePath__, await this.getDefaultData(t, prop)) + } + } + + // 权限控制 + const authObj = get(currentNode, `wfForms.${schemeIndex}.authorize.${t.id}`, {}) + t.edit = authObj.isEdit + if (Number(t.isHide) !== 1 && authObj.isLook !== 0) { + // 加入 scheme + scheme.push(t) + + // organize、datetime 可能作为其他 organize 或 datetimerange 的依赖项,引用它们 + if (['organize', 'datetime'].includes(t.type)) { + schemeRef[t.id] = t + } + + // datetimerange、带有 relation 级联字段的 organize,依赖其他项 + if ((t.type === 'datetimerange' && t.startTime && t.endTime) || (t.type === + 'organize' && t.relation)) { + refList.push(t) + } + } + } + } + } + + // 依次处理表单关联 + refList.forEach(t => { + if (t.type === 'organize') { + // 处理组件结构级联 + // 给当前组件赋上级级联的值路径 __relationPath__ + const parent = schemeRef[t.relation] + t.__relationPath__ = parent.__valuePath__ + // 给上级级联的组件注册自动重置当前组件的 change 事件 + const relItem = { + type: 'organize', + id: t.id, + path: t.__valuePath__ + } + rel[parent.id] = rel[parent.id] ? rel[parent.id].concat(relItem) : [relItem] + + } else if (t.type === 'datetimerange') { + // 处理日期区间 + const start = schemeRef[t.startTime] + const end = schemeRef[t.endTime] + + const relItem = { + type: 'datetimerange', + path: t.__valuePath__, + id: t.id, + startPath: start.__valuePath__, + endPath: end.__valuePath__, + } + + rel[start.id] = rel[start.id] ? rel[start.id].concat(relItem) : [relItem] + rel[end.id] = rel[end.id] ? rel[end.id].concat(relItem) : [relItem] + + } + }) + + return { + scheme, + formValue, + rel + } + }, + newguid(){ + return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) { + var r = Math.random() * 16 | 0, + v = c == 'x' ? r : (r & 0x3 | 0x8); + return v.toString(16); + }); + }, + /** + * 获取最终需要 POST 的数据 + * 参数:formValue, scheme + * 返回:用于提交的数据 + * + * 遍历 formValue,将其中的表单值依次使用 convertToPostData 这个方法转化为提交值 + */ + async getPostData(originFormValue, scheme) { + const formValue = this.COPY(originFormValue) + var guid =this.newguid(); + // 依次按照 scheme 项目遍历 + for (const item of scheme) { + if (item.field) { + // 不是表格的情况 + const path = item.__valuePath__ + const val = get(formValue, path) + const result = await this.convertToPostData(item, val, originFormValue, scheme, guid) + set(formValue, path, result) + + } else if (item.table && item.fieldsData) { + // 是表格的情况 + const tableValue = get(formValue, item.__valuePath__, []) + for (let valueIndex = 0; valueIndex < tableValue.length; ++valueIndex) { + for (const schemeItem of item.fieldsData) { + const path = `${item.__valuePath__}.${valueIndex}.${schemeItem.field}` + const val = get(formValue, path) + + const result = await this.convertToPostData(schemeItem, val, originFormValue, scheme, + guid) + set(formValue, path, result) + } + } + } + } + + formValue.formreq.forEach(t => { + t.formData = JSON.stringify(t.formData) + }) + formValue.formreq = JSON.stringify(formValue.formreq) + + return formValue + }, + + /** + * 获取流程信息 + * 参数: { code, processId, taskId } + * + */ + async fetchProcessInfo({ + code, + processId, + taskId + }) { + const url = processId ? 'learun/adms/newwf/processinfo' : 'learun/adms/newwf/scheme' + const reqObj = { + processId + } + if (taskId) { + reqObj.taskId = taskId + } + const data = processId ? reqObj : code + const result = await this.HTTP_GET(url, data) + + if (!result) { + return {} + } + + if (result.info) { + result.info.Scheme = JSON.parse(result.info.Scheme) + } else if (result.F_Content) { + result.F_Content = JSON.parse(result.F_Content) + } + + return result + }, + + /** + * 从 processInfo 流程信息中,提取出 currentNode + * 参数: processInfo + * + */ + getCurrentNode(processInfo) { + if (processInfo.info) { + return processInfo.info.Scheme.nodes.find(t => t.id === processInfo.info.CurrentNodeId) + } else if (processInfo.F_Content) { + return processInfo.F_Content.nodes.find(t => t.type === 'startround') + } + + return {} + }, + + /** + * 拉取表单的 schemeData + * 参数: currentNode + * + * 从当前节点 currentNode 中提取出表单 id,然后自 API 地址 /form/scheme 中拉取表单数据并返回 + */ + async fetchSchemeData(currentNode, currentTask, type) { + const { + wfForms + } = currentNode + + const data = wfForms.filter(t => t.formId).map(t => ({ + id: t.formId, + ver: '' + })) + const schemeData = await this.HTTP_GET('learun/adms/form/scheme', data) + + return schemeData || {} + }, + + /** + * 拉取表单的 formData + * 参数: currentNode, keyValue + * + * 提取当前节点信息、表单主键信息,从 API 地址 /form/data 中拉取表单数据 + */ + async fetchFormData({ + wfForms + }, keyValue) { + const reqData = wfForms + .filter(t => t.formId) + .map(t => ({ + schemeInfoId: t.formId, + processIdName: t.field, + keyValue + })) + + const formData = await this.HTTP_GET('learun/adms/form/data', reqData) + + return formData || {} + } + } } From cb8fbcad9aa9906e4f7c1d4c58d5ffab304924b8 Mon Sep 17 00:00:00 2001 From: ndbs Date: Tue, 23 Aug 2022 15:36:41 +0800 Subject: [PATCH 12/20] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E5=A4=84=E5=88=86/?= =?UTF-8?q?=E5=A5=96=E5=8A=B1=20=E4=BC=98=E5=8C=96=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/StuEncourgement/Index.cshtml | 13 +++--- .../Views/StuEncourgement/Index.js | 45 ++++++++++++++++--- .../Views/StuPunishment/Index.cshtml | 7 ++- .../Views/StuPunishment/Index.js | 33 +++++++++++++- .../MealCardRunTab/MealCardRunTabService.cs | 4 +- .../StuEncourgement/StuEncourgementService.cs | 8 ++-- .../StuPunishment/StuPunishmentService.cs | 7 +-- 7 files changed, 90 insertions(+), 27 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEncourgement/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEncourgement/Index.cshtml index 48982f154..44eaca017 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEncourgement/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEncourgement/Index.cshtml @@ -7,24 +7,23 @@
+
+
+
学号
- +
姓名
- +
奖励名称
- -
-
-
奖励日期
- +
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEncourgement/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEncourgement/Index.js index 8b5acb4bb..d34ee22bd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEncourgement/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEncourgement/Index.js @@ -7,15 +7,44 @@ var refreshGirdData; var bootstrap = function ($, learun) { "use strict"; + var startTime; + var endTime; var page = { init: function () { page.initGird(); page.bind(); }, bind: function () { + // 时间搜索框 + $('#datesearch').lrdate({ + dfdata: [ + { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } } + ], + // 月 + mShow: false, + premShow: false, + // 季度 + jShow: false, + prejShow: false, + // 年 + ysShow: false, + yxShow: false, + preyShow: false, + yShow: false, + // 默认 + dfvalue: '1', + selectfn: function (begin, end) { + startTime = begin; + endTime = end; + page.search(); + } + }); $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); - }, 300, 400); + }, 200, 400); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); @@ -68,12 +97,12 @@ var bootstrap = function ($, learun) { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/EducationalAdministration/StuEncourgement/GetPageList', headData: [ - { label: "学号", name: "StuNo", width: 100, align: "left"}, - { label: "姓名", name: "StuName", width: 100, align: "left"}, - { label: "奖励名称", name: "EncourgeName", width: 100, align: "left"}, - { label: "奖励原因", name: "Reason", width: 100, align: "left"}, - { label: "奖励金额", name: "Fee", width: 100, align: "left"}, - { label: "奖励日期", name: "EncourgeDate", width: 100, align: "left"}, + { label: "学号", name: "StuNo", width: 200, align: "left"}, + { label: "姓名", name: "StuName", width: 200, align: "left"}, + { label: "奖励名称", name: "EncourgeName", width: 200, align: "left"}, + { label: "奖励原因", name: "Reason", width: 200, align: "left"}, + { label: "奖励金额", name: "Fee", width: 200, align: "left"}, + { label: "奖励日期", name: "EncourgeDate", width: 200, align: "left"}, ], mainId:'ID', isPage: true @@ -82,6 +111,8 @@ var bootstrap = function ($, learun) { }, search: function (param) { param = param || {}; + param.StartTime = startTime; + param.EndTime = endTime; $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.cshtml index 67c53874f..bc90ff2f4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.cshtml @@ -7,6 +7,9 @@
+
+
+
@@ -22,10 +25,6 @@
处分名称
-
-
处分日期
- -
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.js index 9562bac1f..bfd3fa9f5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.js @@ -7,15 +7,44 @@ var refreshGirdData; var bootstrap = function ($, learun) { "use strict"; + var startTime; + var endTime; var page = { init: function () { page.initGird(); page.bind(); }, bind: function () { + // 时间搜索框 + $('#datesearch').lrdate({ + dfdata: [ + { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } } + ], + // 月 + mShow: false, + premShow: false, + // 季度 + jShow: false, + prejShow: false, + // 年 + ysShow: false, + yxShow: false, + preyShow: false, + yShow: false, + // 默认 + dfvalue: '1', + selectfn: function (begin, end) { + startTime = begin; + endTime = end; + page.search(); + } + }); $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); - }, 300, 400); + }, 200, 400); $('#PunishNo').lrDataItemSelect({ code: 'Punishment' }); // 刷新 @@ -137,6 +166,8 @@ var bootstrap = function ($, learun) { }, search: function (param) { param = param || {}; + param.StartTime = startTime; + param.EndTime = endTime; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MealCardRunTab/MealCardRunTabService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MealCardRunTab/MealCardRunTabService.cs index f4447cc5e..c274f584c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MealCardRunTab/MealCardRunTabService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MealCardRunTab/MealCardRunTabService.cs @@ -220,7 +220,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("endTime", queryParam["EndTime"].ToDate(), DbType.DateTime); strSql.Append(" AND ( t.occurTime >= @startTime AND t.occurTime <= @endTime ) "); } - return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + data = data.OrderByDescending(x => x.centralTm); + return data; } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEncourgement/StuEncourgementService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEncourgement/StuEncourgementService.cs index 3f3de8b01..b45777feb 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEncourgement/StuEncourgementService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEncourgement/StuEncourgementService.cs @@ -82,12 +82,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("EncourgeName", "%" + queryParam["EncourgeName"].ToString() + "%", DbType.String); strSql.Append(" AND t.EncourgeName Like @EncourgeName "); } - if (!queryParam["EncourgeDate"].IsEmpty()) + if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) { - dp.Add("EncourgeDate", queryParam["EncourgeDate"].ToString(), DbType.String); - strSql.Append(" AND t.EncourgeDate = @EncourgeDate "); + dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime); + dp.Add("endTime", queryParam["EndTime"].ToDate(), DbType.DateTime); + strSql.Append(" AND ( t.EncourgeDate >= @startTime AND t.EncourgeDate <= @endTime ) "); } - return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuPunishment/StuPunishmentService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuPunishment/StuPunishmentService.cs index 2ec5e0fa2..65e555839 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuPunishment/StuPunishmentService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuPunishment/StuPunishmentService.cs @@ -77,10 +77,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("PunishNo", queryParam["PunishNo"].ToString(), DbType.String); strSql.Append(" AND t.PunishNo = @PunishNo "); } - if (!queryParam["PunishDate"].IsEmpty()) + if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) { - dp.Add("PunishDate", queryParam["PunishDate"].ToString(), DbType.String); - strSql.Append(" AND t.PunishDate = @PunishDate "); + dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime); + dp.Add("endTime", queryParam["EndTime"].ToDate(), DbType.DateTime); + strSql.Append(" AND ( t.PunishDate >= @startTime AND t.PunishDate <= @endTime ) "); } return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } From f4d561ef525587263d477de3445182da2f0e0c4e Mon Sep 17 00:00:00 2001 From: ndbs Date: Tue, 23 Aug 2022 15:54:51 +0800 Subject: [PATCH 13/20] =?UTF-8?q?=E6=97=A5=E6=9C=9F=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E9=80=89=E6=8B=A9=E4=B8=89=E4=B8=AA=E6=9C=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EducationalAdministration/Views/StuEncourgement/Index.js | 2 +- .../EducationalAdministration/Views/StuPunishment/Index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEncourgement/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEncourgement/Index.js index d34ee22bd..895fc8c16 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEncourgement/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEncourgement/Index.js @@ -35,7 +35,7 @@ var bootstrap = function ($, learun) { preyShow: false, yShow: false, // 默认 - dfvalue: '1', + dfvalue: '3', selectfn: function (begin, end) { startTime = begin; endTime = end; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.js index bfd3fa9f5..7b6fd23d4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.js @@ -35,7 +35,7 @@ var bootstrap = function ($, learun) { preyShow: false, yShow: false, // 默认 - dfvalue: '1', + dfvalue: '3', selectfn: function (begin, end) { startTime = begin; endTime = end; From 02b1f2162acbb7d13d58b87f07d18f2f15aa2775 Mon Sep 17 00:00:00 2001 From: ndbs Date: Tue, 23 Aug 2022 17:31:29 +0800 Subject: [PATCH 14/20] =?UTF-8?q?app2.0=20=E4=B8=80=E5=8D=A1=E9=80=9A?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MealCardRunTab/MealCardRunTabService.cs | 4 +--- .../LearunApp-2.2.0/pages/MealCardRunTab/list.vue | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MealCardRunTab/MealCardRunTabService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MealCardRunTab/MealCardRunTabService.cs index c274f584c..f4447cc5e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MealCardRunTab/MealCardRunTabService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MealCardRunTab/MealCardRunTabService.cs @@ -220,9 +220,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("endTime", queryParam["EndTime"].ToDate(), DbType.DateTime); strSql.Append(" AND ( t.occurTime >= @startTime AND t.occurTime <= @endTime ) "); } - var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); - data = data.OrderByDescending(x => x.centralTm); - return data; + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/MealCardRunTab/list.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/MealCardRunTab/list.vue index bafee7915..7bafb76c1 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/MealCardRunTab/list.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/MealCardRunTab/list.vue @@ -188,7 +188,9 @@ let _postParam = { pagination: { rows: _this.rows, - page: _this.page + page: _this.page, + sidx: 'centralTm', + sord: 'desc', }, queryJson: JSON.stringify(_this.multipleData) }; From e284768377b20fbb7fdcf3b68079dffefb47d55d Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Tue, 23 Aug 2022 18:03:45 +0800 Subject: [PATCH 15/20] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E5=BF=83=E7=90=86=E5=81=A5=E5=BA=B7=E6=A1=A3?= =?UTF-8?q?=E6=A1=88=EF=BC=9A=E8=A1=A8=E5=8D=95=E5=A2=9E=E5=8A=A0=E5=BF=85?= =?UTF-8?q?=E5=A1=AB=E9=AA=8C=E8=AF=81=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/APStuHealthRecords/Form.cshtml | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/APStuHealthRecords/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/APStuHealthRecords/Form.cshtml index 6a9bc7f27..e4844f218 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/APStuHealthRecords/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/APStuHealthRecords/Form.cshtml @@ -3,25 +3,25 @@ Layout = "~/Views/Shared/_Form.cshtml"; }
-
-
-
+
+
*
+
-
-
专业
-
+
+
专业*
+
-
-
班级
-
+
+
班级*
+
-
-
学生
-
+
+
学生*
+
-
+
描述
- +
@Html.AppendJsFile("/Areas/LogisticsManagement/Views/APStuHealthRecords/Form.js") From 2b954f83770045c8be2619962f9018dbafda1a20 Mon Sep 17 00:00:00 2001 From: ndbs Date: Tue, 23 Aug 2022 18:06:11 +0800 Subject: [PATCH 16/20] =?UTF-8?q?app2.0=20=E6=95=99=E5=B8=88=E8=AF=BE?= =?UTF-8?q?=E8=A1=A8=E6=9F=A5=E8=AF=A2=E6=9C=89=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Learun.Application.WebApi/Modules/TimeTable.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TimeTable.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TimeTable.cs index fe3934459..8157c1b0d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TimeTable.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TimeTable.cs @@ -89,7 +89,7 @@ namespace Learun.Application.WebApi.Modules public Response GetStuLessonInfo(dynamic _) { var param = this.GetReqData(); - var lessonInfos = stuAttendanceIBLL.GetStuLessonInfo(userInfo.account,param.StartDate,param.EndDate); + var lessonInfos = stuAttendanceIBLL.GetStuLessonInfo(userInfo.account, param.StartDate, param.EndDate); var empNos = lessonInfos.Select(a => a.EmpNo).ToList(); var lessonTerms = arrangeLessonTermIBLL.GetListByEmpNo(empNos); @@ -223,10 +223,10 @@ namespace Learun.Application.WebApi.Modules else if (param.Description == "教师") { //教师 - var empInfo = empInfoIbll.GetAllList().Where(x => x.EmpNo == userInfo.account).FirstOrDefault().EmpNo; + var empInfo = empInfoIbll.GetAllList().Where(x => x.EmpNo == param.Account).FirstOrDefault().EmpNo; if (empInfo != null) { - Data = arrangeLessonTermIBLL.GetTimeTableInEducation(param.StartDate, param.EndDate, "", param.EmpNo, ""); + Data = arrangeLessonTermIBLL.GetTimeTableInEducation(param.StartDate, param.EndDate, "", param.Account, ""); } } From 4ec6b21af7c64827dd9524bb61d46db2d7953de7 Mon Sep 17 00:00:00 2001 From: liangkun Date: Tue, 23 Aug 2022 18:26:16 +0800 Subject: [PATCH 17/20] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/FormApi.cs | 64 +++++++++++++++++++ .../Scheme/FormSchemeBLL.cs | 63 +++++++++++++++++- .../pages/nworkflow/releasetask/single.vue | 5 +- .../pages/nworkflow/workflow.js | 33 +++++++++- 4 files changed, 160 insertions(+), 5 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/FormApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/FormApi.cs index a574ac806..4b5b15393 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/FormApi.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/FormApi.cs @@ -21,12 +21,47 @@ namespace Learun.Application.WebApi.Modules { Get["/scheme"] = GetScheme; Get["/data"] = GetData; + Get["/folderkey"] = GetFolderkey; Post["/save"] = Save; Post["/delete"] = DeleteForm; } private FormSchemeIBLL formSchemeIBLL = new FormSchemeBLL(); + + private Response GetFolderkey(dynamic _) + { + List req = this.GetReqData>();// 获取模板请求数据 + Dictionary schemeList = new Dictionary(); + Dictionary dic = new Dictionary(); + foreach (var item in req) + { + //FormSchemeInfoEntity schemeInfoEntity = formSchemeIBLL.GetSchemeInfoEntity(item.id); + //if (schemeInfoEntity != null) + //{ + // FormSchemeEntity schemeEntity = formSchemeIBLL.GetSchemeEntity(schemeInfoEntity.F_SchemeId); + // if (schemeEntity != null) + // { + // if (schemeInfoEntity.F_SchemeId != item.ver) + // { + // schemeList.Add(item.id, schemeEntity); + // } + // } + //} + if (string.IsNullOrEmpty(item.processIdName)) + { + var data = formSchemeIBLL.GetInstanceForm(item.schemeInfoId, item.keyValue); + dic.Add(item.schemeInfoId, data); + } + else + { + var data = formSchemeIBLL.GetInstanceForm(item.schemeInfoId, item.processIdName, item.keyValue);// + dic.Add(item.schemeInfoId, data); + } + } + + return Success(schemeList); + } /// /// 获取表单模板数据 /// @@ -104,6 +139,35 @@ namespace Learun.Application.WebApi.Modules } #region 请求参数 + + private class FolderKeyReq + { + /// + /// 表单请求Id + /// + public string id { get; set; } + /// + /// 当前自定义表单版本号 + /// + public string ver { get; set; } + /// + /// 流程模板id + /// + public string schemeInfoId { get; set; } + /// + /// 关联字段名称 + /// + public string processIdName { get; set; } + /// + /// 数据主键值 + /// + public string keyValue { get; set; } + /// + /// 表单数据 + /// + public string formData { get; set; } + } + private class SchemeReq { /// /// 表单请求Id diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeBLL.cs index 1e3296b7e..cd910368d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeBLL.cs @@ -551,7 +551,68 @@ namespace Learun.Application.Form } } } - + + public Dictionary GetFolderKey(string schemeInfoId, string processIdName, string keyValue) + { + Dictionary res = new Dictionary(); + + try + { + FormSchemeInfoEntity formSchemeInfoEntity = GetSchemeInfoEntity(schemeInfoId); + FormSchemeEntity formSchemeEntity = GetSchemeEntity(formSchemeInfoEntity.F_SchemeId); + FormSchemeModel formSchemeModel = formSchemeEntity.F_Scheme.ToObject(); + + // 确定主从表之间的关系 + List> TableTree = new List>();// 从表 + foreach (var table in formSchemeModel.dbTable) + { + TreeModelEx treeone = new TreeModelEx(); + treeone.data = table; + treeone.id = table.name; + treeone.parentId = table.relationName; + if (string.IsNullOrEmpty(table.relationName)) + { + treeone.parentId = "0"; + } + TableTree.Add(treeone); + } + TableTree = TableTree.ToTree(); + + // 确定表与组件之间的关系 + Dictionary> tableComponts = new Dictionary>(); + foreach (var tab in formSchemeModel.data) + { + foreach (var compont in tab.componts) + { + if (!string.IsNullOrEmpty(compont.table)) + { + if (!tableComponts.ContainsKey(compont.table)) + { + tableComponts[compont.table] = new List(); + } + if (compont.type == "upload") + { + tableComponts[compont.table].Add(compont); + } + } + } + } + GetInstanceTableData(TableTree, tableComponts, formSchemeModel.dbId, keyValue, processIdName, null, res); + return res; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// /// 保存自定义表单数据 /// diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/releasetask/single.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/releasetask/single.vue index cbe42cb02..59bd5647e 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/releasetask/single.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/releasetask/single.vue @@ -111,7 +111,8 @@ export default { this.needTitle = this.type !== 'again' && Number(currentNode.isTitle) === 1 const formData = await this.fetchFormData(currentNode, processId) - const schemeData = await this.fetchSchemeData(currentNode) + const schemeData = await this.fetchSchemeData(currentNode); + await this.fetchFolderkeyData(currentNode, processId); const { formValue, scheme, rel } = await this.getCustomForm({ schemeData, @@ -127,7 +128,7 @@ export default { this.formValue = formValue this.code = code this.processId = processId -console.log(this.formValue,'=====',this.scheme ,) + console.log(formData,'==',schemeData) this.ready = true this.HIDE_LOADING() diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/workflow.js b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/workflow.js index 54918f6f3..3d560ba81 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/workflow.js +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/workflow.js @@ -259,13 +259,26 @@ export default { */ async getPostData(originFormValue, scheme) { const formValue = this.COPY(originFormValue) - var guid =this.newguid(); // 依次按照 scheme 项目遍历 for (const item of scheme) { if (item.field) { // 不是表格的情况 const path = item.__valuePath__ const val = get(formValue, path) + + if(item.type=='upload'){ + // 先生成一个guid + var guid =this.newguid(); + // 取出当前列对应的labelId + var labeId = item.id + // 从缓存取出当前审批流程所有的guid + var guids = JSON.parse(uni.getStorageSync('guids')) + if(guids){ + guid = guids[labeId] + } + } + // debugger + const result = await this.convertToPostData(item, val, originFormValue, scheme, guid) set(formValue, path, result) @@ -381,6 +394,22 @@ export default { const formData = await this.HTTP_GET('learun/adms/form/data', reqData) return formData || {} - } + }, + async fetchFolderkeyData(currentNode, keyValue) { + const { + wfForms + } = currentNode + + const reqData = wfForms + .filter(t => t.formId) + .map(t => ({ + id: t.formId, + ver: '', + schemeInfoId: t.formId, + processIdName: t.field, + keyValue + })) + const schemeData = await this.HTTP_GET('learun/adms/form/folderkey', reqData) + }, } } From 584b17e0035bab9bc886de78816e7c663022f879 Mon Sep 17 00:00:00 2001 From: liangkun Date: Wed, 24 Aug 2022 11:43:06 +0800 Subject: [PATCH 18/20] =?UTF-8?q?app2.0=E9=99=84=E4=BB=B6=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=94=AF=E6=8C=81=E8=8D=89=E7=A8=BF=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/FormApi.cs | 29 +++-------------- .../Scheme/FormSchemeBLL.cs | 27 ++++++++++++++-- .../Scheme/FormSchemeIBLL.cs | 2 ++ .../pages/nworkflow/myflow/single.vue | 7 ++--- .../pages/nworkflow/releasetask/single.vue | 5 ++- .../pages/nworkflow/workflow.js | 31 +++++++++---------- 6 files changed, 52 insertions(+), 49 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/FormApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/FormApi.cs index 4b5b15393..0a2ac508e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/FormApi.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/FormApi.cs @@ -32,35 +32,16 @@ namespace Learun.Application.WebApi.Modules private Response GetFolderkey(dynamic _) { List req = this.GetReqData>();// 获取模板请求数据 - Dictionary schemeList = new Dictionary(); - Dictionary dic = new Dictionary(); + Dictionary dic = new Dictionary(); foreach (var item in req) { - //FormSchemeInfoEntity schemeInfoEntity = formSchemeIBLL.GetSchemeInfoEntity(item.id); - //if (schemeInfoEntity != null) - //{ - // FormSchemeEntity schemeEntity = formSchemeIBLL.GetSchemeEntity(schemeInfoEntity.F_SchemeId); - // if (schemeEntity != null) - // { - // if (schemeInfoEntity.F_SchemeId != item.ver) - // { - // schemeList.Add(item.id, schemeEntity); - // } - // } - //} - if (string.IsNullOrEmpty(item.processIdName)) - { - var data = formSchemeIBLL.GetInstanceForm(item.schemeInfoId, item.keyValue); - dic.Add(item.schemeInfoId, data); - } - else + if (!string.IsNullOrEmpty(item.processIdName)) { - var data = formSchemeIBLL.GetInstanceForm(item.schemeInfoId, item.processIdName, item.keyValue);// - dic.Add(item.schemeInfoId, data); + var data = formSchemeIBLL.GetFolderKey(item.schemeInfoId, item.processIdName, item.keyValue);// + dic = data; } } - - return Success(schemeList); + return Success(dic); } /// /// 获取表单模板数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeBLL.cs index cd910368d..778209e76 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeBLL.cs @@ -552,7 +552,7 @@ namespace Learun.Application.Form } } - public Dictionary GetFolderKey(string schemeInfoId, string processIdName, string keyValue) + public Dictionary GetFolderKey(string schemeInfoId, string processIdName, string keyValue) { Dictionary res = new Dictionary(); @@ -594,11 +594,34 @@ namespace Learun.Application.Form { tableComponts[compont.table].Add(compont); } + if (compont.type == "guid") + { + tableComponts[compont.table].Add(compont); + } + } } } GetInstanceTableData(TableTree, tableComponts, formSchemeModel.dbId, keyValue, processIdName, null, res); - return res; + Dictionary < string,string> uploadfieldkeyvalue=new Dictionary(); + foreach (var itemCompont in tableComponts) + { + foreach (FormCompontModel formitem in itemCompont.Value) + { + if (formitem.type=="upload") + { + foreach (var resitem in res) + { + if (resitem.Value.Rows.Count>0) + { + if (resitem.Value.Rows[0][formitem.field] != null) + uploadfieldkeyvalue.Add(formitem.id, resitem.Value.Rows[0][formitem.field].ToString()); + } + } + } + } + } + return uploadfieldkeyvalue; } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeIBLL.cs index 571d48c9d..72444597a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeIBLL.cs @@ -137,5 +137,7 @@ namespace Learun.Application.Form /// 数据主键值 void DeleteInstanceForm(string schemeInfoId, string keyValue); #endregion + + Dictionary GetFolderKey(string itemSchemeInfoId, string itemProcessIdName, string itemKeyValue); } } diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/myflow/single.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/myflow/single.vue index 3a505760c..4ac28bcab 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/myflow/single.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/myflow/single.vue @@ -95,7 +95,6 @@ export default { // t.formId 使用表单,根据这个 formId 来获取 scheme 等信息 // t.appurl 使用移动页面,直接跳转到本地的页面;表单结构等均写死在页面里 const { wfForms } = this.currentNode - // 处理没有有效表单的情况,停止加载 if (!wfForms || wfForms.every(t => !t.formId && !t.appurl)) { this.HIDE_LOADING() @@ -197,7 +196,7 @@ export default { return } this.LOADING(`提交${actionText}中…`) - this.HTTP_POST(`/newwf${actionUrl}`, actionData, `提交${actionText}失败`).then(success => { + this.HTTP_POST(`/learun/adms/newwf${actionUrl}`, actionData, `提交${actionText}失败`).then(success => { this.HIDE_LOADING() if (success) { this.EMIT('task-list-change') @@ -216,7 +215,7 @@ export default { this.LOADING('正在提交…') const draftFormValue = this.$refs.form.getFormValue() const draftPostData = await this.getPostData(draftFormValue, this.scheme) - this.HTTP_POST('/newwf​/draft', draftPostData, '提交草稿失败').then(success => { + this.HTTP_POST('/learun/adms/newwf/draft', draftPostData, '提交草稿失败').then(success => { this.HIDE_LOADING() if (success) { this.EMIT('task-list-change') @@ -245,7 +244,7 @@ export default { postData.parentTaskId = this.taskId } const errorTips = '流程发起失败' - this.HTTP_POST('/newwf/createchildflow', postData, errorTips).then(success => { + this.HTTP_POST('/learun/adms/newwf/createchildflow', postData, errorTips).then(success => { this.HIDE_LOADING() if (success) { this.EMIT('task-list-change') diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/releasetask/single.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/releasetask/single.vue index 59bd5647e..f8269c91d 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/releasetask/single.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/releasetask/single.vue @@ -112,8 +112,8 @@ export default { const formData = await this.fetchFormData(currentNode, processId) const schemeData = await this.fetchSchemeData(currentNode); - await this.fetchFolderkeyData(currentNode, processId); - + const fetchFolderkeyData=await this.fetchFolderkeyData(currentNode, processId); + uni.setStorageSync('guids',JSON.stringify(fetchFolderkeyData)); const { formValue, scheme, rel } = await this.getCustomForm({ schemeData, processId, @@ -128,7 +128,6 @@ export default { this.formValue = formValue this.code = code this.processId = processId - console.log(formData,'==',schemeData) this.ready = true this.HIDE_LOADING() diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/workflow.js b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/workflow.js index 3d560ba81..c9d2969d3 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/workflow.js +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/workflow.js @@ -135,7 +135,7 @@ export default { // 有表单值的情况,从表单值中获取数据 const val = [] for (const valueItem of get(formData, `${schemeItem.F_SchemeInfoId}.${t.table}`, - [])) { + [])) { const tableItemValue = {} for (const fieldItem of t.fieldsData.filter(t => t.field)) { const formDataValue = get(valueItem, fieldItem.field.toLowerCase()) @@ -243,13 +243,13 @@ export default { rel } }, - newguid(){ - return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) { - var r = Math.random() * 16 | 0, - v = c == 'x' ? r : (r & 0x3 | 0x8); - return v.toString(16); - }); - }, + newguid() { + return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) { + var r = Math.random() * 16 | 0, + v = c == 'x' ? r : (r & 0x3 | 0x8); + return v.toString(16); + }); + }, /** * 获取最终需要 POST 的数据 * 参数:formValue, scheme @@ -265,20 +265,18 @@ export default { // 不是表格的情况 const path = item.__valuePath__ const val = get(formValue, path) - - if(item.type=='upload'){ + + if (item.type == 'upload') { // 先生成一个guid - var guid =this.newguid(); + var guid = this.newguid(); // 取出当前列对应的labelId var labeId = item.id // 从缓存取出当前审批流程所有的guid var guids = JSON.parse(uni.getStorageSync('guids')) - if(guids){ + if (guids) { guid = guids[labeId] } } - // debugger - const result = await this.convertToPostData(item, val, originFormValue, scheme, guid) set(formValue, path, result) @@ -399,7 +397,7 @@ export default { const { wfForms } = currentNode - + const reqData = wfForms .filter(t => t.formId) .map(t => ({ @@ -409,7 +407,8 @@ export default { processIdName: t.field, keyValue })) - const schemeData = await this.HTTP_GET('learun/adms/form/folderkey', reqData) + const folderkeyData = await this.HTTP_GET('learun/adms/form/folderkey', reqData) + return folderkeyData || {} }, } } From cd7c48d0186d806f3898e9d773fd7b5732636b7a Mon Sep 17 00:00:00 2001 From: ndbs Date: Wed, 24 Aug 2022 14:05:26 +0800 Subject: [PATCH 19/20] =?UTF-8?q?app2.0=E6=A0=A1=E5=86=85=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/NewsApi.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/NewsApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/NewsApi.cs index 9fa30d0a7..41a74b72c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/NewsApi.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/NewsApi.cs @@ -20,6 +20,7 @@ namespace Learun.Application.WebApi.Modules : base("/learun/news") { Get["/list"] = GetList; + Get["/shList"] = GetshList; } @@ -85,6 +86,24 @@ namespace Learun.Application.WebApi.Modules }; return Success(jsonData); } + /// + /// 获取页面显示列表数据 + /// + /// + /// + public Response GetshList(dynamic _) + { + NoticeEntity parameter = this.GetReqData(); + var shlist = noticeIBLL.GetEntityByProcessId(parameter.ProgressId); + return Success(shlist); + } + #region 私有类 + + private class NoticeEntity + { + public string ProgressId { get; set; } + } + #endregion } From 3ac79611015da35416a6695a72c406f46c96751b Mon Sep 17 00:00:00 2001 From: ndbs Date: Wed, 24 Aug 2022 16:21:33 +0800 Subject: [PATCH 20/20] =?UTF-8?q?=E5=85=B5=E5=BD=B9=E7=AE=A1=E7=90=86-?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/MSRIntentionManagement/Form.cshtml | 8 ++++---- .../Views/MSRMilitaryRecord/Form.cshtml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/MSRIntentionManagement/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/MSRIntentionManagement/Form.cshtml index 529532099..3affe03d1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/MSRIntentionManagement/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/MSRIntentionManagement/Form.cshtml @@ -4,12 +4,12 @@ }
-
联系方式
- +
联系方式*
+
-
年龄
- +
年龄*
+
身高
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/MSRMilitaryRecord/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/MSRMilitaryRecord/Form.cshtml index ab4f3d723..4b454669e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/MSRMilitaryRecord/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/MSRMilitaryRecord/Form.cshtml @@ -4,8 +4,8 @@ }
-
参军记录
- +
参军记录*
+
备注