@infly/ui 1.0.15 → 1.0.17
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 +43 -43
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -321,10 +321,10 @@ export default {
|
|
|
321
321
|
| `formData` | `Object` | 必填 | 表单数据对象,字段通过 `name` 双向绑定。 | `:formData="{ keyword: '' }"` |
|
|
322
322
|
| `formRef` | `String` | `"formRef"` | 内部 `el-form` ref 名称,供 `validate()` 等方法使用。 | `formRef="searchFormRef"` |
|
|
323
323
|
| `btnList` | `Array` | `[]` | 表单上方按钮列表。 | `[{ label: "上传", type: "blue", btnEvent: this.openDialog }]` |
|
|
324
|
-
| `filterList` | `Array` | `[]` | 表单字段配置。 | `[{ label: "名称", name: "name", type: "infly-input" }]` |
|
|
325
|
-
| `reqParams` | `Object` | `{}` | 当前请求参数,导出按钮会从中取参数。通常由 `InflyList` 传入。 | `:reqParams="{ keyword: formData.keyword }"` |
|
|
326
|
-
| `request` | `Function` | `null` | 导出按钮使用的请求实例。导出请求优先级为按钮 `exportFunc`、`request` prop、组件实例 `this.$axios`。 | `:request="$axios"` |
|
|
327
|
-
| `hideSearchBtn` | `Boolean` | `false` | 隐藏底部默认“查询”按钮。 | `hideSearchBtn` |
|
|
324
|
+
| `filterList` | `Array` | `[]` | 表单字段配置。 | `[{ label: "名称", name: "name", type: "infly-input" }]` |
|
|
325
|
+
| `reqParams` | `Object` | `{}` | 当前请求参数,导出按钮会从中取参数。通常由 `InflyList` 传入。 | `:reqParams="{ keyword: formData.keyword }"` |
|
|
326
|
+
| `request` | `Function` | `null` | 导出按钮使用的请求实例。导出请求优先级为按钮 `exportFunc`、`request` prop、组件实例 `this.$axios`。 | `:request="$axios"` |
|
|
327
|
+
| `hideSearchBtn` | `Boolean` | `false` | 隐藏底部默认“查询”按钮。 | `hideSearchBtn` |
|
|
328
328
|
| `hideResetBtn` | `Boolean` | `true` | 隐藏底部默认“重置”按钮。默认隐藏。 | `:hideResetBtn="false"` |
|
|
329
329
|
| `isEdit` | `Boolean \| null` | `null` | 强制编辑/展示态;为 `null` 时按路由 `mode` 判断。 | `:isEdit="false"` |
|
|
330
330
|
| `optBtnList` | `Array` | `[]` | 底部查询/重置后的附加按钮。 | `:optBtnList="[{ label: '保存', type: 'primary', btnEvent: 'submit' }]"` |
|
|
@@ -351,10 +351,10 @@ export default {
|
|
|
351
351
|
| --- | --- | --- |
|
|
352
352
|
| `initData` | 底部默认“查询”按钮点击。 | `@initData="search"` |
|
|
353
353
|
| `reset-form` | 底部默认“重置”按钮点击,参数为初始表单快照。 | `@reset-form="(data) => Object.assign(formData, data)"` |
|
|
354
|
-
| `submit` | 按钮 `btnEvent: "submit"` 且校验通过。 | `@submit="submitForm"` |
|
|
355
|
-
| `secTabChange` / `sec-tab-change` | `type: "secTab"` 切换。 | `@secTabChange="handleSecTabChange"` |
|
|
356
|
-
| `export-request-error` | 导出按钮配置了 `exportUrl` 但没有可用请求实例时触发。 | `@export-request-error="handleExportRequestError"` |
|
|
357
|
-
| 自定义事件 | `btnEvent` 为字符串时直接 emit。 | `{ label: "保存", btnEvent: "save" }` + `@save="save"` |
|
|
354
|
+
| `submit` | 按钮 `btnEvent: "submit"` 且校验通过。 | `@submit="submitForm"` |
|
|
355
|
+
| `secTabChange` / `sec-tab-change` | `type: "secTab"` 切换。 | `@secTabChange="handleSecTabChange"` |
|
|
356
|
+
| `export-request-error` | 导出按钮配置了 `exportUrl` 但没有可用请求实例时触发。 | `@export-request-error="handleExportRequestError"` |
|
|
357
|
+
| 自定义事件 | `btnEvent` 为字符串时直接 emit。 | `{ label: "保存", btnEvent: "save" }` + `@save="save"` |
|
|
358
358
|
|
|
359
359
|
### 方法
|
|
360
360
|
|
|
@@ -444,19 +444,19 @@ filterList: [
|
|
|
444
444
|
label: "所属省份",
|
|
445
445
|
name: "province_level_id",
|
|
446
446
|
type: "institution-select",
|
|
447
|
-
title: "选择省份",
|
|
448
|
-
btnText: "选择",
|
|
449
|
-
request: this.$axios,
|
|
450
|
-
reqModule: "admin",
|
|
451
|
-
levelTypes: "1",
|
|
452
|
-
levelNameKey: "province_level_name_filter",
|
|
453
|
-
hideTips: true
|
|
454
|
-
}
|
|
455
|
-
]
|
|
456
|
-
```
|
|
457
|
-
|
|
458
|
-
`InstitutionSelect` 请求实例优先使用 `request` prop,其次使用组件实例 `this.$axios`。默认接口为 `/${reqModule}/level/`,也可以通过 `reqUrl` 显式覆盖;组件不再读取外部工具库的环境信息推导 `reqModule`。
|
|
459
|
-
|
|
447
|
+
title: "选择省份",
|
|
448
|
+
btnText: "选择",
|
|
449
|
+
request: this.$axios,
|
|
450
|
+
reqModule: "admin",
|
|
451
|
+
levelTypes: "1",
|
|
452
|
+
levelNameKey: "province_level_name_filter",
|
|
453
|
+
hideTips: true
|
|
454
|
+
}
|
|
455
|
+
]
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
`InstitutionSelect` 请求实例优先使用 `request` prop,其次使用组件实例 `this.$axios`。默认接口为 `/${reqModule}/level/`,也可以通过 `reqUrl` 显式覆盖;组件不再读取外部工具库的环境信息推导 `reqModule`。
|
|
459
|
+
|
|
460
460
|
#### 复选:`infly-checkbox` / `InflyCheckBox`
|
|
461
461
|
|
|
462
462
|
```js
|
|
@@ -692,11 +692,11 @@ filterList: [
|
|
|
692
692
|
#### 顶部按钮:`btnList`
|
|
693
693
|
|
|
694
694
|
```js
|
|
695
|
-
btnList: [
|
|
696
|
-
{ label: "上传账单", type: "blue", btnEvent: () => { this.uploadDialogVisible = true; } },
|
|
697
|
-
{ label: "导出", type: "primary", isShow: () => this.canExport, btnEvent: this.exportList }
|
|
698
|
-
]
|
|
699
|
-
```
|
|
695
|
+
btnList: [
|
|
696
|
+
{ label: "上传账单", type: "blue", btnEvent: () => { this.uploadDialogVisible = true; } },
|
|
697
|
+
{ label: "导出", type: "primary", isShow: () => this.canExport, btnEvent: this.exportList }
|
|
698
|
+
]
|
|
699
|
+
```
|
|
700
700
|
|
|
701
701
|
#### 底部按钮:默认查询、重置和 `optBtnList`
|
|
702
702
|
|
|
@@ -711,23 +711,23 @@ btnList: [
|
|
|
711
711
|
/>
|
|
712
712
|
```
|
|
713
713
|
|
|
714
|
-
#### 导出按钮
|
|
715
|
-
|
|
716
|
-
导出请求实例按 `exportFunc -> request prop -> this.$axios` 的顺序解析;组件不再内置 `REST` fallback。独立使用 `InflyForm` 时,如果页面没有全局注入 `$axios`,需要显式传入 `request` 或在按钮上配置 `exportFunc`。
|
|
717
|
-
|
|
718
|
-
```vue
|
|
719
|
-
<InflyForm
|
|
720
|
-
:formData="formData"
|
|
721
|
-
:filterList="filterList"
|
|
722
|
-
:btnList="btnList"
|
|
723
|
-
:request="$axios"
|
|
724
|
-
/>
|
|
725
|
-
```
|
|
726
|
-
|
|
727
|
-
```js
|
|
728
|
-
btnList: [
|
|
729
|
-
{
|
|
730
|
-
label: "导出",
|
|
714
|
+
#### 导出按钮
|
|
715
|
+
|
|
716
|
+
导出请求实例按 `exportFunc -> request prop -> this.$axios` 的顺序解析;组件不再内置 `REST` fallback。独立使用 `InflyForm` 时,如果页面没有全局注入 `$axios`,需要显式传入 `request` 或在按钮上配置 `exportFunc`。
|
|
717
|
+
|
|
718
|
+
```vue
|
|
719
|
+
<InflyForm
|
|
720
|
+
:formData="formData"
|
|
721
|
+
:filterList="filterList"
|
|
722
|
+
:btnList="btnList"
|
|
723
|
+
:request="$axios"
|
|
724
|
+
/>
|
|
725
|
+
```
|
|
726
|
+
|
|
727
|
+
```js
|
|
728
|
+
btnList: [
|
|
729
|
+
{
|
|
730
|
+
label: "导出",
|
|
731
731
|
type: "success",
|
|
732
732
|
exportUrl: "/admin/reconciliation/bills/export/",
|
|
733
733
|
exportFileName: "金融营销对账账单",
|