添加项目文件。

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,544 @@
using JNPF.Common.Const;
using JNPF.Common.Models;
using JNPF.Common.Security;
using JNPF.VisualDev.Entitys.Enum;
namespace JNPF.VisualDev.Engine.Security;
/// <summary>
/// 代码生成控件属性帮助类.
/// </summary>
public class CodeGenControlsAttributeHelper
{
/// <summary>
/// 转换静态数据.
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public static List<StaticDataModel> ConversionStaticData(string data)
{
var list = new List<StaticDataModel>();
if (!string.IsNullOrEmpty(data))
{
var conData = data.ToObject<List<StaticDataModel>>();
if (conData != null)
{
foreach (var item in conData)
{
list.Add(new StaticDataModel()
{
id = item.id,
fullName = item.fullName,
});
if (item.children != null)
list.AddRange(ConversionStaticData(item.children.ToJsonString()));
}
}
}
return list;
}
/// <summary>
/// 判断控件是否数据转换.
/// </summary>
/// <returns></returns>
public static bool JudgeControlIsDataConversion(string jnpfKey, string dataType, bool multiple)
{
bool tag = false;
switch (jnpfKey)
{
case JnpfKeyConst.UPLOADFZ:
case JnpfKeyConst.UPLOADIMG:
tag = true;
break;
case JnpfKeyConst.SELECT:
case JnpfKeyConst.TREESELECT:
{
switch (dataType)
{
case "dictionary":
if (!multiple)
{
tag = false;
}
else
{
tag = true;
}
break;
default:
tag = true;
break;
}
}
break;
case JnpfKeyConst.RADIO:
{
switch (dataType)
{
case "dictionary":
tag = false;
break;
default:
tag = true;
break;
}
}
break;
case JnpfKeyConst.DEPSELECT:
case JnpfKeyConst.POSSELECT:
case JnpfKeyConst.USERSELECT:
case JnpfKeyConst.POPUPTABLESELECT:
case JnpfKeyConst.ROLESELECT:
case JnpfKeyConst.GROUPSELECT:
{
if (!multiple)
tag = false;
else
tag = true;
}
break;
case JnpfKeyConst.CHECKBOX:
case JnpfKeyConst.CASCADER:
case JnpfKeyConst.COMSELECT:
case JnpfKeyConst.ADDRESS:
tag = true;
break;
}
return tag;
}
/// <summary>
/// 获取各模式控件是否列表转换.
/// </summary>
/// <param name="generatePattern">生成模式.</param>
/// <param name="jnpfKey">控件Key.</param>
/// <param name="dataType">数据类型 dictionary-数据字段,dynamic-远端数据.</param>
/// <param name="multiple">是否多选.</param>
/// <param name="subTableListDisplay">子表列表显示.</param>
/// <returns>true-ThenMapper转换,false-列表转换.</returns>
public static bool GetWhetherToConvertAllModeControlsIntoLists(GeneratePatterns generatePattern, string jnpfKey, string dataType, bool multiple, bool subTableListDisplay)
{
bool tag = false;
/*
* 因ORM原因 导航查询 一对多 列表查询
* 不能使用ORM 自带函数 待作者开放.Select()
* 导致一对多列表查询转换必须全使用子查询
* 远端数据与静态数据无法列表转换所以全部ThenMapper内转换
* 数据字典又分为两种值转换ID与EnCode
*/
switch (subTableListDisplay)
{
case true:
switch (generatePattern)
{
case GeneratePatterns.MainBelt:
case GeneratePatterns.PrimarySecondary:
switch (jnpfKey)
{
case JnpfKeyConst.CREATEUSER:
case JnpfKeyConst.MODIFYUSER:
case JnpfKeyConst.CURRORGANIZE:
case JnpfKeyConst.CURRPOSITION:
case JnpfKeyConst.DEPSELECT:
case JnpfKeyConst.POSSELECT:
case JnpfKeyConst.USERSELECT:
case JnpfKeyConst.POPUPTABLESELECT:
case JnpfKeyConst.ROLESELECT:
case JnpfKeyConst.GROUPSELECT:
case JnpfKeyConst.RADIO:
case JnpfKeyConst.SELECT:
case JnpfKeyConst.TREESELECT:
case JnpfKeyConst.CHECKBOX:
case JnpfKeyConst.CASCADER:
case JnpfKeyConst.COMSELECT:
case JnpfKeyConst.ADDRESS:
case JnpfKeyConst.SWITCH:
tag = true;
break;
}
break;
}
break;
default:
switch (jnpfKey)
{
case JnpfKeyConst.SELECT:
case JnpfKeyConst.TREESELECT:
{
switch (dataType)
{
case "dictionary":
if (multiple)
tag = true;
else
tag = false;
break;
default:
tag = true;
break;
}
}
break;
case JnpfKeyConst.RADIO:
{
switch (dataType)
{
case "dictionary":
tag = false;
break;
default:
tag = true;
break;
}
}
break;
case JnpfKeyConst.DEPSELECT:
case JnpfKeyConst.POSSELECT:
case JnpfKeyConst.USERSELECT:
case JnpfKeyConst.POPUPTABLESELECT:
case JnpfKeyConst.ROLESELECT:
case JnpfKeyConst.GROUPSELECT:
{
if (multiple)
tag = true;
else
tag = false;
}
break;
case JnpfKeyConst.CHECKBOX:
case JnpfKeyConst.CASCADER:
case JnpfKeyConst.COMSELECT:
case JnpfKeyConst.ADDRESS:
tag = true;
break;
}
break;
}
return tag;
}
/// <summary>
/// 判断含子表字段控件是否数据转换.
/// </summary>
/// <param name="jnpfKey">控件Key.</param>
/// <returns></returns>
public static bool JudgeContainsChildTableControlIsDataConversion(string jnpfKey)
{
bool tag = false;
switch (jnpfKey)
{
case JnpfKeyConst.UPLOADFZ:
case JnpfKeyConst.UPLOADIMG:
case JnpfKeyConst.CREATEUSER:
case JnpfKeyConst.MODIFYUSER:
case JnpfKeyConst.CURRORGANIZE:
case JnpfKeyConst.CURRPOSITION:
case JnpfKeyConst.DEPSELECT:
case JnpfKeyConst.POSSELECT:
case JnpfKeyConst.USERSELECT:
case JnpfKeyConst.POPUPTABLESELECT:
case JnpfKeyConst.ROLESELECT:
case JnpfKeyConst.GROUPSELECT:
case JnpfKeyConst.RADIO:
case JnpfKeyConst.SELECT:
case JnpfKeyConst.TREESELECT:
case JnpfKeyConst.CHECKBOX:
case JnpfKeyConst.CASCADER:
case JnpfKeyConst.COMSELECT:
case JnpfKeyConst.ADDRESS:
case JnpfKeyConst.SWITCH:
tag = true;
break;
}
return tag;
}
/// <summary>
/// 系统控件不更新.
/// </summary>
/// <param name="jnpfKey">控件Key.</param>
/// <returns></returns>
public static bool JudgeControlIsSystemControls(string jnpfKey)
{
bool tag = true;
switch (jnpfKey)
{
case JnpfKeyConst.CREATEUSER:
case JnpfKeyConst.CREATETIME:
case JnpfKeyConst.CURRPOSITION:
case JnpfKeyConst.CURRORGANIZE:
case JnpfKeyConst.BILLRULE:
tag = false;
break;
}
return tag;
}
/// <summary>
/// 获取控件数据来源ID.
/// </summary>
/// <param name="jnpfKey">控件Key.</param>
/// <param name="dataType">数据类型.</param>
/// <param name="control">控件全属性.</param>
/// <returns></returns>
public static string GetControlsPropsUrl(string jnpfKey, string dataType, FieldsModel control)
{
string propsUrl = string.Empty;
switch (jnpfKey)
{
case JnpfKeyConst.POPUPTABLESELECT:
propsUrl = control.interfaceId;
break;
default:
switch (dataType)
{
case "dictionary":
propsUrl = control.__config__.dictionaryType;
break;
default:
propsUrl = control.__config__.propsUrl;
break;
}
break;
}
return propsUrl;
}
/// <summary>
/// 获取控件指定选项的值.
/// </summary>
/// <param name="jnpfKey">控件Key.</param>
/// <param name="dataType">数据类型.</param>
/// <param name="control">控件全属性.</param>
/// <returns></returns>
public static string GetControlsLabel(string jnpfKey, string dataType, FieldsModel control)
{
string label = string.Empty;
switch (jnpfKey)
{
case JnpfKeyConst.POPUPTABLESELECT:
label = control.relationField;
break;
case JnpfKeyConst.CASCADER:
case JnpfKeyConst.TREESELECT:
label = control.props.props.label;
break;
default:
label = control.__config__.props?.label;
break;
}
return label;
}
/// <summary>
/// 获取控件指定选项标签.
/// </summary>
/// <param name="jnpfKey">控件Key.</param>
/// <param name="dataType">数据类型.</param>
/// <param name="control">控件全属性.</param>
/// <returns></returns>
public static string GetControlsValue(string jnpfKey, string dataType, FieldsModel control)
{
string value = string.Empty;
switch (jnpfKey)
{
case JnpfKeyConst.POPUPTABLESELECT:
value = control.propsValue;
break;
case JnpfKeyConst.CASCADER:
case JnpfKeyConst.TREESELECT:
value = control.props.props.value;
break;
default:
value = control.__config__.props?.value;
break;
}
return value;
}
/// <summary>
/// 获取控件指定选项的子选项.
/// </summary>
/// <param name="jnpfKey">控件Key.</param>
/// <param name="dataType">数据类型.</param>
/// <param name="control">控件全属性.</param>
/// <returns></returns>
public static string GetControlsChildren(string jnpfKey, string dataType, FieldsModel control)
{
string children = string.Empty;
switch (jnpfKey)
{
case JnpfKeyConst.CASCADER:
case JnpfKeyConst.TREESELECT:
children = control.props.props.children;
break;
default:
children = control.__config__.props?.children;
break;
}
return children;
}
/// <summary>
/// 获取导出配置.
/// </summary>
/// <param name="control">控件全属性.</param>
/// <param name="model">数据库真实字段.</param>
/// <param name="tableName">表名称.</param>
/// <returns></returns>
public static CodeGenFieldsModel GetImportConfig(FieldsModel control, string model, string tableName)
{
var fieldModel = new CodeGenFieldsModel();
var configModel = new CodeGenConfigModel();
fieldModel.__vModel__ = model;
fieldModel.level = control.level;
fieldModel.min = control.min;
fieldModel.max = control.max;
fieldModel.activeTxt = control.activeTxt;
fieldModel.inactiveTxt = control.inactiveTxt;
fieldModel.format = control.format;
fieldModel.multiple = CodeGenFieldJudgeHelper.IsMultipleColumn(control, model);
fieldModel.separator = control.separator;
fieldModel.__slot__ = control.__slot__?.ToObject<CodeGenSlotModel>()?.ToJsonString().ToJsonString();
fieldModel.props = control.props?.ToObject<CodeGenPropsModel>()?.ToJsonString().ToJsonString();
fieldModel.options = control.options?.ToObject<List<object>>()?.ToJsonString().ToJsonString();
fieldModel.propsValue = control.propsValue;
fieldModel.relationField = control.relationField;
fieldModel.modelId = control.modelId;
fieldModel.interfaceId = control.interfaceId;
fieldModel.selectType = control.selectType;
fieldModel.ableDepIds = control.ableDepIds?.ToJsonString().ToJsonString();
fieldModel.ablePosIds = control.ablePosIds?.ToJsonString().ToJsonString();
fieldModel.ableUserIds = control.ableUserIds?.ToJsonString().ToJsonString();
fieldModel.ableRoleIds = control.ableRoleIds?.ToJsonString().ToJsonString();
fieldModel.ableGroupIds = control.ableGroupIds?.ToJsonString().ToJsonString();
fieldModel.ableIds = control.ableIds?.ToJsonString().ToJsonString();
configModel = control.__config__.ToObject<CodeGenConfigModel>();
configModel.tableName = tableName;
fieldModel.__config__ = configModel.ToJsonString().ToJsonString();
return fieldModel;
}
/// <summary>
/// 获取需解析的字段集合.
/// </summary>
/// <param name="control"></param>
/// <param name="isInlineEditor"></param>
/// <returns>jnpfKey @@ vmodel集合以 , 号隔开.</returns>
public static List<string[]> GetParsJnpfKeyConstList(List<FieldsModel> control, bool isInlineEditor)
{
var res = new Dictionary<string, List<string>>();
control.ForEach(item =>
{
switch (item.__config__.jnpfKey)
{
case JnpfKeyConst.USERSSELECT: // 用户选择组件(包含组织、角色、岗位、分组、用户 Id)
if (!res.ContainsKey(JnpfKeyConst.USERSSELECT)) res.Add(JnpfKeyConst.USERSSELECT, new List<string>());
res[JnpfKeyConst.USERSSELECT].Add(item.__vModel__);
break;
case JnpfKeyConst.TABLE: // 遍历 子表 控件
var ctRes = GetParsJnpfKeyConstList(item.__config__.children, isInlineEditor);
if (ctRes != null && ctRes.Any())
{
foreach (var ct in ctRes)
{
if (!res.ContainsKey(ct.FirstOrDefault())) res.Add(ct.FirstOrDefault(), new List<string>());
res[ct.FirstOrDefault()].AddRange(ct.LastOrDefault().Split(','));
}
}
break;
}
});
var ret = new List<string[]>();
foreach (var item in res)
{
// 如果是行内编辑
if (isInlineEditor)
{
var newValue = new List<string>();
foreach (var it in item.Value) newValue.Add(it + "_name");
res[item.Key] = newValue;
}
}
foreach (var item in res)
{
ret.Add(new string[] { item.Key, string.Join(",", item.Value) });
}
return ret;
}
/// <summary>
/// 获取需解析的字段集合.
/// </summary>
/// <param name="control"></param>
/// <param name="isInlineEditor"></param>
/// <returns>jnpfKey @@ vmodel集合以 , 号隔开.</returns>
public static List<string[]> GetParsJnpfKeyConstListDetails(List<FieldsModel> control)
{
var res = new Dictionary<string, List<string>>();
control.ForEach(item =>
{
switch (item.__config__.jnpfKey)
{
case JnpfKeyConst.USERSSELECT: // 用户选择组件(包含组织、角色、岗位、分组、用户 Id)
if (!res.ContainsKey(JnpfKeyConst.USERSSELECT)) res.Add(JnpfKeyConst.USERSSELECT, new List<string>());
res[JnpfKeyConst.USERSSELECT].Add(item.__vModel__);
break;
case JnpfKeyConst.POPUPTABLESELECT: // 下拉表格.
if (!res.ContainsKey(JnpfKeyConst.POPUPTABLESELECT)) res.Add(JnpfKeyConst.POPUPTABLESELECT, new List<string>());
res[JnpfKeyConst.POPUPTABLESELECT].Add(item.__vModel__);
break;
case JnpfKeyConst.POPUPSELECT: // 弹窗选择.
if (!res.ContainsKey(JnpfKeyConst.POPUPSELECT)) res.Add(JnpfKeyConst.POPUPSELECT, new List<string>());
res[JnpfKeyConst.POPUPSELECT].Add(item.__vModel__);
break;
case JnpfKeyConst.RELATIONFORM: // 关联表单.
if (!res.ContainsKey(JnpfKeyConst.RELATIONFORM)) res.Add(JnpfKeyConst.RELATIONFORM, new List<string>());
res[JnpfKeyConst.RELATIONFORM].Add(item.__vModel__);
break;
case JnpfKeyConst.TABLE: // 遍历 子表 控件
var ctRes = GetParsJnpfKeyConstListDetails(item.__config__.children);
if (ctRes != null && ctRes.Any())
{
foreach (var ct in ctRes)
{
if (!res.ContainsKey(item.__vModel__ + "-" + ct.FirstOrDefault())) res.Add(item.__vModel__ + "-" + ct.FirstOrDefault(), new List<string>());
res[item.__vModel__ + "-" + ct.FirstOrDefault()].AddRange(ct.LastOrDefault().Split(','));
}
}
break;
}
});
var ret = new List<string[]>();
foreach (var item in res)
{
ret.Add(new string[] { item.Key, string.Join(",", item.Value) });
}
return ret;
}
}

