Merge branch 'net5.0'

This commit is contained in:
不做码农 2022-05-09 20:20:21 +08:00
commit f741d7a7bf
6 changed files with 39 additions and 12 deletions

View File

@ -53,13 +53,13 @@ $elseif(column.HtmlType == "datetime")
$elseif(column.HtmlType == "imageUpload") $elseif(column.HtmlType == "imageUpload")
<el-col :lg="24"> <el-col :lg="24">
<el-form-item label="${labelName}" prop="${columnName}"> <el-form-item label="${labelName}" prop="${columnName}">
<UploadImage v-model="form.${columnName}" column="${columnName}" @success="handleUploadSuccess" /> <UploadImage v-model="form.${columnName}" column="${columnName}" @input="handleUploadSuccess" />
</el-form-item> </el-form-item>
</el-col> </el-col>
$elseif(column.HtmlType == "fileUpload") $elseif(column.HtmlType == "fileUpload")
<el-col :lg="24"> <el-col :lg="24">
<el-form-item label="${labelName}" prop="${columnName}"> <el-form-item label="${labelName}" prop="${columnName}">
<UploadFile v-model="form.${columnName}" column="${columnName}" @success="handleUploadSuccess" /> <UploadFile v-model="form.${columnName}" column="${columnName}" @input="handleUploadSuccess" />
</el-form-item> </el-form-item>
</el-col> </el-col>
$elseif(column.HtmlType == "radio") $elseif(column.HtmlType == "radio")

View File

@ -9,7 +9,7 @@ using ${options.ModelsNamespace}.Models;
using ${options.IServicsNamespace}.${options.SubNamespace}.I${options.SubNamespace}Service; using ${options.IServicsNamespace}.${options.SubNamespace}.I${options.SubNamespace}Service;
using ${options.ApiControllerNamespace}.Extensions; using ${options.ApiControllerNamespace}.Extensions;
using ${options.ApiControllerNamespace}.Filters; using ${options.ApiControllerNamespace}.Filters;
using ${options.BaseNamespace}.Common; using ${options.BaseNamespace}Common;
namespace ${options.ApiControllerNamespace}.Controllers namespace ${options.ApiControllerNamespace}.Controllers
{ {

View File

@ -53,7 +53,7 @@ $end
$end $end
var response = _${replaceDto.ModelTypeName}Repository var response = _${replaceDto.ModelTypeName}Repository
.Queryable() .Queryable()
$if(genTable.SubTableName != "" && genTable.SubTableName != null) $if(null != genTable.SubTableName && "" != genTable.SubTableName)
.Includes(it => it.Sub.MappingField(z => z.${genTable.SubTableFkName}, () => it.${replaceDto.PKName})) .Includes(it => it.Sub.MappingField(z => z.${genTable.SubTableFkName}, () => it.${replaceDto.PKName}))
$end $end
$if(genTable.SortField != "" && genTable.SortField != null) $if(genTable.SortField != "" && genTable.SortField != null)

View File

@ -460,7 +460,7 @@ namespace ZR.CodeGenerator
IsInsert = !column.IsIdentity || GenConstants.inputDtoNoField.Any(f => f.Contains(column.DbColumnName, StringComparison.OrdinalIgnoreCase)),//非自增字段都需要插入 IsInsert = !column.IsIdentity || GenConstants.inputDtoNoField.Any(f => f.Contains(column.DbColumnName, StringComparison.OrdinalIgnoreCase)),//非自增字段都需要插入
IsEdit = true, IsEdit = true,
IsQuery = false, IsQuery = false,
HtmlType = GenConstants.HTML_INPUT HtmlType = GenConstants.HTML_INPUT,
}; };
if (GenConstants.imageFiled.Any(f => column.DbColumnName.ToLower().Contains(f.ToLower()))) if (GenConstants.imageFiled.Any(f => column.DbColumnName.ToLower().Contains(f.ToLower())))
@ -513,7 +513,7 @@ namespace ZR.CodeGenerator
/// <param name="replaceDto"></param> /// <param name="replaceDto"></param>
private static void InitJntTemplate(GenerateDto dto, ReplaceDto replaceDto) private static void InitJntTemplate(GenerateDto dto, ReplaceDto replaceDto)
{ {
//Engine.Current.Clean(); Engine.Current.Clean();
dto.GenTable.Columns = dto.GenTable.Columns.OrderBy(x => x.Sort).ToList(); dto.GenTable.Columns = dto.GenTable.Columns.OrderBy(x => x.Sort).ToList();
bool showCustomInput = dto.GenTable.Columns.Any(f => f.HtmlType.Equals(GenConstants.HTML_CUSTOM_INPUT, StringComparison.OrdinalIgnoreCase)); bool showCustomInput = dto.GenTable.Columns.Any(f => f.HtmlType.Equals(GenConstants.HTML_CUSTOM_INPUT, StringComparison.OrdinalIgnoreCase));
//jnt模板引擎全局变量 //jnt模板引擎全局变量

View File

@ -60,7 +60,10 @@ namespace ZR.Service.System
if (info != null && !info.SubTableName.IsEmpty()) if (info != null && !info.SubTableName.IsEmpty())
{ {
info.SubTable = GenTableRepository.Queryable().Where(f => f.SubTableName == info.TableName).First(); info.SubTable = GenTableRepository.Queryable().Where(f => f.SubTableName == info.TableName).First();
SetTableFromOptions(info?.SubTable); if (info?.SubTable != null)
{
SetTableFromOptions(info?.SubTable);
}
} }
return info; return info;
} }

