@infly/ui 1.0.30 → 1.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +799 -799
- package/package.json +2 -2
- package/src/Base/InflyForm/InflyForm.test.js +329 -329
- package/src/Base/InflyForm/InflyForm.vue +986 -986
- package/src/Base/InflyInput/InflyInput.test.js +105 -105
- package/src/Base/InflyInput/InflyInput.vue +167 -167
- package/src/Base/InflyList/InflyList.test.js +229 -229
- package/src/Base/InflyList/InflyList.vue +926 -926
- package/src/Business/BusinessSwitch/BusinessSwitch.test.js +250 -250
- package/src/Business/BusinessTag/BusinessTag.test.js +70 -70
- package/src/Business/InstitutionSelect/InstitutionSelect.test.js +281 -281
package/README.md
CHANGED
|
@@ -1,799 +1,799 @@
|
|
|
1
|
-
# @infly/ui
|
|
2
|
-
|
|
3
|
-
`@infly/ui` 是运营端通用 Vue2 组件库。当前业务页面优先使用 `InflyList`、`InflyForm`、`InflyDialog` 等组件承载筛选、表格、分页、详情展示和弹窗表单。
|
|
4
|
-
|
|
5
|
-
组件内部的框架无关工具来自 `@infly/ts-libs`。依赖 Vue 实例、请求实例或 Element UI 消息能力的全局 mixin 不属于 UI 公共入口;Vue2 应用统一从 `@infly/libs/adapters/vue2/module/` 引入对应适配器。
|
|
6
|
-
|
|
7
|
-
修改 `InflyList` 或 `InflyForm` 时必须同步更新本文档:新增 prop、事件、插槽、字段配置、列类型或表单类型,都要补充至少一个可复制的使用示例。
|
|
8
|
-
|
|
9
|
-
## InflyList
|
|
10
|
-
|
|
11
|
-
`InflyList` 组合了 `el-tabs`、`InflyForm`、`el-table` 和分页。适合“tab + 筛选区 + 操作按钮 + 表格 + 分页”的运营端页面。
|
|
12
|
-
|
|
13
|
-
### 基础示例
|
|
14
|
-
|
|
15
|
-
```vue
|
|
16
|
-
<template>
|
|
17
|
-
<InflyList
|
|
18
|
-
ref="listRef"
|
|
19
|
-
:formData="formData"
|
|
20
|
-
:reqUrl="reqUrl"
|
|
21
|
-
:filterList="filterList"
|
|
22
|
-
:btnList="btnList"
|
|
23
|
-
:columns="columns"
|
|
24
|
-
:dealParams="dealParams"
|
|
25
|
-
:customRender="customRender"
|
|
26
|
-
@tab-change="handleTabChange"
|
|
27
|
-
/>
|
|
28
|
-
</template>
|
|
29
|
-
|
|
30
|
-
<script>
|
|
31
|
-
export default {
|
|
32
|
-
data() {
|
|
33
|
-
return {
|
|
34
|
-
reqUrl: "/admin/reconciliation/bills/",
|
|
35
|
-
formData: { page: 1, pagesize: 10, total: 0 },
|
|
36
|
-
filterList: [
|
|
37
|
-
{ label: "账单年份", name: "bill_year", type: "el-select", options: [{ label: "2026", value: "2026" }], clearable: true },
|
|
38
|
-
{ label: "关键词", name: "keyword", type: "infly-input", placeholder: "账单ID/金额/操作人", clearable: true }
|
|
39
|
-
],
|
|
40
|
-
btnList: [
|
|
41
|
-
{ label: "导出", type: "primary", btnEvent: () => this.exportList() }
|
|
42
|
-
],
|
|
43
|
-
columns: [
|
|
44
|
-
{ label: "账单ID", prop: "id", width: "90px" },
|
|
45
|
-
{ label: "账单金额", prop: "total_consume_amount", type: "render", minWidth: "140px" }
|
|
46
|
-
]
|
|
47
|
-
};
|
|
48
|
-
},
|
|
49
|
-
methods: {
|
|
50
|
-
dealParams(params) {
|
|
51
|
-
return { ...params, keyword: (params.keyword || "").trim() };
|
|
52
|
-
},
|
|
53
|
-
customRender(row, prop) {
|
|
54
|
-
if (prop === "total_consume_amount") return `¥${row[prop] || "0.00"}`;
|
|
55
|
-
return row[prop] || "-";
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
</script>
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### Props
|
|
63
|
-
|
|
64
|
-
| Prop | 类型 | 默认值 | 说明 | 示例 |
|
|
65
|
-
| --- | --- | --- | --- | --- |
|
|
66
|
-
| `formData` | `Object` | 必填 | 查询参数、分页参数和总数容器。组件会写入 `page`、`pagesize`、`total`。 | `:formData="{ page: 1, pagesize: 10, total: 0 }"` |
|
|
67
|
-
| `defaultTabName` | `String` | `""` | 默认激活的一级 tab 名称。 | `:defaultTabName="'billList'"` |
|
|
68
|
-
| `hideTab` | `Boolean` | `false` | 隐藏一级 tab 头部。 | `hideTab` |
|
|
69
|
-
| `tabList` | `Array` | `[{}]` | 一级 tab 配置,直接透传给 `el-tab-pane`;每项可带 `reqUrl`。 | `[{ label: "账单列表", name: "billList", reqUrl: "/admin/reconciliation/bills/" }]` |
|
|
70
|
-
| `filterList` | `Array` | `[]` | 传给 `InflyForm` 的筛选/详情字段配置。 | `[{ label: "关键词", name: "keyword", type: "infly-input" }]` |
|
|
71
|
-
| `columns` | `Array` | 必填 | 表格列配置,支持普通列、操作列、特殊类型、多级表头。 | `[{ label: "ID", prop: "id" }]` |
|
|
72
|
-
| `btnList` | `Array` | `[]` | 顶部操作按钮,传给 `InflyForm`。 | `[{ label: "上传", type: "blue", btnEvent: this.openDialog }]` |
|
|
73
|
-
| `outSideReqParams` | `Object` | `{}` | 额外请求参数,每次请求合并到 `formData` 后。 | `:outSideReqParams="{ bill_id: billId }"` |
|
|
74
|
-
| `reqUrl` | `String` | `""` | 列表接口地址;为空时会尝试使用当前 tab 的 `reqUrl`。 | `reqUrl="/admin/reconciliation/logs/"` |
|
|
75
|
-
| `reqMethod` | `String` | `"get"` | 请求方法,使用 `this.$axios[reqMethod]`。 | `reqMethod="post"` |
|
|
76
|
-
| `defaultInit` | `Boolean` | `true` | 创建后是否自动请求。详情页常设为 `false`,待详情信息加载后手动请求。 | `:defaultInit="false"` |
|
|
77
|
-
| `dealParams` | `Function` | `null` | 请求前处理参数,返回对象会替换最终参数。 | `:dealParams="(params) => ({ ...params, status: params.status || undefined })"` |
|
|
78
|
-
| `dealRes` | `Function` | `null` | 请求后处理响应,返回对象会作为最终响应。 | `:dealRes="(res) => ({ lists: res.data, counts: res.total })"` |
|
|
79
|
-
| `initEventName` | `String` | `"initData"` | 查询后额外 emit 的事件名。 | `initEventName="refresh"` |
|
|
80
|
-
| `hideDivider` | `Boolean` | `false` | 隐藏筛选区和表格之间的分隔线。 | `hideDivider` |
|
|
81
|
-
| `isInnerList` | `Boolean` | `false` | 内嵌列表样式。 | `isInnerList` |
|
|
82
|
-
| `isTopList` | `Boolean` | `true` | 页面顶部列表样式。 | `:isTopList="false"` |
|
|
83
|
-
| `hideEmptyTag` | `Boolean` | `false` | `el-tag` 列为空时不渲染 tag。 | `hideEmptyTag` |
|
|
84
|
-
| `hideJumpPageButton` | `Boolean` | `false` | 隐藏分页右侧“跳转”按钮。 | `hideJumpPageButton` |
|
|
85
|
-
| `customRender` | `Function` | 取 `row[prop]` | `type: "render"`、`custom`、`el-popover` 的统一渲染函数,可返回字符串或 VNode。 | `customRender(row, prop) { return row[prop] || "-" }` |
|
|
86
|
-
| `tableProps` | `Object` | `{}` | 透传给 `el-table`,也支持 `dataList` 覆盖内部请求数据。 | `:tableProps="{ stripe: true, dataList: localRows }"` |
|
|
87
|
-
| `formProps` | `Object` | `{ "label-width": "80px" }` | 透传给内部 `InflyForm`。 | `:formProps="{ layout: 'inline-seamless', 'label-width': '120px' }"` |
|
|
88
|
-
| `emptyText` | `String` | `""` | 普通单元格空值文案。 | `emptyText="-"` |
|
|
89
|
-
| `tabsProps` | `Object` | `{ type: "border-card" }` | 透传给 `el-tabs`。 | `:tabsProps="{ type: '' }"` |
|
|
90
|
-
|
|
91
|
-
### 事件
|
|
92
|
-
|
|
93
|
-
| 事件 | 触发时机 | 示例 |
|
|
94
|
-
| --- | --- | --- |
|
|
95
|
-
| `initData` | 调用 `initData()` 后触发;名称可由 `initEventName` 改写。 | `@initData="afterSearch"` |
|
|
96
|
-
| `tab-change` / `tabChange` | 一级 tab 切换时触发,参数包含原始 tab 配置和 `activityTab`。 | `@tab-change="handleTabChange"` |
|
|
97
|
-
| `sec-tab-change` / `secTabChange` | 内部 `InflyForm` 的 `secTab` 切换时触发。 | `@secTabChange="handleSecTabChange"` |
|
|
98
|
-
| `request-error` | 请求异常或请求方法不支持时触发。 | `@request-error="handleError"` |
|
|
99
|
-
| `request-timeout` | 单次请求超过 60 秒时触发。 | `@request-timeout="handleTimeout"` |
|
|
100
|
-
|
|
101
|
-
### 插槽
|
|
102
|
-
|
|
103
|
-
| 插槽 | 位置 | 示例 |
|
|
104
|
-
| --- | --- | --- |
|
|
105
|
-
| `pretop` | `el-tabs` 内、tab pane 前。 | `<template #pretop><div>顶部说明</div></template>` |
|
|
106
|
-
| `prepend` | 每个 tab pane 的表单前。 | `<template #prepend><div class="tips">说明</div></template>` |
|
|
107
|
-
| `replace` | 替换表单、分隔线、表格和分页整体。 | `<template #replace>自定义完整内容</template>` |
|
|
108
|
-
| `replaceTable` | 只替换表格和分页。 | `<template #replaceTable><CustomTable /></template>` |
|
|
109
|
-
| `customRender` | 传给 `InflyForm` 的 `type: "customRender"` 字段。 | `<template #customRender="{ item }"><MyInput :item="item" /></template>` |
|
|
110
|
-
| `expand` | `type: "expand"` 展开列内容。 | `<template #expand="{ row }">{{ row.detail }}</template>` |
|
|
111
|
-
| `[prop]` | 表格列同名具名插槽,优先级高于列 `type`。 | `<template #status="{ row }"><el-tag>{{ row.status_str }}</el-tag></template>` |
|
|
112
|
-
|
|
113
|
-
### 列配置
|
|
114
|
-
|
|
115
|
-
列配置会把内部字段之外的属性透传给 `el-table-column`,例如 `label`、`prop`、`width`、`minWidth`、`fixed`、`sortable`、`showOverflowTooltip`。默认 `align` 为 `center`。
|
|
116
|
-
|
|
117
|
-
内部字段包括:`children`、`columns`、`type`、`buttonList`、`className`、`isHide`、`click`、`options`、`optionKeyField`、`optionValueField`、`propValueField`、`mapField`、`render`。
|
|
118
|
-
|
|
119
|
-
#### 普通列
|
|
120
|
-
|
|
121
|
-
```js
|
|
122
|
-
columns: [
|
|
123
|
-
{ label: "账单ID", prop: "id", width: "90px" },
|
|
124
|
-
{ label: "所属机构", prop: "level_name", minWidth: "150px", showOverflowTooltip: true }
|
|
125
|
-
]
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
#### 默认列:selection、index、expand
|
|
129
|
-
|
|
130
|
-
```js
|
|
131
|
-
columns: [
|
|
132
|
-
{ type: "selection", width: 55 },
|
|
133
|
-
{ type: "index", label: "序号", width: 70 },
|
|
134
|
-
{ type: "expand", width: 50 },
|
|
135
|
-
{ label: "名称", prop: "name" }
|
|
136
|
-
]
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
```vue
|
|
140
|
-
<InflyList :formData="formData" v-bind="pageConfig">
|
|
141
|
-
<template #expand="{ row }">
|
|
142
|
-
<pre>{{ row }}</pre>
|
|
143
|
-
</template>
|
|
144
|
-
</InflyList>
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
#### `type: "render"` / `custom`
|
|
148
|
-
|
|
149
|
-
```js
|
|
150
|
-
columns: [
|
|
151
|
-
{ label: "消耗金额(含税)", prop: "total_consume_amount_with_tax", type: "render" }
|
|
152
|
-
],
|
|
153
|
-
customRender(row, prop) {
|
|
154
|
-
return `<span class="text-red">¥${row[prop] || "0.00"}</span>`;
|
|
155
|
-
}
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
#### `type: "el-tag"`
|
|
159
|
-
|
|
160
|
-
```js
|
|
161
|
-
columns: [
|
|
162
|
-
{
|
|
163
|
-
label: "状态",
|
|
164
|
-
prop: "status",
|
|
165
|
-
type: "el-tag",
|
|
166
|
-
options: [
|
|
167
|
-
{ value: "pending", name: "待处理", tagType: "info" },
|
|
168
|
-
{ value: "completed", name: "完成", tagType: "success" },
|
|
169
|
-
{ value: "failed", name: "失败", tagType: "danger" }
|
|
170
|
-
]
|
|
171
|
-
}
|
|
172
|
-
]
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
#### 操作列:`type: "el-button"` 或 `buttonList`
|
|
176
|
-
|
|
177
|
-
`buttonList` 每一项除 `name`、`label`、`className`、`isShow`、`isHide`、`click`、`btnEvent` 外,其余属性会透传给 `el-button`,例如 `size`、`plain`、`disabled`、`loading`、`icon`。
|
|
178
|
-
|
|
179
|
-
```js
|
|
180
|
-
columns: [
|
|
181
|
-
{
|
|
182
|
-
label: "操作",
|
|
183
|
-
prop: "action",
|
|
184
|
-
type: "el-button",
|
|
185
|
-
fixed: "right",
|
|
186
|
-
width: "120px",
|
|
187
|
-
buttonList: [
|
|
188
|
-
{
|
|
189
|
-
name: "查看详情",
|
|
190
|
-
type: "text",
|
|
191
|
-
size: "mini",
|
|
192
|
-
className: "text-blue",
|
|
193
|
-
disabled: false,
|
|
194
|
-
isShow: (row) => row.status !== "deleted",
|
|
195
|
-
click: (row) => this.goDetail(row)
|
|
196
|
-
}
|
|
197
|
-
]
|
|
198
|
-
}
|
|
199
|
-
]
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
#### `type: "el-image"`
|
|
203
|
-
|
|
204
|
-
```js
|
|
205
|
-
columns: [
|
|
206
|
-
{ label: "图片", prop: "cover_url", type: "el-image", width: 80, fit: "cover" }
|
|
207
|
-
]
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
#### 多级表头
|
|
211
|
-
|
|
212
|
-
支持 `children` 或 `columns`,叶子列继续使用普通列能力。
|
|
213
|
-
|
|
214
|
-
```js
|
|
215
|
-
columns: [
|
|
216
|
-
{ label: "日期", prop: "date", width: 150 },
|
|
217
|
-
{
|
|
218
|
-
label: "配送信息",
|
|
219
|
-
children: [
|
|
220
|
-
{ label: "姓名", prop: "name", width: 120 },
|
|
221
|
-
{
|
|
222
|
-
label: "地址",
|
|
223
|
-
columns: [
|
|
224
|
-
{ label: "省份", prop: "province", width: 120 },
|
|
225
|
-
{ label: "市区", prop: "city", width: 120 },
|
|
226
|
-
{ label: "地址", prop: "address", minWidth: 200, showOverflowTooltip: true }
|
|
227
|
-
]
|
|
228
|
-
}
|
|
229
|
-
]
|
|
230
|
-
}
|
|
231
|
-
]
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
### 常用页面模式
|
|
235
|
-
|
|
236
|
-
#### 一级 tab 切换不同接口和列
|
|
237
|
-
|
|
238
|
-
```js
|
|
239
|
-
pageConfig() {
|
|
240
|
-
return {
|
|
241
|
-
reqUrl: this.currentTabConfig.reqUrl,
|
|
242
|
-
tabList: [
|
|
243
|
-
{ label: "账单列表", name: "billList" },
|
|
244
|
-
{ label: "操作日志", name: "processLog" }
|
|
245
|
-
],
|
|
246
|
-
filterList: this.currentTabConfig.filterList,
|
|
247
|
-
btnList: this.currentTabConfig.btnList,
|
|
248
|
-
columns: this.currentTabConfig.columns
|
|
249
|
-
};
|
|
250
|
-
},
|
|
251
|
-
methods: {
|
|
252
|
-
handleTabChange({ name }) {
|
|
253
|
-
this.activeTab = name;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
#### 本地数据表格
|
|
259
|
-
|
|
260
|
-
```vue
|
|
261
|
-
<InflyList
|
|
262
|
-
:formData="{ page: 1, pagesize: 10, total: rows.length }"
|
|
263
|
-
:defaultInit="false"
|
|
264
|
-
:columns="columns"
|
|
265
|
-
:tableProps="{ dataList: rows, stripe: true }"
|
|
266
|
-
/>
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
#### 替换表格区域
|
|
270
|
-
|
|
271
|
-
```vue
|
|
272
|
-
<InflyList :formData="formData" v-bind="pageConfig">
|
|
273
|
-
<template #replaceTable>
|
|
274
|
-
<CustomDistributionTable :rows="rows" />
|
|
275
|
-
</template>
|
|
276
|
-
</InflyList>
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
## InflyForm
|
|
280
|
-
|
|
281
|
-
`InflyForm` 是动态表单/详情展示组件。编辑态下根据 `filterList` 渲染输入控件;非编辑态下渲染文本、tag、链接或自定义内容。`InflyList` 内部的筛选区也是使用该组件。
|
|
282
|
-
|
|
283
|
-
### 基础示例
|
|
284
|
-
|
|
285
|
-
```vue
|
|
286
|
-
<template>
|
|
287
|
-
<InflyForm
|
|
288
|
-
ref="formRef"
|
|
289
|
-
:formData="formData"
|
|
290
|
-
:filterList="filterList"
|
|
291
|
-
:btnList="btnList"
|
|
292
|
-
layout="inline"
|
|
293
|
-
label-width="100px"
|
|
294
|
-
@initData="search"
|
|
295
|
-
@reset-form="resetForm"
|
|
296
|
-
/>
|
|
297
|
-
</template>
|
|
298
|
-
|
|
299
|
-
<script>
|
|
300
|
-
export default {
|
|
301
|
-
data() {
|
|
302
|
-
return {
|
|
303
|
-
formData: { keyword: "", status: "" },
|
|
304
|
-
filterList: [
|
|
305
|
-
{ label: "关键词", name: "keyword", type: "infly-input", placeholder: "请输入关键词", clearable: true },
|
|
306
|
-
{ label: "状态", name: "status", type: "el-select", options: [{ label: "启用", value: "enabled" }], clearable: true }
|
|
307
|
-
],
|
|
308
|
-
btnList: [
|
|
309
|
-
{ label: "导出", type: "primary", btnEvent: () => this.exportData() }
|
|
310
|
-
]
|
|
311
|
-
};
|
|
312
|
-
}
|
|
313
|
-
};
|
|
314
|
-
</script>
|
|
315
|
-
```
|
|
316
|
-
|
|
317
|
-
### Props
|
|
318
|
-
|
|
319
|
-
| Prop | 类型 | 默认值 | 说明 | 示例 |
|
|
320
|
-
| --- | --- | --- | --- | --- |
|
|
321
|
-
| `formClass` | `String` | `""` | 追加到内部 `el-form` 的 class。 | `formClass="reconciliation-summary-form"` |
|
|
322
|
-
| `layout` | `String \| Array` | `""` | 表单布局 class,支持 `inline`、`inline-seamless`、`compact`,可传数组组合。 | `layout="inline-seamless"` |
|
|
323
|
-
| `formData` | `Object` | 必填 | 表单数据对象,字段通过 `name` 双向绑定。 | `:formData="{ keyword: '' }"` |
|
|
324
|
-
| `formRef` | `String` | `"formRef"` | 内部 `el-form` ref 名称,供 `validate()` 等方法使用。 | `formRef="searchFormRef"` |
|
|
325
|
-
| `btnList` | `Array` | `[]` | 表单上方按钮列表。 | `[{ label: "上传", type: "blue", btnEvent: this.openDialog }]` |
|
|
326
|
-
| `filterList` | `Array` | `[]` | 表单字段配置。 | `[{ label: "名称", name: "name", type: "infly-input" }]` |
|
|
327
|
-
| `reqParams` | `Object` | `{}` | 当前请求参数,导出按钮会从中取参数。通常由 `InflyList` 传入。 | `:reqParams="{ keyword: formData.keyword }"` |
|
|
328
|
-
| `request` | `Function` | `null` | 导出按钮使用的请求实例。导出请求优先级为按钮 `exportFunc`、`request` prop、组件实例 `this.$axios`。 | `:request="$axios"` |
|
|
329
|
-
| `hideSearchBtn` | `Boolean` | `false` | 隐藏底部默认“查询”按钮。 | `hideSearchBtn` |
|
|
330
|
-
| `hideResetBtn` | `Boolean` | `true` | 隐藏底部默认“重置”按钮。默认隐藏。 | `:hideResetBtn="false"` |
|
|
331
|
-
| `isEdit` | `Boolean \| null` | `null` | 强制编辑/展示态;为 `null` 时按路由 `mode` 判断。 | `:isEdit="false"` |
|
|
332
|
-
| `optBtnList` | `Array` | `[]` | 底部查询/重置后的附加按钮。 | `:optBtnList="[{ label: '保存', type: 'primary', btnEvent: 'submit' }]"` |
|
|
333
|
-
| `btnWrapDirection` | `String` | `"row"` | 顶部按钮排列方向 class。 | `btnWrapDirection="column"` |
|
|
334
|
-
| `btnWrapClass` | `String` | `""` | 底部按钮容器追加 class。 | `btnWrapClass="dialog-footer"` |
|
|
335
|
-
| `baseButtonsLeft` | `String` | `"420px"` | 底部按钮距离 label 后的偏移基准。 | `baseButtonsLeft="260px"` |
|
|
336
|
-
| `emptyStr` | `String` | `"-"` | 非编辑态空值展示。 | `emptyStr="暂无"` |
|
|
337
|
-
|
|
338
|
-
`InflyForm` 还会把未声明的属性透传给 `el-form`,例如 `label-width`、`label-suffix`、`rules`、`size`。
|
|
339
|
-
|
|
340
|
-
```vue
|
|
341
|
-
<InflyForm
|
|
342
|
-
:formData="formData"
|
|
343
|
-
:filterList="filterList"
|
|
344
|
-
label-width="120px"
|
|
345
|
-
label-suffix=":"
|
|
346
|
-
size="small"
|
|
347
|
-
/>
|
|
348
|
-
```
|
|
349
|
-
|
|
350
|
-
### 事件
|
|
351
|
-
|
|
352
|
-
| 事件 | 触发时机 | 示例 |
|
|
353
|
-
| --- | --- | --- |
|
|
354
|
-
| `initData` | 底部默认“查询”按钮点击。 | `@initData="search"` |
|
|
355
|
-
| `reset-form` | 底部默认“重置”按钮点击,参数为初始表单快照。 | `@reset-form="(data) => Object.assign(formData, data)"` |
|
|
356
|
-
| `submit` | 按钮 `btnEvent: "submit"` 且校验通过。 | `@submit="submitForm"` |
|
|
357
|
-
| `secTabChange` / `sec-tab-change` | `type: "secTab"` 切换。 | `@secTabChange="handleSecTabChange"` |
|
|
358
|
-
| `export-request-error` | 导出按钮配置了 `exportUrl` 但没有可用请求实例时触发。 | `@export-request-error="handleExportRequestError"` |
|
|
359
|
-
| 自定义事件 | `btnEvent` 为字符串时直接 emit。 | `{ label: "保存", btnEvent: "save" }` + `@save="save"` |
|
|
360
|
-
|
|
361
|
-
### 方法
|
|
362
|
-
|
|
363
|
-
| 方法 | 说明 | 示例 |
|
|
364
|
-
| --- | --- | --- |
|
|
365
|
-
| `getFormInstance()` | 返回内部 `el-form` 实例。 | `this.$refs.formRef.getFormInstance()` |
|
|
366
|
-
| `validate(callback)` | 调用内部 `el-form.validate`。 | `await this.$refs.formRef.validate()` |
|
|
367
|
-
| `clearValidate(props)` | 清除校验。 | `this.$refs.formRef.clearValidate(["name"])` |
|
|
368
|
-
| `validateField(props, callback)` | 校验指定字段。 | `this.$refs.formRef.validateField("name")` |
|
|
369
|
-
| `resetFormData()` | 触发 `reset-form`,并清理 `InstitutionSelect`。 | `this.$refs.formRef.resetFormData()` |
|
|
370
|
-
|
|
371
|
-
### 插槽
|
|
372
|
-
|
|
373
|
-
| 插槽 | 位置 | 示例 |
|
|
374
|
-
| --- | --- | --- |
|
|
375
|
-
| `prepend` | 表单整体前。 | `<template #prepend><div>说明</div></template>` |
|
|
376
|
-
| `append` | 表单整体后。 | `<template #append><div>底部说明</div></template>` |
|
|
377
|
-
| `customRender` | 字段 `type: "customRender"` 时渲染。 | `<template #customRender="{ item }"><MyField :item="item" /></template>` |
|
|
378
|
-
|
|
379
|
-
### filterList 字段配置
|
|
380
|
-
|
|
381
|
-
字段配置会拆分函数类型属性:除 `isHide`、`isShow`、`labelRender` 和 `el-upload` 回调外,函数属性会作为事件监听传给内部控件。
|
|
382
|
-
|
|
383
|
-
| 字段 | 说明 | 示例 |
|
|
384
|
-
| --- | --- | --- |
|
|
385
|
-
| `label` | 表单项 label。 | `{ label: "关键词" }` |
|
|
386
|
-
| `labelRender` | 自定义 label,支持 JSX 元素(VNode 对象)或函数 `(value, formData) => 字符串/VNode`;存在时整体替换 `label` 文本,`label-suffix` 由自己处理。 | `{ label: "关键词", labelRender: (<span>关键词 <i class="el-icon-question" /></span>) }` |
|
|
387
|
-
| `name` | 绑定字段名;日期范围可传数组。 | `{ name: "keyword" }`、`{ name: ["start", "end"], type: "daterange" }` |
|
|
388
|
-
| `prop` | 未传 `name` 时作为字段名。 | `{ prop: "keyword", type: "infly-input" }` |
|
|
389
|
-
| `type` | 控件类型或展示类型。 | `{ type: "el-select" }` |
|
|
390
|
-
| `options` | 选择类控件选项。 | `{ options: [{ label: "启用", value: 1 }] }` |
|
|
391
|
-
| `required` | 是否显示必填标记。 | `{ required: true }` |
|
|
392
|
-
| `rules` | 当前字段校验规则。 | `{ rules: [{ required: true, message: "请输入名称" }] }` |
|
|
393
|
-
| `isHide` | 隐藏条件,布尔值或函数。 | `{ isHide: (form) => form.type !== "coupon" }` |
|
|
394
|
-
| `isShow` | 显示条件,布尔值或函数。 | `{ isShow: (form) => form.enabled }` |
|
|
395
|
-
| `mode` | 单项强制编辑态。 | `{ mode: "edit" }` |
|
|
396
|
-
| `formItemClass` | 当前 `el-form-item` 追加 class。 | `{ formItemClass: "summary-tax-line" }` |
|
|
397
|
-
| `nowrap` | 给当前项追加不换行 class。 | `{ nowrap: true }` |
|
|
398
|
-
| `position` | 双列定位布局,支持 `left`、`right`、`full`。 | `{ label: "备注", name: "remark", type: "render", position: "full" }` |
|
|
399
|
-
| `valuePrefix` | 非编辑态展示前缀。 | `{ valuePrefix: "¥" }` |
|
|
400
|
-
| `optionConfig` | 自定义选项取值和展示。 | `{ optionConfig: { labelKey: "name", valueKey: "id" } }` |
|
|
401
|
-
| `radioType` | `el-radio-group` 内部单选组件,默认 `el-radio`。 | `{ type: "el-radio-group", radioType: "el-radio-button" }` |
|
|
402
|
-
| 其他属性 | 透传给内部控件或 `el-form-item`。 | `{ placeholder: "请输入", clearable: true }` |
|
|
403
|
-
|
|
404
|
-
### 支持的字段类型
|
|
405
|
-
|
|
406
|
-
#### 自定义 label:`labelRender`
|
|
407
|
-
|
|
408
|
-
`labelRender` 支持两种形式,二选一:
|
|
409
|
-
|
|
410
|
-
1. **VNode 对象(JSX 元素)**:直接写 JSX,静态渲染;
|
|
411
|
-
2. **函数**:`(value, formData) => 字符串或 VNode`,返回字符串时以行内元素渲染(注意 XSS:内容需转义或来自可信数据源),返回 VNode 可依赖 `formData` 动态渲染。
|
|
412
|
-
|
|
413
|
-
两种形式都会**整体替换 `label` 文本**(element-ui label 插槽语义),需要显示文本时请把文本包含在 JSX 内。`.vue` 文件 script 中的 JSX 由构建链(`@infly/vue2-vite`)自动转换并注入 `h`,无需手动引入;`labelRender` 函数没有组件 `this` 上下文,不能使用 `this.$createElement`。
|
|
414
|
-
|
|
415
|
-
```jsx
|
|
416
|
-
filterList: [
|
|
417
|
-
// 形式一:VNode 对象(静态)
|
|
418
|
-
{
|
|
419
|
-
label: "订单推送状态",
|
|
420
|
-
prop: "settlement_state",
|
|
421
|
-
type: "infly-checkbox",
|
|
422
|
-
labelRender: (
|
|
423
|
-
<span>
|
|
424
|
-
订单推送状态
|
|
425
|
-
<el-popover placement="top" width={200} trigger="hover" content="这是一段解释文案">
|
|
426
|
-
<i slot="reference" class="el-icon-question" style="margin-left: 4px" />
|
|
427
|
-
</el-popover>
|
|
428
|
-
</span>
|
|
429
|
-
)
|
|
430
|
-
},
|
|
431
|
-
// 形式二:函数(可动态渲染)
|
|
432
|
-
{
|
|
433
|
-
label: "活动名称",
|
|
434
|
-
name: "activity_name",
|
|
435
|
-
labelRender: (value, formData) => (
|
|
436
|
-
<span>
|
|
437
|
-
<i class="el-icon-s-opportunity" style="margin-right: 4px" />
|
|
438
|
-
活动名称
|
|
439
|
-
<el-popover placement="top" width={200} trigger="hover">
|
|
440
|
-
<span>这里是解释文案</span>
|
|
441
|
-
<i slot="reference" class="el-icon-question" style="margin-left: 4px" />
|
|
442
|
-
</el-popover>
|
|
443
|
-
</span>
|
|
444
|
-
)
|
|
445
|
-
}
|
|
446
|
-
]
|
|
447
|
-
```
|
|
448
|
-
|
|
449
|
-
#### 输入框:`infly-input` / `InflyInput` / `textarea` / `infly-input-number` / `el-autocomplete`
|
|
450
|
-
|
|
451
|
-
```js
|
|
452
|
-
filterList: [
|
|
453
|
-
{ label: "关键词", name: "keyword", type: "infly-input", placeholder: "请输入关键词", clearable: true },
|
|
454
|
-
{ label: "备注", name: "remark", type: "textarea", rows: 3, maxlength: 50, showWordLimit: true }
|
|
455
|
-
]
|
|
456
|
-
```
|
|
457
|
-
|
|
458
|
-
#### 选择器:`el-select`
|
|
459
|
-
|
|
460
|
-
```js
|
|
461
|
-
filterList: [
|
|
462
|
-
{
|
|
463
|
-
label: "账单月份",
|
|
464
|
-
name: "bill_month",
|
|
465
|
-
type: "el-select",
|
|
466
|
-
options: [{ label: "05", value: "05" }],
|
|
467
|
-
clearable: true,
|
|
468
|
-
placeholder: "请选择账单月份"
|
|
469
|
-
}
|
|
470
|
-
]
|
|
471
|
-
```
|
|
472
|
-
|
|
473
|
-
#### 日期:`date` / `month` / `year` / `datetime` / `daterange` / `datetimerange` / `el-time-picker`
|
|
474
|
-
|
|
475
|
-
```js
|
|
476
|
-
filterList: [
|
|
477
|
-
{ label: "账单年份", name: "bill_year", type: "year", valueFormat: "yyyy", format: "yyyy", placeholder: "请选择年份" },
|
|
478
|
-
{ label: "账单年月", name: "bill_month", type: "month", valueFormat: "yyyy-MM", placeholder: "请选择月份" },
|
|
479
|
-
{ label: "账单周期", name: ["period_start", "period_end"], type: "daterange" }
|
|
480
|
-
]
|
|
481
|
-
```
|
|
482
|
-
|
|
483
|
-
数组形式的 `name` 会自动把 `period_start`、`period_end` 与内部范围值同步。
|
|
484
|
-
|
|
485
|
-
#### 机构选择:`institution-select` / `InstitutionSelect`
|
|
486
|
-
|
|
487
|
-
```js
|
|
488
|
-
filterList: [
|
|
489
|
-
{
|
|
490
|
-
label: "所属省份",
|
|
491
|
-
name: "province_level_id",
|
|
492
|
-
type: "institution-select",
|
|
493
|
-
title: "选择省份",
|
|
494
|
-
btnText: "选择",
|
|
495
|
-
request: this.$axios,
|
|
496
|
-
reqModule: "admin",
|
|
497
|
-
levelTypes: "1",
|
|
498
|
-
levelNameKey: "province_level_name_filter",
|
|
499
|
-
hideTips: true
|
|
500
|
-
}
|
|
501
|
-
]
|
|
502
|
-
```
|
|
503
|
-
|
|
504
|
-
`InstitutionSelect` 请求实例优先使用 `request` prop,其次使用组件实例 `this.$axios`。默认接口为 `/${reqModule}/level/`,也可以通过 `reqUrl` 显式覆盖;组件不再读取外部工具库的环境信息推导 `reqModule`。
|
|
505
|
-
|
|
506
|
-
#### 复选:`infly-checkbox` / `InflyCheckBox`
|
|
507
|
-
|
|
508
|
-
```js
|
|
509
|
-
filterList: [
|
|
510
|
-
{
|
|
511
|
-
label: "处理结果",
|
|
512
|
-
name: "process_result",
|
|
513
|
-
type: "infly-checkbox",
|
|
514
|
-
options: [
|
|
515
|
-
{ label: "成功", value: "success" },
|
|
516
|
-
{ label: "失败", value: "failed" }
|
|
517
|
-
]
|
|
518
|
-
}
|
|
519
|
-
]
|
|
520
|
-
```
|
|
521
|
-
|
|
522
|
-
#### 单选:`el-radio-group`
|
|
523
|
-
|
|
524
|
-
```js
|
|
525
|
-
filterList: [
|
|
526
|
-
{
|
|
527
|
-
label: "类型",
|
|
528
|
-
name: "type",
|
|
529
|
-
type: "el-radio-group",
|
|
530
|
-
radioType: "el-radio-button",
|
|
531
|
-
options: [
|
|
532
|
-
{ name: "全部", value: "" },
|
|
533
|
-
{ name: "已启用", value: "enabled" }
|
|
534
|
-
]
|
|
535
|
-
}
|
|
536
|
-
]
|
|
537
|
-
```
|
|
538
|
-
|
|
539
|
-
#### 上传:`el-upload`
|
|
540
|
-
|
|
541
|
-
```js
|
|
542
|
-
filterList: [
|
|
543
|
-
{
|
|
544
|
-
label: "活动列表",
|
|
545
|
-
name: "activity_file",
|
|
546
|
-
type: "el-upload",
|
|
547
|
-
action: "",
|
|
548
|
-
drag: true,
|
|
549
|
-
accept: ".xlsx",
|
|
550
|
-
tips: "仅支持 .xlsx 文件",
|
|
551
|
-
"on-change": this.handleFileChange,
|
|
552
|
-
"auto-upload": false,
|
|
553
|
-
"file-list": this.activityFileList
|
|
554
|
-
}
|
|
555
|
-
]
|
|
556
|
-
```
|
|
557
|
-
|
|
558
|
-
`el-upload` 的回调函数保留为属性整体透传,适配 Element UI 的 `on-change`、`on-remove` 等写法。
|
|
559
|
-
|
|
560
|
-
#### 展示态文本:`text`
|
|
561
|
-
|
|
562
|
-
```js
|
|
563
|
-
filterList: [
|
|
564
|
-
{ label: "账单ID", name: "id", type: "text" }
|
|
565
|
-
]
|
|
566
|
-
```
|
|
567
|
-
|
|
568
|
-
当 `isEdit=false` 或路由 `mode` 非编辑态时,显示 `formData[name + "_str"]` 优先,其次显示 `formData[name]`。
|
|
569
|
-
|
|
570
|
-
#### 分组标题:`module`
|
|
571
|
-
|
|
572
|
-
`module` 用于只显示分组标题。表单内存在 `module` 时,普通字段会继承 `label-suffix`,`module` 自身不展示后缀和字段值。
|
|
573
|
-
|
|
574
|
-
```js
|
|
575
|
-
filterList: [
|
|
576
|
-
{ label: "基础信息", type: "module" },
|
|
577
|
-
{ label: "活动名称", name: "activity_name", type: "infly-input", required: true }
|
|
578
|
-
]
|
|
579
|
-
```
|
|
580
|
-
|
|
581
|
-
#### 业务开关:`BusinessSwitch` / `business-switch`
|
|
582
|
-
|
|
583
|
-
```js
|
|
584
|
-
filterList: [
|
|
585
|
-
{
|
|
586
|
-
label: "启用状态",
|
|
587
|
-
name: "enabled",
|
|
588
|
-
type: "business-switch",
|
|
589
|
-
activeValue: true,
|
|
590
|
-
inactiveValue: false,
|
|
591
|
-
render: (value) => (value ? "已启用" : "已停用")
|
|
592
|
-
}
|
|
593
|
-
]
|
|
594
|
-
```
|
|
595
|
-
|
|
596
|
-
#### 展示态链接:`router-link`
|
|
597
|
-
|
|
598
|
-
`router-link` 只在非编辑态渲染,其他属性会透传给 Vue Router 的 `router-link`。
|
|
599
|
-
|
|
600
|
-
```js
|
|
601
|
-
filterList: [
|
|
602
|
-
{
|
|
603
|
-
label: "详情页",
|
|
604
|
-
name: "detail_text",
|
|
605
|
-
type: "router-link",
|
|
606
|
-
to: { path: "/reconciliation/detail", query: { id: this.formData.id } }
|
|
607
|
-
}
|
|
608
|
-
]
|
|
609
|
-
```
|
|
610
|
-
|
|
611
|
-
#### 展示态 tag:`el-tag`
|
|
612
|
-
|
|
613
|
-
```js
|
|
614
|
-
filterList: [
|
|
615
|
-
{
|
|
616
|
-
label: "状态",
|
|
617
|
-
name: "status_str",
|
|
618
|
-
type: "el-tag",
|
|
619
|
-
propValueField: "status",
|
|
620
|
-
options: [
|
|
621
|
-
{ value: "completed", tagType: "success" },
|
|
622
|
-
{ value: "failed", tagType: "danger" }
|
|
623
|
-
]
|
|
624
|
-
}
|
|
625
|
-
]
|
|
626
|
-
```
|
|
627
|
-
|
|
628
|
-
#### 自定义展示:`render`
|
|
629
|
-
|
|
630
|
-
```js
|
|
631
|
-
filterList: [
|
|
632
|
-
{
|
|
633
|
-
label: "消耗金额(含税)",
|
|
634
|
-
name: "total_consume_amount_with_tax",
|
|
635
|
-
type: "render",
|
|
636
|
-
render: (value) => `<span class="text-red">¥${value || "0.00"}</span>`
|
|
637
|
-
}
|
|
638
|
-
]
|
|
639
|
-
```
|
|
640
|
-
|
|
641
|
-
`render` 可返回字符串或 VNode。字符串会通过 `v-html` 渲染,调用方必须确保内容可信或已转义。
|
|
642
|
-
|
|
643
|
-
#### 自定义插槽:`customRender`
|
|
644
|
-
|
|
645
|
-
```vue
|
|
646
|
-
<InflyForm :formData="formData" :filterList="filterList">
|
|
647
|
-
<template #customRender="{ item }">
|
|
648
|
-
<CustomUploader :config="item" />
|
|
649
|
-
</template>
|
|
650
|
-
</InflyForm>
|
|
651
|
-
```
|
|
652
|
-
|
|
653
|
-
```js
|
|
654
|
-
filterList: [
|
|
655
|
-
{ label: "附件", name: "files", type: "customRender" }
|
|
656
|
-
]
|
|
657
|
-
```
|
|
658
|
-
|
|
659
|
-
#### 二级 tab:`secTab`
|
|
660
|
-
|
|
661
|
-
适合详情页“基础信息 + 下方明细 tab”的结构。`secTab` 项会插入到它在 `filterList` 中出现的位置,激活 tab 的 `filterList` 会跟在 tab 后面。
|
|
662
|
-
|
|
663
|
-
```js
|
|
664
|
-
filterList: [
|
|
665
|
-
{ label: "账单ID", name: "id", type: "text", position: "left" },
|
|
666
|
-
{
|
|
667
|
-
label: "订单明细",
|
|
668
|
-
name: "orders",
|
|
669
|
-
type: "secTab",
|
|
670
|
-
buttonList: [
|
|
671
|
-
{ name: "导出订单明细", type: "primary", click: () => this.exportDetail("orders") }
|
|
672
|
-
],
|
|
673
|
-
filterList: [
|
|
674
|
-
{ label: "订单号查询", name: "empower_order_id", type: "infly-input", position: "full", clearable: true }
|
|
675
|
-
]
|
|
676
|
-
},
|
|
677
|
-
{
|
|
678
|
-
label: "消耗明细",
|
|
679
|
-
name: "consumes",
|
|
680
|
-
type: "secTab",
|
|
681
|
-
filterList: [
|
|
682
|
-
{ label: "关键词搜索", name: "keyword", type: "infly-input", position: "full", clearable: true }
|
|
683
|
-
]
|
|
684
|
-
}
|
|
685
|
-
]
|
|
686
|
-
```
|
|
687
|
-
|
|
688
|
-
### 布局示例
|
|
689
|
-
|
|
690
|
-
#### 行内筛选
|
|
691
|
-
|
|
692
|
-
```vue
|
|
693
|
-
<InflyForm
|
|
694
|
-
:formData="formData"
|
|
695
|
-
:filterList="filterList"
|
|
696
|
-
layout="inline"
|
|
697
|
-
label-width="100px"
|
|
698
|
-
/>
|
|
699
|
-
```
|
|
700
|
-
|
|
701
|
-
#### 无缝行内详情
|
|
702
|
-
|
|
703
|
-
```vue
|
|
704
|
-
<InflyForm
|
|
705
|
-
:formData="billInfo"
|
|
706
|
-
:filterList="summaryFilterList"
|
|
707
|
-
:isEdit="false"
|
|
708
|
-
layout="inline-seamless"
|
|
709
|
-
label-width="150px"
|
|
710
|
-
label-suffix=":"
|
|
711
|
-
/>
|
|
712
|
-
```
|
|
713
|
-
|
|
714
|
-
#### 左右定位与整行插入
|
|
715
|
-
|
|
716
|
-
`position` 只影响传了 `left`、`right`、`full` 的项。`left` 固定左列,`right` 固定右列,`full` 占整行并按配置顺序插入,不会被统一挪到最后。
|
|
717
|
-
|
|
718
|
-
```js
|
|
719
|
-
filterList: [
|
|
720
|
-
{ label: "账单ID", name: "id", type: "text", position: "left" },
|
|
721
|
-
{ label: "充值金额", name: "total_order_amount", type: "render", position: "right", render: this.renderMoney },
|
|
722
|
-
{ label: "账单年份", name: "task_bill_year", type: "text", position: "left" },
|
|
723
|
-
{ label: "结算金额", name: "total_settlement_amount", type: "render", position: "right", render: this.renderMoney },
|
|
724
|
-
{
|
|
725
|
-
label: "备注说明",
|
|
726
|
-
name: "summary_note",
|
|
727
|
-
type: "render",
|
|
728
|
-
position: "full",
|
|
729
|
-
nowrap: true,
|
|
730
|
-
render: () => this.summaryNoteHtml()
|
|
731
|
-
},
|
|
732
|
-
{ label: "订单号查询", name: "empower_order_id", type: "infly-input", position: "full", clearable: true }
|
|
733
|
-
]
|
|
734
|
-
```
|
|
735
|
-
|
|
736
|
-
### 按钮配置
|
|
737
|
-
|
|
738
|
-
#### 顶部按钮:`btnList`
|
|
739
|
-
|
|
740
|
-
```js
|
|
741
|
-
btnList: [
|
|
742
|
-
{ label: "上传账单", type: "blue", btnEvent: () => { this.uploadDialogVisible = true; } },
|
|
743
|
-
{ label: "导出", type: "primary", isShow: () => this.canExport, btnEvent: this.exportList }
|
|
744
|
-
]
|
|
745
|
-
```
|
|
746
|
-
|
|
747
|
-
#### 底部按钮:默认查询、重置和 `optBtnList`
|
|
748
|
-
|
|
749
|
-
```vue
|
|
750
|
-
<InflyForm
|
|
751
|
-
:formData="formData"
|
|
752
|
-
:filterList="filterList"
|
|
753
|
-
:hideResetBtn="false"
|
|
754
|
-
:optBtnList="[{ label: '保存', type: 'primary', btnEvent: 'submit' }]"
|
|
755
|
-
@initData="search"
|
|
756
|
-
@submit="submitForm"
|
|
757
|
-
/>
|
|
758
|
-
```
|
|
759
|
-
|
|
760
|
-
#### 导出按钮
|
|
761
|
-
|
|
762
|
-
导出请求实例按 `exportFunc -> request prop -> this.$axios` 的顺序解析;组件不再内置 `REST` fallback。独立使用 `InflyForm` 时,如果页面没有全局注入 `$axios`,需要显式传入 `request` 或在按钮上配置 `exportFunc`。
|
|
763
|
-
|
|
764
|
-
`InflyForm` 直接调用 `@infly/ts-libs` 的 `exportFile`,不会注册或导出 `fileExportMixin`。应用若需要全局 `$exportFile`,使用:
|
|
765
|
-
|
|
766
|
-
```javascript
|
|
767
|
-
import { fileExportMixin } from "@infly/libs/adapters/vue2/module/file-export.js";
|
|
768
|
-
|
|
769
|
-
Vue.mixin(fileExportMixin);
|
|
770
|
-
```
|
|
771
|
-
|
|
772
|
-
```vue
|
|
773
|
-
<InflyForm
|
|
774
|
-
:formData="formData"
|
|
775
|
-
:filterList="filterList"
|
|
776
|
-
:btnList="btnList"
|
|
777
|
-
:request="$axios"
|
|
778
|
-
/>
|
|
779
|
-
```
|
|
780
|
-
|
|
781
|
-
```js
|
|
782
|
-
btnList: [
|
|
783
|
-
{
|
|
784
|
-
label: "导出",
|
|
785
|
-
type: "success",
|
|
786
|
-
exportUrl: "/admin/reconciliation/bills/export/",
|
|
787
|
-
exportFileName: "金融营销对账账单",
|
|
788
|
-
exportMethod: "get",
|
|
789
|
-
dealParams: (params, formData) => ({ ...params, keyword: formData.keyword })
|
|
790
|
-
}
|
|
791
|
-
]
|
|
792
|
-
```
|
|
793
|
-
|
|
794
|
-
## AI 维护规则
|
|
795
|
-
|
|
796
|
-
1. 新增或修改 `InflyList` / `InflyForm` 的 prop、事件、插槽、列类型、字段类型、配置字段时,同步更新本 README。
|
|
797
|
-
2. 每个新增能力至少提供一个完整示例,优先参考 `apps/postal-benefits-platform/src/shared/pages/` 中已经存在的写法。
|
|
798
|
-
3. 公共组件改动必须保持旧配置语义不变;新能力优先通过显式配置启用。
|
|
799
|
-
4. 交付说明中写清影响范围、已验证路径和未覆盖风险。
|
|
1
|
+
# @infly/ui
|
|
2
|
+
|
|
3
|
+
`@infly/ui` 是运营端通用 Vue2 组件库。当前业务页面优先使用 `InflyList`、`InflyForm`、`InflyDialog` 等组件承载筛选、表格、分页、详情展示和弹窗表单。
|
|
4
|
+
|
|
5
|
+
组件内部的框架无关工具来自 `@infly/ts-libs`。依赖 Vue 实例、请求实例或 Element UI 消息能力的全局 mixin 不属于 UI 公共入口;Vue2 应用统一从 `@infly/libs/adapters/vue2/module/` 引入对应适配器。
|
|
6
|
+
|
|
7
|
+
修改 `InflyList` 或 `InflyForm` 时必须同步更新本文档:新增 prop、事件、插槽、字段配置、列类型或表单类型,都要补充至少一个可复制的使用示例。
|
|
8
|
+
|
|
9
|
+
## InflyList
|
|
10
|
+
|
|
11
|
+
`InflyList` 组合了 `el-tabs`、`InflyForm`、`el-table` 和分页。适合“tab + 筛选区 + 操作按钮 + 表格 + 分页”的运营端页面。
|
|
12
|
+
|
|
13
|
+
### 基础示例
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<template>
|
|
17
|
+
<InflyList
|
|
18
|
+
ref="listRef"
|
|
19
|
+
:formData="formData"
|
|
20
|
+
:reqUrl="reqUrl"
|
|
21
|
+
:filterList="filterList"
|
|
22
|
+
:btnList="btnList"
|
|
23
|
+
:columns="columns"
|
|
24
|
+
:dealParams="dealParams"
|
|
25
|
+
:customRender="customRender"
|
|
26
|
+
@tab-change="handleTabChange"
|
|
27
|
+
/>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script>
|
|
31
|
+
export default {
|
|
32
|
+
data() {
|
|
33
|
+
return {
|
|
34
|
+
reqUrl: "/admin/reconciliation/bills/",
|
|
35
|
+
formData: { page: 1, pagesize: 10, total: 0 },
|
|
36
|
+
filterList: [
|
|
37
|
+
{ label: "账单年份", name: "bill_year", type: "el-select", options: [{ label: "2026", value: "2026" }], clearable: true },
|
|
38
|
+
{ label: "关键词", name: "keyword", type: "infly-input", placeholder: "账单ID/金额/操作人", clearable: true }
|
|
39
|
+
],
|
|
40
|
+
btnList: [
|
|
41
|
+
{ label: "导出", type: "primary", btnEvent: () => this.exportList() }
|
|
42
|
+
],
|
|
43
|
+
columns: [
|
|
44
|
+
{ label: "账单ID", prop: "id", width: "90px" },
|
|
45
|
+
{ label: "账单金额", prop: "total_consume_amount", type: "render", minWidth: "140px" }
|
|
46
|
+
]
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
methods: {
|
|
50
|
+
dealParams(params) {
|
|
51
|
+
return { ...params, keyword: (params.keyword || "").trim() };
|
|
52
|
+
},
|
|
53
|
+
customRender(row, prop) {
|
|
54
|
+
if (prop === "total_consume_amount") return `¥${row[prop] || "0.00"}`;
|
|
55
|
+
return row[prop] || "-";
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
</script>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Props
|
|
63
|
+
|
|
64
|
+
| Prop | 类型 | 默认值 | 说明 | 示例 |
|
|
65
|
+
| --- | --- | --- | --- | --- |
|
|
66
|
+
| `formData` | `Object` | 必填 | 查询参数、分页参数和总数容器。组件会写入 `page`、`pagesize`、`total`。 | `:formData="{ page: 1, pagesize: 10, total: 0 }"` |
|
|
67
|
+
| `defaultTabName` | `String` | `""` | 默认激活的一级 tab 名称。 | `:defaultTabName="'billList'"` |
|
|
68
|
+
| `hideTab` | `Boolean` | `false` | 隐藏一级 tab 头部。 | `hideTab` |
|
|
69
|
+
| `tabList` | `Array` | `[{}]` | 一级 tab 配置,直接透传给 `el-tab-pane`;每项可带 `reqUrl`。 | `[{ label: "账单列表", name: "billList", reqUrl: "/admin/reconciliation/bills/" }]` |
|
|
70
|
+
| `filterList` | `Array` | `[]` | 传给 `InflyForm` 的筛选/详情字段配置。 | `[{ label: "关键词", name: "keyword", type: "infly-input" }]` |
|
|
71
|
+
| `columns` | `Array` | 必填 | 表格列配置,支持普通列、操作列、特殊类型、多级表头。 | `[{ label: "ID", prop: "id" }]` |
|
|
72
|
+
| `btnList` | `Array` | `[]` | 顶部操作按钮,传给 `InflyForm`。 | `[{ label: "上传", type: "blue", btnEvent: this.openDialog }]` |
|
|
73
|
+
| `outSideReqParams` | `Object` | `{}` | 额外请求参数,每次请求合并到 `formData` 后。 | `:outSideReqParams="{ bill_id: billId }"` |
|
|
74
|
+
| `reqUrl` | `String` | `""` | 列表接口地址;为空时会尝试使用当前 tab 的 `reqUrl`。 | `reqUrl="/admin/reconciliation/logs/"` |
|
|
75
|
+
| `reqMethod` | `String` | `"get"` | 请求方法,使用 `this.$axios[reqMethod]`。 | `reqMethod="post"` |
|
|
76
|
+
| `defaultInit` | `Boolean` | `true` | 创建后是否自动请求。详情页常设为 `false`,待详情信息加载后手动请求。 | `:defaultInit="false"` |
|
|
77
|
+
| `dealParams` | `Function` | `null` | 请求前处理参数,返回对象会替换最终参数。 | `:dealParams="(params) => ({ ...params, status: params.status || undefined })"` |
|
|
78
|
+
| `dealRes` | `Function` | `null` | 请求后处理响应,返回对象会作为最终响应。 | `:dealRes="(res) => ({ lists: res.data, counts: res.total })"` |
|
|
79
|
+
| `initEventName` | `String` | `"initData"` | 查询后额外 emit 的事件名。 | `initEventName="refresh"` |
|
|
80
|
+
| `hideDivider` | `Boolean` | `false` | 隐藏筛选区和表格之间的分隔线。 | `hideDivider` |
|
|
81
|
+
| `isInnerList` | `Boolean` | `false` | 内嵌列表样式。 | `isInnerList` |
|
|
82
|
+
| `isTopList` | `Boolean` | `true` | 页面顶部列表样式。 | `:isTopList="false"` |
|
|
83
|
+
| `hideEmptyTag` | `Boolean` | `false` | `el-tag` 列为空时不渲染 tag。 | `hideEmptyTag` |
|
|
84
|
+
| `hideJumpPageButton` | `Boolean` | `false` | 隐藏分页右侧“跳转”按钮。 | `hideJumpPageButton` |
|
|
85
|
+
| `customRender` | `Function` | 取 `row[prop]` | `type: "render"`、`custom`、`el-popover` 的统一渲染函数,可返回字符串或 VNode。 | `customRender(row, prop) { return row[prop] || "-" }` |
|
|
86
|
+
| `tableProps` | `Object` | `{}` | 透传给 `el-table`,也支持 `dataList` 覆盖内部请求数据。 | `:tableProps="{ stripe: true, dataList: localRows }"` |
|
|
87
|
+
| `formProps` | `Object` | `{ "label-width": "80px" }` | 透传给内部 `InflyForm`。 | `:formProps="{ layout: 'inline-seamless', 'label-width': '120px' }"` |
|
|
88
|
+
| `emptyText` | `String` | `""` | 普通单元格空值文案。 | `emptyText="-"` |
|
|
89
|
+
| `tabsProps` | `Object` | `{ type: "border-card" }` | 透传给 `el-tabs`。 | `:tabsProps="{ type: '' }"` |
|
|
90
|
+
|
|
91
|
+
### 事件
|
|
92
|
+
|
|
93
|
+
| 事件 | 触发时机 | 示例 |
|
|
94
|
+
| --- | --- | --- |
|
|
95
|
+
| `initData` | 调用 `initData()` 后触发;名称可由 `initEventName` 改写。 | `@initData="afterSearch"` |
|
|
96
|
+
| `tab-change` / `tabChange` | 一级 tab 切换时触发,参数包含原始 tab 配置和 `activityTab`。 | `@tab-change="handleTabChange"` |
|
|
97
|
+
| `sec-tab-change` / `secTabChange` | 内部 `InflyForm` 的 `secTab` 切换时触发。 | `@secTabChange="handleSecTabChange"` |
|
|
98
|
+
| `request-error` | 请求异常或请求方法不支持时触发。 | `@request-error="handleError"` |
|
|
99
|
+
| `request-timeout` | 单次请求超过 60 秒时触发。 | `@request-timeout="handleTimeout"` |
|
|
100
|
+
|
|
101
|
+
### 插槽
|
|
102
|
+
|
|
103
|
+
| 插槽 | 位置 | 示例 |
|
|
104
|
+
| --- | --- | --- |
|
|
105
|
+
| `pretop` | `el-tabs` 内、tab pane 前。 | `<template #pretop><div>顶部说明</div></template>` |
|
|
106
|
+
| `prepend` | 每个 tab pane 的表单前。 | `<template #prepend><div class="tips">说明</div></template>` |
|
|
107
|
+
| `replace` | 替换表单、分隔线、表格和分页整体。 | `<template #replace>自定义完整内容</template>` |
|
|
108
|
+
| `replaceTable` | 只替换表格和分页。 | `<template #replaceTable><CustomTable /></template>` |
|
|
109
|
+
| `customRender` | 传给 `InflyForm` 的 `type: "customRender"` 字段。 | `<template #customRender="{ item }"><MyInput :item="item" /></template>` |
|
|
110
|
+
| `expand` | `type: "expand"` 展开列内容。 | `<template #expand="{ row }">{{ row.detail }}</template>` |
|
|
111
|
+
| `[prop]` | 表格列同名具名插槽,优先级高于列 `type`。 | `<template #status="{ row }"><el-tag>{{ row.status_str }}</el-tag></template>` |
|
|
112
|
+
|
|
113
|
+
### 列配置
|
|
114
|
+
|
|
115
|
+
列配置会把内部字段之外的属性透传给 `el-table-column`,例如 `label`、`prop`、`width`、`minWidth`、`fixed`、`sortable`、`showOverflowTooltip`。默认 `align` 为 `center`。
|
|
116
|
+
|
|
117
|
+
内部字段包括:`children`、`columns`、`type`、`buttonList`、`className`、`isHide`、`click`、`options`、`optionKeyField`、`optionValueField`、`propValueField`、`mapField`、`render`。
|
|
118
|
+
|
|
119
|
+
#### 普通列
|
|
120
|
+
|
|
121
|
+
```js
|
|
122
|
+
columns: [
|
|
123
|
+
{ label: "账单ID", prop: "id", width: "90px" },
|
|
124
|
+
{ label: "所属机构", prop: "level_name", minWidth: "150px", showOverflowTooltip: true }
|
|
125
|
+
]
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
#### 默认列:selection、index、expand
|
|
129
|
+
|
|
130
|
+
```js
|
|
131
|
+
columns: [
|
|
132
|
+
{ type: "selection", width: 55 },
|
|
133
|
+
{ type: "index", label: "序号", width: 70 },
|
|
134
|
+
{ type: "expand", width: 50 },
|
|
135
|
+
{ label: "名称", prop: "name" }
|
|
136
|
+
]
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
```vue
|
|
140
|
+
<InflyList :formData="formData" v-bind="pageConfig">
|
|
141
|
+
<template #expand="{ row }">
|
|
142
|
+
<pre>{{ row }}</pre>
|
|
143
|
+
</template>
|
|
144
|
+
</InflyList>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
#### `type: "render"` / `custom`
|
|
148
|
+
|
|
149
|
+
```js
|
|
150
|
+
columns: [
|
|
151
|
+
{ label: "消耗金额(含税)", prop: "total_consume_amount_with_tax", type: "render" }
|
|
152
|
+
],
|
|
153
|
+
customRender(row, prop) {
|
|
154
|
+
return `<span class="text-red">¥${row[prop] || "0.00"}</span>`;
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
#### `type: "el-tag"`
|
|
159
|
+
|
|
160
|
+
```js
|
|
161
|
+
columns: [
|
|
162
|
+
{
|
|
163
|
+
label: "状态",
|
|
164
|
+
prop: "status",
|
|
165
|
+
type: "el-tag",
|
|
166
|
+
options: [
|
|
167
|
+
{ value: "pending", name: "待处理", tagType: "info" },
|
|
168
|
+
{ value: "completed", name: "完成", tagType: "success" },
|
|
169
|
+
{ value: "failed", name: "失败", tagType: "danger" }
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
#### 操作列:`type: "el-button"` 或 `buttonList`
|
|
176
|
+
|
|
177
|
+
`buttonList` 每一项除 `name`、`label`、`className`、`isShow`、`isHide`、`click`、`btnEvent` 外,其余属性会透传给 `el-button`,例如 `size`、`plain`、`disabled`、`loading`、`icon`。
|
|
178
|
+
|
|
179
|
+
```js
|
|
180
|
+
columns: [
|
|
181
|
+
{
|
|
182
|
+
label: "操作",
|
|
183
|
+
prop: "action",
|
|
184
|
+
type: "el-button",
|
|
185
|
+
fixed: "right",
|
|
186
|
+
width: "120px",
|
|
187
|
+
buttonList: [
|
|
188
|
+
{
|
|
189
|
+
name: "查看详情",
|
|
190
|
+
type: "text",
|
|
191
|
+
size: "mini",
|
|
192
|
+
className: "text-blue",
|
|
193
|
+
disabled: false,
|
|
194
|
+
isShow: (row) => row.status !== "deleted",
|
|
195
|
+
click: (row) => this.goDetail(row)
|
|
196
|
+
}
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
]
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
#### `type: "el-image"`
|
|
203
|
+
|
|
204
|
+
```js
|
|
205
|
+
columns: [
|
|
206
|
+
{ label: "图片", prop: "cover_url", type: "el-image", width: 80, fit: "cover" }
|
|
207
|
+
]
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
#### 多级表头
|
|
211
|
+
|
|
212
|
+
支持 `children` 或 `columns`,叶子列继续使用普通列能力。
|
|
213
|
+
|
|
214
|
+
```js
|
|
215
|
+
columns: [
|
|
216
|
+
{ label: "日期", prop: "date", width: 150 },
|
|
217
|
+
{
|
|
218
|
+
label: "配送信息",
|
|
219
|
+
children: [
|
|
220
|
+
{ label: "姓名", prop: "name", width: 120 },
|
|
221
|
+
{
|
|
222
|
+
label: "地址",
|
|
223
|
+
columns: [
|
|
224
|
+
{ label: "省份", prop: "province", width: 120 },
|
|
225
|
+
{ label: "市区", prop: "city", width: 120 },
|
|
226
|
+
{ label: "地址", prop: "address", minWidth: 200, showOverflowTooltip: true }
|
|
227
|
+
]
|
|
228
|
+
}
|
|
229
|
+
]
|
|
230
|
+
}
|
|
231
|
+
]
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### 常用页面模式
|
|
235
|
+
|
|
236
|
+
#### 一级 tab 切换不同接口和列
|
|
237
|
+
|
|
238
|
+
```js
|
|
239
|
+
pageConfig() {
|
|
240
|
+
return {
|
|
241
|
+
reqUrl: this.currentTabConfig.reqUrl,
|
|
242
|
+
tabList: [
|
|
243
|
+
{ label: "账单列表", name: "billList" },
|
|
244
|
+
{ label: "操作日志", name: "processLog" }
|
|
245
|
+
],
|
|
246
|
+
filterList: this.currentTabConfig.filterList,
|
|
247
|
+
btnList: this.currentTabConfig.btnList,
|
|
248
|
+
columns: this.currentTabConfig.columns
|
|
249
|
+
};
|
|
250
|
+
},
|
|
251
|
+
methods: {
|
|
252
|
+
handleTabChange({ name }) {
|
|
253
|
+
this.activeTab = name;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
#### 本地数据表格
|
|
259
|
+
|
|
260
|
+
```vue
|
|
261
|
+
<InflyList
|
|
262
|
+
:formData="{ page: 1, pagesize: 10, total: rows.length }"
|
|
263
|
+
:defaultInit="false"
|
|
264
|
+
:columns="columns"
|
|
265
|
+
:tableProps="{ dataList: rows, stripe: true }"
|
|
266
|
+
/>
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
#### 替换表格区域
|
|
270
|
+
|
|
271
|
+
```vue
|
|
272
|
+
<InflyList :formData="formData" v-bind="pageConfig">
|
|
273
|
+
<template #replaceTable>
|
|
274
|
+
<CustomDistributionTable :rows="rows" />
|
|
275
|
+
</template>
|
|
276
|
+
</InflyList>
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
## InflyForm
|
|
280
|
+
|
|
281
|
+
`InflyForm` 是动态表单/详情展示组件。编辑态下根据 `filterList` 渲染输入控件;非编辑态下渲染文本、tag、链接或自定义内容。`InflyList` 内部的筛选区也是使用该组件。
|
|
282
|
+
|
|
283
|
+
### 基础示例
|
|
284
|
+
|
|
285
|
+
```vue
|
|
286
|
+
<template>
|
|
287
|
+
<InflyForm
|
|
288
|
+
ref="formRef"
|
|
289
|
+
:formData="formData"
|
|
290
|
+
:filterList="filterList"
|
|
291
|
+
:btnList="btnList"
|
|
292
|
+
layout="inline"
|
|
293
|
+
label-width="100px"
|
|
294
|
+
@initData="search"
|
|
295
|
+
@reset-form="resetForm"
|
|
296
|
+
/>
|
|
297
|
+
</template>
|
|
298
|
+
|
|
299
|
+
<script>
|
|
300
|
+
export default {
|
|
301
|
+
data() {
|
|
302
|
+
return {
|
|
303
|
+
formData: { keyword: "", status: "" },
|
|
304
|
+
filterList: [
|
|
305
|
+
{ label: "关键词", name: "keyword", type: "infly-input", placeholder: "请输入关键词", clearable: true },
|
|
306
|
+
{ label: "状态", name: "status", type: "el-select", options: [{ label: "启用", value: "enabled" }], clearable: true }
|
|
307
|
+
],
|
|
308
|
+
btnList: [
|
|
309
|
+
{ label: "导出", type: "primary", btnEvent: () => this.exportData() }
|
|
310
|
+
]
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
</script>
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### Props
|
|
318
|
+
|
|
319
|
+
| Prop | 类型 | 默认值 | 说明 | 示例 |
|
|
320
|
+
| --- | --- | --- | --- | --- |
|
|
321
|
+
| `formClass` | `String` | `""` | 追加到内部 `el-form` 的 class。 | `formClass="reconciliation-summary-form"` |
|
|
322
|
+
| `layout` | `String \| Array` | `""` | 表单布局 class,支持 `inline`、`inline-seamless`、`compact`,可传数组组合。 | `layout="inline-seamless"` |
|
|
323
|
+
| `formData` | `Object` | 必填 | 表单数据对象,字段通过 `name` 双向绑定。 | `:formData="{ keyword: '' }"` |
|
|
324
|
+
| `formRef` | `String` | `"formRef"` | 内部 `el-form` ref 名称,供 `validate()` 等方法使用。 | `formRef="searchFormRef"` |
|
|
325
|
+
| `btnList` | `Array` | `[]` | 表单上方按钮列表。 | `[{ label: "上传", type: "blue", btnEvent: this.openDialog }]` |
|
|
326
|
+
| `filterList` | `Array` | `[]` | 表单字段配置。 | `[{ label: "名称", name: "name", type: "infly-input" }]` |
|
|
327
|
+
| `reqParams` | `Object` | `{}` | 当前请求参数,导出按钮会从中取参数。通常由 `InflyList` 传入。 | `:reqParams="{ keyword: formData.keyword }"` |
|
|
328
|
+
| `request` | `Function` | `null` | 导出按钮使用的请求实例。导出请求优先级为按钮 `exportFunc`、`request` prop、组件实例 `this.$axios`。 | `:request="$axios"` |
|
|
329
|
+
| `hideSearchBtn` | `Boolean` | `false` | 隐藏底部默认“查询”按钮。 | `hideSearchBtn` |
|
|
330
|
+
| `hideResetBtn` | `Boolean` | `true` | 隐藏底部默认“重置”按钮。默认隐藏。 | `:hideResetBtn="false"` |
|
|
331
|
+
| `isEdit` | `Boolean \| null` | `null` | 强制编辑/展示态;为 `null` 时按路由 `mode` 判断。 | `:isEdit="false"` |
|
|
332
|
+
| `optBtnList` | `Array` | `[]` | 底部查询/重置后的附加按钮。 | `:optBtnList="[{ label: '保存', type: 'primary', btnEvent: 'submit' }]"` |
|
|
333
|
+
| `btnWrapDirection` | `String` | `"row"` | 顶部按钮排列方向 class。 | `btnWrapDirection="column"` |
|
|
334
|
+
| `btnWrapClass` | `String` | `""` | 底部按钮容器追加 class。 | `btnWrapClass="dialog-footer"` |
|
|
335
|
+
| `baseButtonsLeft` | `String` | `"420px"` | 底部按钮距离 label 后的偏移基准。 | `baseButtonsLeft="260px"` |
|
|
336
|
+
| `emptyStr` | `String` | `"-"` | 非编辑态空值展示。 | `emptyStr="暂无"` |
|
|
337
|
+
|
|
338
|
+
`InflyForm` 还会把未声明的属性透传给 `el-form`,例如 `label-width`、`label-suffix`、`rules`、`size`。
|
|
339
|
+
|
|
340
|
+
```vue
|
|
341
|
+
<InflyForm
|
|
342
|
+
:formData="formData"
|
|
343
|
+
:filterList="filterList"
|
|
344
|
+
label-width="120px"
|
|
345
|
+
label-suffix=":"
|
|
346
|
+
size="small"
|
|
347
|
+
/>
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### 事件
|
|
351
|
+
|
|
352
|
+
| 事件 | 触发时机 | 示例 |
|
|
353
|
+
| --- | --- | --- |
|
|
354
|
+
| `initData` | 底部默认“查询”按钮点击。 | `@initData="search"` |
|
|
355
|
+
| `reset-form` | 底部默认“重置”按钮点击,参数为初始表单快照。 | `@reset-form="(data) => Object.assign(formData, data)"` |
|
|
356
|
+
| `submit` | 按钮 `btnEvent: "submit"` 且校验通过。 | `@submit="submitForm"` |
|
|
357
|
+
| `secTabChange` / `sec-tab-change` | `type: "secTab"` 切换。 | `@secTabChange="handleSecTabChange"` |
|
|
358
|
+
| `export-request-error` | 导出按钮配置了 `exportUrl` 但没有可用请求实例时触发。 | `@export-request-error="handleExportRequestError"` |
|
|
359
|
+
| 自定义事件 | `btnEvent` 为字符串时直接 emit。 | `{ label: "保存", btnEvent: "save" }` + `@save="save"` |
|
|
360
|
+
|
|
361
|
+
### 方法
|
|
362
|
+
|
|
363
|
+
| 方法 | 说明 | 示例 |
|
|
364
|
+
| --- | --- | --- |
|
|
365
|
+
| `getFormInstance()` | 返回内部 `el-form` 实例。 | `this.$refs.formRef.getFormInstance()` |
|
|
366
|
+
| `validate(callback)` | 调用内部 `el-form.validate`。 | `await this.$refs.formRef.validate()` |
|
|
367
|
+
| `clearValidate(props)` | 清除校验。 | `this.$refs.formRef.clearValidate(["name"])` |
|
|
368
|
+
| `validateField(props, callback)` | 校验指定字段。 | `this.$refs.formRef.validateField("name")` |
|
|
369
|
+
| `resetFormData()` | 触发 `reset-form`,并清理 `InstitutionSelect`。 | `this.$refs.formRef.resetFormData()` |
|
|
370
|
+
|
|
371
|
+
### 插槽
|
|
372
|
+
|
|
373
|
+
| 插槽 | 位置 | 示例 |
|
|
374
|
+
| --- | --- | --- |
|
|
375
|
+
| `prepend` | 表单整体前。 | `<template #prepend><div>说明</div></template>` |
|
|
376
|
+
| `append` | 表单整体后。 | `<template #append><div>底部说明</div></template>` |
|
|
377
|
+
| `customRender` | 字段 `type: "customRender"` 时渲染。 | `<template #customRender="{ item }"><MyField :item="item" /></template>` |
|
|
378
|
+
|
|
379
|
+
### filterList 字段配置
|
|
380
|
+
|
|
381
|
+
字段配置会拆分函数类型属性:除 `isHide`、`isShow`、`labelRender` 和 `el-upload` 回调外,函数属性会作为事件监听传给内部控件。
|
|
382
|
+
|
|
383
|
+
| 字段 | 说明 | 示例 |
|
|
384
|
+
| --- | --- | --- |
|
|
385
|
+
| `label` | 表单项 label。 | `{ label: "关键词" }` |
|
|
386
|
+
| `labelRender` | 自定义 label,支持 JSX 元素(VNode 对象)或函数 `(value, formData) => 字符串/VNode`;存在时整体替换 `label` 文本,`label-suffix` 由自己处理。 | `{ label: "关键词", labelRender: (<span>关键词 <i class="el-icon-question" /></span>) }` |
|
|
387
|
+
| `name` | 绑定字段名;日期范围可传数组。 | `{ name: "keyword" }`、`{ name: ["start", "end"], type: "daterange" }` |
|
|
388
|
+
| `prop` | 未传 `name` 时作为字段名。 | `{ prop: "keyword", type: "infly-input" }` |
|
|
389
|
+
| `type` | 控件类型或展示类型。 | `{ type: "el-select" }` |
|
|
390
|
+
| `options` | 选择类控件选项。 | `{ options: [{ label: "启用", value: 1 }] }` |
|
|
391
|
+
| `required` | 是否显示必填标记。 | `{ required: true }` |
|
|
392
|
+
| `rules` | 当前字段校验规则。 | `{ rules: [{ required: true, message: "请输入名称" }] }` |
|
|
393
|
+
| `isHide` | 隐藏条件,布尔值或函数。 | `{ isHide: (form) => form.type !== "coupon" }` |
|
|
394
|
+
| `isShow` | 显示条件,布尔值或函数。 | `{ isShow: (form) => form.enabled }` |
|
|
395
|
+
| `mode` | 单项强制编辑态。 | `{ mode: "edit" }` |
|
|
396
|
+
| `formItemClass` | 当前 `el-form-item` 追加 class。 | `{ formItemClass: "summary-tax-line" }` |
|
|
397
|
+
| `nowrap` | 给当前项追加不换行 class。 | `{ nowrap: true }` |
|
|
398
|
+
| `position` | 双列定位布局,支持 `left`、`right`、`full`。 | `{ label: "备注", name: "remark", type: "render", position: "full" }` |
|
|
399
|
+
| `valuePrefix` | 非编辑态展示前缀。 | `{ valuePrefix: "¥" }` |
|
|
400
|
+
| `optionConfig` | 自定义选项取值和展示。 | `{ optionConfig: { labelKey: "name", valueKey: "id" } }` |
|
|
401
|
+
| `radioType` | `el-radio-group` 内部单选组件,默认 `el-radio`。 | `{ type: "el-radio-group", radioType: "el-radio-button" }` |
|
|
402
|
+
| 其他属性 | 透传给内部控件或 `el-form-item`。 | `{ placeholder: "请输入", clearable: true }` |
|
|
403
|
+
|
|
404
|
+
### 支持的字段类型
|
|
405
|
+
|
|
406
|
+
#### 自定义 label:`labelRender`
|
|
407
|
+
|
|
408
|
+
`labelRender` 支持两种形式,二选一:
|
|
409
|
+
|
|
410
|
+
1. **VNode 对象(JSX 元素)**:直接写 JSX,静态渲染;
|
|
411
|
+
2. **函数**:`(value, formData) => 字符串或 VNode`,返回字符串时以行内元素渲染(注意 XSS:内容需转义或来自可信数据源),返回 VNode 可依赖 `formData` 动态渲染。
|
|
412
|
+
|
|
413
|
+
两种形式都会**整体替换 `label` 文本**(element-ui label 插槽语义),需要显示文本时请把文本包含在 JSX 内。`.vue` 文件 script 中的 JSX 由构建链(`@infly/vue2-vite`)自动转换并注入 `h`,无需手动引入;`labelRender` 函数没有组件 `this` 上下文,不能使用 `this.$createElement`。
|
|
414
|
+
|
|
415
|
+
```jsx
|
|
416
|
+
filterList: [
|
|
417
|
+
// 形式一:VNode 对象(静态)
|
|
418
|
+
{
|
|
419
|
+
label: "订单推送状态",
|
|
420
|
+
prop: "settlement_state",
|
|
421
|
+
type: "infly-checkbox",
|
|
422
|
+
labelRender: (
|
|
423
|
+
<span>
|
|
424
|
+
订单推送状态
|
|
425
|
+
<el-popover placement="top" width={200} trigger="hover" content="这是一段解释文案">
|
|
426
|
+
<i slot="reference" class="el-icon-question" style="margin-left: 4px" />
|
|
427
|
+
</el-popover>
|
|
428
|
+
</span>
|
|
429
|
+
)
|
|
430
|
+
},
|
|
431
|
+
// 形式二:函数(可动态渲染)
|
|
432
|
+
{
|
|
433
|
+
label: "活动名称",
|
|
434
|
+
name: "activity_name",
|
|
435
|
+
labelRender: (value, formData) => (
|
|
436
|
+
<span>
|
|
437
|
+
<i class="el-icon-s-opportunity" style="margin-right: 4px" />
|
|
438
|
+
活动名称
|
|
439
|
+
<el-popover placement="top" width={200} trigger="hover">
|
|
440
|
+
<span>这里是解释文案</span>
|
|
441
|
+
<i slot="reference" class="el-icon-question" style="margin-left: 4px" />
|
|
442
|
+
</el-popover>
|
|
443
|
+
</span>
|
|
444
|
+
)
|
|
445
|
+
}
|
|
446
|
+
]
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
#### 输入框:`infly-input` / `InflyInput` / `textarea` / `infly-input-number` / `el-autocomplete`
|
|
450
|
+
|
|
451
|
+
```js
|
|
452
|
+
filterList: [
|
|
453
|
+
{ label: "关键词", name: "keyword", type: "infly-input", placeholder: "请输入关键词", clearable: true },
|
|
454
|
+
{ label: "备注", name: "remark", type: "textarea", rows: 3, maxlength: 50, showWordLimit: true }
|
|
455
|
+
]
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
#### 选择器:`el-select`
|
|
459
|
+
|
|
460
|
+
```js
|
|
461
|
+
filterList: [
|
|
462
|
+
{
|
|
463
|
+
label: "账单月份",
|
|
464
|
+
name: "bill_month",
|
|
465
|
+
type: "el-select",
|
|
466
|
+
options: [{ label: "05", value: "05" }],
|
|
467
|
+
clearable: true,
|
|
468
|
+
placeholder: "请选择账单月份"
|
|
469
|
+
}
|
|
470
|
+
]
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
#### 日期:`date` / `month` / `year` / `datetime` / `daterange` / `datetimerange` / `el-time-picker`
|
|
474
|
+
|
|
475
|
+
```js
|
|
476
|
+
filterList: [
|
|
477
|
+
{ label: "账单年份", name: "bill_year", type: "year", valueFormat: "yyyy", format: "yyyy", placeholder: "请选择年份" },
|
|
478
|
+
{ label: "账单年月", name: "bill_month", type: "month", valueFormat: "yyyy-MM", placeholder: "请选择月份" },
|
|
479
|
+
{ label: "账单周期", name: ["period_start", "period_end"], type: "daterange" }
|
|
480
|
+
]
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
数组形式的 `name` 会自动把 `period_start`、`period_end` 与内部范围值同步。
|
|
484
|
+
|
|
485
|
+
#### 机构选择:`institution-select` / `InstitutionSelect`
|
|
486
|
+
|
|
487
|
+
```js
|
|
488
|
+
filterList: [
|
|
489
|
+
{
|
|
490
|
+
label: "所属省份",
|
|
491
|
+
name: "province_level_id",
|
|
492
|
+
type: "institution-select",
|
|
493
|
+
title: "选择省份",
|
|
494
|
+
btnText: "选择",
|
|
495
|
+
request: this.$axios,
|
|
496
|
+
reqModule: "admin",
|
|
497
|
+
levelTypes: "1",
|
|
498
|
+
levelNameKey: "province_level_name_filter",
|
|
499
|
+
hideTips: true
|
|
500
|
+
}
|
|
501
|
+
]
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
`InstitutionSelect` 请求实例优先使用 `request` prop,其次使用组件实例 `this.$axios`。默认接口为 `/${reqModule}/level/`,也可以通过 `reqUrl` 显式覆盖;组件不再读取外部工具库的环境信息推导 `reqModule`。
|
|
505
|
+
|
|
506
|
+
#### 复选:`infly-checkbox` / `InflyCheckBox`
|
|
507
|
+
|
|
508
|
+
```js
|
|
509
|
+
filterList: [
|
|
510
|
+
{
|
|
511
|
+
label: "处理结果",
|
|
512
|
+
name: "process_result",
|
|
513
|
+
type: "infly-checkbox",
|
|
514
|
+
options: [
|
|
515
|
+
{ label: "成功", value: "success" },
|
|
516
|
+
{ label: "失败", value: "failed" }
|
|
517
|
+
]
|
|
518
|
+
}
|
|
519
|
+
]
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
#### 单选:`el-radio-group`
|
|
523
|
+
|
|
524
|
+
```js
|
|
525
|
+
filterList: [
|
|
526
|
+
{
|
|
527
|
+
label: "类型",
|
|
528
|
+
name: "type",
|
|
529
|
+
type: "el-radio-group",
|
|
530
|
+
radioType: "el-radio-button",
|
|
531
|
+
options: [
|
|
532
|
+
{ name: "全部", value: "" },
|
|
533
|
+
{ name: "已启用", value: "enabled" }
|
|
534
|
+
]
|
|
535
|
+
}
|
|
536
|
+
]
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
#### 上传:`el-upload`
|
|
540
|
+
|
|
541
|
+
```js
|
|
542
|
+
filterList: [
|
|
543
|
+
{
|
|
544
|
+
label: "活动列表",
|
|
545
|
+
name: "activity_file",
|
|
546
|
+
type: "el-upload",
|
|
547
|
+
action: "",
|
|
548
|
+
drag: true,
|
|
549
|
+
accept: ".xlsx",
|
|
550
|
+
tips: "仅支持 .xlsx 文件",
|
|
551
|
+
"on-change": this.handleFileChange,
|
|
552
|
+
"auto-upload": false,
|
|
553
|
+
"file-list": this.activityFileList
|
|
554
|
+
}
|
|
555
|
+
]
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
`el-upload` 的回调函数保留为属性整体透传,适配 Element UI 的 `on-change`、`on-remove` 等写法。
|
|
559
|
+
|
|
560
|
+
#### 展示态文本:`text`
|
|
561
|
+
|
|
562
|
+
```js
|
|
563
|
+
filterList: [
|
|
564
|
+
{ label: "账单ID", name: "id", type: "text" }
|
|
565
|
+
]
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
当 `isEdit=false` 或路由 `mode` 非编辑态时,显示 `formData[name + "_str"]` 优先,其次显示 `formData[name]`。
|
|
569
|
+
|
|
570
|
+
#### 分组标题:`module`
|
|
571
|
+
|
|
572
|
+
`module` 用于只显示分组标题。表单内存在 `module` 时,普通字段会继承 `label-suffix`,`module` 自身不展示后缀和字段值。
|
|
573
|
+
|
|
574
|
+
```js
|
|
575
|
+
filterList: [
|
|
576
|
+
{ label: "基础信息", type: "module" },
|
|
577
|
+
{ label: "活动名称", name: "activity_name", type: "infly-input", required: true }
|
|
578
|
+
]
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
#### 业务开关:`BusinessSwitch` / `business-switch`
|
|
582
|
+
|
|
583
|
+
```js
|
|
584
|
+
filterList: [
|
|
585
|
+
{
|
|
586
|
+
label: "启用状态",
|
|
587
|
+
name: "enabled",
|
|
588
|
+
type: "business-switch",
|
|
589
|
+
activeValue: true,
|
|
590
|
+
inactiveValue: false,
|
|
591
|
+
render: (value) => (value ? "已启用" : "已停用")
|
|
592
|
+
}
|
|
593
|
+
]
|
|
594
|
+
```
|
|
595
|
+
|
|
596
|
+
#### 展示态链接:`router-link`
|
|
597
|
+
|
|
598
|
+
`router-link` 只在非编辑态渲染,其他属性会透传给 Vue Router 的 `router-link`。
|
|
599
|
+
|
|
600
|
+
```js
|
|
601
|
+
filterList: [
|
|
602
|
+
{
|
|
603
|
+
label: "详情页",
|
|
604
|
+
name: "detail_text",
|
|
605
|
+
type: "router-link",
|
|
606
|
+
to: { path: "/reconciliation/detail", query: { id: this.formData.id } }
|
|
607
|
+
}
|
|
608
|
+
]
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
#### 展示态 tag:`el-tag`
|
|
612
|
+
|
|
613
|
+
```js
|
|
614
|
+
filterList: [
|
|
615
|
+
{
|
|
616
|
+
label: "状态",
|
|
617
|
+
name: "status_str",
|
|
618
|
+
type: "el-tag",
|
|
619
|
+
propValueField: "status",
|
|
620
|
+
options: [
|
|
621
|
+
{ value: "completed", tagType: "success" },
|
|
622
|
+
{ value: "failed", tagType: "danger" }
|
|
623
|
+
]
|
|
624
|
+
}
|
|
625
|
+
]
|
|
626
|
+
```
|
|
627
|
+
|
|
628
|
+
#### 自定义展示:`render`
|
|
629
|
+
|
|
630
|
+
```js
|
|
631
|
+
filterList: [
|
|
632
|
+
{
|
|
633
|
+
label: "消耗金额(含税)",
|
|
634
|
+
name: "total_consume_amount_with_tax",
|
|
635
|
+
type: "render",
|
|
636
|
+
render: (value) => `<span class="text-red">¥${value || "0.00"}</span>`
|
|
637
|
+
}
|
|
638
|
+
]
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
`render` 可返回字符串或 VNode。字符串会通过 `v-html` 渲染,调用方必须确保内容可信或已转义。
|
|
642
|
+
|
|
643
|
+
#### 自定义插槽:`customRender`
|
|
644
|
+
|
|
645
|
+
```vue
|
|
646
|
+
<InflyForm :formData="formData" :filterList="filterList">
|
|
647
|
+
<template #customRender="{ item }">
|
|
648
|
+
<CustomUploader :config="item" />
|
|
649
|
+
</template>
|
|
650
|
+
</InflyForm>
|
|
651
|
+
```
|
|
652
|
+
|
|
653
|
+
```js
|
|
654
|
+
filterList: [
|
|
655
|
+
{ label: "附件", name: "files", type: "customRender" }
|
|
656
|
+
]
|
|
657
|
+
```
|
|
658
|
+
|
|
659
|
+
#### 二级 tab:`secTab`
|
|
660
|
+
|
|
661
|
+
适合详情页“基础信息 + 下方明细 tab”的结构。`secTab` 项会插入到它在 `filterList` 中出现的位置,激活 tab 的 `filterList` 会跟在 tab 后面。
|
|
662
|
+
|
|
663
|
+
```js
|
|
664
|
+
filterList: [
|
|
665
|
+
{ label: "账单ID", name: "id", type: "text", position: "left" },
|
|
666
|
+
{
|
|
667
|
+
label: "订单明细",
|
|
668
|
+
name: "orders",
|
|
669
|
+
type: "secTab",
|
|
670
|
+
buttonList: [
|
|
671
|
+
{ name: "导出订单明细", type: "primary", click: () => this.exportDetail("orders") }
|
|
672
|
+
],
|
|
673
|
+
filterList: [
|
|
674
|
+
{ label: "订单号查询", name: "empower_order_id", type: "infly-input", position: "full", clearable: true }
|
|
675
|
+
]
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
label: "消耗明细",
|
|
679
|
+
name: "consumes",
|
|
680
|
+
type: "secTab",
|
|
681
|
+
filterList: [
|
|
682
|
+
{ label: "关键词搜索", name: "keyword", type: "infly-input", position: "full", clearable: true }
|
|
683
|
+
]
|
|
684
|
+
}
|
|
685
|
+
]
|
|
686
|
+
```
|
|
687
|
+
|
|
688
|
+
### 布局示例
|
|
689
|
+
|
|
690
|
+
#### 行内筛选
|
|
691
|
+
|
|
692
|
+
```vue
|
|
693
|
+
<InflyForm
|
|
694
|
+
:formData="formData"
|
|
695
|
+
:filterList="filterList"
|
|
696
|
+
layout="inline"
|
|
697
|
+
label-width="100px"
|
|
698
|
+
/>
|
|
699
|
+
```
|
|
700
|
+
|
|
701
|
+
#### 无缝行内详情
|
|
702
|
+
|
|
703
|
+
```vue
|
|
704
|
+
<InflyForm
|
|
705
|
+
:formData="billInfo"
|
|
706
|
+
:filterList="summaryFilterList"
|
|
707
|
+
:isEdit="false"
|
|
708
|
+
layout="inline-seamless"
|
|
709
|
+
label-width="150px"
|
|
710
|
+
label-suffix=":"
|
|
711
|
+
/>
|
|
712
|
+
```
|
|
713
|
+
|
|
714
|
+
#### 左右定位与整行插入
|
|
715
|
+
|
|
716
|
+
`position` 只影响传了 `left`、`right`、`full` 的项。`left` 固定左列,`right` 固定右列,`full` 占整行并按配置顺序插入,不会被统一挪到最后。
|
|
717
|
+
|
|
718
|
+
```js
|
|
719
|
+
filterList: [
|
|
720
|
+
{ label: "账单ID", name: "id", type: "text", position: "left" },
|
|
721
|
+
{ label: "充值金额", name: "total_order_amount", type: "render", position: "right", render: this.renderMoney },
|
|
722
|
+
{ label: "账单年份", name: "task_bill_year", type: "text", position: "left" },
|
|
723
|
+
{ label: "结算金额", name: "total_settlement_amount", type: "render", position: "right", render: this.renderMoney },
|
|
724
|
+
{
|
|
725
|
+
label: "备注说明",
|
|
726
|
+
name: "summary_note",
|
|
727
|
+
type: "render",
|
|
728
|
+
position: "full",
|
|
729
|
+
nowrap: true,
|
|
730
|
+
render: () => this.summaryNoteHtml()
|
|
731
|
+
},
|
|
732
|
+
{ label: "订单号查询", name: "empower_order_id", type: "infly-input", position: "full", clearable: true }
|
|
733
|
+
]
|
|
734
|
+
```
|
|
735
|
+
|
|
736
|
+
### 按钮配置
|
|
737
|
+
|
|
738
|
+
#### 顶部按钮:`btnList`
|
|
739
|
+
|
|
740
|
+
```js
|
|
741
|
+
btnList: [
|
|
742
|
+
{ label: "上传账单", type: "blue", btnEvent: () => { this.uploadDialogVisible = true; } },
|
|
743
|
+
{ label: "导出", type: "primary", isShow: () => this.canExport, btnEvent: this.exportList }
|
|
744
|
+
]
|
|
745
|
+
```
|
|
746
|
+
|
|
747
|
+
#### 底部按钮:默认查询、重置和 `optBtnList`
|
|
748
|
+
|
|
749
|
+
```vue
|
|
750
|
+
<InflyForm
|
|
751
|
+
:formData="formData"
|
|
752
|
+
:filterList="filterList"
|
|
753
|
+
:hideResetBtn="false"
|
|
754
|
+
:optBtnList="[{ label: '保存', type: 'primary', btnEvent: 'submit' }]"
|
|
755
|
+
@initData="search"
|
|
756
|
+
@submit="submitForm"
|
|
757
|
+
/>
|
|
758
|
+
```
|
|
759
|
+
|
|
760
|
+
#### 导出按钮
|
|
761
|
+
|
|
762
|
+
导出请求实例按 `exportFunc -> request prop -> this.$axios` 的顺序解析;组件不再内置 `REST` fallback。独立使用 `InflyForm` 时,如果页面没有全局注入 `$axios`,需要显式传入 `request` 或在按钮上配置 `exportFunc`。
|
|
763
|
+
|
|
764
|
+
`InflyForm` 直接调用 `@infly/ts-libs` 的 `exportFile`,不会注册或导出 `fileExportMixin`。应用若需要全局 `$exportFile`,使用:
|
|
765
|
+
|
|
766
|
+
```javascript
|
|
767
|
+
import { fileExportMixin } from "@infly/libs/adapters/vue2/module/file-export.js";
|
|
768
|
+
|
|
769
|
+
Vue.mixin(fileExportMixin);
|
|
770
|
+
```
|
|
771
|
+
|
|
772
|
+
```vue
|
|
773
|
+
<InflyForm
|
|
774
|
+
:formData="formData"
|
|
775
|
+
:filterList="filterList"
|
|
776
|
+
:btnList="btnList"
|
|
777
|
+
:request="$axios"
|
|
778
|
+
/>
|
|
779
|
+
```
|
|
780
|
+
|
|
781
|
+
```js
|
|
782
|
+
btnList: [
|
|
783
|
+
{
|
|
784
|
+
label: "导出",
|
|
785
|
+
type: "success",
|
|
786
|
+
exportUrl: "/admin/reconciliation/bills/export/",
|
|
787
|
+
exportFileName: "金融营销对账账单",
|
|
788
|
+
exportMethod: "get",
|
|
789
|
+
dealParams: (params, formData) => ({ ...params, keyword: formData.keyword })
|
|
790
|
+
}
|
|
791
|
+
]
|
|
792
|
+
```
|
|
793
|
+
|
|
794
|
+
## AI 维护规则
|
|
795
|
+
|
|
796
|
+
1. 新增或修改 `InflyList` / `InflyForm` 的 prop、事件、插槽、列类型、字段类型、配置字段时,同步更新本 README。
|
|
797
|
+
2. 每个新增能力至少提供一个完整示例,优先参考 `apps/postal-benefits-platform/src/shared/pages/` 中已经存在的写法。
|
|
798
|
+
3. 公共组件改动必须保持旧配置语义不变;新能力优先通过显式配置启用。
|
|
799
|
+
4. 交付说明中写清影响范围、已验证路径和未覆盖风险。
|