@hzab/form-render 1.7.17 → 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 +8 -0
- 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 -63
- 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 +4 -4
- package/src/components/LocationPicker/Map/AMap/common/loader.ts +2 -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 +2 -3
- package/src/components/Upload/uploader.jsx +8 -1
- 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 -271
- package/src/components/LocationPicker/README.md +0 -44
- package/src/components/RichEditor/README.md +0 -82
- package/src/components/TreeCheckbox/README.md +0 -11
- package/src/components/Upload/README.md +0 -77
package/README.md
DELETED
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
# @hzab/form-render
|
|
2
|
-
|
|
3
|
-
formily schema 表单渲染组件
|
|
4
|
-
|
|
5
|
-
# 组件
|
|
6
|
-
|
|
7
|
-
## Tips
|
|
8
|
-
|
|
9
|
-
- antd 组件样式需要手动引入
|
|
10
|
-
|
|
11
|
-
## 示例
|
|
12
|
-
|
|
13
|
-
#### 项目初始化时挂载全局组件
|
|
14
|
-
|
|
15
|
-
```jsx
|
|
16
|
-
import { setFormilyGlobalComponents } from "@hzab/utils/src/formily/global-components";
|
|
17
|
-
|
|
18
|
-
// 挂载 Test1 组件到 formRender 组件
|
|
19
|
-
setFormilyGlobalComponents({
|
|
20
|
-
Test1() {
|
|
21
|
-
return <div>Test1</div>;
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
// 挂载 Test2 组件到 formRender 组件
|
|
26
|
-
setFormilyGlobalComponents({
|
|
27
|
-
Test2() {
|
|
28
|
-
return <div>Test2</div>;
|
|
29
|
-
},
|
|
30
|
-
Test3() {
|
|
31
|
-
return <div>Test3</div>;
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
```jsx
|
|
37
|
-
import FormRender from "@hzab/form-render";
|
|
38
|
-
|
|
39
|
-
// testSchema 为 formily 生成的 schema json
|
|
40
|
-
<FormRender schema={testSchema} />;
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
#### 组件远程数据
|
|
44
|
-
|
|
45
|
-
- 使用 schemaScope 传入全局配置变量,在响应器的动作响应中调用
|
|
46
|
-
|
|
47
|
-
```jsx
|
|
48
|
-
// schema
|
|
49
|
-
{
|
|
50
|
-
"form": {
|
|
51
|
-
"labelCol": 6,
|
|
52
|
-
"wrapperCol": 12
|
|
53
|
-
},
|
|
54
|
-
"schema": {
|
|
55
|
-
"type": "object",
|
|
56
|
-
"properties": {
|
|
57
|
-
"parentId": {
|
|
58
|
-
"type": "string",
|
|
59
|
-
"title": "上级菜单",
|
|
60
|
-
"x-decorator": "FormItem",
|
|
61
|
-
"x-component": "TreeSelect",
|
|
62
|
-
"x-validator": [],
|
|
63
|
-
"x-component-props": {},
|
|
64
|
-
"x-decorator-props": {},
|
|
65
|
-
"x-reactions": {
|
|
66
|
-
"fulfill": {
|
|
67
|
-
"run": "fetchMenuTree($self);"
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
"name": "parentId",
|
|
71
|
-
"x-designable-id": "i012z5nbd5z",
|
|
72
|
-
"x-index": 0
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// formRender
|
|
79
|
-
<FormRender
|
|
80
|
-
schema={testSchema}
|
|
81
|
-
schemaScope={{
|
|
82
|
-
fetchMenuTree(field) {
|
|
83
|
-
// 模拟请求
|
|
84
|
-
setTimeout(() => {
|
|
85
|
-
// field 目标组件的 配置参数
|
|
86
|
-
// 通过 field.component[1] 可以动态配置目标组件的 props
|
|
87
|
-
// 树选择器 数据源
|
|
88
|
-
field.component[1].treeData = [{ value: 1, label: 1 }];
|
|
89
|
-
}, 1000)
|
|
90
|
-
},
|
|
91
|
-
}}
|
|
92
|
-
/>
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
#### 自定义组件
|
|
96
|
-
|
|
97
|
-
- 使用 components 传入自定义组件,在 schema 中 x-component 配置对应的组件名称
|
|
98
|
-
|
|
99
|
-
```jsx
|
|
100
|
-
// schema
|
|
101
|
-
{
|
|
102
|
-
"form": {
|
|
103
|
-
"labelCol": 6,
|
|
104
|
-
"wrapperCol": 12
|
|
105
|
-
},
|
|
106
|
-
"schema": {
|
|
107
|
-
"type": "object",
|
|
108
|
-
"properties": {
|
|
109
|
-
"parentId": {
|
|
110
|
-
"type": "string",
|
|
111
|
-
"title": "图标选择器",
|
|
112
|
-
"x-decorator": "FormItem",
|
|
113
|
-
"x-component": "IconSelect",
|
|
114
|
-
"x-validator": [],
|
|
115
|
-
"x-component-props": {},
|
|
116
|
-
"x-decorator-props": {},
|
|
117
|
-
"x-reactions": {},
|
|
118
|
-
"name": "parentId",
|
|
119
|
-
"x-designable-id": "i012z5nbd5z",
|
|
120
|
-
"x-index": 0
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// formRender
|
|
127
|
-
<FormRender
|
|
128
|
-
schema={testSchema}
|
|
129
|
-
components={{
|
|
130
|
-
// 自定义组件
|
|
131
|
-
IconSelect() {
|
|
132
|
-
return "IconSelect";
|
|
133
|
-
},
|
|
134
|
-
}}
|
|
135
|
-
/>
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
## API
|
|
139
|
-
|
|
140
|
-
### InfoPanel Attributes
|
|
141
|
-
|
|
142
|
-
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
143
|
-
| ------------------ | -------- | ---- | ---------- | ------------------------------------------------------------------------------------------ |
|
|
144
|
-
| schema | Object | 是 | - | 数据信息的 schema |
|
|
145
|
-
| schemaScope | Object | 否 | - | 全局作用域,用于实现协议表达式变量注入 |
|
|
146
|
-
| layout | Object | 否 | horizontal | 表单布局,horizontal vertical \ inline |
|
|
147
|
-
| initialValues | Object | 否 | - | form 初始值 |
|
|
148
|
-
| components | Object | 否 | - | 自定义组件 |
|
|
149
|
-
| formOptions | Object | 否 | - | createForm 的参数 |
|
|
150
|
-
| emptyValue | string | 否 | N/A | 只读模式 PreviewText emptyValue 配置 |
|
|
151
|
-
| disabled | boolean | 否 | - | 禁用状态 |
|
|
152
|
-
| readOnly | boolean | 否 | - | 只读状态 |
|
|
153
|
-
| onFormValuesChange | Function | 否 | - | 表单事件 (form)=>{} https://core.formilyjs.org/zh-CN/api/entry/form-effect-hooks |
|
|
154
|
-
| onFieldValueChange | Function | 否 | - | 表单项事件 (field, form)=>{} https://core.formilyjs.org/zh-CN/api/entry/field-effect-hooks |
|
|
155
|
-
|
|
156
|
-
### 方法 Methods
|
|
157
|
-
|
|
158
|
-
| 名称 | 参数 | 说明 |
|
|
159
|
-
| ---- | --------- | -------------- |
|
|
160
|
-
| init | form 实例 | 组件初始化执行 |
|
|
161
|
-
|
|
162
|
-
### Schema
|
|
163
|
-
|
|
164
|
-
- 使用 表单编辑器生成:https://designable-antd.formilyjs.org/
|
|
165
|
-
|
|
166
|
-
```js
|
|
167
|
-
{
|
|
168
|
-
"form": {
|
|
169
|
-
"labelCol": 6,
|
|
170
|
-
"wrapperCol": 12
|
|
171
|
-
},
|
|
172
|
-
"schema": {
|
|
173
|
-
"type": "object",
|
|
174
|
-
"properties": {
|
|
175
|
-
// 参数 key
|
|
176
|
-
"parentId": {
|
|
177
|
-
"type": "string",
|
|
178
|
-
// 参数 label
|
|
179
|
-
"title": "上级菜单",
|
|
180
|
-
"x-decorator": "FormItem",
|
|
181
|
-
// 渲染的组件
|
|
182
|
-
"x-component": "TreeSelect",
|
|
183
|
-
// 组件校验
|
|
184
|
-
"x-validator": [],
|
|
185
|
-
// 组件配置
|
|
186
|
-
"x-component-props": {
|
|
187
|
-
"virtual": true,
|
|
188
|
-
"allowClear": true,
|
|
189
|
-
"showSearch": true
|
|
190
|
-
},
|
|
191
|
-
// 容器配置
|
|
192
|
-
"x-decorator-props": {},
|
|
193
|
-
// 响应器
|
|
194
|
-
"x-reactions": {
|
|
195
|
-
// 依赖字段
|
|
196
|
-
"dependencies": [
|
|
197
|
-
{
|
|
198
|
-
"property": "value",
|
|
199
|
-
"type": "any"
|
|
200
|
-
}
|
|
201
|
-
],
|
|
202
|
-
// 响应动作
|
|
203
|
-
"fulfill": {
|
|
204
|
-
// 属性响应,只支持 JS 表达式
|
|
205
|
-
"state": {
|
|
206
|
-
"visible": "{{$deps.menuType === \"C\" || $deps.menuType === \"F\"}}"
|
|
207
|
-
},
|
|
208
|
-
// 动作响应,支持 JS 语句
|
|
209
|
-
"run": "fetchMenuTree($self);"
|
|
210
|
-
}
|
|
211
|
-
},
|
|
212
|
-
// 参数 key
|
|
213
|
-
"name": "parentId",
|
|
214
|
-
// 组件在编辑器中的 ID(必须唯一)
|
|
215
|
-
"x-designable-id": "i012z5nbd5z",
|
|
216
|
-
// 组件在表单中的顺序(必须唯一)
|
|
217
|
-
"x-index": 0,
|
|
218
|
-
// 是否在 table 中展示,目前需要手动添加配置
|
|
219
|
-
"inTable": false
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
# 组件开发流程
|
|
227
|
-
|
|
228
|
-
- 在 config/webpack.config/webpack.config.dev.js 中按需修改 alias 配置的包名,便于本地调试
|
|
229
|
-
- 在 example/typings.d.ts 中按需修改 declare module 配置的包名,解决 ts 报错问题
|
|
230
|
-
- npm run dev
|
|
231
|
-
|
|
232
|
-
## 文件目录
|
|
233
|
-
|
|
234
|
-
- example 本地测试代码
|
|
235
|
-
- src 组件源码
|
|
236
|
-
|
|
237
|
-
## 命令
|
|
238
|
-
|
|
239
|
-
- 生成文档:npm run docs
|
|
240
|
-
- 本地运行:npm run dev
|
|
241
|
-
- 打包编译:npm run build
|
|
242
|
-
|
|
243
|
-
## 发布
|
|
244
|
-
|
|
245
|
-
- npm 源和云效源都需要发布
|
|
246
|
-
|
|
247
|
-
- 命令:npm publish --access public
|
|
248
|
-
- 发布目录:
|
|
249
|
-
- src
|
|
250
|
-
|
|
251
|
-
### nrm
|
|
252
|
-
|
|
253
|
-
- 安装
|
|
254
|
-
npm install -g nrm
|
|
255
|
-
- 增加源
|
|
256
|
-
nrm add aliyun https://packages.aliyun.com/62046985b3ead41b374a17f7/npm/npm-registry/
|
|
257
|
-
- 切换源
|
|
258
|
-
nrm use aliyun
|
|
259
|
-
nrm use npm
|
|
260
|
-
- 登录(账号密码在 https://packages.aliyun.com/npm/npm-registry/guide 查看)
|
|
261
|
-
npm login --registry=https://packages.aliyun.com/62046985b3ead41b374a17f7/npm/npm-registry/
|
|
262
|
-
|
|
263
|
-
## 配置
|
|
264
|
-
|
|
265
|
-
### 配置文件
|
|
266
|
-
|
|
267
|
-
- 本地配置文件:config/config.js
|
|
268
|
-
|
|
269
|
-
### webpack 配置文件
|
|
270
|
-
|
|
271
|
-
- config/webpack.config.js
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
## 使用前安装依赖
|
|
2
|
-
|
|
3
|
-
npm install @amap/amap-jsapi-loader
|
|
4
|
-
|
|
5
|
-
## 注意事项
|
|
6
|
-
|
|
7
|
-
- isObjectRes 在 @hzab/form-render0.5.0 版本中去除,结果全部存放在对象中
|
|
8
|
-
- changeMode 在 @hzab/form-render0.5.1 版本中去除,仅允许点击地图选点
|
|
9
|
-
|
|
10
|
-
## 引入
|
|
11
|
-
|
|
12
|
-
```jsx
|
|
13
|
-
import MapLocationPoint from "./mapLocationPoint";
|
|
14
|
-
|
|
15
|
-
export default function AMap(props) {
|
|
16
|
-
return <MapLocationPoint hasSearch={true}></MapLocationPoint>;
|
|
17
|
-
}
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
### InfoPanel Attributes
|
|
21
|
-
|
|
22
|
-
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
23
|
-
| ------------------ | ------- | ---- | --------- | ------------------------------------------------ |
|
|
24
|
-
| mode | string | 否 | dialog | 地图显示的类型, dialog 弹窗显示、 show 直接显示 |
|
|
25
|
-
| element | string | 否 | Polypoint | 地图绘制的元素名Polypoint&Polyline&Polygon |
|
|
26
|
-
| layout | string | 否 | ver | 选择器和地图的布局 hor 水平、 ver 垂直 |
|
|
27
|
-
| hasSearch | boolean | 否 | true | 是否允许搜索 |
|
|
28
|
-
| isAutoFixAddr | boolean | 否 | false | 打开地图时是否根据经纬度自动修正已填的地址 |
|
|
29
|
-
| lonKey | string | 否 | longitude | 经度字段 key |
|
|
30
|
-
| latKey | string | 否 | latitude | 维度字段 key |
|
|
31
|
-
| addrKey | string | 否 | address | 地址字段 key |
|
|
32
|
-
| isAutoSearch | boolean | 否 | false | 搜索框是否自动搜索 |
|
|
33
|
-
| markerIconConf | Object | 否 | - | markerIcon 配置对象 |
|
|
34
|
-
| icons | Object | 否 | - | icon 图片配置 |
|
|
35
|
-
| getCurPositionConf | Object | 否 | - | getCurrentPosition Config |
|
|
36
|
-
|
|
37
|
-
#### icons
|
|
38
|
-
|
|
39
|
-
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
40
|
-
| ------------ | ------ | ---- | ------ | ------------------------ |
|
|
41
|
-
| markerIcon | string | 否 | dialog | marker icon 图片地址 |
|
|
42
|
-
| pickerIcon | string | 否 | dialog | 选点 icon 图片地址或元素 |
|
|
43
|
-
| positionIcon | string | 否 | dialog | 定位 icon 图片地址或元素 |
|
|
44
|
-
| resetIcon | string | 否 | dialog | 重置 icon 图片地址或元素 |
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
## PC使用前安装依赖
|
|
2
|
-
|
|
3
|
-
npm install @wangeditor/editor-for-react
|
|
4
|
-
|
|
5
|
-
## 引入
|
|
6
|
-
|
|
7
|
-
```jsx
|
|
8
|
-
import wangEditor from "./wangEditor";
|
|
9
|
-
|
|
10
|
-
export default function AMap(props) {
|
|
11
|
-
return <wangEditor ref={editorRef}></wangEditor>;
|
|
12
|
-
}
|
|
13
|
-
```
|
|
14
|
-
向富文本内set内容
|
|
15
|
-
editorRef.current.setEditorContent(HtmlString)
|
|
16
|
-
|
|
17
|
-
获取富文本当前内容
|
|
18
|
-
editorRef.current.getEditorContent()
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
### InfoPanel Attributes
|
|
22
|
-
|
|
23
|
-
| 参数 | 类型 | 必填 | 默认值 |
|
|
24
|
-
| ------------------ | ---------------------- | ---- | --------- |
|
|
25
|
-
| toolbarConfig | Partial<IToolbarConfig> | 否 | {} |
|
|
26
|
-
| editorConfig | Partial<IEditorConfig> | 否 | { placeholder: '请输入内容...' } |
|
|
27
|
-
|
|
28
|
-
图片上传的配置
|
|
29
|
-
```jsx
|
|
30
|
-
editorConfig = {
|
|
31
|
-
MENU_CONF{
|
|
32
|
-
uploadImage:{
|
|
33
|
-
|
|
34
|
-
server: '/api/upload',
|
|
35
|
-
|
|
36
|
-
// form-data fieldName ,默认值 'wangeditor-uploaded-image'
|
|
37
|
-
fieldName: 'your-custom-name',
|
|
38
|
-
|
|
39
|
-
// 单个文件的最大体积限制,默认为 2M
|
|
40
|
-
maxFileSize: 1 * 1024 * 1024, // 1M
|
|
41
|
-
|
|
42
|
-
// 最多可上传几个文件,默认为 100
|
|
43
|
-
maxNumberOfFiles: 10,
|
|
44
|
-
|
|
45
|
-
// 选择文件时的类型限制,默认为 ['image/*'] 。如不想限制,则设置为 []
|
|
46
|
-
allowedFileTypes: ['image/*'],
|
|
47
|
-
|
|
48
|
-
// 自定义上传参数,例如传递验证的 token 等。参数会被添加到 formData 中,一起上传到服务端。
|
|
49
|
-
meta: {
|
|
50
|
-
token: 'xxx',
|
|
51
|
-
otherKey: 'yyy'
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
// 将 meta 拼接到 url 参数中,默认 false
|
|
55
|
-
metaWithUrl: false,
|
|
56
|
-
|
|
57
|
-
// 自定义增加 http header
|
|
58
|
-
headers: {
|
|
59
|
-
Accept: 'text/x-json',
|
|
60
|
-
otherKey: 'xxx'
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
// 跨域是否传递 cookie ,默认为 false
|
|
64
|
-
withCredentials: true,
|
|
65
|
-
|
|
66
|
-
// 超时时间,默认为 10 秒
|
|
67
|
-
timeout: 5 * 1000, // 5 秒
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
## 移动端使用前安装依赖
|
|
74
|
-
npm install lib-flexible
|
|
75
|
-
|
|
76
|
-
```jsx
|
|
77
|
-
import wangEditor from "./wangEditor/handleMobile";
|
|
78
|
-
|
|
79
|
-
export default function AMap(props) {
|
|
80
|
-
return <HandleMobile content={HtmlString}></HandleMobile>;
|
|
81
|
-
}
|
|
82
|
-
```
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
### InfoPanel Attributes
|
|
2
|
-
|
|
3
|
-
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
4
|
-
| ------------- | ------- | ---- | -------------------------------------------------- | --------------------------------------------- |
|
|
5
|
-
| dataSource | Array | 是 | - | 树数据 |
|
|
6
|
-
| mergeFullLeaf | boolean | 否 | true | 合并不存在 children 的层级 |
|
|
7
|
-
| mergeLeaf | boolean | 否 | true | 合并每一层级的叶子节点 |
|
|
8
|
-
| fieldNames | Object | 否 | { label: label, value: value, children: children } | 自定义 options 中 label value children 的字段 |
|
|
9
|
-
| disabled | boolean | 否 | false | 禁用状态 |
|
|
10
|
-
| readOnly | boolean | 否 | false | 只读状态 |
|
|
11
|
-
| tabBox | boolean | 否 | false | 最外层使用 tab |
|
|
@@ -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-公共读写 |
|