View File

@ -242,7 +242,7 @@ INSERT INTO sys_menu(menuId, menuName, parentId, orderNum, path, component, isFr
INSERT INTO sys_menu(menuId, menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time, menuName_key) VALUES (103, '部门管理', 1, 4, 'dept', 'system/dept/index', 0, 0, 'C', '0', '0', 'system:dept:list', 'tree', '', GETDATE(), 'menu.systemDept'); INSERT INTO sys_menu(menuId, menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time, menuName_key) VALUES (103, '部门管理', 1, 4, 'dept', 'system/dept/index', 0, 0, 'C', '0', '0', 'system:dept:list', 'tree', '', GETDATE(), 'menu.systemDept');
INSERT INTO sys_menu(menuId, menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time, menuName_key) VALUES (104, '岗位管理', 1, 5, 'post', 'system/post/index', 0, 0, 'C', '0', '0', 'system:post:list', 'post', '', GETDATE(), 'menu.systemPost'); INSERT INTO sys_menu(menuId, menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time, menuName_key) VALUES (104, '岗位管理', 1, 5, 'post', 'system/post/index', 0, 0, 'C', '0', '0', 'system:post:list', 'post', '', GETDATE(), 'menu.systemPost');
INSERT INTO sys_menu(menuId, menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time, menuName_key) VALUES (105, '字典管理', 1, 6, 'dict', 'system/dict/index', 0, 0, 'C', '0', '0', 'system:dict:list', 'dict', '', GETDATE(), 'menu.systemDic'); INSERT INTO sys_menu(menuId, menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time, menuName_key) VALUES (105, '字典管理', 1, 6, 'dict', 'system/dict/index', 0, 0, 'C', '0', '0', 'system:dict:list', 'dict', '', GETDATE(), 'menu.systemDic');
INSERT INTO sys_menu(menuId, menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time, menuName_key) VALUES (106, '角色分配', 1, 2, 'roleusers','system/roleusers/index', 0, 0, 'C', '1', '0', 'system:roleusers:list', 'people', '', GETDATE()); INSERT INTO sys_menu(menuId, menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time, menuName_key) VALUES (106, '角色分配', 1, 2, 'roleusers','system/roleusers/index', 0, 0, 'C', '1', '0', 'system:roleusers:list', 'people', '', GETDATE(), '');
INSERT into sys_menu(menuId, menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time, menuName_key) VALUES (107, '参数设置', 1, 8, 'config', 'system/config/index', 0, 0, 'C', '0', '0', 'system:config:list','edit','', GETDATE(), 'menu.systemParam'); INSERT into sys_menu(menuId, menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time, menuName_key) VALUES (107, '参数设置', 1, 8, 'config', 'system/config/index', 0, 0, 'C', '0', '0', 'system:config:list','edit','', GETDATE(), 'menu.systemParam');
INSERT INTO sys_menu(menuId, menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time, menuName_key) VALUES (108, '日志管理', 1, 10, 'log', '', 0, 0, 'M', '0', '0', '', 'log', '', GETDATE(), 'menu.systemLog'); INSERT INTO sys_menu(menuId, menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time, menuName_key) VALUES (108, '日志管理', 1, 10, 'log', '', 0, 0, 'M', '0', '0', '', 'log', '', GETDATE(), 'menu.systemLog');
INSERT INTO sys_menu(menuId, menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time, menuName_key) VALUES (109, '通知公告', 1, 9, 'notice', 'system/notice/index', 0, 0, 'C', '0', '0', 'system:notice:list', 'message', '', GETDATE(), 'menu.systemNotice'); INSERT INTO sys_menu(menuId, menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time, menuName_key) VALUES (109, '通知公告', 1, 9, 'notice', 'system/notice/index', 0, 0, 'C', '0', '0', 'system:notice:list', 'message', '', GETDATE(), 'menu.systemNotice');
@ -339,10 +339,35 @@ INSERT INTO sys_menu(menuId, menuName, parentId, orderNum, path, component, isFr
INSERT INTO sys_menu(menuId, menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time, update_by, update_time, remark) VALUES (1064, '生成代码', 115, 1, '#', NULL, 0, 0, 'F', '0', '0', 'tool:gen:code', '', '', GETDATE(), '', NULL, NULL); INSERT INTO sys_menu(menuId, menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time, update_by, update_time, remark) VALUES (1064, '生成代码', 115, 1, '#', NULL, 0, 0, 'F', '0', '0', 'tool:gen:code', '', '', GETDATE(), '', NULL, NULL);
INSERT INTO sys_menu(menuId, menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time, update_by, update_time, remark) VALUES (1065, '预览代码', 115, 1, '#', NULL, 0, 0, 'F', '0', '0', 'tool:gen:preview', '', '', GETDATE(), '', NULL, NULL); INSERT INTO sys_menu(menuId, menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time, update_by, update_time, remark) VALUES (1065, '预览代码', 115, 1, '#', NULL, 0, 0, 'F', '0', '0', 'tool:gen:preview', '', '', GETDATE(), '', NULL, NULL);
SET IDENTITY_INSERT sys_menu OFF
GO
-- 文件存储菜单
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by, create_time, remark, menuName_key)
VALUES ('文件存储', 3, 17, 'file', 'tool/file/index', 0, 0, 'C', '0', '0', 'tool:file:list', 'upload', '', '', '文件存储菜单', 'menu.fileStorage');
-- 按钮父菜单id
DECLARE @fileMenuId INT = SCOPE_IDENTITY();
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_time)
VALUES ('查询', @fileMenuId, 1, '#', NULL, 0, 0, 'F', '0', '0', 'tool:file:query', '', '');
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_time)
VALUES ('新增', @fileMenuId, 2, '#', NULL, 0, 0, 'F', '0', '0', 'tool:file:add', '', '');
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_time)
VALUES ('删除', @fileMenuId, 3, '#', NULL, 0, 0, 'F', '0', '0', 'tool:file:delete', '', '');
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_time)
VALUES ('修改', @fileMenuId, 4, '#', NULL, 0, 0, 'F', '0', '0', 'tool:file:update', '', '');
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_time)
VALUES ('导出', @fileMenuId, 5, '#', NULL, 0, 0, 'F', '0', '0', 'tool:file:export', '', '');
GO
-- 多语言配置菜单 -- 多语言配置菜单
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by, create_time, menuName_key) INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by, create_time, menuName_key)
VALUES ('多语言配置', 1, 999, 'CommonLang', 'system/commonLang/index', 0, 0, 'C', '0', '0', 'system:lang:list', '', 'system', GETDATE(), 'menu.systemLang'); VALUES ('多语言配置', 1, 999, 'CommonLang', 'system/commonLang/index', 0, 0, 'C', '0', '0', 'system:lang:list', 'language', 'system', GETDATE(), 'menu.systemLang');
-- 按钮父菜单id -- 按钮父菜单id
DECLARE @menuId INT = @@identity DECLARE @menuId INT = @@identity
@ -362,10 +387,7 @@ VALUES ('修改', @menuId, 4, '#', NULL, 0, 0, 'F', '0', '0', 'system:lang:edit'
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time) INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time)
VALUES ('导出', @menuId, 5, '#', NULL, 0, 0, 'F', '0', '0', 'system:lang:export', '', 'system', GETDATE()); VALUES ('导出', @menuId, 5, '#', NULL, 0, 0, 'F', '0', '0', 'system:lang:export', '', 'system', GETDATE());
SET IDENTITY_INSERT sys_menu OFF
GO GO
-- ---------------------------- -- ----------------------------
-- = '操作日志记录' -- = '操作日志记录'
-- Table structure for sys_oper_log -- Table structure for sys_oper_log
@ -782,6 +804,8 @@ CREATE TABLE [dbo].[sys_file](
[storeType] [INT] NULL [storeType] [INT] NULL
) )
GO GO
IF OBJECT_ID(N'sys_common_lang',N'U') is not NULL DROP TABLE sys_common_lang
GO
CREATE TABLE sys_common_lang CREATE TABLE sys_common_lang
( (
id BIGINT NOT NULL, id BIGINT NOT NULL,