View File

@@ -0,0 +1,28 @@
using System.Text;
namespace JNPF.VisualDev.Engine.Security;
/// <summary>
/// 代码生成导出字段帮助类.
/// </summary>
public class CodeGenExportFieldHelper
{
/// <summary>
/// 获取主表字段名.
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
public static string ExportColumnField(List<IndexGridFieldModel>? list)
{
StringBuilder columnSb = new StringBuilder();
if (list != null)
{
foreach (var item in list)
{
columnSb.AppendFormat("{{\\\"value\\\":\\\"{0}\\\",\\\"field\\\":\\\"{1}\\\"}},", item.label, item.prop);
}
}
return columnSb.ToString();
}
}

View File

@@ -0,0 +1,162 @@
using JNPF.Common.Const;
using JNPF.Common.Extension;
using JNPF.VisualDev.Engine.Model.CodeGen;
namespace JNPF.VisualDev.Engine.Security;
/// <summary>
/// 代码生成表字段判断帮助类.
/// </summary>
public class CodeGenFieldJudgeHelper
{
/// <summary>
/// 是否查询列.
/// </summary>
/// <param name="searchList">模板内查询列表.</param>
/// <param name="fieldName">字段名称.</param>
/// <returns></returns>
public static bool IsColumnQueryWhether(List<IndexSearchFieldModel>? searchList, string fieldName)
{
var column = searchList?.Any(s => s.prop == fieldName);
return column ?? false;
}
/// <summary>
/// 列查询类型.
/// </summary>
/// <param name="searchList">模板内查询列表.</param>
/// <param name="fieldName">字段名称.</param>
/// <returns></returns>
public static int ColumnQueryType(List<IndexSearchFieldModel>? searchList, string fieldName)
{
var column = searchList?.Find(s => s.prop == fieldName);
return column?.searchType ?? 0;
}
/// <summary>
/// 是否展示列.
/// </summary>
/// <param name="columnList">模板内展示字段.</param>
/// <param name="fieldName">字段名称.</param>
/// <returns></returns>
public static bool IsShowColumn(List<IndexGridFieldModel>? columnList, string fieldName)
{
bool? column = columnList?.Any(s => s.prop == fieldName);
return column ?? false;
}
/// <summary>
/// 获取是否多选.
/// </summary>
/// <param name="columnList">模板内控件列表.</param>
/// <param name="fieldName">字段名称.</param>
/// <returns></returns>
public static bool IsMultipleColumn(List<FieldsModel> columnList, string fieldName)
{
bool isMultiple = false;
var column = columnList.Find(s => s.__vModel__ == fieldName);
if (column != null)
{
switch (column?.__config__.jnpfKey)
{
case JnpfKeyConst.CASCADER:
isMultiple = column.props.props.multiple;
break;
default:
isMultiple = column.multiple;
break;
}
}
return isMultiple;
}
/// <summary>
/// 获取是否多选.
/// </summary>
/// <param name="columnList">模板内控件列表.</param>
/// <param name="fieldName">字段名称.</param>
/// <returns></returns>
public static bool IsMultipleColumn(FieldsModel column, string fieldName)
{
bool isMultiple = false;
if (column != null)
{
switch (column?.__config__.jnpfKey)
{
case JnpfKeyConst.CASCADER:
isMultiple = column.props.props.multiple;
break;
default:
isMultiple = column.multiple;
break;
}
}
return isMultiple;
}
/// <summary>
/// 是否datetime.
/// </summary>
/// <param name="fields"></param>
/// <returns></returns>
public static bool IsDateTime(FieldsModel? fields)
{
bool isDateTime = false;
if (fields?.__config__.jnpfKey == JnpfKeyConst.DATE || fields?.__config__.jnpfKey == JnpfKeyConst.TIME)
isDateTime = true;
return isDateTime;
}
/// <summary>
/// 是否副表datetime.
/// </summary>
/// <param name="fields"></param>
/// <returns></returns>
public static bool IsSecondaryTableDateTime(FieldsModel? fields)
{
bool isDateTime = false;
if (fields?.__config__.jnpfKey == JnpfKeyConst.DATE || fields?.__config__.jnpfKey == JnpfKeyConst.TIME || fields?.__config__.jnpfKey == JnpfKeyConst.CREATETIME || fields?.__config__.jnpfKey == JnpfKeyConst.MODIFYTIME)
isDateTime = true;
return isDateTime;
}
/// <summary>
/// 是否子表映射.
/// </summary>
/// <param name="tableColumnConfig">表列.</param>
/// <returns></returns>
public static bool IsChildTableMapper(List<TableColumnConfigModel> tableColumnConfig)
{
bool isOpen = false;
tableColumnConfig.ForEach(item =>
{
switch (item.jnpfKey)
{
case JnpfKeyConst.CASCADER:
case JnpfKeyConst.ADDRESS:
case JnpfKeyConst.COMSELECT:
case JnpfKeyConst.UPLOADIMG:
case JnpfKeyConst.UPLOADFZ:
case JnpfKeyConst.DATE:
case JnpfKeyConst.TIME:
isOpen = true;
break;
case JnpfKeyConst.SELECT:
case JnpfKeyConst.USERSELECT:
case JnpfKeyConst.TREESELECT:
case JnpfKeyConst.DEPSELECT:
case JnpfKeyConst.POSSELECT:
switch (item.IsMultiple)
{
case true:
isOpen = true;
break;
}
break;
}
});
return isOpen;
}
}

