Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
601a40e8
提交
601a40e8
编写于
2月 17, 2022
作者:
Mosher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:更新表单值规则
上级
f1c2bb55
变更
3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
54 行增加
和
7 行删除
+54
-7
app-form-item.vue
...l/r7/app_{{apps}}/src/components/common/app-form-item.vue
+1
-0
{{ctrls@FORM}}-form-state.ts.hbs
...es}}/{{ctrls@FORM}}-form/{{ctrls@FORM}}-form-state.ts.hbs
+38
-5
{{ctrls@GRID}}-grid-state.ts.hbs
...es}}/{{ctrls@GRID}}-grid/{{ctrls@GRID}}-grid-state.ts.hbs
+15
-2
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/common/app-form-item.vue
浏览文件 @
601a40e8
...
@@ -58,6 +58,7 @@ const initRules = () => {
...
@@ -58,6 +58,7 @@ const initRules = () => {
<template
v-slot:default=
"
{slotStyle, slotClass}">
<template
v-slot:default=
"
{slotStyle, slotClass}">
<a-form-item
<a-form-item
:class=
"slotClass"
:class=
"slotClass"
:colon=
"false"
:style=
"slotStyle"
:style=
"slotStyle"
:name=
"name"
:name=
"name"
:rules=
"itemRules"
:rules=
"itemRules"
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@FORM}}-form/{{ctrls@FORM}}-form-state.ts.hbs
浏览文件 @
601a40e8
import { ControlVOBase, EditFormService } from '@core';
import { ControlVOBase, EditFormService
, Verify, isEmpty
} from '@core';
import {
{{
pascalCase
ctrl
.
psAppDataEntity
.
codeName
}}
Service } from '@api/
{{
spinalCase
ctrl
.
psAppDataEntity
.
codeName
}}
/
{{
spinalCase
ctrl
.
psAppDataEntity
.
codeName
}}
-service';
import {
{{
pascalCase
ctrl
.
psAppDataEntity
.
codeName
}}
Service } from '@api/
{{
spinalCase
ctrl
.
psAppDataEntity
.
codeName
}}
/
{{
spinalCase
ctrl
.
psAppDataEntity
.
codeName
}}
-service';
/**
/**
...
@@ -115,16 +115,49 @@ export const ctrlState = {
...
@@ -115,16 +115,49 @@ export const ctrlState = {
},
},
rules: {
rules: {
{{#
each
ctrl
.
psDEFormItemVRs
as
|
ruleItem
|
}}
{{#
each
ctrl
.
psDEFormItemVRs
as
|
ruleItem
|
}}
{{#if
(
eq
ruleItem
.
valueRuleType
'SYSVALUERULE'
)
}}
{{
ruleItem
.
psDEFormItemName
}}
: [
{{
ruleItem
.
psDEFormItemName
}}
: [
{{#if
(
eq
ruleItem
.
valueRuleType
'SYSVALUERULE'
)
}}
{
{
trigger: ['change', 'blur'],
{{#
eq
ruleItem
.
psSysValueRule
.
ruleType
'REG'
}}
{{#
eq
ruleItem
.
psSysValueRule
.
ruleType
'REG'
}}
trigger: ['change', 'blur'],
pattern: /
{{
ruleItem
.
psSysValueRule
.
regExCode
}}
/,
pattern: /
{{
ruleItem
.
psSysValueRule
.
regExCode
}}
/,
{{/
eq
}}
message:'
{{
ruleItem
.
psSysValueRule
.
ruleInfo
}}
'
message:'
{{
ruleItem
.
psSysValueRule
.
ruleInfo
}}
'
}],
{{/
eq
}}
{{#
eq
ruleItem
.
psSysValueRule
.
ruleType
'SCRIPT'
}}
validator: (rule: any, value: any, callback: any) => {
if (isEmpty(value)) {
return Promise.resolve();
}
let source: any = { '
{{
ruleItem
.
getPSDEFormItemName
}}
': value };
try {
eval(`
{{
ruleItem
.
psSysValueRule
.
scriptCode
}}
`);
} catch (error: any) {
App.getNotificationService().error({ message: '校验脚本值规则异常' });
}
return Promise.resolve();
}
{{/
eq
}}
},
{{else
if
(
eq
ruleItem
.
valueRuleType
'DEFVALUERULE'
)
}}
{
validator: async (rule: any, value: any, callback: any) => {
if (isEmpty(value)) {
return Promise.resolve();
}
let source: any = { '
{{
ruleItem
.
getPSDEFormItemName
}}
': value };
const { isPast, infoMessage } = Verify.verifyDeRules(
'
{{
ruleItem
.
getPSDEFormItemName
}}
',
source,
{{>
@macro
/
front-end
/
common
/
derules
.
hbs
item
=
ruleItem
.
psDEFValueRule
.
getPSDEFVRGroupCondition
}}
);
if (!isPast) {
return Promise.reject(infoMessage || '
{{
ruleItem
.
psDEFValueRule
.
ruleInfo
}}
');
}
return Promise.resolve();
}
}
{{/if}}
{{/if}}
],
{{/
each
}}
{{/
each
}}
},
},
};
};
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@GRID}}-grid/{{ctrls@GRID}}-grid-state.ts.hbs
浏览文件 @
601a40e8
...
@@ -209,11 +209,24 @@ export const ctrlState = {
...
@@ -209,11 +209,24 @@ export const ctrlState = {
{{
ruleItem
.
psDEGridEditItemName
}}
: [
{{
ruleItem
.
psDEGridEditItemName
}}
: [
{{#if
(
eq
ruleItem
.
valueRuleType
'SYSVALUERULE'
)
}}
{{#if
(
eq
ruleItem
.
valueRuleType
'SYSVALUERULE'
)
}}
{
{
trigger: ['change', 'blur'],
{{#
eq
ruleItem
.
psSysValueRule
.
ruleType
'REG'
}}
{{#
eq
ruleItem
.
psSysValueRule
.
ruleType
'REG'
}}
trigger: ['change', 'blur'],
pattern: /
{{
ruleItem
.
psSysValueRule
.
regExCode
}}
/,
pattern: /
{{
ruleItem
.
psSysValueRule
.
regExCode
}}
/,
{{/
eq
}}
message:'
{{
ruleItem
.
psSysValueRule
.
ruleInfo
}}
'
message:'
{{
ruleItem
.
psSysValueRule
.
ruleInfo
}}
'
{{/
eq
}}
{{#
eq
ruleItem
.
psSysValueRule
.
ruleType
'SCRIPT'
}}
validator: (rule: any, value: any, callback: any, source: any) => {
if (isEmpty(value)) {
return Promise.resolve();
}
try {
eval(`
{{
ruleItem
.
psSysValueRule
.
scriptCode
}}
`);
} catch (error: any) {
App.getNotificationService().error({ message: '校验脚本值规则异常' });
}
return Promise.resolve();
}
{{/
eq
}}
},
},
{{else
if
(
eq
ruleItem
.
valueRuleType
'DEFVALUERULE'
)
}}
{{else
if
(
eq
ruleItem
.
valueRuleType
'DEFVALUERULE'
)
}}
{{#
each
ctrl
.
psDEGridEditItems
as
|
editItem
|
}}
{{#
each
ctrl
.
psDEGridEditItems
as
|
editItem
|
}}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录