Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
050402ad
提交
050402ad
编写于
12月 16, 2021
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
拉平model属性
上级
224da2a8
变更
10
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
200 行增加
和
24 行删除
+200
-24
ApiModel.java
...core/src/main/java/cn/ibizlab/codegen/model/ApiModel.java
+9
-0
AppModel.java
...core/src/main/java/cn/ibizlab/codegen/model/AppModel.java
+15
-0
CtrlModel.java
...ore/src/main/java/cn/ibizlab/codegen/model/CtrlModel.java
+7
-0
DataSetModel.java
.../src/main/java/cn/ibizlab/codegen/model/DataSetModel.java
+1
-1
DynamicModelStorage.java
...in/java/cn/ibizlab/codegen/model/DynamicModelStorage.java
+11
-9
ModelStorage.java
.../src/main/java/cn/ibizlab/codegen/model/ModelStorage.java
+32
-13
PageModel.java
...ore/src/main/java/cn/ibizlab/codegen/model/PageModel.java
+25
-0
SystemModel.java
...e/src/main/java/cn/ibizlab/codegen/model/SystemModel.java
+22
-1
{{pages}}-view.vue
...src/page/{{appModules}}/{{pages}}-view/{{pages}}-view.vue
+1
-0
vue.config.js
...re/src/main/resources/templ/r7/app_{{apps}}/vue.config.js
+77
-0
未找到文件。
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/ApiModel.java
0 → 100644
浏览文件 @
050402ad
package
cn
.
ibizlab
.
codegen
.
model
;
import
net.ibizsys.model.app.IPSApplication
;
public
class
ApiModel
extends
BaseModel
{
}
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/AppModel.java
0 → 100644
浏览文件 @
050402ad
package
cn
.
ibizlab
.
codegen
.
model
;
import
net.ibizsys.model.app.IPSApplication
;
public
class
AppModel
extends
BaseModel
{
public
IPSApplication
getApplication
()
{
return
(
IPSApplication
)
opt
;
}
public
String
getMain
()
{
return
getApplication
().
getDefaultPSAppIndexView
().
getName
();
}
}
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/CtrlModel.java
0 → 100644
浏览文件 @
050402ad
package
cn
.
ibizlab
.
codegen
.
model
;
public
class
CtrlModel
extends
BaseModel
{
}
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/DataSetModel.java
浏览文件 @
050402ad
...
...
@@ -49,7 +49,7 @@ public class DataSetModel extends BaseModel{
*/
private
String
dsModel
;
public
IPSDEDataSet
getDataSet
s
()
public
IPSDEDataSet
getDataSet
()
{
return
(
IPSDEDataSet
)
opt
;
}
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/DynamicModelStorage.java
浏览文件 @
050402ad
...
...
@@ -47,12 +47,14 @@ public class DynamicModelStorage {
return
this
;
}
private
IPSSystem
iPSSystem
=
null
;
public
IPSSystem
getPSSystem
()
private
SystemModel
systemModel
=
null
;
public
SystemModel
getSystemModel
()
{
if
(
iPSSystem
==
null
)
{
if
(
systemModel
==
null
)
{
String
strPSModelFolderPath
=
null
;
if
(
Files
.
exists
(
Paths
.
get
(
getModelPath
(),
"PSSYSTEM.json"
)))
{
strPSModelFolderPath
=
Paths
.
get
(
getModelPath
()).
toString
();
...
...
@@ -67,26 +69,26 @@ public class DynamicModelStorage {
PSModelServiceImpl
psModelService
=
new
PSModelServiceImpl
();
psModelService
.
setPSModelFolderPath
(
strPSModelFolderPath
);
try
{
iPSSystem
=
psModelService
.
getPSSystem
();
IPSSystem
iPSSystem
=
psModelService
.
getPSSystem
();
systemModel
=
new
SystemModel
().
setOpt
(
iPSSystem
);
Assert
.
notNull
(
iPSSystem
,
"加载系统模型错误:"
+
strPSModelFolderPath
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"加载系统模型错误"
+
strPSModelFolderPath
,
e
);
}
}
return
iPSSystem
;
return
systemModel
;
}
private
Map
<
String
,
EntityModel
>
entities
=
new
HashMap
<>();
public
EntityModel
getDynamicEntity
(
String
entity
)
throws
Exception
{
if
(
entities
.
containsKey
(
entity
))
return
entities
.
get
(
entity
);
IPSSystem
iPSSystem
=
get
PS
System
();
IPSSystem
iPSSystem
=
get
SystemModel
().
get
System
();
IPSDataEntity
dataEntity
=
iPSSystem
.
getPSDataEntity
(
entity
,
true
);
Assert
.
notNull
(
dataEntity
,
"未找到对应的实体模型:"
+
entity
);
EntityModel
entityModel
=
new
EntityModel
().
setOpt
(
dataEntity
);
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/ModelStorage.java
浏览文件 @
050402ad
...
...
@@ -46,14 +46,14 @@ public class ModelStorage {
opt
.
putAll
(
config
.
getAdditionalProperties
());
opt
.
setTemplateFileType
(
type
);
IPSSystem
ipsSystem
=
dynamicService
.
getPSSystem
();
SystemModel
systemModel
=
dynamicService
.
getSystemModel
();
if
(
StringUtils
.
isEmpty
(
config
.
getAdditionalProperties
().
get
(
CodegenConstants
.
PROJECT_NAME
)))
opt
.
setProjectName
(
ipsSystem
.
getCodeName
().
toLowerCase
()).
toString
(
);
opt
.
setProjectName
(
systemModel
.
getProjectName
()
);
if
(
StringUtils
.
isEmpty
(
config
.
getAdditionalProperties
().
get
(
CodegenConstants
.
PROJECT_DESC
)))
opt
.
setProjectDesc
(
ipsSystem
.
getName
().
toLowerCase
()).
toString
(
);
opt
.
setProjectDesc
(
systemModel
.
getProjectDesc
()
);
if
(
StringUtils
.
isEmpty
(
config
.
getAdditionalProperties
().
get
(
CodegenConstants
.
PACKAGE_NAME
)))
opt
.
setPackageName
(
ipsSystem
.
getCodeName
().
toLowerCase
()).
toString
(
);
opt
.
set
(
"system"
,
ipsSystem
);
opt
.
setPackageName
(
systemModel
.
getPackageName
()
);
opt
.
set
(
"system"
,
systemModel
);
return
opt
;
}
...
...
@@ -69,9 +69,9 @@ public class ModelStorage {
CliData
rt
=
new
CliData
();
if
(
type
.
equals
(
TemplateFileType
.
api
))
{
if
(
dynamicService
.
get
PS
System
().
getAllPSSysServiceAPIs
()!=
null
)
if
(
dynamicService
.
get
SystemModel
().
get
System
().
getAllPSSysServiceAPIs
()!=
null
)
{
dynamicService
.
get
PS
System
().
getAllPSSysServiceAPIs
().
forEach
(
item
->{
dynamicService
.
get
SystemModel
().
get
System
().
getAllPSSysServiceAPIs
().
forEach
(
item
->{
CliOption
opt
=
newCliOption
(
TemplateFileType
.
api
).
baseData
(
item
,
item
.
getCodeName
().
toLowerCase
());
rt
.
addOption
(
opt
);
});
...
...
@@ -79,17 +79,18 @@ public class ModelStorage {
}
else
if
(
type
.
equals
(
TemplateFileType
.
app
))
{
if
(
dynamicService
.
get
PS
System
().
getAllPSApps
()!=
null
)
if
(
dynamicService
.
get
SystemModel
().
get
System
().
getAllPSApps
()!=
null
)
{
dynamicService
.
getPSSystem
().
getAllPSApps
().
forEach
(
item
->{
CliOption
opt
=
newCliOption
(
TemplateFileType
.
app
).
baseData
(
item
,
item
.
getCodeName
().
toLowerCase
());
dynamicService
.
getSystemModel
().
getSystem
().
getAllPSApps
().
forEach
(
item
->{
AppModel
appModel
=
new
AppModel
().
setOpt
(
item
);
CliOption
opt
=
newCliOption
(
TemplateFileType
.
app
).
baseData
(
appModel
,
item
.
getCodeName
().
toLowerCase
());
rt
.
addOption
(
opt
);
});
}
}
else
if
(
type
.
equals
(
TemplateFileType
.
serviceApi
))
{
dynamicService
.
get
PS
System
().
getAllPSSysServiceAPIs
().
forEach
(
api
->{
dynamicService
.
get
SystemModel
().
get
System
().
getAllPSSysServiceAPIs
().
forEach
(
api
->{
if
(
api
.
getPSDEServiceAPIs
()!=
null
)
{
api
.
getPSDEServiceAPIs
().
forEach
(
item
->{
...
...
@@ -101,7 +102,7 @@ public class ModelStorage {
}
else
if
(
type
.
equals
(
TemplateFileType
.
entity
))
{
dynamicService
.
get
PS
System
().
getAllPSDataEntities
().
forEach
(
item
->{
dynamicService
.
get
SystemModel
().
get
System
().
getAllPSDataEntities
().
forEach
(
item
->{
EntityModel
schema
=
dynamicService
.
getEntitySchema
(
item
.
getId
());
CliOption
opt
=
newCliOption
(
TemplateFileType
.
entity
).
setCliSubType
(
schema
.
getStorageMode
()).
setModule
(
schema
.
getModule
())
.
baseData
(
schema
,
item
.
getCodeName
());
...
...
@@ -110,12 +111,30 @@ public class ModelStorage {
}
else
if
(
type
.
equals
(
TemplateFileType
.
module
))
{
dynamicService
.
get
PS
System
().
getAllPSSystemModules
().
forEach
(
item
->{
dynamicService
.
get
SystemModel
().
get
System
().
getAllPSSystemModules
().
forEach
(
item
->{
CliOption
opt
=
newCliOption
(
TemplateFileType
.
module
)
.
baseData
(
item
,
item
.
getCodeName
());
rt
.
addOption
(
opt
);
});
}
else
if
(
type
.
equals
(
TemplateFileType
.
page
))
{
dynamicService
.
getSystemModel
().
getSystem
().
getAllPSApps
().
forEach
(
app
->{
if
(
app
.
getAllPSAppViews
()!=
null
)
{
app
.
getAllPSAppViews
().
forEach
(
item
->{
PageModel
pageModel
=
new
PageModel
().
setOpt
(
item
);
CliOption
opt
=
newCliOption
(
TemplateFileType
.
page
)
.
set
(
"apps"
,
app
.
getCodeName
().
toLowerCase
())
.
set
(
"appModules"
,
pageModel
.
getAppModule
())
.
baseData
(
pageModel
,
item
.
getCodeName
().
toLowerCase
());
rt
.
addOption
(
opt
);
});
}
});
}
else
if
(
type
.
equals
(
TemplateFileType
.
supportingFiles
))
{
CliOption
opt
=
newCliOption
(
TemplateFileType
.
supportingFiles
)
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/PageModel.java
0 → 100644
浏览文件 @
050402ad
package
cn
.
ibizlab
.
codegen
.
model
;
import
net.ibizsys.model.app.view.IPSAppView
;
import
org.springframework.util.StringUtils
;
public
class
PageModel
extends
BaseModel
{
public
IPSAppView
getAppView
()
{
return
(
IPSAppView
)
opt
;
}
public
String
getAppModule
()
{
if
(
getAppView
().
getPSAppDataEntity
()==
null
)
return
"default"
;
String
appModules
=
getAppView
().
getPSAppDataEntity
().
getCodeName
();
appModules
=
appModules
.
toLowerCase
();
return
appModules
;
}
}
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/SystemModel.java
浏览文件 @
050402ad
package
cn
.
ibizlab
.
codegen
.
model
;
public
class
SystemModel
{
import
net.ibizsys.model.IPSSystem
;
public
class
SystemModel
extends
BaseModel
{
public
IPSSystem
getSystem
()
{
return
(
IPSSystem
)
opt
;
}
public
String
getProjectName
()
{
return
getSystem
().
getCodeName
().
toLowerCase
();
}
public
String
getProjectDesc
()
{
return
getSystem
().
getName
();
}
public
String
getPackageName
()
{
return
getSystem
().
getCodeName
().
toLowerCase
();
}
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/page/{{appModules}}/{{pages}}-view/{{pages}}-view.vue
0 → 100644
浏览文件 @
050402ad
{{page.codeName}}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/vue.config.js
0 → 100644
浏览文件 @
050402ad
const
path
=
require
(
'path'
);
const
os
=
require
(
'os'
);
function
resolve
(
dir
)
{
return
path
.
join
(
__dirname
,
dir
)
}
//{{app.codeName}}
module
.
exports
=
{
publicPath
:
'./'
,
// 去除 map 文件 1
productionSourceMap
:
false
,
outputDir
:
"../{{projectName}}-app/{{projectName}}-app-{{apps}}/target/classes/META-INF/resources"
,
devServer
:
{
host
:
'0.0.0.0'
,
port
:
8111
,
compress
:
true
,
disableHostCheck
:
true
,
// proxy: "http://127.0.0.1:8080/",
historyApiFallback
:
{
rewrites
:
[
]
}
},
pages
:
{
apiview
:
{
// page 的入口
entry
:
'src/pages/api/{{app.main}}/main.ts'
,
// 模板来源
template
:
'src/template.html'
,
// 在 dist/index.html 的输出
filename
:
'index.html'
,
// 当使用 title 选项时,
// template 中的 title 标签需要是 <title><%= htmlWebpackPlugin.options.title %></title>
title
:
'{{app.defaultPSAppIndexView.title}}'
,
// 在这个页面中包含的块,默认情况下会包含
// 提取出来的通用 chunk 和 vendor chunk。
// chunks: ['chunk-vendors', 'chunk-common', 'index']
},
},
// 多核打包
parallel
:
os
.
cpus
().
length
>
1
,
chainWebpack
:
(
config
)
=>
{
// 删除自动计算预加载资源
config
.
plugins
.
delete
(
'preload-apiview'
)
// 删除预加载资源
config
.
plugins
.
delete
(
'prefetch-apiview'
)
config
.
resolve
.
alias
.
set
(
'@ibizsys'
,
resolve
(
'src/ibizsys'
))
.
set
(
'@pages'
,
resolve
(
'src/pages'
))
.
set
(
'@components'
,
resolve
(
'src/components'
))
.
set
(
'@widgets'
,
resolve
(
'src/widgets'
))
.
set
(
'@engine'
,
resolve
(
'src/engine'
))
.
set
(
'@interface'
,
resolve
(
'src/interface'
))
.
set
(
'@locale'
,
resolve
(
'src/locale'
))
.
set
(
'@mock'
,
resolve
(
'src/mock'
))
.
set
(
'@service'
,
resolve
(
'src/service'
))
.
set
(
'@codelist'
,
resolve
(
'src/codelist'
))
},
configureWebpack
:
config
=>
{
let
ForkTsCheckerPlugin
;
if
(
config
.
plugins
.
length
>
0
){
ForkTsCheckerPlugin
=
config
.
plugins
.
find
(
element
=>
{
return
element
.
workersNumber
&&
element
.
memoryLimit
;
})
}
if
(
Object
.
is
(
config
.
mode
,
'production'
))
{
// 最大进程数
ForkTsCheckerPlugin
.
workersNumber
=
os
.
cpus
().
length
>
4
?
4
:
os
.
cpus
().
length
;
// 会占用额外内存不释放,不建议开发阶段使用
// 单个进程最大使用内存
ForkTsCheckerPlugin
.
memoryLimit
=
4096
;
}
else
{
// 最大进程数
// ForkTsCheckerPlugin.workersNumber = os.cpus().length > 4 ? 4 : os.cpus().length; // 会占用额外内存不释放,不建议开发阶段使用
// 单个进程最大使用内存
ForkTsCheckerPlugin
.
memoryLimit
=
4096
;
}
},
}
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录