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
ef51af8e
authored
Jan 05, 2023
by
罗建民
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
--story=1013404 --user=罗建民 主从表样式支持
https://www.tapd.cn/56664057/s/1129970
parent
d22a30fd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
140 additions
and
1 deletions
models/Example1.groovy
models/Example1.json
models/Example1.groovy
View file @
ef51af8e
import
com.qinqinxiaobao.report.exception.MyException
import
com.qinqinxiaobao.report.uniplat.engine.DO.DataObject
import
com.qinqinxiaobao.report.uniplat.engine.DO.DataObject
import
com.qinqinxiaobao.report.uniplat.engine.DO.EnvDataObject
import
com.qinqinxiaobao.report.uniplat.engine.DO.EnvDataObject
import
com.qinqinxiaobao.report.uniplat.engine.DataList
import
com.qinqinxiaobao.report.uniplat.engine.DataList
...
@@ -9,6 +10,8 @@ import com.qinqinxiaobao.report.uniplat.models.field.sql.SqlClauseBuilder
...
@@ -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.models.field.sql.SqlStatement
import
com.qinqinxiaobao.report.uniplat.workflow.dto.WorkflowContext
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.JsonUtils
import
java.util.stream.Collectors
import
java.util.stream.Collectors
...
@@ -121,4 +124,25 @@ class Example1 {
...
@@ -121,4 +124,25 @@ class Example1 {
def
emptyBehavior
(
ActionBehaviorContext
ctx
)
{
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
models/Example1.json
View file @
ef51af8e
...
@@ -171,6 +171,112 @@
...
@@ -171,6 +171,112 @@
},
},
"behavior"
:
"emptyBehavior"
,
"behavior"
:
"emptyBehavior"
,
"forward"
:
""
"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"
:
[
"intentDefs"
:
[
...
@@ -551,6 +657,12 @@
...
@@ -551,6 +657,12 @@
{
{
"name"
:
"topSection"
,
"name"
:
"topSection"
,
"label"
:
"顶部Section"
,
"label"
:
"顶部Section"
,
"field_groups"
:
[
{
"label"
:
"label:"
,
"template"
:
"{{host.getOrgId()}}"
}
],
"chartGroups"
:
[
"chartGroups"
:
[
{
{
"name"
:
"顶部1"
,
"name"
:
"顶部1"
,
...
@@ -740,7 +852,9 @@
...
@@ -740,7 +852,9 @@
],
],
"actions"
:
[
"actions"
:
[
"insert"
,
"insert"
,
"startProcess"
"startProcess"
,
"detailsStyle"
,
"inputsTemplate"
],
],
"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