Commit ef51af8e by 罗建民

--story=1013404 --user=罗建民 主从表样式支持 https://www.tapd.cn/56664057/s/1129970

parent d22a30fd
Showing with 140 additions and 1 deletions
import com.qinqinxiaobao.report.exception.MyException
import com.qinqinxiaobao.report.uniplat.engine.DO.DataObject
import com.qinqinxiaobao.report.uniplat.engine.DO.EnvDataObject
import com.qinqinxiaobao.report.uniplat.engine.DataList
......@@ -9,6 +10,8 @@ import com.qinqinxiaobao.report.uniplat.models.field.sql.SqlClauseBuilder
import com.qinqinxiaobao.report.uniplat.models.field.sql.SqlStatement
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 java.util.stream.Collectors
......@@ -121,4 +124,25 @@ class Example1 {
def emptyBehavior(ActionBehaviorContext ctx) {
}
def detailsStyle(ActionBehaviorContext ctx) {
def data = [:]
data.put("主表:" + ctx.getDataModel().getModelName(), ctx.getInputs())
ctx.getDetails().dataDetails.forEach(details -> data.put("从表:" + details.getName(), details.getValues()))
return [
"msg": JsonUtils.dumps(data)
]
}
def inputsTemplate(ActionBehaviorContext ctx) {
return [
"msg": JsonUtils.dumps(ctx.getInputs())
]
}
def getInputsTemplate() {
return "<strong>name</strong>:{name}<br/> " +
" <strong>status</strong>:{status}</br>" +
" other:{other}"
}
}
\ No newline at end of file
......@@ -171,6 +171,112 @@
},
"behavior": "emptyBehavior",
"forward": ""
},
{
"name": "detailsStyle",
"when": "1",
"label": "从表样式测试",
"prompt": "",
"container": "dialog",
"parameters": {
"server": [],
"inputs": [
{
"label": "name",
"property": "name",
"type": "text"
},
{
"label": "file",
"property": "file",
"type": "multi_file"
},
{
"label": "status",
"property": "status",
"type": "number"
},
{
"label": "other",
"property": "other",
"type": "text"
}
],
"details": [
{
"name": "Example1",
"label": "form从表",
"relatedId": "status",
"style": "form",
"template": "",
"controls": [
{
"label": "name",
"property": "name",
"type": "text"
},
{
"label": "other",
"property": "other",
"type": "text"
}
]
},
{
"name": "callback_test",
"label": "template从表",
"relatedId": "id",
"style": "template",
"template": "<strong>name</strong>:{name}<br/>age:{age}",
"controls": [
{
"property": "name",
"label": "name",
"type": "text",
"required": true
},
{
"property": "age",
"label": "age",
"type": "number"
}
]
}
]
},
"behavior": "detailsStyle",
"forward": ""
},
{
"name": "inputsTemplate",
"when": "1",
"label": "主表模板样式",
"prompt": "",
"container": "dialog",
"parameters": {
"server": [],
"inputs_style": "template",
"inputs_template": "{{host.invokeModelFunc('Example1','getInputsTemplate')}}",
"inputs": [
{
"label": "name",
"property": "name",
"type": "text"
},
{
"label": "status",
"property": "status",
"type": "number"
},
{
"label": "other",
"property": "other",
"type": "text"
}
]
},
"behavior": "inputsTemplate",
"forward": ""
}
],
"intentDefs": [
......@@ -551,6 +657,12 @@
{
"name": "topSection",
"label": "顶部Section",
"field_groups": [
{
"label": "label:",
"template": "{{host.getOrgId()}}"
}
],
"chartGroups": [
{
"name": "顶部1",
......@@ -740,7 +852,9 @@
],
"actions": [
"insert",
"startProcess"
"startProcess",
"detailsStyle",
"inputsTemplate"
],
"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