diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/EnrollDataController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/EnrollDataController.cs index 26d66566e..384eb428f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/EnrollDataController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/EnrollDataController.cs @@ -160,7 +160,8 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers return; } string filename = Server.UrlDecode(data.F_FileName);//客户端保存的文件名 - string filepath = data.F_FilePath;// DirFileHelper.GetAbsolutePath(data.F_FilePath);//路径 + data.F_FilePath ="/"+ data.F_FilePath.Substring(data.F_FilePath.IndexOf("Resource")); + string filepath = DirFileHelper.GetAbsolutePath(data.F_FilePath);//路径 if (data.F_FileType == "xlsx" || data.F_FileType == "xls") { filepath = filepath.Substring(0, filepath.LastIndexOf(".")) + ".pdf";//文件名 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/EnrollTemplate/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/EnrollTemplate/Index.cshtml index 65b0ab11f..eeeb52375 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/EnrollTemplate/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/EnrollTemplate/Index.cshtml @@ -20,7 +20,8 @@
- + +  预览
 新增 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/EnrollTemplate/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/EnrollTemplate/Index.js index 5d2010519..d3ce19bca 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/EnrollTemplate/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/EnrollTemplate/Index.js @@ -66,13 +66,34 @@ var bootstrap = function ($, learun) { $('#lr_print').on('click', function () { $('#gridtable').jqprintTable(); }); + //文件预览 + $('#lr-preview').on('click', function () { + var keyValue = $("#gridtable").jfGridValue("Id"); + var Path = $("#gridtable").jfGridValue("Path"); + if (keyValue) { + learun.layerForm({ + id: 'PreviewForm', + title: '文件预览', + url: top.$.rootUrl + '/LR_Desktop/EnrollData/PreviewFile?folderid=' + Path, + width: 1080, + height: 850, + btn: null, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } else { + learun.alert.warning('请选择要预览的文件!'); + } + }); }, // 初始化列表 initGird: function () { - $('#gridtable').lrAuthorizeJfGrid({ + $('#gridtable').jfGrid({ url: top.$.rootUrl + '/LR_Desktop/EnrollTemplate/GetPageList', headData: [ { label: "模板名称", name: "Name", width: 200, align: "left" }, + { label: "文件名称", name: "F_FileName", width: 200, align: "left" }, //{ label: "模板上传", name: "Path", width: 100, align: "left"}, { label: "是否启用", name: "Enabled", width: 100, align: "left", diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/EnrollTemplate/IndexPersonnel.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/EnrollTemplate/IndexPersonnel.cshtml index b772cd1e6..e30859e7e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/EnrollTemplate/IndexPersonnel.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/EnrollTemplate/IndexPersonnel.cshtml @@ -21,6 +21,7 @@
 新增 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/EnrollTemplate/IndexPersonnel.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/EnrollTemplate/IndexPersonnel.js index dbca47504..6cc623a2e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/EnrollTemplate/IndexPersonnel.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/EnrollTemplate/IndexPersonnel.js @@ -66,6 +66,26 @@ var bootstrap = function ($, learun) { $('#lr_print').on('click', function () { $('#gridtable').jqprintTable(); }); + //文件预览 + $('#lr-preview').on('click', function () { + var keyValue = $("#gridtable").jfGridValue("Id"); + var Path = $("#gridtable").jfGridValue("Path"); + if (keyValue) { + learun.layerForm({ + id: 'PreviewForm', + title: '文件预览', + url: top.$.rootUrl + '/LR_Desktop/EnrollData/PreviewFile?folderid=' + Path, + width: 1080, + height: 850, + btn: null, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } else { + learun.alert.warning('请选择要预览的文件!'); + } + }); }, // 初始化列表 initGird: function () { @@ -73,6 +93,7 @@ var bootstrap = function ($, learun) { url: top.$.rootUrl + '/LR_Desktop/EnrollTemplate/GetPageList', headData: [ { label: "模板名称", name: "Name", width: 200, align: "left" }, + { label: "文件名称", name: "F_FileName", width: 200, align: "left" }, //{ label: "模板上传", name: "Path", width: 100, align: "left"}, { label: "是否启用", name: "Enabled", width: 100, align: "left", diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/EnrollData/EnrollDataService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/EnrollData/EnrollDataService.cs index 74aaaf79a..2e647bad6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/EnrollData/EnrollDataService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/EnrollData/EnrollDataService.cs @@ -36,7 +36,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop t.*,f.F_FileName "); strSql.Append(" FROM EnrollData t "); - strSql.Append(" left join "+ basedbname + ".dbo.LR_Base_AnnexesFile f on t.[Path]=f.f_folderid "); + strSql.Append(" left join " + basedbname + ".dbo.LR_Base_AnnexesFile f on t.[Path]=f.f_folderid "); strSql.Append(" WHERE 1=1 "); var queryParam = queryJson.ToJObject(); // 虚拟参数 @@ -48,10 +48,10 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop } if (!queryParam["keyword"].IsEmpty()) { - dp.Add("keyword", queryParam["keyword"].ToString(), DbType.String); + dp.Add("keyword", "%" + queryParam["keyword"].ToString() + "%", DbType.String); strSql.Append(" AND f.F_FileName like @keyword "); } - return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) { @@ -102,7 +102,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop { try { - this.BaseRepository("CollegeMIS").Delete(t=>t.Id == keyValue); + this.BaseRepository("CollegeMIS").Delete(t => t.Id == keyValue); } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/EnrollTemplate/EnrollTemplateEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/EnrollTemplate/EnrollTemplateEntity.cs index a07e50879..40bfa64e7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/EnrollTemplate/EnrollTemplateEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/EnrollTemplate/EnrollTemplateEntity.cs @@ -83,6 +83,9 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop } #endregion #region 扩展字段 + [NotMapped] + public string F_FileName { get; set; } + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/EnrollTemplate/EnrollTemplateService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/EnrollTemplate/EnrollTemplateService.cs index c49cbd92e..87c251085 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/EnrollTemplate/EnrollTemplateService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/EnrollTemplate/EnrollTemplateService.cs @@ -29,15 +29,17 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop { try { + var basedbname = BaseRepository().getDbConnection().Database; var strSql = new StringBuilder(); strSql.Append("SELECT "); strSql.Append(@" t.Id, t.Name, t.Path, - t.Enabled + t.Enabled,f.F_FileName "); strSql.Append(" FROM EnrollTemplate t "); + strSql.Append(" left join " + basedbname + ".dbo.LR_Base_AnnexesFile f on t.[Path]=f.f_folderid "); strSql.Append(" WHERE 1=1 "); var queryParam = queryJson.ToJObject(); // 虚拟参数