添加项目文件。

This commit is contained in:
2023-03-13 15:00:34 +08:00
parent 42bf06ca3e
commit 1d73df3235
1205 changed files with 185078 additions and 0 deletions

View File

@@ -0,0 +1,144 @@
using Microsoft.AspNetCore.Components.Forms;
namespace JNPF.VisualDev.Engine.Security;
/// <summary>
/// 代码生成列表按钮帮助类.
/// </summary>
public class GetCodeGenIndexButtonHelper
{
/// <summary>
/// 代码生成单表Index列表列按钮方法.
/// </summary>
/// <param name="value">按钮类型.</param>
/// <param name="primaryKey">主键key.</param>
/// <param name="primaryKeyPolicy">主键策略.</param>
/// <param name="isFlow">是否工作流表单.</param>
/// <param name="isInlineEditor">是否行内编辑.</param>
/// <returns></returns>
public static string IndexColumnButton(string value, string primaryKey, int primaryKeyPolicy, bool isFlow = false, bool isInlineEditor = false)
{
string method = string.Empty;
switch (value)
{
case "edit":
switch (isInlineEditor)
{
case true:
method = string.Format("scope.row.rowEdit=true");
break;
default:
switch (primaryKeyPolicy)
{
case 2:
switch (isFlow)
{
case true:
method = string.Format("addOrUpdateHandle(scope.row.flowTaskId)");
break;
default:
method = string.Format("addOrUpdateHandle(scope.row.{0})", primaryKey);
break;
}
break;
default:
method = string.Format("addOrUpdateHandle(scope.row.{0})", primaryKey);
break;
}
break;
}
break;
case "remove":
method = string.Format("handleDel(scope.row.{0})", primaryKey);
break;
case "detail":
switch (isFlow)
{
case true:
switch (isInlineEditor)
{
case true:
switch (primaryKeyPolicy)
{
case 2:
method = string.Format("goDetail(scope.row.flowTaskId,scope.row.flowState)");
break;
default:
method = string.Format("goDetail(scope.row.{0},scope.row.flowState)", primaryKey);
break;
}
break;
default:
switch (primaryKeyPolicy)
{
case 2:
method = string.Format("addOrUpdateHandle(scope.row.flowTaskId,scope.row.flowState)");
break;
default:
method = string.Format("addOrUpdateHandle(scope.row.{0},scope.row.flowState)", primaryKey);
break;
}
break;
}
break;
default:
method = string.Format("goDetail(scope.row.{0})", primaryKey);
break;
}
break;
}
return method;
}
/// <summary>
/// 代码生成单表Index列表头部按钮方法.
/// </summary>
/// <returns></returns>
public static string IndexTopButton(string value)
{
var method = string.Empty;
switch (value)
{
case "add":
method = "addOrUpdateHandle()";
break;
case "download":
method = "exportData()";
break;
case "batchRemove":
method = "handleBatchRemoveDel()";
break;
case "upload":
method = "handelUpload()";
break;
}
return method;
}
/// <summary>
/// 代码生成流程Index列表列按钮是否禁用.
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static string WorkflowIndexColumnButton(string value)
{
var disabled = string.Empty;
switch (value)
{
case "edit":
disabled = ":disabled='[1, 2, 4, 5].indexOf(scope.row.flowState) > -1' ";
break;
case "remove":
disabled = ":disabled='[1, 2, 3, 5].indexOf(scope.row.flowState) > -1' ";
break;
case "detail":
disabled = ":disabled='!scope.row.flowState' ";
break;
}
return disabled;
}
}