Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
c85b0f53
提交
c85b0f53
编写于
12月 31, 2021
作者:
WodahsOrez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:部件服务
上级
41b1c709
变更
12
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
128 行增加
和
116 行删除
+128
-116
controlAction.hbs
...s/templ/r7/@macro/front-end/view/common/controlAction.hbs
+8
-2
viewBaseConfig.hbs
.../templ/r7/@macro/front-end/view/common/viewBaseConfig.hbs
+23
-24
control-vo-base.ts
...pps}}/src/ibiz-core/runtime/control-vo/control-vo-base.ts
+17
-0
control-service-base.ts
...ibiz-core/service/control-service/control-service-base.ts
+18
-1
edit-form-service.ts
...rc/ibiz-core/service/control-service/edit-form-service.ts
+7
-14
index.ts
...p_{{apps}}/src/ibiz-core/service/control-service/index.ts
+2
-1
{{pages@APPINDEXVIEW}}-config.ts.hbs
...pages@APPINDEXVIEW}}/{{pages@APPINDEXVIEW}}-config.ts.hbs
+1
-3
{{pages@DEEDITVIEW}}-config.ts.hbs
...}/{{pages@DEEDITVIEW}}/{{pages@DEEDITVIEW}}-config.ts.hbs
+0
-5
{{pages@DEGRIDVIEW}}-config.ts.hbs
...}/{{pages@DEGRIDVIEW}}/{{pages@DEGRIDVIEW}}-config.ts.hbs
+0
-5
{{pages@DEPICKUPGRIDVIEW}}-config.ts.hbs
...PICKUPGRIDVIEW}}/{{pages@DEPICKUPGRIDVIEW}}-config.ts.hbs
+1
-14
{{pages@DEPICKUPVIEW}}-config.ts.hbs
...pages@DEPICKUPVIEW}}/{{pages@DEPICKUPVIEW}}-config.ts.hbs
+1
-14
{{ctrls@FORM}}-form-config.ts.hbs
...s}}/{{ctrls@FORM}}-form/{{ctrls@FORM}}-form-config.ts.hbs
+50
-33
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/view/common/controlAction.hbs
浏览文件 @
c85b0f53
controlsAction:{
controlsAction:{
{{#
page
.
ctrls
as
|
ctrl
|
}}
{{#
neq
controlType
"TOOLBAR"
}}
{{
codeName
}}
:{
loadAction: '
{{
ctrl
.
getPSControlAction
.
psAppDEMethod
.
codeName
}}
',
removeAction: '
{{
ctrl
.
removePSControlAction
.
psAppDEMethod
.
codeName
}}
',
updateAction: '
{{
ctrl
.
updatePSControlAction
.
psAppDEMethod
.
codeName
}}
',
loadDraftAction: '
{{
ctrl
.
getDraftPSControlAction
.
psAppDEMethod
.
codeName
}}
',
createAction: '
{{
ctrl
.
getDraftPSControlAction
.
psAppDEMethod
.
codeName
}}
',
}
\ No newline at end of file
},
{{/
neq
}}
{{/
page
.
ctrls
}}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/view/common/viewBaseConfig.hbs
浏览文件 @
c85b0f53
viewCodeName: '
{{
page
.
codeName
}}
',
viewName: '
{{
page
.
name
}}
',
viewCaption: '
{{
page
.
caption
}}
',
height: '
{{
page
.
height
}}
',
width: '
{{
page
.
width
}}
',
viewMsgGroup: '
{{
page
.
psAppViewMsgGroup
}}
',
viewUIActions: '
{{
page
.
psAppViewUIActions
}}
',
viewSysCss: '
{{
page
.
psSysCss
}}
',
viewSysImage: '
{{
page
.
psSysImage
}}
',
subCaption: '
{{
page
.
subCaption
}}
',
viewType: '
{{
page
.
viewType
}}
',
viewStyle: '
{{
page
.
viewStyle
}}
',
showCaptionBar: '
{{
page
.
viewStyle
}}
',
viewToolbarModel: [
{{#
page
.
ctrls
}}
{{#
eq
controlType
"TOOLBAR"
}}
{{#
psDEToolbarItems
}}
{ name:'
{{
name
}}
',caption:'
{{
caption
}}
',groupExtractMode:'
{{
groupExtractMode
}}
',itemType:'
{{
itemType
}}
',noPrivDisplayMode:'
{{
noPrivDisplayMode
}}
',showIcon:
{{
showIcon
}}
,showCaption:
{{
showCaption
}}
,tooltip:'
{{
tooltip
}}
' },
{{/
psDEToolbarItems
}}
{{/
eq
}}
{{/
page
.
ctrls
}}
],
\ No newline at end of file
viewCodeName: '
{{
page
.
codeName
}}
',
viewName: '
{{
page
.
name
}}
',
viewCaption: '
{{
page
.
caption
}}
',
height: '
{{
page
.
height
}}
',
width: '
{{
page
.
width
}}
',
viewMsgGroup: '
{{
page
.
psAppViewMsgGroup
}}
',
viewUIActions: '
{{
page
.
psAppViewUIActions
}}
',
viewSysCss: '
{{
page
.
psSysCss
}}
',
viewSysImage: '
{{
page
.
psSysImage
}}
',
subCaption: '
{{
page
.
subCaption
}}
',
viewType: '
{{
page
.
viewType
}}
',
viewStyle: '
{{
page
.
viewStyle
}}
',
showCaptionBar: '
{{
page
.
viewStyle
}}
',
viewToolbarModel: [
{{#
page
.
ctrls
}}
{{#
eq
controlType
"TOOLBAR"
}}
{{#
psDEToolbarItems
}}
{ name:'
{{
name
}}
',caption:'
{{
caption
}}
',groupExtractMode:'
{{
groupExtractMode
}}
',itemType:'
{{
itemType
}}
',noPrivDisplayMode:'
{{
noPrivDisplayMode
}}
',showIcon:
{{
showIcon
}}
,showCaption:
{{
showCaption
}}
,tooltip:'
{{
tooltip
}}
' },
{{/
psDEToolbarItems
}}
{{/
eq
}}
{{/
page
.
ctrls
}}
],
{{>
@macro
/
front-end
/
view
/
common
/
controlAction
.
hbs
}}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/ibiz-core/runtime/control-vo/control-vo-base.ts
浏览文件 @
c85b0f53
...
...
@@ -74,6 +74,23 @@ export class ControlVOBase {
}
}
/**
* 克隆方法(创建一个新的ControlVO对象)
* 拥有ControlVO的功能,且与原对象的互不影响。
*
*/
public
clone
(){
}
/**
* 转换成普通js对象,拷贝所有的数据
*
*/
public
toObject
(){
return
{};
}
/**
* 用后台数据重置数据对象
* @param data 后台数据
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/ibiz-core/service/control-service/control-service-base.ts
浏览文件 @
c85b0f53
export
class
ControlServiceBase
{
import
{
ControlVOBase
,
EntityService
}
from
"@ibiz-core"
;
export
class
ControlServiceBase
<
T
extends
ControlVOBase
>
{
/**
* 构造函数
* @param controlVOType
*/
constructor
(
private
controlVOType
:
new
(
data
:
any
)
=>
T
,
public
entityService
:
EntityService
){}
/**
* 新建部件界面数据对象
* @param $DO 后台数据对象
* @return {*}
*/
public
newControlVO
(
$DO
:
any
){
return
new
this
.
controlVOType
(
$DO
);
}
/**
* 请求前处理函数
*
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/
widgets/{{appEntities}}/{{ctrls@FORM}}-form/{{ctrls@FORM}}-form-service.ts.hb
s
→
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/
ibiz-core/service/control-service/edit-form-service.t
s
浏览文件 @
c85b0f53
import { ControlServiceBase, hasFunction } from '@ibiz-core';
import
{
ControlServiceBase
,
ControlVOBase
,
hasFunction
}
from
'@ibiz-core'
;
import
{
createUUID
}
from
'qx-util'
;
import {
{{
pascalCase
ctrl
.
psAppDataEntity
.
codeName
}}
Service } from '@service/entity/
{{
spinalCase
ctrl
.
psAppDataEntity
.
codeName
}}
/
{{
spinalCase
ctrl
.
psAppDataEntity
.
codeName
}}
-service';
import { ControlVO } from './
{{
spinalCase
ctrl
.
codeName
}}
-form-config';
export class ControlService extends ControlServiceBase {
/**
* 实体服务对象
*/
public entityService:
{{
pascalCase
ctrl
.
psAppDataEntity
.
codeName
}}
Service = new
{{
pascalCase
ctrl
.
psAppDataEntity
.
codeName
}}
Service();
export
class
EditFormService
<
T
extends
ControlVOBase
>
extends
ControlServiceBase
<
T
>
{
/**
* 加载草稿数据
...
...
@@ -24,7 +17,7 @@ export class ControlService extends ControlServiceBase {
const
action
=
hasFunction
(
this
.
entityService
,
opts
.
action
)
?
opts
.
action
:
'GetDraft'
;
const
response
=
await
this
.
entityService
[
action
](
Context
,
Data
,
opts
.
isLoading
);
// this.setRemoteCopyData(response);
response.data =
new
ControlVO(response.data);
response
.
data
=
this
.
new
ControlVO
(
response
.
data
);
response
.
data
.
srfuf
=
"0"
;
return
this
.
handleResponse
(
response
,
opts
);
}
...
...
@@ -42,7 +35,7 @@ export class ControlService extends ControlServiceBase {
const
action
=
hasFunction
(
this
.
entityService
,
opts
.
action
)
?
opts
.
action
:
'GET'
;
const
response
=
await
this
.
entityService
[
action
](
Context
,
Data
,
opts
.
isLoading
);
// this.setRemoteCopyData(response);
response.data =
new
ControlVO(response.data);
response
.
data
=
this
.
new
ControlVO
(
response
.
data
);
return
this
.
handleResponse
(
response
,
opts
);
}
...
...
@@ -58,7 +51,7 @@ export class ControlService extends ControlServiceBase {
const
{
context
:
Context
,
data
:
Data
}
=
this
.
handleRequestData
(
context
,
data
,
opts
);
const
action
=
hasFunction
(
this
.
entityService
,
opts
.
action
)
?
opts
.
action
:
'Create'
;
const
response
=
await
this
.
entityService
[
action
](
Context
,
Data
,
opts
.
isLoading
);
response.data =
new
ControlVO(response.data);
response
.
data
=
this
.
new
ControlVO
(
response
.
data
);
return
this
.
handleResponse
(
response
,
opts
);
}
...
...
@@ -74,7 +67,7 @@ export class ControlService extends ControlServiceBase {
const
{
context
:
Context
,
data
:
Data
}
=
this
.
handleRequestData
(
context
,
data
,
opts
);
const
action
=
hasFunction
(
this
.
entityService
,
opts
.
action
)
?
opts
.
action
:
'Remove'
;
const
response
=
await
this
.
entityService
[
action
](
Context
,
Data
,
opts
.
isLoading
);
response.data =
new
ControlVO(response.data);
response
.
data
=
this
.
new
ControlVO
(
response
.
data
);
return
this
.
handleResponse
(
response
,
opts
);
}
...
...
@@ -90,7 +83,7 @@ export class ControlService extends ControlServiceBase {
const
{
context
:
Context
,
data
:
Data
}
=
this
.
handleRequestData
(
context
,
data
,
opts
);
const
action
=
hasFunction
(
this
.
entityService
,
opts
.
action
)
?
opts
.
action
:
'Update'
;
const
response
=
await
this
.
entityService
[
action
](
Context
,
Data
,
opts
.
isLoading
);
response.data =
new
ControlVO(response.data);
response
.
data
=
this
.
new
ControlVO
(
response
.
data
);
return
this
.
handleResponse
(
response
,
opts
);
}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/ibiz-core/service/control-service/index.ts
浏览文件 @
c85b0f53
export
*
from
'./control-service-base'
\ No newline at end of file
export
*
from
'./control-service-base'
export
*
from
'./edit-form-service'
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/page/{{appModules}}/{{pages@APPINDEXVIEW}}/{{pages@APPINDEXVIEW}}-config.ts.hbs
浏览文件 @
c85b0f53
export const ViewConfig = {
viewCodeName: '
{{
page
.
codeName
}}
',
viewName: '
{{
page
.
name
}}
',
viewCaption: '
{{
page
.
caption
}}
',
{{>
@macro
/
front-end
/
view
/
common
/
viewBaseConfig
.
hbs
}}
};
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/page/{{appModules}}/{{pages@DEEDITVIEW}}/{{pages@DEEDITVIEW}}-config.ts.hbs
浏览文件 @
c85b0f53
export const ViewConfig = {
{{>
@macro
/
front-end
/
view
/
common
/
viewBaseConfig
.
hbs
}}
{{#
each
page
.
ctrls
as
|
ctrl
|
}}
{{#if
(
eq
ctrl
.
controlType
"FORM"
)
}}
{{>
@macro
/
front-end
/
view
/
common
/
controlAction
.
hbs
ctrl
=
ctrl
}}
{{/if}}
{{/
each
}}
};
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/page/{{appModules}}/{{pages@DEGRIDVIEW}}/{{pages@DEGRIDVIEW}}-config.ts.hbs
浏览文件 @
c85b0f53
...
...
@@ -2,9 +2,4 @@ export const ViewConfig = {
gridRowActiveMode:
{{
page
.
gridRowActiveMode
}}
,
rowEditState:
{{#if
page
.
enableRowEdit
}}{{
page
.
rowEditDefault
}}{{else}}
false
{{/if}}
,
{{>
@macro
/
front-end
/
view
/
common
/
viewBaseConfig
.
hbs
}}
{{#
each
page
.
ctrls
as
|
ctrl
|
}}
{{#if
(
eq
ctrl
.
controlType
"GRID"
)
}}
{{>
@macro
/
front-end
/
view
/
common
/
controlAction
.
hbs
ctrl
=
ctrl
}}
{{/if}}
{{/
each
}}
};
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/page/{{appModules}}/{{pages@DEPICKUPGRIDVIEW}}/{{pages@DEPICKUPGRIDVIEW}}-config.ts.hbs
浏览文件 @
c85b0f53
export const ViewConfig = {
viewCodeName: '
{{
page
.
codeName
}}
',
viewName: '
{{
page
.
name
}}
',
viewCaption: '
{{
page
.
caption
}}
',
{{#
page
.
ctrls
}}
{{#
eq
controlType
"GRID"
}}
{{
lowerCase
codeName
}}
:{
name:'
{{
name
}}
',
codeName:'
{{
codeName
}}
',
action:{
'createAction': 'Create'
}
},
{{/
eq
}}
{{/
page
.
ctrls
}}
{{>
@macro
/
front-end
/
view
/
common
/
viewBaseConfig
.
hbs
}}
};
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/page/{{appModules}}/{{pages@DEPICKUPVIEW}}/{{pages@DEPICKUPVIEW}}-config.ts.hbs
浏览文件 @
c85b0f53
export const ViewConfig = {
viewCodeName: '
{{
page
.
codeName
}}
',
viewName: '
{{
page
.
name
}}
',
viewCaption: '
{{
page
.
caption
}}
',
{{#
page
.
ctrls
}}
{{#
eq
controlType
"PICKUPVIEWPANEL"
}}
{{
lowerCase
codeName
}}
:{
name:'
{{
name
}}
',
codeName:'
{{
codeName
}}
',
action:{
'createAction': 'Create'
}
},
{{/
eq
}}
{{/
page
.
ctrls
}}
{{>
@macro
/
front-end
/
view
/
common
/
viewBaseConfig
.
hbs
}}
};
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@FORM}}-form/{{ctrls@FORM}}-form-config.ts.hbs
浏览文件 @
c85b0f53
{{>
@macro
/
form-detail
/
include-form
.
hbs
}}
import { ControlVOBase, verifyRules } from '@ibiz-core';
import {
ControlService } from './
{{
spinalCase
ctrl
.
codeName
}}
-form
-service';
import { ControlVOBase, verifyRules
, EditFormService
} from '@ibiz-core';
import {
{{
pascalCase
ctrl
.
psAppDataEntity
.
codeName
}}
Service } from '@service/entity/
{{
spinalCase
ctrl
.
psAppDataEntity
.
codeName
}}
/
{{
spinalCase
ctrl
.
psAppDataEntity
.
codeName
}}
-service';
/**
* 部件展示数据对象
* @export
* @class ControlVO
*/
export class ControlVO extends ControlVOBase {
/**
* 用后台数据对象创建部件数据对象
* @param data 后台数据
*/
constructor(data: any){
super(data);
// 记录没有映射的属性
this.$ownKeys =
{{
~#
each
ctrl
.
psDEFormItems
as
|
formItem
|
~
}}
{{#if
@first
}}
[
{{/
if
~
}}
'
{{
lowerCase
formItem
.
id
}}
'
{{#
unless
@last
}}
,
{{/
unless
}}
{{
~#
if
@last
}}
];
{{/
if
~
}}
{{/
each
}}
}
// 表单里映射了属性的字段
{{#
each
ctrl
.
psDEFormItems
as
|
formItem
|
}}
{{!-- TODO: 表单formItem的name拿不到 --}}
{{#
neq
formItem
.
psAppDEField
null
}}
get
{{
lowerCase
formItem
.
id
}}
() {
return this.$DO.
{{
lowerCase
formItem
.
psAppDEField
.
codeName
}}
;
}
set
{{
lowerCase
formItem
.
id
}}
(value: any) {
this.$DO.
{{
lowerCase
formItem
.
psAppDEField
.
codeName
}}
= value;
}
{{/
neq
}}
{{/
each
}}
// 表单里没有映射实体属性的字段(srfuf除外)
{{#
each
ctrl
.
psDEFormItems
as
|
formItem
|
}}
{{#if
(
and
(
eq
formItem
.
psAppDEField
null
)
(
neq
formItem
.
id
"srfuf"
))
}}
{{
lowerCase
formItem
.
id
}}
: any;
{{/if}}
{{/
each
}}
}
// 部件配置对象
export const CtrlConfig = {
controlCodeName: '
{{
ctrl
.
codeName
}}
',
controlName: '
{{
ctrl
.
name
}}
',
controlService: new
ControlService(
),
data:
{}
,
controlService: new
EditFormService
<ControlVO>
(ControlVO, new
{{
pascalCase
ctrl
.
psAppDataEntity
.
codeName
}}
Service()
),
data:
new ControlVO({})
,
itemsModel: [
{{#
each
ctrl
.
psDEFormPages
as
|
FormPage
|
}}
{{>
(
lookup
'FORMDETAILSMODEL'
)
items
=
FormPage
.
psDEFormDetails
}}
...
...
@@ -34,32 +79,4 @@ export const CtrlConfig = {
{{/
neq
}}
{{/
each
}}
},
};
/**
* 部件展示数据对象
* @export
* @class ControlVO
*/
export class ControlVO extends ControlVOBase {
// 表单里映射了属性的字段
{{#
each
ctrl
.
psDEFormItems
as
|
formItem
|
}}
{{!-- TODO: 表单formItem的name拿不到 --}}
{{#
neq
formItem
.
psAppDEField
null
}}
get
{{
lowerCase
formItem
.
id
}}
() {
return this.$DO.
{{
lowerCase
formItem
.
psAppDEField
.
codeName
}}
;
}
set
{{
lowerCase
formItem
.
id
}}
(value: any) {
this.$DO.
{{
lowerCase
formItem
.
psAppDEField
.
codeName
}}
= value;
}
{{/
neq
}}
{{/
each
}}
// 表单里没有映射实体属性的字段(srfuf除外)
{{#
each
ctrl
.
psDEFormItems
as
|
formItem
|
}}
{{#if
(
and
(
eq
formItem
.
psAppDEField
null
)
(
neq
formItem
.
id
"srfuf"
))
}}
{{
lowerCase
formItem
.
id
}}
: any;
{{/if}}
{{/
each
}}
}
\ No newline at end of file
};
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录