Merge pull request '模版增加 搜索关键字' (#29) from orzsoft_admin/Admin.NET.Pro:template into main
Reviewed-on: http://101.43.53.74:3000/Admin.NET/Admin.NET.Pro/pulls/29
This commit is contained in:
commit
e0868099ec
@ -1,125 +1,131 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 代码生成表
|
||||
/// </summary>
|
||||
[SugarTable(null, "代码生成表")]
|
||||
[SysTable]
|
||||
[SugarIndex("index_{table}_B", nameof(BusName), OrderByType.Asc)]
|
||||
[SugarIndex("index_{table}_T", nameof(TableName), OrderByType.Asc)]
|
||||
public partial class SysCodeGen : EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 作者姓名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "作者姓名", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? AuthorName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否移除表前缀
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否移除表前缀", Length = 8)]
|
||||
[MaxLength(8)]
|
||||
public string? TablePrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生成方式
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "生成方式", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? GenerateType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 库定位器名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "库定位器名", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? ConfigId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库名(保留字段)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "数据库库名", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? DbName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "数据库类型", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? DbType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库链接
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "数据库链接", Length = 256)]
|
||||
[MaxLength(256)]
|
||||
public string? ConnectionString { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库表名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "数据库表名", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? TableName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 命名空间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "命名空间", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? NameSpace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "业务名", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? BusName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否生成菜单
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否生成菜单")]
|
||||
public bool GenerateMenu { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 菜单图标
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "菜单图标", Length = 32)]
|
||||
public string? MenuIcon { get; set; } = "ele-Menu";
|
||||
|
||||
/// <summary>
|
||||
/// 菜单编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "菜单编码")]
|
||||
public long? MenuPid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 页面目录
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "页面目录", Length = 32)]
|
||||
public string? PagePath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 支持打印类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "支持打印类型", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? PrintType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 打印模版名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "打印模版名称", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? PrintName { get; set; }
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 代码生成表
|
||||
/// </summary>
|
||||
[SugarTable(null, "代码生成表")]
|
||||
[SysTable]
|
||||
[SugarIndex("index_{table}_B", nameof(BusName), OrderByType.Asc)]
|
||||
[SugarIndex("index_{table}_T", nameof(TableName), OrderByType.Asc)]
|
||||
public partial class SysCodeGen : EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 作者姓名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "作者姓名", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? AuthorName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否移除表前缀
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否移除表前缀", Length = 8)]
|
||||
[MaxLength(8)]
|
||||
public string? TablePrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生成方式
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "生成方式", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? GenerateType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 库定位器名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "库定位器名", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? ConfigId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库名(保留字段)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "数据库库名", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? DbName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "数据库类型", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? DbType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库链接
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "数据库链接", Length = 256)]
|
||||
[MaxLength(256)]
|
||||
public string? ConnectionString { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库表名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "数据库表名", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? TableName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 命名空间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "命名空间", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? NameSpace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "业务名", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? BusName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否生成菜单
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否生成菜单")]
|
||||
public bool GenerateMenu { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 菜单图标
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "菜单图标", Length = 32)]
|
||||
public string? MenuIcon { get; set; } = "ele-Menu";
|
||||
|
||||
/// <summary>
|
||||
/// 菜单编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "菜单编码")]
|
||||
public long? MenuPid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 页面目录
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "页面目录", Length = 32)]
|
||||
public string? PagePath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 支持打印类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "支持打印类型", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? PrintType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 打印模版名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "打印模版名称", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? PrintName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否使用 Api Service
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否使用 Api Service")]
|
||||
public bool IsApiService { get; set; } = false;
|
||||
}
|
||||
@ -1,100 +1,102 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core.Service;
|
||||
|
||||
public class CustomViewEngine : ViewEngineModel
|
||||
{
|
||||
private readonly ISqlSugarClient _db;
|
||||
|
||||
public CustomViewEngine()
|
||||
{
|
||||
}
|
||||
|
||||
public CustomViewEngine(ISqlSugarClient db)
|
||||
{
|
||||
_db = db;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 库定位器
|
||||
/// </summary>
|
||||
public string ConfigId { get; set; } = SqlSugarConst.MainConfigId;
|
||||
|
||||
public string AuthorName { get; set; }
|
||||
|
||||
public string BusName { get; set; }
|
||||
|
||||
public string NameSpace { get; set; }
|
||||
|
||||
public string ClassName { get; set; }
|
||||
|
||||
public string ProjectLastName { get; set; }
|
||||
|
||||
public string LowerClassName
|
||||
{
|
||||
get
|
||||
{
|
||||
return ClassName[..1].ToLower() + ClassName[1..]; // 首字母小写
|
||||
}
|
||||
}
|
||||
|
||||
public string PagePath { get; set; } = "main";
|
||||
|
||||
public bool IsJoinTable { get; set; }
|
||||
|
||||
public bool IsUpload { get; set; }
|
||||
|
||||
public string PrintType { get; set; }
|
||||
|
||||
public string PrintName { get; set; }
|
||||
|
||||
public List<CodeGenConfig> QueryWhetherList { get; set; }
|
||||
|
||||
public List<CodeGenConfig> TableField { get; set; }
|
||||
|
||||
private List<ColumnOuput> ColumnList { get; set; }
|
||||
|
||||
public string GetColumnNetType(object tbName, object colName)
|
||||
{
|
||||
if (tbName == null || colName == null) return null;
|
||||
|
||||
var config = App.GetOptions<DbConnectionOptions>().ConnectionConfigs.FirstOrDefault(u => u.ConfigId.ToString() == ConfigId);
|
||||
ColumnList = GetColumnListByTableName(tbName.ToString());
|
||||
var col = ColumnList.Where(c => (config.DbSettings.EnableUnderLine
|
||||
? CodeGenUtil.CamelColumnName(c.ColumnName, Array.Empty<string>())
|
||||
: c.ColumnName) == colName.ToString()).FirstOrDefault();
|
||||
return col.NetType;
|
||||
}
|
||||
|
||||
public List<ColumnOuput> GetColumnListByTableName(string tableName)
|
||||
{
|
||||
// 多库代码生成切换库
|
||||
var provider = _db.AsTenant().GetConnectionScope(ConfigId != SqlSugarConst.MainConfigId ? ConfigId : SqlSugarConst.MainConfigId);
|
||||
|
||||
// 获取实体类型属性
|
||||
var entityType = provider.DbMaintenance.GetTableInfoList().FirstOrDefault(u => u.Name == tableName);
|
||||
|
||||
// 因为ConfigId的表通常也会用到主库的表来做连接,所以这里如果在ConfigId中找不到实体也尝试一下在主库中查找
|
||||
if (ConfigId == SqlSugarConst.MainConfigId && entityType == null) return null;
|
||||
if (ConfigId != SqlSugarConst.MainConfigId)
|
||||
{
|
||||
provider = _db.AsTenant().GetConnectionScope(SqlSugarConst.MainConfigId);
|
||||
entityType = provider.DbMaintenance.GetTableInfoList().FirstOrDefault(u => u.Name == tableName);
|
||||
if (entityType == null) return null;
|
||||
}
|
||||
|
||||
// 按原始类型的顺序获取所有实体类型属性(不包含导航属性,会返回null)
|
||||
return provider.DbMaintenance.GetColumnInfosByTableName(entityType.Name).Select(u => new ColumnOuput
|
||||
{
|
||||
ColumnName = u.DbColumnName,
|
||||
ColumnKey = u.IsPrimarykey.ToString(),
|
||||
DataType = u.DataType.ToString(),
|
||||
NetType = CodeGenUtil.ConvertDataType(u, provider.CurrentConnectionConfig.DbType),
|
||||
ColumnComment = u.ColumnDescription
|
||||
}).ToList();
|
||||
}
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core.Service;
|
||||
|
||||
public class CustomViewEngine : ViewEngineModel
|
||||
{
|
||||
private readonly ISqlSugarClient _db;
|
||||
|
||||
public CustomViewEngine()
|
||||
{
|
||||
}
|
||||
|
||||
public CustomViewEngine(ISqlSugarClient db)
|
||||
{
|
||||
_db = db;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 库定位器
|
||||
/// </summary>
|
||||
public string ConfigId { get; set; } = SqlSugarConst.MainConfigId;
|
||||
|
||||
public string AuthorName { get; set; }
|
||||
|
||||
public string BusName { get; set; }
|
||||
|
||||
public string NameSpace { get; set; }
|
||||
|
||||
public string ClassName { get; set; }
|
||||
|
||||
public string ProjectLastName { get; set; }
|
||||
|
||||
public string LowerClassName
|
||||
{
|
||||
get
|
||||
{
|
||||
return ClassName[..1].ToLower() + ClassName[1..]; // 首字母小写
|
||||
}
|
||||
}
|
||||
|
||||
public string PagePath { get; set; } = "main";
|
||||
|
||||
public bool IsJoinTable { get; set; }
|
||||
|
||||
public bool IsUpload { get; set; }
|
||||
|
||||
public string PrintType { get; set; }
|
||||
|
||||
public string PrintName { get; set; }
|
||||
|
||||
public bool IsApiService { get; set; }
|
||||
|
||||
public List<CodeGenConfig> QueryWhetherList { get; set; }
|
||||
|
||||
public List<CodeGenConfig> TableField { get; set; }
|
||||
|
||||
private List<ColumnOuput> ColumnList { get; set; }
|
||||
|
||||
public string GetColumnNetType(object tbName, object colName)
|
||||
{
|
||||
if (tbName == null || colName == null) return null;
|
||||
|
||||
var config = App.GetOptions<DbConnectionOptions>().ConnectionConfigs.FirstOrDefault(u => u.ConfigId.ToString() == ConfigId);
|
||||
ColumnList = GetColumnListByTableName(tbName.ToString());
|
||||
var col = ColumnList.Where(c => (config.DbSettings.EnableUnderLine
|
||||
? CodeGenUtil.CamelColumnName(c.ColumnName, Array.Empty<string>())
|
||||
: c.ColumnName) == colName.ToString()).FirstOrDefault();
|
||||
return col.NetType;
|
||||
}
|
||||
|
||||
public List<ColumnOuput> GetColumnListByTableName(string tableName)
|
||||
{
|
||||
// 多库代码生成切换库
|
||||
var provider = _db.AsTenant().GetConnectionScope(ConfigId != SqlSugarConst.MainConfigId ? ConfigId : SqlSugarConst.MainConfigId);
|
||||
|
||||
// 获取实体类型属性
|
||||
var entityType = provider.DbMaintenance.GetTableInfoList().FirstOrDefault(u => u.Name == tableName);
|
||||
|
||||
// 因为ConfigId的表通常也会用到主库的表来做连接,所以这里如果在ConfigId中找不到实体也尝试一下在主库中查找
|
||||
if (ConfigId == SqlSugarConst.MainConfigId && entityType == null) return null;
|
||||
if (ConfigId != SqlSugarConst.MainConfigId)
|
||||
{
|
||||
provider = _db.AsTenant().GetConnectionScope(SqlSugarConst.MainConfigId);
|
||||
entityType = provider.DbMaintenance.GetTableInfoList().FirstOrDefault(u => u.Name == tableName);
|
||||
if (entityType == null) return null;
|
||||
}
|
||||
|
||||
// 按原始类型的顺序获取所有实体类型属性(不包含导航属性,会返回null)
|
||||
return provider.DbMaintenance.GetColumnInfosByTableName(entityType.Name).Select(u => new ColumnOuput
|
||||
{
|
||||
ColumnName = u.DbColumnName,
|
||||
ColumnKey = u.IsPrimarykey.ToString(),
|
||||
DataType = u.DataType.ToString(),
|
||||
NetType = CodeGenUtil.ConvertDataType(u, provider.CurrentConnectionConfig.DbType),
|
||||
ColumnComment = u.ColumnDescription
|
||||
}).ToList();
|
||||
}
|
||||
}
|
||||
@ -1,182 +1,192 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core.Service;
|
||||
|
||||
/// <summary>
|
||||
/// 代码生成参数类
|
||||
/// </summary>
|
||||
public class CodeGenInput : BasePageInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 作者姓名
|
||||
/// </summary>
|
||||
public virtual string AuthorName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 类名
|
||||
/// </summary>
|
||||
public virtual string ClassName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否移除表前缀
|
||||
/// </summary>
|
||||
public virtual string TablePrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 库定位器名
|
||||
/// </summary>
|
||||
public virtual string ConfigId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库名(保留字段)
|
||||
/// </summary>
|
||||
public virtual string DbName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库类型
|
||||
/// </summary>
|
||||
public virtual string DbType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库链接
|
||||
/// </summary>
|
||||
public virtual string ConnectionString { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生成方式
|
||||
/// </summary>
|
||||
public virtual string GenerateType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库表名
|
||||
/// </summary>
|
||||
public virtual string TableName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 命名空间
|
||||
/// </summary>
|
||||
public virtual string NameSpace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务名(业务代码包名称)
|
||||
/// </summary>
|
||||
public virtual string BusName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 功能名(数据库表名称)
|
||||
/// </summary>
|
||||
public virtual string TableComment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 菜单应用分类(应用编码)
|
||||
/// </summary>
|
||||
public virtual string MenuApplication { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否生成菜单
|
||||
/// </summary>
|
||||
public virtual bool GenerateMenu { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 菜单父级
|
||||
/// </summary>
|
||||
public virtual long? MenuPid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 页面目录
|
||||
/// </summary>
|
||||
public virtual string PagePath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 支持打印类型
|
||||
/// </summary>
|
||||
public virtual string PrintType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 打印模版名称
|
||||
/// </summary>
|
||||
public virtual string PrintName { get; set; }
|
||||
}
|
||||
|
||||
public class AddCodeGenInput : CodeGenInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据库表名
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "数据库表名不能为空")]
|
||||
public override string TableName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务名(业务代码包名称)
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "业务名不能为空")]
|
||||
public override string BusName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 命名空间
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "命名空间不能为空")]
|
||||
public override string NameSpace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 作者姓名
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "作者姓名不能为空")]
|
||||
public override string AuthorName { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 类名
|
||||
///// </summary>
|
||||
//[Required(ErrorMessage = "类名不能为空")]
|
||||
//public override string ClassName { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 是否移除表前缀
|
||||
///// </summary>
|
||||
//[Required(ErrorMessage = "是否移除表前缀不能为空")]
|
||||
//public override string TablePrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生成方式
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "生成方式不能为空")]
|
||||
public override string GenerateType { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 功能名(数据库表名称)
|
||||
///// </summary>
|
||||
//[Required(ErrorMessage = "数据库表名不能为空")]
|
||||
//public override string TableComment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否生成菜单
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "是否生成菜单不能为空")]
|
||||
public override bool GenerateMenu { get; set; }
|
||||
}
|
||||
|
||||
public class DeleteCodeGenInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 代码生成器Id
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "代码生成器Id不能为空")]
|
||||
public long Id { get; set; }
|
||||
}
|
||||
|
||||
public class UpdateCodeGenInput : CodeGenInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 代码生成器Id
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "代码生成器Id不能为空")]
|
||||
public long Id { get; set; }
|
||||
}
|
||||
|
||||
public class QueryCodeGenInput : DeleteCodeGenInput
|
||||
{
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core.Service;
|
||||
|
||||
/// <summary>
|
||||
/// 代码生成参数类
|
||||
/// </summary>
|
||||
public class CodeGenInput : BasePageInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 作者姓名
|
||||
/// </summary>
|
||||
public virtual string AuthorName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 类名
|
||||
/// </summary>
|
||||
public virtual string ClassName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否移除表前缀
|
||||
/// </summary>
|
||||
public virtual string TablePrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 库定位器名
|
||||
/// </summary>
|
||||
public virtual string ConfigId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库名(保留字段)
|
||||
/// </summary>
|
||||
public virtual string DbName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库类型
|
||||
/// </summary>
|
||||
public virtual string DbType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库链接
|
||||
/// </summary>
|
||||
public virtual string ConnectionString { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生成方式
|
||||
/// </summary>
|
||||
public virtual string GenerateType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库表名
|
||||
/// </summary>
|
||||
public virtual string TableName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 命名空间
|
||||
/// </summary>
|
||||
public virtual string NameSpace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务名(业务代码包名称)
|
||||
/// </summary>
|
||||
public virtual string BusName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 功能名(数据库表名称)
|
||||
/// </summary>
|
||||
public virtual string TableComment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 菜单应用分类(应用编码)
|
||||
/// </summary>
|
||||
public virtual string MenuApplication { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否生成菜单
|
||||
/// </summary>
|
||||
public virtual bool GenerateMenu { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 菜单父级
|
||||
/// </summary>
|
||||
public virtual long? MenuPid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 页面目录
|
||||
/// </summary>
|
||||
public virtual string PagePath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 支持打印类型
|
||||
/// </summary>
|
||||
public virtual string PrintType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 打印模版名称
|
||||
/// </summary>
|
||||
public virtual string PrintName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否使用 Api Service
|
||||
/// </summary>
|
||||
public virtual bool IsApiService { get; set; }
|
||||
}
|
||||
|
||||
public class AddCodeGenInput : CodeGenInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据库表名
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "数据库表名不能为空")]
|
||||
public override string TableName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务名(业务代码包名称)
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "业务名不能为空")]
|
||||
public override string BusName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 命名空间
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "命名空间不能为空")]
|
||||
public override string NameSpace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 作者姓名
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "作者姓名不能为空")]
|
||||
public override string AuthorName { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 类名
|
||||
///// </summary>
|
||||
//[Required(ErrorMessage = "类名不能为空")]
|
||||
//public override string ClassName { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 是否移除表前缀
|
||||
///// </summary>
|
||||
//[Required(ErrorMessage = "是否移除表前缀不能为空")]
|
||||
//public override string TablePrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生成方式
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "生成方式不能为空")]
|
||||
public override string GenerateType { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 功能名(数据库表名称)
|
||||
///// </summary>
|
||||
//[Required(ErrorMessage = "数据库表名不能为空")]
|
||||
//public override string TableComment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否生成菜单
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "是否生成菜单不能为空")]
|
||||
public override bool GenerateMenu { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否使用 Api Service
|
||||
/// </summary>
|
||||
public override bool IsApiService { get; set; }
|
||||
}
|
||||
|
||||
public class DeleteCodeGenInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 代码生成器Id
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "代码生成器Id不能为空")]
|
||||
public long Id { get; set; }
|
||||
}
|
||||
|
||||
public class UpdateCodeGenInput : CodeGenInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 代码生成器Id
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "代码生成器Id不能为空")]
|
||||
public long Id { get; set; }
|
||||
}
|
||||
|
||||
public class QueryCodeGenInput : DeleteCodeGenInput
|
||||
{
|
||||
}
|
||||
@ -1,83 +1,88 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core.Service;
|
||||
|
||||
/// <summary>
|
||||
/// 代码生成参数类
|
||||
/// </summary>
|
||||
public class CodeGenOutput
|
||||
{
|
||||
/// <summary>
|
||||
/// 代码生成器Id
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 作者姓名
|
||||
/// </summary>
|
||||
public string AuthorName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 类名
|
||||
/// </summary>
|
||||
public string ClassName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否移除表前缀
|
||||
/// </summary>
|
||||
public string TablePrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生成方式
|
||||
/// </summary>
|
||||
public string GenerateType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库表名
|
||||
/// </summary>
|
||||
public string TableName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 包名
|
||||
/// </summary>
|
||||
public string PackageName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务名(业务代码包名称)
|
||||
/// </summary>
|
||||
public string BusName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 功能名(数据库表名称)
|
||||
/// </summary>
|
||||
public string TableComment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 菜单应用分类(应用编码)
|
||||
/// </summary>
|
||||
public string MenuApplication { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否生成菜单
|
||||
/// </summary>
|
||||
public bool GenerateMenu { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 菜单父级
|
||||
/// </summary>
|
||||
public long? MenuPid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 支持打印类型
|
||||
/// </summary>
|
||||
public string PrintType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 打印模版名称
|
||||
/// </summary>
|
||||
public string PrintName { get; set; }
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core.Service;
|
||||
|
||||
/// <summary>
|
||||
/// 代码生成参数类
|
||||
/// </summary>
|
||||
public class CodeGenOutput
|
||||
{
|
||||
/// <summary>
|
||||
/// 代码生成器Id
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 作者姓名
|
||||
/// </summary>
|
||||
public string AuthorName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 类名
|
||||
/// </summary>
|
||||
public string ClassName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否移除表前缀
|
||||
/// </summary>
|
||||
public string TablePrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生成方式
|
||||
/// </summary>
|
||||
public string GenerateType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库表名
|
||||
/// </summary>
|
||||
public string TableName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 包名
|
||||
/// </summary>
|
||||
public string PackageName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务名(业务代码包名称)
|
||||
/// </summary>
|
||||
public string BusName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 功能名(数据库表名称)
|
||||
/// </summary>
|
||||
public string TableComment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 菜单应用分类(应用编码)
|
||||
/// </summary>
|
||||
public string MenuApplication { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否生成菜单
|
||||
/// </summary>
|
||||
public bool GenerateMenu { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 菜单父级
|
||||
/// </summary>
|
||||
public long? MenuPid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 支持打印类型
|
||||
/// </summary>
|
||||
public string PrintType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 打印模版名称
|
||||
/// </summary>
|
||||
public string PrintName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否使用 Api Service
|
||||
/// </summary>
|
||||
public bool IsApiService { get; set; }
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -169,16 +169,24 @@
|
||||
import { ref,onMounted, reactive } from "vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
import type { FormRules } from "element-plus";
|
||||
|
||||
@if (@Model.IsApiService) {
|
||||
// 接口函数
|
||||
import { getAPI } from '/@@/utils/axios-utils';
|
||||
@:import { getAPI } from '/@@/utils/axios-utils';
|
||||
|
||||
// 接口
|
||||
import { @(@Model.ClassName)Api } from '/@@/api-services/api';
|
||||
@:import { @(@Model.ClassName)Api } from '/@@/api-services/api';
|
||||
|
||||
// 模型
|
||||
import { Update@(@Model.ClassName)Input } from '/@@/api-services/models';
|
||||
@:import { Update@(@Model.ClassName)Input } from '/@@/api-services/models';
|
||||
} else {
|
||||
@:import { add@(@Model.ClassName), update@(@Model.ClassName), detail@(@Model.ClassName) } from "/@@/api/@(@Model.PagePath)/@(@Model.LowerClassName)";
|
||||
|
||||
if(@Model.TableField.Any(x=>x.EffectType == "Upload")){
|
||||
@:import { Plus } from "@@element-plus/icons-vue";
|
||||
@:import { UploadRequestOptions } from "element-plus";
|
||||
@:import {@string.Join(",",Model.TableField.Where(x=>x.EffectType == "Upload").Select(x=>"upload"+x.PropertyName).ToList())} from '/@@/api/@(@Model.PagePath)/@(@Model.LowerClassName)';
|
||||
}
|
||||
}
|
||||
|
||||
@if(@Model.TableField.Any(x=>x.EffectType == "ConstSelector")){
|
||||
@:import { getConstType } from "/@@/utils/constHelper";
|
||||
@ -244,8 +252,11 @@
|
||||
// 改用detail获取最新数据来编辑
|
||||
let rowData = JSON.parse(JSON.stringify(row));
|
||||
if (rowData.id)
|
||||
//state.ruleForm = (await detail@(@Model.ClassName)(rowData.id)).data.result;
|
||||
state.ruleForm = (await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)DetailGet(rowData.id)).data.result;
|
||||
@if (@Model.IsApiService) {
|
||||
@:state.ruleForm = (await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)DetailGet(rowData.id)).data.result;
|
||||
} else {
|
||||
@:state.ruleForm = (await detail@(@Model.ClassName)(rowData.id)).data.result;
|
||||
}
|
||||
else
|
||||
state.ruleForm = rowData;
|
||||
state.isShowDialog = true;
|
||||
@ -268,11 +279,17 @@
|
||||
if (isValid) {
|
||||
let values = state.ruleForm;
|
||||
if (state.ruleForm.@(@pkFieldName) == undefined || state.ruleForm.@(@pkFieldName) == null || state.ruleForm.@(@pkFieldName) == "" || state.ruleForm.@(@pkFieldName) == 0) {
|
||||
//await add@(@Model.ClassName)(values);
|
||||
await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)AddPost(state.ruleForm);
|
||||
@if (@Model.IsApiService) {
|
||||
@:await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)AddPost(state.ruleForm);
|
||||
} else {
|
||||
@:await add@(@Model.ClassName)(values);
|
||||
}
|
||||
} else {
|
||||
//await update@(@Model.ClassName)(values);
|
||||
await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)UpdatePost(state.ruleForm);
|
||||
@if (@Model.IsApiService) {
|
||||
@:await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)UpdatePost(state.ruleForm);
|
||||
} else {
|
||||
@:await update@(@Model.ClassName)(values);
|
||||
}
|
||||
}
|
||||
closeDialog();
|
||||
} else {
|
||||
@ -324,7 +341,11 @@
|
||||
if(column.WhetherAddUpdate=="N") continue;
|
||||
if(@column.EffectType == "Upload"){
|
||||
@:const upload@(@column.PropertyName)Handle = async (options: UploadRequestOptions) => {
|
||||
@if (@Model.IsApiService) {
|
||||
@:let list = await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)Upload@(@column.FkEntityName)PostForm(options);
|
||||
} else {
|
||||
@:let list = await upload@(@column.PropertyName)(options);
|
||||
}
|
||||
@:state.ruleForm.@(column.LowerPropertyName) = res.data.result?.url;
|
||||
@:};
|
||||
}
|
||||
|
||||
@ -19,25 +19,30 @@
|
||||
}
|
||||
<template>
|
||||
<div class="@(@Model.LowerClassName)-container" v-loading="options.loading">
|
||||
<el-card shadow="hover" :body-style="{ padding: '20px 20px 16px 0px', display: 'flex', width: '100%', height: '100%', alignItems: 'start' }">
|
||||
<el-card shadow="hover" :body-style="{ padding: '20px 20px 16px 10px', display: 'flex', width: '100%', height: '100%', alignItems: 'start' }">
|
||||
<el-form :model="state.queryParams" ref="queryForm" :show-message="false" :inlineMessage="true" label-width="auto" style="flex: 1 1 0%">
|
||||
<el-row :gutter="10">
|
||||
@if(Model.QueryWhetherList.Count > 0){
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="关键字" prop="searchKey">
|
||||
<el-input v-model="state.queryParams.searchKey" placeholder="请输入模糊查询关键字" clearable @@keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
foreach (var column in Model.QueryWhetherList) {
|
||||
if(@column.EffectType == "Input" || @column.EffectType == "InputTextArea") {
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
|
||||
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
|
||||
<el-input v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="@column.ColumnComment" clearable @@keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
} else if(@column.EffectType == "InputNumber") {
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
|
||||
<el-form-item label="@column.ColumnComment">
|
||||
<el-input-number v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="请输入@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
} else if(@column.EffectType == "fk") {
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
|
||||
<el-form-item label="@column.ColumnComment">
|
||||
<el-select filterable="" v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="请选择@(@column.ColumnComment)" clearable>
|
||||
<el-option v-for="(item,index) in @LowerFirstLetter(@column.FkEntityName)@(@column.PropertyName)DropdownList" :key="index" :value="item.value" :label="item.label" />
|
||||
@ -45,7 +50,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
} else if(@column.EffectType == "Select") {
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
|
||||
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
|
||||
<el-select v-model="state.queryParams.@(@column.LowerPropertyName)" filterable placeholder="请选择@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery(true)" >
|
||||
<el-option v-for="(item,index) in dl('@(@column.DictTypeCode)')" :key="index" :value="item.code" :label="`${item.name} [${item.code}] ${item.value}`" />
|
||||
@ -53,7 +58,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
} else if(@column.EffectType == "EnumSelector") {
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
|
||||
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
|
||||
<el-select v-model="state.queryParams.@(@column.LowerPropertyName)" filterable placeholder="请选择@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery(true)" >
|
||||
<el-option v-for="(item,index) in dl('@(@column.DictTypeCode)')" :key="index" :value="item.value" :label="`${item.name} [${item.code}] ${item.value}`" />
|
||||
@ -61,7 +66,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
} else if(@column.EffectType == "DatePicker") {
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
|
||||
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
|
||||
@if(@column.QueryType == "~"){
|
||||
@:<el-date-picker type="daterange" v-model="state.queryParams.@(@column.LowerPropertyName)Range" value-format="YYYY-MM-DD HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" />
|
||||
@ -83,6 +88,8 @@
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @@click="handleQuery(true)" v-auth="'@(@Model.LowerClassName):page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @@click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||
<el-button icon="ele-ZoomIn" @@click="changeAdvanceQueryUI" v-if="!state.showAdvanceQueryUI" style="margin-left: 5px"> 高级查询 </el-button>
|
||||
<el-button icon="ele-ZoomOut" @@click="changeAdvanceQueryUI" v-if="state.showAdvanceQueryUI" style="margin-left: 5px"> 隐藏 </el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -218,6 +225,7 @@ import PrintDialog from '/@@/views/system/print/component/hiprint/preview.vue';
|
||||
import EditDialog from '/@@/views/@(@Model.PagePath)/@(@Model.LowerClassName)/component/editDialog.vue';
|
||||
import ModifyRecord from '/@@/components/table/modifyRecord.vue';
|
||||
|
||||
@if (@Model.IsApiService) {
|
||||
// 接口函数
|
||||
import { getAPI } from '/@@/utils/axios-utils';
|
||||
|
||||
@ -227,6 +235,15 @@ import { @(@Model.ClassName)Api } from '/@@/api-services/api';
|
||||
// 模型
|
||||
import { @(@Model.ClassName), @(@Model.ClassName)Input, @(@Model.ClassName)Output } from '/@@/api-services/models';
|
||||
|
||||
} else {
|
||||
@:import { page@(@Model.EntityName), delete@(@Model.EntityName) } from '/@@/api/@(@Model.PagePath)/@(@Model.LowerEntityName)';
|
||||
foreach (var column in Model.QueryWhetherList){
|
||||
if(@column.EffectType == "fk"){
|
||||
@:import { get@(@column.FkEntityName)@(@column.PropertyName)Dropdown } from '/@@/api/@(@Model.PagePath)/@(@Model.LowerEntityName)';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 子窗口对象
|
||||
const xGrid = ref<VxeGridInstance>();
|
||||
const printDialogRef = ref<InstanceType<typeof PrintDialog>>();
|
||||
@ -234,7 +251,9 @@ const editDialogRef = ref<InstanceType<typeof EditDialog>>();
|
||||
|
||||
// 变量
|
||||
const state = reactive({
|
||||
showAdvanceQueryUI: false,
|
||||
queryParams: {
|
||||
searchKey: undefined,
|
||||
@if(Model.QueryWhetherList.Count > 0) {
|
||||
@foreach (var column in Model.QueryWhetherList) {
|
||||
@:@(@column.LowerPropertyName): undefined,
|
||||
@ -253,6 +272,11 @@ const state = reactive({
|
||||
title: '',
|
||||
});
|
||||
|
||||
// 改变高级查询的控件显示状态
|
||||
const changeAdvanceQueryUI = () => {
|
||||
state.showAdvanceQueryUI = !state.showAdvanceQueryUI;
|
||||
};
|
||||
|
||||
// 表格参数配置
|
||||
const options = useVxeTable<@(@Model.ClassName)>({
|
||||
id: '@(@Model.ClassName)',
|
||||
@ -311,11 +335,16 @@ const handleQuery = async (reset = false) => {
|
||||
// 获取数据
|
||||
const fetchData = async (tableParams: any) => {
|
||||
let params = Object.assign(state.queryParams, state.tableParams, tableParams);
|
||||
return getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)PagePost(params);
|
||||
@if (@Model.IsApiService) {
|
||||
@:return getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)PagePost(params);
|
||||
} else {
|
||||
@:return page@(@Model.ClassName)(params);
|
||||
}
|
||||
};
|
||||
|
||||
// 重置操作
|
||||
const resetQuery = () => {
|
||||
state.queryParams.searchKey = undefined,
|
||||
@if(Model.QueryWhetherList.Count > 0) {
|
||||
@foreach (var column in Model.QueryWhetherList) {
|
||||
@:state.queryParams.@(@column.LowerPropertyName) = undefined,
|
||||
@ -354,7 +383,11 @@ const handleEdit = (row: any) => {
|
||||
const handlePrint = async (row: any) => {
|
||||
state.title = '打印@(@Model.BusName)';
|
||||
@if(@Model.PrintType == "custom"){
|
||||
if (@Model.IsApiService) {
|
||||
@:var res = await getAPI(SysPrintApi).apiSysPrintPrintNameGet('@Model.PrintName');
|
||||
} else {
|
||||
@:var res = await getPrint@(@Model.ClassName)(row);
|
||||
}
|
||||
@:var printTemplate = res.data.result as SysPrint;
|
||||
@:var template = JSON.parse(printTemplate.template);
|
||||
@:var width = template.panels[0].width;
|
||||
@ -375,7 +408,11 @@ const handleDelete = (row: any) => {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(async () => {
|
||||
await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)DeletePost({ id: row.id });
|
||||
@if (@Model.IsApiService) {
|
||||
@:await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)DeletePost({ id: row.id });
|
||||
} else {
|
||||
@:await delete@(@Model.ClassName)(row);
|
||||
}
|
||||
handleQuery();
|
||||
ElMessage.success('删除成功');
|
||||
})
|
||||
|
||||
@ -12,7 +12,7 @@ if exist %apiServicesPath% (
|
||||
|
||||
echo ================================ 开始生成 api-services ================================
|
||||
|
||||
java -jar %dir%swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/All%%20Groups/swagger.json -l typescript-axios -o %apiServicesPath%
|
||||
java -jar %dir%swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/Default/swagger.json -l typescript-axios -o %apiServicesPath%
|
||||
|
||||
@rem 删除不必要的文件和文件夹
|
||||
rd /s /q %apiServicesPath%.swagger-codegen
|
||||
|
||||
@ -14,7 +14,7 @@ fi
|
||||
|
||||
echo "================================ 开始生成 api-services ================================"
|
||||
|
||||
java -jar "${currPath}"/swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/All%20Groups/swagger.json -l typescript-axios -o "${apiServicesPath}"
|
||||
java -jar "${currPath}"/swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/Default/swagger.json -l typescript-axios -o "${apiServicesPath}"
|
||||
|
||||
rm -rf "${apiServicesPath}".swagger-codegen
|
||||
rm -f "${apiServicesPath}".gitignore
|
||||
|
||||
27
Web/api_build/build_approvalFlow.bat
Normal file
27
Web/api_build/build_approvalFlow.bat
Normal file
@ -0,0 +1,27 @@
|
||||
@echo off
|
||||
CHCP 65001
|
||||
|
||||
set dir=%~dp0
|
||||
|
||||
set apiServicesPath=%dir%..\src\api-services\_approvalFlow
|
||||
|
||||
if exist %apiServicesPath% (
|
||||
echo ================================ 删除目录 api-services ================================
|
||||
rd /s /q %apiServicesPath%
|
||||
)
|
||||
|
||||
echo ================================ 开始生成 api-services ================================
|
||||
|
||||
java -jar %dir%swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/ApprovalFlow/swagger.json -l typescript-axios -o %apiServicesPath%
|
||||
|
||||
@rem 删除不必要的文件和文件夹
|
||||
rd /s /q %apiServicesPath%.swagger-codegen
|
||||
del /q %apiServicesPath%.gitignore
|
||||
del /q %apiServicesPath%.npmignore
|
||||
del /q %apiServicesPath%.swagger-codegen-ignore
|
||||
del /q %apiServicesPath%git_push.sh
|
||||
del /q %apiServicesPath%package.json
|
||||
del /q %apiServicesPath%README.md
|
||||
del /q %apiServicesPath%tsconfig.json
|
||||
|
||||
echo ================================ 生成结束 ================================
|
||||
28
Web/api_build/build_approvalFlow.sh
Normal file
28
Web/api_build/build_approvalFlow.sh
Normal file
@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
currPath=$(pwd)
|
||||
parentPath=$(dirname "$currPath")
|
||||
apiServicesPath=${parentPath}/src/api-services/_approvalFlow
|
||||
|
||||
echo "================================ 生成目录 ${apiServicesPath} ================================"
|
||||
|
||||
# 判断目录是否存在
|
||||
if test -d "$apiServicesPath"; then
|
||||
echo "================================ 删除目录 api-services ================================"
|
||||
rm -rf "${apiServicesPath}"
|
||||
fi
|
||||
|
||||
echo "================================ 开始生成 api-services ================================"
|
||||
|
||||
java -jar "${currPath}"/swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/ApprovalFlow/swagger.json -l typescript-axios -o "${apiServicesPath}"
|
||||
|
||||
rm -rf "${apiServicesPath}".swagger-codegen
|
||||
rm -f "${apiServicesPath}".gitignore
|
||||
rm -f "${apiServicesPath}".npmignore
|
||||
rm -f "${apiServicesPath}".swagger-codegen-ignore
|
||||
rm -f "${apiServicesPath}"git_push.sh
|
||||
rm -f "${apiServicesPath}"package.json
|
||||
rm -f "${apiServicesPath}"README.md
|
||||
rm -f "${apiServicesPath}"tsconfig.json
|
||||
|
||||
echo "================================ 生成结束 ================================"
|
||||
27
Web/api_build/build_dingTalk.bat
Normal file
27
Web/api_build/build_dingTalk.bat
Normal file
@ -0,0 +1,27 @@
|
||||
@echo off
|
||||
CHCP 65001
|
||||
|
||||
set dir=%~dp0
|
||||
|
||||
set apiServicesPath=%dir%..\src\api-services\_goView
|
||||
|
||||
if exist %apiServicesPath% (
|
||||
echo ================================ 删除目录 api-services ================================
|
||||
rd /s /q %apiServicesPath%
|
||||
)
|
||||
|
||||
echo ================================ 开始生成 api-services ================================
|
||||
|
||||
java -jar %dir%swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/GoView/swagger.json -l typescript-axios -o %apiServicesPath%
|
||||
|
||||
@rem 删除不必要的文件和文件夹
|
||||
rd /s /q %apiServicesPath%.swagger-codegen
|
||||
del /q %apiServicesPath%.gitignore
|
||||
del /q %apiServicesPath%.npmignore
|
||||
del /q %apiServicesPath%.swagger-codegen-ignore
|
||||
del /q %apiServicesPath%git_push.sh
|
||||
del /q %apiServicesPath%package.json
|
||||
del /q %apiServicesPath%README.md
|
||||
del /q %apiServicesPath%tsconfig.json
|
||||
|
||||
echo ================================ 生成结束 ================================
|
||||
28
Web/api_build/build_dingTalk.sh
Normal file
28
Web/api_build/build_dingTalk.sh
Normal file
@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
currPath=$(pwd)
|
||||
parentPath=$(dirname "$currPath")
|
||||
apiServicesPath=${parentPath}/src/api-services/_goView
|
||||
|
||||
echo "================================ 生成目录 ${apiServicesPath} ================================"
|
||||
|
||||
# 判断目录是否存在
|
||||
if test -d "$apiServicesPath"; then
|
||||
echo "================================ 删除目录 api-services ================================"
|
||||
rm -rf "${apiServicesPath}"
|
||||
fi
|
||||
|
||||
echo "================================ 开始生成 api-services ================================"
|
||||
|
||||
java -jar "${currPath}"/swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/All%20Groups/swagger.json -l typescript-axios -o "${apiServicesPath}"
|
||||
|
||||
rm -rf "${apiServicesPath}".swagger-codegen
|
||||
rm -f "${apiServicesPath}".gitignore
|
||||
rm -f "${apiServicesPath}".npmignore
|
||||
rm -f "${apiServicesPath}".swagger-codegen-ignore
|
||||
rm -f "${apiServicesPath}"git_push.sh
|
||||
rm -f "${apiServicesPath}"package.json
|
||||
rm -f "${apiServicesPath}"README.md
|
||||
rm -f "${apiServicesPath}"tsconfig.json
|
||||
|
||||
echo "================================ 生成结束 ================================"
|
||||
27
Web/api_build/build_goView.bat
Normal file
27
Web/api_build/build_goView.bat
Normal file
@ -0,0 +1,27 @@
|
||||
@echo off
|
||||
CHCP 65001
|
||||
|
||||
set dir=%~dp0
|
||||
|
||||
set apiServicesPath=%dir%..\src\api-services\_goView
|
||||
|
||||
if exist %apiServicesPath% (
|
||||
echo ================================ 删除目录 api-services ================================
|
||||
rd /s /q %apiServicesPath%
|
||||
)
|
||||
|
||||
echo ================================ 开始生成 api-services ================================
|
||||
|
||||
java -jar %dir%swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/GoView/swagger.json -l typescript-axios -o %apiServicesPath%
|
||||
|
||||
@rem 删除不必要的文件和文件夹
|
||||
rd /s /q %apiServicesPath%.swagger-codegen
|
||||
del /q %apiServicesPath%.gitignore
|
||||
del /q %apiServicesPath%.npmignore
|
||||
del /q %apiServicesPath%.swagger-codegen-ignore
|
||||
del /q %apiServicesPath%git_push.sh
|
||||
del /q %apiServicesPath%package.json
|
||||
del /q %apiServicesPath%README.md
|
||||
del /q %apiServicesPath%tsconfig.json
|
||||
|
||||
echo ================================ 生成结束 ================================
|
||||
28
Web/api_build/build_goView.sh
Normal file
28
Web/api_build/build_goView.sh
Normal file
@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
currPath=$(pwd)
|
||||
parentPath=$(dirname "$currPath")
|
||||
apiServicesPath=${parentPath}/src/api-services/_dingTalk
|
||||
|
||||
echo "================================ 生成目录 ${apiServicesPath} ================================"
|
||||
|
||||
# 判断目录是否存在
|
||||
if test -d "$apiServicesPath"; then
|
||||
echo "================================ 删除目录 api-services ================================"
|
||||
rm -rf "${apiServicesPath}"
|
||||
fi
|
||||
|
||||
echo "================================ 开始生成 api-services ================================"
|
||||
|
||||
java -jar "${currPath}"/swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/DingTalk/swagger.json -l typescript-axios -o "${apiServicesPath}"
|
||||
|
||||
rm -rf "${apiServicesPath}".swagger-codegen
|
||||
rm -f "${apiServicesPath}".gitignore
|
||||
rm -f "${apiServicesPath}".npmignore
|
||||
rm -f "${apiServicesPath}".swagger-codegen-ignore
|
||||
rm -f "${apiServicesPath}"git_push.sh
|
||||
rm -f "${apiServicesPath}"package.json
|
||||
rm -f "${apiServicesPath}"README.md
|
||||
rm -f "${apiServicesPath}"tsconfig.json
|
||||
|
||||
echo "================================ 生成结束 ================================"
|
||||
@ -121,6 +121,14 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="接口模式" prop="isApiService">
|
||||
<el-radio-group v-model="state.ruleForm.isApiService">
|
||||
<el-radio :value="true">使用API Service</el-radio>
|
||||
<el-radio :value="false">不使用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="支持打印" prop="printType">
|
||||
<el-select v-model="state.ruleForm.printType" filterable class="w100" @change="printTypeChanged">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user