Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
58356594
提交
58356594
编写于
2月 11, 2022
作者:
Mosher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:更新实体行为发布逻辑,支持脚本、实体处理逻辑类型
上级
c1ca690c
变更
5
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
116 行增加
和
59 行删除
+116
-59
service-delogic-method.hbs
...mpl/r7/@macro/front-end/entity/service-delogic-method.hbs
+26
-0
service-remote-method.hbs
...empl/r7/@macro/front-end/entity/service-remote-method.hbs
+44
-44
service-script-method.hbs
...empl/r7/@macro/front-end/entity/service-script-method.hbs
+19
-0
{{appEntities}}-service-base.ts.hbs
...c/api/{{appEntities}}/{{appEntities}}-service-base.ts.hbs
+18
-6
app-sys-action.ts
...p_{{apps}}/src/core/logic/app-ui-action/app-sys-action.ts
+9
-9
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/entity/service-delogic-method.hbs
0 → 100644
浏览文件 @
58356594
/**
*
{{
singleAppMethod
.
codeName
}}
*
* @param {IContext} [context={}]
* @param {IParam} [data = {}]
* @returns {Promise
<any>
}
* @memberof
{{
pascalCase
appEntity
.
codeName
}}
ServiceBase
*/
public async
{{
singleAppMethod
.
codeName
}}
(context: IContext = {}, data: IParam = {}): Promise
<any>
{
try {
// data = await this.executeAppDELogic('
{{
singleAppMethod
.
psDEAction
.
psDELogic
.
codeName
}}
', context, data);
const res = {
ok: true,
status: 200,
data: data
};
return res;
} catch (error: any) {
const res = {
ok: false,
status: 500,
message: error?.message
}
return res;
}
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/entity/service-remote-method.hbs
浏览文件 @
58356594
/**
/**
*
{{
singleAppMethod
.
codeName
}}
*
* @param {IContext} [context={}]
...
...
@@ -6,7 +6,7 @@
* @returns {Promise
<any>
}
* @memberof
{{
pascalCase
appEntity
.
codeName
}}
ServiceBase
*/
public async
{{
singleAppMethod
.
codeName
}}
(context: IContext = {}, data: IParam = {}): Promise
<any>
{
public async
{{
singleAppMethod
.
codeName
}}
(context: IContext = {}, data: IParam = {}): Promise
<any>
{
{{! 方法路径是否带资源主键 }}
const deResPath = this.buildDeResPath(context,
{{
singleAppMethod
.
psDEServiceAPIMethod
.
needResourceKey
}}
);
{{#if
(
eq
singleAppMethod
.
methodType
"SELECT"
)
}}
...
...
@@ -45,4 +45,4 @@
this.afterExecuteAction(context,data,'
{{
singleAppMethod
.
codeName
}}
');
{{/if}}
return res;
}
\ No newline at end of file
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/entity/service-script-method.hbs
0 → 100644
浏览文件 @
58356594
/**
*
{{
singleAppMethod
.
codeName
}}
*
* @param {IContext} [context={}]
* @param {IParam} [data = {}]
* @returns {Promise
<any>
}
* @memberof
{{
pascalCase
appEntity
.
codeName
}}
ServiceBase
*/
public async
{{
singleAppMethod
.
codeName
}}
(context: IContext = {}, data: IParam = {}): Promise
<any>
{
{{#if
singleAppMethod
.
psDEAction
.
scriptCode
}}
eval(`
{{
singleAppMethod
.
psDEAction
.
scriptCode
}}
`);
{{/if}}
const res = {
ok: true,
status: 200,
data: data
}
return res;
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/api/{{appEntities}}/{{appEntities}}-service-base.ts.hbs
浏览文件 @
58356594
...
...
@@ -43,13 +43,25 @@ export class {{pascalCase appEntity.codeName}}ServiceBase extends EntityService
}
{{#
each
appEntity
.
allPSAppDEMethods
as
|
singleAppMethod
|
}}
{{! 非内置行为才输出 }}
{{#if
(
eq
isBuiltinMethod
false
)
}}
{{! 存在接口方法才输出 }}
{{#if
singleAppMethod
.
psDEServiceAPIMethod
}}
{{! 远端接口 }}
{{! 非内置行为和非临时数据方法才输出 }}
{{#if
(
and
(
eq
builtinMethod
false
)
(
eq
tempDataMode
0
))
}}
{{#if
(
eq
appEntity
.
psDEServiceAPI
.
nested
true
)
}}
{{!-- todo嵌套行为补充 --}}
{{else}}
{{!-- todo 插件 --}}
{{#if
(
and
(
eq
methodType
'DEACTION'
)
psDEAction
(
eq
psDEAction
.
actionType
'DELOGIC'
))
}}
{{!-- 实体处理逻辑 --}}
{{>
@macro
/
front-end
/
entity
/
service-delogic-method
.
hbs
singleAppMethod
=
singleAppMethod
}}
{{else
if
(
and
(
eq
methodType
'DEACTION'
)
psDEAction
(
eq
psDEAction
.
actionType
'SCRIPT'
))
}}
{{!-- 脚本代码 --}}
{{>
@macro
/
front-end
/
entity
/
service-script-method
.
hbs
singleAppMethod
=
singleAppMethod
}}
{{else
if
(
and
singleAppMethod
.
psDEServiceAPIMethod
appEntity
.
major
)
}}
{{!-- 远程接口 --}}
{{>
@macro
/
front-end
/
entity
/
service-remote-method
.
hbs
singleAppMethod
=
singleAppMethod
}}
{{/if}}
{{/if}}
{{/if}}
{{/
each
}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/logic/app-ui-action/app-sys-action.ts
浏览文件 @
58356594
...
...
@@ -204,7 +204,7 @@ export class AppSysAction {
public
static
newRow
(
params
:
IUIActionParams
)
{
const
{
actionEnvironment
}
=
params
;
// 视图里获取多数据部件
if
(
hasFunction
(
actionEnvironment
.
xDataControl
,
"newRow"
))
{
if
(
actionEnvironment
.
xDataControl
&&
hasFunction
(
actionEnvironment
.
xDataControl
,
"newRow"
))
{
actionEnvironment
.
xDataControl
.
newRow
();
}
else
if
(
isExist
(
actionEnvironment
.
newRow
))
{
actionEnvironment
.
newRow
();
...
...
@@ -220,7 +220,7 @@ export class AppSysAction {
public
static
save
(
params
:
IUIActionParams
)
{
const
{
actionEnvironment
}
=
params
;
// 视图里获取多数据部件
if
(
hasFunction
(
actionEnvironment
.
xDataControl
,
"save"
))
{
if
(
actionEnvironment
.
xDataControl
&&
hasFunction
(
actionEnvironment
.
xDataControl
,
"save"
))
{
actionEnvironment
.
xDataControl
.
save
();
}
else
if
(
isExist
(
actionEnvironment
.
save
))
{
actionEnvironment
.
save
();
...
...
@@ -236,7 +236,7 @@ export class AppSysAction {
public
static
saveRow
(
params
:
IUIActionParams
)
{
const
{
actionEnvironment
}
=
params
;
// 视图里获取多数据部件
if
(
hasFunction
(
actionEnvironment
.
xDataControl
,
"save"
))
{
if
(
actionEnvironment
.
xDataControl
&&
hasFunction
(
actionEnvironment
.
xDataControl
,
"save"
))
{
actionEnvironment
.
xDataControl
.
save
();
}
else
if
(
isExist
(
actionEnvironment
.
save
))
{
actionEnvironment
.
save
();
...
...
@@ -252,10 +252,10 @@ export class AppSysAction {
public
static
remove
(
params
:
IUIActionParams
)
{
const
{
actionEnvironment
,
data
}
=
params
;
// 视图里获取多数据部件
if
(
hasFunction
(
actionEnvironment
.
xDataControl
,
"remove"
))
{
if
(
actionEnvironment
.
xDataControl
&&
hasFunction
(
actionEnvironment
.
xDataControl
,
"remove"
))
{
actionEnvironment
.
xDataControl
.
remove
(
data
);
}
else
if
(
isExist
(
actionEnvironment
.
remove
))
{
actionEnvironment
.
remove
();
actionEnvironment
.
remove
(
data
);
}
}
...
...
@@ -268,7 +268,7 @@ export class AppSysAction {
public
static
refresh
(
params
:
IUIActionParams
)
{
const
{
actionEnvironment
}
=
params
;
// 视图里获取多数据部件
if
(
hasFunction
(
actionEnvironment
.
xDataControl
,
"refresh"
))
{
if
(
actionEnvironment
.
xDataControl
&&
hasFunction
(
actionEnvironment
.
xDataControl
,
"refresh"
))
{
actionEnvironment
.
xDataControl
.
refresh
();
}
else
if
(
isExist
(
actionEnvironment
.
refresh
))
{
actionEnvironment
.
refresh
();
...
...
@@ -296,7 +296,7 @@ export class AppSysAction {
*/
public
static
async
saveAndExit
(
params
:
IUIActionParams
)
{
const
{
actionEnvironment
}
=
params
;
if
(
hasFunction
(
actionEnvironment
.
xDataControl
,
"save"
))
{
if
(
actionEnvironment
.
xDataControl
&&
hasFunction
(
actionEnvironment
.
xDataControl
,
"save"
))
{
await
actionEnvironment
.
xDataControl
.
save
();
}
else
if
(
isExist
(
actionEnvironment
.
save
))
{
await
actionEnvironment
.
save
();
...
...
@@ -314,7 +314,7 @@ export class AppSysAction {
*/
public
static
async
saveAndNew
(
params
:
IUIActionParams
)
{
const
{
actionEnvironment
}
=
params
;
if
(
hasFunction
(
actionEnvironment
.
xDataControl
,
"save"
))
{
if
(
actionEnvironment
.
xDataControl
&&
hasFunction
(
actionEnvironment
.
xDataControl
,
"save"
))
{
await
actionEnvironment
.
xDataControl
.
save
();
}
else
if
(
isExist
(
actionEnvironment
.
save
))
{
await
actionEnvironment
.
save
();
...
...
@@ -338,7 +338,7 @@ export class AppSysAction {
public
static
async
removeAndExit
(
params
:
IUIActionParams
)
{
const
{
actionEnvironment
}
=
params
;
// 视图里获取多数据部件
if
(
hasFunction
(
actionEnvironment
.
xDataControl
,
"remove"
))
{
if
(
actionEnvironment
.
xDataControl
&&
hasFunction
(
actionEnvironment
.
xDataControl
,
"remove"
))
{
await
actionEnvironment
.
xDataControl
.
remove
();
}
else
if
(
isExist
(
actionEnvironment
.
remove
))
{
await
actionEnvironment
.
remove
();
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录