Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
uniplat-example
/
intent-example
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ae370452
authored
Mar 27, 2023
by
罗建民
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
feat:必填项对接场景
parent
8b407d8b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
1 deletions
models/Example1.groovy
models/Example1.json
models/Example1.groovy
View file @
ae370452
...
@@ -12,6 +12,9 @@ import com.qinqinxiaobao.report.uniplat.workflow.dto.WorkflowContext
...
@@ -12,6 +12,9 @@ import com.qinqinxiaobao.report.uniplat.workflow.dto.WorkflowContext
import
com.qinqinxiaobao.report.uniplat.models.chart.ChartCustomFunctionContext
import
com.qinqinxiaobao.report.uniplat.models.chart.ChartCustomFunctionContext
import
com.qinqinxiaobao.report.utils.AssertUtils
import
com.qinqinxiaobao.report.utils.AssertUtils
import
com.qinqinxiaobao.report.utils.JsonUtils
import
com.qinqinxiaobao.report.utils.JsonUtils
import
com.qinqinxiaobao.report.uniplat.executor.ParameterUpdateMasterContext
import
com.qinqinxiaobao.report.uniplat.executor.RuleDef
import
java.util.stream.Collectors
import
java.util.stream.Collectors
...
@@ -165,4 +168,18 @@ class Example1 {
...
@@ -165,4 +168,18 @@ class Example1 {
]
]
return
JsonUtils
.
dumps
(
props
)
return
JsonUtils
.
dumps
(
props
)
}
}
def
requireUpdator
(
ParameterUpdateMasterContext
ctx
)
{
if
(
ctx
.
sender
==
'isRequired'
)
{
if
(
ctx
.
params
.
isRequired
)
{
RuleDef
ruleRequired
=
new
RuleDef
()
ruleRequired
.
setRequired
(
true
)
ruleRequired
.
setMessage
(
String
.
format
(
"%s不能为空"
,
"文本值"
))
ruleRequired
.
setTrigger
(
"change"
)
return
[
"rules"
:
Arrays
.
asList
(
ruleRequired
)
]
}
}
}
}
}
\ No newline at end of file
models/Example1.json
View file @
ae370452
...
@@ -296,6 +296,35 @@
...
@@ -296,6 +296,35 @@
},
},
"behavior"
:
"inputsTemplate"
,
"behavior"
:
"inputsTemplate"
,
"forward"
:
""
"forward"
:
""
},
{
"name"
:
"testRequired"
,
"when"
:
"1"
,
"label"
:
"必填项对接"
,
"prompt"
:
""
,
"container"
:
"dialog"
,
"parameters"
:
{
"server"
:
[],
"inputs"
:
[
{
"label"
:
"是否必填"
,
"property"
:
"isRequired"
,
"type"
:
"boolean"
,
"is_param"
:
true
,
"required"
:
true
},
{
"label"
:
"文本值"
,
"property"
:
"text"
,
"type"
:
"text"
,
"updator"
:
"requireUpdator"
,
"is_param"
:
true
,
"required"
:
false
}
]
},
"behavior"
:
""
,
"forward"
:
""
}
}
],
],
"intentDefs"
:
[
"intentDefs"
:
[
...
@@ -1149,7 +1178,7 @@
...
@@ -1149,7 +1178,7 @@
}
}
],
],
"actions"
:
[
"actions"
:
[
"testRequired"
],
],
"field_groups"
:
[
"field_groups"
:
[
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment