From 3b958606fa6e24e7e9c1ca9f5648472aa64fce11 Mon Sep 17 00:00:00 2001 From: SL <123@123.com> Date: Tue, 22 Aug 2023 17:20:28 +0800 Subject: [PATCH] =?UTF-8?q?[UI.Client]=20=E4=BF=AE=E6=AD=A3Recipe=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=99=A8=E4=B8=AD=E5=8A=A0=E8=BD=BDRoutine=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E6=89=80=E6=9C=89=E5=8D=95=E5=85=83=E6=A0=BC=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=9D=83=E9=99=90=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Editors/Recipe/RecipeEditorViewModel.cs | 21 +++++++++++++++++-- .../RecipeEditorLib/RecipeModel/RecipeData.cs | 6 +++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/MECF.Framework.UI.Client/CenterViews/Editors/Recipe/RecipeEditorViewModel.cs b/MECF.Framework.UI.Client/CenterViews/Editors/Recipe/RecipeEditorViewModel.cs index cd22f2b..108146b 100644 --- a/MECF.Framework.UI.Client/CenterViews/Editors/Recipe/RecipeEditorViewModel.cs +++ b/MECF.Framework.UI.Client/CenterViews/Editors/Recipe/RecipeEditorViewModel.cs @@ -1419,7 +1419,24 @@ namespace MECF.Framework.UI.Client.CenterViews.Editors.Recipe recipe.Revisor = BaseApp.Instance.UserContext.LoginName; recipe.ReviseTime = DateTime.Now; - result = _recipeProvider.WriteRecipeFile(recipe.PrefixPath, recipe.Name, recipe.GetXmlString()); + var recipeXmlString = ""; + try + { + recipeXmlString = recipe.GetXmlString(); + } + catch (Exception ex) + { + DialogBox.ShowError($"Unable to generate recipe xml file, {ex.Message}"); + return false; + } + + if (string.IsNullOrEmpty(recipeXmlString)) + { + DialogBox.ShowError($"Unable to generate recipe xml file, the xml string is empty."); + return false; + } + + result = _recipeProvider.WriteRecipeFile(recipe.PrefixPath, recipe.Name, recipeXmlString); if (result) { @@ -1429,7 +1446,7 @@ namespace MECF.Framework.UI.Client.CenterViews.Editors.Recipe } else { - MessageBox.Show("Save failed!"); + DialogBox.ShowError("Unable to transfer the recipe to RT, please see the RT logs for details."); } return result; diff --git a/MECF.Framework.UI.Client/RecipeEditorLib/RecipeModel/RecipeData.cs b/MECF.Framework.UI.Client/RecipeEditorLib/RecipeModel/RecipeData.cs index 77b6212..e053bf7 100644 --- a/MECF.Framework.UI.Client/RecipeEditorLib/RecipeModel/RecipeData.cs +++ b/MECF.Framework.UI.Client/RecipeEditorLib/RecipeModel/RecipeData.cs @@ -1022,13 +1022,17 @@ namespace MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel newStep.Add(param); } + if (RecipeType == RecipeType.Process) + newStep.Permission = stepMp; + else + newStep.Permission = MenuPermissionEnum.MP_READ_WRITE; + foreach (var param in newStep) { // 根据列权限设置参数访问权限 param.ColumnPermChangedCallback?.Invoke(param); } - newStep.Permission = stepMp; return newStep; }