Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
3ab34835
提交
3ab34835
编写于
12月 29, 2021
作者:
RedPig97
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update: 更新
上级
8aa372b1
变更
4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
53 行增加
和
16 行删除
+53
-16
form-details-model.hbs
...ources/templ/r7/@macro/form-detail/form-details-model.hbs
+16
-0
include-form.hbs
...in/resources/templ/r7/@macro/form-detail/include-form.hbs
+2
-1
form-control.ts
...rc/ibiz-core/modules/widgets/form-control/form-control.ts
+21
-7
{{ctrls@FORM}}-form-config.ts.hbs
...s}}/{{ctrls@FORM}}-form/{{ctrls@FORM}}-form-config.ts.hbs
+14
-8
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/form-detail/form-details-model.hbs
0 → 100644
浏览文件 @
3ab34835
{{#
each
items
as
|
formDetail
|
}}
{
caption: '
{{
formDetail
.
caption
}}
',
codeName: '
{{
formDetail
.
codeName
}}
',
name: '
{{
formDetail
.
name
}}
',
{{#if
(
eq
formDetail
.
detailType
"FORMITEM"
)
}}
dataType: '
{{
formDetail
.
dataType
}}
',
detailStyle: '
{{
formDetail
.
detailStyle
}}
',
resetItemName: '
{{
formDetail
.
resetItemName
}}
',
valueItemName: '
{{
formDetail
.
valueItemName
}}
',
{{/if}}
},
{{#if
formDetail
.
psDEFormDetails
}}
{{>
(
lookup
'FORMDETAILSMODEL'
)
items
=
formDetail
.
psDEFormDetails
}}
{{/if}}
{{/
each
}}
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/form-detail/include-form.hbs
浏览文件 @
3ab34835
{{#
*
inline
"FORMPAGE"
}}{{>
@macro
/
form-detail
/
form-page
.
hbs
}}{{/
inline
}}
{{#
*
inline
"FORMPAGE"
}}{{>
@macro
/
form-detail
/
form-page
.
hbs
}}{{/
inline
}}
{{#
*
inline
"GROUPPANEL"
}}{{>
@macro
/
form-detail
/
form-group
.
hbs
}}{{/
inline
}}
{{#
*
inline
"GROUPPANEL"
}}{{>
@macro
/
form-detail
/
form-group
.
hbs
}}{{/
inline
}}
{{#
*
inline
"FORMITEM"
}}{{>
@macro
/
form-detail
/
form-item
.
hbs
}}{{/
inline
}}
{{#
*
inline
"FORMITEM"
}}{{>
@macro
/
form-detail
/
form-item
.
hbs
}}{{/
inline
}}
\ No newline at end of file
{{#
*
inline
"FORMDETAILSMODEL"
}}{{>
@macro
/
form-detail
/
form-details-model
.
hbs
}}{{/
inline
}}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/ibiz-core/modules/widgets/form-control/form-control.ts
浏览文件 @
3ab34835
...
@@ -28,12 +28,31 @@ export class FormControl extends MainControl {
...
@@ -28,12 +28,31 @@ export class FormControl extends MainControl {
*/
*/
public
formDataChange
(
name
:
string
,
value
:
any
)
{
public
formDataChange
(
name
:
string
,
value
:
any
)
{
this
.
controlState
.
data
[
name
]
=
value
;
this
.
controlState
.
data
[
name
]
=
value
;
// TODO 重置项逻辑
this
.
resetFormData
(
name
);
// TODO 表单项更新
// TODO 表单项更新
// TODO 动态控制逻辑
// TODO 动态控制逻辑
// TODO 自动保存(可以单独做一个逻辑块,监听data的变化)
// TODO 自动保存(可以单独做一个逻辑块,监听data的变化)
}
}
/**
* @description 表单项重置
* @param {string} name
* @memberof FormControl
*/
public
resetFormData
(
name
:
string
)
{
const
formItems
:
any
[]
=
this
.
controlState
.
itemsModel
;
if
(
formItems
&&
formItems
.
length
>
0
)
{
for
(
const
item
of
formItems
)
{
if
(
item
.
resetItemName
&&
item
.
resetItemName
==
name
)
{
this
.
formDataChange
(
item
.
name
,
null
);
if
(
item
.
valueItemName
)
{
this
.
formDataChange
(
item
.
valueItemName
,
null
);
}
}
}
}
}
/**
/**
* 在表单执行某些行为能力后,表单整体数据发生改变后被调用。会依次执行以下逻辑:
* 在表单执行某些行为能力后,表单整体数据发生改变后被调用。会依次执行以下逻辑:
* 1.
* 1.
...
@@ -301,17 +320,12 @@ export class FormControl extends MainControl {
...
@@ -301,17 +320,12 @@ export class FormControl extends MainControl {
const
{
load
}
=
this
.
useLoad
(
props
);
const
{
load
}
=
this
.
useLoad
(
props
);
const
{
save
}
=
this
.
useSave
(
props
);
const
{
save
}
=
this
.
useSave
(
props
);
const
handleEditorEvent
=
this
.
handleEditorEvent
.
bind
(
this
);
this
.
handleEditorEvent
=
(
actionParam
:
IActionParam
)
=>
{
handleEditorEvent
(
actionParam
);
};
return
{
return
{
...
superParams
,
...
superParams
,
state
:
this
.
controlState
,
state
:
this
.
controlState
,
load
,
load
,
save
,
save
,
handleEditorEvent
:
this
.
handleEditorEvent
,
handleEditorEvent
:
this
.
handleEditorEvent
.
bind
(
this
)
,
};
};
}
}
}
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@FORM}}-form/{{ctrls@FORM}}-form-config.ts.hbs
浏览文件 @
3ab34835
{{>
@macro
/
form-detail
/
include-form
.
hbs
}}
import { ControlVOBase, verifyRules } from '@ibiz-core';
import { ControlVOBase, verifyRules } from '@ibiz-core';
import { ControlService } from './
{{
spinalCase
ctrl
.
codeName
}}
-form-service';
import { ControlService } from './
{{
spinalCase
ctrl
.
codeName
}}
-form-service';
...
@@ -6,6 +7,11 @@ export const CtrlConfig = {
...
@@ -6,6 +7,11 @@ export const CtrlConfig = {
controlName: '
{{
ctrl
.
name
}}
',
controlName: '
{{
ctrl
.
name
}}
',
controlService: new ControlService(),
controlService: new ControlService(),
data: {},
data: {},
itemsModel: [
{{#
each
ctrl
.
psDEFormPages
as
|
FormPage
|
}}
{{>
(
lookup
'FORMDETAILSMODEL'
)
items
=
FormPage
.
psDEFormDetails
}}
{{/
each
}}
],
rules: {
rules: {
{{#
each
ctrl
.
psDEFormEditItemVRs
as
|
ruleItem
|
}}
{{#
each
ctrl
.
psDEFormEditItemVRs
as
|
ruleItem
|
}}
{{#
neq
ruleItem
2
}}
{{#
neq
ruleItem
2
}}
...
@@ -14,20 +20,20 @@ export const CtrlConfig = {
...
@@ -14,20 +20,20 @@ export const CtrlConfig = {
{{#
each
ruleItem
.
psDEFVRGroupCondition
as
|
condition
|
}}
{{#
each
ruleItem
.
psDEFVRGroupCondition
as
|
condition
|
}}
{trigger: ['change', 'blur'],
{trigger: ['change', 'blur'],
validator: (_rule: RuleObject, value: string) => verifyRules(_rule,value,{
validator: (_rule: RuleObject, value: string) => verifyRules(_rule,value,{
{{#
condition
.
condType
}}
'Type'
:
{{
condition
.
condType
}}
,
{{/
condition
.
condType
}}
{{#
condition
.
condType
}}
type
:
{{
condition
.
condType
}}
,
{{/
condition
.
condType
}}
{{#
condition
.
name
}}
'name'
:
{{
condition
.
name
}}
,
{{/
condition
.
name
}}
{{#
condition
.
name
}}
name
:
{{
condition
.
name
}}
,
{{/
condition
.
name
}}
{{#
condition
.
maxValue
}}
'maxValue'
:
{{
condition
.
maxValue
}}
,
{{/
condition
.
maxValue
}}
{{#
condition
.
maxValue
}}
maxValue
:
{{
condition
.
maxValue
}}
,
{{/
condition
.
maxValue
}}
{{#
condition
.
minValue
}}
'minValue'
:
{{
condition
.
minValue
}}
,
{{/
condition
.
minValue
}}
{{#
condition
.
minValue
}}
minValue
:
{{
condition
.
minValue
}}
,
{{/
condition
.
minValue
}}
{{#
condition
.
ruleInfo
}}
'ruleInfo'
:
{{
condition
.
ruleInfo
}}
,
{{/
condition
.
ruleInfo
}}
{{#
condition
.
ruleInfo
}}
ruleInfo
:
{{
condition
.
ruleInfo
}}
,
{{/
condition
.
ruleInfo
}}
{{#
condition
.
includeMaxValue
}}
'includeMaxValue'
:
{{
condition
.
includeMaxValue
}}
,
{{/
condition
.
includeMaxValue
}}
{{#
condition
.
includeMaxValue
}}
includeMaxValue
:
{{
condition
.
includeMaxValue
}}
,
{{/
condition
.
includeMaxValue
}}
{{#
condition
.
includeMinValue
}}
'includeMinValue'
:
{{
condition
.
includeMinValue
}}
,
{{/
condition
.
includeMinValue
}}
{{#
condition
.
includeMinValue
}}
includeMinValue
:
{{
condition
.
includeMinValue
}}
,
{{/
condition
.
includeMinValue
}}
}) }
}) }
{{/
each
}}
{{/
each
}}
]
]
{{/if}}
{{/if}}
{{/
neq
}}
{{/
neq
}}
{{/
each
}}
{{/
each
}}
}
}
,
};
};
/**
/**
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录