Commit ae370452 by 罗建民

feat:必填项对接场景

parent 8b407d8b
Showing with 48 additions and 1 deletions
......@@ -12,6 +12,9 @@ import com.qinqinxiaobao.report.uniplat.workflow.dto.WorkflowContext
import com.qinqinxiaobao.report.uniplat.models.chart.ChartCustomFunctionContext
import com.qinqinxiaobao.report.utils.AssertUtils
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
......@@ -165,4 +168,18 @@ class Example1 {
]
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
......@@ -296,6 +296,35 @@
},
"behavior": "inputsTemplate",
"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": [
......@@ -1149,7 +1178,7 @@
}
],
"actions": [
"testRequired"
],
"field_groups": [
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment