v3.4.6
This commit is contained in:
@@ -32,7 +32,10 @@ public class CodeGenWay
|
||||
columnDesignModel ??= new ColumnDesignModel();
|
||||
columnDesignModel.searchList = GetMultiEndQueryMerging(templateEntity, controls);
|
||||
columnDesignModel.columnList = GetMultiTerminalListDisplayAndConsolidation(templateEntity);
|
||||
FormDataModel formDataModel = templateEntity.FormData.ToObject<FormDataModel>();
|
||||
FormDataModel formDataModel = templateEntity.FormData.ToObjectOld<FormDataModel>();
|
||||
|
||||
// 移除流程引擎ID
|
||||
dbTableFields.RemoveAll(it => it.field.ReplaceRegex("^f_", string.Empty).ToLower().Equals("flowid"));
|
||||
|
||||
// 移除乐观锁
|
||||
dbTableFields.RemoveAll(it => it.field.ReplaceRegex("^f_", string.Empty).ToLower().Equals("version"));
|
||||
@@ -58,18 +61,18 @@ public class CodeGenWay
|
||||
IsConversion = false,
|
||||
IsSystemControl = false,
|
||||
IsAuxiliary = true,
|
||||
IsControlParsing = false,
|
||||
IsUpdate = false,
|
||||
TableNo = tableNo,
|
||||
TableName = tableName,
|
||||
});
|
||||
break;
|
||||
default:
|
||||
switch (controls.Any(c => c.__vModel__.Equals(string.Format("jnpf_{0}_jnpf_{1}", tableName, field))))
|
||||
var childControl = string.Format("jnpf_{0}_jnpf_{1}", tableName, field);
|
||||
switch (controls.Any(c => c.__vModel__.Equals(childControl)))
|
||||
{
|
||||
case true:
|
||||
var childControl = string.Empty;
|
||||
childControl = string.Format("jnpf_{0}_jnpf_{1}", tableName, field);
|
||||
FieldsModel control = controls.Find(c => c.__vModel__.Equals(string.Format("jnpf_{0}_jnpf_{1}", tableName, field)));
|
||||
FieldsModel control = controls.Find(c => c.__vModel__.Equals(childControl));
|
||||
var isImportField = templateEntity.WebType == 1 ? false : columnDesignModel?.uploaderTemplateJson?.selectKey?.Any(it => it.Equals(childControl));
|
||||
switch (control.__config__.jnpfKey)
|
||||
{
|
||||
@@ -86,7 +89,8 @@ public class CodeGenWay
|
||||
NetType = CodeGenHelper.ConvertDataType(column.dataType),
|
||||
PrimaryKey = column.primaryKey.ParseToBool(),
|
||||
QueryWhether = control.isQueryField,
|
||||
QueryType = CodeGenFieldJudgeHelper.ColumnQueryType(searchList: columnDesignModel.searchList, field),
|
||||
QueryType = CodeGenFieldJudgeHelper.ColumnQueryType(searchList: columnDesignModel.searchList, childControl),
|
||||
QueryMultiple = CodeGenFieldJudgeHelper.ColumnQueryMultiple(searchList: columnDesignModel.searchList, childControl),
|
||||
IsShow = control.isIndexShow,
|
||||
IsUnique = control.__config__.unique,
|
||||
IsMultiple = CodeGenFieldJudgeHelper.IsMultipleColumn(controls, field),
|
||||
@@ -95,8 +99,8 @@ public class CodeGenWay
|
||||
IsDateTime = CodeGenFieldJudgeHelper.IsSecondaryTableDateTime(control),
|
||||
ActiveTxt = control.activeTxt,
|
||||
InactiveTxt = control.inactiveTxt,
|
||||
IsDetailConversion = CodeGenControlsAttributeHelper.JudgeControlIsDataConversion(control.__config__.jnpfKey, "", CodeGenFieldJudgeHelper.IsMultipleColumn(controls, string.Format("jnpf_{0}_jnpf_{1}", tableName, field))),
|
||||
IsConversion = modelType == 1 ? CodeGenControlsAttributeHelper.JudgeContainsChildTableControlIsDataConversion(control.__config__.jnpfKey) : CodeGenControlsAttributeHelper.JudgeControlIsDataConversion(control.__config__.jnpfKey, "", CodeGenFieldJudgeHelper.IsMultipleColumn(controls, string.Format("jnpf_{0}_jnpf_{1}", tableName, field))),
|
||||
IsDetailConversion = CodeGenControlsAttributeHelper.JudgeControlIsDataConversion(control.__config__.jnpfKey, "", CodeGenFieldJudgeHelper.IsMultipleColumn(controls, childControl)),
|
||||
IsConversion = modelType == 1 ? CodeGenControlsAttributeHelper.JudgeContainsChildTableControlIsDataConversion(control.__config__.jnpfKey) : CodeGenControlsAttributeHelper.JudgeControlIsDataConversion(control.__config__.jnpfKey, "", CodeGenFieldJudgeHelper.IsMultipleColumn(controls, childControl)),
|
||||
IsSystemControl = true,
|
||||
IsUpdate = CodeGenControlsAttributeHelper.JudgeControlIsSystemControls(control.__config__.jnpfKey),
|
||||
IsAuxiliary = true,
|
||||
@@ -105,7 +109,9 @@ public class CodeGenWay
|
||||
FormatTableName = tableName.ParseToPascalCase(),
|
||||
ControlLabel = control.__config__.label,
|
||||
IsImportField = isImportField.ParseToBool(),
|
||||
IsControlParsing = false,
|
||||
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
||||
IsTreeParentField = childControl.Equals(columnDesignModel.parentField),
|
||||
});
|
||||
break;
|
||||
default:
|
||||
@@ -118,10 +124,11 @@ public class CodeGenWay
|
||||
DataType = column.dataType,
|
||||
NetType = CodeGenHelper.ConvertDataType(column.dataType),
|
||||
PrimaryKey = column.primaryKey.ParseToBool(),
|
||||
QueryWhether = CodeGenFieldJudgeHelper.IsColumnQueryWhether(searchList: columnDesignModel.searchList, string.Format("jnpf_{0}_jnpf_{1}", tableName, field)),
|
||||
QueryType = CodeGenFieldJudgeHelper.ColumnQueryType(searchList: columnDesignModel.searchList, string.Format("jnpf_{0}_jnpf_{1}", tableName, field)),
|
||||
IsShow = CodeGenFieldJudgeHelper.IsShowColumn(columnDesignModel.columnList, string.Format("jnpf_{0}_jnpf_{1}", tableName, field)),
|
||||
IsMultiple = CodeGenFieldJudgeHelper.IsMultipleColumn(controls, string.Format("jnpf_{0}_jnpf_{1}", tableName, field)),
|
||||
QueryWhether = CodeGenFieldJudgeHelper.IsColumnQueryWhether(searchList: columnDesignModel.searchList, childControl),
|
||||
QueryType = CodeGenFieldJudgeHelper.ColumnQueryType(searchList: columnDesignModel.searchList, childControl),
|
||||
QueryMultiple = CodeGenFieldJudgeHelper.ColumnQueryMultiple(searchList: columnDesignModel.searchList, childControl),
|
||||
IsShow = CodeGenFieldJudgeHelper.IsShowColumn(columnDesignModel.columnList, childControl),
|
||||
IsMultiple = CodeGenFieldJudgeHelper.IsMultipleColumn(controls, childControl),
|
||||
IsUnique = control.__config__.unique,
|
||||
jnpfKey = control.__config__.jnpfKey,
|
||||
Rule = control.__config__.rule,
|
||||
@@ -136,8 +143,8 @@ public class CodeGenWay
|
||||
Value = CodeGenControlsAttributeHelper.GetControlsValue(control.__config__.jnpfKey, dataType, control),
|
||||
Children = CodeGenControlsAttributeHelper.GetControlsChildren(control.__config__.jnpfKey, dataType, control),
|
||||
Separator = control.separator,
|
||||
IsDetailConversion = CodeGenControlsAttributeHelper.JudgeControlIsDataConversion(control.__config__.jnpfKey, dataType, CodeGenFieldJudgeHelper.IsMultipleColumn(controls, string.Format("jnpf_{0}_jnpf_{1}", tableName, field))),
|
||||
IsConversion = modelType == 1 ? CodeGenControlsAttributeHelper.JudgeContainsChildTableControlIsDataConversion(control.__config__.jnpfKey) : CodeGenControlsAttributeHelper.JudgeControlIsDataConversion(control.__config__.jnpfKey, "", CodeGenFieldJudgeHelper.IsMultipleColumn(controls, string.Format("jnpf_{0}_jnpf_{1}", tableName, field))),
|
||||
IsDetailConversion = CodeGenControlsAttributeHelper.JudgeControlIsDataConversion(control.__config__.jnpfKey, dataType, CodeGenFieldJudgeHelper.IsMultipleColumn(controls, childControl)),
|
||||
IsConversion = modelType == 1 ? CodeGenControlsAttributeHelper.JudgeContainsChildTableControlIsDataConversion(control.__config__.jnpfKey) : CodeGenControlsAttributeHelper.JudgeControlIsDataConversion(control.__config__.jnpfKey, "", CodeGenFieldJudgeHelper.IsMultipleColumn(controls, childControl)),
|
||||
IsSystemControl = false,
|
||||
IsUpdate = CodeGenControlsAttributeHelper.JudgeControlIsSystemControls(control.__config__.jnpfKey),
|
||||
IsAuxiliary = true,
|
||||
@@ -147,7 +154,9 @@ public class CodeGenWay
|
||||
ControlLabel = control.__config__.label,
|
||||
IsImportField = isImportField.ParseToBool(),
|
||||
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
||||
IsControlParsing = CodeGenFieldJudgeHelper.IsControlParsing(control),
|
||||
ShowField = control.relational,
|
||||
IsTreeParentField = childControl.Equals(columnDesignModel.parentField),
|
||||
});
|
||||
break;
|
||||
}
|
||||
@@ -168,6 +177,7 @@ public class CodeGenWay
|
||||
IsAuxiliary = true,
|
||||
IsUpdate = false,
|
||||
TableNo = tableNo,
|
||||
IsControlParsing = false,
|
||||
});
|
||||
break;
|
||||
}
|
||||
@@ -187,6 +197,9 @@ public class CodeGenWay
|
||||
// 是否对象映射
|
||||
bool isMapper = CodeGenFieldJudgeHelper.IsChildTableMapper(tableColumnList);
|
||||
|
||||
// 是否查询条件多选
|
||||
bool isSearchMultiple = tableColumnList.Any(it => it.QueryMultiple);
|
||||
|
||||
return new CodeGenConfigModel()
|
||||
{
|
||||
NameSpace = formDataModel.areasName,
|
||||
@@ -204,6 +217,7 @@ public class CodeGenWay
|
||||
PrimaryKeyPolicy = formDataModel.primaryKeyPolicy,
|
||||
IsImportData = tableColumnList.Any(it => it.IsImportField.Equals(true)),
|
||||
EnableFlow = templateEntity.EnableFlow == 1 ? true : false,
|
||||
IsSearchMultiple = isSearchMultiple,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -224,7 +238,10 @@ public class CodeGenWay
|
||||
columnDesignModel ??= new ColumnDesignModel();
|
||||
columnDesignModel.searchList = GetMultiEndQueryMerging(templateEntity, controls);
|
||||
columnDesignModel.columnList = GetMultiTerminalListDisplayAndConsolidation(templateEntity);
|
||||
FormDataModel formDataModel = templateEntity.FormData.ToObject<FormDataModel>();
|
||||
FormDataModel formDataModel = templateEntity.FormData.ToObjectOld<FormDataModel>();
|
||||
|
||||
// 移除流程引擎ID
|
||||
dbTableFields.RemoveAll(it => it.field.ReplaceRegex("^f_", string.Empty).ToLower().Equals("flowid"));
|
||||
|
||||
// 移除乐观锁
|
||||
dbTableFields.RemoveAll(it => it.field.ReplaceRegex("^f_", string.Empty).ToLower().Equals("version"));
|
||||
@@ -247,6 +264,7 @@ public class CodeGenWay
|
||||
DataType = column.dataType,
|
||||
NetType = CodeGenHelper.ConvertDataType(column.dataType),
|
||||
PrimaryKey = true,
|
||||
IsControlParsing = false,
|
||||
});
|
||||
break;
|
||||
default:
|
||||
@@ -267,6 +285,7 @@ public class CodeGenWay
|
||||
PrimaryKey = column.primaryKey.ParseToBool(),
|
||||
QueryWhether = control.isQueryField,
|
||||
QueryType = CodeGenFieldJudgeHelper.ColumnQueryType(searchList: columnDesignModel.searchList, string.Format("{0}-{1}", controlId, field)),
|
||||
QueryMultiple = CodeGenFieldJudgeHelper.ColumnQueryMultiple(searchList: columnDesignModel.searchList, string.Format("{0}-{1}", controlId, field)),
|
||||
IsMultiple = CodeGenFieldJudgeHelper.IsMultipleColumn(controls, field),
|
||||
IsUnique = control.__config__.unique,
|
||||
jnpfKey = control.__config__.jnpfKey,
|
||||
@@ -290,6 +309,7 @@ public class CodeGenWay
|
||||
IsImportField = isImportField.ParseToBool(),
|
||||
ChildControlKey = controlId,
|
||||
ShowField = control.relational,
|
||||
IsControlParsing = CodeGenFieldJudgeHelper.IsControlParsing(control),
|
||||
});
|
||||
break;
|
||||
case false:
|
||||
@@ -302,6 +322,7 @@ public class CodeGenWay
|
||||
NetType = CodeGenHelper.ConvertDataType(column.dataType),
|
||||
ForeignKeyField = true,
|
||||
IsImportField = false,
|
||||
IsControlParsing = false,
|
||||
});
|
||||
break;
|
||||
}
|
||||
@@ -322,6 +343,9 @@ public class CodeGenWay
|
||||
|
||||
bool isShowSubTableField = tableColumnList.Any(it => it.IsShow.Equals(true));
|
||||
|
||||
// 是否查询条件多选
|
||||
bool isSearchMultiple = tableColumnList.Any(it => it.QueryMultiple);
|
||||
|
||||
return new CodeGenConfigModel()
|
||||
{
|
||||
NameSpace = formDataModel.areasName,
|
||||
@@ -337,6 +361,7 @@ public class CodeGenWay
|
||||
PrimaryKeyPolicy = formDataModel.primaryKeyPolicy,
|
||||
IsImportData = tableColumnList.Any(it => it.IsImportField.Equals(true)),
|
||||
IsShowSubTableField = isShowSubTableField,
|
||||
IsSearchMultiple = isSearchMultiple,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -355,7 +380,7 @@ public class CodeGenWay
|
||||
columnDesignModel ??= new ColumnDesignModel();
|
||||
columnDesignModel.searchList = GetMultiEndQueryMerging(templateEntity, controls);
|
||||
columnDesignModel.columnList = GetMultiTerminalListDisplayAndConsolidation(templateEntity);
|
||||
FormDataModel formDataModel = templateEntity.FormData.ToObject<FormDataModel>();
|
||||
FormDataModel formDataModel = templateEntity.FormData.ToObjectOld<FormDataModel>();
|
||||
|
||||
// 移除乐观锁
|
||||
dbTableFields.RemoveAll(it => it.field.ReplaceRegex("^f_", string.Empty).ToLower().Equals("version"));
|
||||
@@ -363,6 +388,9 @@ public class CodeGenWay
|
||||
// 移除真实流程ID
|
||||
dbTableFields.RemoveAll(it => it.field.ReplaceRegex("^f_", string.Empty).ToLower().Equals("flowtaskid"));
|
||||
|
||||
// 移除流程引擎ID
|
||||
dbTableFields.RemoveAll(it => it.field.ReplaceRegex("^f_", string.Empty).ToLower().Equals("flowid"));
|
||||
|
||||
var table = templateEntity.Tables.ToObject<List<DbTableRelationModel>>();
|
||||
|
||||
var tableColumnList = new List<TableColumnConfigModel>();
|
||||
@@ -409,6 +437,7 @@ public class CodeGenWay
|
||||
PrimaryKey = column.primaryKey.ParseToBool(),
|
||||
QueryWhether = control.isQueryField,
|
||||
QueryType = CodeGenFieldJudgeHelper.ColumnQueryType(searchList: columnDesignModel.searchList, field),
|
||||
QueryMultiple = CodeGenFieldJudgeHelper.ColumnQueryMultiple(searchList: columnDesignModel.searchList, field),
|
||||
IsShow = control.isIndexShow,
|
||||
IsUnique = control.__config__.unique,
|
||||
IsMultiple = CodeGenFieldJudgeHelper.IsMultipleColumn(controls, field),
|
||||
@@ -424,6 +453,7 @@ public class CodeGenWay
|
||||
ControlLabel = control.__config__.label,
|
||||
IsImportField = isImportField == null ? false : (bool)isImportField,
|
||||
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
||||
IsTreeParentField = childControl.Equals(columnDesignModel.parentField),
|
||||
});
|
||||
break;
|
||||
default:
|
||||
@@ -438,6 +468,7 @@ public class CodeGenWay
|
||||
PrimaryKey = column.primaryKey.ParseToBool(),
|
||||
QueryWhether = control.isQueryField,
|
||||
QueryType = CodeGenFieldJudgeHelper.ColumnQueryType(searchList: columnDesignModel.searchList, field),
|
||||
QueryMultiple = CodeGenFieldJudgeHelper.ColumnQueryMultiple(searchList: columnDesignModel.searchList, field),
|
||||
IsShow = control.isIndexShow,
|
||||
IsMultiple = CodeGenFieldJudgeHelper.IsMultipleColumn(controls, field),
|
||||
IsUnique = control.__config__.unique,
|
||||
@@ -462,6 +493,7 @@ public class CodeGenWay
|
||||
IsImportField = isImportField == null ? false : (bool)isImportField,
|
||||
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
||||
ShowField = control.relational,
|
||||
IsTreeParentField = childControl.Equals(columnDesignModel.parentField),
|
||||
});
|
||||
break;
|
||||
}
|
||||
@@ -479,6 +511,7 @@ public class CodeGenWay
|
||||
IsSystemControl = false,
|
||||
ForeignKeyField = true,
|
||||
IsUpdate = false,
|
||||
IsControlParsing = false,
|
||||
});
|
||||
break;
|
||||
}
|
||||
@@ -507,7 +540,7 @@ public class CodeGenWay
|
||||
columnDesignModel ??= new ColumnDesignModel();
|
||||
columnDesignModel.searchList = GetMultiEndQueryMerging(templateEntity, controls);
|
||||
columnDesignModel.columnList = GetMultiTerminalListDisplayAndConsolidation(templateEntity);
|
||||
FormDataModel formDataModel = templateEntity.FormData.ToObject<FormDataModel>();
|
||||
FormDataModel formDataModel = templateEntity.FormData.ToObjectOld<FormDataModel>();
|
||||
|
||||
// 移除乐观锁
|
||||
dbTableFields.RemoveAll(it => it.field.ReplaceRegex("^f_", string.Empty).ToLower().Equals("version"));
|
||||
@@ -515,6 +548,9 @@ public class CodeGenWay
|
||||
// 移除真实流程ID
|
||||
dbTableFields.RemoveAll(it => it.field.ReplaceRegex("^f_", string.Empty).ToLower().Equals("flowtaskid"));
|
||||
|
||||
// 移除流程引擎ID
|
||||
dbTableFields.RemoveAll(it => it.field.ReplaceRegex("^f_", string.Empty).ToLower().Equals("flowid"));
|
||||
|
||||
var tableColumnList = new List<TableColumnConfigModel>();
|
||||
foreach (DbTableFieldModel? column in dbTableFields)
|
||||
{
|
||||
@@ -558,6 +594,7 @@ public class CodeGenWay
|
||||
PrimaryKey = column.primaryKey.ParseToBool(),
|
||||
QueryWhether = control.isQueryField,
|
||||
QueryType = CodeGenFieldJudgeHelper.ColumnQueryType(searchList: columnDesignModel.searchList, field),
|
||||
QueryMultiple = CodeGenFieldJudgeHelper.ColumnQueryMultiple(searchList: columnDesignModel.searchList, field),
|
||||
IsShow = control.isIndexShow,
|
||||
IsUnique = control.__config__.unique,
|
||||
IsMultiple = CodeGenFieldJudgeHelper.IsMultipleColumn(controls, field),
|
||||
@@ -575,6 +612,7 @@ public class CodeGenWay
|
||||
ControlLabel = control.__config__.label,
|
||||
IsImportField = isImportField.ParseToBool(),
|
||||
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
||||
IsTreeParentField = field.Equals(columnDesignModel.parentField),
|
||||
});
|
||||
break;
|
||||
default:
|
||||
@@ -589,6 +627,7 @@ public class CodeGenWay
|
||||
PrimaryKey = column.primaryKey.ParseToBool(),
|
||||
QueryWhether = control.isQueryField,
|
||||
QueryType = CodeGenFieldJudgeHelper.ColumnQueryType(searchList: columnDesignModel.searchList, field),
|
||||
QueryMultiple = CodeGenFieldJudgeHelper.ColumnQueryMultiple(searchList: columnDesignModel.searchList, field),
|
||||
IsShow = control.isIndexShow,
|
||||
IsMultiple = CodeGenFieldJudgeHelper.IsMultipleColumn(controls, field),
|
||||
IsUnique = control.__config__.unique,
|
||||
@@ -614,6 +653,7 @@ public class CodeGenWay
|
||||
ControlLabel = control.__config__.label,
|
||||
IsImportField = isImportField.ParseToBool(),
|
||||
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
||||
IsTreeParentField = field.Equals(columnDesignModel.parentField),
|
||||
});
|
||||
break;
|
||||
}
|
||||
@@ -631,6 +671,7 @@ public class CodeGenWay
|
||||
IsSystemControl = false,
|
||||
IsAuxiliary = false,
|
||||
IsUpdate = false,
|
||||
IsControlParsing = false,
|
||||
});
|
||||
break;
|
||||
}
|
||||
@@ -665,7 +706,7 @@ public class CodeGenWay
|
||||
columnDesignModel ??= new ColumnDesignModel();
|
||||
columnDesignModel.searchList = GetMultiEndQueryMerging(templateEntity, controls);
|
||||
columnDesignModel.columnList = GetMultiTerminalListDisplayAndConsolidation(templateEntity);
|
||||
FormDataModel formDataModel = templateEntity.FormData.ToObject<FormDataModel>();
|
||||
FormDataModel formDataModel = templateEntity.FormData.ToObjectOld<FormDataModel>();
|
||||
|
||||
// 移除乐观锁
|
||||
dbTableFields.RemoveAll(it => it.field.ReplaceRegex("^f_", string.Empty).ToLower().Equals("version"));
|
||||
@@ -673,6 +714,9 @@ public class CodeGenWay
|
||||
// 移除真实流程ID
|
||||
dbTableFields.RemoveAll(it => it.field.ReplaceRegex("^f_", string.Empty).ToLower().Equals("flowtaskid"));
|
||||
|
||||
// 移除流程引擎ID
|
||||
dbTableFields.RemoveAll(it => it.field.ReplaceRegex("^f_", string.Empty).ToLower().Equals("flowid"));
|
||||
|
||||
var tableColumnList = new List<TableColumnConfigModel>();
|
||||
|
||||
foreach (DbTableFieldModel? column in dbTableFields)
|
||||
@@ -714,6 +758,7 @@ public class CodeGenWay
|
||||
PrimaryKey = column.primaryKey.ParseToBool(),
|
||||
QueryWhether = control.isQueryField,
|
||||
QueryType = CodeGenFieldJudgeHelper.ColumnQueryType(searchList: columnDesignModel.searchList, field),
|
||||
QueryMultiple = CodeGenFieldJudgeHelper.ColumnQueryMultiple(searchList: columnDesignModel.searchList, field),
|
||||
IsShow = control.isIndexShow,
|
||||
IsUnique = control.__config__.unique,
|
||||
IsMultiple = CodeGenFieldJudgeHelper.IsMultipleColumn(controls, field),
|
||||
@@ -731,6 +776,7 @@ public class CodeGenWay
|
||||
ControlLabel = control.__config__.label,
|
||||
IsImportField = columnDesignModel?.uploaderTemplateJson?.selectKey?.Any(it => it.Equals(field)) == null ? false : (bool)columnDesignModel?.uploaderTemplateJson?.selectKey?.Any(it => it.Equals(field)),
|
||||
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
||||
IsTreeParentField = field.Equals(columnDesignModel.parentField),
|
||||
});
|
||||
break;
|
||||
default:
|
||||
@@ -745,6 +791,7 @@ public class CodeGenWay
|
||||
PrimaryKey = column.primaryKey.ParseToBool(),
|
||||
QueryWhether = control.isQueryField,
|
||||
QueryType = CodeGenFieldJudgeHelper.ColumnQueryType(searchList: columnDesignModel.searchList, field),
|
||||
QueryMultiple = CodeGenFieldJudgeHelper.ColumnQueryMultiple(searchList: columnDesignModel.searchList, field),
|
||||
IsShow = control.isIndexShow,
|
||||
IsMultiple = CodeGenFieldJudgeHelper.IsMultipleColumn(controls, field),
|
||||
IsUnique = control.__config__.unique,
|
||||
@@ -771,6 +818,7 @@ public class CodeGenWay
|
||||
IsImportField = columnDesignModel?.uploaderTemplateJson?.selectKey?.Any(it => it.Equals(field)) == null ? false : (bool)columnDesignModel?.uploaderTemplateJson?.selectKey?.Any(it => it.Equals(field)),
|
||||
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
||||
ShowField = control.relational,
|
||||
IsTreeParentField = field.Equals(columnDesignModel.parentField),
|
||||
});
|
||||
break;
|
||||
}
|
||||
@@ -815,7 +863,7 @@ public class CodeGenWay
|
||||
columnDesignModel ??= new ColumnDesignModel();
|
||||
columnDesignModel.searchList = GetMultiEndQueryMerging(templateEntity, controls);
|
||||
columnDesignModel.columnList = GetMultiTerminalListDisplayAndConsolidation(templateEntity);
|
||||
FormDataModel formDataModel = templateEntity.FormData.ToObject<FormDataModel>();
|
||||
FormDataModel formDataModel = templateEntity.FormData.ToObjectOld<FormDataModel>();
|
||||
var tableColumnList = new List<TableColumnConfigModel>();
|
||||
|
||||
// 移除乐观锁
|
||||
@@ -824,6 +872,9 @@ public class CodeGenWay
|
||||
// 移除真实流程ID
|
||||
dbTableFields.RemoveAll(it => it.field.ReplaceRegex("^f_", string.Empty).ToLower().Equals("flowtaskid"));
|
||||
|
||||
// 移除流程引擎ID
|
||||
dbTableFields.RemoveAll(it => it.field.ReplaceRegex("^f_", string.Empty).ToLower().Equals("flowid"));
|
||||
|
||||
foreach (DbTableFieldModel? column in dbTableFields)
|
||||
{
|
||||
var field = column.field.ReplaceRegex("^f_", string.Empty).ParseToPascalCase().ToLowerCase();
|
||||
@@ -866,6 +917,7 @@ public class CodeGenWay
|
||||
PrimaryKey = column.primaryKey.ParseToBool(),
|
||||
QueryWhether = control.isQueryField,
|
||||
QueryType = CodeGenFieldJudgeHelper.ColumnQueryType(searchList: columnDesignModel.searchList, field),
|
||||
QueryMultiple = CodeGenFieldJudgeHelper.ColumnQueryMultiple(searchList: columnDesignModel.searchList, field),
|
||||
IsShow = control.isIndexShow,
|
||||
IsUnique = control.__config__.unique,
|
||||
IsMultiple = CodeGenFieldJudgeHelper.IsMultipleColumn(controls, field),
|
||||
@@ -881,6 +933,7 @@ public class CodeGenWay
|
||||
ControlLabel = control.__config__.label,
|
||||
IsImportField = isImportField.ParseToBool(),
|
||||
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
||||
IsTreeParentField = field.Equals(columnDesignModel.parentField),
|
||||
});
|
||||
break;
|
||||
default:
|
||||
@@ -895,6 +948,7 @@ public class CodeGenWay
|
||||
PrimaryKey = column.primaryKey.ParseToBool(),
|
||||
QueryWhether = control.isQueryField,
|
||||
QueryType = CodeGenFieldJudgeHelper.ColumnQueryType(searchList: columnDesignModel.searchList, field),
|
||||
QueryMultiple = CodeGenFieldJudgeHelper.ColumnQueryMultiple(searchList: columnDesignModel.searchList, field),
|
||||
IsShow = control.isIndexShow,
|
||||
IsMultiple = CodeGenFieldJudgeHelper.IsMultipleColumn(controls, field),
|
||||
IsUnique = control.__config__.unique,
|
||||
@@ -919,6 +973,7 @@ public class CodeGenWay
|
||||
IsImportField = isImportField.ParseToBool(),
|
||||
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
||||
ShowField = control.relational,
|
||||
IsTreeParentField = field.Equals(columnDesignModel.parentField),
|
||||
});
|
||||
break;
|
||||
}
|
||||
@@ -995,13 +1050,14 @@ public class CodeGenWay
|
||||
controls = CodeGenUnifiedHandlerHelper.LinkageChainJudgment(controls, columnDesignModel);
|
||||
|
||||
Dictionary<string, List<string>> listQueryControls = CodeGenQueryControlClassificationHelper.ListQueryControl(logic);
|
||||
Dictionary<string, List<string>> listColumnControlsType = CodeGenQueryControlClassificationHelper.ListColumnControls();
|
||||
|
||||
// 表单脚本设计
|
||||
var formScriptDesign = CodeGenFormControlDesignHelper.FormScriptDesign("SingleTable", controls, tableColumns, columnDesignModel?.columnList);
|
||||
List<FormScriptDesignModel>? formScriptDesign = CodeGenFormControlDesignHelper.FormScriptDesign("SingleTable", controls, tableColumns, columnDesignModel?.columnList);
|
||||
|
||||
// 整个表单控件
|
||||
var formControlList = CodeGenFormControlDesignHelper.FormControlDesign(formDataModel.fields, controls, formDataModel.gutter, formDataModel.labelWidth, columnDesignModel?.columnList, columnDesignModel.type, logic, true);
|
||||
List<FormControlDesignModel>? formControlList = CodeGenFormControlDesignHelper.FormControlDesign(formDataModel.fields, controls, formDataModel.gutter, formDataModel.labelWidth, columnDesignModel?.columnList, columnDesignModel.type, logic, true);
|
||||
|
||||
var formRealControl = CodeGenFormControlDesignHelper.FormRealControl(controls);
|
||||
|
||||
// 列表控件Option
|
||||
var indnxControlOption = CodeGenFormControlDesignHelper.FormControlProps(formDataModel.fields, controls, columnDesignModel, logic, true);
|
||||
@@ -1069,6 +1125,7 @@ public class CodeGenWay
|
||||
Type = column.type,
|
||||
ShowAllLevels = column.showalllevels ? "true" : "false",
|
||||
Level = column.level,
|
||||
IsMultiple = item.searchMultiple,
|
||||
SelectType = column.selectType != null ? column.selectType.Equals("custom") ? string.Format("selectType='{0}' ", column.selectType) : string.Format("selectType='all' ") : string.Empty,
|
||||
AbleDepIds = column.selectType != null && column.selectType == "custom" ? string.Format(":ableDepIds='{0}_AbleDepIds' ", childControl.Length >= 2 ? string.Format("{0}_{1}", childControl[0], column.__vModel__) : item.__vModel__) : string.Empty,
|
||||
AblePosIds = column.selectType != null && column.selectType == "custom" && (column.__config__.jnpfKey.Equals(JnpfKeyConst.USERSELECT) || column.__config__.jnpfKey.Equals(JnpfKeyConst.POSSELECT)) ? string.Format(":ablePosIds='{0}_AblePosIds' ", childControl.Length >= 2 ? string.Format("{0}_{1}", childControl[0], column.__vModel__) : item.__vModel__) : string.Empty,
|
||||
@@ -1086,7 +1143,7 @@ public class CodeGenWay
|
||||
{
|
||||
Type = columnDesignModel.btnsList.IndexOf(item) == 0 ? "primary" : "text",
|
||||
Icon = item.icon,
|
||||
Method = GetCodeGenIndexButtonHelper.IndexTopButton(item.value),
|
||||
Method = GetCodeGenIndexButtonHelper.IndexTopButton(item.value, templateEntity.EnableFlow == 1 ? true : false),
|
||||
Value = item.value,
|
||||
Label = item.label
|
||||
});
|
||||
@@ -1114,8 +1171,6 @@ public class CodeGenWay
|
||||
{
|
||||
if (!ChildControlField.Any(it => it == item.__vModel__))
|
||||
{
|
||||
// 控件对应的控件类型
|
||||
var conversion = listColumnControlsType.Where(q => q.Value.Contains(item.jnpfKey)).FirstOrDefault();
|
||||
var relationTable = item?.__config__?.relationTable;
|
||||
if (relationTable != null && !indexColumnDesign.Any(it => it.TableName == relationTable))
|
||||
{
|
||||
@@ -1127,7 +1182,6 @@ public class CodeGenWay
|
||||
foreach (var child in childTableAll)
|
||||
{
|
||||
var columnControl = childTable.__config__.children.Find(it => it.__vModel__.Equals(child.__vModel__.Split('-')[1]));
|
||||
conversion = listColumnControlsType.Where(q => q.Value.Contains(child.jnpfKey)).FirstOrDefault();
|
||||
childTableColumnDesign.Add(new IndexColumnDesign()
|
||||
{
|
||||
TableName = child.__config__.tableName,
|
||||
@@ -1138,10 +1192,10 @@ public class CodeGenWay
|
||||
Label = columnControl.__config__.label,
|
||||
Width = child.width.ToString() == "0" ? "0" : string.Format("{0}", child.width),
|
||||
Align = child.align,
|
||||
IsAutomatic = conversion.Key == null ? false : true,
|
||||
IsSort = child.sortable ? string.Format("sortable='custom' ") : string.Empty,
|
||||
IsChildTable = true,
|
||||
Format = child.format?.ToLower().Replace(":mm", ":MM"),
|
||||
ModelId = child.modelId,
|
||||
});
|
||||
ChildControlField.Add(string.Format("{0}", child.__vModel__));
|
||||
}
|
||||
@@ -1154,7 +1208,6 @@ public class CodeGenWay
|
||||
jnpfKey = JnpfKeyConst.TABLE,
|
||||
IsChildTable = true,
|
||||
ChildTableDesigns = childTableColumnDesign,
|
||||
IsAutomatic = childTableColumnDesign.Any(it => it.IsAutomatic),
|
||||
Fixed = string.Empty,
|
||||
});
|
||||
}
|
||||
@@ -1172,10 +1225,9 @@ public class CodeGenWay
|
||||
Width = item.width == null ? string.Empty : string.Format("width='{0}' ", item.width),
|
||||
Fixed = columnDesignModel.childTableStyle == 1 ? (item.@fixed == "none" || item.@fixed == null ? string.Empty : string.Format("fixed='{0}' ", item.@fixed)) : string.Empty,
|
||||
Align = item.align,
|
||||
Format = item.format?.ToLower().Replace(":mm", ":MM"),
|
||||
IsAutomatic = conversion.Key == null ? false : true,
|
||||
IsSort = item.sortable ? string.Format("sortable='custom' ") : string.Empty,
|
||||
IsChildTable = false,
|
||||
ModelId = item.modelId,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1188,7 +1240,11 @@ public class CodeGenWay
|
||||
break;
|
||||
}
|
||||
|
||||
var propertyJson = CodeGenFormControlDesignHelper.GetPropertyJson(formScriptDesign);
|
||||
|
||||
var printIds = columnDesignModel.printIds != null ? string.Join(",", columnDesignModel.printIds) : null;
|
||||
var isBatchRemoveDel = indexTopButton.Any(it => it.Value == "batchRemove");
|
||||
var isBatchPrint = indexTopButton.Any(it => it.Value == "batchPrint");
|
||||
var isUpload = indexTopButton.Any(it => it.Value == "upload");
|
||||
var isDownload = indexTopButton.Any(it => it.Value == "download");
|
||||
var isRemoveDel = indexColumnButtonDesign.Any(it => it.Value == "remove");
|
||||
@@ -1199,24 +1255,40 @@ public class CodeGenWay
|
||||
var isAdd = indexTopButton.Any(it => it.Value == "add");
|
||||
var isTreeRelation = !string.IsNullOrEmpty(columnDesignModel?.treeRelation);
|
||||
var isRelationForm = formControlList.Any(it => it.IsRelationForm);
|
||||
var isTreeRelationMultiple = indexSearchFieldDesign.Any(it => it.Name.Equals(columnDesignModel?.treeRelation?.Replace("-", "_")) && it.IsMultiple);
|
||||
var isFixed = columnDesignModel.childTableStyle == 1 ? indexColumnDesign.Any(it => it.Fixed.Equals("fixed='left' ") && !it.Name.Equals(columnDesignModel.groupField)) : false;
|
||||
var isChildrenRegular = formScriptDesign.Any(it => it.jnpfKey.Equals(JnpfKeyConst.TABLE) && it.RegList != null && it.RegList.Count > 0);
|
||||
|
||||
// 表单默认值控件列表
|
||||
var defaultFormControlList = new DefaultFormControlModel();
|
||||
switch (logic)
|
||||
{
|
||||
case 4:
|
||||
columnDesignModel = templateEntity.ColumnData?.ToObject<ColumnDesignModel>();
|
||||
columnDesignModel ??= new ColumnDesignModel();
|
||||
defaultFormControlList = CodeGenFormControlDesignHelper.DefaultFormControlList(controls, columnDesignModel.searchList);
|
||||
break;
|
||||
case 5:
|
||||
ColumnDesignModel pcColumnDesignModel = templateEntity.ColumnData?.ToObject<ColumnDesignModel>();
|
||||
columnDesignModel = templateEntity.AppColumnData?.ToObject<ColumnDesignModel>();
|
||||
columnDesignModel ??= new ColumnDesignModel();
|
||||
defaultFormControlList = CodeGenFormControlDesignHelper.DefaultFormControlList(controls, columnDesignModel.searchList);
|
||||
|
||||
// 移动端的分页遵循PC端
|
||||
columnDesignModel.hasPage = templateEntity.WebType == 1 ? false : pcColumnDesignModel.hasPage;
|
||||
break;
|
||||
}
|
||||
|
||||
var isDefaultFormControl = defaultFormControlList.IsExistDate || defaultFormControlList.IsExistDepSelect || defaultFormControlList.IsExistComSelect || defaultFormControlList.IsExistUserSelect || defaultFormControlList.IsExistSubTable ? true : false;
|
||||
|
||||
switch (columnDesignModel.type)
|
||||
{
|
||||
case 3:
|
||||
case 5:
|
||||
columnDesignModel.hasPage = false;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (templateEntity.WebType)
|
||||
{
|
||||
case 1:
|
||||
@@ -1256,7 +1328,7 @@ public class CodeGenWay
|
||||
Sort = columnDesignModel.sort,
|
||||
HasPrintBtn = formDataModel.hasPrintBtn,
|
||||
PrintButtonText = formDataModel.printButtonText,
|
||||
PrintId = formDataModel.printId,
|
||||
PrintId = formDataModel.printId != null ? string.Join(",", formDataModel.printId) : null,
|
||||
IsChildDataTransfer = formScriptDesign.Any(it => it.IsDataTransfer.Equals(true)),
|
||||
IsChildTableQuery = indexSearchFieldDesign.Any(it => it.IsChildQuery.Equals(true)),
|
||||
IsChildTableShow = indexColumnDesign.Any(it => it.IsChildTable.Equals(true)),
|
||||
@@ -1268,10 +1340,22 @@ public class CodeGenWay
|
||||
PrimaryKeyPolicy = formDataModel.primaryKeyPolicy,
|
||||
IsRelationForm = isRelationForm,
|
||||
ChildTableStyle = columnDesignModel.childTableStyle,
|
||||
IsChildrenRegular = isChildrenRegular,
|
||||
DefaultFormControlList = defaultFormControlList,
|
||||
IsDefaultFormControl = isDefaultFormControl,
|
||||
PropertyJson = propertyJson,
|
||||
FormRealControl = formRealControl,
|
||||
};
|
||||
break;
|
||||
default:
|
||||
var codeGenColumnData = new CodeGenColumnData
|
||||
{
|
||||
treeInterfaceId = columnDesignModel.treeInterfaceId,
|
||||
treeTemplateJson = columnDesignModel.treeTemplateJson
|
||||
};
|
||||
return new FrontEndGenConfigModel()
|
||||
{
|
||||
PrintIds = printIds,
|
||||
NameSpace = formDataModel.areasName,
|
||||
ClassName = formDataModel.className.FirstOrDefault(),
|
||||
FormRef = formDataModel.formRef,
|
||||
@@ -1293,6 +1377,7 @@ public class CodeGenWay
|
||||
TreePropsUrl = columnDesignModel?.treePropsUrl,
|
||||
TreePropsChildren = columnDesignModel?.treePropsChildren,
|
||||
TreePropsLabel = columnDesignModel?.treePropsLabel,
|
||||
IsTreeRelationMultiple = isTreeRelationMultiple,
|
||||
IsExistQuery = templateEntity.Type == 3 ? false : (bool)columnDesignModel?.searchList?.Any(it => it.prop.Equals(columnDesignModel?.treeRelation)),
|
||||
PrimaryKey = tableColumns?.Find(it => it.PrimaryKey.Equals(true))?.LowerColumnName,
|
||||
FormList = formScriptDesign,
|
||||
@@ -1303,6 +1388,7 @@ public class CodeGenWay
|
||||
ColumnDesign = indexColumnDesign,
|
||||
OptionsList = indnxControlOption,
|
||||
IsBatchRemoveDel = isBatchRemoveDel,
|
||||
IsBatchPrint = isBatchPrint,
|
||||
IsDownload = isDownload,
|
||||
IsRemoveDel = isRemoveDel,
|
||||
IsDetail = isDetail,
|
||||
@@ -1322,7 +1408,7 @@ public class CodeGenWay
|
||||
Sort = columnDesignModel.sort,
|
||||
HasPrintBtn = formDataModel.hasPrintBtn,
|
||||
PrintButtonText = formDataModel.printButtonText,
|
||||
PrintId = formDataModel.printId,
|
||||
PrintId = formDataModel.printId != null ? string.Join(",", formDataModel.printId) : null,
|
||||
IsChildDataTransfer = formScriptDesign.Any(it => it.IsDataTransfer.Equals(true)),
|
||||
IsChildTableQuery = indexSearchFieldDesign.Any(it => it.IsChildQuery.Equals(true)),
|
||||
IsChildTableShow = indexColumnDesign.Any(it => it.IsChildTable.Equals(true)),
|
||||
@@ -1337,7 +1423,18 @@ public class CodeGenWay
|
||||
IsRelationForm = isRelationForm,
|
||||
ChildTableStyle = columnDesignModel.childTableStyle,
|
||||
IsFixed = isFixed,
|
||||
IsChildrenRegular = isChildrenRegular,
|
||||
TreeSynType = columnDesignModel.treeSynType,
|
||||
HasTreeQuery = columnDesignModel.hasTreeQuery,
|
||||
ColumnData = codeGenColumnData,
|
||||
SummaryField = columnDesignModel.summaryField,
|
||||
ShowSummary = columnDesignModel.showSummary,
|
||||
DefaultFormControlList = defaultFormControlList,
|
||||
IsDefaultFormControl = isDefaultFormControl,
|
||||
PropertyJson = propertyJson,
|
||||
FormRealControl = formRealControl,
|
||||
};
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1401,6 +1498,18 @@ public class CodeGenWay
|
||||
// 是否批量删除
|
||||
bool isBatchRemove = false;
|
||||
|
||||
// 是否查询条件多选
|
||||
bool isSearchMultiple = false;
|
||||
|
||||
// 是否树形表格
|
||||
bool isTreeTable = false;
|
||||
|
||||
// 树形表格-父级字段
|
||||
string parentField = string.Empty;
|
||||
|
||||
// 树形表格-显示字段
|
||||
string treeShowField = string.Empty;
|
||||
|
||||
switch (templateEntity.WebType)
|
||||
{
|
||||
case 2:
|
||||
@@ -1408,6 +1517,18 @@ public class CodeGenWay
|
||||
defaultSidx = columnDesignModel.defaultSidx ?? tableColumnList.Find(t => t.PrimaryKey).ColumnName;
|
||||
isExport = columnDesignModel.btnsList.Any(it => it.value == "download");
|
||||
isBatchRemove = columnDesignModel.btnsList.Any(it => it.value == "batchRemove");
|
||||
isSearchMultiple = tableColumnList.Any(it => it.QueryMultiple && !it.IsAuxiliary);
|
||||
break;
|
||||
}
|
||||
|
||||
switch (columnDesignModel.type)
|
||||
{
|
||||
case 5:
|
||||
isTreeTable = true;
|
||||
parentField = string.Format("{0}_pid", columnDesignModel.parentField);
|
||||
treeShowField = columnDesignModel.columnList.Find(it => it.__vModel__.ToLower() != columnDesignModel.parentField.ToLower()).__vModel__;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1424,8 +1545,18 @@ public class CodeGenWay
|
||||
|
||||
bool isUpdate = tableColumnList.Any(it => it.IsUpdate);
|
||||
|
||||
bool isLogicalDelete = formDataModel.logicalDelete;
|
||||
|
||||
List<CodeGenFunctionModel> function = new List<CodeGenFunctionModel>();
|
||||
|
||||
// 树形表格没有分页
|
||||
switch (columnDesignModel.type)
|
||||
{
|
||||
case 5:
|
||||
columnDesignModel.hasPage = false;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (templateEntity.Type)
|
||||
{
|
||||
case 3:
|
||||
@@ -1514,6 +1645,11 @@ public class CodeGenWay
|
||||
ImportDataType = columnDesignModel?.uploaderTemplateJson?.dataType,
|
||||
IsSystemControl = isSystemControl,
|
||||
IsUpdate = isUpdate,
|
||||
IsSearchMultiple = isSearchMultiple,
|
||||
IsTreeTable = isTreeTable,
|
||||
ParentField = parentField,
|
||||
TreeShowField = treeShowField,
|
||||
IsLogicalDelete = isLogicalDelete,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user