新增JeecgBoot BPM流程自动生成器,包含流程创建、修改及审批人配置功能,支持自然语言描述转化为BPMN XML,并通过API与JeecgBoot系统交互。
This commit is contained in:
16
.trae/skills/jimureport/examples/column-split.md
Normal file
16
.trae/skills/jimureport/examples/column-split.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# 示例5:分栏
|
||||
|
||||
**类型:** 分栏报表
|
||||
**特征:** `loopBlockList` 中加 `"loopTime":2` 实现横向循环2次(分2栏)
|
||||
|
||||
## 关键配置
|
||||
|
||||
```json
|
||||
{"loopBlockList":[{"sci":1,"sri":2,"eci":5,"eri":5,"index":1,"db":"jm","loopTime":2}]}
|
||||
```
|
||||
|
||||
## 报表 JSON
|
||||
|
||||
```json
|
||||
{"loopBlockList":[{"sci":1,"sri":2,"eci":5,"eri":5,"index":1,"db":"jm","loopTime":2}],"querySetting":{"izOpenQueryBar":false,"izDefaultQuery":true},"printConfig":{"paper":"A4","width":210,"height":297,"definition":1,"isBackend":false,"marginX":10,"marginY":10,"layout":"portrait"},"hidden":{"rows":[],"cols":[]},"dbexps":[],"dicts":[],"freeze":"A1","dataRectWidth":817,"autofilter":{},"validations":[],"cols":{"0":{"width":72},"3":{"width":101},"4":{"width":90},"5":{"width":54},"len":50},"pyGroupEngine":false,"submitHandlers":[],"excel_config_id":"590831722099462144","hiddenCells":[],"zonedEditionList":[],"rows":{"1":{"cells":{"5":{"style":15,"text":"分栏示例","merge":[0,1],"height":59},"8":{"style":9,"text":"说明:需要对多行区域进行循环且分栏展示时,则进行循环块设置并指定横向循环次数","merge":[0,2],"height":59}},"height":59},"2":{"cells":{"1":{"text":"","loopBlock":1},"2":{"text":"职员信息","style":2,"merge":[0,1],"height":34,"loopBlock":1},"4":{"text":"","loopBlock":1},"5":{"text":"","loopBlock":1}},"height":51},"3":{"cells":{"1":{"text":"姓名","style":4,"loopBlock":1},"2":{"text":"性别","style":4,"loopBlock":1},"3":{"text":"职务","style":4,"loopBlock":1},"4":{"text":"联系方式","style":4,"loopBlock":1},"5":{"text":"","loopBlock":1}},"height":31},"4":{"cells":{"1":{"text":"#{jm.name}","style":0,"loopBlock":1},"2":{"style":0,"loopBlock":1,"text":"#{jm.sex}"},"3":{"style":0,"loopBlock":1,"text":"#{jm.update_by}"},"4":{"style":0,"loopBlock":1,"text":"#{jm.jphone}"},"5":{"text":"","loopBlock":1}}},"5":{"cells":{"1":{"text":"","loopBlock":1},"5":{"text":"","loopBlock":1}},"height":34},"len":103},"rpbar":{"show":true,"pageSize":"","btnList":[]},"name":"sheet1","merges":["F2:G2","I2:K2","C3:D3"]}
|
||||
```
|
||||
31
.trae/skills/jimureport/examples/employee-register.md
Normal file
31
.trae/skills/jimureport/examples/employee-register.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# 示例10:员工信息登记(带照片)
|
||||
|
||||
**类型:** 单据模板(带图片占位)
|
||||
**特征:** `imgList` 图片占位 + `virtual` 虚拟单元格 + `${employee.xxx}` 单值绑定 + 日期格式化
|
||||
|
||||
## 数据绑定
|
||||
|
||||
`${employee.num}`、`${employee.name}`、`${employee.sex}`、`${employee.birthday}`、`${employee.nation}`、`${employee.political}`、`${employee.native_place}`、`${employee.height}`、`${employee.weight}`、`${employee.health}`、`${employee.id_card}`、`${employee.education}`、`${employee.school}`、`${employee.major}`、`${employee.address}`、`${employee.zip_code}`、`${employee.email}`、`${employee.phone}`、`${employee.foreign_language}`、`${employee.foreign_language_level}`、`${employee.computer_level}`、`${employee.graduation_time}`、`${employee.arrival_time}`、`${employee.positional_titles}`、`${employee.education_experience}`、`${employee.work_experience}`、`${employee.create_time}`
|
||||
|
||||
## 图片占位配置
|
||||
|
||||
```json
|
||||
{
|
||||
"imgList": [{
|
||||
"row": 3, "col": 6, "colspan": 1, "rowspan": 5,
|
||||
"width": "135", "height": "201",
|
||||
"src": "https://xxx.png",
|
||||
"layer_id": "8mRFFslT5d0Hfyos",
|
||||
"offsetX": 0, "offsetY": 0,
|
||||
"virtualCellRange": [[3,6]]
|
||||
}]
|
||||
}
|
||||
```
|
||||
|
||||
单元格引用图片:`"virtual":"8mRFFslT5d0Hfyos"` + `"merge":[4,0]`
|
||||
|
||||
## 报表 JSON
|
||||
|
||||
```json
|
||||
{"loopBlockList":[],"querySetting":{"izOpenQueryBar":false,"izDefaultQuery":true},"recordSubTableOrCollection":{"group":[],"record":[],"range":[]},"printConfig":{"paper":"A4","width":210,"height":297,"definition":1,"isBackend":false,"marginX":10,"marginY":10,"layout":"portrait"},"hidden":{"rows":[],"cols":[],"conditions":{"rows":{},"cols":{}}},"dbexps":[],"toolPrintSizeObj":{"printType":"A4","widthPx":718,"heightPx":1047},"dicts":["sex1"],"freeze":"A1","dataRectWidth":710,"autofilter":{},"validations":[],"cols":{"0":{"width":64},"1":{"width":118},"2":{"width":71},"3":{"width":115},"4":{"width":83},"5":{"width":123},"6":{"width":136},"7":{"width":1},"len":50},"excel_config_id":"1316944968992034816","hiddenCells":[],"zonedEditionList":[],"rows":{"1":{"cells":{"0":{"text":"员工信息登记表","merge":[0,6],"style":28}},"height":46},"2":{"cells":{"0":{"text":"编号:","style":29},"1":{"text":"${employee.num}","style":30,"merge":[0,3]},"5":{"text":"填写日期:","style":29},"6":{"text":"${employee.create_time}","style":34}},"isDrag":true,"height":44},"3":{"cells":{"0":{"text":"姓名:","style":29},"1":{"text":"${employee.name}","style":30},"2":{"text":"性别:","style":29},"3":{"text":"${employee.sex}","style":30},"4":{"text":"出生年月:","style":29},"5":{"text":"${employee.birthday}","style":36},"6":{"style":3,"text":" ","merge":[4,0],"virtual":"8mRFFslT5d0Hfyos"}},"isDrag":true,"height":42},"4":{"cells":{"0":{"text":"民族:","style":29},"1":{"text":"${employee.nation}","style":30},"2":{"text":"政治面貌:","style":29},"3":{"text":"${employee.political}","style":30},"4":{"text":"籍贯:","style":29},"5":{"text":"${employee.native_place}","style":30}},"isDrag":true,"height":38},"5":{"cells":{"0":{"text":"身高(cm):","style":29},"1":{"text":"${employee.height}","style":30},"2":{"text":"体重(kg):","style":29},"3":{"text":"${employee.weight}","style":30},"4":{"text":"健康状况:","style":29},"5":{"text":"${employee.health}","style":30}},"isDrag":true,"height":38},"6":{"cells":{"0":{"text":"身份证号:","style":29},"1":{"text":"${employee.id_card}","style":30,"merge":[0,2]},"4":{"text":"学历:","style":29},"5":{"text":"${employee.education}","style":30}},"isDrag":true,"height":40},"7":{"cells":{"0":{"text":"毕业学校:","style":29},"1":{"text":"${employee.school}","style":30,"merge":[0,2]},"4":{"text":"专业:","style":29},"5":{"text":"${employee.major}","style":30}},"isDrag":true,"height":44},"8":{"cells":{"0":{"text":"联系地址:","style":29},"1":{"text":"${employee.address}","style":30,"merge":[0,2]},"4":{"text":"邮编:","style":29},"5":{"text":"${employee.zip_code}","style":30,"merge":[0,1]}},"isDrag":true,"height":45},"9":{"cells":{"0":{"text":"Email:","style":29},"1":{"text":"${employee.email}","style":30,"merge":[0,2]},"4":{"text":"手机号:","style":29},"5":{"text":"${employee.phone}","style":30,"merge":[0,1]}},"isDrag":true,"height":40},"10":{"cells":{"0":{"text":"外语语种:","style":29},"1":{"text":"${employee.foreign_language}","style":30},"2":{"text":"外语水平:","style":29},"3":{"text":"${employee.foreign_language_level}","style":30},"4":{"text":"计算机水平:","style":29},"5":{"text":"${employee.computer_level}","style":30,"merge":[0,1]}},"isDrag":true,"height":41},"11":{"cells":{"0":{"text":"毕业时间:","style":29},"1":{"text":"${employee.graduation_time}","style":34},"2":{"text":"到职时间:","style":29},"3":{"text":"${employee.arrival_time}","style":34},"4":{"text":"职称:","style":29},"5":{"text":"${employee.positional_titles}","style":30,"merge":[0,1]}},"isDrag":true,"height":42},"12":{"cells":{"0":{"text":"教育经历:","style":32},"1":{"text":" ","style":35,"merge":[0,5]}},"isDrag":true,"height":39},"13":{"cells":{"0":{"text":"${employee.education_experience}","style":33,"merge":[0,6]}},"isDrag":true,"height":70},"14":{"cells":{"0":{"text":"工作经历:","style":32},"1":{"merge":[0,5],"style":30,"text":" "}},"height":43},"15":{"cells":{"0":{"text":"${employee.work_experience}","style":30,"merge":[0,6]}},"isDrag":true,"height":61},"len":100},"name":"sheet1","merges":["A2:G2","B3:E3","G4:G8","B7:D7","B8:D8","B9:D9","F9:G9","B10:D10","F10:G10","F11:G11","F12:G12","B13:G13","A14:G14","B15:G15","A16:G16"],"imgList":[{"row":3,"col":6,"colspan":1,"rowspan":5,"width":"135","height":"201","src":"https://static.jeecg.com/designreport/images/QQ截图20210115102648_1610677626114.png","layer_id":"8mRFFslT5d0Hfyos","offsetX":0,"offsetY":0,"virtualCellRange":[[3,6]]}]}
|
||||
```
|
||||
164
.trae/skills/jimureport/examples/expression-functions-example.md
Normal file
164
.trae/skills/jimureport/examples/expression-functions-example.md
Normal file
@@ -0,0 +1,164 @@
|
||||
# 常用表达式函数示例
|
||||
|
||||
## 场景说明
|
||||
|
||||
展示积木报表中可用的表达式函数,包括日期函数、字符串函数、数学函数、条件表达式和行号表达式。表达式以 `=` 开头,可使用常量参数或数据集参数 `${dbCode.field}`。
|
||||
|
||||
## 表达式语法规则
|
||||
|
||||
- 表达式以 `=` 开头:`=函数名(参数)`
|
||||
- 常量参数直接写值:`=round(341.234, 2)`
|
||||
- 数据集参数用 `${}` 引用:`=round(${jm_expression.num}, 2)`
|
||||
- 字符串常量用双引号或单引号:`=date("2021-07-29")`
|
||||
|
||||
## 日期函数
|
||||
|
||||
| 函数 | 表达式 | 常量参数示例 | 数据集参数示例 |
|
||||
|------|--------|-------------|---------------|
|
||||
| `date()` | `date("2021-07-29 12:11:10")` | `=date("2021-07-29 12:11:10")` | `=date("${ds.create_time}")` |
|
||||
| `time()` | `time("12:11:10")` | `=time("12:11:10")` | `=time("${ds.create_time}")` |
|
||||
| `now()` | `now()` | `=now()` | `=now()` |
|
||||
| `year()` | `year("2021-07-29 12:11:10")` | `=year("2021-07-29 12:11:10")` | `=year("${ds.create_time}")` |
|
||||
| `month()` | `month("2021-07-29 12:11:10")` | `=month("2021-07-29 12:11:10")` | `=month("${ds.create_time}")` |
|
||||
| `day()` | `day("2021-07-29 12:11:10")` | `=day("2021-07-29 12:11:10")` | `=day("${ds.create_time}")` |
|
||||
|
||||
### now() 格式化
|
||||
|
||||
通过 style 的 `format` 属性控制 `=now()` 的显示格式:
|
||||
|
||||
| format 值 | 输出格式 | 示例 |
|
||||
|-----------|---------|------|
|
||||
| `"date"` | yyyy-MM-dd | 2021-07-29 |
|
||||
| `"date2"` | yyyy/MM/dd | 2021/07/29 |
|
||||
| `"time"` | HH:mm:ss | 12:11:10 |
|
||||
| `"datetime"` | yyyy-MM-dd HH:mm:ss | 2021-07-29 12:11:10 |
|
||||
|
||||
## 字符串函数
|
||||
|
||||
| 函数 | 表达式 | 常量参数示例 | 数据集参数示例 |
|
||||
|------|--------|-------------|---------------|
|
||||
| `char()` | `char(22269)` | `=char(22269)` | — |
|
||||
| `cnmoney()` | `cnmoney(341.234)` | `=cnmoney(341.234)` | `=cnmoney(${ds.num})` |
|
||||
| `cnmoney("b")` | `cnmoney(341.234,"b")` | `=cnmoney(341.234,"b")` | `=cnmoney(${ds.num},"b")` |
|
||||
| `cnmoney("bw")` | `cnmoney(341.234,"bw")` | `=cnmoney(341.234,"bw")` | `=cnmoney(${ds.num},"bw")` |
|
||||
| `concat()` | `concat('hello ','word',' !')` | `=concat('hello ','world',' !')` | `=concat('${ds.upper}',' world',' !')` |
|
||||
| `lower()` | `lower('HELLOW')` | `=lower('HELLOW')` | `=lower("${ds.upper}")` |
|
||||
| `upper()` | `upper('world')` | `=upper('world')` | `=upper('${ds.lower}')` |
|
||||
|
||||
### cnmoney() 参数说明
|
||||
|
||||
| 参数 | 说明 | 示例输出 |
|
||||
|------|------|---------|
|
||||
| 无 | 中文大写金额 | 叁佰肆拾壹元贰角叁分肆厘 |
|
||||
| `"b"` | 简写 | 三四一.二三四 |
|
||||
| `"bw"` | 简写带万 | 三百四十一.二三四 |
|
||||
|
||||
## 数学函数
|
||||
|
||||
| 函数 | 表达式 | 常量参数示例 | 数据集参数示例 |
|
||||
|------|--------|-------------|---------------|
|
||||
| `rand()` | `rand()` | `=rand()` | — |
|
||||
| `rand()*N` | `rand()*100` | `=rand()*100` | — |
|
||||
| `round()` | `round(341.234,2)` | `=round(341.234,2)` | `=round(${ds.num},2)` |
|
||||
| `round(rand())` | `round(rand(),2)` | `=round(rand(),2)` | — |
|
||||
| `abs()` | `abs(-341.234)` | `=abs(-341.234)` | `=abs(${ds.num})` |
|
||||
| `floor()` | `floor(341.234,2)` | `=floor(341.234,2)` | `=floor(${ds.num},2)` |
|
||||
| `ceil()` | `ceil(341.234,2)` | `=ceil(341.234,2)` | `=ceil(${ds.num},2)` |
|
||||
| `trunc()` | `trunc(341.234)` | `=trunc(341.234)` | `=trunc(${ds.num})` |
|
||||
|
||||
## 条件表达式
|
||||
|
||||
### case() — 简单条件
|
||||
|
||||
```
|
||||
=case(条件, 真值, 假值)
|
||||
```
|
||||
|
||||
常量:`=case(1==1,'男','女')`
|
||||
数据集:`=case('${ds.sex}'=='1','男','女')`
|
||||
|
||||
### if() — 多分支条件
|
||||
|
||||
```
|
||||
=(let sex='${ds.sex}';
|
||||
if(sex== '1'){
|
||||
return '男';
|
||||
}elsif(sex== '2'){
|
||||
return '女';
|
||||
}else{
|
||||
return '未知';
|
||||
})
|
||||
```
|
||||
|
||||
**注意:** 多行 if 表达式需要用 `()` 包裹整个表达式,用 `let` 声明变量,分支用 `elsif`(不是 `else if`)。
|
||||
|
||||
## 行号表达式
|
||||
|
||||
| 函数 | 说明 | 示例 |
|
||||
|------|------|------|
|
||||
| `row()` | 自动行号 | `=row(1)` 从1开始编号 |
|
||||
|
||||
## 样式中的 format 属性
|
||||
|
||||
styles 数组中可通过 `format` 控制单元格显示格式:
|
||||
|
||||
```json
|
||||
{ "format": "date" }
|
||||
{ "format": "date2" }
|
||||
{ "format": "time" }
|
||||
{ "format": "datetime" }
|
||||
```
|
||||
|
||||
对应的 style 索引(本示例中):
|
||||
|
||||
| 索引 | format | 边框 | 用途 |
|
||||
|------|--------|------|------|
|
||||
| 0 | date | 无 | 日期格式(无边框) |
|
||||
| 1 | date2 | 无 | 日期格式2(无边框) |
|
||||
| 2 | time | 无 | 时间格式(无边框) |
|
||||
| 3 | datetime | 无 | 日期时间格式(无边框) |
|
||||
| 5 | date | thin四边 | 日期格式(带边框) |
|
||||
| 6 | date2 | thin四边 | 日期格式2(带边框) |
|
||||
| 7 | time | thin四边 | 时间格式(带边框) |
|
||||
| 8 | datetime | thin四边 | 日期时间格式(带边框) |
|
||||
|
||||
## 单元格链接(display: link)
|
||||
|
||||
```json
|
||||
{
|
||||
"text": "更多表达式请查看详细文档。",
|
||||
"linkIds": "580872825561501696,580872825561501696",
|
||||
"display": "link",
|
||||
"merge": [0, 1]
|
||||
}
|
||||
```
|
||||
|
||||
| 属性 | 说明 |
|
||||
|------|------|
|
||||
| `display` | `"link"` 表示显示为超链接 |
|
||||
| `linkIds` | 链接目标的报表ID,多个用逗号分隔 |
|
||||
|
||||
## 单元格纵向合并(数据行内)
|
||||
|
||||
```json
|
||||
"5": {
|
||||
"cells": {
|
||||
"1": {
|
||||
"text": "now()",
|
||||
"merge": [3, 0],
|
||||
"height": 100,
|
||||
"style": 4
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`merge: [3, 0]` 表示向下合并3行、向右合并0列,即占据第5-8行的第1列。
|
||||
|
||||
## 样式方案(绿色主题)
|
||||
|
||||
| 索引 | 背景色 | 用途 |
|
||||
|------|--------|------|
|
||||
| 12 | #93d051(绿色) | 分类标题行(日期函数/字符串函数等) |
|
||||
| 17 | #93d051(绿色) | 表头行(函数名称/表达式/常量参数/数据集参数) |
|
||||
| 4 | — | 数据行(thin四边框) |
|
||||
70
.trae/skills/jimureport/examples/fill-form.md
Normal file
70
.trae/skills/jimureport/examples/fill-form.md
Normal file
File diff suppressed because one or more lines are too long
33
.trae/skills/jimureport/examples/fixed-head-tail.md
Normal file
33
.trae/skills/jimureport/examples/fixed-head-tail.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# 示例8:固定表头表尾
|
||||
|
||||
**类型:** 分组报表 + 固定打印表头表尾
|
||||
**特征:** `fixedPrintHeadRows`/`fixedPrintTailRows` + 横向分组 `groupRight` + 纵向分组 `group` + 动态聚合 `dynamic`
|
||||
|
||||
## 关键配置
|
||||
|
||||
```json
|
||||
{
|
||||
"fixedPrintHeadRows": [{"sci":1,"eci":3,"sri":1,"eri":2}],
|
||||
"fixedPrintTailRows": [{"sri":6,"sci":1,"eri":6,"eci":5}],
|
||||
"isGroup": true,
|
||||
"groupField": "xs.diqu"
|
||||
}
|
||||
```
|
||||
|
||||
## 数据绑定语法
|
||||
|
||||
- 横向分组(年):`#{xs.groupRight(year)}`,`direction:"right"`,`aggregate:"group"`,`sort:"desc"`
|
||||
- 横向分组(月):`#{xs.groupRight(mouth)}`,`aggregate:"group"`,`direction:"right"`
|
||||
- 纵向分组(地区):`#{xs.group(diqu)}`,`aggregate:"group"`,`subtotal:"groupField"`
|
||||
- 纵向分组(分类):`#{xs.group(class)}`,`aggregate:"group"`
|
||||
- 动态聚合(销量):`#{xs.dynamic(sales)}`,`aggregate:"dynamic"`,`funcname:"SUM"`
|
||||
- 合计行:`=sum(D4)`
|
||||
- 斜线表头:`lineStart:"lefttop"`,`text:"地区|销量|时间"`
|
||||
- 固定表头标记:`fixedHead:1`
|
||||
- 固定表尾标记:`fixedTail:1`
|
||||
|
||||
## 报表 JSON
|
||||
|
||||
```json
|
||||
{"loopBlockList":[],"printConfig":{"layout":"portrait","paper":"A4","isBackend":false,"width":210,"definition":1,"marginX":10,"height":297,"marginY":10},"dbexps":[],"toolPrintSizeObj":{"printType":"A4","widthPx":718,"heightPx":1047},"dicts":[],"freeze":"A1","dataRectWidth":713,"autofilter":{},"validations":[],"cols":{"0":{"width":36},"1":{"width":95},"2":{"width":95},"4":{"width":141},"5":{"width":246},"6":{"width":155},"len":50},"area":{"sri":6,"sci":1,"eri":6,"eci":5,"width":677,"height":25},"excel_config_id":"739738655920574464","zonedEditionList":[],"rows":{"0":{"cells":{"1":{"merge":[0,2],"style":6,"text":"固定表头表尾打印实例"},"5":{"style":30,"text":"说明:本示例在横向分组、纵向分组基础上,添加固定表头表尾。在打印时可显示表头及表尾"}},"height":83},"1":{"cells":{"1":{"lineStart":"lefttop","merge":[1,1],"style":2,"text":"地区|销量|时间","fixedHead":1,"height":74},"2":{"text":"","fixedHead":1},"3":{"style":8,"text":"#{xs.groupRight(year)}年","sort":"desc","fixedHead":1,"aggregate":"group","direction":"right"}},"height":40},"2":{"cells":{"1":{"text":"","fixedHead":1},"2":{"text":"","fixedHead":1},"3":{"style":8,"text":"#{xs.groupRight(mouth)}","sort":"default","fixedHead":1,"aggregate":"group","direction":"right"}},"height":34},"3":{"cells":{"1":{"subtotal":"groupField","style":28,"text":"#{xs.group(diqu)}","aggregate":"group"},"2":{"style":28,"text":"#{xs.group(class)}","aggregate":"group"},"3":{"decimalPlaces":"0","funcname":"SUM","style":29,"text":"#{xs.dynamic(sales)}","aggregate":"dynamic"}},"height":38},"4":{"cells":{"1":{"merge":[0,1],"style":24,"text":"总计"},"3":{"style":25,"text":"=sum(D4)"}},"height":37},"6":{"cells":{"1":{"style":32,"text":"审核:","fixedTail":1},"2":{"style":32,"text":"张三","fixedTail":1},"3":{"style":32,"fixedTail":1},"4":{"style":32,"text":"复审:","fixedTail":1},"5":{"style":32,"text":"李四","fixedTail":1}}},"len":100},"rpbar":{"show":true,"pageSize":"","btnList":[]},"groupField":"xs.diqu","fixedPrintHeadRows":[{"sci":1,"eci":3,"sri":1,"eri":2}],"fixedPrintTailRows":[{"sri":6,"sci":1,"eri":6,"eci":5}],"displayConfig":{},"background":false,"name":"sheet1","isGroup":true,"merges":["B1:D1","B2:C3","B5:C5"]}
|
||||
```
|
||||
29
.trae/skills/jimureport/examples/horizontal-group.md
Normal file
29
.trae/skills/jimureport/examples/horizontal-group.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# 示例11:横向分组
|
||||
|
||||
**类型:** 横向分组统计表
|
||||
**特征:** `customGroup()` + `direction:"right"` 数据横向展开
|
||||
|
||||
## 关键语法
|
||||
|
||||
所有数据行使用 `#{hex.customGroup(字段名)}` + `direction:"right"` 实现横向展开:
|
||||
|
||||
```json
|
||||
{"text":"#{hex.customGroup(department)}","style":11,"direction":"right"}
|
||||
```
|
||||
|
||||
## 数据字段
|
||||
|
||||
| 行 | 标签 | 绑定 |
|
||||
|---|---|---|
|
||||
| 2 | 部门 | `#{hex.customGroup(department)}` |
|
||||
| 3 | 学历 | `#{hex.customGroup(education)}` |
|
||||
| 4 | 性别 | `#{hex.customGroup(sex)}` |
|
||||
| 5 | 年龄 | `#{hex.customGroup(age)}` (无 direction,纵向) |
|
||||
| 6 | 姓名 | `#{hex.customGroup(name)}` |
|
||||
| 7 | 薪水 | `#{hex.customGroup(salary)}` |
|
||||
|
||||
## 报表 JSON
|
||||
|
||||
```json
|
||||
{"loopBlockList":[],"querySetting":{"izOpenQueryBar":false,"izDefaultQuery":true},"recordSubTableOrCollection":{"group":[],"record":[],"range":[]},"printConfig":{"paper":"A4","width":210,"height":297,"definition":1,"isBackend":false,"marginX":10,"marginY":10},"hidden":{"rows":[],"cols":[],"conditions":{"rows":{},"cols":{}}},"dbexps":[],"toolPrintSizeObj":{"printType":"A4","widthPx":718,"heightPx":1047},"dicts":[],"freeze":"A1","dataRectWidth":204,"isViewContentHorizontalCenter":false,"autofilter":{},"validations":[],"cols":{"0":{"width":44},"1":{"width":79},"2":{"width":81},"len":50},"area":{"sri":7,"sci":5,"eri":7,"eci":5,"width":100,"height":36},"excel_config_id":"1194552262320803840","hiddenCells":[],"zonedEditionList":[],"rows":{"1":{"cells":{"0":{"text":"员工信息横向统计表","style":9,"merge":[0,11]}},"height":97},"2":{"cells":{"1":{"text":"部门","style":7},"2":{"text":"#{hex.customGroup(department)}","style":11,"direction":"right"}},"isDrag":true,"height":40},"3":{"cells":{"1":{"text":"学历","style":7},"2":{"text":"#{hex.customGroup(education)}","style":11,"direction":"right"}},"isDrag":true,"height":39},"4":{"cells":{"1":{"text":"性别","style":7},"2":{"text":"#{hex.customGroup(sex)}","style":11,"direction":"right"}},"isDrag":true,"height":41},"5":{"cells":{"1":{"text":"年龄","style":7},"2":{"text":"#{hex.customGroup(age)}","style":11}},"isDrag":true,"height":39},"6":{"cells":{"1":{"text":"姓名","style":7},"2":{"text":"#{hex.customGroup(name)}","style":11,"direction":"right"}},"isDrag":true,"height":40},"7":{"cells":{"1":{"text":"薪水","style":7},"2":{"text":"#{hex.customGroup(salary)}","style":11,"direction":"right"}},"isDrag":true,"height":36},"len":100},"name":"sheet1","fillFormStyle":"default","merges":["A2:L2"]}
|
||||
```
|
||||
30
.trae/skills/jimureport/examples/internship-cert.md
Normal file
30
.trae/skills/jimureport/examples/internship-cert.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# 示例9:实习证明
|
||||
|
||||
**类型:** 单据模板(带背景图)
|
||||
**特征:** `background` 背景图 + `${tt.xxx}` 单值绑定 + 自由布局
|
||||
|
||||
## 数据绑定
|
||||
|
||||
- `${tt.name}` — 姓名
|
||||
- `${tt.pingjia}` — 评价内容(多行文本,merge跨4行5列)
|
||||
- `${tt.lingdao}` — 证明人
|
||||
- `${tt.shijian}` — 日期
|
||||
|
||||
## 关键配置
|
||||
|
||||
```json
|
||||
{
|
||||
"background": {
|
||||
"path": "https://static.jeecg.com/designreport/images/11_1611283832037.png",
|
||||
"repeat": "no-repeat",
|
||||
"width": "",
|
||||
"height": ""
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 报表 JSON
|
||||
|
||||
```json
|
||||
{"loopBlockList":[],"area":{"sri":28,"sci":9,"eri":28,"eci":9,"width":100,"height":25},"excel_config_id":"1347373863746539520","printConfig":{"layout":"portrait","paper":"A4","isBackend":false,"width":210,"definition":1,"marginX":10,"height":297,"marginY":10},"hiddenCells":[],"zonedEditionList":[],"rows":{"7":{"cells":{"2":{"merge":[0,4],"style":2,"text":"实习证明"}},"height":41},"10":{"cells":{"2":{"style":11,"text":"${tt.name}"},"3":{"merge":[0,3],"style":19,"text":"同学在我公司与 2020年4月1日 至 2020年5月1日 实习。","height":34}},"height":34},"12":{"cells":{"2":{"merge":[3,4],"style":13,"text":"${tt.pingjia}","height":129}},"height":36},"17":{"cells":{"2":{"style":12,"text":"特此证明!"}}},"22":{"cells":{"4":{"style":11,"text":"证明人:"},"5":{"style":12,"text":"${tt.lingdao}"}}},"23":{"cells":{"5":{"style":15,"text":"${tt.shijian}"}}},"len":100},"dbexps":[],"dicts":[],"freeze":"A1","dataRectWidth":707,"displayConfig":{},"background":{"path":"https://static.jeecg.com/designreport/images/11_1611283832037.png","repeat":"no-repeat","width":"","height":""},"name":"sheet1","autofilter":{},"validations":[],"cols":{"0":{"width":69},"1":{"width":41},"4":{"width":119},"5":{"width":147},"6":{"width":31},"len":50},"merges":["C8:G8","D11:G11","C13:G16"]}
|
||||
```
|
||||
15
.trae/skills/jimureport/examples/loopblock-detail.md
Normal file
15
.trae/skills/jimureport/examples/loopblock-detail.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# 示例4:循环块明细表(员工信息卡片)
|
||||
|
||||
**类型:** 循环块报表
|
||||
**特征:** `loopBlockList` 定义循环区域,每条数据渲染一个卡片,支持二维码 `display:"qrcode"`
|
||||
|
||||
## 关键配置
|
||||
|
||||
- `loopBlockList`:`[{"sci":1,"sri":2,"eci":7,"eri":5,"index":1,"db":"uiu"}]`
|
||||
- 二维码:单元格 `"display":"qrcode"` + `displayConfig` 配置宽高颜色
|
||||
|
||||
## 报表 JSON
|
||||
|
||||
```json
|
||||
{"loopBlockList":[{"sci":1,"sri":2,"eci":7,"eri":5,"index":1,"db":"uiu"}],"querySetting":{"izOpenQueryBar":false,"izDefaultQuery":true},"recordSubTableOrCollection":{"group":[],"record":[],"range":[]},"printConfig":{"paper":"A4","width":210,"height":297,"definition":1,"isBackend":false,"marginX":10,"marginY":10,"layout":"portrait"},"hidden":{"rows":[],"cols":[],"conditions":{"rows":{},"cols":{}}},"queryFormSetting":{"useQueryForm":false,"dbKey":"","idField":""},"dbexps":[],"toolPrintSizeObj":{"printType":"A4","widthPx":718,"heightPx":1047},"dicts":[],"freeze":"A1","dataRectWidth":688,"isViewContentHorizontalCenter":false,"autofilter":{},"validations":[],"cols":{"0":{"width":30},"1":{"width":94},"2":{"width":96},"3":{"width":81},"4":{"width":93},"5":{"width":88},"6":{"width":90},"7":{"width":116},"8":{"width":22},"len":50},"pyGroupEngine":false,"submitHandlers":[],"excel_config_id":"1176098706643308544","hiddenCells":[],"zonedEditionList":[],"rows":{"1":{"cells":{"1":{"text":"员工信息明细表","merge":[0,5],"style":32}},"height":64},"2":{"cells":{"1":{"text":"姓名:","style":28,"loopBlock":1},"2":{"style":30,"merge":[0,1],"loopBlock":1,"text":"#{uiu.name}"},"4":{"text":"所在部门:","style":29,"loopBlock":1},"5":{"style":30,"merge":[0,1],"loopBlock":1,"text":"#{uiu.department}"},"7":{"merge":[2,0],"height":75,"style":9,"text":"#{uiu.tm}","display":"qrcode","loopBlock":1}},"height":42},"3":{"cells":{"1":{"text":"年龄:","style":28,"loopBlock":1},"2":{"style":30,"merge":[0,1],"loopBlock":1,"text":"#{uiu.age}"},"4":{"text":"学历:","style":29,"loopBlock":1},"5":{"style":30,"merge":[0,1],"loopBlock":1,"text":"#{uiu.education}"},"7":{"text":"","loopBlock":1}},"height":35},"4":{"cells":{"1":{"text":"性别:","style":28,"loopBlock":1},"2":{"style":30,"merge":[0,1],"loopBlock":1,"text":"#{uiu.sex}"},"4":{"text":"薪水:","style":29,"loopBlock":1},"5":{"style":30,"merge":[0,1],"loopBlock":1,"text":"#{uiu.salary}"},"7":{"text":"","loopBlock":1}},"height":35},"5":{"cells":{"1":{"text":"","loopBlock":1},"2":{"text":"","loopBlock":1},"3":{"text":"","loopBlock":1},"4":{"text":"","loopBlock":1},"5":{"text":"","loopBlock":1},"6":{"text":"","loopBlock":1},"7":{"text":"","loopBlock":1}},"height":17},"len":100},"rpbar":{"show":true,"pageSize":"","btnList":[]},"displayConfig":{"11":{"text":"#{uiu.tm}","width":117,"height":117,"colorDark":"#000000","colorLight":"#ffffff"}},"name":"sheet1","merges":["B2:G2","C3:D3","F3:G3","H3:H5","C4:D4","F4:G4","C5:D5","F5:G5"]}
|
||||
```
|
||||
17
.trae/skills/jimureport/examples/master-sub-loopblock.md
Normal file
17
.trae/skills/jimureport/examples/master-sub-loopblock.md
Normal file
File diff suppressed because one or more lines are too long
79
.trae/skills/jimureport/examples/master-sub-table.md
Normal file
79
.trae/skills/jimureport/examples/master-sub-table.md
Normal file
File diff suppressed because one or more lines are too long
304
.trae/skills/jimureport/examples/normal-list-example.md
Normal file
304
.trae/skills/jimureport/examples/normal-list-example.md
Normal file
@@ -0,0 +1,304 @@
|
||||
# 普通列表报表示例
|
||||
|
||||
## 场景说明
|
||||
|
||||
一个标准的普通列表报表,数据集编码为 `aa`,SQL为 `select * from demo`,展示6个字段:id、name、key_word、punch_time、salary_money、bonus_money。
|
||||
|
||||
- 表头行(第1行):蓝底白字,行高34px
|
||||
- 数据行(第2行):居中+垂直居中,通过 `#{aa.字段名}` 绑定数据
|
||||
|
||||
## 完整 jsonStr
|
||||
|
||||
```json
|
||||
{
|
||||
"loopBlockList": [],
|
||||
"querySetting": {
|
||||
"izOpenQueryBar": false,
|
||||
"izDefaultQuery": true
|
||||
},
|
||||
"recordSubTableOrCollection": {
|
||||
"group": [],
|
||||
"record": [],
|
||||
"range": []
|
||||
},
|
||||
"printConfig": {
|
||||
"paper": "A4",
|
||||
"width": 210,
|
||||
"height": 297,
|
||||
"definition": 1,
|
||||
"isBackend": false,
|
||||
"marginX": 10,
|
||||
"marginY": 10,
|
||||
"layout": "portrait",
|
||||
"printCallBackUrl": ""
|
||||
},
|
||||
"hidden": {
|
||||
"rows": [],
|
||||
"cols": [],
|
||||
"conditions": {
|
||||
"rows": {},
|
||||
"cols": {}
|
||||
}
|
||||
},
|
||||
"queryFormSetting": {
|
||||
"useQueryForm": false,
|
||||
"dbKey": "",
|
||||
"idField": ""
|
||||
},
|
||||
"dbexps": [],
|
||||
"dicts": [],
|
||||
"fillFormToolbar": {
|
||||
"show": true,
|
||||
"btnList": ["save", "subTable_add", "verify", "subTable_del", "print", "close", "first", "prev", "next", "paging", "total", "last", "exportPDF", "exportExcel", "exportWord"]
|
||||
},
|
||||
"freeze": "A1",
|
||||
"dataRectWidth": 700,
|
||||
"isViewContentHorizontalCenter": false,
|
||||
"autofilter": {},
|
||||
"validations": [],
|
||||
"cols": {
|
||||
"len": 100
|
||||
},
|
||||
"area": {
|
||||
"sri": 12,
|
||||
"sci": 3,
|
||||
"eri": 12,
|
||||
"eci": 3,
|
||||
"width": 100,
|
||||
"height": 25
|
||||
},
|
||||
"pyGroupEngine": false,
|
||||
"submitHandlers": [],
|
||||
"excel_config_id": "1193766682428530688",
|
||||
"hiddenCells": [],
|
||||
"zonedEditionList": [],
|
||||
"rows": {
|
||||
"1": {
|
||||
"cells": {
|
||||
"1": { "text": "id", "style": 4 },
|
||||
"2": { "text": "name", "style": 4 },
|
||||
"3": { "text": "key_word", "style": 4 },
|
||||
"4": { "text": "punch_time", "style": 4 },
|
||||
"5": { "text": "salary_money", "style": 4 },
|
||||
"6": { "text": "bonus_money", "style": 4 }
|
||||
},
|
||||
"height": 34
|
||||
},
|
||||
"2": {
|
||||
"cells": {
|
||||
"1": { "text": "#{aa.id}", "style": 2 },
|
||||
"2": { "text": "#{aa.name}", "style": 2 },
|
||||
"3": { "text": "#{aa.key_word}", "style": 2 },
|
||||
"4": { "text": "#{aa.punch_time}", "style": 2 },
|
||||
"5": { "text": "#{aa.salary_money}", "style": 2 },
|
||||
"6": { "text": "#{aa.bonus_money}", "style": 2 }
|
||||
}
|
||||
},
|
||||
"len": 200
|
||||
},
|
||||
"rpbar": {
|
||||
"show": true,
|
||||
"pageSize": "",
|
||||
"btnList": []
|
||||
},
|
||||
"fixedPrintHeadRows": [],
|
||||
"fixedPrintTailRows": [],
|
||||
"displayConfig": {},
|
||||
"fillFormInfo": {
|
||||
"layout": {
|
||||
"direction": "horizontal",
|
||||
"width": 200,
|
||||
"height": 45
|
||||
}
|
||||
},
|
||||
"background": false,
|
||||
"name": "sheet1",
|
||||
"styles": [
|
||||
{
|
||||
"border": {
|
||||
"bottom": ["thin", "#000"],
|
||||
"top": ["thin", "#000"],
|
||||
"left": ["thin", "#000"],
|
||||
"right": ["thin", "#000"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"border": {
|
||||
"bottom": ["thin", "#000"],
|
||||
"top": ["thin", "#000"],
|
||||
"left": ["thin", "#000"],
|
||||
"right": ["thin", "#000"]
|
||||
},
|
||||
"align": "center"
|
||||
},
|
||||
{
|
||||
"border": {
|
||||
"bottom": ["thin", "#000"],
|
||||
"top": ["thin", "#000"],
|
||||
"left": ["thin", "#000"],
|
||||
"right": ["thin", "#000"]
|
||||
},
|
||||
"align": "center",
|
||||
"valign": "middle"
|
||||
},
|
||||
{
|
||||
"border": {
|
||||
"bottom": ["thin", "#000"],
|
||||
"top": ["thin", "#000"],
|
||||
"left": ["thin", "#000"],
|
||||
"right": ["thin", "#000"]
|
||||
},
|
||||
"align": "center",
|
||||
"valign": "middle",
|
||||
"bgcolor": "#01b0f1"
|
||||
},
|
||||
{
|
||||
"border": {
|
||||
"bottom": ["thin", "#000"],
|
||||
"top": ["thin", "#000"],
|
||||
"left": ["thin", "#000"],
|
||||
"right": ["thin", "#000"]
|
||||
},
|
||||
"align": "center",
|
||||
"valign": "middle",
|
||||
"bgcolor": "#01b0f1",
|
||||
"color": "#ffffff"
|
||||
}
|
||||
],
|
||||
"fillFormStyle": "default",
|
||||
"freezeLineColor": "rgb(185, 185, 185)",
|
||||
"merges": []
|
||||
}
|
||||
```
|
||||
|
||||
## 结构要点
|
||||
|
||||
### rows 布局
|
||||
|
||||
| 行号 | 用途 | style | 说明 |
|
||||
|------|------|-------|------|
|
||||
| 1 | 表头行 | 4(蓝底白字) | `height: 34`,text为字段显示名 |
|
||||
| 2 | 数据行 | 2(居中+垂直居中) | text为 `#{数据集编码.字段名}` |
|
||||
|
||||
### styles 索引对照
|
||||
|
||||
| 索引 | 边框 | 水平对齐 | 垂直对齐 | 背景色 | 字体色 | 典型用途 |
|
||||
|------|------|---------|---------|--------|--------|---------|
|
||||
| 0 | thin #000 | — | — | — | — | 基础单元格 |
|
||||
| 1 | thin #000 | center | — | — | — | 居中文本 |
|
||||
| 2 | thin #000 | center | middle | — | — | **数据行** |
|
||||
| 3 | thin #000 | center | middle | #01b0f1 | — | 蓝底表头(无白字) |
|
||||
| 4 | thin #000 | center | middle | #01b0f1 | #ffffff | **表头行(推荐)** |
|
||||
|
||||
### 数据绑定规则
|
||||
|
||||
- 数据集编码 `aa` 对应 saveDb 时的 `dbCode: "aa"`
|
||||
- 绑定语法: `#{aa.字段名}` — 字段名来自 fieldList 中的 `fieldName`
|
||||
- 列号从 1 开始(0列通常留空)
|
||||
|
||||
### 对应的数据集配置
|
||||
|
||||
```json
|
||||
{
|
||||
"jimuReportId": "1193766682428530688",
|
||||
"dbCode": "aa",
|
||||
"dbChName": "aa",
|
||||
"dbType": "0",
|
||||
"dbSource": "",
|
||||
"isList": "1",
|
||||
"isPage": "1",
|
||||
"dbDynSql": "select * from demo",
|
||||
"fieldList": [
|
||||
{ "fieldName": "id", "fieldText": "id", "widgetType": "String", "orderNum": 0 },
|
||||
{ "fieldName": "name", "fieldText": "name", "widgetType": "String", "orderNum": 1 },
|
||||
{ "fieldName": "key_word", "fieldText": "key_word", "widgetType": "String", "orderNum": 2 },
|
||||
{ "fieldName": "punch_time", "fieldText": "punch_time", "widgetType": "String", "orderNum": 3 },
|
||||
{ "fieldName": "salary_money", "fieldText": "salary_money", "widgetType": "String", "orderNum": 4 },
|
||||
{ "fieldName": "bonus_money", "fieldText": "bonus_money", "widgetType": "String", "orderNum": 5 }
|
||||
],
|
||||
"paramList": []
|
||||
}
|
||||
```
|
||||
|
||||
### 正确的 /jmreport/save 请求格式
|
||||
|
||||
> **关键:jsonStr 内容(rows、cols、styles 等)必须放在请求体顶层,和 `designerObj` 同级。禁止嵌套在 `designerObj.jsonStr` 中,否则后端会清空 rows 数据。**
|
||||
>
|
||||
> 后端 `saveReport` 逻辑:`json.remove("designerObj")` 后,剩余的顶层 JSON 直接作为 jsonStr 存入数据库。
|
||||
|
||||
```json
|
||||
{
|
||||
"designerObj": {
|
||||
"id": "1193766682428530688",
|
||||
"name": "普通列表示例",
|
||||
"type": "0",
|
||||
"template": 0,
|
||||
"delFlag": 0,
|
||||
"viewCount": 0,
|
||||
"updateCount": 0,
|
||||
"submitForm": 0,
|
||||
"reportName": "普通列表示例"
|
||||
},
|
||||
"loopBlockList": [],
|
||||
"querySetting": { "izOpenQueryBar": false, "izDefaultQuery": true },
|
||||
"recordSubTableOrCollection": { "group": [], "record": [], "range": [] },
|
||||
"printConfig": { "paper": "A4", "width": 210, "height": 297, "definition": 1, "isBackend": false, "marginX": 10, "marginY": 10, "layout": "portrait", "printCallBackUrl": "" },
|
||||
"hidden": { "rows": [], "cols": [], "conditions": { "rows": {}, "cols": {} } },
|
||||
"queryFormSetting": { "useQueryForm": false, "dbKey": "", "idField": "" },
|
||||
"dbexps": [], "dicts": [],
|
||||
"fillFormToolbar": { "show": true, "btnList": ["save", "subTable_add", "verify", "subTable_del", "print", "close", "first", "prev", "next", "paging", "total", "last", "exportPDF", "exportExcel", "exportWord"] },
|
||||
"freeze": "A1",
|
||||
"dataRectWidth": 700,
|
||||
"isViewContentHorizontalCenter": false,
|
||||
"autofilter": {},
|
||||
"validations": [],
|
||||
"cols": { "len": 100 },
|
||||
"area": { "sri": 12, "sci": 3, "eri": 12, "eci": 3, "width": 100, "height": 25 },
|
||||
"pyGroupEngine": false,
|
||||
"submitHandlers": [],
|
||||
"excel_config_id": "1193766682428530688",
|
||||
"hiddenCells": [],
|
||||
"zonedEditionList": [],
|
||||
"rows": {
|
||||
"1": {
|
||||
"cells": {
|
||||
"1": { "text": "id", "style": 4 },
|
||||
"2": { "text": "name", "style": 4 },
|
||||
"3": { "text": "key_word", "style": 4 },
|
||||
"4": { "text": "punch_time", "style": 4 },
|
||||
"5": { "text": "salary_money", "style": 4 },
|
||||
"6": { "text": "bonus_money", "style": 4 }
|
||||
},
|
||||
"height": 34
|
||||
},
|
||||
"2": {
|
||||
"cells": {
|
||||
"1": { "text": "#{aa.id}", "style": 2 },
|
||||
"2": { "text": "#{aa.name}", "style": 2 },
|
||||
"3": { "text": "#{aa.key_word}", "style": 2 },
|
||||
"4": { "text": "#{aa.punch_time}", "style": 2 },
|
||||
"5": { "text": "#{aa.salary_money}", "style": 2 },
|
||||
"6": { "text": "#{aa.bonus_money}", "style": 2 }
|
||||
}
|
||||
},
|
||||
"len": 200
|
||||
},
|
||||
"rpbar": { "show": true, "pageSize": "", "btnList": [] },
|
||||
"fixedPrintHeadRows": [],
|
||||
"fixedPrintTailRows": [],
|
||||
"displayConfig": {},
|
||||
"fillFormInfo": { "layout": { "direction": "horizontal", "width": 200, "height": 45 } },
|
||||
"background": false,
|
||||
"name": "sheet1",
|
||||
"styles": [
|
||||
{ "border": { "bottom": ["thin", "#000"], "top": ["thin", "#000"], "left": ["thin", "#000"], "right": ["thin", "#000"] } },
|
||||
{ "border": { "bottom": ["thin", "#000"], "top": ["thin", "#000"], "left": ["thin", "#000"], "right": ["thin", "#000"] }, "align": "center" },
|
||||
{ "border": { "bottom": ["thin", "#000"], "top": ["thin", "#000"], "left": ["thin", "#000"], "right": ["thin", "#000"] }, "align": "center", "valign": "middle" },
|
||||
{ "border": { "bottom": ["thin", "#000"], "top": ["thin", "#000"], "left": ["thin", "#000"], "right": ["thin", "#000"] }, "align": "center", "valign": "middle", "bgcolor": "#01b0f1" },
|
||||
{ "border": { "bottom": ["thin", "#000"], "top": ["thin", "#000"], "left": ["thin", "#000"], "right": ["thin", "#000"] }, "align": "center", "valign": "middle", "bgcolor": "#01b0f1", "color": "#ffffff" }
|
||||
],
|
||||
"fillFormStyle": "default",
|
||||
"freezeLineColor": "rgb(185, 185, 185)",
|
||||
"merges": []
|
||||
}
|
||||
```
|
||||
180
.trae/skills/jimureport/examples/prescription-form-example.md
Normal file
180
.trae/skills/jimureport/examples/prescription-form-example.md
Normal file
@@ -0,0 +1,180 @@
|
||||
# 处方笺模板示例(表单+列表混合)
|
||||
|
||||
## 场景说明
|
||||
|
||||
一个医院处方笺模板,包含:
|
||||
- **单条数据**(患者信息):使用 `${yonghu.字段名}` 绑定
|
||||
- **列表数据**(药品明细):使用 `#{yaopin.字段名}` 绑定
|
||||
- 外边框用 **thick**(粗线),内部用 **thin**(细线)
|
||||
- 自定义列宽,多处单元格合并
|
||||
- 隐藏行(`-1` 行)存放辅助字段
|
||||
|
||||
## 数据绑定语法对比
|
||||
|
||||
| 语法 | 数据类型 | 说明 | 示例 |
|
||||
|------|---------|------|------|
|
||||
| `${dbCode.field}` | 单条记录 | 直接取值,不循环 | `${yonghu.yphone}` |
|
||||
| `#{dbCode.field}` | 列表数据 | 自动循环展开 | `#{yaopin.name}` |
|
||||
|
||||
## 布局结构(行分布)
|
||||
|
||||
| 行号 | 内容 | 高度 | 说明 |
|
||||
|------|------|------|------|
|
||||
| 0 | 顶部留白 | 96px | 预留logo/印章区域 |
|
||||
| 1 | 上边框线 | 18px | thick边框顶边 |
|
||||
| 2 | 标题"智能医学院处方笺" | 124px | 合并C3:L3,style 38(14号加粗居中) |
|
||||
| 3 | 姓名/性别/年龄 | 默认 | `${yonghu.yphone}` `${yonghu.ysex}` `${yonghu.yage}` |
|
||||
| 4 | 单位/电话 | 29px | `${yonghu.danwei}` `${yonghu.yphone}` |
|
||||
| 5 | 初步诊断 | 34px | `${yonghu.yjieguo}` 合并7列 |
|
||||
| 6 | RP:标记 | 79px | 处方开始标志 |
|
||||
| 7 | **药品列表行** | 37px | `#{yaopin.name}` `#{yaopin.percent}` — 自动循环 |
|
||||
| 8 | 空行间隔 | 27px | |
|
||||
| 9 | 医嘱 | 默认 | `${yonghu.yizhu}` 合并8列 |
|
||||
| 10-12 | 费用明细 | 默认 | 药品费/中成药费/治疗费/检查费等 |
|
||||
| 13 | 合计 | 默认 | `${yonghu.ytotal}` |
|
||||
| 14 | 空行 | 17px | |
|
||||
| 15 | 医师/日期 | 43px | `${yonghu.yishe}` `${yonghu.kdata}` |
|
||||
| 16 | 空行 | 17px | |
|
||||
| 17 | 下边框线 | 默认 | thick边框底边 |
|
||||
| -1 | **隐藏行** | — | `#{yaopin.key1}` `#{yaopin.key2}` 辅助数据 |
|
||||
|
||||
## 关键特性
|
||||
|
||||
### 1. 隐藏行(-1行)
|
||||
|
||||
```json
|
||||
"-1": {
|
||||
"cells": {
|
||||
"0": { "text": "#{yaopin.key2}" },
|
||||
"-1": { "text": "#{yaopin.key1}" }
|
||||
},
|
||||
"isDrag": true
|
||||
}
|
||||
```
|
||||
|
||||
用于存放不需要显示但参与数据处理的字段,行号为 `-1`,列号可以为 `-1`。
|
||||
|
||||
### 2. 粗细边框方案
|
||||
|
||||
外框用 `thick`,内部用 `thin`,通过不同 style 组合实现:
|
||||
|
||||
```
|
||||
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ← 行1: thick top + thick left/right
|
||||
┃ 标题 ┃ ← 行2-16: thick left + thick right
|
||||
┃ ──────────────────────────── ┃ ← 内部分隔: thin border
|
||||
┃ 内容 ┃
|
||||
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ← 行17: thick bottom + thick left/right
|
||||
```
|
||||
|
||||
边框样式索引分类:
|
||||
|
||||
| 索引范围 | 边框类型 | 用途 |
|
||||
|---------|---------|------|
|
||||
| 24-26 | thick top + left/right | 顶部边框行 |
|
||||
| 27, 31 | thick left | 左边框列 |
|
||||
| 28 | thick right | 右边框列 |
|
||||
| 32-34 | thick bottom + left/right | 底部边框行 |
|
||||
| 6-7 | thin 四边 | 内部费用格子 |
|
||||
|
||||
### 3. 自定义列宽
|
||||
|
||||
```json
|
||||
"cols": {
|
||||
"0": { "width": 35 },
|
||||
"1": { "width": 14 },
|
||||
"2": { "width": 56 },
|
||||
"3": { "width": 54 },
|
||||
"4": { "width": 156 },
|
||||
"5": { "width": 41 },
|
||||
"6": { "width": 31 },
|
||||
"7": { "width": 113 },
|
||||
"8": { "width": 58 },
|
||||
"9": { "width": 20 },
|
||||
"10": { "width": 23 },
|
||||
"11": { "width": 81 },
|
||||
"12": { "width": 12 },
|
||||
"len": 50
|
||||
}
|
||||
```
|
||||
|
||||
### 4. 合并单元格
|
||||
|
||||
```json
|
||||
"merges": [
|
||||
"C3:L3", // 标题横跨10列
|
||||
"C4:D4", // 姓名标签
|
||||
"C5:D5", // 单位标签
|
||||
"C6:D6", // 初步诊断标签
|
||||
"E6:L6", // 诊断结果跨8列
|
||||
"B7:D7", // RP标记
|
||||
"C7:E7", // 药品名称
|
||||
"H7:I7", // 药品规格
|
||||
"D10:L10", // 医嘱跨9列
|
||||
"C11:D11", // 药品费
|
||||
"F11:G11", // 中成药费
|
||||
"I11:K11", // 治疗费
|
||||
"E13:H13", // 合计金额
|
||||
"J16:L16", // 日期
|
||||
...
|
||||
]
|
||||
```
|
||||
|
||||
### 5. isDrag 属性
|
||||
|
||||
```json
|
||||
"3": { "cells": {...}, "isDrag": true }
|
||||
```
|
||||
|
||||
`isDrag: true` 表示该行的高度曾被用户手动拖拽调整过。
|
||||
|
||||
### 6. toolPrintSizeObj(打印尺寸)
|
||||
|
||||
```json
|
||||
"toolPrintSizeObj": {
|
||||
"printType": "A4",
|
||||
"widthPx": 718,
|
||||
"heightPx": 1047
|
||||
}
|
||||
```
|
||||
|
||||
A4纸张的像素尺寸,用于打印预览。
|
||||
|
||||
## 对应的数据集配置
|
||||
|
||||
### 数据集1:yonghu(患者信息,单条)
|
||||
|
||||
```json
|
||||
{
|
||||
"dbCode": "yonghu",
|
||||
"dbChName": "患者信息",
|
||||
"dbType": "0",
|
||||
"isList": "0",
|
||||
"isPage": "0",
|
||||
"dbDynSql": "select yphone, ysex, yage, danwei, yjieguo, yizhu, yprice, yzhenliao, ytotal, yishe, kdata from yonghu_table where id = '${id}'"
|
||||
}
|
||||
```
|
||||
|
||||
### 数据集2:yaopin(药品明细,列表)
|
||||
|
||||
```json
|
||||
{
|
||||
"dbCode": "yaopin",
|
||||
"dbChName": "药品明细",
|
||||
"dbType": "0",
|
||||
"isList": "1",
|
||||
"isPage": "0",
|
||||
"dbDynSql": "select name, percent, key1, key2 from yaopin_table where chufang_id = '${id}'"
|
||||
}
|
||||
```
|
||||
|
||||
## 与普通列表的区别
|
||||
|
||||
| 特性 | 普通列表 | 处方笺(表单混合) |
|
||||
|------|---------|-------------------|
|
||||
| 数据集数量 | 通常1个 | 多个(yonghu + yaopin) |
|
||||
| 绑定语法 | 全部用 `#{}` | 单条用 `${}`,列表用 `#{}` |
|
||||
| 布局 | 表头+数据行 | 自由布局,多区域 |
|
||||
| 边框 | 统一thin | 外粗内细 |
|
||||
| 列宽 | 默认均匀 | 自定义不等宽 |
|
||||
| 合并单元格 | 少/无 | 大量合并 |
|
||||
| 隐藏行 | 无 | `-1` 行存辅助数据 |
|
||||
17
.trae/skills/jimureport/examples/prescription.md
Normal file
17
.trae/skills/jimureport/examples/prescription.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# 示例7:处方签
|
||||
|
||||
**类型:** 自由布局单据
|
||||
**特征:** 复杂边框布局(thick/thin混用)、主表 `${yonghu.xxx}` + 药品列表 `#{yaopin.xxx}`
|
||||
|
||||
## 数据绑定
|
||||
|
||||
- 主表(单值):`${yonghu.yphone}`、`${yonghu.ysex}`、`${yonghu.yage}`、`${yonghu.danwei}`、`${yonghu.yjieguo}`、`${yonghu.yizhu}`
|
||||
- 药品列表:`#{yaopin.name}`、`#{yaopin.percent}`
|
||||
- 费用汇总:`${yonghu.yprice}`、`${yonghu.yzhenliao}`、`${yonghu.ytotal}`
|
||||
- 签名:`${yonghu.yishe}`、`${yonghu.kdata}`
|
||||
|
||||
## 报表 JSON
|
||||
|
||||
```json
|
||||
{"loopBlockList":[],"area":{"sri":10,"sci":5,"eri":10,"eci":6,"width":72,"height":25},"excel_config_id":"6059e405dd9c66a6d38e00841d2e40cc","printConfig":{"paper":"A4","width":210,"height":297,"definition":1,"isBackend":false},"rows":{"0":{"cells":{"3":{"style":80,"text":" "}},"height":96},"1":{"cells":{"1":{"style":24,"text":" "},"2":{"style":25,"text":" "},"3":{"style":25,"text":" "},"4":{"style":25,"text":" "},"5":{"style":25,"text":" "},"6":{"style":25,"text":" "},"7":{"style":25,"text":" "},"8":{"style":25,"text":" "},"9":{"style":25,"text":" "},"10":{"style":25,"text":" "},"11":{"style":25,"text":" "},"12":{"style":26,"text":" "}},"height":18},"2":{"cells":{"1":{"text":" ","style":27},"2":{"merge":[0,9],"text":"智能医学院处方笺","style":38},"12":{"style":28,"text":" "}},"height":124},"3":{"cells":{"1":{"text":" ","style":46},"2":{"merge":[0,1],"text":"姓名:","style":4},"4":{"text":"${yonghu.yphone}"},"5":{"text":"性别:","style":42},"6":{"text":"${yonghu.ysex}","style":42},"7":{"text":"年龄:","style":47},"8":{"text":"${yonghu.yage}"},"11":{"style":69,"text":" ","merge":[0,1]},"12":{"style":43,"text":" "}},"isDrag":true},"4":{"cells":{"1":{"text":" ","style":74},"2":{"style":4,"merge":[0,1],"text":"单位:"},"4":{"text":"${yonghu.danwei}"},"5":{"text":"电话:"},"6":{"text":"${yonghu.yphone}","merge":[0,5]},"12":{"style":28,"text":" "}},"isDrag":true,"height":29},"5":{"cells":{"1":{"style":31,"text":" "},"2":{"merge":[0,1],"text":"初步诊断:","style":4},"4":{"text":"${yonghu.yjieguo}","merge":[0,7]},"12":{"style":28,"text":" "}},"isDrag":true,"height":34},"6":{"cells":{"1":{"text":" RP:","merge":[0,2],"style":79},"12":{"style":28,"text":" "}},"height":79},"7":{"cells":{"1":{"text":".","style":48},"3":{"text":"#{yaopin.name}","merge":[0,1]},"7":{"text":"#{yaopin.percent}","merge":[0,1]},"12":{"style":28,"text":" "}},"isDrag":true,"height":37},"9":{"cells":{"1":{"style":31,"text":" "},"2":{"text":"医嘱:","style":76},"3":{"text":"${yonghu.yizhu}","style":6,"merge":[0,8]},"12":{"style":28,"text":" "}},"isDrag":true},"10":{"cells":{"1":{"style":31,"text":" "},"2":{"text":"药品费","style":6,"merge":[0,1]},"4":{"text":"${yonghu.yprice}","style":6},"5":{"merge":[0,1],"text":"中成药费","style":6},"8":{"text":"治疗费","merge":[0,2],"style":6},"12":{"style":28,"text":" "}},"isDrag":true},"13":{"cells":{"1":{"style":31,"text":" "},"2":{"text":"合计","style":6,"merge":[0,1]},"4":{"text":"${yonghu.ytotal}","style":6,"merge":[0,7]},"12":{"style":28,"text":" "}},"isDrag":true},"15":{"cells":{"1":{"style":31,"text":" "},"2":{"text":"医师:","style":4,"merge":[0,1]},"4":{"text":"${yonghu.yishe}","style":80},"8":{"text":"日期:","style":4},"9":{"text":"${yonghu.kdata}","style":80,"merge":[0,2]},"12":{"style":71,"text":" "}},"isDrag":true,"height":43},"len":94},"dbexps":[],"dicts":[],"freeze":"A1","dataRectWidth":694,"displayConfig":{},"background":false,"name":"sheet1","autofilter":{},"validations":[],"cols":{"0":{"width":35},"1":{"width":14},"2":{"width":56},"3":{"width":54},"4":{"width":156},"5":{"width":41},"6":{"width":31},"7":{"width":113},"8":{"width":58},"9":{"width":20},"10":{"width":23},"11":{"width":81},"12":{"width":12},"len":50},"merges":["C3:E3","C7:E7","H3:I3","H7:I7","F11:G11","I11:K11","F12:G12","I12:K12","I13:K13","E13:H13","C11:D11","C12:D12","C13:D13","C14:D14","L4:M4","C3:L3","B7:D7","C4:D4","C5:D5","E14:L14","D10:L10","G5:L5","C6:D6","E6:L6","J16:L16","C16:D16","D8:E8","H8:I8"]}
|
||||
```
|
||||
@@ -0,0 +1,287 @@
|
||||
# 纵向分组小计报表示例
|
||||
|
||||
## 场景说明
|
||||
|
||||
员工信息登记表,按**部门**分组(一级),按**学历**分组(二级),自动合并相同分组的单元格,并在分组末尾显示小计/合计行。
|
||||
|
||||
## 分组效果预览
|
||||
|
||||
```
|
||||
┌──────┬──────┬──────┬──────┬──────┬──────┐
|
||||
│ 部门 │ 学历 │ 性别 │ 年龄 │ 姓名 │ 薪水 │
|
||||
├──────┼──────┼──────┼──────┼──────┼──────┤
|
||||
│ │ │ 男 │ 28 │ 张三 │ 8000 │
|
||||
│ │ 本科 ├──────┼──────┼──────┼──────┤
|
||||
│ │ │ 女 │ 25 │ 李四 │ 7500 │
|
||||
│ 研发 │ ├──────┼──────┼──────┼──────┤
|
||||
│ 部 │ │ 小计 │15500 │
|
||||
│ ├──────┼──────┼──────┼──────┼──────┤
|
||||
│ │ 硕士 │ 男 │ 30 │ 王五 │ 12000│
|
||||
│ │ ├──────┼──────┼──────┼──────┤
|
||||
│ │ │ 小计 │12000 │
|
||||
├──────┼──────┼──────┼──────┼──────┼──────┤
|
||||
│ │ 合计 │27500 │
|
||||
├──────┼──────┼──────┼──────┼──────┼──────┤
|
||||
│ ... │ ... │ ... │ ... │ ... │ ... │
|
||||
└──────┴──────┴──────┴──────┴──────┴──────┘
|
||||
```
|
||||
|
||||
## 核心配置
|
||||
|
||||
### 1. 分组字段声明
|
||||
|
||||
jsonStr 顶层需要两个属性:
|
||||
|
||||
```json
|
||||
{
|
||||
"isGroup": true,
|
||||
"groupField": "vegvkdueqw.department"
|
||||
}
|
||||
```
|
||||
|
||||
| 属性 | 说明 |
|
||||
|------|------|
|
||||
| `isGroup` | `true` 启用分组模式 |
|
||||
| `groupField` | 主分组字段,格式 `数据集编码.字段名` |
|
||||
|
||||
### 2. 数据行分组绑定
|
||||
|
||||
```json
|
||||
"3": {
|
||||
"cells": {
|
||||
"1": {
|
||||
"style": 17,
|
||||
"text": "#{vegvkdueqw.group(department)}",
|
||||
"aggregate": "group",
|
||||
"subtotal": "groupField",
|
||||
"funcname": "-1",
|
||||
"subtotalText": "合计"
|
||||
},
|
||||
"2": {
|
||||
"style": 17,
|
||||
"text": "#{vegvkdueqw.group(education)}",
|
||||
"aggregate": "group",
|
||||
"subtotal": "groupField",
|
||||
"funcname": "-1",
|
||||
"subtotalText": "小计"
|
||||
},
|
||||
"3": { "style": 17, "text": "#{vegvkdueqw.sex}" },
|
||||
"4": { "style": 17, "text": "#{vegvkdueqw.age}" },
|
||||
"5": { "style": 17, "text": "#{vegvkdueqw.name}" },
|
||||
"6": { "style": 17, "text": "#{vegvkdueqw.salary}" }
|
||||
},
|
||||
"height": 54
|
||||
}
|
||||
```
|
||||
|
||||
### 3. 分组单元格属性详解
|
||||
|
||||
| 属性 | 值 | 说明 |
|
||||
|------|-----|------|
|
||||
| `text` | `#{dbCode.group(fieldName)}` | 分组绑定语法,自动合并相同值的单元格 |
|
||||
| `aggregate` | `"group"` | 标记为分组聚合列 |
|
||||
| `subtotal` | `"groupField"` | 启用小计行 |
|
||||
| `funcname` | `"-1"` | 小计函数:`"-1"`=不计算(仅显示文本),可选 `"SUM"` `"AVG"` `"COUNT"` 等 |
|
||||
| `subtotalText` | `"合计"` / `"小计"` | 小计行显示的文本 |
|
||||
|
||||
### 4. 分组绑定语法
|
||||
|
||||
| 语法 | 说明 |
|
||||
|------|------|
|
||||
| `#{dbCode.group(field)}` | 分组字段,相同值自动合并单元格 |
|
||||
| `#{dbCode.field}` | 普通字段,每行独立显示 |
|
||||
|
||||
### 5. 多级分组
|
||||
|
||||
- **一级分组**(部门):subtotalText = `"合计"` — 部门切换时显示合计行
|
||||
- **二级分组**(学历):subtotalText = `"小计"` — 学历切换时显示小计行
|
||||
- 分组列从左到右排列,左边为高级别分组
|
||||
|
||||
## 完整 jsonStr
|
||||
|
||||
```json
|
||||
{
|
||||
"loopBlockList": [],
|
||||
"querySetting": {
|
||||
"izOpenQueryBar": false,
|
||||
"izDefaultQuery": true
|
||||
},
|
||||
"recordSubTableOrCollection": { "group": [], "record": [], "range": [] },
|
||||
"printConfig": {
|
||||
"paper": "A4",
|
||||
"width": 210,
|
||||
"height": 297,
|
||||
"definition": 4,
|
||||
"isBackend": false,
|
||||
"marginX": 10,
|
||||
"marginY": 10,
|
||||
"layout": "portrait",
|
||||
"printCallBackUrl": "",
|
||||
"paginationShow": false,
|
||||
"paginationLocation": "middle",
|
||||
"paginationStart": 1,
|
||||
"headerFooterShow": false,
|
||||
"headerLocation": "left",
|
||||
"headerText": "",
|
||||
"footerLocation": "left",
|
||||
"footerText": "",
|
||||
"fontsize": 28,
|
||||
"rotationAngle": -45,
|
||||
"watermarkColor": "#246DDE",
|
||||
"watermarkText": "积木报表",
|
||||
"watermarkShow": true,
|
||||
"printFootorFixBottom": false
|
||||
},
|
||||
"hidden": { "rows": [], "cols": [], "conditions": { "rows": {}, "cols": {} } },
|
||||
"queryFormSetting": { "useQueryForm": false, "dbKey": "", "idField": "" },
|
||||
"dbexps": [],
|
||||
"dicts": [],
|
||||
"fillFormToolbar": {
|
||||
"show": true,
|
||||
"btnList": ["save", "subTable_add", "verify", "subTable_del", "print", "close", "first", "prev", "next", "paging", "total", "last", "exportPDF", "exportExcel", "exportWord"]
|
||||
},
|
||||
"freeze": "A1",
|
||||
"dataRectWidth": 687,
|
||||
"isViewContentHorizontalCenter": false,
|
||||
"autofilter": {},
|
||||
"validations": [],
|
||||
"cols": {
|
||||
"0": { "width": 34 },
|
||||
"1": { "width": 119 },
|
||||
"3": { "width": 117 },
|
||||
"6": { "width": 117 },
|
||||
"7": { "width": 22 },
|
||||
"len": 100
|
||||
},
|
||||
"area": { "sri": 16, "sci": 4, "eri": 16, "eci": 4, "width": 100, "height": 25 },
|
||||
"pyGroupEngine": false,
|
||||
"submitHandlers": [],
|
||||
"excel_config_id": "1162913845578612736",
|
||||
"hiddenCells": [],
|
||||
"zonedEditionList": [],
|
||||
"rows": {
|
||||
"1": {
|
||||
"cells": {
|
||||
"1": {
|
||||
"merge": [0, 5],
|
||||
"style": 2,
|
||||
"text": "纵向员工信息登记表",
|
||||
"height": 0
|
||||
}
|
||||
},
|
||||
"height": 40
|
||||
},
|
||||
"2": {
|
||||
"cells": {
|
||||
"1": { "style": 15, "text": "部门" },
|
||||
"2": { "style": 15, "text": "学历" },
|
||||
"3": { "style": 15, "text": "性别" },
|
||||
"4": { "style": 15, "text": "年龄" },
|
||||
"5": { "style": 15, "text": "姓名" },
|
||||
"6": { "style": 15, "text": "薪水" }
|
||||
},
|
||||
"height": 34
|
||||
},
|
||||
"3": {
|
||||
"cells": {
|
||||
"1": {
|
||||
"style": 17,
|
||||
"text": "#{vegvkdueqw.group(department)}",
|
||||
"aggregate": "group",
|
||||
"subtotal": "groupField",
|
||||
"funcname": "-1",
|
||||
"subtotalText": "合计"
|
||||
},
|
||||
"2": {
|
||||
"style": 17,
|
||||
"text": "#{vegvkdueqw.group(education)}",
|
||||
"aggregate": "group",
|
||||
"subtotal": "groupField",
|
||||
"funcname": "-1",
|
||||
"subtotalText": "小计"
|
||||
},
|
||||
"3": { "style": 17, "text": "#{vegvkdueqw.sex}" },
|
||||
"4": { "style": 17, "text": "#{vegvkdueqw.age}" },
|
||||
"5": { "style": 17, "text": "#{vegvkdueqw.name}" },
|
||||
"6": { "style": 17, "text": "#{vegvkdueqw.salary}" }
|
||||
},
|
||||
"height": 54
|
||||
},
|
||||
"len": 100
|
||||
},
|
||||
"rpbar": { "show": true, "pageSize": "", "btnList": [] },
|
||||
"groupField": "vegvkdueqw.department",
|
||||
"fixedPrintHeadRows": [],
|
||||
"fixedPrintTailRows": [],
|
||||
"displayConfig": {},
|
||||
"fillFormInfo": { "layout": { "direction": "horizontal", "width": 200, "height": 45 } },
|
||||
"background": false,
|
||||
"name": "sheet1",
|
||||
"styles": [
|
||||
{ "font": { "bold": true } },
|
||||
{ "font": { "size": 16, "bold": true } },
|
||||
{ "align": "center", "font": { "size": 16, "bold": true } },
|
||||
{ "align": "center" },
|
||||
{ "bgcolor": "#5b9cd6", "align": "center" },
|
||||
{ "bgcolor": "#5b9cd6", "color": "#ffffff", "align": "center" },
|
||||
{ "border": { "top": ["thin", "#000"], "left": ["thin", "#000"], "bottom": ["thin", "#000"], "right": ["thin", "#000"] }, "bgcolor": "#5b9cd6", "color": "#ffffff", "align": "center" },
|
||||
{ "border": { "top": ["thin", "#000"], "left": ["thin", "#000"], "bottom": ["thin", "#000"], "right": ["thin", "#000"] } },
|
||||
{ "border": { "top": ["thin", "#bfbfbf"], "left": ["thin", "#bfbfbf"], "bottom": ["thin", "#bfbfbf"], "right": ["thin", "#bfbfbf"] }, "bgcolor": "#5b9cd6", "color": "#ffffff", "align": "center" },
|
||||
{ "border": { "top": ["thin", "#bfbfbf"], "left": ["thin", "#bfbfbf"], "bottom": ["thin", "#bfbfbf"], "right": ["thin", "#bfbfbf"] } },
|
||||
{ "border": { "top": ["thin", "#9cc2e6"], "left": ["thin", "#9cc2e6"], "bottom": ["thin", "#9cc2e6"], "right": ["thin", "#9cc2e6"] }, "bgcolor": "#5b9cd6", "color": "#ffffff", "align": "center" },
|
||||
{ "border": { "top": ["thin", "#9cc2e6"], "left": ["thin", "#9cc2e6"], "bottom": ["thin", "#9cc2e6"], "right": ["thin", "#9cc2e6"] } },
|
||||
{ "border": { "top": ["thin", "#9cc2e6"], "left": ["thin", "#9cc2e6"], "bottom": ["thin", "#9cc2e6"], "right": ["thin", "#9cc2e6"] }, "bgcolor": "#bdd7ee", "color": "#ffffff", "align": "center" },
|
||||
{ "border": { "top": ["thin", "#9cc2e6"], "left": ["thin", "#9cc2e6"], "bottom": ["thin", "#9cc2e6"], "right": ["thin", "#9cc2e6"] }, "bgcolor": "#bdd7ee", "color": "#000100", "align": "center" },
|
||||
{ "border": { "top": ["thin", "#9cc2e6"], "left": ["thin", "#9cc2e6"], "bottom": ["thin", "#9cc2e6"], "right": ["thin", "#9cc2e6"] }, "bgcolor": "#9cc2e6", "color": "#000100", "align": "center" },
|
||||
{ "border": { "top": ["thin", "#5b9cd6"], "left": ["thin", "#5b9cd6"], "bottom": ["thin", "#5b9cd6"], "right": ["thin", "#5b9cd6"] }, "bgcolor": "#9cc2e6", "color": "#000100", "align": "center" },
|
||||
{ "border": { "top": ["thin", "#5b9cd6"], "left": ["thin", "#5b9cd6"], "bottom": ["thin", "#5b9cd6"], "right": ["thin", "#5b9cd6"] } },
|
||||
{ "border": { "top": ["thin", "#5b9cd6"], "left": ["thin", "#5b9cd6"], "bottom": ["thin", "#5b9cd6"], "right": ["thin", "#5b9cd6"] }, "align": "center" }
|
||||
],
|
||||
"isGroup": true,
|
||||
"freezeLineColor": "rgb(185, 185, 185)",
|
||||
"merges": ["B2:G2"]
|
||||
}
|
||||
```
|
||||
|
||||
## 样式方案(蓝色主题)
|
||||
|
||||
| 索引 | 背景色 | 字体色 | 边框色 | 用途 |
|
||||
|------|--------|--------|--------|------|
|
||||
| 2 | — | — | — | 标题(16号加粗居中) |
|
||||
| 15 | #9cc2e6 | #000100 | #5b9cd6 | **表头行**(中蓝底) |
|
||||
| 17 | — | — | #5b9cd6 | **数据行**(蓝色边框居中) |
|
||||
|
||||
三层蓝色渐变:
|
||||
- 深蓝 `#5b9cd6` — 表头背景/边框色
|
||||
- 中蓝 `#9cc2e6` — 表头行背景
|
||||
- 浅蓝 `#bdd7ee` — 交替行/小计行背景
|
||||
|
||||
## 打印配置(含水印)
|
||||
|
||||
```json
|
||||
"printConfig": {
|
||||
"paper": "A4",
|
||||
"definition": 4,
|
||||
"watermarkShow": true,
|
||||
"watermarkText": "积木报表",
|
||||
"watermarkColor": "#246DDE",
|
||||
"fontsize": 28,
|
||||
"rotationAngle": -45,
|
||||
"paginationShow": false,
|
||||
"headerFooterShow": false,
|
||||
"printFootorFixBottom": false
|
||||
}
|
||||
```
|
||||
|
||||
| 属性 | 说明 |
|
||||
|------|------|
|
||||
| `definition` | 打印清晰度(1-4,4最高) |
|
||||
| `watermarkShow` | 启用水印 |
|
||||
| `watermarkText` | 水印文字 |
|
||||
| `watermarkColor` | 水印颜色 |
|
||||
| `fontsize` | 水印字号 |
|
||||
| `rotationAngle` | 水印旋转角度(负数=逆时针) |
|
||||
| `paginationShow` | 是否显示页码 |
|
||||
| `paginationLocation` | 页码位置:left/middle/right |
|
||||
| `headerFooterShow` | 是否显示页眉页脚 |
|
||||
| `printFootorFixBottom` | 页脚是否固定在底部 |
|
||||
21
.trae/skills/jimureport/examples/zone-edition.md
Normal file
21
.trae/skills/jimureport/examples/zone-edition.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# 示例6:分版(多表格并排)
|
||||
|
||||
**类型:** 分版报表
|
||||
**特征:** `zonedEditionList` 定义多个独立数据区域,单元格标记 `"zonedEdition":N`
|
||||
|
||||
## 关键配置
|
||||
|
||||
```json
|
||||
{
|
||||
"zonedEditionList": [
|
||||
{"sci":4,"sri":3,"eci":6,"eri":4,"db":"flapi","index":1},
|
||||
{"sci":8,"sri":4,"eci":9,"eri":5,"db":"flapi","index":2}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## 报表 JSON
|
||||
|
||||
```json
|
||||
{"loopBlockList":[],"querySetting":{"izOpenQueryBar":false,"izDefaultQuery":true},"recordSubTableOrCollection":{"group":[],"record":[],"range":[]},"printConfig":{"paper":"A4","width":210,"height":297,"definition":1,"isBackend":false,"marginX":10,"marginY":10,"layout":"portrait"},"hidden":{"rows":[],"cols":[],"conditions":{"rows":{},"cols":{}}},"queryFormSetting":{"useQueryForm":false,"dbKey":"","idField":""},"dbexps":[],"dicts":[],"freeze":"A1","dataRectWidth":930,"isViewContentHorizontalCenter":false,"autofilter":{},"validations":[],"cols":{"3":{"width":69},"7":{"width":61},"len":50},"pyGroupEngine":false,"submitHandlers":[],"excel_config_id":"1193411148792549376","hiddenCells":[],"zonedEditionList":[{"sci":4,"sri":3,"eci":6,"eri":4,"db":"flapi","index":1},{"sci":8,"sri":4,"eci":9,"eri":5,"db":"flapi","index":2}],"rows":{"1":{"cells":{"3":{"style":18,"text":"分版示例","merge":[0,1],"height":65},"5":{"merge":[0,2],"height":65,"text":"说明:当报表左侧已有表格,右侧仍需要展示表格时,需使用分版功能","style":20}},"height":65},"2":{"cells":{"1":{"text":"表1","style":7},"5":{"text":"表2","style":7}},"height":41},"3":{"cells":{"0":{"text":"姓名","style":2},"1":{"text":"性别","style":2},"2":{"text":"年龄","style":2},"4":{"text":"省份","style":2,"zonedEdition":1},"5":{"style":2,"zonedEdition":1,"text":"月份"},"6":{"style":2,"zonedEdition":1,"text":"金额"},"8":{"text":"表3","style":8}},"height":35},"4":{"cells":{"0":{"text":"#{jm.name}","style":0},"1":{"text":"#{jm.sex}","style":0},"2":{"text":"#{jm.age}","style":0},"4":{"text":"#{flapi.dept}","style":0,"zonedEdition":1},"5":{"style":0,"zonedEdition":1,"text":"#{flapi.month}月"},"6":{"style":0,"zonedEdition":1,"text":"#{flapi.amount}"},"8":{"text":"年份","style":2,"zonedEdition":2},"9":{"text":"金额","style":2,"zonedEdition":2}},"height":30},"5":{"cells":{"8":{"text":"#{flapi.year}年","style":0,"zonedEdition":2},"9":{"text":"#{flapi.settleamount}","style":0,"zonedEdition":2}}},"len":103},"rpbar":{"show":true,"pageSize":"","btnList":[]},"name":"sheet1","merges":["D1:E1","D2:E2","F2:H2"]}
|
||||
```
|
||||
Reference in New Issue
Block a user