Browse Source

设置公式页面公式下拉框调整为动态取数据

金隅分支
zhangli 3 years ago
parent
commit
106b25925a
6 changed files with 87 additions and 3 deletions
  1. +13
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/FormulaMainController.cs
  2. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/FormChild.cshtml
  3. +7
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/FormChild.js
  4. +26
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainBLL.cs
  5. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainIBLL.cs
  6. +39
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainService.cs

+ 13
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/FormulaMainController.cs View File

@@ -73,6 +73,19 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers
};
return Success(jsonData);
}

/// <summary>
/// 获取
/// </summary>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetList(string queryJson)
{
var list = formulaMainIBLL.GetList(queryJson);

return Success(list);
}
/// <summary>
/// 获取表单数据
/// </summary>
@@ -113,7 +126,6 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers

return Success(list);
}
#endregion

#region 提交数据


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/FormChild.cshtml View File

@@ -5,7 +5,7 @@
<div class="lr-form-wrap" id="form">
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">上级<font face="宋体">*</font></div>
<div id="MainId" isvalid="yes" checkexpession="NotNull"></div><a id="lr_add" class="btn" style="position: relative;margin: -48px 0 0 -67px;"><i class="fa fa-plus"></i>&nbsp;</a>
<div id="MainId" isvalid="yes" checkexpession="NotNull" readonly="readonly"></div><a id="lr_add" class="btn" style="position: relative;margin: -48px 0 0 -67px;"><i class="fa fa-plus"></i>&nbsp;</a>
</div>
<div id="content1">


+ 7
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/FormChild.js View File

@@ -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);
// 新增


+ 26
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainBLL.cs View File

@@ -43,6 +43,32 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop
}
}


/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
public IEnumerable<FormulaMainEntity> GetList(string queryJson)
{
try
{
return formulaMainService.GetList(queryJson);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 获取FormulaMain表实体数据
/// </summary>


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainIBLL.cs View File

@@ -21,6 +21,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
IEnumerable<FormulaMainEntity> GetPageList(Pagination pagination, string queryJson);
IEnumerable<FormulaMainEntity> GetList(string queryJson);
/// <summary>
/// 获取FormulaMain表实体数据
/// </summary>


+ 39
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/FormulaMain/FormulaMainService.cs View File

@@ -65,6 +65,45 @@ t.[Result]
}
}

/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
public IEnumerable<FormulaMainEntity> 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<FormulaMainEntity>(strSql.ToString(), dp);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
/// <summary>
/// 获取FormulaMain表实体数据
/// </summary>


Loading…
Cancel
Save