View File

@@ -0,0 +1,274 @@
using JNPF.VisualDev.Engine.Model.CodeGen;
namespace JNPF.VisualDev.Engine.Security;
/// <summary>
/// 代码生成方法帮助类.
/// </summary>
public class CodeGenFunctionHelper
{
/// <summary>
/// 获取纯表单方法.
/// </summary>
/// <returns></returns>
public static List<CodeGenFunctionModel> GetPureFormMethod()
{
return new List<CodeGenFunctionModel>
{
new CodeGenFunctionModel()
{
FullName = "add",
IsInterface = true,
orderBy = 1,
}
};
}
/// <summary>
/// 获取纯表单带流程方法.
/// </summary>
/// <returns></returns>
public static List<CodeGenFunctionModel> GetPureFormWithProcessMethod()
{
return new List<CodeGenFunctionModel>
{
new CodeGenFunctionModel()
{
FullName = "info",
IsInterface = true,
orderBy = 1,
},
new CodeGenFunctionModel()
{
FullName = "save",
IsInterface = true,
orderBy = 2,
}
};
}
/// <summary>
/// 常规列表方法.
/// </summary>
/// <param name="hasPage">是否分页.</param>
/// <param name="btnsList">头部按钮.</param>
/// <param name="columnBtnsList">列表按钮.</param>
/// <returns></returns>
public static List<CodeGenFunctionModel> GetGeneralListMethod(bool hasPage, List<ButtonConfigModel> btnsList, List<ButtonConfigModel> columnBtnsList)
{
List<CodeGenFunctionModel> functionList = new List<CodeGenFunctionModel>
{
// 默认注入获取信息方法
new CodeGenFunctionModel()
{
FullName = "info",
IsInterface = true,
orderBy = 1,
}
};
// 根据是否分页注入默认列表方法.
switch (hasPage)
{
case false:
functionList.Add(new CodeGenFunctionModel()
{
FullName = "noPage",
IsInterface = true,
orderBy = 3,
});
break;
default:
functionList.Add(new CodeGenFunctionModel()
{
FullName = "page",
IsInterface = true,
orderBy = 3,
});
break;
}
btnsList?.ForEach(b =>
{
int orderBy = 0;
switch (b.value)
{
case "add":
orderBy = 4;
break;
case "upload":
orderBy = 5;
break;
case "download":
orderBy = 9;
break;
case "batchRemove":
orderBy = 8;
break;
}
if (b.value == "download" && !hasPage)
{
functionList.Add(new CodeGenFunctionModel()
{
FullName = "page",
IsInterface = false,
orderBy = 10,
});
}
else if (b.value == "download" && hasPage)
{
functionList.Add(new CodeGenFunctionModel()
{
FullName = "noPage",
IsInterface = false,
orderBy = 10,
});
}
functionList.Add(new CodeGenFunctionModel()
{
FullName = b.value,
IsInterface = true,
orderBy = orderBy,
});
});
columnBtnsList?.ForEach(c =>
{
int orderBy = 0;
switch (c.value)
{
case "edit":
orderBy = 7;
break;
case "remove":
orderBy = 6;
break;
case "detail":
orderBy = 2;
break;
}
functionList.Add(new CodeGenFunctionModel()
{
FullName = c.value,
IsInterface = true,
orderBy = orderBy,
});
});
return functionList;
}
/// <summary>
/// 常规列表带流程方法.
/// </summary>
/// <param name="hasPage"></param>
/// <param name="btnsList"></param>
/// <param name="columnBtnsList"></param>
/// <returns></returns>
public static List<CodeGenFunctionModel> GetGeneralListWithProcessMethod(bool hasPage, List<ButtonConfigModel> btnsList, List<ButtonConfigModel> columnBtnsList)
{
List<CodeGenFunctionModel> functionList = new List<CodeGenFunctionModel>
{
// 默认注入获取信息方法
new CodeGenFunctionModel()
{
FullName = "info",
IsInterface = true,
orderBy = 1,
}
};
// 根据是否分页注入默认列表方法.
switch (hasPage)
{
case false:
functionList.Add(new CodeGenFunctionModel()
{
FullName = "noPage",
IsInterface = true,
orderBy = 3,
});
break;
default:
functionList.Add(new CodeGenFunctionModel()
{
FullName = "page",
IsInterface = true,
orderBy = 3,
});
break;
}
btnsList?.ForEach(b =>
{
int orderBy = 0;
switch (b.value)
{
case "save":
orderBy = 4;
break;
case "upload":
orderBy = 5;
break;
case "download":
orderBy = 9;
break;
case "batchRemove":
orderBy = 8;
break;
}
if (b.value == "download" && !hasPage)
{
functionList.Add(new CodeGenFunctionModel()
{
FullName = "page",
IsInterface = false,
orderBy = 10,
});
}
else if (b.value == "download" && hasPage)
{
functionList.Add(new CodeGenFunctionModel()
{
FullName = "noPage",
IsInterface = false,
orderBy = 10,
});
}
functionList.Add(new CodeGenFunctionModel()
{
FullName = b.value,
IsInterface = true,
orderBy = orderBy,
});
});
columnBtnsList?.ForEach(c =>
{
int orderBy = 0;
switch (c.value)
{
case "remove":
orderBy = 6;
break;
case "detail":
orderBy = 2;
break;
}
functionList.Add(new CodeGenFunctionModel()
{
FullName = c.value,
IsInterface = true,
orderBy = orderBy,
});
});
return functionList;
}
}

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

View File

