Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
29d6294a
提交
29d6294a
编写于
1月 19, 2022
作者:
zhangkang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:系统值规则和必填值规则
上级
d6a03f67
变更
3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
46 行增加
和
29 行删除
+46
-29
form-item.hbs
...mpl/r7/@macro/front-end/widgets/form-detail/form-item.hbs
+2
-2
app-form-item.vue
...l/r7/app_{{apps}}/src/components/render/app-form-item.vue
+32
-7
{{ctrls@FORM}}-form-state.ts.hbs
...es}}/{{ctrls@FORM}}-form/{{ctrls@FORM}}-form-state.ts.hbs
+12
-20
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/widgets/form-detail/form-item.hbs
浏览文件 @
29d6294a
{{>
@macro
/
front-end
/
editors
/
include-editor
.
hbs
}}
{{#
eq
item
.
psLayoutPos
'FLEX'
}}
<div
style=
"flex-grow:
{{#if
item
.
psLayoutPos
.
grow
}}{{
item
.
psLayoutPos
.
grow
}}{{else}}
0
{{/if}}
;"
>
<AppFormItem
v-show=
"state.detailsModel.
{{
item
.
codeName
}}
.visible"
name=
"
{{
item
.
codeName
}}
"
label=
"
{{
item
.
caption
}}
"
>
<AppFormItem
v-show=
"state.detailsModel.
{{
item
.
codeName
}}
.visible"
name=
"
{{
item
.
codeName
}}
"
:rules=
"state.rules.
{{
item
.
codeName
}}
"
label=
"
{{
item
.
caption
}}
"
>
{{#if
item
.
psEditor
}}
{{>
(
lookup
.
'item.psEditor.editorType'
)
item
=
item
ctrlType
=
"form"
}}
{{/if}}
...
...
@@ -10,7 +10,7 @@
{{else}}
<a-col
{{>
@macro
/
front-end
/
widgets
/
common
/
layout-pos
.
hbs
item
=
item
.
psLayoutPos
}}
>
<AppFormItem
v-show=
"state.detailsModel.
{{
item
.
codeName
}}
.visible"
name=
"
{{
item
.
codeName
}}
"
:required=
"state.detailsModel.
{{
item
.
codeName
}}
.required"
label=
"
{{
item
.
caption
}}
"
>
<AppFormItem
v-show=
"state.detailsModel.
{{
item
.
codeName
}}
.visible"
name=
"
{{
item
.
codeName
}}
"
:r
ules=
"state.rules.
{{
item
.
codeName
}}
"
:r
equired=
"state.detailsModel.
{{
item
.
codeName
}}
.required"
label=
"
{{
item
.
caption
}}
"
>
{{#if
item
.
psEditor
}}
{{>
(
lookup
.
'item.psEditor.editorType'
)
item
=
item
ctrlType
=
"form"
}}
{{/if}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/render/app-form-item.vue
浏览文件 @
29d6294a
<
script
setup
lang=
"ts"
>
import
{
IActionParam
}
from
"@core"
;
import
{
IActionParam
}
from
'@core'
;
interface
FormGroupProps
{
interface
FormGroupProps
{
name
:
string
;
error
?:
string
;
label
:
string
;
required
:
boolean
;
required
:
boolean
;
rules
?:
any
;
}
interface
FormGroupEmit
{
(
name
:
'componentEvent'
,
value
:
IActionParam
):
void
interface
FormGroupEmit
{
(
name
:
'componentEvent'
,
value
:
IActionParam
):
void
;
}
const
props
=
withDefaults
(
defineProps
<
FormGroupProps
>
(),
{});
const
emit
=
defineEmits
<
FormGroupEmit
>
();
onBeforeMount
(()
=>
{
initRules
();
});
let
itemRules
:
any
=
[];
const
initRules
=
()
=>
{
if
(
props
.
rules
)
{
itemRules
.
push
(...
props
.
rules
);
}
if
(
props
.
required
)
{
itemRules
.
push
({
trigger
:
[
'change'
,
'blur'
],
required
:
props
.
required
,
message
:
props
.
label
+
'必须填写'
,
});
}
};
//
</
script
>
<
template
>
<a-form-item
:name=
"name"
:label=
"label"
:help=
"error"
:required=
"required"
:validateStatus=
"error ? 'error': 'validating'"
>
<a-form-item
:name=
"name"
:rules=
"itemRules"
:label=
"label"
:help=
"error"
:required=
"required"
:validateStatus=
"error ? 'error' : 'validating'"
>
<slot></slot>
</a-form-item>
</
template
>
<
style
lang=
"scss"
>
</
style
>
\ 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-state.ts.hbs
浏览文件 @
29d6294a
...
...
@@ -72,25 +72,17 @@ export const ctrlState = {
{{/
each
}}
},
rules: {
{{#
each
ctrl
.
psDEFormEditItemVRs
as
|
ruleItem
|
}}
{{#
neq
ruleItem
2
}}
{{#if
ruleItem
.
valueRuleType
'DEFVALUERULE'
}}
{{
psDEFormEditItemName
}}
: [
{{#
each
ruleItem
.
psDEFVRGroupCondition
as
|
condition
|
}}
{trigger: ['change', 'blur'],
validator: (_rule: RuleObject, value: string) => verifyRules(_rule,value,{
{{#
condition
.
condType
}}
type: '
{{
condition
.
condType
}}
',
{{/
condition
.
condType
}}
{{#
condition
.
name
}}
name: '
{{
condition
.
name
}}
',
{{/
condition
.
name
}}
{{#
condition
.
maxValue
}}
maxValue: '
{{
condition
.
maxValue
}}
',
{{/
condition
.
maxValue
}}
{{#
condition
.
minValue
}}
minValue: '
{{
condition
.
minValue
}}
',
{{/
condition
.
minValue
}}
{{#
condition
.
ruleInfo
}}
ruleInfo: '
{{
condition
.
ruleInfo
}}
',
{{/
condition
.
ruleInfo
}}
{{#
condition
.
includeMaxValue
}}
includeMaxValue: '
{{
condition
.
includeMaxValue
}}
',
{{/
condition
.
includeMaxValue
}}
{{#
condition
.
includeMinValue
}}
includeMinValue: '
{{
condition
.
includeMinValue
}}
',
{{/
condition
.
includeMinValue
}}
}) }
{{/
each
}}
]
{{/if}}
{{/
neq
}}
{{/
each
}}
{{#
each
ctrl
.
psDEFormItemVRs
as
|
ruleItem
|
}}
{{#if
ruleItem
.
valueRuleType
'SYSVALUERULE'
}}
{{
ruleItem
.
psDEFormItemName
}}
: [
{
trigger: ['change', 'blur'],
{{#
eq
ruleItem
.
psSysValueRule
.
ruleType
'REG'
}}
pattern: /
{{
ruleItem
.
psSysValueRule
.
regExCode
}}
/,
{{/
eq
}}
message:'
{{
ruleItem
.
psSysValueRule
.
ruleInfo
}}
'
}],
{{/if}}
{{/
each
}}
},
};
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录