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; }