[UI.Client]

修正Recipe编辑器中加载Routine后,所有单元格没有权限的问题。
This commit is contained in:
SL 2023-08-22 17:20:28 +08:00
parent d09efef6f5
commit 3b958606fa
2 changed files with 24 additions and 3 deletions

View File

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

View File

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