@@ -0,0 +1,730 @@
using JNPF.Common.Configuration;
namespace JNPF.VisualDev.Engine.Security;
/// <summary>
/// 代码生成目标路径帮助类.
/// </summary>
public class CodeGenTargetPathHelper
{
#region
/// <summary>
/// 前端页面生成文件路径.
/// </summary>
/// <param name="tableName">主表名称.</param>
/// <param name="fileName">压缩包名称.</param>
/// <param name="webType">页面类型1、纯表单2、表单加列表.</param>
/// <param name="enableFlow">是否开启流程(0-否,1-是).</param>
/// <param name="isDetail">是否有详情.</param>
/// <param name="hasSuperQuery">高级查询.</param>
/// <returns></returns>
public static List<string> FrontEndTargetPathList(string tableName, string fileName, int webType, int enableFlow, bool isDetail = false, bool hasSuperQuery = false)
{
var frontendPath = Path.Combine(KeyVariable.SystemPath, "CodeGenerate", fileName, "Net");
var indexPath = Path.Combine(frontendPath, "html", "PC", tableName, "index.vue");
var formPath = Path.Combine(frontendPath, "html", "PC", tableName, "Form.vue");
var detailPath = Path.Combine(frontendPath, "html", "PC", tableName, "Detail.vue");
var exportJsonPath = Path.Combine(frontendPath, "fff", "flowForm.fff");
var columnJsonPath = Path.Combine(frontendPath, "html", "PC", tableName, "columnList.js");
var superQueryJsonPath = Path.Combine(frontendPath, "html", "PC", tableName, "superQueryJson.js");
var pathList = new List<string>();
switch (webType)
{
case 1:
pathList.Add(indexPath);
pathList.Add(formPath);
if (enableFlow == 1)
pathList.Add(exportJsonPath);
break;
case 2:
pathList.Add(indexPath);
pathList.Add(formPath);
switch (enableFlow)
{
case 0:
if (isDetail)
pathList.Add(detailPath);
break;
case 1:
pathList.Add(exportJsonPath);
break;
}
pathList.Add(columnJsonPath);
if (hasSuperQuery)
pathList.Add(superQueryJsonPath);
break;
}
return pathList;
}
/// <summary>
/// 前端页面模板文件路径集合.
/// </summary>
/// <param name="webType">页面类型1、纯表单2、表单加列表3、表单列表工作流.</param>
/// <param name="enableFlow">是否开启流程(0-否,1-是).</param>
/// <param name="isDetail">是否有详情.</param>
/// <param name="hasSuperQuery">高级查询.</param>
/// <returns>返回前端模板地址列表.</returns>
public static List<string> FrontEndTemplatePathList(int webType, int enableFlow, bool isDetail = false, bool hasSuperQuery = false)
{
var templatePath = Path.Combine(App.WebHostEnvironment.WebRootPath, "Template");
var pathList = new List<string>();
switch (webType)
{
case 1:
switch (enableFlow)
{
case 1:
pathList.Add(Path.Combine(templatePath, "PureForm", "index.vue.vm"));
pathList.Add(Path.Combine(templatePath, "WorkflowForm.vue.vm"));
pathList.Add(Path.Combine(templatePath, "ExportJson.json.vm"));
break;
default:
pathList.Add(Path.Combine(templatePath, "Form.vue.vm"));
break;
}
break;
case 2:
switch (enableFlow)
{
case 1:
pathList.Add(Path.Combine(templatePath, "WorkflowIndex.vue.vm"));
pathList.Add(Path.Combine(templatePath, "WorkflowForm.vue.vm"));
pathList.Add(Path.Combine(templatePath, "ExportJson.json.vm"));
break;
default:
pathList.Add(Path.Combine(templatePath, "index.vue.vm"));
pathList.Add(Path.Combine(templatePath, "Form.vue.vm"));
if (isDetail)
pathList.Add(Path.Combine(templatePath, "Detail.vue.vm"));
break;
}
pathList.Add(Path.Combine(templatePath, "columnList.js.vm"));
if (hasSuperQuery)
pathList.Add(Path.Combine(templatePath, "superQueryJson.js.vm"));
break;
}
return pathList;
}
/// <summary>
/// 前端行内编辑页面生成文件路径.
/// </summary>
/// <param name="tableName">主表名称.</param>
/// <param name="fileName">压缩包名称.</param>
/// <param name="enableFlow">是否开启流程.</param>
/// <param name="isDetail">是否有详情.</param>
/// <param name="hasSuperQuery">高级查询.</param>
/// <returns></returns>
public static List<string> FrontEndInlineEditorTargetPathList(string tableName, string fileName, int enableFlow, bool isDetail = false, bool hasSuperQuery = false)
{
var frontendPath = Path.Combine(KeyVariable.SystemPath, "CodeGenerate", fileName, "Net");
var indexPath = Path.Combine(frontendPath, "html", "PC", tableName, "index.vue");
var detailPath = Path.Combine(frontendPath, "html", "PC", tableName, "Detail.vue");
var formPath = Path.Combine(frontendPath, "html", "PC", tableName, "Form.vue");
var exportJsonPath = Path.Combine(frontendPath, "fff", "ExportJson.fff");
var columnJsonPath = Path.Combine(frontendPath, "html", "PC", tableName, "columnList.js");
var superQueryJsonPath = Path.Combine(frontendPath, "html", "PC", tableName, "superQueryJson.js");
var pathList = new List<string>();
pathList.Add(indexPath);
switch (enableFlow)
{
case 0:
if (isDetail)
pathList.Add(detailPath);
break;
default:
if (isDetail)
pathList.Add(formPath);
pathList.Add(exportJsonPath);
break;
}
pathList.Add(columnJsonPath);
if (hasSuperQuery)
pathList.Add(superQueryJsonPath);
return pathList;
}
/// <summary>
/// 前端行内编辑页面模板文件路径集合.
/// </summary>
/// <param name="enableFlow">是否开启流程.</param>
/// <param name="isDetail">是否有详情.</param>
/// <param name="hasSuperQuery">高级查询.</param>
/// <returns>返回前端模板地址列表.</returns>
public static List<string> FrontEndInlineEditorTemplatePathList(int enableFlow, bool isDetail = false, bool hasSuperQuery = false)
{
var templatePath = Path.Combine(App.WebHostEnvironment.WebRootPath, "Template");
var pathList = new List<string>();
switch (enableFlow)
{
case 0:
pathList.Add(Path.Combine(templatePath, "editorIndex.vue.vm"));
if (isDetail)
pathList.Add(Path.Combine(templatePath, "Detail.vue.vm"));
break;
case 1:
pathList.Add(Path.Combine(templatePath, "editorWorkflowIndex.vue.vm"));
if (isDetail)
pathList.Add(Path.Combine(templatePath, "WorkflowForm.vue.vm"));
pathList.Add(Path.Combine(templatePath, "ExportJson.json.vm"));
break;
}
pathList.Add(Path.Combine(templatePath, "columnList.js.vm"));
if (hasSuperQuery)
pathList.Add(Path.Combine(templatePath, "superQueryJson.js.vm"));
return pathList;
}
/// <summary>
/// App前端带流程页面模板文件路径集合.
/// </summary>
/// <param name="webType">页面类型1、纯表单2、表单加列表.</param>
/// <returns></returns>
public static List<string> AppFrontEndWorkflowTemplatePathList(int webType)
{
var templatePath = Path.Combine(App.WebHostEnvironment.WebRootPath, "Template");
var pathList = new List<string>();
switch (webType)
{
case 1:
pathList.Add(Path.Combine(templatePath, "PureForm", "appWorkflowIndex.vue.vm"));
pathList.Add(Path.Combine(templatePath, "appWorkflowForm.vue.vm"));
break;
case 2:
pathList.Add(Path.Combine(templatePath, "appWorkflowIndex.vue.vm"));
pathList.Add(Path.Combine(templatePath, "appWorkflowForm.vue.vm"));
pathList.Add(Path.Combine(templatePath, "columnList.js.vm"));
break;
}
return pathList;
}
/// <summary>
/// 设置App前端带流程页面生成文件路径.
/// </summary>
/// <param name="tableName">主表名称.</param>
/// <param name="fileName">压缩包名称.</param>
/// <param name="webType">页面类型1、纯表单2、表单加列表.</param>
/// <param name="isDetail">是否开启详情.</param>
/// <returns></returns>
public static List<string> AppFrontEndWorkflowTargetPathList(string tableName, string fileName, int webType)
{
var frontendPath = Path.Combine(KeyVariable.SystemPath, "CodeGenerate", fileName, "Net");
var indexPath = Path.Combine(frontendPath, "html", "App", "index", tableName, "index.vue");
var formPath = Path.Combine(frontendPath, "html", "App", "form", tableName, "index.vue");
var columnJsonPath = Path.Combine(frontendPath, "html", "App", "index", tableName, "columnList.js");
var pathList = new List<string>();
switch (webType)
{
case 1:
pathList.Add(indexPath);
pathList.Add(formPath);
break;
case 2:
pathList.Add(indexPath);
pathList.Add(formPath);
pathList.Add(columnJsonPath);
break;
}
return pathList;
}
/// <summary>
/// App前端页面模板文件路径集合.
/// </summary>
/// <param name="webType">页面类型1、纯表单2、表单加列表3、表单列表工作流.</param>
/// <param name="isDetail">是否开启详情.</param>
/// <returns></returns>
public static List<string> AppFrontEndTemplatePathList(int webType, bool isDetail)
{
var templatePath = Path.Combine(App.WebHostEnvironment.WebRootPath, "Template");
var pathList = new List<string>();
switch (webType)
{
case 1:
pathList.Add(Path.Combine(templatePath, "appForm.vue.vm"));
break;
case 2:
pathList.Add(Path.Combine(templatePath, "appIndex.vue.vm"));
pathList.Add(Path.Combine(templatePath, "appForm.vue.vm"));
if (isDetail)
pathList.Add(Path.Combine(templatePath, "appDetail.vue.vm"));
pathList.Add(Path.Combine(templatePath, "columnList.js.vm"));
break;
}
return pathList;
}
/// <summary>
/// 设置App前端页面生成文件路径.
/// </summary>
/// <param name="tableName">主表名称.</param>
/// <param name="fileName">压缩包名称.</param>
/// <param name="webType">页面类型1、纯表单2、表单加列表.</param>
/// <param name="isDetail">是否开启详情.</param>
/// <returns></returns>
public static List<string> AppFrontEndTargetPathList(string tableName, string fileName, int webType, bool isDetail)
{
var frontendPath = Path.Combine(KeyVariable.SystemPath, "CodeGenerate", fileName, "Net");
var indexPath = Path.Combine(frontendPath, "html", "App", tableName, "index.vue");
var formPath = Path.Combine(frontendPath, "html", "App", tableName, "form.vue");
var detailPath = Path.Combine(frontendPath, "html", "App", tableName, "Detail.vue");
var columnJsonPath = Path.Combine(frontendPath, "html", "App", tableName, "columnList.js");
var pathList = new List<string>();
switch (webType)
{
case 1:
pathList.Add(indexPath);
break;
case 2:
pathList.Add(indexPath);
pathList.Add(formPath);
if (isDetail)
pathList.Add(detailPath);
pathList.Add(columnJsonPath);
break;
}
return pathList;
}
/// <summary>
/// 流程前端页面模板文件路径集合.
/// </summary>
/// <param name="logicType">逻辑类型4-pc,5-app.</param>
/// <returns></returns>
public static List<string> FlowFrontEndTemplatePathList(int logicType)
{
var pathList = new List<string>();
var templatePath = Path.Combine(App.WebHostEnvironment.WebRootPath, "Template");
switch (logicType)
{
case 4:
pathList.Add(Path.Combine(templatePath, "WorkflowForm.vue.vm"));
break;
case 5:
pathList.Add(Path.Combine(templatePath, "appWorkflowForm.vue.vm"));
break;
}
pathList.Add(Path.Combine(templatePath, "ExportJson.json.vm"));
return pathList;
}
/// <summary>
/// 流程前端页面生成文件路径.
/// </summary>
/// <param name="logicType">逻辑类型4-pc,5-app.</param>
/// <param name="tableName">主表名称.</param>
/// <param name="fileName">压缩包名称.</param>
/// <returns></returns>
public static List<string> FlowFrontEndTargetPathList(int logicType, string tableName, string fileName)
{
var pathList = new List<string>();
var frontendPath = Path.Combine(KeyVariable.SystemPath, "CodeGenerate", fileName, "Net");
var indexPath = Path.Combine(frontendPath, "html", "PC", tableName, "index.vue");
var indexAppPath = Path.Combine(frontendPath, "html", "APP", tableName, "index.vue");
var exportJsonPath = Path.Combine(frontendPath, "fff", "flowForm.fff");
switch (logicType)
{
case 4:
pathList.Add(indexPath);
break;
case 5:
pathList.Add(indexAppPath);
break;
}
pathList.Add(exportJsonPath);
return pathList;
}
#endregion
#region
/// <summary>
/// 后端模板文件路径集合.
/// </summary>
/// <param name="genModel">SingleTable-单主表,MainBelt-主带子,,,.</param>
/// <param name="webType">生成模板类型1、纯表单2、表单加列表3、表单列表工作流.</param>
/// <param name="enableFlow">是否开启工作流.</param>
/// <param name="isMapper">是否对象映射.</param>
/// <returns></returns>
public static List<string> BackendTemplatePathList(string genModel, int webType, int enableFlow, bool isMapper)
{
List<string> templatePathList = new List<string>();
var templatePath = Path.Combine(App.WebHostEnvironment.WebRootPath, "Template");
switch (webType)
{
case 1:
templatePathList.Add(Path.Combine(templatePath, genModel, "Service.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, "IService.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "Entity.cs.vm"));
if (isMapper)
templatePathList.Add(Path.Combine(templatePath, genModel, "Mapper.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "CrInput.cs.vm"));
switch (enableFlow)
{
case 1:
templatePathList.Add(Path.Combine(templatePath, genModel, "InfoOutput.cs.vm"));
break;
}
break;
case 2:
templatePathList.Add(Path.Combine(templatePath, genModel, "Service.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, "IService.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "Entity.cs.vm"));
if (isMapper)
templatePathList.Add(Path.Combine(templatePath, genModel, "Mapper.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "CrInput.cs.vm"));
switch (enableFlow)
{
case 0:
templatePathList.Add(Path.Combine(templatePath, "UpInput.cs.vm"));
break;
}
templatePathList.Add(Path.Combine(templatePath, genModel, "ListQueryInput.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "InfoOutput.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "ListOutput.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "DetailOutput.cs.vm"));
break;
}
return templatePathList;
}
/// <summary>
/// 后端主表生成文件路径.
/// </summary>
/// <param name="tableName">表名.</param>
/// <param name="fileName">文件价名称.</param>
/// <param name="webType">页面类型1、纯表单2、表单加列表.</param>
/// <param name="enableFlow">是否开启工作流.</param>
/// <param name="isInlineEditor">是否行内编辑.</param>
/// <param name="isMapper">是否对象映射.</param>
/// <returns></returns>
public static List<string> BackendTargetPathList(string tableName, string fileName, int webType, int enableFlow, bool isInlineEditor, bool isMapper)
{
List<string> targetPathList = new List<string>();
var backendPath = Path.Combine(KeyVariable.SystemPath, "CodeGenerate", fileName, "Net");
var servicePath = Path.Combine(backendPath, "Controller", tableName, tableName + "Service.cs");
var iservicePath = Path.Combine(backendPath, "Controller", tableName, "I" + tableName + "Service.cs");
var entityPath = Path.Combine(backendPath, "Models", "Entity", tableName, tableName + "Entity.cs");
var mapperPath = Path.Combine(backendPath, "Models", "Mapper", tableName, tableName + "Mapper.cs");
var inputCrPath = Path.Combine(backendPath, "Models", "Dto", tableName, tableName + "CrInput.cs");
var inputUpPath = Path.Combine(backendPath, "Models", "Dto", tableName, tableName + "UpInput.cs");
var inputListQueryPath = Path.Combine(backendPath, "Models", "Dto", tableName, tableName + "ListQueryInput.cs");
var outputInfoPath = Path.Combine(backendPath, "Models", "Dto", tableName, tableName + "InfoOutput.cs");
var outputListPath = Path.Combine(backendPath, "Models", "Dto", tableName, tableName + "ListOutput.cs");
var outputDetailPath = Path.Combine(backendPath, "Models", "Dto", tableName, tableName + "DetailOutput.cs");
var inlineEditorListPath = Path.Combine(backendPath, "Models", "Dto", tableName, tableName + "InlineEditorOutput.cs");
switch (webType)
{
case 1:
targetPathList.Add(servicePath);
targetPathList.Add(iservicePath);
targetPathList.Add(entityPath);
if (isMapper)
targetPathList.Add(mapperPath);
targetPathList.Add(inputCrPath);
switch (enableFlow)
{
case 1:
targetPathList.Add(outputInfoPath);
break;
}
break;
case 2:
targetPathList.Add(servicePath);
targetPathList.Add(iservicePath);
targetPathList.Add(entityPath);
if (isMapper)
targetPathList.Add(mapperPath);
targetPathList.Add(inputCrPath);
switch (enableFlow)
{
case 0:
targetPathList.Add(inputUpPath);
break;
}
targetPathList.Add(inputListQueryPath);
targetPathList.Add(outputInfoPath);
targetPathList.Add(outputListPath);
if (isInlineEditor)
targetPathList.Add(inlineEditorListPath);
targetPathList.Add(outputDetailPath);
break;
}
return targetPathList;
}
/// <summary>
/// 后端行内编辑模板文件路径集合.
/// </summary>
/// <param name="genModel">SingleTable-单主表,MainBelt-主带子,,,.</param>
/// <param name="webType">生成模板类型1、纯表单2、表单加列表3、表单列表工作流.</param>
/// <param name="enableFlow">是否开启工作流.</param>
/// <param name="isMapper">是否对象映射.</param>
/// <returns></returns>
public static List<string> BackendInlineEditorTemplatePathList(string genModel, int webType, int enableFlow, bool isMapper)
{
List<string> templatePathList = new List<string>();
var templatePath = Path.Combine(App.WebHostEnvironment.WebRootPath, "Template");
switch (webType)
{
case 2:
templatePathList.Add(Path.Combine(templatePath, genModel, "InlineEditor", "Service.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, "IService.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "Entity.cs.vm"));
if (isMapper)
templatePathList.Add(Path.Combine(templatePath, genModel, "Mapper.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "CrInput.cs.vm"));
switch (enableFlow)
{
case 0:
templatePathList.Add(Path.Combine(templatePath, "UpInput.cs.vm"));
break;
}
templatePathList.Add(Path.Combine(templatePath, genModel, "ListQueryInput.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "InfoOutput.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "InlineEditor", "ListOutput.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "InlineEditor", "InlineEditorOutput.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "DetailOutput.cs.vm"));
break;
}
return templatePathList;
}
#endregion
#region
/// <summary>
/// 后端模板文件路径集合.
/// </summary>
/// <param name="genModel">SingleTable-单主表,MainBelt-主带子,,,.</param>
/// <param name="webType">生成模板类型1、纯表单2、表单加列表.</param>
/// <param name="type">模板类型.</param>
/// <param name="isMapper">是否对象映射.</param>
/// <param name="isShowSubTableField">是否展示子表字段.</param>
/// <returns></returns>
public static List<string> BackendChildTableTemplatePathList(string genModel, int webType, int type, bool isMapper, bool isShowSubTableField)
{
List<string> templatePathList = new List<string>();
var templatePath = Path.Combine(App.WebHostEnvironment.WebRootPath, "Template");
switch (webType)
{
case 1:
templatePathList.Add(Path.Combine(templatePath, genModel, "Entity.cs.vm"));
if (isMapper)
templatePathList.Add(Path.Combine(templatePath, genModel, "Mapper.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "CrInput.cs.vm"));
if (type == 3)
templatePathList.Add(Path.Combine(templatePath, genModel, "InfoOutput.cs.vm"));
break;
case 2:
templatePathList.Add(Path.Combine(templatePath, genModel, "Entity.cs.vm"));
if (isMapper)
templatePathList.Add(Path.Combine(templatePath, genModel, "Mapper.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "CrInput.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, "UpInput.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "InfoOutput.cs.vm"));
if (isShowSubTableField)
templatePathList.Add(Path.Combine(templatePath, genModel, "ListOutput.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "DetailOutput.cs.vm"));
break;
}
return templatePathList;
}
/// <summary>
/// 后端主表生成文件路径.
/// </summary>
/// <param name="tableName">表名.</param>
/// <param name="fileName">文件价名称.</param>
/// <param name="webType">页面类型1、纯表单2、表单加列表.</param>
/// <param name="type">模板类型.</param>
/// <param name="isMapper">是否对象映射.</param>
/// <param name="isShowSubTableField">是否展示子表字段.</param>
/// <returns></returns>
public static List<string> BackendChildTableTargetPathList(string tableName, string fileName, int webType, int type, bool isMapper, bool isShowSubTableField)
{
List<string> targetPathList = new List<string>();
var backendPath = Path.Combine(KeyVariable.SystemPath, "CodeGenerate", fileName, "Net");
var entityPath = Path.Combine(backendPath, "Models", "Entity", (type == 3 ? "WorkFlowForm\\" : string.Empty) + tableName, tableName + "Entity.cs");
var mapperPath = Path.Combine(backendPath, "Models", "Mapper", tableName, tableName + "Mapper.cs");
var inputCrPath = Path.Combine(backendPath, "Models", "Dto", (type == 3 ? "WorkFlowForm\\" : string.Empty) + tableName, tableName + "CrInput.cs");
var inputUpPath = Path.Combine(backendPath, "Models", "Dto", (type == 3 ? "WorkFlowForm\\" : string.Empty) + tableName, tableName + "UpInput.cs");
var outputInfoPath = Path.Combine(backendPath, "Models", "Dto", (type == 3 ? "WorkFlowForm\\" : string.Empty) + tableName, tableName + "InfoOutput.cs");
var outputListPath = Path.Combine(backendPath, "Models", "Dto", (type == 3 ? "WorkFlowForm\\" : string.Empty) + tableName, tableName + "ListOutput.cs");
var inputListQueryPath = Path.Combine(backendPath, "Models", "Dto", (type == 3 ? "WorkFlowForm\\" : string.Empty) + tableName, tableName + "ListQueryInput.cs");
var outputDetailPath = Path.Combine(backendPath, "Models", "Dto", (type == 3 ? "WorkFlowForm\\" : string.Empty) + tableName, tableName + "DetailOutput.cs");
switch (webType)
{
case 1:
targetPathList.Add(entityPath);
if (isMapper)
targetPathList.Add(mapperPath);
targetPathList.Add(inputCrPath);
if (type == 3)
targetPathList.Add(outputInfoPath);
break;
case 2:
targetPathList.Add(entityPath);
if (isMapper)
targetPathList.Add(mapperPath);
targetPathList.Add(inputCrPath);
targetPathList.Add(inputUpPath);
targetPathList.Add(outputInfoPath);
if (isShowSubTableField)
targetPathList.Add(outputListPath);
targetPathList.Add(outputDetailPath);
break;
}
return targetPathList;
}
#endregion
#region
/// <summary>
/// 后端副表生成文件路径.
/// </summary>
/// <param name="tableName">表名.</param>
/// <param name="fileName">文件价名称.</param>
/// <param name="webType">生成模板类型1、纯表单2、表单加列表.</param>
/// <param name="type">模板类型.</param>
/// <param name="enableFlow">是否开启流程.</param>
/// <returns></returns>
public static List<string> BackendAuxiliaryTargetPathList(string tableName, string fileName, int webType, int type, int enableFlow)
{
List<string> targetPathList = new List<string>();
var backendPath = Path.Combine(KeyVariable.SystemPath, "CodeGenerate", fileName, "Net");
var entityPath = Path.Combine(backendPath, "Models", "Entity", type == 3 ? "WorkFlowForm\\" + tableName : tableName, tableName + "Entity.cs");
var mapperPath = Path.Combine(backendPath, "Models", "Mapper", tableName, tableName + "Mapper.cs");
var inputCrPath = Path.Combine(backendPath, "Models", "Dto", type == 3 ? "WorkFlowForm\\" + tableName : tableName, tableName + "CrInput.cs");
var outputInfoPath = Path.Combine(backendPath, "Models", "Dto", type == 3 ? "WorkFlowForm\\" + tableName : tableName, tableName + "InfoOutput.cs");
switch (webType)
{
case 1:
targetPathList.Add(entityPath);
targetPathList.Add(mapperPath);
targetPathList.Add(inputCrPath);
if (enableFlow == 1 || type == 3)
targetPathList.Add(outputInfoPath);
break;
default:
targetPathList.Add(entityPath);
targetPathList.Add(mapperPath);
targetPathList.Add(inputCrPath);
targetPathList.Add(outputInfoPath);
break;
}
return targetPathList;
}
/// <summary>
/// 后端副表模板文件路径集合.
/// </summary>
/// <param name="genModel">SingleTable-单主表,MainBelt-主带子,,,.</param>
/// <param name="webType">生成模板类型1、纯表单2、表单加列表.</param>
/// <param name="enableFlow">是否开启流程.</param>
/// <returns></returns>
public static List<string> BackendAuxiliaryTemplatePathList(string genModel, int webType, int type, int enableFlow)
{
List<string> templatePathList = new List<string>();
var templatePath = Path.Combine(App.WebHostEnvironment.WebRootPath, "Template");
switch (webType)
{
case 1:
templatePathList.Add(Path.Combine(templatePath, genModel, "Entity.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "Mapper.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "CrInput.cs.vm"));
if (enableFlow == 1 || type == 3)
templatePathList.Add(Path.Combine(templatePath, genModel, "InfoOutput.cs.vm"));
break;
default:
templatePathList.Add(Path.Combine(templatePath, genModel, "Entity.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "Mapper.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "CrInput.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "InfoOutput.cs.vm"));
break;
}
return templatePathList;
}
#endregion
#region
/// <summary>
/// 后端流程模板文件路径集合.
/// </summary>
/// <param name="genModel">SingleTable-单主表,MainBelt-主带子,,,.</param>
/// <param name="isMapper">是否对象映射.</param>
/// <returns></returns>
public static List<string> BackendFlowTemplatePathList(string genModel, bool isMapper)
{
List<string> templatePathList = new List<string>();
var templatePath = Path.Combine(App.WebHostEnvironment.WebRootPath, "Template");
templatePathList.Add(Path.Combine(templatePath, genModel, "Service.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, "IService.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "Entity.cs.vm"));
if (isMapper)
templatePathList.Add(Path.Combine(templatePath, genModel, "Mapper.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "CrInput.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "InfoOutput.cs.vm"));
return templatePathList;
}
/// <summary>
/// 后端主表生成文件路径.
/// </summary>
/// <param name="tableName">表名.</param>
/// <param name="fileName">文件价名称.</param>
/// <param name="isMapper">是否对象映射.</param>
/// <returns></returns>
public static List<string> BackendFlowTargetPathList(string tableName, string fileName, bool isMapper)
{
List<string> targetPathList = new List<string>();
var backendPath = Path.Combine(KeyVariable.SystemPath, "CodeGenerate", fileName, "Net");
var servicePath = Path.Combine(backendPath, "Controller", tableName, tableName + "Service.cs");
var iservicePath = Path.Combine(backendPath, "Controller", tableName, "I" + tableName + "Service.cs");
var entityPath = Path.Combine(backendPath, "Models", "Entity", "WorkFlowForm", tableName + "Entity.cs");
var mapperPath = Path.Combine(backendPath, "Models", "Mapper", tableName, tableName + "Mapper.cs");
var inputCrPath = Path.Combine(backendPath, "Models", "Dto", "WorkFlowForm", tableName, tableName + "CrInput.cs");
var outputInfoPath = Path.Combine(backendPath, "Models", "Dto", "WorkFlowForm", tableName, tableName + "InfoOutput.cs");
targetPathList.Add(servicePath);
targetPathList.Add(iservicePath);
targetPathList.Add(entityPath);
if (isMapper)
targetPathList.Add(mapperPath);
targetPathList.Add(inputCrPath);
targetPathList.Add(outputInfoPath);
return targetPathList;
}
#endregion
}

View File

@@ -0,0 +1,291 @@
using JNPF.Common.Const;
using JNPF.Common.Extension;
namespace JNPF.VisualDev.Engine.Security;
/// <summary>
/// 代码生成 统一处理帮助类.
/// </summary>
public class CodeGenUnifiedHandlerHelper
{
/// <summary>
/// 统一处理表单内控件.
/// </summary>
/// <returns></returns>
public static List<FieldsModel> UnifiedHandlerFormDataModel(List<FieldsModel> formDataModel, ColumnDesignModel pcColumnDesignModel, ColumnDesignModel appColumnDesignModel, bool isMain = true, string tableControlsKey = "")
{
var template = new List<FieldsModel>();
// 循环表单内控件
formDataModel.ForEach(item =>
{
var config = item.__config__;
switch (config.jnpfKey)
{
case JnpfKeyConst.TABLE:
item.__config__.children = UnifiedHandlerFormDataModel(item.__config__.children, pcColumnDesignModel, appColumnDesignModel, false, item.__vModel__);
template.Add(item);
break;
default:
{
if (isMain)
{
// 是否为PC端查询字段与移动端查询字段
bool pcSearch = (pcColumnDesignModel?.searchList?.Any(it => it.__vModel__.Equals(item.__vModel__))).ParseToBool();
bool appSearch = (appColumnDesignModel?.searchList?.Any(it => it.__vModel__.Equals(item.__vModel__))).ParseToBool();
if (pcSearch || appSearch)
item.isQueryField = true;
else
item.isQueryField = false;
bool pcColumn = (pcColumnDesignModel?.columnList?.Any(it => it.__vModel__.Equals(item.__vModel__))).ParseToBool();
bool appColumn = (appColumnDesignModel?.columnList?.Any(it => it.__vModel__.Equals(item.__vModel__))).ParseToBool();
if (pcColumn || appColumn)
item.isIndexShow = true;
else
item.isIndexShow = false;
}
else
{
bool pcSearch = (pcColumnDesignModel?.searchList?.Any(it => it.__vModel__.Equals(string.Format("{0}-{1}", tableControlsKey, item.__vModel__)))).ParseToBool();
bool appSearch = (appColumnDesignModel?.searchList?.Any(it => it.__vModel__.Equals(string.Format("{0}-{1}", tableControlsKey, item.__vModel__)))).ParseToBool();
if (pcSearch || appSearch)
item.isQueryField = true;
else
item.isQueryField = false;
bool pcColumn = (pcColumnDesignModel?.columnList?.Any(it => it.__vModel__.Equals(string.Format("{0}-{1}", tableControlsKey, item.__vModel__)))).ParseToBool();
bool appColumn = (appColumnDesignModel?.columnList?.Any(it => it.__vModel__.Equals(string.Format("{0}-{1}", tableControlsKey, item.__vModel__)))).ParseToBool();
if (pcColumn || appColumn)
item.isIndexShow = true;
else
item.isIndexShow = false;
}
template.Add(item);
}
break;
}
});
return template;
}
/// <summary>
/// 统一处理表单内控件.
/// </summary>
/// <returns></returns>
public static List<FieldsModel> UnifiedHandlerFormDataModel(List<FieldsModel> formDataModel, ColumnDesignModel columnDesignModel, bool isMain = true, string tableControlsKey = "")
{
var template = new List<FieldsModel>();
// 循环表单内控件
formDataModel.ForEach(item =>
{
var config = item.__config__;
switch (config.jnpfKey)
{
case JnpfKeyConst.TABLE:
item.__config__.children = UnifiedHandlerFormDataModel(item.__config__.children, columnDesignModel, false, item.__vModel__);
template.Add(item);
break;
default:
{
if (isMain)
{
// 是否为PC端查询字段与移动端查询字段
bool search = (bool)columnDesignModel?.searchList?.Any(it => it.__vModel__.Equals(item.__vModel__));
if (search)
item.isQueryField = true;
else
item.isQueryField = false;
bool column = (bool)columnDesignModel?.columnList?.Any(it => it.__vModel__.Equals(item.__vModel__));
if (column)
item.isIndexShow = true;
else
item.isIndexShow = false;
}
else
{
bool search = (bool)columnDesignModel?.searchList?.Any(it => it.__vModel__.Equals(string.Format("{0}-{1}", tableControlsKey, item.__vModel__)));
if (search)
{
item.isQueryField = true;
item.superiorVModel = tableControlsKey;
}
else
{
item.isQueryField = false;
}
bool column = (bool)columnDesignModel?.columnList?.Any(it => it.__vModel__.Equals(string.Format("{0}-{1}", tableControlsKey, item.__vModel__)));
if (column)
item.isIndexShow = true;
else
item.isIndexShow = false;
}
template.Add(item);
}
break;
}
});
return template;
}
/// <summary>
/// 联动关系链判断.
/// </summary>
/// <param name="formDataModel"></param>
/// <param name="columnDesignModel"></param>
/// <param name="isMain"></param>
/// <param name="tableControlsKey"></param>
/// <returns></returns>
public static List<FieldsModel> LinkageChainJudgment(List<FieldsModel> formDataModel, ColumnDesignModel columnDesignModel, bool isMain = true, string tableControlsKey = "")
{
var NewFormDataModel = formDataModel.Copy();
var childrenFormModel = new List<FieldsModel>();
if (!isMain)
{
formDataModel = NewFormDataModel.Find(it => it.__vModel__.Equals(tableControlsKey) && it.__config__.jnpfKey.Equals(JnpfKeyConst.TABLE)).__config__.children;
childrenFormModel = formDataModel.Copy();
}
formDataModel.ForEach(item =>
{
var config = item.__config__;
switch (config.jnpfKey)
{
case JnpfKeyConst.TABLE:
{
NewFormDataModel = LinkageChainJudgment(NewFormDataModel, columnDesignModel, false, item.__vModel__);
}
break;
case JnpfKeyConst.RADIO:
case JnpfKeyConst.CHECKBOX:
case JnpfKeyConst.SELECT:
case JnpfKeyConst.CASCADER:
case JnpfKeyConst.TREESELECT:
switch (isMain)
{
case true:
// dataType = dynamic && templateJson属性有长度则代表有远端联动
if (config.dataType == "dynamic" && config.templateJson?.Count() > 0)
{
config.templateJson.FindAll(it => it.relationField.Any()).ForEach(items =>
{
var fieldModel = NewFormDataModel.Where(it => it.__vModel__.Equals(items.relationField) && it.__config__.jnpfKey.Equals(items.jnpfKey)).FirstOrDefault();
fieldModel.IsLinked = true;
List<LinkageConfig> linkageConfigs = new List<LinkageConfig>
{
new LinkageConfig()
{
field = item.__vModel__,
fieldName = item.__vModel__.ToLowerCase(),
jnpfKey = config.jnpfKey,
IsMultiple = config.jnpfKey.Equals(JnpfKeyConst.CASCADER) ? item.props.props.multiple : config.jnpfKey.Equals(JnpfKeyConst.CHECKBOX)? true: item.multiple,
}
};
fieldModel.linkageReverseRelationship.AddRange(linkageConfigs);
});
}
break;
default:
if (config.dataType == "dynamic" && config.templateJson?.Count() > 0)
{
var childrenFieldModel = childrenFormModel.Where(it => item.__vModel__.Equals(it.__vModel__) && it.__config__.jnpfKey.Equals(config.jnpfKey)).FirstOrDefault();
childrenFieldModel.IsLinkage = true;
config.templateJson.FindAll(it => it.relationField.Any()).ForEach(items =>
{
var isTrigger = false;
var fieldModel = childrenFormModel.Where(it => items.relationField.Equals(string.Format("{0}-{1}", tableControlsKey, it.__vModel__)) && it.__config__.jnpfKey.Equals(items.jnpfKey)).FirstOrDefault();
if (fieldModel == null)
{
isTrigger = true;
fieldModel = NewFormDataModel.Where(it => it.__vModel__.Equals(items.relationField) && it.__config__.jnpfKey.Equals(items.jnpfKey)).FirstOrDefault();
}
fieldModel.IsLinked = true;
List<LinkageConfig> linkageConfigs = new List<LinkageConfig>
{
new LinkageConfig()
{
field = item.__vModel__,
fieldName = tableControlsKey,
jnpfKey = config.jnpfKey,
isChildren = isTrigger,
IsMultiple = config.jnpfKey.Equals(JnpfKeyConst.CASCADER) ? item.props.props.multiple : item.multiple,
}
};
fieldModel.linkageReverseRelationship.AddRange(linkageConfigs);
});
}
break;
}
break;
case JnpfKeyConst.POPUPTABLESELECT:
case JnpfKeyConst.POPUPSELECT:
switch (isMain)
{
case true:
var mainFieldModel = NewFormDataModel.Where(it => item.__vModel__.Equals(it.__vModel__) && it.__config__.jnpfKey.Equals(config.jnpfKey)).FirstOrDefault();
mainFieldModel.IsLinkage = true;
item.templateJson?.FindAll(it => it.relationField.Any()).ForEach(items =>
{
var fieldModel = NewFormDataModel.Where(it => it.__vModel__.Equals(items.relationField) && it.__config__.jnpfKey.Equals(items.jnpfKey)).FirstOrDefault();
fieldModel.IsLinked = true;
List<LinkageConfig> linkageConfigs = new List<LinkageConfig>
{
new LinkageConfig()
{
field = item.__vModel__,
fieldName = item.__vModel__.ToLowerCase(),
jnpfKey = config.jnpfKey,
IsMultiple = config.jnpfKey.Equals(JnpfKeyConst.CASCADER) ? item.props.props.multiple : config.jnpfKey.Equals(JnpfKeyConst.CHECKBOX) ? true : item.multiple,
}
};
fieldModel.linkageReverseRelationship.AddRange(linkageConfigs);
});
break;
default:
var childrenFieldModel = childrenFormModel.Where(it => item.__vModel__.Equals(it.__vModel__) && it.__config__.jnpfKey.Equals(config.jnpfKey)).FirstOrDefault();
childrenFieldModel.IsLinkage = true;
item.templateJson?.FindAll(it => it.relationField.Any()).ForEach(items =>
{
var isTrigger = false;
var fieldModel = childrenFormModel.Where(it => items.relationField.Equals(string.Format("{0}-{1}", tableControlsKey, it.__vModel__)) && it.__config__.jnpfKey.Equals(items.jnpfKey)).FirstOrDefault();
if (fieldModel == null)
{
isTrigger = true;
fieldModel = NewFormDataModel.Where(it => it.__vModel__.Equals(items.relationField) && it.__config__.jnpfKey.Equals(items.jnpfKey)).FirstOrDefault();
}
fieldModel.IsLinked = true;
List<LinkageConfig> linkageConfigs = new List<LinkageConfig>
{
new LinkageConfig()
{
field = item.__vModel__,
fieldName = tableControlsKey,
jnpfKey = config.jnpfKey,
isChildren = isTrigger,
IsMultiple = config.jnpfKey.Equals(JnpfKeyConst.CASCADER) ? item.props.props.multiple : item.multiple,
}
};
fieldModel.linkageReverseRelationship.AddRange(linkageConfigs);
});
break;
}
break;
}
});
if (!isMain)
{
NewFormDataModel.Find(it => it.__vModel__.Equals(tableControlsKey) && it.__config__.jnpfKey.Equals(JnpfKeyConst.TABLE)).__config__.children = childrenFormModel;
}
return NewFormDataModel;
}
}

View File

@@ -0,0 +1,186 @@
using JNPF.Common.Const;
namespace JNPF.VisualDev.Engine.Security;
/// <summary>
/// 代码生成查询控件归类帮助类.
/// </summary>
public class CodeGenQueryControlClassificationHelper
{
/// <summary>
/// 列表查询控件.
/// </summary>
/// <param name="type">1-Web设计,2-App设计,3-流程表单,4-Web表单,5-App表单.</param>
/// <returns></returns>
public static Dictionary<string, List<string>> ListQueryControl(int type)
{
Dictionary<string, List<string>> listQueryControl = new Dictionary<string, List<string>>();
switch (type)
{
case 4:
{
var useInputList = new List<string>();
useInputList.Add(JnpfKeyConst.COMINPUT);
useInputList.Add(JnpfKeyConst.TEXTAREA);
useInputList.Add(JnpfKeyConst.JNPFTEXT);
useInputList.Add(JnpfKeyConst.BILLRULE);
listQueryControl["inputList"] = useInputList;
var useDateList = new List<string>();
useDateList.Add(JnpfKeyConst.CREATETIME);
useDateList.Add(JnpfKeyConst.MODIFYTIME);
listQueryControl["dateList"] = useDateList;
var useSelectList = new List<string>();
useSelectList.Add(JnpfKeyConst.SELECT);
useSelectList.Add(JnpfKeyConst.RADIO);
useSelectList.Add("checkbox");
listQueryControl["selectList"] = useSelectList;
var timePickerList = new List<string>();
timePickerList.Add(JnpfKeyConst.TIME);
listQueryControl["timePickerList"] = timePickerList;
var numRangeList = new List<string>();
numRangeList.Add(JnpfKeyConst.NUMINPUT);
numRangeList.Add(JnpfKeyConst.CALCULATE);
listQueryControl["numRangeList"] = numRangeList;
var datePickerList = new List<string>();
datePickerList.Add(JnpfKeyConst.DATE);
listQueryControl["datePickerList"] = datePickerList;
var userSelectList = new List<string>();
userSelectList.Add(JnpfKeyConst.CREATEUSER);
userSelectList.Add(JnpfKeyConst.MODIFYUSER);
userSelectList.Add(JnpfKeyConst.USERSELECT);
listQueryControl["userSelectList"] = userSelectList;
var usersSelectList = new List<string>();
usersSelectList.Add(JnpfKeyConst.USERSSELECT);
listQueryControl["usersSelectList"] = usersSelectList;
var comSelectList = new List<string>();
comSelectList.Add(JnpfKeyConst.COMSELECT);
comSelectList.Add(JnpfKeyConst.CURRORGANIZE);
listQueryControl["comSelectList"] = comSelectList;
var depSelectList = new List<string>();
depSelectList.Add(JnpfKeyConst.CURRDEPT);
depSelectList.Add(JnpfKeyConst.DEPSELECT);
listQueryControl["depSelectList"] = depSelectList;
var posSelectList = new List<string>();
posSelectList.Add(JnpfKeyConst.CURRPOSITION);
posSelectList.Add(JnpfKeyConst.POSSELECT);
listQueryControl["posSelectList"] = posSelectList;
var useCascaderList = new List<string>();
useCascaderList.Add(JnpfKeyConst.CASCADER);
listQueryControl["useCascaderList"] = useCascaderList;
var jNPFAddressList = new List<string>();
jNPFAddressList.Add(JnpfKeyConst.ADDRESS);
listQueryControl["JNPFAddressList"] = jNPFAddressList;
var treeSelectList = new List<string>();
treeSelectList.Add(JnpfKeyConst.TREESELECT);
listQueryControl["treeSelectList"] = treeSelectList;
}
break;
case 5:
{
var inputList = new List<string>();
inputList.Add(JnpfKeyConst.COMINPUT);
inputList.Add(JnpfKeyConst.TEXTAREA);
inputList.Add(JnpfKeyConst.JNPFTEXT);
inputList.Add(JnpfKeyConst.BILLRULE);
inputList.Add(JnpfKeyConst.CALCULATE);
listQueryControl["input"] = inputList;
var numRangeList = new List<string>();
numRangeList.Add(JnpfKeyConst.NUMINPUT);
listQueryControl["numRange"] = numRangeList;
var switchList = new List<string>();
switchList.Add(JnpfKeyConst.SWITCH);
listQueryControl["switch"] = switchList;
var selectList = new List<string>();
selectList.Add(JnpfKeyConst.RADIO);
selectList.Add(JnpfKeyConst.CHECKBOX);
selectList.Add(JnpfKeyConst.SELECT);
listQueryControl["select"] = selectList;
var cascaderList = new List<string>();
cascaderList.Add(JnpfKeyConst.CASCADER);
listQueryControl["cascader"] = cascaderList;
var timeList = new List<string>();
timeList.Add(JnpfKeyConst.TIME);
listQueryControl["time"] = timeList;
var dateList = new List<string>();
dateList.Add(JnpfKeyConst.DATE);
dateList.Add(JnpfKeyConst.CREATETIME);
dateList.Add(JnpfKeyConst.MODIFYTIME);
listQueryControl["date"] = dateList;
var comSelectList = new List<string>();
comSelectList.Add(JnpfKeyConst.COMSELECT);
listQueryControl["comSelect"] = comSelectList;
var depSelectList = new List<string>();
depSelectList.Add(JnpfKeyConst.DEPSELECT);
depSelectList.Add(JnpfKeyConst.CURRDEPT);
depSelectList.Add(JnpfKeyConst.CURRORGANIZE);
listQueryControl["depSelect"] = depSelectList;
var posSelectList = new List<string>();
posSelectList.Add(JnpfKeyConst.POSSELECT);
posSelectList.Add(JnpfKeyConst.CURRPOSITION);
listQueryControl["posSelect"] = posSelectList;
var userSelectList = new List<string>();
userSelectList.Add(JnpfKeyConst.USERSELECT);
userSelectList.Add(JnpfKeyConst.CREATEUSER);
userSelectList.Add(JnpfKeyConst.MODIFYUSER);
listQueryControl["userSelect"] = userSelectList;
var usersSelectList = new List<string>();
usersSelectList.Add(JnpfKeyConst.USERSSELECT);
listQueryControl["usersSelectList"] = usersSelectList;
var treeSelectList = new List<string>();
treeSelectList.Add(JnpfKeyConst.TREESELECT);
listQueryControl["treeSelect"] = treeSelectList;
var addressList = new List<string>();
addressList.Add(JnpfKeyConst.ADDRESS);
listQueryControl["address"] = addressList;
}
break;
}
return listQueryControl;
}
/// <summary>
/// 需要转换的列表列控件.
/// </summary>
/// <returns></returns>
public static Dictionary<string, List<string>> ListColumnControls()
{
Dictionary<string, List<string>> listColumnControlsType = new Dictionary<string, List<string>>();
var columnList = new List<string>();
columnList.Add("date");
columnList.Add("createTime");
columnList.Add("modifyTime");
listColumnControlsType["columnList"] = columnList;
return listColumnControlsType;
}
}