@hzab/form-render 1.7.18 → 1.7.19
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/CHANGELOG.md +3 -3
- package/LICENSE +21 -0
- package/dist/common/date-utils.d.ts +1 -0
- package/dist/common/event.d.ts +5 -0
- package/dist/common/formily-utils.d.ts +54 -0
- package/dist/common/global-props-context.d.ts +8 -0
- package/dist/common/location-utils.d.ts +6 -0
- package/dist/common/schema-handler.d.ts +90 -0
- package/dist/common/schema-merge.d.ts +12 -0
- package/dist/components/ArrayBase/index.d.ts +75 -0
- package/dist/components/ArrayBase/style.d.ts +2 -0
- package/dist/components/ArrayCards/index.d.ts +13 -0
- package/dist/components/ArrayCards/style.d.ts +4 -0
- package/dist/components/ArrayTable/index.d.ts +51 -0
- package/dist/components/ArrayTable/style.d.ts +7 -0
- package/dist/components/CheckboxWithTip/index.d.ts +15 -0
- package/dist/components/DatePicker/index.d.ts +5 -0
- package/dist/components/LocationListPicker/components/AddrList/index.d.ts +3 -0
- package/dist/components/LocationListPicker/components/Popup/index.d.ts +15 -0
- package/dist/components/LocationListPicker/index.d.ts +3 -0
- package/dist/components/LocationPicker/Map/AMap/common/loader.d.ts +2 -0
- package/dist/components/LocationPicker/Map/AMap/common/utils.d.ts +130 -0
- package/dist/components/LocationPicker/common/utils.d.ts +19 -0
- package/dist/components/LocationPicker/components/ModalContent/index.d.ts +3 -0
- package/dist/components/LocationPicker/components/Notice/index.d.ts +2 -0
- package/dist/components/LocationPicker/components/PickerInfo/index.d.ts +3 -0
- package/dist/components/LocationPicker/components/ResInfo/index.d.ts +8 -0
- package/dist/components/LocationPicker/index.d.ts +3 -0
- package/dist/components/LocationPicker/servers/index.d.ts +21 -0
- package/dist/components/PersonnelSelect/index.d.ts +6 -0
- package/dist/components/PersonnelSelect/type.d.ts +88 -0
- package/dist/components/RadioGroupWithTip/index.d.ts +14 -0
- package/dist/components/RichEditor/components/handleMobileRem/index.d.ts +3 -0
- package/dist/components/RichEditor/components/handleMobileVw/index.d.ts +3 -0
- package/dist/components/RichEditor/index.d.ts +32 -0
- package/dist/components/Text/index.d.ts +9 -0
- package/dist/components/TreeCheckbox/common/utils.d.ts +74 -0
- package/dist/components/TreeCheckbox/components/CheckboxTable/index.d.ts +2 -0
- package/dist/components/TreeCheckbox/components/Render/index.d.ts +2 -0
- package/dist/components/TreeCheckbox/components/TabsRender/index.d.ts +2 -0
- package/dist/components/TreeCheckbox/index.d.ts +3 -0
- package/dist/components/Upload/common/OfflineUpload.d.ts +3 -0
- package/dist/components/Upload/common/checkFileType.d.ts +3 -0
- package/dist/components/Upload/common/customRequest.d.ts +32 -0
- package/dist/components/Upload/common/fileName.d.ts +3 -0
- package/dist/components/Upload/common/handleIOFileList.d.ts +133 -0
- package/dist/components/Upload/common/nanoid.d.ts +2 -0
- package/dist/components/Upload/components/Image/index.d.ts +3 -0
- package/dist/components/Upload/components/ItemList/ItemRender.d.ts +2 -0
- package/dist/components/Upload/components/ItemList/index.d.ts +2 -0
- package/dist/components/Upload/components/PreviewModal/index.d.ts +5 -0
- package/dist/components/Upload/components/PreviewModal/previewRender.d.ts +12 -0
- package/dist/components/Upload/index.d.ts +2 -0
- package/dist/components/UserSelect/index.d.ts +29 -0
- package/dist/components/index.d.ts +14 -0
- package/dist/globalConfig.d.ts +6 -0
- package/dist/index.cjs +9 -0
- package/dist/index.css +2 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +3227 -0
- package/package.json +79 -72
- package/src/common/schema-handler.ts +2 -2
- package/src/components/ArrayBase/index.tsx +7 -5
- package/src/components/ArrayCards/index.tsx +5 -4
- package/src/components/ArrayTable/index.tsx +9 -7
- package/src/components/DatePicker/index.tsx +1 -1
- package/src/components/LocationListPicker/components/Popup/index.tsx +1 -1
- package/src/components/LocationListPicker/index.tsx +3 -3
- package/src/components/LocationPicker/Map/AMap/common/utils.ts +9 -9
- package/src/components/LocationPicker/common/utils.ts +5 -5
- package/src/components/LocationPicker/components/ModalContent/index.tsx +5 -5
- package/src/components/PersonnelSelect/type.ts +1 -1
- package/src/components/RichEditor/components/handleMobileRem/index.tsx +2 -2
- package/src/components/RichEditor/components/handleMobileVw/index.tsx +1 -1
- package/src/components/RichEditor/index.tsx +1 -1
- package/src/components/TreeCheckbox/common/utils.ts +1 -1
- package/src/components/Upload/common/handleIOFileList.ts +2 -2
- package/src/components/Upload/uploader-input.jsx +1 -1
- package/src/components/Upload/uploader.jsx +6 -12
- package/src/components/UserSelect/index.tsx +1 -1
- package/src/global.d.ts +12 -0
- package/src/index.tsx +2 -2
- package/src/vite-env.d.ts +1 -0
- package/README.md +0 -330
- package/docs/README.md +0 -21
- package/docs/components/ArrayCards.md +0 -68
- package/docs/components/ArrayTable.md +0 -111
- package/docs/components/CheckboxWithTip.md +0 -43
- package/docs/components/DatePicker.md +0 -54
- package/docs/components/LocationListPicker.md +0 -41
- package/docs/components/LocationPicker.md +0 -67
- package/docs/components/PersonnelSelect.md +0 -77
- package/docs/components/RadioGroupWithTip.md +0 -43
- package/docs/components/RichEditor.md +0 -94
- package/docs/components/Text.md +0 -26
- package/docs/components/TreeCheckbox.md +0 -52
- package/docs/components/Upload.md +0 -77
- package/docs/components/UserSelect.md +0 -59
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
# LocationPicker
|
|
2
|
-
|
|
3
|
-
地图选点组件,基于高德地图。支持弹窗 / 内嵌展示,以及点、线、面绘制。
|
|
4
|
-
|
|
5
|
-
## 使用前安装依赖
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install @amap/amap-jsapi-loader
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## 注意事项
|
|
12
|
-
|
|
13
|
-
- `isObjectRes` 在 `@hzab/form-render@0.5.0` 版本中去除,结果全部存放在对象中
|
|
14
|
-
- `changeMode` 在 `@hzab/form-render@0.5.1` 版本中去除,仅允许点击地图选点
|
|
15
|
-
|
|
16
|
-
## Schema 示例
|
|
17
|
-
|
|
18
|
-
```json
|
|
19
|
-
{
|
|
20
|
-
"x-component": "LocationPicker",
|
|
21
|
-
"x-component-props": {
|
|
22
|
-
"mode": "dialog",
|
|
23
|
-
"hasSearch": true,
|
|
24
|
-
"lonKey": "longitude",
|
|
25
|
-
"latKey": "latitude",
|
|
26
|
-
"addrKey": "address"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
独立使用:
|
|
32
|
-
|
|
33
|
-
```jsx
|
|
34
|
-
import { LocationPicker } from "@hzab/form-render/src/components";
|
|
35
|
-
|
|
36
|
-
export default function Demo() {
|
|
37
|
-
return <LocationPicker mode="dialog" hasSearch />;
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### LocationPicker Attributes
|
|
42
|
-
|
|
43
|
-
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
44
|
-
| ------------------ | ------- | ---- | --------- | ---- |
|
|
45
|
-
| mode | string | 否 | dialog | 地图显示类型:`dialog` 弹窗、`show` 直接显示 |
|
|
46
|
-
| element | string | 否 | Polypoint | 地图绘制元素:`Polypoint` / `Polyline` / `Polygon` |
|
|
47
|
-
| layout | string | 否 | ver | 选择器与地图布局:`hor` 水平、`ver` 垂直 |
|
|
48
|
-
| hasSearch | boolean | 否 | true | 是否允许搜索 |
|
|
49
|
-
| isAutoFixAddr | boolean | 否 | false | 打开地图时是否根据经纬度自动修正已填地址 |
|
|
50
|
-
| lonKey | string | 否 | longitude | 经度字段 key |
|
|
51
|
-
| latKey | string | 否 | latitude | 纬度字段 key |
|
|
52
|
-
| addrKey | string | 否 | address | 地址字段 key |
|
|
53
|
-
| pointsKey | string | 否 | points | 点位集合字段 key |
|
|
54
|
-
| isAutoSearch | boolean | 否 | true | 搜索框是否自动搜索 |
|
|
55
|
-
| modalConf | Object | 否 | - | 弹窗额外配置 |
|
|
56
|
-
| markerIconConf | Object | 否 | - | marker icon 配置对象 |
|
|
57
|
-
| icons | Object | 否 | - | icon 图片配置,见下表 |
|
|
58
|
-
| getCurPositionConf | Object | 否 | - | `getCurrentPosition` 配置 |
|
|
59
|
-
|
|
60
|
-
#### icons
|
|
61
|
-
|
|
62
|
-
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
63
|
-
| ------------ | ------ | ---- | ------ | ---- |
|
|
64
|
-
| markerIcon | string | 否 | - | marker icon 图片地址 |
|
|
65
|
-
| pickerIcon | string | 否 | - | 选点 icon 图片地址或元素 |
|
|
66
|
-
| positionIcon | string | 否 | - | 定位 icon 图片地址或元素 |
|
|
67
|
-
| resetIcon | string | 否 | - | 重置 icon 图片地址或元素 |
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
# PersonnelSelect / RemoteSelect
|
|
2
|
-
|
|
3
|
-
远程人员搜索下拉框。`PersonnelSelect` 为 Formily `connect` 包装;底层实现为 `RemoteSelect`,支持远程分页加载、搜索与自定义列表项。
|
|
4
|
-
|
|
5
|
-
## Schema 示例
|
|
6
|
-
|
|
7
|
-
```jsx
|
|
8
|
-
<FormRender
|
|
9
|
-
schema={schema}
|
|
10
|
-
schemaScope={{
|
|
11
|
-
loadPersonnel(search, pagination) {
|
|
12
|
-
return Promise.resolve({
|
|
13
|
-
list: [{ userId: "1", userName: "张三", phoneNumber: "13800000000" }],
|
|
14
|
-
pagination: { ...pagination, total: 1 },
|
|
15
|
-
});
|
|
16
|
-
},
|
|
17
|
-
}}
|
|
18
|
-
/>
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
```json
|
|
22
|
-
{
|
|
23
|
-
"x-component": "PersonnelSelect",
|
|
24
|
-
"x-component-props": {
|
|
25
|
-
"mode": "multiple",
|
|
26
|
-
"labelInValue": true,
|
|
27
|
-
"loadData": "{{loadPersonnel}}"
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
也可直接使用 `RemoteSelect`:
|
|
33
|
-
|
|
34
|
-
```json
|
|
35
|
-
{
|
|
36
|
-
"x-component": "RemoteSelect",
|
|
37
|
-
"x-component-props": {
|
|
38
|
-
"mode": "tags",
|
|
39
|
-
"loadData": "{{loadPersonnel}}"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### Attributes
|
|
45
|
-
|
|
46
|
-
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
47
|
-
| ----------------- | -------- | ---- | ------ | ---- |
|
|
48
|
-
| loadData | Function | 是 | - | `(search, pagination) => Promise<{ list, pagination }>` |
|
|
49
|
-
| searchData | Function | 否 | - | 额外查询函数 |
|
|
50
|
-
| mode | string | 是 | - | `multiple` 或多选 tags 模式(`tags`) |
|
|
51
|
-
| labelKey | string | 否 | userName | 列表项 label 字段 |
|
|
52
|
-
| valueKey | string | 否 | userId | 列表项 value 字段 |
|
|
53
|
-
| disabledKey | string | 否 | disabled | 禁用字段 |
|
|
54
|
-
| labelInValue | boolean | 否 | false | 是否以 `{ label, value }` 形式回传 |
|
|
55
|
-
| isClearable | boolean | 否 | false | 下拉收起时是否清空列表缓存 |
|
|
56
|
-
| initialPagination | Object | 否 | `{ pageNum: 1, pageSize: 10 }` | 初始分页 |
|
|
57
|
-
| listItemConfigs | Array | 否 | 姓名/主部门/主驻点/手机号/身份证 | 列表项展示字段配置 `{ label, key }[]` |
|
|
58
|
-
| renderItem | Function | 否 | - | 自定义列表项渲染 |
|
|
59
|
-
| customItemNode | ReactNode\|Function | 否 | - | 自定义列表项中附加节点 |
|
|
60
|
-
| avataProps | Object | 否 | - | antd Avatar props |
|
|
61
|
-
| disabledStyle | Function | 否 | - | `(disabled) => CSSProperties` |
|
|
62
|
-
|
|
63
|
-
其余 props 透传 antd Select(如 `placeholder`、`disabled`)。
|
|
64
|
-
|
|
65
|
-
### loadData 返回
|
|
66
|
-
|
|
67
|
-
```ts
|
|
68
|
-
{
|
|
69
|
-
list: Array<{ label?: string; value?: string | number; [key: string]: any }>;
|
|
70
|
-
pagination: {
|
|
71
|
-
pageNum: number;
|
|
72
|
-
pageSize: number;
|
|
73
|
-
total?: number;
|
|
74
|
-
hasMore?: boolean;
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
```
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# RadioGroupWithTip
|
|
2
|
-
|
|
3
|
-
带描述文案、支持单项禁用的单选组。数据优先取 `dataSource`,否则取 Formily `field.dataSource`(schema `enum`)。
|
|
4
|
-
|
|
5
|
-
## Schema 示例
|
|
6
|
-
|
|
7
|
-
```json
|
|
8
|
-
{
|
|
9
|
-
"x-component": "RadioGroupWithTip",
|
|
10
|
-
"enum": [
|
|
11
|
-
{
|
|
12
|
-
"label": "单次采集",
|
|
13
|
-
"value": 1,
|
|
14
|
-
"desc": "以人员为单位开展信息采集。"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"label": "按月采集",
|
|
18
|
-
"value": 2,
|
|
19
|
-
"desc": "以自然月为周期定期采集。",
|
|
20
|
-
"disabled": true
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
}
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
### RadioGroupWithTip Attributes
|
|
27
|
-
|
|
28
|
-
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
29
|
-
| ---------- | -------------- | ---- | ------ | ---- |
|
|
30
|
-
| value | string\|number | 否 | - | 当前选中值 |
|
|
31
|
-
| onChange | Function | 否 | - | 选中变化回调 |
|
|
32
|
-
| dataSource | Array | 否 | field.dataSource | 选项列表,见下表 |
|
|
33
|
-
|
|
34
|
-
其余 props 透传 antd `Radio.Group`。
|
|
35
|
-
|
|
36
|
-
### dataSource / enum 子项
|
|
37
|
-
|
|
38
|
-
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
39
|
-
| -------- | -------------- | ---- | ------ | ---- |
|
|
40
|
-
| label | string | 是 | - | 主标题 |
|
|
41
|
-
| value | string\|number | 是 | - | 选项值 |
|
|
42
|
-
| desc | string | 否 | - | 描述文案 |
|
|
43
|
-
| disabled | boolean | 否 | false | 单项禁用 |
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
# RichEditor
|
|
2
|
-
|
|
3
|
-
基于 wangEditor 的富文本编辑器,支持 OSS / 私有化上传。Schema 中可使用 `RichEditor` 或别名 `Editor`。
|
|
4
|
-
|
|
5
|
-
## PC 使用前安装依赖
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install @wangeditor/editor-for-react
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Schema 示例
|
|
12
|
-
|
|
13
|
-
```json
|
|
14
|
-
{
|
|
15
|
-
"x-component": "RichEditor",
|
|
16
|
-
"x-component-props": {
|
|
17
|
-
"height": "400px",
|
|
18
|
-
"uploadMode": "oss",
|
|
19
|
-
"toolbarConfig": {},
|
|
20
|
-
"editorConfig": {
|
|
21
|
-
"placeholder": "请输入内容..."
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
独立使用:
|
|
28
|
-
|
|
29
|
-
```jsx
|
|
30
|
-
import { RichEditor } from "@hzab/form-render/src/components";
|
|
31
|
-
import { useRef } from "react";
|
|
32
|
-
|
|
33
|
-
export default function Demo() {
|
|
34
|
-
const editorRef = useRef();
|
|
35
|
-
return <RichEditor ref={editorRef} height="400px" />;
|
|
36
|
-
}
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
向富文本 set 内容:`editorRef.current.setEditorContent(HtmlString)`
|
|
40
|
-
|
|
41
|
-
获取富文本当前内容:`editorRef.current.getEditorContent()`
|
|
42
|
-
|
|
43
|
-
### RichEditor Attributes
|
|
44
|
-
|
|
45
|
-
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
46
|
-
| ----------------- | ----------------------- | ---- | ------ | ---- |
|
|
47
|
-
| value | string | 否 | - | 编辑器 HTML 内容 |
|
|
48
|
-
| onChange | Function | 否 | - | 内容变化回调 |
|
|
49
|
-
| height | string | 否 | - | 编辑器高度 |
|
|
50
|
-
| toolbarConfig | Partial\<IToolbarConfig\> | 否 | {} | 工具栏配置 |
|
|
51
|
-
| editorConfig | Partial\<IEditorConfig\> | 否 | `{ placeholder: '请输入内容...' }` | 编辑器配置 |
|
|
52
|
-
| uploadMode | string | 否 | oss | 上传模式:`oss` / `offline` 等 |
|
|
53
|
-
| ossOpt | Object | 否 | - | OSS 上传配置 |
|
|
54
|
-
| uploadParams | Object | 否 | {} | 上传入参 |
|
|
55
|
-
| ossServerUrl | string | 否 | 全局配置或 `/api/v1/user/oss/getWebOssConfig` | 获取 OSS 配置接口 |
|
|
56
|
-
| ossUrl | string | 否 | 同 ossServerUrl | OSS 配置接口(兼容字段) |
|
|
57
|
-
| offlineServerUrl | string | 否 | - | 私有化上传接口 |
|
|
58
|
-
| offlinePreviewUrl | string | 否 | - | 私有化预览前缀 |
|
|
59
|
-
| customRequest | Function | 否 | - | 自定义上传请求 |
|
|
60
|
-
| zIndex | number | 否 | 9999 | 编辑器层级 |
|
|
61
|
-
|
|
62
|
-
图片上传可在 `editorConfig.MENU_CONF.uploadImage` 中配置,参考 [wangEditor 文档](https://www.wangeditor.com/v5/menu-config.html#upload-image)。
|
|
63
|
-
|
|
64
|
-
```jsx
|
|
65
|
-
editorConfig = {
|
|
66
|
-
MENU_CONF: {
|
|
67
|
-
uploadImage: {
|
|
68
|
-
server: "/api/upload",
|
|
69
|
-
fieldName: "your-custom-name",
|
|
70
|
-
maxFileSize: 1 * 1024 * 1024,
|
|
71
|
-
maxNumberOfFiles: 10,
|
|
72
|
-
allowedFileTypes: ["image/*"],
|
|
73
|
-
meta: { token: "xxx" },
|
|
74
|
-
headers: { Accept: "text/x-json" },
|
|
75
|
-
withCredentials: true,
|
|
76
|
-
timeout: 5 * 1000,
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
};
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## 移动端使用前安装依赖
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
npm install lib-flexible
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
```jsx
|
|
89
|
-
import HandleMobile from "./components/handleMobileVw";
|
|
90
|
-
|
|
91
|
-
export default function Demo() {
|
|
92
|
-
return <HandleMobile content={HtmlString} />;
|
|
93
|
-
}
|
|
94
|
-
```
|
package/docs/components/Text.md
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# Text
|
|
2
|
-
|
|
3
|
-
只读文本展示组件,常用于 schema 合并、LocationListPicker 弹层等内部场景;也可在 schema 中直接使用。
|
|
4
|
-
|
|
5
|
-
## Schema 示例
|
|
6
|
-
|
|
7
|
-
```json
|
|
8
|
-
{
|
|
9
|
-
"x-component": "Text",
|
|
10
|
-
"x-component-props": {
|
|
11
|
-
"content": "静态文案",
|
|
12
|
-
"mode": "div"
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
表单字段有值时优先展示 `value`,否则展示 `content`。
|
|
18
|
-
|
|
19
|
-
### Text Attributes
|
|
20
|
-
|
|
21
|
-
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
22
|
-
| --------- | ------ | ---- | ------ | ---- |
|
|
23
|
-
| value | any | 否 | - | 字段值,优先展示 |
|
|
24
|
-
| content | any | 否 | - | 无 value 时的静态内容 |
|
|
25
|
-
| mode | string | 否 | div | 渲染标签名;`normal` 或不传时为 `div`,也可设为 `span` / `p` 等 |
|
|
26
|
-
| className | string | 否 | - | 附加 class,根节点带 `formily-text` |
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# TreeCheckbox
|
|
2
|
-
|
|
3
|
-
树形多选复选框,支持按层级合并叶子节点,以及最外层 Tab 展示。
|
|
4
|
-
|
|
5
|
-
## Schema 示例
|
|
6
|
-
|
|
7
|
-
```json
|
|
8
|
-
{
|
|
9
|
-
"x-component": "TreeCheckbox",
|
|
10
|
-
"x-component-props": {
|
|
11
|
-
"mergeLeaf": true,
|
|
12
|
-
"mergeFullLeaf": true,
|
|
13
|
-
"tabBox": false,
|
|
14
|
-
"fieldNames": {
|
|
15
|
-
"label": "label",
|
|
16
|
-
"value": "value",
|
|
17
|
-
"children": "children"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
"enum": [
|
|
21
|
-
{
|
|
22
|
-
"label": "一级",
|
|
23
|
-
"value": "1",
|
|
24
|
-
"children": [
|
|
25
|
-
{ "label": "二级-1", "value": "1-1" },
|
|
26
|
-
{ "label": "二级-2", "value": "1-2" }
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
]
|
|
30
|
-
}
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
数据也可通过 `x-component-props.dataSource` 或 `field.dataSource` 传入。
|
|
34
|
-
|
|
35
|
-
### TreeCheckbox Attributes
|
|
36
|
-
|
|
37
|
-
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
38
|
-
| ------------- | ------- | ---- | -------------------------------------------------- | ---- |
|
|
39
|
-
| dataSource | Array | 否 | field.dataSource | 树数据 |
|
|
40
|
-
| mergeFullLeaf | boolean | 否 | true | 合并不存在 children 的层级 |
|
|
41
|
-
| mergeLeaf | boolean | 否 | true | 合并每一层级的叶子节点 |
|
|
42
|
-
| fieldNames | Object | 否 | `{ label, value, children }` | 自定义 options 中字段名 |
|
|
43
|
-
| disabled | boolean | 否 | false | 禁用状态 |
|
|
44
|
-
| readOnly | boolean | 否 | false | 只读状态 |
|
|
45
|
-
| tabBox | boolean | 否 | false | 最外层使用 tab |
|
|
46
|
-
| tabConfList | Array | 否 | - | tab 配置列表;存在时优先用于计算 tab 层级数 |
|
|
47
|
-
| tabLevel | number | 否 | - | tab 层级数(`tabBox === true` 时为 1) |
|
|
48
|
-
| labelKey | string | 否 | label | 兼容旧字段,后续废弃 |
|
|
49
|
-
| valueKey | string | 否 | value | 兼容旧字段,后续废弃 |
|
|
50
|
-
| childrenKey | string | 否 | children | 兼容旧字段,后续废弃 |
|
|
51
|
-
|
|
52
|
-
表单值为选中节点 `value` 组成的数组。
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
# Uploader
|
|
2
|
-
|
|
3
|
-
上传组件——使用 antd upload 组件封装而成
|
|
4
|
-
|
|
5
|
-
- 支持 oss 上传
|
|
6
|
-
- 支持限制文件大小
|
|
7
|
-
- 支持预览
|
|
8
|
-
- 支持配置下载模板
|
|
9
|
-
|
|
10
|
-
### InfoPanel Attributes
|
|
11
|
-
|
|
12
|
-
- 参数参考 antd upload 组件
|
|
13
|
-
- props 参数 会覆盖 antd upload 组件已有配置项
|
|
14
|
-
|
|
15
|
-
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
16
|
-
| -------------------- | -------- | ---- | -------- | ------------------------------------------------------------------------------------ |
|
|
17
|
-
| name | string | 否 | file | 文件名 |
|
|
18
|
-
| accept | string | 否 | - | 接受上传的文件类型, 详见 input accept Attribute |
|
|
19
|
-
| listType | string | 否 | text | 上传列表的内建样式,支持三种基本样式 text, picture 和 picture-card |
|
|
20
|
-
| maxCount | number | 否 | - | 限制上传数量。当为 1 时,始终用最新上传的文件代替当前文件 |
|
|
21
|
-
| maxSize | number | 否 | - | 限制上传的文件大小。 |
|
|
22
|
-
| multiple | boolean | 否 | - | 是否支持多选文件,ie10+ 支持。开启后按住 ctrl 可选择多个文件 |
|
|
23
|
-
| disabled | boolean | 否 | false | 禁用状态 |
|
|
24
|
-
| readOnly | boolean | 否 | false | 只读状态 |
|
|
25
|
-
| isResRemoveArr | boolean | 否 | false | maxCount === 1 时,结果是否自动去除数组嵌套 |
|
|
26
|
-
| uploadMode | string | 否 | oss | 上传模式: 阿里云 oss: oss, 内部定制私有化部署: offline, 文件: file, 自定义: custom, |
|
|
27
|
-
| ossServerUrl | string | 否 | - | 获取 oss 参数的接口,默认 /api/v1/user/oss/getWebOssConfig |
|
|
28
|
-
| ossOpt | Object | 否 | - | oss 上传的配置参数 |
|
|
29
|
-
| fileListConf | Object | 否 | {} | 结果数据配置 |
|
|
30
|
-
| previewConfig | Object | 否 | {} | 预览场景配置(见下表)。仅影响列表/弹窗预览,不进入 onChange / 表单提交 |
|
|
31
|
-
| previewBaseUrl | string | 否 | - | 仅预览使用的域名/路径前缀(糖衣)。与 `previewConfig.url` 并存时,以 `previewConfig.url` 为准;不进入表单提交 |
|
|
32
|
-
| onCountExceed | Function | 否 | - | 数量超出 maxCount 时的回调 |
|
|
33
|
-
| beforeUploadCheck | Function | 否 | - | 追加的 beforeUpload 检查,返回 Promise.reject() 进行拦截 |
|
|
34
|
-
| templateUrl | string | 否 | - | 模板下载的地址 |
|
|
35
|
-
| templateDownloadText | string | 否 | 模板下载 | 模板下载按钮的文案 |
|
|
36
|
-
| uploadParams | Object | 否 | {} | 文件上传接口入参 |
|
|
37
|
-
|
|
38
|
-
### previewConfig 预览配置
|
|
39
|
-
|
|
40
|
-
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
41
|
-
| ---- | ---- | ---- | ------ | ---- |
|
|
42
|
-
| url | string | 否 | - | 预览域名或路径前缀,如 `https://cdn.example.com`。相对路径会拼到此前缀后用于列表缩略图与弹窗预览 |
|
|
43
|
-
| query | object | 否 | - | 追加到预览地址的 query 对象,推荐写法,如 `{ loookType: 1 }` |
|
|
44
|
-
| search | string | 否 | - | `?` 后的原始字符串(可不含 `?`),会先解析再与 `query` 合并;同名键以 `query` 为准 |
|
|
45
|
-
|
|
46
|
-
兼容:把 `query` 写成字符串(如 `"loookType=1"`)时,组件会解析为 `search`,无需立刻改业务 schema。
|
|
47
|
-
|
|
48
|
-
> **边界**:`previewConfig.url` / `previewBaseUrl` 只用于上传列表视图与弹窗预览;`onChange` 与表单提交仍使用后端返回的相对/原始路径,不会提交拼接后的完整地址。
|
|
49
|
-
|
|
50
|
-
### fileListConf 结果数据配置
|
|
51
|
-
|
|
52
|
-
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
53
|
-
| -------- | ------ | ---- | ------ | ---------------------------- | --------- | ---------- | --------- |
|
|
54
|
-
| listMode | string | 否 | array | 列表数据模式 "array" | "jsonStr" | "splitStr" |
|
|
55
|
-
| split | string | 否 | ", " | 字符串列表数据模式下的分隔符 |
|
|
56
|
-
| itemMode | string | 否 | "url" | 子项数据模式 "object" | "file" | "url" | "jsonStr" |
|
|
57
|
-
|
|
58
|
-
### ossOpt
|
|
59
|
-
|
|
60
|
-
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
61
|
-
| --------------- | ------ | ---- | ------ | -------------------------------------------------------------- |
|
|
62
|
-
| axios | Object | 否 | - | 发起请求的 axios |
|
|
63
|
-
| axiosConf | Object | 否 | - | axios 配置 |
|
|
64
|
-
| signatureParams | Object | 否 | - | 请求 oss 上传地址接口的入参 |
|
|
65
|
-
| serverUrl | string | 否 | - | 请求 oss 上传地址的接口,默认 /api/v1/user/oss/getWebOssConfig |
|
|
66
|
-
|
|
67
|
-
#### signatureParams
|
|
68
|
-
|
|
69
|
-
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
70
|
-
| ------- | ------ | ---- | ------ | ----------------------------------------------------------------------------- |
|
|
71
|
-
| fileAcl | string | 否 | - | 是否是私有域上传 private-私有,public-read-公共读,public-read-write-公共读写 |
|
|
72
|
-
|
|
73
|
-
### uploadParams
|
|
74
|
-
|
|
75
|
-
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
76
|
-
| ------- | ------ | ---- | ------ | ----------------------------------------------------------------------------- |
|
|
77
|
-
| fileAcl | string | 否 | - | 是否是私有域上传 private-私有,public-read-公共读,public-read-write-公共读写 |
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
# UserSelect
|
|
2
|
-
|
|
3
|
-
人员下拉选择器,基于 antd Select,支持头像、手机号、身份证号等扩展展示。
|
|
4
|
-
|
|
5
|
-
## Schema 示例
|
|
6
|
-
|
|
7
|
-
```json
|
|
8
|
-
{
|
|
9
|
-
"x-component": "UserSelect",
|
|
10
|
-
"x-component-props": {
|
|
11
|
-
"isAvatar": true,
|
|
12
|
-
"avatarSize": "default",
|
|
13
|
-
"configKey": {
|
|
14
|
-
"phoneKey": "phone",
|
|
15
|
-
"idCardKey": "idCard"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"enum": [
|
|
19
|
-
{
|
|
20
|
-
"label": "张三",
|
|
21
|
-
"value": "1",
|
|
22
|
-
"phone": "13800000000",
|
|
23
|
-
"idCard": "3301**********1234",
|
|
24
|
-
"avatar": "https://example.com/avatar.png"
|
|
25
|
-
}
|
|
26
|
-
]
|
|
27
|
-
}
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
数据源也可通过 Formily `field.dataSource` 或 `x-component-props.options` 传入。
|
|
31
|
-
|
|
32
|
-
### UserSelect Attributes
|
|
33
|
-
|
|
34
|
-
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
35
|
-
| ---------- | -------- | ---- | ------- | ---- |
|
|
36
|
-
| options | Array | 否 | - | 下拉数据;也可使用 schema `enum` / `field.dataSource` |
|
|
37
|
-
| isAvatar | boolean | 否 | false | 是否显示头像 |
|
|
38
|
-
| avatarSize | AvatarSize | 否 | default | antd Avatar 尺寸 |
|
|
39
|
-
| configKey | Object | 否 | - | 自定义字段映射,见下表 |
|
|
40
|
-
| InfoRender | Function | 否 | - | 自定义 option 信息区渲染,入参为 option 对象 |
|
|
41
|
-
|
|
42
|
-
其余 props 透传 antd Select。
|
|
43
|
-
|
|
44
|
-
### configKey
|
|
45
|
-
|
|
46
|
-
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
47
|
-
| --------- | ------ | ---- | ------ | ---- |
|
|
48
|
-
| phoneKey | string | 否 | phone | 手机号字段名 |
|
|
49
|
-
| idCardKey | string | 否 | idCard | 身份证号字段名 |
|
|
50
|
-
|
|
51
|
-
### options 子项
|
|
52
|
-
|
|
53
|
-
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
54
|
-
| ------ | -------------- | ---- | ------ | ---- |
|
|
55
|
-
| label | string | 是 | - | 展示名称 |
|
|
56
|
-
| value | string\|number | 是 | - | 选项值 |
|
|
57
|
-
| avatar | string | 否 | - | 头像 URL |
|
|
58
|
-
| phone | string | 否 | - | 手机号(可被 configKey 覆盖) |
|
|
59
|
-
| idCard | string | 否 | - | 身份证号(可被 configKey 覆盖) |
|