From a637aebce45fc1d161406dab266958af44980f16 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Wed, 23 Jun 2021 16:24:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E5=BC=8F=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/FormulaChildController.cs | 5 ++--- .../LR_Desktop/Views/CalculateProject/Index.js | 5 ++--- .../LR_Desktop/Views/FormulaMain/FormChild.js | 7 +++---- .../LR_Desktop/Views/FormulaMain/Index.cshtml | 2 +- .../Areas/LR_Desktop/Views/FormulaMain/Index.js | 15 +++++++-------- 5 files changed, 15 insertions(+), 19 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/FormulaChildController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/FormulaChildController.cs index abb74dc96..d82612555 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/FormulaChildController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/FormulaChildController.cs @@ -113,10 +113,9 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers [HttpPost] [ValidateAntiForgeryToken] [AjaxOnly] - public ActionResult SaveList(string mainEntity, List strEntity) + public ActionResult SaveList(string MainId, List strEntity) { - FormulaChildEntity model = mainEntity.ToObject(); - formulaChildIBLL.SaveList(model.MainId, strEntity); + formulaChildIBLL.SaveList(MainId, strEntity); return Success("保存成功!"); } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/CalculateProject/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/CalculateProject/Index.js index 701482011..e5aca768f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/CalculateProject/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/CalculateProject/Index.js @@ -86,10 +86,9 @@ var bootstrap = function ($, learun) { }}, { label: "值", name: "Value", width: 100, align: "left"}, { label: "排序", name: "Sort", width: 100, align: "left"}, - { label: "状态", name: "IsEnable", width: 100, align: "left", + { label: "是否启用", name: "IsEnable", width: 100, align: "left", formatter: function (cellvalue) { - return cellvalue == 0 ? "禁用" : "启用"; - + return cellvalue == 1 ? "" : ""; }}, ], mainId:'Id', 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 500dd18a8..7624e10c4 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 @@ -19,7 +19,7 @@ var bootstrap = function ($, learun) { bind: function () { $('#MainId').lrDataSourceSelect({ code: 'FormulaMain', value: 'id', text: 'name' }); $('#ProjectId').lrDataSourceSelect({ code: 'CalculateProject', value: 'id', text: 'name' }); - + $('#MainId').lrselectSet(keyValue); // 新增 $('#lr_add').on('click', function () { page.addcontent(); @@ -61,7 +61,6 @@ var bootstrap = function ($, learun) { $('#content1').html(''); var html = ''; if (data) { - $('#MainId').lrselectSet(data[0].MainId); for (var i = 0; i < data.length; i++) { var id = learun.newGuid(); var html = ''; @@ -161,10 +160,10 @@ var bootstrap = function ($, learun) { var strEntity = JSON.stringify($('body').lrGetFormData()); var postData = { - mainEntity: strEntity, + //mainEntity: strEntity, strEntity: arr }; - $.lrSaveForm(top.$.rootUrl + '/LR_Desktop/FormulaChild/SaveList', postData, function (res) { + $.lrSaveForm(top.$.rootUrl + '/LR_Desktop/FormulaChild/SaveList?MainId=' + keyValue, postData, function (res) { // 保存成功后才回调 if (!!callBack) { callBack(); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Index.cshtml index a26fc5ead..447c34b17 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Index.cshtml @@ -25,7 +25,7 @@ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Index.js index 3d6ce9711..755d1076f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Index.js @@ -49,13 +49,13 @@ var bootstrap = function ($, learun) { }); } }); - // 编辑公式 + // 设置公式 $('#lr_editgs').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { learun.layerForm({ id: 'form', - title: '编辑', + title: '设置公式', url: top.$.rootUrl + '/LR_Desktop/FormulaMain/FormChild?keyValue=' + keyValue, width: 600, height: 500, @@ -88,17 +88,16 @@ var bootstrap = function ($, learun) { $('#gridtable').jfGrid({ url: top.$.rootUrl + '/LR_Desktop/FormulaMain/GetPageList', headData: [ - { label: "名称", name: "Name", width: 100, align: "left" }, + { label: "名称", name: "Name", width: 150, align: "left" }, + { label: "公式", name: "Result", width: 250, align: "left" }, { label: "排序", name: "Sort", width: 100, align: "left" }, + { label: "描述", name: "Desc", width: 200, align: "left" }, { label: "状态", name: "IsEnable", width: 100, align: "left", formatter: function (cellvalue) { - return cellvalue == 0 ? "禁用" : "启用"; - + return cellvalue == 1 ? "" : ""; } - }, - { label: "公式", name: "Result", width: 250, align: "left" }, - { label: "描述", name: "Desc", width: 100, align: "left" } + } ], mainId: 'Id', isPage: true