From 106b25925a70722cb1cc536b5c5d3e2a14888e02 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Mon, 12 Jul 2021 16:20:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=85=AC=E5=BC=8F=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=85=AC=E5=BC=8F=E4=B8=8B=E6=8B=89=E6=A1=86=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E4=B8=BA=E5=8A=A8=E6=80=81=E5=8F=96=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/FormulaMainController.cs | 14 ++++++- .../Views/FormulaMain/FormChild.cshtml | 2 +- .../LR_Desktop/Views/FormulaMain/FormChild.js | 8 +++- .../LR_Desktop/FormulaMain/FormulaMainBLL.cs | 26 +++++++++++++ .../LR_Desktop/FormulaMain/FormulaMainIBLL.cs | 1 + .../FormulaMain/FormulaMainService.cs | 39 +++++++++++++++++++ 6 files changed, 87 insertions(+), 3 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/FormulaMainController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/FormulaMainController.cs index 3d6c89fa6..0fa6e0701 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/FormulaMainController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/FormulaMainController.cs @@ -73,6 +73,19 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers }; return Success(jsonData); } + + /// + /// 获取 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetList(string queryJson) + { + var list = formulaMainIBLL.GetList(queryJson); + + return Success(list); + } /// /// 获取表单数据 /// @@ -113,7 +126,6 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers return Success(list); } - #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/FormChild.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/FormChild.cshtml index cdc0336f5..54c3d5763 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/FormChild.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/FormChild.cshtml @@ -5,7 +5,7 @@
上级*
-
  +
 
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/FormChild.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/FormChild.js index 709874975..0c8ebdf38 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/FormChild.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/FormChild.js @@ -17,7 +17,13 @@ var bootstrap = function ($, learun) { page.addcontent(); }, bind: function () { - $('#MainId').lrDataSourceSelect({ code: 'FormulaMain', value: 'id', text: 'name' }); + $('#MainId').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/LR_Desktop/FormulaMain/GetList', + value: "Id", + text: "Name" + }); + //$('#MainId').lrDataSourceSelect({ code: 'FormulaMain', value: 'id', text: 'name' }); $('#ProjectId').lrDataSourceSelect({ code: 'CalculateProject', value: 'id', text: 'name' }); $('#MainId').lrselectSet(keyValue); // 新增 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainBLL.cs index 7feea17d1..b131aab2b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainBLL.cs @@ -43,6 +43,32 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop } } + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetList(string queryJson) + { + try + { + return formulaMainService.GetList(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// /// 获取FormulaMain表实体数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainIBLL.cs index 1db22744a..1a2db67b7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainIBLL.cs @@ -21,6 +21,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop /// 查询参数 /// IEnumerable GetPageList(Pagination pagination, string queryJson); + IEnumerable GetList(string queryJson); /// /// 获取FormulaMain表实体数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainService.cs index e8811eb6e..fd90aa830 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainService.cs @@ -65,6 +65,45 @@ t.[Result] } } + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetList(string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.Id, + t.Name + "); + strSql.Append(" FROM FormulaMain t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["Name"].IsEmpty()) + { + dp.Add("Name", "%" + queryParam["Name"].ToString() + "%", DbType.String); + strSql.Append(" AND t.Name Like @Name "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } /// /// 获取FormulaMain表实体数据 ///