feat:移除了弹窗,服务器添加sls

This commit is contained in:
2026-09-08 22:39:45 +08:00
commit 6a295f9a7a
4082 changed files with 1322534 additions and 0 deletions

View File

@ -0,0 +1,63 @@
# 按钮 `button`
交互按钮,支持跳转 / 回调 / 表单提交三类行为。**Card 2.0**。
## 最小示例
```json
{
"tag": "button",
"text": { "tag": "plain_text", "content": "确定" },
"type": "primary",
"behaviors": [{ "type": "callback", "value": { "action": "ok" } }]
}
```
## 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `button` |
| `text` | 否 | Object | / | `{tag:"plain_text", content}`≤100 字符 |
| `type` | 否 | String | default | 见下方 type 枚举 |
| `size` | 否 | String | medium | `tiny` / `small` / `medium` / `large` |
| `width` | 否 | String | default | `default` / `fill` / `[100,∞)px` |
| `behaviors` | 是* | Array | / | 交互行为,见下;表单内按钮不用 behaviors 而用 `form_action_type` |
| `icon` | 否 | Object | / | 前缀图标(同 `div.icon` |
| `hover_tips` | 否 | Object | / | PC 端悬浮提示plain_text |
| `disabled` | 否 | Boolean | false | 是否禁用 |
| `disabled_tips` | 否 | Object | / | 禁用后悬浮提示plain_text |
| `confirm` | 否 | Object | / | 二次确认弹窗 `{title, text}`(均 plain_texttitle 必填) |
| `margin` | 否 | String | 0 | 外边距 [-99,99]px |
| `element_id` | 否 | String | / | 唯一标识,字母开头 ≤20 字符 |
**type 枚举**`default`(黑字描边) / `primary`(蓝字描边) / `danger`(红字描边) / `text` / `primary_text` / `danger_text`(无边框) / `primary_filled`(蓝底白字) / `danger_filled`(红底白字) / `laser`(镭射)。
## 按钮主次(强制)
- 全卡仅 1 个按钮 → `type: "primary_filled"`,并 `width: "fill"` 撑满成强焦点。
- 多个并列按钮 → 第一个(主操作)`primary_filled`,其余一律 `default`,形成「一主多次」层级。
- 删除 / 拒绝等危险操作用 `danger` 系(`danger``danger_filled`)。
## behaviors交互行为
```json
// 1. 服务端回调
{ "type": "callback", "value": { "key": "v" } }
// 2. 跳转链接(可与 callback 同数组共存)
{ "type": "open_url", "default_url": "https://x", "pc_url": "", "ios_url": "", "android_url": "" }
```
表单容器内的按钮 **不用 behaviors**,改用根字段:
| 字段 | 必填 | 说明 |
|---|---|---|
| `name` | 是 | 表单内唯一标识 |
| `form_action_type` | 是 | `submit`(提交表单)/ `reset`(重置) |
## 嵌套 / 易错点
- 可嵌套在 column_set / form / collapsible_panel / 循环容器 / interactive_container 内。
- 2.0 已废弃 `action` 交互模块,按钮直接放 `elements`,用间距控制排列。
- 旧式 `url`/`value` 顶层字段是 1.0 写法2.0 一律用 `behaviors`
- 点击触发 `card.action.trigger`,回传 `action.tag="button"` + `action.value`(即 callback 的 value

View File

@ -0,0 +1,57 @@
# 图表 `chart`
基于 VChart 的可视化图表(折线/柱/饼/词云等)。**Card 2.0**。
## 最小示例
```json
{
"tag": "chart",
"chart_spec": {
"type": "line",
"title": { "text": "趋势" },
"data": { "values": [
{ "time": "周一", "value": 8 },
{ "time": "周二", "value": 14 }
] },
"xField": "time",
"yField": "value"
}
}
```
## 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `chart` |
| `chart_spec` | 是 | Object | / | VChart 图表定义,见下 |
| `aspect_ratio` | 否 | String | 16:9(PC)/1:1(移动) | `1:1` / `2:1` / `4:3` / `16:9` |
| `color_theme` | 否 | String | brand | `brand` / `rainbow` / `complementary` / `converse` / `primary`chart_spec 里声明了样式则此项无效 |
| `height` | 否 | String | auto | `auto`(按宽高比) 或 `[1,999]px`(设固定高则 aspect_ratio 失效) |
| `preview` | 否 | Boolean | true | 是否可独立窗口/全屏查看 |
| `margin` | 否 | String | 0 | 外边距 [-99,99]px |
| `element_id` | 否 | String | / | 唯一标识,字母开头 ≤20 字符 |
## chart_spec 常用类型
`chart_spec` 是标准 VChart spec。核心字段`type``data.values`(数据数组)、`xField`/`yField`(轴字段)、`seriesField`(分组)、`title.text``legends`
| 图表 | type | 关键字段 |
|---|---|---|
| 折线 | `line` | `xField`, `yField` |
| 面积 | `area` | `xField`, `yField` |
| 柱状 | `bar` | `xField`, `yField`,分组加 `seriesField` |
| 条形(横向) | `bar` | `direction:"horizontal"``xField`=值,`yField`=类别 |
| 饼/环 | `pie` | `valueField`, `categoryField`,环图加 `innerRadius` |
| 散点 | `scatter` | `xField`, `yField` |
| 词云 | `wordCloud` | `nameField`, `valueField` |
完整属性参考 [VChart 官方文档](https://www.visactor.io/vchart/option/barChart)。
## 易错点
- 不支持 JavaScript 语法,`chart_spec` 必须是纯 JSON。
- 单卡建议 ≤5 个图表。
- 移动端不支持部分 VChart 属性(纹理 texture、conical 渐变、grid 词云布局等),用了会在移动端加载失败。
- 平台默认给 chart_spec 追加 media query 自适应;要自控可设 `"media": []`

View File

@ -0,0 +1,38 @@
# 勾选器 `checker`
任务勾选场景的交互组件,支持配置回调响应。仅支持手写 JSON搭建工具不支持构建。**Card 2.0**。
## 最小示例
```json
{
"tag": "checker",
"name": "check_1",
"checked": false,
"text": { "tag": "plain_text", "content": "完成新品上市计划报告" },
"behaviors": [{ "type": "callback", "value": { "key": "todo1" } }]
}
```
## 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `checker` |
| `name` | 否* | String | / | 唯一标识;**form 内必填且全局唯一** |
| `checked` | 否 | Boolean | false | 初始勾选状态 |
| `text` | 否 | Object | / | `{tag:"plain_text"\|"lark_md", content, text_size?, text_color?, text_align?}`text_color 见 `../resource/colors.md` |
| `overall_checkable` | 否 | Boolean | true | 悬浮时整体是否有阴影效果 |
| `button_area` | 否 | Object | / | `{pc_display_rule:"always"|"on_hover", buttons:[<=3 个 button]}` |
| `checked_style` | 否 | Object | / | `{show_strikethrough, opacity}`,勾选后的内容样式 |
| `disabled` / `disabled_tips` | 否 | Boolean/Object | false / 空 | 禁用及禁用提示 |
| `hover_tips` | 否 | Object | 空 | 悬浮提示;与 `disabled_tips` 同配时后者生效 |
| `behaviors` | 否 | Array | / | `[{type:"callback", value:{...}}]`**未配置时仅本地勾选生效,不触发回调** |
| `confirm` | 否 | Object | / | 二次确认弹窗 `{title, text}` |
| `padding`/`margin` | 否 | String | 0 | [-99,99]px |
## 嵌套 / 易错点
- 可嵌套在 form / 交互容器 / column_set / collapsible_panel 内。
- 不配置 `behaviors` 时勾选仅前端本地生效,不会触发服务端回调——需要业务侧感知必须显式配置。
- 回调:`action.tag="checker"` + `action.checked`布尔值form 内则读 `form_value[name]`

View File

@ -0,0 +1,46 @@
# 折叠面板 `collapsible_panel`
折叠次要内容(备注、长文本),点标题展开/收起。**Card 2.0**。
## 最小示例
```json
{
"tag": "collapsible_panel",
"expanded": false,
"header": { "title": { "tag": "plain_text", "content": "面板标题" } },
"elements": [{ "tag": "markdown", "content": "折叠的内容" }]
}
```
## 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `collapsible_panel` |
| `header` | 是 | Object | / | 标题区,见下 |
| `elements` | 否 | Array | / | 面板内组件;**不能放 `form`** |
| `expanded` | 否 | Boolean | false | 是否默认展开 |
| `background_color` | 否 | String | 透明 | 面板背景,颜色枚举(见 `../resource/colors.md` |
| `border` | 否 | Object | / | `{ color, corner_radius }` |
| `direction` | 否 | String | vertical | `vertical` / `horizontal` |
| `vertical_spacing`/`horizontal_spacing` | 否 | String | 8px | 间距枚举或 [0,99]px |
| `padding` | 否 | String | 0 | 内边距 [0,99]px |
| `margin` | 否 | String | 0 | 外边距 [-99,99]px |
**header 字段**
| 字段 | 必填 | 说明 |
|---|---|---|
| `title` | 否 | `{tag:"plain_text"\|"markdown", content}` |
| `background_color` | 否 | 标题区背景,颜色枚举 |
| `width` | 否 | `fill` / `auto` / `auto_when_fold`(收起时自适应) |
| `vertical_align` | 否 | `top`/`center`/`bottom` |
| `icon` | 否 | 图标 `{tag, token, color, size}`(同 `div.icon`,多 `size` |
| `icon_position` | 否 | `left` / `right` / `follow_text` |
| `icon_expanded_angle` | 否 | 展开时图标旋转角:`-180`/`-90`/`90`/`180` |
## 嵌套 / 易错点
- 内部不支持 `form`;容器最多嵌套 5 层。
- 仅支持写 JSON搭建工具不支持。

View File

@ -0,0 +1,53 @@
# 分栏 `column_set` + `column`
横向多列布局容器。`column_set` 装若干 `column`,每个 `column` 内再放组件。**Card 2.0**。
## 最小示例
```json
{
"tag": "column_set",
"flex_mode": "none",
"columns": [
{ "tag": "column", "width": "weighted", "weight": 1,
"elements": [{ "tag": "markdown", "content": "左列" }] },
{ "tag": "column", "width": "weighted", "weight": 1,
"elements": [{ "tag": "markdown", "content": "右列" }] }
]
}
```
## column_set 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `column_set` |
| `columns` | 是 | column[] | / | 列数组,子节点只能是 `column` |
| `flex_mode` | 否 | String | none | 窄屏自适应:`none`(按比例压缩) / `stretch`(变上下堆叠) / `flow`(自动换行) / `bisect`(两等分) / `trisect`(三等分) |
| `horizontal_spacing` | 否 | String | 8px | `small`(4)/`medium`(8)/`large`(12)/`extra_large`(16) 或 `[0,99]px` |
| `horizontal_align` | 否 | String | left | `left` / `center` / `right` |
| `background_style` | 否 | String | default | `default` 或颜色枚举/RGBA`../resource/colors.md`);嵌套时上层覆盖下层 |
| `action` | 否 | Object | / | 整块点击跳转 `{ multi_url:{url,pc_url,ios_url,android_url} }` |
| `margin` | 否 | String | 0 | 外边距 [-99,99]px |
## column 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `column` |
| `elements` | 否 | Element[] | / | 列内组件;**不能放 `form``table`**,可放 `column_set` |
| `width` | 否 | String | auto | 仅 `flex_mode:none` 生效:`auto` / `weighted`(配 weight) / `[16,600]px` |
| `weight` | 否 | Number | 1 | `width:weighted` 时的宽度占比1~5 整数 |
| `vertical_align` | 否 | String | top | `top` / `center` / `bottom` |
| `direction` | 否 | String | vertical | `vertical` / `horizontal` |
| `horizontal_spacing`/`vertical_spacing` | 否 | String | 8px | 同上间距枚举或 `[0,99]px` |
| `padding` | 否 | String | 0 | 内边距 [0,99]px |
| `margin` | 否 | String | 0 | 外边距 [-99,99]px |
| `background_style` | 否 | String | default | 同上 |
| `action` | 否 | Object | / | 点击列跳转,同 column_set.action |
## 嵌套 / 易错点
- **column_set 的直接子节点只能是 `column`**;不能 `column_set → column_set`。二级分栏要走 `column_set → column → column_set`
- column 内可放除 `form` / `table` 外的所有组件。
- 最多嵌套 5 层,过深会压缩展示空间。

View File

@ -0,0 +1,34 @@
# 日期选择器 `date_picker`
提供日期选项的交互组件,默认拥有交互能力(无需显式 `behaviors` 也会回调)。**Card 2.0**。
## 最小示例
```json
{
"tag": "date_picker",
"placeholder": { "tag": "plain_text", "content": "请选择" },
"initial_date": "2024-01-01"
}
```
## 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `date_picker` |
| `name` | 否* | String | / | 唯一标识;**form 内必填且全局唯一** |
| `required` | 否 | Boolean | false | 是否必选form 内生效) |
| `initial_date` | 否 | String | / | 初始值,格式 `yyyy-MM-dd`,会覆盖 `placeholder` |
| `placeholder` | 否 | Object | / | 占位文本plain_text未设 `initial_date` 时必填 |
| `width` | 否 | String | default | `default`/`fill`/`[100,∞)px` |
| `disabled` | 否 | Boolean | false | 是否禁用(需端版本 V7.4+ |
| `behaviors` | 否 | Array | / | `[{type:"callback", value:{...}}]` |
| `confirm` | 否 | Object | / | 二次确认弹窗 `{title, text}` |
| `margin` | 否 | String | 0 | [-99,99]px |
## 嵌套 / 易错点
- 可嵌套在 column_set / form / collapsible_panel / 循环容器 / 交互容器内;搭建工具中暂不支持嵌套在交互容器中。
- 提醒用户注意时区语境(如预定海外酒店用酒店所在地时区);服务端只返回用户当前时区作为参考,不代表用户选的就是该时区。
- 回调:`action.tag="date_picker"` + `action.option`(日期字符串,如 `"2025-06-10 +0800"`+ `action.timezone`form 内则读 `form_value[name]`

View File

@ -0,0 +1,36 @@
# 普通文本 `div`
带样式的文本块,支持前缀图标和 label-value 字段对。**Card 2.0**。富文本用 `markdown` 组件。
## 最小示例
```json
{
"tag": "div",
"text": { "tag": "plain_text", "content": "示例文本" }
}
```
## 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `div` |
| `text` | 否 | Object | / | 文本对象,见下 |
| `text.tag` | 是 | String | plain_text | `plain_text``lark_md`(部分 Markdown语法见 `markdown.md` |
| `text.content` | 是 | String | / | 文本内容 |
| `text.text_size` | 否 | String | normal | `heading-0`~`heading-4` / `normal`(14px) / `notation`(12px) 等;可在 `config.style.text_size` 自定义 pc/mobile 不同字号 |
| `text.text_color` | 否 | String | default | 颜色枚举(见 `../resource/colors.md`),仅 `plain_text` 生效 |
| `text.text_align` | 否 | String | left | `left` / `center` / `right` |
| `text.lines` | 否 | Int | / | 最大显示行数,超出 `...` 省略 |
| `icon` | 否 | Object | / | 前缀图标,见下 |
| `icon.tag` | 否 | String | / | `standard_icon`(用 `token`+`color`token 见 `../resource/icons.md`)或 `custom_icon`(用 `img_key` |
| `width` | 否 | String | fill | `fill` / `auto` / `[16,999]px` |
| `margin` | 否 | String | 0 | 外边距 [-99,99]px |
| `element_id` | 否 | String | / | 唯一标识,字母开头 ≤20 字符;流式更新时 `text.element_id` 指定文本 |
> `fields` 字段(多列 label-value数组每项 `{ is_short, text:{tag,content} }``is_short:true` 可并排。
## 易错点
- `text_color` 只在 `text.tag``plain_text` 时生效;`lark_md` 用内联 `<font color=red>` 着色。

View File

@ -0,0 +1,51 @@
# 表单容器 `form`
批量录入表单项后一次提交:用户在前端填写多个表单项,点击提交按钮后将所有值打包一次性回调到服务端。**Card 2.0**。
## 最小示例
```json
{
"tag": "form",
"name": "form_1",
"elements": [
{ "tag": "input", "name": "reason", "required": true },
{
"tag": "button",
"text": { "tag": "plain_text", "content": "提交" },
"type": "primary",
"form_action_type": "submit",
"name": "Button_submit"
}
]
}
```
## 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `form` |
| `name` | 是 | String | / | 表单容器唯一标识,卡片内全局唯一,用于识别提交数据归属 |
| `elements` | 是 | Element[] | [] | 子节点,支持除 `table``form` 外的所有组件 |
| `direction` | 否 | String | vertical | `vertical` / `horizontal` |
| `horizontal_spacing`/`vertical_spacing` | 否 | String | 8px/12px | 间距枚举 `small`(4)/`medium`(8)/`large`(12)/`extra_large`(16) 或 `[0,99]px` |
| `horizontal_align` | 否 | String | left | `left`/`center`/`right` |
| `vertical_align` | 否 | String | top | `top`/`center`/`bottom` |
| `padding`/`margin` | 否 | String | 0 | [-99,99]px支持单值/双值/四值写法 |
| `element_id` | 否 | String | / | 唯一标识,字母开头 ≤20 字符 |
### 子组件内嵌字段(交互组件嵌在 form 内时生效)
| 字段 | 必填 | 说明 |
|---|---|---|
| `name` | 是 | 表单内组件唯一标识,卡片全局唯一,否则提交失败 |
| `required` | 否 | 是否必填;为 true 且未填时点提交会本地拦截,不发起回调 |
| `form_action_type` | 是(按钮) | `submit`(提交)/ `reset`(重置初始值);表单内按钮**不用** `behaviors` |
## 嵌套 / 易错点
- `form` 不支持嵌套 `table``form`;且 `form` 本身只能放卡片根节点下,不能被其他组件嵌套。
- form 内所有交互组件的 `name` 必须填且全局唯一,否则提交失败。
- 表单内必须包含一个 `form_action_type: submit` 的按钮。
- 回调来源:`card.action.trigger``action.tag="button"` + `action.form_value`(按组件 `name` 映射各字段值)。

View File

@ -0,0 +1,34 @@
# 标题 `header`
卡片顶部标题区(主/副标题、后缀标签、图标、主题色)。**Card 2.0**。挂在卡片根的 `header` 键下,不在 `body.elements` 内,单卡仅一个。
## 最小示例
```json
{
"header": {
"title": { "tag": "plain_text", "content": "卡片标题" },
"template": "blue"
}
}
```
## 字段
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
| `title` | 是 | Object | 主标题,`{tag:"plain_text"\|"lark_md", content}`,最多 4 行 |
| `subtitle` | 否 | Object | 副标题,同 title最多 1 行;只配副标题会按主标题展示 |
| `template` | 否 | String | 主题色枚举,见下;默认 `default` |
| `text_tag_list` | 否 | Array | 后缀标签,最多 3 个,每项 `{tag:"text_tag", text:{tag:"plain_text",content}, color}` |
| `i18n_text_tag_list` | 否 | Object | 多语言后缀标签;与 `text_tag_list` 二选一,同配以多语言为准 |
| `icon` | 否 | Object | 前缀图标(同 `div.icon` |
| `padding` | 否 | String | 内边距,默认 12px[0,99]px |
**template 枚举**13 色):`blue` / `wathet` / `turquoise` / `green` / `yellow` / `orange` / `red` / `carmine` / `violet` / `purple` / `indigo` / `grey` / `default`
**标签 color 枚举**`neutral`/`blue`/`turquoise`/`lime`/`orange`/`violet`/`indigo`/`wathet`/`green`/`yellow`/`red`/`purple`/`carmine`。深浅档位及 RGBA 见 `../resource/colors.md`
## 选色建议
按场景选 template 颜色见 `../lark-im-card-style.md` 意图表。常见语义green=成功/完成orange=警告red=错误/危险grey=失效/归档blue=通用信息。

View File

@ -0,0 +1,17 @@
# 分割线 `hr`
分隔卡片内容的水平线。**Card 2.0**1.0 同名 `hr`)。
## 最小示例
```json
{ "tag": "hr" }
```
## 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `hr` |
| `margin` | 否 | String | 0 | 外边距,范围 [-99,99]px`"8px 0"` |
| `element_id` | 否 | String | / | 组件唯一标识字母开头、≤20 字符 |

View File

@ -0,0 +1,34 @@
# 图片 `img`
展示图片。需先调上传图片接口拿 `img_key`。**Card 2.0**。
## 最小示例
```json
{
"tag": "img",
"img_key": "img_v3_xxx",
"alt": { "tag": "plain_text", "content": "" }
}
```
## 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `img` |
| `img_key` | 是 | String | / | 图片 key上传图片接口获取 |
| `alt` | 是 | Object | / | hover 说明,`{tag:"plain_text", content:""}`,不需要传空 |
| `title` | 否 | Object | / | 图片标题plain_text 对象 |
| `scale_type` | 否 | String | crop_center | `crop_center` / `crop_top` / `fit_horizontal`(不裁剪) |
| `size` | 否 | String | / | 仅 `crop_*` 生效:`stretch`/`large`(160)/`medium`(80)/`small`(40)/`tiny`(16),或 `"100px 100px"` |
| `corner_radius` | 否 | String | / | 圆角,`[0,∞]px``[0,100]%` |
| `transparent` | 否 | Boolean | false | 是否透明底 |
| `preview` | 否 | Boolean | true | 点击是否放大;配 `card_link` 跳转时设 false |
| `margin` | 否 | String | 0 | 外边距 [-99,99]px |
| `element_id` | 否 | String | / | 唯一标识,字母开头 ≤20 字符 |
## 易错点
- 通栏效果2.0 不再支持 `size: stretch_without_padding`,改用负 `margin`(如 `"4px -12px"`)。
- 上传规范≤10M、尺寸 ≤1500×3000px、高:宽 ≤16:9。

View File

@ -0,0 +1,30 @@
# 多图混排 `img_combination`
多张图片按预设版式拼排。**Card 2.0**。
## 最小示例
```json
{
"tag": "img_combination",
"combination_mode": "double",
"img_list": [{ "img_key": "img_v3_a" }, { "img_key": "img_v3_b" }]
}
```
## 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `img_combination` |
| `combination_mode` | 是 | String | / | `double`(≤2) / `triple`(≤3) / `bisect`(双列≤6) / `trisect`(三列≤9) |
| `img_list` | 是 | Array | / | 每项 `{ img_key }`,顺序即排列顺序 |
| `combination_transparent` | 否 | Boolean | false | 是否透明底 |
| `corner_radius` | 否 | String | / | 圆角,`[0,∞]px``[0,100]%` |
| `margin` | 否 | String | 0 | 外边距 [-99,99]px |
| `element_id` | 否 | String | / | 唯一标识,字母开头 ≤20 字符 |
## 易错点
- 图片数超过 mode 上限:只显示靠前的,其余丢弃;不足则留空白。
- 上传规范≤10M、≤1500×3000px、高:宽 ≤16:9。

View File

@ -0,0 +1,43 @@
# 输入框 `input`
收集用户文本输入。常嵌在 `form` 内配合提交按钮使用。**Card 2.0**。
## 最小示例
```json
{
"tag": "input",
"name": "comment",
"placeholder": { "tag": "plain_text", "content": "请输入" },
"label": { "tag": "plain_text", "content": "备注:" }
}
```
## 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `input` |
| `name` | 否* | String | / | 唯一标识;**在 form 内必填且全局唯一**,用于识别提交数据 |
| `required` | 否 | Boolean | false | 是否必填(仅 form 内生效) |
| `placeholder` | 否 | Object | / | 占位文本plain_text≤100 字符 |
| `default_value` | 否 | String | / | 预填内容 |
| `label` | 否 | Object | / | 描述文本plain_text |
| `label_position` | 否 | String | top | `top` / `left`(窄屏自动转 top |
| `input_type` | 否 | String | text | `text` / `multiline_text`(多行,回调含 `\n`) / `password` |
| `rows` | 否 | Number | 5 | 多行时默认行数 |
| `auto_resize` | 否 | Boolean | false | 多行时高度自适应(仅 PC |
| `max_rows` | 否 | Number | / | `auto_resize` 时最大行数 |
| `max_length` | 否 | Number | 1000 | 最大字符数,[1,1000] |
| `show_icon` | 否 | Boolean | true | password 时是否显示前缀图标 |
| `width` | 否 | String | default | `default` / `fill` / `[100,∞)px` |
| `disabled` | 否 | Boolean | false | 是否禁用(配 `disabled_tips` plain_text |
| `behaviors` | 否 | Array | / | `[{type:"callback", value:{...}}]` |
| `confirm` | 否 | Object | / | 二次确认弹窗 `{title, text}` |
| `margin` | 否 | String | 0 | 外边距 [-99,99]px |
## 嵌套 / 易错点
- 可嵌套在 column_set / form / collapsible_panel / 循环容器 / interactive_container 内。
- 在 form 内为**异步提交**:用户填完点提交按钮才一次性回调全部表单数据。
- 回调里 `action.tag="input"` + `action.input_value`用户输入值form 提交则值在 `form_value` 内。

View File

@ -0,0 +1,46 @@
# 交互容器 `interactive_container`
整块可点击区域统一定义内嵌内容的样式和交互callback/open_url适合卡片内的列表项、可点击卡片块。**Card 2.0**。
## 最小示例
```json
{
"tag": "interactive_container",
"width": "fill",
"has_border": true,
"border_color": "grey",
"corner_radius": "8px",
"padding": "4px 12px 4px 12px",
"behaviors": [{ "type": "callback", "value": { "key": "value" } }],
"elements": [
{ "tag": "markdown", "content": "帮我生成一篇产品方案的框架" }
]
}
```
## 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `interactive_container` |
| `elements` | 是 | Element[] | [] | 子节点,支持除 `form`/`table` 外的所有组件 |
| `behaviors` | 是 | Array | / | 点击整容器的交互:`callback`(回传)/ `open_url`(跳转),可同数组共存 |
| `width` | 否 | String | fill | `fill`/`auto`/`[16,999]px` |
| `height` | 否 | String | auto | `auto`/`[10,999]px` |
| `direction` | 否 | String | vertical | `vertical`/`horizontal` |
| `horizontal_align`/`vertical_align` | 否 | String | left/top | 对齐方式 |
| `background_style` | 否 | String | default | `default`/`laser`/颜色枚举/RGBA`../resource/colors.md` |
| `has_border` | 否 | Boolean | false | 是否展示 1px 边框 |
| `border_color` | 否 | String | grey | `has_border` 为 true 时生效 |
| `corner_radius` | 否 | String | 0px | `[0,∞]px``[0,100]%` |
| `padding`/`margin` | 否 | String | 4px,12px / 0px | 同间距写法 |
| `disabled` / `disabled_tips` | 否 | Boolean/Object | false / 空 | 禁用整容器及禁用提示 |
| `hover_tips` | 否 | Object | 空 | PC 端悬浮提示 |
| `confirm` | 否 | Object | / | 二次确认弹窗 `{title, text}` |
## 嵌套 / 易错点
- 可嵌套除 `form`/`table` 外的所有组件,包括嵌套自身(列表项常见写法)。
- 若容器内有交互组件(如内部 `button`),优先响应该子组件的交互,容器级 `behaviors` 不会触发。
- 回调来源:`card.action.trigger``action.tag` 取决于内部触发的具体组件;容器本身被点击时 `action.value` 即容器 `behaviors.value`

View File

@ -0,0 +1,56 @@
# 富文本 `markdown`
支持 Markdown + 部分 HTML 的富文本。最常用的内容组件。**Card 2.0**。
## 最小示例
```json
{
"tag": "markdown",
"content": "**标题**\n正文<font color='red'>红字</font>[链接](https://x)"
}
```
## 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `markdown` |
| `content` | 是 | String | / | Markdown 文本JSON 里用 `\n` 换行 |
| `text_size` | 否 | String | normal | `heading-0`~`heading-4` / `normal`(14px) / `notation`(12px) 等;可在 `config.style.text_size` 自定义 pc/mobile 字号 |
| `text_align` | 否 | String | left | `left` / `center` / `right` |
| `icon` | 否 | Object | / | 前缀图标(同 `div.icon` |
| `margin` | 否 | String | 0 | 外边距 [-99,99]px |
| `element_id` | 否 | String | / | 唯一标识,字母开头 ≤20 字符 |
## 常用语法
| 效果 | 语法 |
|---|---|
| 粗 / 斜 / 删除线 | `**粗**``*斜*``~~删~~`(前后留空格更稳) |
| 换行 | JSON 内 `\n`;或 `<br>` |
| 文字链接 | `[文字](https://x)`(必须带 http/https |
| 带图标链接 | `<link icon='chat_outlined' …>文案</link>`icon token 见 `../resource/icons.md` |
| 彩色文本 | `<font color='red'>红字</font>`color 枚举见 `../resource/colors.md`;链接文本不可着色) |
| 标签 | `<text_tag color='blue'>标签</text_tag>`colorneutral/blue/turquoise/lime/orange/violet/indigo/wathet/green/yellow/red/purple/carmine |
| @ 人 | `<at id=ou_xxx></at>``<at id=all></at>``<at ids=id1,id2></at>` |
| @所有人 | `<at id=all></at>`(需群主开权限,否则发送失败) |
| 人员卡片 | `<person id='ou_xxx' show_name=true show_avatar=true style='normal'></person>` |
| 数字角标 | `<number_tag>1</number_tag>`0-99可加 background_color/font_color/url |
| 国际化时间 | `<local_datetime millisecond='' format_type='date_num'></local_datetime>` |
| 标题 | `# 一级` ~ `###### 六级`(大标题显丑,正文优先用加粗,见易错点) |
| 列表 | `- 项`(无序)/ `1. 项`有序4 空格一层缩进 |
| 引用 | `> 引用文字` |
| 行内/块代码 | `` `code` `` / ```` ```go ... ``` ````(可指定语言) |
| 分割线 | `<hr>` 或 `---`(需单独一行) |
| 图片 | `![hover文案](img_key)` |
| 表格 | 标准 MD 表格;除标题最多 5 行(超出分页),单组件 ≤4 表 |
| 飞书表情 | `:DONE:`、`:OK:` |
## 易错点
- **慎用大标题**`#` / `##` / `###` 一~三级标题字号过大、显丑,正文里一律用 `**加粗**` 替代来突出重点。**唯一例外**是「指标卡」里用 `##` 放大数值(见 `../lark-im-card-style.md` 视觉规范)。
- **少用 `markdown` 的 `margin`**:间距优先交给父容器的 `vertical_spacing` / `padding`,多数情况置 `0px`;仅精细缩进时设非零值(见 `../lark-im-card-style.md` 间距纪律)。
- 2.0 不再支持旧的 `[xx]($urlVal)` + `href` 差异化跳转语法,改用 `<link>`。
- 要展示 Markdown 特殊字符(`* ~ > < [ ] ( ) # : _` 等)须 HTML 转义,如 `<`→`&#60;`、`*`→`&#42;`。
- `content` 里的引号注意与 JSON 转义;属性值用单引号可减少冲突。

View File

@ -0,0 +1,40 @@
# 人员选择-多选 `multi_select_person`
从候选人员中多选。**Card 2.0**。字段与 `select_person` 基本一致,差别在多选默认值。
## 最小示例
```json
{
"tag": "multi_select_person",
"name": "reviewers",
"placeholder": { "tag": "plain_text", "content": "请选择" },
"options": [
{ "value": "ou_xxx" },
{ "value": "ou_yyy" }
]
}
```
## 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `multi_select_person` |
| `options` | 否 | Array | / | 候选人 `{value: open_id}`;为空或全无效时候选项为会话全体成员 |
| `selected_values` | 否 | String[] | / | 默认选中的 open_id 数组 |
| `name` | 否* | String | / | 唯一标识;**form 内必填且全局唯一** |
| `required` | 否 | Boolean | false | 是否必选form 内生效) |
| `type` | 否 | String | default | `default`(带框) / `text`(纯文本) |
| `placeholder` | 否 | Object | / | 占位文本plain_text |
| `width` | 否 | String | default | `default` / `fill` / `[100,∞)px` |
| `disabled` | 否 | Boolean | false | 是否禁用 |
| `behaviors` | 否 | Array | / | `[{type:"callback", value:{...}}]` |
| `confirm` | 否 | Object | / | 二次确认弹窗 `{title, text}` |
| `margin` | 否 | String | 0 | 外边距 [-99,99]px |
## 嵌套 / 易错点
- 可嵌套在 column_set / form / collapsible_panel / 循环容器 / interactive_container 内。
- `options[].value` 只接受 **open_id**;默认选中用 `selected_values`(数组)。
- 回调返回选中的多个 open_id。

View File

@ -0,0 +1,40 @@
# 下拉多选 `multi_select_static`
下拉菜单多选。**Card 2.0**。字段与 `select_static` 基本一致,差别在多选默认值。
## 最小示例
```json
{
"tag": "multi_select_static",
"name": "tags",
"placeholder": { "tag": "plain_text", "content": "请选择" },
"options": [
{ "text": { "tag": "plain_text", "content": "选项1" }, "value": "1" },
{ "text": { "tag": "plain_text", "content": "选项2" }, "value": "2" }
]
}
```
## 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `multi_select_static` |
| `options` | 否 | Array | / | 选项 `{text:{plain_text}, value, icon?}``value` 不可重复 |
| `selected_values` | 否 | String[] | / | 默认选中的 value 数组 |
| `name` | 否* | String | / | 唯一标识;**form 内必填且全局唯一** |
| `required` | 否 | Boolean | false | 是否必选form 内生效) |
| `type` | 否 | String | default | `default`(带框) / `text`(纯文本) |
| `placeholder` | 否 | Object | / | 占位文本plain_text |
| `width` | 否 | String | default | `default`(带框固定282px) / `fill` / `[100,∞)px` |
| `disabled` | 否 | Boolean | false | 是否禁用 |
| `behaviors` | 否 | Array | / | `[{type:"callback", value:{...}}]` |
| `confirm` | 否 | Object | / | 二次确认弹窗 `{title, text}` |
| `margin` | 否 | String | 0 | 外边距 [-99,99]px |
## 嵌套 / 易错点
- 可嵌套在 column_set / form / collapsible_panel / 循环容器 / interactive_container 内。
- 选项 `value` 唯一;默认选中用 `selected_values`(数组)而非单选的 `initial_*`
- 回调返回选中的多个值。

View File

@ -0,0 +1,36 @@
# 折叠按钮组 `overflow`
折叠多个选项按钮,点击展开。适用于操作较多的场景。**Card 2.0**。
## 最小示例
```json
{
"tag": "overflow",
"options": [
{ "text": { "tag": "plain_text", "content": "选项A" }, "value": "a" },
{ "text": { "tag": "plain_text", "content": "选项B" }, "value": "b" }
]
}
```
## 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `overflow` |
| `options` | 是 | Array | / | 选项按钮,见下 |
| `options[].text` | 否 | Object | / | `{tag:"plain_text", content}`≤100 字符 |
| `options[].value` | 否 | String | / | 点击回传值,用于区分点了哪个选项(回调 `action.option` |
| `options[].multi_url` | 否 | Object | / | 跳转链接 `{url, pc_url, ios_url, android_url}` |
| `behaviors` | 否 | Array | / | 额外回传:`[{type:"callback", value:{...}}]` |
| `confirm` | 否 | Object | / | 二次确认弹窗 `{title, text}`(均 plain_text |
| `width` | 否 | String | default | `default` / `fill` / `[100,∞)px` |
| `margin` | 否 | String | 0 | 外边距 [-99,99]px |
| `element_id` | 否 | String | / | 唯一标识,字母开头 ≤20 字符 |
## 嵌套 / 易错点
- 可嵌套在 form / collapsible_panel / 循环容器 / interactive_container / column_set 内。
- 多按钮时务必给每个 `options[].value`,否则回调无法区分点了哪个。
- 点击触发 `card.action.trigger`,回传 `action.tag = "overflow"` + `action.option`

View File

@ -0,0 +1,30 @@
# 人员 `person`
展示单个用户的头像/姓名,点击可看名片。**Card 2.0**。
## 最小示例
```json
{
"tag": "person",
"user_id": "ou_xxx",
"show_name": true
}
```
## 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `person` |
| `user_id` | 是 | String | / | 人员 ID支持 open_id / union_id / user_id |
| `size` | 否 | String | medium | `extra_small` / `small` / `medium` / `large` |
| `show_avatar` | 否 | Boolean | true | 是否显示头像 |
| `show_name` | 否 | Boolean | false | 是否显示姓名 |
| `style` | 否 | String | normal | `normal` / `capsule`(胶囊) |
| `margin` | 否 | String | 0 | 外边距 [-99,99]px |
| `element_id` | 否 | String | / | 唯一标识,字母开头 ≤20 字符 |
## 易错点
- 发卡应用需有访问用户 ID 的权限,否则人员信息无法展示。

View File

@ -0,0 +1,31 @@
# 人员列表 `person_list`
展示多个用户的头像/姓名。**Card 2.0**。
## 最小示例
```json
{
"tag": "person_list",
"persons": [{ "id": "ou_xxx" }, { "id": "ou_yyy" }]
}
```
## 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `person_list` |
| `persons` | 是 | Array | / | 每项 `{ id }`id 支持 open_id / union_id / user_id |
| `show_name` | 否 | Boolean | true | 是否显示姓名;关掉且多人时为"葫芦串"叠头像样式 |
| `show_avatar` | 否 | Boolean | false | 是否显示头像 |
| `size` | 否 | String | medium | `extra_small` / `small` / `medium` / `large` |
| `lines` | 否 | Int | / | 最大行数,不可为 0 |
| `drop_invalid_user_id` | 否 | Boolean | false | true 忽略无效 IDfalse 则有无效 ID 时报错 |
| `icon` / `ud_icon` | 否 | Object | / | 前缀图标(同 `div.icon`);两者同设以 `icon` 为准 |
| `margin` | 否 | String | 0 | 外边距 [-99,99]px |
| `element_id` | 否 | String | / | 唯一标识,字母开头 ≤20 字符 |
## 易错点
- 发卡应用需有访问用户 ID 的权限,否则无法展示人员信息。

View File

@ -0,0 +1,34 @@
# 日期时间选择器 `picker_datetime`
提供日期+时间选项的交互组件,默认拥有交互能力。**Card 2.0**。
## 最小示例
```json
{
"tag": "picker_datetime",
"placeholder": { "tag": "plain_text", "content": "请选择" },
"initial_datetime": "2024-01-01 08:00"
}
```
## 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `picker_datetime` |
| `name` | 否* | String | / | 唯一标识;**form 内必填且全局唯一** |
| `required` | 否 | Boolean | false | 是否必选form 内生效) |
| `initial_datetime` | 否 | String | / | 初始值,格式 `yyyy-MM-dd HH:mm`,会覆盖 `placeholder` |
| `placeholder` | 否 | Object | / | 占位文本plain_text未设 `initial_datetime` 时必填 |
| `width` | 否 | String | default | `default`/`fill`/`[100,∞)px` |
| `disabled` | 否 | Boolean | false | 是否禁用(需端版本 V7.4+ |
| `behaviors` | 否 | Array | / | `[{type:"callback", value:{...}}]` |
| `confirm` | 否 | Object | / | 二次确认弹窗 `{title, text}` |
| `margin` | 否 | String | 0 | [-99,99]px |
## 嵌套 / 易错点
- 可嵌套在 column_set / form / collapsible_panel / 循环容器 / 交互容器内;搭建工具中暂不支持嵌套在交互容器中。
- 提醒用户注意时区语境;服务端只返回用户当前时区作为参考,不代表用户选的就是该时区。
- 回调:`action.tag="picker_datetime"` + `action.option`(如 `"2025-06-10 19:19 +0800"`+ `action.timezone`form 内则读 `form_value[name]`

View File

@ -0,0 +1,34 @@
# 时间选择器 `picker_time`
提供时间选项的交互组件,默认拥有交互能力。**Card 2.0**。
## 最小示例
```json
{
"tag": "picker_time",
"placeholder": { "tag": "plain_text", "content": "请选择" },
"initial_time": "09:00"
}
```
## 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `picker_time` |
| `name` | 否* | String | / | 唯一标识;**form 内必填且全局唯一** |
| `required` | 否 | Boolean | false | 是否必选form 内生效) |
| `initial_time` | 否 | String | / | 初始值,格式 `HH:mm`,会覆盖 `placeholder` |
| `placeholder` | 否 | Object | / | 占位文本plain_text未设 `initial_time` 时必填 |
| `width` | 否 | String | default | `default`/`fill`/`[100,∞)px` |
| `disabled` | 否 | Boolean | false | 是否禁用(需端版本 V7.4+ |
| `behaviors` | 否 | Array | / | `[{type:"callback", value:{...}}]` |
| `confirm` | 否 | Object | / | 二次确认弹窗 `{title, text}` |
| `margin` | 否 | String | 0 | [-99,99]px |
## 嵌套 / 易错点
- 可嵌套在 column_set / form / collapsible_panel / 循环容器 / 交互容器内;搭建工具中暂不支持嵌套在交互容器中。
- 提醒用户注意时区语境;服务端只返回用户当前时区作为参考,不代表用户选的就是该时区。
- 回调:`action.tag="picker_time"` + `action.option`(时间字符串,如 `"05:05 +0800"`+ `action.timezone`form 内则读 `form_value[name]`

View File

@ -0,0 +1,35 @@
# 循环容器(搭建工具专属,无 JSON tag
批量渲染同版式不同数据的列表(如商品列表、推荐列表)。**仅支持在飞书卡片搭建工具中可视化构建,不支持手写卡片 JSON 代码实现**——因此没有 `tag` 字段可直接编排。
## 使用方式
1. 在[卡片搭建工具](https://open.feishu.cn/cardkit)中添加循环容器组件,绑定一个对象数组变量。
2. 在容器内添加任意展示/交互/分栏组件,并将其字段绑定到对象数组的子变量。
3. 发布卡片模板后,发送时通过 `template_variable` 传入实际数据数组,数组每个元素对应一条循环项。
## 发送示例(模板 + 变量赋值)
```json
{
"type": "template",
"data": {
"template_id": "AAqi6xJ8rabcd",
"template_version_name": "1.0.0",
"template_variable": {
"looping": [
{ "title": "**和风陶韵**", "description": "...", "image": { "img_key": "img_v3_xxx" } },
{ "title": "**匠心之作**", "description": "...", "image": { "img_key": "img_v3_yyy" } }
]
}
}
}
```
将以上 JSON 压缩转义后作为 `messages.create``content``msg_type``interactive`
## 嵌套 / 易错点
- 不支持再嵌套循环容器(对象数组变量不支持嵌套对象数组类型)。
- 数组元素个数即渲染条数,可直接控制列表长度。
- 若循环容器内嵌表单容器的交互组件(如 input交互组件的 `name`(表单项标识)必须绑定到不重复的子变量,否则预览/发送报错。

View File

@ -0,0 +1,42 @@
# 多图选择 `select_img`
以图片为选项的交互组件,支持单选/多选如商品图、模板图、AI 生成图)。仅支持手写 JSON搭建工具不支持。**Card 2.0**。
## 最小示例
```json
{
"tag": "select_img",
"name": "select_img_1",
"layout": "bisect",
"aspect_ratio": "16:9",
"options": [
{ "img_key": "img_v2_xxx", "value": "picture1" },
{ "img_key": "img_v2_yyy", "value": "picture2" }
]
}
```
## 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `select_img` |
| `options` | 是 | Array | / | 选项,每项 `{img_key, value, disabled?, disabled_tips?, hover_tips?}` |
| `multi_select` | 否 | Boolean | false | 多选仅支持异步提交,**必须**内嵌在 form 中,否则报错 |
| `layout` | 否 | String | bisect | 图片布局:`stretch`(撑满)/`bisect`(二等分)/`trisect`(三等分) |
| `aspect_ratio` | 否 | String | 16:9 | `1:1`/`16:9`/`4:3` |
| `name` | 否* | String | / | 唯一标识;**form 内必填且全局唯一** |
| `required` | 否 | Boolean | false | 是否必选form 内生效) |
| `can_preview` | 否 | Boolean | true | 点击图片是否弹窗放大(仅 form 内生效) |
| `disabled` | 否 | Boolean | false | 是否禁用整组件 |
| `value` | 否 | String/Object | / | 自定义回传参数 |
| `behaviors` | 是 | Array | / | `[{type:"callback", value:{...}}]` |
| `confirm` | 否 | Object | / | 二次确认弹窗 `{title, text}` |
## 嵌套 / 易错点
- 可嵌套在根节点 / column_set / form / 交互容器(搭建工具暂不支持嵌套交互容器)。
- **不在 form 内**:仅支持单选,点击立即提交触发回调,不支持多选/异步提交。
- **在 form 内**:支持单选/多选 + 异步提交(随表单一起提交)。
- 回调(非 form`action.tag="select_img"` + `action.options`单选时仍是该字段form 内则读 `form_value[name]`

View File

@ -0,0 +1,39 @@
# 人员选择-单选 `select_person`
从候选人员中单选一人。**Card 2.0**。
## 最小示例
```json
{
"tag": "select_person",
"placeholder": { "tag": "plain_text", "content": "请选择" },
"options": [
{ "value": "ou_xxx" },
{ "value": "ou_yyy" }
]
}
```
## 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `select_person` |
| `options` | 否 | Array | / | 候选人,每项 `{value: open_id}`**为空或全无效时,候选项为会话内全体成员** |
| `name` | 否* | String | / | 唯一标识;**form 内必填且全局唯一** |
| `required` | 否 | Boolean | false | 是否必选form 内生效) |
| `type` | 否 | String | default | `default`(带框) / `text`(纯文本) |
| `placeholder` | 否 | Object | / | 占位文本plain_text |
| `initial_option` | 否 | String | / | 初始选中的 open_id须在 options 内 |
| `width` | 否 | String | default | `default` / `fill` / `[100,∞)px` |
| `disabled` | 否 | Boolean | false | 是否禁用 |
| `behaviors` | 否 | Array | / | `[{type:"callback", value:{...}}]` |
| `confirm` | 否 | Object | / | 二次确认弹窗 `{title, text}` |
| `margin` | 否 | String | 0 | 外边距 [-99,99]px |
## 嵌套 / 易错点
- 可嵌套在 column_set / form / collapsible_panel / 循环容器 / interactive_container 内。
- `options[].value` 只接受 **open_id**
- 回调 `action.tag="select_person"` + `action.option`(选中人的 open_id

View File

@ -0,0 +1,43 @@
# 下拉单选 `select_static`
下拉菜单单选。**Card 2.0**。
## 最小示例
```json
{
"tag": "select_static",
"placeholder": { "tag": "plain_text", "content": "请选择" },
"options": [
{ "text": { "tag": "plain_text", "content": "选项1" }, "value": "1" },
{ "text": { "tag": "plain_text", "content": "选项2" }, "value": "2" }
]
}
```
## 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `select_static` |
| `options` | 否 | Array | / | 选项,见下 |
| `options[].text` | 是 | Object | / | 选项名plain_text |
| `options[].value` | 是 | String | / | 选项回调值,**同组件内不可重复** |
| `options[].icon` | 否 | Object | / | 选项前缀图标(同 `div.icon` |
| `name` | 否* | String | / | 唯一标识;**form 内必填且全局唯一** |
| `required` | 否 | Boolean | false | 是否必选form 内生效) |
| `type` | 否 | String | default | `default`(带框) / `text`(纯文本) |
| `placeholder` | 否 | Object | / | 占位文本plain_text |
| `initial_option` | 否 | String | / | 初始选中内容(覆盖 placeholder 和 initial_index |
| `initial_index` | 否 | Int | / | 初始选中序号0=不选1=第一个 |
| `width` | 否 | String | default | `default` / `fill` / `[100,∞)px` |
| `disabled` | 否 | Boolean | false | 是否禁用 |
| `behaviors` | 否 | Array | / | `[{type:"callback", value:{...}}]` |
| `confirm` | 否 | Object | / | 二次确认弹窗 `{title, text}` |
| `margin` | 否 | String | 0 | 外边距 [-99,99]px |
## 嵌套 / 易错点
- 可嵌套在 column_set / form / collapsible_panel / 循环容器 / interactive_container 内。
- 选项 `value` 必须唯一,否则交互异常、服务端无法区分选了哪个。
- 回调 `action.tag="select_static"` + `action.option`(选中项的 value

View File

@ -0,0 +1,53 @@
# 表格 `table`
多列数据表,支持文本/数字/选项/人员/日期等列类型。**Card 2.0**。
## 最小示例
```json
{
"tag": "table",
"columns": [
{ "name": "city", "display_name": "城市", "data_type": "text" },
{ "name": "qty", "display_name": "数量", "data_type": "number" }
],
"rows": [
{ "city": "北京", "qty": 12 },
{ "city": "上海", "qty": 8 }
]
}
```
## 字段
| 字段 | 必填 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
| `tag` | 是 | String | / | 固定 `table` |
| `columns` | 是 | column[] | / | 列定义≤50 列,见下 |
| `rows` | 是 | Object[] | / | 行数据,按 `列name: 值` 填充 |
| `page_size` | 否 | Number | 5 | 每页行数,[1,10] |
| `row_height` | 否 | String | low | `low`/`middle`/`high`/`auto`/`[32,124]px` |
| `row_max_height` | 否 | String | 124px | `row_height:auto` 时最大行高 [32,999]px |
| `freeze_first_column` | 否 | Boolean | false | 冻结首列 |
| `header_style` | 否 | Object | / | 表头样式:`{text_align, text_size, background_style:grey\|none, text_color, bold, lines}` |
| `margin` | 否 | String | 0 | 外边距 [-99,99]px |
**column 字段**`name`(必填,键名) / `display_name`(表头名) / `data_type`(见下) / `width`(`auto`/`[80,600]px`/`%`) / `horizontal_align` / `vertical_align``number` 列可加 `format:{precision, symbol, separator}``date` 列可加 `date_format`(如 `YYYY/MM/DD`)。
**data_type 与行值结构**
| data_type | 行值 |
|---|---|
| `text` | `"飞书"` |
| `lark_md` | `"[链接](https://x)"` |
| `number` | `168.23` |
| `options` | `[{text:"S2", color:"blue"}]`(颜色枚举见 `../resource/colors.md`,文本勿过长) |
| `persons` | `"ou_xxx"``["ou_a","ou_b"]` |
| `date` | `1699341315000`(毫秒时间戳,按本地时区显示) |
| `markdown` | `"![img](img_key)"` 完整 Markdown |
## 嵌套 / 易错点
- **table 只能放卡片根 `body.elements`**:不能被任何容器嵌套,自身也不能嵌别的组件。
- 单卡最多 5 个 table多语言每语言 5 个)。
- `rows` 的键必须与 `columns[].name` 对应。