@infly/ui 1.0.13 → 1.0.15
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 +18 -1
- package/package.json +2 -5
package/README.md
CHANGED
|
@@ -323,6 +323,7 @@ export default {
|
|
|
323
323
|
| `btnList` | `Array` | `[]` | 表单上方按钮列表。 | `[{ label: "上传", type: "blue", btnEvent: this.openDialog }]` |
|
|
324
324
|
| `filterList` | `Array` | `[]` | 表单字段配置。 | `[{ label: "名称", name: "name", type: "infly-input" }]` |
|
|
325
325
|
| `reqParams` | `Object` | `{}` | 当前请求参数,导出按钮会从中取参数。通常由 `InflyList` 传入。 | `:reqParams="{ keyword: formData.keyword }"` |
|
|
326
|
+
| `request` | `Function` | `null` | 导出按钮使用的请求实例。导出请求优先级为按钮 `exportFunc`、`request` prop、组件实例 `this.$axios`。 | `:request="$axios"` |
|
|
326
327
|
| `hideSearchBtn` | `Boolean` | `false` | 隐藏底部默认“查询”按钮。 | `hideSearchBtn` |
|
|
327
328
|
| `hideResetBtn` | `Boolean` | `true` | 隐藏底部默认“重置”按钮。默认隐藏。 | `:hideResetBtn="false"` |
|
|
328
329
|
| `isEdit` | `Boolean \| null` | `null` | 强制编辑/展示态;为 `null` 时按路由 `mode` 判断。 | `:isEdit="false"` |
|
|
@@ -352,6 +353,7 @@ export default {
|
|
|
352
353
|
| `reset-form` | 底部默认“重置”按钮点击,参数为初始表单快照。 | `@reset-form="(data) => Object.assign(formData, data)"` |
|
|
353
354
|
| `submit` | 按钮 `btnEvent: "submit"` 且校验通过。 | `@submit="submitForm"` |
|
|
354
355
|
| `secTabChange` / `sec-tab-change` | `type: "secTab"` 切换。 | `@secTabChange="handleSecTabChange"` |
|
|
356
|
+
| `export-request-error` | 导出按钮配置了 `exportUrl` 但没有可用请求实例时触发。 | `@export-request-error="handleExportRequestError"` |
|
|
355
357
|
| 自定义事件 | `btnEvent` 为字符串时直接 emit。 | `{ label: "保存", btnEvent: "save" }` + `@save="save"` |
|
|
356
358
|
|
|
357
359
|
### 方法
|
|
@@ -444,6 +446,8 @@ filterList: [
|
|
|
444
446
|
type: "institution-select",
|
|
445
447
|
title: "选择省份",
|
|
446
448
|
btnText: "选择",
|
|
449
|
+
request: this.$axios,
|
|
450
|
+
reqModule: "admin",
|
|
447
451
|
levelTypes: "1",
|
|
448
452
|
levelNameKey: "province_level_name_filter",
|
|
449
453
|
hideTips: true
|
|
@@ -451,6 +455,8 @@ filterList: [
|
|
|
451
455
|
]
|
|
452
456
|
```
|
|
453
457
|
|
|
458
|
+
`InstitutionSelect` 请求实例优先使用 `request` prop,其次使用组件实例 `this.$axios`。默认接口为 `/${reqModule}/level/`,也可以通过 `reqUrl` 显式覆盖;组件不再读取外部工具库的环境信息推导 `reqModule`。
|
|
459
|
+
|
|
454
460
|
#### 复选:`infly-checkbox` / `InflyCheckBox`
|
|
455
461
|
|
|
456
462
|
```js
|
|
@@ -688,7 +694,7 @@ filterList: [
|
|
|
688
694
|
```js
|
|
689
695
|
btnList: [
|
|
690
696
|
{ label: "上传账单", type: "blue", btnEvent: () => { this.uploadDialogVisible = true; } },
|
|
691
|
-
{ label: "导出", type: "primary", isShow: () =>
|
|
697
|
+
{ label: "导出", type: "primary", isShow: () => this.canExport, btnEvent: this.exportList }
|
|
692
698
|
]
|
|
693
699
|
```
|
|
694
700
|
|
|
@@ -707,6 +713,17 @@ btnList: [
|
|
|
707
713
|
|
|
708
714
|
#### 导出按钮
|
|
709
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
|
+
|
|
710
727
|
```js
|
|
711
728
|
btnList: [
|
|
712
729
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infly/ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "组件库 ",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -25,8 +25,5 @@
|
|
|
25
25
|
"infly-ui"
|
|
26
26
|
],
|
|
27
27
|
"author": "Kahal",
|
|
28
|
-
"license": "ISC"
|
|
29
|
-
"peerDependencies": {
|
|
30
|
-
"infly-libs": "^2.0.0"
|
|
31
|
-
}
|
|
28
|
+
"license": "ISC"
|
|
32
29
|
}
|