zy-react-library 2.0.9 → 2.0.10

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.
Files changed (2) hide show
  1. package/README.md +393 -356
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -167,19 +167,19 @@ import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
167
167
 
168
168
  ### OptionItem
169
169
 
170
- | 参数 | 类型 | 必填 | 说明 |
171
- | --- | --- | --- | --- |
172
- | `bianma` | `any` | 否 | 默认选项值字段。 |
173
- | `name` | `string \| ReactNode` | 否 | 默认选项标签字段。 |
174
- | `disabled` | `boolean` | 否 | 是否禁用当前选项。 |
175
- | `[key: string]` | `any` | 否 | 允许携带业务自定义字段。 |
170
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
171
+ | --- | --- | --- | --- | --- |
172
+ | `bianma` | `any` | 否 | - | 默认选项值字段。 |
173
+ | `name` | `string \| ReactNode` | 否 | - | 默认选项标签字段。 |
174
+ | `disabled` | `boolean` | 否 | `false` | 是否禁用当前选项。 |
175
+ | `[key: string]` | `any` | 否 | - | 允许携带业务自定义字段。 |
176
176
 
177
177
  ### ItemsFieldConfig
178
178
 
179
- | 参数 | 类型 | 必填 | 说明 |
180
- | --- | --- | --- | --- |
181
- | `valueKey` | `string` | 否 | 选项值字段名,默认使用 `bianma`。 |
182
- | `labelKey` | `string \| ((item) => ReactNode)` | 否 | 选项标签字段名或自定义标签渲染函数,默认使用 `name`。 |
179
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
180
+ | --- | --- | --- | --- | --- |
181
+ | `valueKey` | `string` | 否 | `"bianma"` | 选项值字段名。 |
182
+ | `labelKey` | `string \| ((item) => ReactNode)` | 否 | `"name"` | 选项标签字段名或自定义标签渲染函数。 |
183
183
 
184
184
  ### FormListUniqueProps
185
185
 
@@ -218,23 +218,37 @@ import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
218
218
  | `Page` | `isShowHeader=true`、`headerPrevious=true`、`isShowFooter=true`、`isShowAllAction=true`、`loading=false`、`backButtonText="关闭"`、`contentPadding="20px"`。 |
219
219
  | `HeaderBack` | `previous=true`。 |
220
220
  | `Upload` | `value=[]`、`ratio=""`、`showTip=true`、`multiple=true`;未传 `fileType` 时根据 `accept` 推断,默认按图片;图片默认 `accept=".jpg,.jpeg,.png"`、`maxCount=4`、`size=10`;视频默认 `accept=".mp4"`、`maxCount=1`、`size=100`;文档默认 `accept=".pdf,.doc,.docx"`、`maxCount=4`、`size=10`。 |
221
- | `ImportFile` | `title="导入"`、`labelCol={ span: 4 }`、`exportTemplateButtonText="导出模板"`;弹窗宽度 `600`,内置附件上传 `accept=".xls,.xlsx"`、`listType="text"`、`maxCount=1`。 |
222
- | `Pdf` | `visible=false`、`inline=false`、`title="PDF预览"`、`style={}`。 |
223
- | `TooltipPreviewImg` | `files=[]`、`fileUrlKey="filePath"`。 |
224
- | `BasicSelect` | `placeholder=""`、`data=[]`、`nameKey="name"`、`idKey="id"`,内置 `showSearch=true`、`allowClear=true`、`optionFilterProp="children"`。 |
225
- | `DictionarySelect` | `appKey=DICTIONARY_APP_KEY_ENUM.DEFAULT`、`dictValue=""`、`nameKey="dictLabel"`、`idKey="dictValue"`。 |
226
- | `PersonnelSelect` | `params={}`、`placeholder="人员"`、`isNeedCorpInfoId=false`、`isNeedDepartmentId=true`、`isNeedPostId=false`、`extraParams={}`,内部默认额外参数 `{ noMain: "", eqEmploymentFlag: 1 }`。 |
227
- | `BasicSelectTree` | `getNodePathsIsIncludeOneself=true`、`placeholder=""`、`treeData=[]`、`nameKey="name"`、`idKey="id"`、`childrenKey="children"`、`onlyLastLevel=false`,内置 `showSearch=true`、`allowClear=true`、`style={ width: "100%" }`。 |
228
- | `DictionarySelectTree` | `appKey=DICTIONARY_APP_KEY_ENUM.DEFAULT`、`dictValue=""`、`nameKey="dictLabel"`、`idKey="dictValue"`。 |
229
- | `HiddenLevelSelectTree` | `isShowNeglect=true`、`isShowLarger=true`、`isShowMajor=true`,内部固定 `placeholder="隐患级别"`、`onlyLastLevel=true`、`nameKey="dictLabel"`、`idKey="dictValue"`。 |
230
- | `BasicCascader` | `getNodePathsIsIncludeOneself=true`、`placeholder=""`、`data=[]`、`nameKey="name"`、`idKey="id"`、`childrenKey="children"`。 |
231
- | `AreaCascader` | 内部使用 `area.json`,默认 `nameKey="label"`、`idKey="value"`。 |
232
- | `IndustryCascader` | 内部使用 `industry.json`,默认 `nameKey="dict_label"`、`idKey="dict_value"`、`childrenKey="childrenList"`。 |
233
- | `DictionaryCascader` | `appKey=DICTIONARY_APP_KEY_ENUM.DEFAULT`、`dictValue=""`、`nameKey="dictLabel"`、`idKey="dictValue"`。 |
234
- | `BasicLeftTree` | `getNodePathsIsIncludeOneself=true`、`treeData=[]`、`nameKey="name"`、`idKey="id"`、`childrenKey="children"`,搜索框固定宽度容器 `300`。 |
235
- | `Map` | `longitudeProps="longitude"`、`latitudeProps="latitude"`、`required=true`、`area=""`、`showArea=false`、`disable=false`、`type="baidu"`。 |
236
- | `MapSelector` | `area=""`、`showArea=false`、`disable=false`、`type="baidu"`;弹窗宽度 `1000`、`maskClosable=false`、地图容器高度 `500px`。 |
237
- | `HiddenInfo` | `id=""`、`idKey="id"`、`hiddenId=""`、`hiddenIdKey="hiddenId"`、`history=false`。 |
221
+ | `ImportFile` | `title="导入"`、`labelCol={ span: 4 }`、`exportTemplateButtonText="导出模板"`;弹窗宽度 `600`,内置附件上传 `accept=".xls,.xlsx"`、`listType="text"`、`maxCount=1`。 |
222
+ | `PreviewImg` | `files=[]`、`fileUrlKey="filePath"`;图片固定 `width=100`、`height=100`,图片间距 `marginRight=10`、`marginBottom=10`。 |
223
+ | `PreviewPdf` | `files=[]`、`nameKey=""`、`urlKey=""`、`name=""`、`url=""`。 |
224
+ | `Pdf` | `visible=false`、`inline=false`、`title="PDF预览"`、`style={}`。 |
225
+ | `Video` | `source=""`、`vid=""`、`playAuth=""`、`cover=""`、`autoplay=true`、`showProgress=true`、`playTime=0`、`inline=false`、`isLive=false`、`width="100%"`、`height="600px"`、`title="视频"`、`visible=false`、`aliPlayerProps={}`;弹窗宽度 `800`。 |
226
+ | `AliPlayer` | `source=""`、`vid=""`、`playAuth=""`、`cover=""`、`width="100%"`、`height="600px"`、`autoplay=true`、`showProgress=true`、`isLive=false`、`playTime=0`。 |
227
+ | `Signature` | `width=752`、`height=300`、`url=""`;签名弹窗宽度 `800`,画笔颜色 `black`,画布背景 `rgb(255,255,255)`。 |
228
+ | `TooltipPreviewImg` | `files=[]`、`fileUrlKey="filePath"`。 |
229
+ | `SelectCreate` | `showDelete=true`、`label=""`、`maxCount=1`,内部固定 `mode="tags"`。 |
230
+ | `BasicSelect` | `placeholder=""`、`data=[]`、`nameKey="name"`、`idKey="id"`,内置 `showSearch=true`、`allowClear=true`、`optionFilterProp="children"`。 |
231
+ | `DictionarySelect` | `appKey=DICTIONARY_APP_KEY_ENUM.DEFAULT`、`dictValue=""`、`nameKey="dictLabel"`、`idKey="dictValue"`。 |
232
+ | `PersonnelSelect` | `params={}`、`placeholder="人员"`、`isNeedCorpInfoId=false`、`isNeedDepartmentId=true`、`isNeedPostId=false`、`extraParams={}`,内部默认额外参数 `{ noMain: "", eqEmploymentFlag: 1 }`。 |
233
+ | `BasicSelectTree` | `getNodePathsIsIncludeOneself=true`、`placeholder=""`、`treeData=[]`、`nameKey="name"`、`idKey="id"`、`childrenKey="children"`、`onlyLastLevel=false`,内置 `showSearch=true`、`allowClear=true`、`style={ width: "100%" }`。 |
234
+ | `AreaSelectTree` | 内部使用 `area.json`,默认 `nameKey="label"`、`idKey="value"`。 |
235
+ | `IndustrySelectTree` | 内部使用 `industry.json`,默认 `nameKey="dict_label"`、`idKey="dict_value"`、`childrenKey="childrenList"`。 |
236
+ | `DepartmentSelectTree` | `params={}`、`placeholder="部门"`、`isNeedCorpInfoId=false`、`isNeedParentId=false`、`searchType="current"`,内部固定 `childrenKey="childrenList"`。 |
237
+ | `DictionarySelectTree` | `appKey=DICTIONARY_APP_KEY_ENUM.DEFAULT`、`dictValue=""`、`nameKey="dictLabel"`、`idKey="dictValue"`。 |
238
+ | `HiddenLevelSelectTree` | `isShowNeglect=true`、`isShowLarger=true`、`isShowMajor=true`,内部固定 `placeholder="隐患级别"`、`onlyLastLevel=true`、`nameKey="dictLabel"`、`idKey="dictValue"`。 |
239
+ | `HiddenPartSelectTree` | `params={}`、`isNeedCorpInfoId=false`,内部固定 `placeholder="隐患部位"`、`nameKey="hiddenregion"`、`idKey="hiddenregionId"`。 |
240
+ | `BasicCascader` | `getNodePathsIsIncludeOneself=true`、`placeholder=""`、`data=[]`、`nameKey="name"`、`idKey="id"`、`childrenKey="children"`。 |
241
+ | `AreaCascader` | 内部使用 `area.json`,默认 `nameKey="label"`、`idKey="value"`。 |
242
+ | `IndustryCascader` | 内部使用 `industry.json`,默认 `nameKey="dict_label"`、`idKey="dict_value"`、`childrenKey="childrenList"`。 |
243
+ | `DictionaryCascader` | `appKey=DICTIONARY_APP_KEY_ENUM.DEFAULT`、`dictValue=""`、`nameKey="dictLabel"`、`idKey="dictValue"`。 |
244
+ | `BasicLeftTree` | `getNodePathsIsIncludeOneself=true`、`treeData=[]`、`nameKey="name"`、`idKey="id"`、`childrenKey="children"`,搜索框固定宽度容器 `300`。 |
245
+ | `AreaLeftTree` | 内部使用 `area.json`,默认 `nameKey="label"`、`idKey="value"`。 |
246
+ | `DictionaryLeftTree` | `appKey=DICTIONARY_APP_KEY_ENUM.DEFAULT`、`dictValue=""`、`nameKey="dictLabel"`、`idKey="dictValue"`。 |
247
+ | `DepartmentLeftTree` | `params={}`、`searchType="current"`,内部固定 `childrenKey="childrenList"`。 |
248
+ | `Map` | `longitudeProps="longitude"`、`latitudeProps="latitude"`、`required=true`、`area=""`、`showArea=false`、`disable=false`、`type="baidu"`。 |
249
+ | `MapSelector` | `area=""`、`showArea=false`、`disable=false`、`type="baidu"`;弹窗宽度 `1000`、`maskClosable=false`、地图容器高度 `500px`。 |
250
+ | `SeamlessScroll` | `value=true`、`list=[]`、`step=1`、`limitScrollNum=3`、`hover=true`、`direction="up"`、`singleHeight=0`、`singleWidth=0`、`singleWaitTime=1000`、`isRemUnit=false`、`isWatch=true`、`delay=0`、`ease="ease-in"`、`count=-1`、`copyNum=1`、`wheel=false`、`singleLine=false`。 |
251
+ | `HiddenInfo` | `id=""`、`idKey="id"`、`hiddenId=""`、`hiddenIdKey="hiddenId"`、`history=false`。 |
238
252
 
239
253
  ### Table
240
254
 
@@ -342,20 +356,20 @@ import Page from "zy-react-library/components/Page";
342
356
 
343
357
  页面容器组件。
344
358
 
345
- | 参数 | 类型 | 必填 | 说明 |
346
- | --- | --- | --- | --- |
347
- | `headerTitle` | `ReactNode` | 否 | 页头标题。 |
348
- | `history` | `{ goBack?: () => void; [key: string]: any }` | 否 | 路由历史对象,用于返回。 |
349
- | `isShowHeader` | `boolean` | 否 | 是否显示头部。 |
350
- | `headerPrevious` | `boolean` | 否 | 头部是否显示返回能力。 |
351
- | `isShowFooter` | `boolean` | 否 | 是否显示底部操作区。 |
352
- | `isShowAllAction` | `boolean` | 否 | 是否显示默认全部操作。 |
353
- | `loading` | `boolean` | 否 | 页面加载状态。 |
354
- | `backButtonText` | `string` | 否 | 返回按钮文案。 |
355
- | `contentPadding` | `string` | 否 | 内容区内边距。 |
356
- | `customActionButtons` | `ReactNode` | 否 | 自定义底部操作按钮。 |
357
- | `extraActionButtons` | `ReactNode` | 否 | 额外底部操作按钮。 |
358
- | `children` | `ReactNode \| (() => ReactNode)` | 是 | 页面内容。 |
359
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
360
+ | --- | --- | --- | --- | --- |
361
+ | `headerTitle` | `ReactNode` | 否 | - | 页头标题。 |
362
+ | `history` | `{ goBack?: () => void; [key: string]: any }` | 否 | `window.history.back` | 路由历史对象,用于返回;没有 `history.goBack` 时使用浏览器返回。 |
363
+ | `isShowHeader` | `boolean` | 否 | `true` | 是否显示头部。 |
364
+ | `headerPrevious` | `boolean` | 否 | `true` | 头部是否显示返回能力。 |
365
+ | `isShowFooter` | `boolean` | 否 | `true` | 是否显示底部操作区。 |
366
+ | `isShowAllAction` | `boolean` | 否 | `true` | 是否显示默认全部操作。 |
367
+ | `loading` | `boolean` | 否 | `false` | 页面加载状态,控制外层 `Spin`。 |
368
+ | `backButtonText` | `string` | 否 | `"关闭"` | 返回按钮文案。 |
369
+ | `contentPadding` | `string` | 否 | `"20px"` | 内容区内边距。 |
370
+ | `customActionButtons` | `ReactNode` | 否 | - | 自定义底部操作按钮;传入后替换默认底部按钮组。 |
371
+ | `extraActionButtons` | `ReactNode` | 否 | - | 额外底部操作按钮,插入默认关闭按钮前。 |
372
+ | `children` | `ReactNode \| (() => ReactNode)` | 是 | - | 页面内容。 |
359
373
 
360
374
  ### HeaderBack
361
375
 
@@ -367,11 +381,11 @@ import HeaderBack from "zy-react-library/components/HeaderBack";
367
381
 
368
382
  页头返回组件。
369
383
 
370
- | 参数 | 类型 | 必填 | 说明 |
371
- | --- | --- | --- | --- |
372
- | `title` | `ReactNode` | 是 | 标题内容。 |
373
- | `history` | `{ goBack?: () => void; [key: string]: any }` | 否 | 路由历史对象。 |
374
- | `previous` | `boolean` | 否 | 是否显示返回操作。 |
384
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
385
+ | --- | --- | --- | --- | --- |
386
+ | `title` | `ReactNode` | 是 | - | 标题内容。 |
387
+ | `history` | `{ goBack?: () => void; [key: string]: any }` | 否 | `window.history.back` | 路由历史对象;没有 `history.goBack` 时使用浏览器返回。 |
388
+ | `previous` | `boolean` | 否 | `true` | 是否显示返回操作。 |
375
389
 
376
390
  ### Upload
377
391
 
@@ -383,16 +397,20 @@ import Upload from "zy-react-library/components/Upload";
383
397
 
384
398
  上传组件,继承 `Omit<AntUploadProps, "fileList">`。
385
399
 
386
- | 参数 | 类型 | 必填 | 说明 |
387
- | --- | --- | --- | --- |
388
- | `value` | `UploadFile[]` | 否 | 当前文件列表。 |
389
- | `ratio` | `` `${number}*${number}` `` | 否 | 图片宽高比例提示,例如 `"16*9"`。 |
390
- | `showTip` | `boolean` | 否 | 是否显示上传提示。 |
391
- | `size` | `number` | 否 | 文件大小限制。 |
392
- | `tipContent` | `ReactNode` | 否 | 自定义提示内容。 |
393
- | `uploadButtonText` | `string` | 否 | 上传按钮文案。 |
394
- | `fileType` | `"image" \| "video" \| "document"` | 否 | 文件类型。 |
395
- | `onGetRemoveFile` | `(file: Omit<UploadFile, "originFileObj">) => void` | 否 | 删除文件时返回被移除的文件。 |
400
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
401
+ | --- | --- | --- | --- | --- |
402
+ | `value` | `UploadFile[]` | 否 | `[]` | 当前文件列表。 |
403
+ | `ratio` | `` `${number}*${number}` `` | 否 | `""` | 图片宽高比例提示,例如 `"16*9"`。 |
404
+ | `showTip` | `boolean` | 否 | `true` | 是否显示上传提示。 |
405
+ | `size` | `number` | 否 | 图片/文档 `10`,视频 `100` | 文件大小限制,单位 MB。 |
406
+ | `tipContent` | `ReactNode` | 否 | 自动生成提示文案 | 自定义提示内容。 |
407
+ | `uploadButtonText` | `string` | 否 | 视频 `"上传视频"`,其他 `"上传附件"` | 上传按钮文案。 |
408
+ | `fileType` | `"image" \| "video" \| "document"` | 否 | 根据 `accept` 推断,默认 `"image"` | 文件类型。 |
409
+ | `onGetRemoveFile` | `(file: Omit<UploadFile, "originFileObj">) => void` | 否 | - | 删除文件时返回被移除的文件。 |
410
+ | `multiple` | `boolean` | 否 | `true` | 是否允许多选,继承自 antd Upload。 |
411
+ | `maxCount` | `number` | 否 | 图片/文档 `4`,视频 `1` | 最大上传数量,继承自 antd Upload。 |
412
+ | `accept` | `string` | 否 | 图片 `.jpg,.jpeg,.png`;视频 `.mp4`;文档 `.pdf,.doc,.docx` | 允许的文件类型,继承自 antd Upload。 |
413
+ | `listType` | `string` | 否 | 图片 `"picture-card"`,其他 `"text"` | 上传列表样式,继承自 antd Upload。 |
396
414
 
397
415
  ### ImportFile
398
416
 
@@ -404,16 +422,17 @@ import ImportFile from "zy-react-library/components/ImportFile";
404
422
 
405
423
  文件导入弹窗,继承 `Omit<FormProps, "form">`。
406
424
 
407
- | 参数 | 类型 | 必填 | 说明 |
408
- | --- | --- | --- | --- |
409
- | `visible` | `boolean` | 是 | 是否显示弹窗。 |
410
- | `title` | `string` | 否 | 弹窗标题。 |
411
- | `templateUrl` | `string` | 否 | 导入模板下载地址。 |
412
- | `children` | `ReactNode \| ((props: { form: FormInstance }) => ReactNode)` | 否 | 自定义弹窗内容;函数形式可拿到内部表单实例。 |
413
- | `onConfirm` | `(values: { file?: UploadFile[]; [key: string]: any }) => void` | 是 | 确认导入回调。 |
414
- | `onCancel` | `() => void` | 是 | 取消回调。 |
415
- | `exportTemplateButtonText` | `ReactNode` | 否 | 下载模板按钮文案。 |
416
- | `extraButtons` | `ReactNode` | 否 | 额外按钮。 |
425
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
426
+ | --- | --- | --- | --- | --- |
427
+ | `visible` | `boolean` | 是 | - | 是否显示弹窗。 |
428
+ | `title` | `string` | 否 | `"导入"` | 弹窗标题。 |
429
+ | `templateUrl` | `string` | 否 | - | 导入模板下载地址。 |
430
+ | `children` | `ReactNode \| ((props: { form: FormInstance }) => ReactNode)` | 否 | - | 自定义弹窗内容;函数形式可拿到内部表单实例。 |
431
+ | `onConfirm` | `(values: { file?: UploadFile[]; [key: string]: any }) => void` | 是 | - | 确认导入回调。 |
432
+ | `onCancel` | `() => void` | 是 | - | 取消回调。 |
433
+ | `exportTemplateButtonText` | `ReactNode` | 否 | `"导出模板"` | 下载模板按钮文案。 |
434
+ | `extraButtons` | `ReactNode` | 否 | - | 额外按钮。 |
435
+ | `labelCol` | `ColProps` | 否 | `{ span: 4 }` | 表单标签栅格,继承自 `FormProps`。 |
417
436
 
418
437
  ### PreviewImg
419
438
 
@@ -425,10 +444,10 @@ import PreviewImg from "zy-react-library/components/PreviewImg";
425
444
 
426
445
  图片预览组件。
427
446
 
428
- | 参数 | 类型 | 必填 | 说明 |
429
- | --- | --- | --- | --- |
430
- | `files` | `string[] \| { filePath?: string; [key: string]: string }[]` | 是 | 图片地址数组,或包含图片地址字段的对象数组。 |
431
- | `fileUrlKey` | `string` | 否 | 对象数组中图片地址字段名。 |
447
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
448
+ | --- | --- | --- | --- | --- |
449
+ | `files` | `string[] \| { filePath?: string; [key: string]: string }[]` | 是 | `[]` | 图片地址数组,或包含图片地址字段的对象数组。 |
450
+ | `fileUrlKey` | `string` | 否 | `"filePath"` | 对象数组中图片地址字段名。 |
432
451
 
433
452
  ### TooltipPreviewImg
434
453
 
@@ -450,13 +469,13 @@ import PreviewPdf from "zy-react-library/components/PreviewPdf";
450
469
 
451
470
  PDF 预览入口组件。
452
471
 
453
- | 参数 | 类型 | 必填 | 说明 |
454
- | --- | --- | --- | --- |
455
- | `files` | `{ filePath?: string; fileName?: string; name?: string; [key: string]: string }[]` | 否 | PDF 文件对象数组。 |
456
- | `nameKey` | `string` | 否 | 文件名字段名。 |
457
- | `urlKey` | `string` | 否 | 文件地址字段名。 |
458
- | `name` | `string` | 否 | 单文件文件名。 |
459
- | `url` | `string` | 否 | 单文件地址。 |
472
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
473
+ | --- | --- | --- | --- | --- |
474
+ | `files` | `{ filePath?: string; fileName?: string; name?: string; [key: string]: string }[]` | 否 | `[]` | PDF 文件对象数组。 |
475
+ | `nameKey` | `string` | 否 | `""` | 文件名字段名;不传时优先取 `name`、`fileName`。 |
476
+ | `urlKey` | `string` | 否 | `""` | 文件地址字段名;不传时优先取 `filePath`。 |
477
+ | `name` | `string` | 否 | `""` | 单文件文件名。 |
478
+ | `url` | `string` | 否 | `""` | 单文件地址。 |
460
479
 
461
480
  ### Pdf
462
481
 
@@ -468,15 +487,15 @@ import Pdf from "zy-react-library/components/Pdf";
468
487
 
469
488
  PDF 展示组件。
470
489
 
471
- | 参数 | 类型 | 必填 | 说明 |
472
- | --- | --- | --- | --- |
473
- | `file` | `string` | 是 | PDF 文件地址。 |
474
- | `name` | `string` | 否 | 文件名。 |
475
- | `visible` | `boolean` | 否 | 是否以弹窗形式显示。 |
476
- | `title` | `string` | 否 | 弹窗标题。 |
477
- | `onCancel` | `() => void` | 否 | 关闭弹窗回调。 |
478
- | `inline` | `boolean` | 否 | 是否内联展示。 |
479
- | `style` | `CSSProperties` | 否 | 外层样式。 |
490
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
491
+ | --- | --- | --- | --- | --- |
492
+ | `file` | `string` | 是 | - | PDF 文件地址。 |
493
+ | `name` | `string` | 否 | - | 文件名。 |
494
+ | `visible` | `boolean` | 否 | `false` | 是否以弹窗形式显示。 |
495
+ | `title` | `string` | 否 | `"PDF预览"` | 弹窗标题。 |
496
+ | `onCancel` | `() => void` | 否 | - | 关闭弹窗回调。 |
497
+ | `inline` | `boolean` | 否 | `false` | 是否内联展示。 |
498
+ | `style` | `CSSProperties` | 否 | `{}` | 外层样式。 |
480
499
 
481
500
  ### Video
482
501
 
@@ -488,12 +507,12 @@ import Video from "zy-react-library/components/Video";
488
507
 
489
508
  视频播放组件,继承 `AliPlayerProps`。
490
509
 
491
- | 参数 | 类型 | 必填 | 说明 |
492
- | --- | --- | --- | --- |
493
- | `title` | `string` | 否 | 弹窗标题。 |
494
- | `visible` | `boolean` | 否 | 是否显示弹窗。 |
495
- | `inline` | `boolean` | 否 | 是否内联展示。 |
496
- | `onCancel` | `() => void` | 否 | 关闭回调。 |
510
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
511
+ | --- | --- | --- | --- | --- |
512
+ | `title` | `string` | 否 | `"视频"` | 弹窗标题。 |
513
+ | `visible` | `boolean` | 否 | `false` | 是否显示弹窗;传 `onCancel` 时由外部控制。 |
514
+ | `inline` | `boolean` | 否 | `false` | 是否内联展示。 |
515
+ | `onCancel` | `() => void` | 否 | 内部状态关闭 | 关闭回调;不传时组件内部维护弹窗显隐。 |
497
516
 
498
517
  ### AliPlayer
499
518
 
@@ -505,22 +524,22 @@ import AliPlayer from "zy-react-library/components/Video/AliPlayer";
505
524
 
506
525
  阿里云播放器封装,支持 `ref`。
507
526
 
508
- | 参数 | 类型 | 必填 | 说明 |
509
- | --- | --- | --- | --- |
510
- | `source` | `string \| string[]` | 否 | 视频播放地址。 |
511
- | `vid` | `string` | 否 | 阿里云视频 ID。 |
512
- | `playAuth` | `string` | 否 | 阿里云播放凭证。 |
513
- | `cover` | `string` | 否 | 封面地址。 |
514
- | `width` | `string` | 否 | 播放器宽度。 |
515
- | `height` | `string` | 否 | 播放器高度。 |
516
- | `autoplay` | `boolean` | 否 | 是否自动播放。 |
517
- | `showProgress` | `boolean` | 否 | 是否显示进度条。 |
518
- | `isLive` | `boolean` | 否 | 是否为直播。 |
519
- | `playTime` | `number` | 否 | 初始播放时间。 |
520
- | `onEnded` | `() => void` | 否 | 播放结束回调。 |
521
- | `onTimeupdate` | `(currentTime: number) => void` | 否 | 播放时间更新回调。 |
522
- | `onGetPlayerInstance` | `(player: any) => void` | 否 | 获取播放器实例。 |
523
- | `aliPlayerProps` | `Record<string, any>` | 否 | 透传给 AliPlayer 的额外属性。 |
527
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
528
+ | --- | --- | --- | --- | --- |
529
+ | `source` | `string \| string[]` | 否 | `""` | 视频播放地址。 |
530
+ | `vid` | `string` | 否 | `""` | 阿里云视频 ID。 |
531
+ | `playAuth` | `string` | 否 | `""` | 阿里云播放凭证。 |
532
+ | `cover` | `string` | 否 | `""` | 封面地址。 |
533
+ | `width` | `string` | 否 | `"100%"` | 播放器宽度。 |
534
+ | `height` | `string` | 否 | `"600px"` | 播放器高度。 |
535
+ | `autoplay` | `boolean` | 否 | `true` | 是否自动播放。 |
536
+ | `showProgress` | `boolean` | 否 | `true` | 是否显示进度条。 |
537
+ | `isLive` | `boolean` | 否 | `false` | 是否为直播。 |
538
+ | `playTime` | `number` | 否 | `0` | 初始播放时间,大于 0 时会 seek 到该时间。 |
539
+ | `onEnded` | `() => void` | 否 | - | 播放结束回调。 |
540
+ | `onTimeupdate` | `(currentTime: number) => void` | 否 | - | 播放时间更新回调。 |
541
+ | `onGetPlayerInstance` | `(player: any) => void` | 否 | - | 获取播放器实例。 |
542
+ | `aliPlayerProps` | `Record<string, any>` | 否 | - | 透传给 AliPlayer 的额外属性。 |
524
543
 
525
544
  Ref 方法:
526
545
 
@@ -540,11 +559,11 @@ import Editor from "zy-react-library/components/Editor";
540
559
 
541
560
  富文本编辑器组件,支持 `ref`。
542
561
 
543
- | 参数 | 类型 | 必填 | 说明 |
544
- | --- | --- | --- | --- |
545
- | `value` | `string` | 否 | HTML 内容。 |
546
- | `onChange` | `(html: string) => void` | 否 | 内容变化回调。 |
547
- | `disabled` | `boolean` | 否 | 是否禁用编辑。 |
562
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
563
+ | --- | --- | --- | --- | --- |
564
+ | `value` | `string` | 否 | - | HTML 内容。 |
565
+ | `onChange` | `(html: string) => void` | 否 | - | 内容变化回调。 |
566
+ | `disabled` | `boolean` | 否 | - | 是否禁用编辑。 |
548
567
 
549
568
  Ref 方法:
550
569
 
@@ -565,12 +584,12 @@ import Signature from "zy-react-library/components/Signature";
565
584
 
566
585
  手写签名组件。
567
586
 
568
- | 参数 | 类型 | 必填 | 说明 |
569
- | --- | --- | --- | --- |
570
- | `onConfirm` | `(value: SignatureValue) => void` | 是 | 确认签名回调。 |
571
- | `width` | `number` | 否 | 画布宽度。 |
572
- | `height` | `number` | 否 | 画布高度。 |
573
- | `url` | `string` | 否 | 已有签名图片地址。 |
587
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
588
+ | --- | --- | --- | --- | --- |
589
+ | `onConfirm` | `(value: SignatureValue) => void` | 是 | - | 确认签名回调。 |
590
+ | `width` | `number` | 否 | `752` | 签名画布宽度。 |
591
+ | `height` | `number` | 否 | `300` | 签名画布高度,也用于已签名图片预览高度。 |
592
+ | `url` | `string` | 否 | `""` | 已有签名图片地址。 |
574
593
 
575
594
  `SignatureValue`:
576
595
 
@@ -590,16 +609,16 @@ import Map from "zy-react-library/components/Map";
590
609
 
591
610
  地图选择组件。
592
611
 
593
- | 参数 | 类型 | 必填 | 说明 |
594
- | --- | --- | --- | --- |
595
- | `longitudeProps` | `string` | 否 | 经度字段名。 |
596
- | `latitudeProps` | `string` | 否 | 纬度字段名。 |
597
- | `required` | `boolean` | 否 | 是否必填。 |
598
- | `area` | `string` | 否 | 区域文本。 |
599
- | `showArea` | `boolean` | 否 | 是否显示区域。 |
600
- | `disable` | `boolean` | 否 | 是否禁用选择。 |
601
- | `onConfirm` | `(longitude, latitude, extra: { area: string }) => void` | 否 | 确认选择回调。 |
602
- | `type` | `"baidu" \| "cesium"` | 否 | 地图类型。 |
612
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
613
+ | --- | --- | --- | --- | --- |
614
+ | `longitudeProps` | `string` | 否 | `"longitude"` | 经度字段名。 |
615
+ | `latitudeProps` | `string` | 否 | `"latitude"` | 纬度字段名。 |
616
+ | `required` | `boolean` | 否 | `true` | 是否必填。 |
617
+ | `area` | `string` | 否 | `""` | 区域文本。 |
618
+ | `showArea` | `boolean` | 否 | `false` | 是否显示区域。 |
619
+ | `disable` | `boolean` | 否 | `false` | 是否禁用选择。 |
620
+ | `onConfirm` | `(longitude, latitude, extra: { area: string }) => void` | 否 | - | 确认选择回调。 |
621
+ | `type` | `"baidu" \| "cesium"` | 否 | `"baidu"` | 地图类型。 |
603
622
 
604
623
  ### MapSelector
605
624
 
@@ -611,17 +630,17 @@ import MapSelector from "zy-react-library/components/Map/MapSelector";
611
630
 
612
631
  地图选择弹窗。
613
632
 
614
- | 参数 | 类型 | 必填 | 说明 |
615
- | --- | --- | --- | --- |
616
- | `visible` | `boolean` | 是 | 是否显示弹窗。 |
617
- | `onClose` | `() => void` | 是 | 关闭回调。 |
618
- | `longitude` | `number \| string` | 否 | 初始经度。 |
619
- | `latitude` | `number \| string` | 否 | 初始纬度。 |
620
- | `area` | `string` | 否 | 初始区域文本。 |
621
- | `showArea` | `boolean` | 否 | 是否显示区域。 |
622
- | `disable` | `boolean` | 否 | 是否禁用选择。 |
623
- | `onConfirm` | `(longitude, latitude, extra: { area: string }) => void` | 否 | 确认选择回调。 |
624
- | `type` | `"baidu" \| "cesium"` | 否 | 地图类型。 |
633
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
634
+ | --- | --- | --- | --- | --- |
635
+ | `visible` | `boolean` | 是 | - | 是否显示弹窗。 |
636
+ | `onClose` | `() => void` | 是 | - | 关闭回调。 |
637
+ | `longitude` | `number \| string` | 否 | `""` | 初始经度;不传时使用 `window.mapLongitude` 初始化地图中心。 |
638
+ | `latitude` | `number \| string` | 否 | `""` | 初始纬度;不传时使用 `window.mapLatitude` 初始化地图中心。 |
639
+ | `area` | `string` | 否 | `""` | 初始区域文本。 |
640
+ | `showArea` | `boolean` | 否 | `false` | 是否显示区域。 |
641
+ | `disable` | `boolean` | 否 | `false` | 是否禁用选择。 |
642
+ | `onConfirm` | `(longitude, latitude, extra: { area: string }) => void` | 否 | - | 确认选择回调。 |
643
+ | `type` | `"baidu" \| "cesium"` | 否 | `"baidu"` | 地图类型。 |
625
644
 
626
645
  ### SeamlessScroll
627
646
 
@@ -633,26 +652,26 @@ import SeamlessScroll from "zy-react-library/components/SeamlessScroll";
633
652
 
634
653
  无缝滚动组件,支持 `ref.reset()`。
635
654
 
636
- | 参数 | 类型 | 必填 | 说明 |
637
- | --- | --- | --- | --- |
638
- | `value` | `boolean` | 否 | 是否启用滚动。 |
639
- | `list` | `unknown[]` | 是 | 滚动数据列表。 |
640
- | `step` | `number` | 否 | 滚动步长。 |
641
- | `limitScrollNum` | `number` | 否 | 触发滚动的最小数据条数。 |
642
- | `hover` | `boolean` | 否 | 鼠标悬浮时是否暂停。 |
643
- | `direction` | `"up" \| "down" \| "left" \| "right"` | 否 | 滚动方向。 |
644
- | `singleHeight` | `number` | 否 | 单条高度。 |
645
- | `singleWidth` | `number` | 否 | 单条宽度。 |
646
- | `singleWaitTime` | `number` | 否 | 单步滚动等待时间。 |
647
- | `isRemUnit` | `boolean` | 否 | 尺寸是否使用 rem 单位。 |
648
- | `isWatch` | `boolean` | 否 | 是否监听数据变化并重置滚动。 |
649
- | `delay` | `number` | 否 | 动画延迟。 |
650
- | `ease` | `string \| { x1: number; y1: number; x2: number; y2: number }` | 否 | 动画缓动函数。 |
651
- | `count` | `number` | 否 | 滚动次数。 |
652
- | `copyNum` | `number` | 否 | 复制列表份数。 |
653
- | `wheel` | `boolean` | 否 | 是否支持滚轮。 |
654
- | `singleLine` | `boolean` | 否 | 是否单行滚动。 |
655
- | `className` | `string` | 否 | 自定义类名。 |
655
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
656
+ | --- | --- | --- | --- | --- |
657
+ | `value` | `boolean` | 否 | `true` | 是否启用滚动。 |
658
+ | `list` | `unknown[]` | 是 | `[]` | 滚动数据列表。 |
659
+ | `step` | `number` | 否 | `1` | 滚动步长。 |
660
+ | `limitScrollNum` | `number` | 否 | `3` | 触发滚动的最小数据条数。 |
661
+ | `hover` | `boolean` | 否 | `true` | 鼠标悬浮时是否暂停。 |
662
+ | `direction` | `"up" \| "down" \| "left" \| "right"` | 否 | `"up"` | 滚动方向。 |
663
+ | `singleHeight` | `number` | 否 | `0` | 单条高度;大于 0 时按单条高度做停顿。 |
664
+ | `singleWidth` | `number` | 否 | `0` | 单条宽度;横向滚动时可用于单步停顿。 |
665
+ | `singleWaitTime` | `number` | 否 | `1000` | 单步滚动等待时间。 |
666
+ | `isRemUnit` | `boolean` | 否 | `false` | 尺寸是否使用 rem 单位。 |
667
+ | `isWatch` | `boolean` | 否 | `true` | 是否监听数据变化并重置滚动。 |
668
+ | `delay` | `number` | 否 | `0` | 动画延迟。 |
669
+ | `ease` | `string \| { x1: number; y1: number; x2: number; y2: number }` | 否 | `"ease-in"` | 动画缓动函数。 |
670
+ | `count` | `number` | 否 | `-1` | 滚动次数;`-1` 表示不限制次数。 |
671
+ | `copyNum` | `number` | 否 | `1` | 复制列表份数。 |
672
+ | `wheel` | `boolean` | 否 | `false` | 是否支持滚轮。 |
673
+ | `singleLine` | `boolean` | 否 | `false` | 是否单行滚动。 |
674
+ | `className` | `string` | 否 | - | 自定义类名。 |
656
675
 
657
676
  ### SelectCreate
658
677
 
@@ -664,12 +683,13 @@ import SelectCreate from "zy-react-library/components/SelectCreate";
664
683
 
665
684
  可创建/删除选项的选择器,继承 `antd SelectProps`。
666
685
 
667
- | 参数 | 类型 | 必填 | 说明 |
668
- | --- | --- | --- | --- |
669
- | `items` | `SelectCreateOption[]` | 是 | 选项列表。 |
670
- | `showDelete` | `boolean` | 否 | 是否显示删除选项能力。 |
671
- | `label` | `string` | 否 | 创建项标签文案。 |
672
- | `onDelete` | `(option: SelectCreateOption) => void` | | 删除选项回调。 |
686
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
687
+ | --- | --- | --- | --- | --- |
688
+ | `items` | `SelectCreateOption[]` | 是 | - | 选项列表。 |
689
+ | `showDelete` | `boolean` | 否 | `true` | 是否显示删除选项能力。 |
690
+ | `label` | `string` | 否 | `""` | 创建项标签文案,会拼到默认 placeholder 中。 |
691
+ | `maxCount` | `number` | | `1` | 最大选择数量,继承自 antd Select。 |
692
+ | `onDelete` | `(option: SelectCreateOption) => void` | 否 | - | 删除选项回调。 |
673
693
 
674
694
  `SelectCreateOption`:
675
695
 
@@ -688,14 +708,14 @@ import HiddenInfo from "zy-react-library/components/HiddenInfo/gwj";
688
708
 
689
709
  隐患信息展示组件。
690
710
 
691
- | 参数 | 类型 | 必填 | 说明 |
692
- | --- | --- | --- | --- |
693
- | `id` | `string` | 否 | 业务 ID。 |
694
- | `idKey` | `string` | 否 | 业务 ID 字段名。 |
695
- | `hiddenId` | `string` | 否 | 隐患 ID。 |
696
- | `hiddenIdKey` | `string` | 否 | 隐患 ID 字段名。 |
697
- | `history` | `boolean` | 否 | 是否展示历史相关内容。 |
698
- | `onGetData` | `(data: Record<string, any>) => void` | 否 | 获取详情数据后的回调。 |
711
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
712
+ | --- | --- | --- | --- | --- |
713
+ | `id` | `string` | 否 | `""` | 业务 ID。 |
714
+ | `idKey` | `string` | 否 | `"id"` | URL 查询参数中的业务 ID 字段名。 |
715
+ | `hiddenId` | `string` | 否 | `""` | 隐患 ID。 |
716
+ | `hiddenIdKey` | `string` | 否 | `"hiddenId"` | URL 查询参数中的隐患 ID 字段名。 |
717
+ | `history` | `boolean` | 否 | `false` | 是否请求历史详情接口。 |
718
+ | `onGetData` | `(data: Record<string, any>) => void` | 否 | - | 获取详情数据后的回调。 |
699
719
 
700
720
  ## Select 选择器
701
721
 
@@ -709,16 +729,16 @@ import BasicSelect from "zy-react-library/components/Select/Basic";
709
729
 
710
730
  基础选择器,继承 `antd SelectProps`。
711
731
 
712
- | 参数 | 类型 | 必填 | 说明 |
713
- | --- | --- | --- | --- |
714
- | `data` | `Record<string, any>[]` | 是 | 选项数据。 |
715
- | `nameKey` | `string` | 否 | 标签字段名。 |
716
- | `idKey` | `string` | 否 | 值字段名。 |
717
- | `placeholder` | `string` | 否 | 占位文案。 |
718
- | `onGetLabel` | `(label: string \| string[]) => void` | 否 | 选择后返回标签。 |
719
- | `onGetOption` | `(option: Record<string, any> \| Record<string, any>[]) => void` | 否 | 选择后返回选项对象。 |
720
- | `onGetData` | `(data: Record<string, any>[]) => void` | 否 | 返回处理后的选项数据。 |
721
- | `labelRender` | `(item: Record<string, any>) => ReactNode` | 否 | 自定义选项标签渲染。 |
732
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
733
+ | --- | --- | --- | --- | --- |
734
+ | `data` | `Record<string, any>[]` | 是 | `[]` | 选项数据。 |
735
+ | `nameKey` | `string` | 否 | `"name"` | 标签字段名。 |
736
+ | `idKey` | `string` | 否 | `"id"` | 值字段名。 |
737
+ | `placeholder` | `string` | 否 | `""` | 占位文案,最终显示为 `请选择${placeholder}`。 |
738
+ | `onGetLabel` | `(label: string \| string[]) => void` | 否 | - | 选择后返回标签。 |
739
+ | `onGetOption` | `(option: Record<string, any> \| Record<string, any>[]) => void` | 否 | - | 选择后返回选项对象。 |
740
+ | `onGetData` | `(data: Record<string, any>[]) => void` | 否 | - | 返回处理后的选项数据。 |
741
+ | `labelRender` | `(item: Record<string, any>) => ReactNode` | 否 | - | 自定义选项标签渲染。 |
722
742
 
723
743
  ### DictionarySelect
724
744
 
@@ -730,14 +750,14 @@ import DictionarySelect from "zy-react-library/components/Select/Dictionary";
730
750
 
731
751
  字典选择器,继承 `BasicSelectProps`,但内部接管 `data`、默认字段和部分回调。
732
752
 
733
- | 参数 | 类型 | 必填 | 说明 |
734
- | --- | --- | --- | --- |
735
- | `appKey` | `string` | 否 | 字典应用 key。 |
736
- | `dictValue` | `string` | 是 | 字典类型值。 |
737
- | `nameKey` | `string` | 否 | 标签字段名。 |
738
- | `idKey` | `string` | 否 | 值字段名。 |
739
- | `onGetOption` | `(option: DictionarySelectItem \| DictionarySelectItem[]) => void` | 否 | 选择后返回字典项。 |
740
- | `onGetData` | `(data: DictionarySelectItem[]) => void` | 否 | 返回字典数据。 |
753
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
754
+ | --- | --- | --- | --- | --- |
755
+ | `appKey` | `string` | 否 | `DICTIONARY_APP_KEY_ENUM.DEFAULT` | 字典应用 key。 |
756
+ | `dictValue` | `string` | 是 | `""` | 字典类型值;为空会输出缺少参数错误。 |
757
+ | `nameKey` | `string` | 否 | `"dictLabel"` | 标签字段名。 |
758
+ | `idKey` | `string` | 否 | `"dictValue"` | 值字段名。 |
759
+ | `onGetOption` | `(option: DictionarySelectItem \| DictionarySelectItem[]) => void` | 否 | - | 选择后返回字典项。 |
760
+ | `onGetData` | `(data: DictionarySelectItem[]) => void` | 否 | - | 返回字典数据。 |
741
761
 
742
762
  `DictionarySelectItem`:
743
763
 
@@ -756,16 +776,16 @@ import PersonnelSelect from "zy-react-library/components/Select/Personnel/Gwj";
756
776
 
757
777
  人员选择器,继承 `BasicSelectProps`,内部接管人员数据源和默认字段。
758
778
 
759
- | 参数 | 类型 | 必填 | 说明 |
760
- | --- | --- | --- | --- |
761
- | `params` | `Params` | 否 | 人员查询基础参数。 |
762
- | `placeholder` | `string` | 否 | 占位文案。 |
763
- | `isNeedCorpInfoId` | `boolean` | 否 | 是否需要企业 ID。 |
764
- | `isNeedPostId` | `boolean` | 否 | 是否需要岗位 ID。 |
765
- | `isNeedDepartmentId` | `boolean` | 否 | 是否需要部门 ID。 |
766
- | `extraParams` | `ExtraParams` | 否 | 人员查询额外参数。 |
767
- | `onGetOption` | `(option: PersonnelSelectItem \| PersonnelSelectItem[]) => void` | 否 | 选择后返回人员项。 |
768
- | `onGetData` | `(data: PersonnelSelectItem[]) => void` | 否 | 返回人员数据。 |
779
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
780
+ | --- | --- | --- | --- | --- |
781
+ | `params` | `Params` | 否 | `{}` | 人员查询基础参数。 |
782
+ | `placeholder` | `string` | 否 | `"人员"` | 占位文案,最终显示为 `请选择人员`。 |
783
+ | `isNeedCorpInfoId` | `boolean` | 否 | `false` | 是否需要企业 ID。 |
784
+ | `isNeedPostId` | `boolean` | 否 | `false` | 是否需要岗位 ID。 |
785
+ | `isNeedDepartmentId` | `boolean` | 否 | `true` | 是否需要部门 ID。 |
786
+ | `extraParams` | `ExtraParams` | 否 | `{}`,内部再合并 `{ noMain: "", eqEmploymentFlag: 1 }` | 人员查询额外参数。 |
787
+ | `onGetOption` | `(option: PersonnelSelectItem \| PersonnelSelectItem[]) => void` | 否 | - | 选择后返回人员项。 |
788
+ | `onGetData` | `(data: PersonnelSelectItem[]) => void` | 否 | - | 返回人员数据。 |
769
789
 
770
790
  `Params`:
771
791
 
@@ -811,18 +831,18 @@ import BasicSelectTree from "zy-react-library/components/SelectTree/Basic";
811
831
 
812
832
  基础树选择器,继承 `Omit<TreeSelectProps, "fieldNames">`。
813
833
 
814
- | 参数 | 类型 | 必填 | 说明 |
815
- | --- | --- | --- | --- |
816
- | `nameKey` | `string` | 否 | 节点标签字段名。 |
817
- | `idKey` | `string` | 否 | 节点值字段名。 |
818
- | `childrenKey` | `string` | 否 | 子节点字段名。 |
819
- | `getNodePathsIsIncludeOneself` | `boolean` | 否 | 获取节点路径时是否包含当前节点。 |
820
- | `onGetNodePaths` | `(nodes: Record<string, any>[]) => void` | 否 | 返回当前节点路径。 |
821
- | `placeholder` | `string` | 否 | 占位文案。 |
822
- | `level` | `number` | 否 | 限制展示层级。 |
823
- | `onGetLabel` | `(label: string \| string[]) => void` | 否 | 返回选中标签。 |
824
- | `onGetData` | `(data, processedData) => void` | 否 | 返回原始数据和处理后的数据。 |
825
- | `onlyLastLevel` | `boolean` | 否 | 是否只允许选择最后一级。 |
834
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
835
+ | --- | --- | --- | --- | --- |
836
+ | `nameKey` | `string` | 否 | `"name"` | 节点标签字段名。 |
837
+ | `idKey` | `string` | 否 | `"id"` | 节点值字段名。 |
838
+ | `childrenKey` | `string` | 否 | `"children"` | 子节点字段名。 |
839
+ | `getNodePathsIsIncludeOneself` | `boolean` | 否 | `true` | 获取节点路径时是否包含当前节点。 |
840
+ | `onGetNodePaths` | `(nodes: Record<string, any>[]) => void` | 否 | - | 返回当前节点路径。 |
841
+ | `placeholder` | `string` | 否 | `""` | 占位文案,最终显示为 `请选择${placeholder}`。 |
842
+ | `level` | `number` | 否 | - | 限制展示层级。 |
843
+ | `onGetLabel` | `(label: string \| string[]) => void` | 否 | - | 返回选中标签。 |
844
+ | `onGetData` | `(data, processedData) => void` | 否 | - | 返回原始数据和处理后的数据。 |
845
+ | `onlyLastLevel` | `boolean` | 否 | `false` | 是否只允许选择最后一级。 |
826
846
 
827
847
  ### AreaSelectTree
828
848
 
@@ -834,10 +854,10 @@ import AreaSelectTree from "zy-react-library/components/SelectTree/Area";
834
854
 
835
855
  地区树选择器,继承 `BasicSelectTree` 能力,内部接管地区数据、默认字段和占位文案。
836
856
 
837
- | 参数 | 类型 | 必填 | 说明 |
838
- | --- | --- | --- | --- |
839
- | `onGetNodePaths` | `(nodes: AreaSelectTreeItem[]) => void` | 否 | 返回地区节点路径。 |
840
- | `onGetData` | `(data: AreaSelectTreeItem[], processedData: AreaSelectTreeItem[]) => void` | 否 | 返回原始地区数据和处理后的地区数据。 |
857
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
858
+ | --- | --- | --- | --- | --- |
859
+ | `onGetNodePaths` | `(nodes: AreaSelectTreeItem[]) => void` | 否 | - | 返回地区节点路径。 |
860
+ | `onGetData` | `(data: AreaSelectTreeItem[], processedData: AreaSelectTreeItem[]) => void` | 否 | - | 返回原始地区数据和处理后的地区数据。 |
841
861
 
842
862
  `AreaSelectTreeItem`:`value: string`、`label: string`、`children: AreaSelectTreeItem[]`。
843
863
 
@@ -851,10 +871,10 @@ import IndustrySelectTree from "zy-react-library/components/SelectTree/Industry"
851
871
 
852
872
  行业树选择器。
853
873
 
854
- | 参数 | 类型 | 必填 | 说明 |
855
- | --- | --- | --- | --- |
856
- | `onGetNodePaths` | `(nodes: IndustrySelectTreeItem[]) => void` | 否 | 返回行业节点路径。 |
857
- | `onGetData` | `(data: IndustrySelectTreeItem[], processedData: IndustrySelectTreeItem[]) => void` | 否 | 返回原始行业数据和处理后的行业数据。 |
874
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
875
+ | --- | --- | --- | --- | --- |
876
+ | `onGetNodePaths` | `(nodes: IndustrySelectTreeItem[]) => void` | 否 | - | 返回行业节点路径。 |
877
+ | `onGetData` | `(data: IndustrySelectTreeItem[], processedData: IndustrySelectTreeItem[]) => void` | 否 | - | 返回原始行业数据和处理后的行业数据。 |
858
878
 
859
879
  `IndustrySelectTreeItem`:`dict_value: string`、`dict_label: string`、`childrenList: IndustrySelectTreeItem[]`。
860
880
 
@@ -868,10 +888,10 @@ import DictionarySelectTree from "zy-react-library/components/SelectTree/Diction
868
888
 
869
889
  字典树选择器。
870
890
 
871
- | 参数 | 类型 | 必填 | 说明 |
872
- | --- | --- | --- | --- |
873
- | `appKey` | `string` | 否 | 字典应用 key。 |
874
- | `dictValue` | `string` | 是 | 字典类型值。 |
891
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
892
+ | --- | --- | --- | --- | --- |
893
+ | `appKey` | `string` | 否 | `DICTIONARY_APP_KEY_ENUM.DEFAULT` | 字典应用 key。 |
894
+ | `dictValue` | `string` | 是 | - | 字典类型值。 |
875
895
  | `nameKey` | `string` | 否 | 节点标签字段名。 |
876
896
  | `idKey` | `string` | 否 | 节点值字段名。 |
877
897
  | `onGetNodePaths` | `(nodes: DictionarySelectTreeItem[]) => void` | 否 | 返回字典节点路径。 |
@@ -889,15 +909,15 @@ import DepartmentSelectTree from "zy-react-library/components/SelectTree/Departm
889
909
 
890
910
  部门树选择器。
891
911
 
892
- | 参数 | 类型 | 必填 | 说明 |
893
- | --- | --- | --- | --- |
894
- | `params` | `Params` | 否 | 部门查询参数。 |
895
- | `placeholder` | `string` | 否 | 占位文案。 |
896
- | `isNeedCorpInfoId` | `boolean` | 否 | 是否需要企业 ID。 |
897
- | `isNeedParentId` | `boolean` | 否 | 是否需要父级 ID。 |
898
- | `searchType` | `"current" \| "all" \| "inType"` | 否 | 查询范围类型。 |
899
- | `onGetNodePaths` | `(nodes: DepartmentSelectTreeItem[]) => void` | 否 | 返回部门节点路径。 |
900
- | `onGetData` | `(data: DepartmentSelectTreeItem[], processedData: DepartmentSelectTreeItem[]) => void` | 否 | 返回原始部门数据和处理后的部门数据。 |
912
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
913
+ | --- | --- | --- | --- | --- |
914
+ | `params` | `Params` | 否 | `{}` | 部门查询参数。 |
915
+ | `placeholder` | `string` | 否 | `"部门"` | 占位文案。 |
916
+ | `isNeedCorpInfoId` | `boolean` | 否 | `false` | 是否需要企业 ID。 |
917
+ | `isNeedParentId` | `boolean` | 否 | `false` | 是否需要父级 ID。 |
918
+ | `searchType` | `"current" \| "all" \| "inType"` | 否 | `"current"` | 查询范围类型。 |
919
+ | `onGetNodePaths` | `(nodes: DepartmentSelectTreeItem[]) => void` | 否 | - | 返回部门节点路径。 |
920
+ | `onGetData` | `(data: DepartmentSelectTreeItem[], processedData: DepartmentSelectTreeItem[]) => void` | 否 | - | 返回原始部门数据和处理后的部门数据。 |
901
921
 
902
922
  `Params`:
903
923
 
@@ -920,13 +940,13 @@ import HiddenLevelSelectTree from "zy-react-library/components/SelectTree/Hidden
920
940
 
921
941
  隐患等级树选择器。
922
942
 
923
- | 参数 | 类型 | 必填 | 说明 |
924
- | --- | --- | --- | --- |
925
- | `isShowNeglect` | `boolean` | 否 | 是否显示可忽略等级。 |
926
- | `isShowLarger` | `boolean` | 否 | 是否显示较大等级。 |
927
- | `isShowMajor` | `boolean` | 否 | 是否显示重大等级。 |
928
- | `onGetNodePaths` | `(nodes: HiddenLevelSelectTreeItem[]) => void` | 否 | 返回隐患等级节点路径。 |
929
- | `onGetData` | `(data: HiddenLevelSelectTreeItem[], processedData: HiddenLevelSelectTreeItem[]) => void` | 否 | 返回原始数据和处理后的数据。 |
943
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
944
+ | --- | --- | --- | --- | --- |
945
+ | `isShowNeglect` | `boolean` | 否 | `true` | 是否显示可忽略等级。 |
946
+ | `isShowLarger` | `boolean` | 否 | `true` | 是否显示较大等级。 |
947
+ | `isShowMajor` | `boolean` | 否 | `true` | 是否显示重大等级。 |
948
+ | `onGetNodePaths` | `(nodes: HiddenLevelSelectTreeItem[]) => void` | 否 | - | 返回隐患等级节点路径。 |
949
+ | `onGetData` | `(data: HiddenLevelSelectTreeItem[], processedData: HiddenLevelSelectTreeItem[]) => void` | 否 | - | 返回原始数据和处理后的数据。 |
930
950
 
931
951
  `HiddenLevelSelectTreeItem`:`dictValue: string`、`dictLabel: string`、`children: HiddenLevelSelectTreeItem[]`。
932
952
 
@@ -940,12 +960,12 @@ import HiddenPartSelectTree from "zy-react-library/components/SelectTree/HiddenP
940
960
 
941
961
  隐患部位树选择器。
942
962
 
943
- | 参数 | 类型 | 必填 | 说明 |
944
- | --- | --- | --- | --- |
945
- | `params` | `{ eqCorpinfoId?: string }` | 否 | 查询参数。 |
946
- | `isNeedCorpInfoId` | `boolean` | 否 | 是否需要企业 ID。 |
947
- | `onGetNodePaths` | `(nodes: HiddenPartSelectTreeItem[]) => void` | 否 | 返回隐患部位节点路径。 |
948
- | `onGetData` | `(data: HiddenPartSelectTreeItem[], processedData: HiddenPartSelectTreeItem[]) => void` | 否 | 返回原始数据和处理后的数据。 |
963
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
964
+ | --- | --- | --- | --- | --- |
965
+ | `params` | `{ eqCorpinfoId?: string }` | 否 | `{}` | 查询参数。 |
966
+ | `isNeedCorpInfoId` | `boolean` | 否 | `false` | 是否需要企业 ID。 |
967
+ | `onGetNodePaths` | `(nodes: HiddenPartSelectTreeItem[]) => void` | 否 | - | 返回隐患部位节点路径。 |
968
+ | `onGetData` | `(data: HiddenPartSelectTreeItem[], processedData: HiddenPartSelectTreeItem[]) => void` | 否 | - | 返回原始数据和处理后的数据。 |
949
969
 
950
970
  `HiddenPartSelectTreeItem`:`hiddenregionId: string`、`hiddenregion: string`、`children: HiddenPartSelectTreeItem[]`。
951
971
 
@@ -961,16 +981,16 @@ import BasicCascader from "zy-react-library/components/Cascader/Basic";
961
981
 
962
982
  基础级联选择器,继承 `Omit<CascaderProps, "fieldNames">`。
963
983
 
964
- | 参数 | 类型 | 必填 | 说明 |
965
- | --- | --- | --- | --- |
966
- | `nameKey` | `string` | 否 | 节点标签字段名。 |
967
- | `idKey` | `string` | 否 | 节点值字段名。 |
968
- | `childrenKey` | `string` | 否 | 子节点字段名。 |
969
- | `getNodePathsIsIncludeOneself` | `boolean` | 否 | 获取节点路径时是否包含当前节点。 |
970
- | `onGetNodePaths` | `(nodes: Record<string, any>[]) => void` | 否 | 返回当前节点路径。 |
971
- | `placeholder` | `string` | 否 | 占位文案。 |
972
- | `level` | `number` | 否 | 限制展示层级。 |
973
- | `onGetData` | `(data, processedData) => void` | 否 | 返回原始数据和处理后的数据。 |
984
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
985
+ | --- | --- | --- | --- | --- |
986
+ | `nameKey` | `string` | 否 | `"name"` | 节点标签字段名。 |
987
+ | `idKey` | `string` | 否 | `"id"` | 节点值字段名。 |
988
+ | `childrenKey` | `string` | 否 | `"children"` | 子节点字段名。 |
989
+ | `getNodePathsIsIncludeOneself` | `boolean` | 否 | `true` | 获取节点路径时是否包含当前节点。 |
990
+ | `onGetNodePaths` | `(nodes: Record<string, any>[]) => void` | 否 | - | 返回当前节点路径。 |
991
+ | `placeholder` | `string` | 否 | `""` | 占位文案,最终显示为 `请选择${placeholder}`。 |
992
+ | `level` | `number` | 否 | - | 限制展示层级。 |
993
+ | `onGetData` | `(data, processedData) => void` | 否 | - | 返回原始数据和处理后的数据。 |
974
994
 
975
995
  ### AreaCascader
976
996
 
@@ -982,10 +1002,10 @@ import AreaCascader from "zy-react-library/components/Cascader/Area";
982
1002
 
983
1003
  地区级联选择器。
984
1004
 
985
- | 参数 | 类型 | 必填 | 说明 |
986
- | --- | --- | --- | --- |
987
- | `onGetNodePaths` | `(nodes: AreaCascaderItem[]) => void` | 否 | 返回地区节点路径。 |
988
- | `onGetData` | `(data: AreaCascaderItem[], processedData: AreaCascaderItem[]) => void` | 否 | 返回原始地区数据和处理后的地区数据。 |
1005
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
1006
+ | --- | --- | --- | --- | --- |
1007
+ | `onGetNodePaths` | `(nodes: AreaCascaderItem[]) => void` | 否 | - | 返回地区节点路径。 |
1008
+ | `onGetData` | `(data: AreaCascaderItem[], processedData: AreaCascaderItem[]) => void` | 否 | - | 返回原始地区数据和处理后的地区数据。 |
989
1009
 
990
1010
  `AreaCascaderItem`:`value: string`、`label: string`、`children: AreaCascaderItem[]`。
991
1011
 
@@ -999,10 +1019,10 @@ import IndustryCascader from "zy-react-library/components/Cascader/Industry";
999
1019
 
1000
1020
  行业级联选择器。
1001
1021
 
1002
- | 参数 | 类型 | 必填 | 说明 |
1003
- | --- | --- | --- | --- |
1004
- | `onGetNodePaths` | `(nodes: IndustryCascaderItem[]) => void` | 否 | 返回行业节点路径。 |
1005
- | `onGetData` | `(data: IndustryCascaderItem[], processedData: IndustryCascaderItem[]) => void` | 否 | 返回原始行业数据和处理后的行业数据。 |
1022
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
1023
+ | --- | --- | --- | --- | --- |
1024
+ | `onGetNodePaths` | `(nodes: IndustryCascaderItem[]) => void` | 否 | - | 返回行业节点路径。 |
1025
+ | `onGetData` | `(data: IndustryCascaderItem[], processedData: IndustryCascaderItem[]) => void` | 否 | - | 返回原始行业数据和处理后的行业数据。 |
1006
1026
 
1007
1027
  `IndustryCascaderItem`:`dict_value: string`、`dict_label: string`、`childrenList: IndustryCascaderItem[]`。
1008
1028
 
@@ -1016,10 +1036,10 @@ import DictionaryCascader from "zy-react-library/components/Cascader/Dictionary"
1016
1036
 
1017
1037
  字典级联选择器。
1018
1038
 
1019
- | 参数 | 类型 | 必填 | 说明 |
1020
- | --- | --- | --- | --- |
1021
- | `appKey` | `string` | 否 | 字典应用 key。 |
1022
- | `dictValue` | `string` | 是 | 字典类型值。 |
1039
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
1040
+ | --- | --- | --- | --- | --- |
1041
+ | `appKey` | `string` | 否 | `DICTIONARY_APP_KEY_ENUM.DEFAULT` | 字典应用 key。 |
1042
+ | `dictValue` | `string` | 是 | - | 字典类型值。 |
1023
1043
  | `nameKey` | `string` | 否 | 节点标签字段名。 |
1024
1044
  | `idKey` | `string` | 否 | 节点值字段名。 |
1025
1045
  | `onGetNodePaths` | `(nodes: DictionaryCascaderItem[]) => void` | 否 | 返回字典节点路径。 |
@@ -1039,14 +1059,14 @@ import BasicLeftTree from "zy-react-library/components/LeftTree/Basic";
1039
1059
 
1040
1060
  基础树组件,继承 `Omit<TreeProps, "fieldNames">`。
1041
1061
 
1042
- | 参数 | 类型 | 必填 | 说明 |
1043
- | --- | --- | --- | --- |
1044
- | `nameKey` | `string` | 否 | 节点标题字段名。 |
1045
- | `idKey` | `string` | 否 | 节点 key 字段名。 |
1046
- | `childrenKey` | `string` | 否 | 子节点字段名。 |
1047
- | `getNodePathsIsIncludeOneself` | `boolean` | 否 | 获取节点路径时是否包含当前节点。 |
1048
- | `onGetNodePaths` | `(nodes: Record<string, any>[]) => void` | 否 | 返回当前节点路径。 |
1049
- | `onGetData` | `(data: Record<string, any>[]) => void` | 否 | 返回树数据。 |
1062
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
1063
+ | --- | --- | --- | --- | --- |
1064
+ | `nameKey` | `string` | 否 | `"name"` | 节点标题字段名。 |
1065
+ | `idKey` | `string` | 否 | `"id"` | 节点 key 字段名。 |
1066
+ | `childrenKey` | `string` | 否 | `"children"` | 子节点字段名。 |
1067
+ | `getNodePathsIsIncludeOneself` | `boolean` | 否 | `true` | 获取节点路径时是否包含当前节点。 |
1068
+ | `onGetNodePaths` | `(nodes: Record<string, any>[]) => void` | 否 | - | 返回当前节点路径。 |
1069
+ | `onGetData` | `(data: Record<string, any>[]) => void` | 否 | - | 返回树数据。 |
1050
1070
 
1051
1071
  ### AreaLeftTree
1052
1072
 
@@ -1058,10 +1078,10 @@ import AreaLeftTree from "zy-react-library/components/LeftTree/Area";
1058
1078
 
1059
1079
  地区左侧树。
1060
1080
 
1061
- | 参数 | 类型 | 必填 | 说明 |
1062
- | --- | --- | --- | --- |
1063
- | `onGetNodePaths` | `(nodes: AreaLeftTreeItem[]) => void` | 否 | 返回地区节点路径。 |
1064
- | `onGetData` | `(data: AreaLeftTreeItem[], processedData: AreaLeftTreeItem[]) => void` | 否 | 返回原始地区数据和处理后的地区数据。 |
1081
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
1082
+ | --- | --- | --- | --- | --- |
1083
+ | `onGetNodePaths` | `(nodes: AreaLeftTreeItem[]) => void` | 否 | - | 返回地区节点路径。 |
1084
+ | `onGetData` | `(data: AreaLeftTreeItem[], processedData: AreaLeftTreeItem[]) => void` | 否 | - | 返回原始地区数据和处理后的地区数据。 |
1065
1085
 
1066
1086
  `AreaLeftTreeItem`:`value: string`、`label: string`、`children: AreaLeftTreeItem[]`。
1067
1087
 
@@ -1075,14 +1095,14 @@ import DictionaryLeftTree from "zy-react-library/components/LeftTree/Dictionary"
1075
1095
 
1076
1096
  字典左侧树。
1077
1097
 
1078
- | 参数 | 类型 | 必填 | 说明 |
1079
- | --- | --- | --- | --- |
1080
- | `appKey` | `string` | 否 | 字典应用 key。 |
1081
- | `dictValue` | `string` | 是 | 字典类型值。 |
1082
- | `nameKey` | `string` | 否 | 节点标题字段名。 |
1083
- | `idKey` | `string` | 否 | 节点 key 字段名。 |
1084
- | `onGetNodePaths` | `(nodes: DictionaryLeftTreeItem[]) => void` | 否 | 返回字典节点路径。 |
1085
- | `onGetData` | `(data: DictionaryLeftTreeItem[], processedData: DictionaryLeftTreeItem[]) => void` | 否 | 返回原始字典数据和处理后的字典数据。 |
1098
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
1099
+ | --- | --- | --- | --- | --- |
1100
+ | `appKey` | `string` | 否 | `DICTIONARY_APP_KEY_ENUM.DEFAULT` | 字典应用 key。 |
1101
+ | `dictValue` | `string` | 是 | `""` | 字典类型值;为空会输出缺少参数错误。 |
1102
+ | `nameKey` | `string` | 否 | `"dictLabel"` | 节点标题字段名。 |
1103
+ | `idKey` | `string` | 否 | `"dictValue"` | 节点 key 字段名。 |
1104
+ | `onGetNodePaths` | `(nodes: DictionaryLeftTreeItem[]) => void` | 否 | - | 返回字典节点路径。 |
1105
+ | `onGetData` | `(data: DictionaryLeftTreeItem[], processedData: DictionaryLeftTreeItem[]) => void` | 否 | - | 返回原始字典数据和处理后的字典数据。 |
1086
1106
 
1087
1107
  `DictionaryLeftTreeItem`:`dictValue: string`、`dictLabel: string`、`children: DictionaryLeftTreeItem[]`。
1088
1108
 
@@ -1096,12 +1116,12 @@ import DepartmentLeftTree from "zy-react-library/components/LeftTree/Department/
1096
1116
 
1097
1117
  部门左侧树。
1098
1118
 
1099
- | 参数 | 类型 | 必填 | 说明 |
1100
- | --- | --- | --- | --- |
1101
- | `params` | `DepartmentSelectTreeProps["params"]` | 否 | 部门查询参数。 |
1102
- | `searchType` | `DepartmentSelectTreeProps["searchType"]` | 否 | 查询范围类型。 |
1103
- | `onGetNodePaths` | `(nodes: DepartmentLeftTreeItem[]) => void` | 否 | 返回部门节点路径。 |
1104
- | `onGetData` | `(data: DepartmentLeftTreeItem[], processedData: DepartmentLeftTreeItem[]) => void` | 否 | 返回原始部门数据和处理后的部门数据。 |
1119
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
1120
+ | --- | --- | --- | --- | --- |
1121
+ | `params` | `DepartmentSelectTreeProps["params"]` | 否 | `{}` | 部门查询参数。 |
1122
+ | `searchType` | `DepartmentSelectTreeProps["searchType"]` | 否 | `"current"` | 查询范围类型。 |
1123
+ | `onGetNodePaths` | `(nodes: DepartmentLeftTreeItem[]) => void` | 否 | - | 返回部门节点路径。 |
1124
+ | `onGetData` | `(data: DepartmentLeftTreeItem[], processedData: DepartmentLeftTreeItem[]) => void` | 否 | - | 返回原始部门数据和处理后的部门数据。 |
1105
1125
 
1106
1126
  `DepartmentLeftTreeItem`:`id: string`、`name: string`、`childrenList: DepartmentLeftTreeItem[]`。
1107
1127
 
@@ -1125,11 +1145,28 @@ import DepartmentLeftTree from "zy-react-library/components/LeftTree/Department/
1125
1145
  | `VideoIcon` | `zy-react-library/components/Icon/VideoIcon` |
1126
1146
  | `ViewIcon` | `zy-react-library/components/Icon/ViewIcon` |
1127
1147
 
1128
- ## Hooks
1129
-
1130
- ### useTable
1131
-
1132
- 引入:
1148
+ ## Hooks
1149
+
1150
+ ### Hook 默认值速查
1151
+
1152
+ | Hook | 默认值 |
1153
+ | --- | --- |
1154
+ | `useTable` | `usePagination=true`、`useStorageQueryCriteria=true`、`usePermission=true`、`defaultType="advance"`、`defaultPagination={ current: 1, pageSize: 20 }`。 |
1155
+ | `useUploadFile` | `returnType="object"`;执行上传时 `files=[]`、`single=true`。 |
1156
+ | `useGetFile` | `returnType="object"`;执行获取时 `single=true`。 |
1157
+ | `useDeleteFile` | `returnType="object"`;执行删除时 `files=[]`、`single=true`。 |
1158
+ | `useImportFile` | `returnType="object"`;执行导入时 `options.files=[]`、`options.params={}`。 |
1159
+ | `useDownloadBlob` | `returnType="object"`;执行下载时 `options.name=""`、`options.type=""`、`options.params={}`,未传 `type` 时使用 `application/vnd.ms-excel`,未传 `name` 时使用当前时间 `YYYY-MM-DD HH:mm:ss`。 |
1160
+ | `useDownloadFile` | `returnType="object"`;未传 `name` 时从 `url` 中截取文件名。 |
1161
+ | `useDictionary` | `returnType="object"`;执行获取时 `appKey=DICTIONARY_APP_KEY_ENUM.DEFAULT`。 |
1162
+ | `useGetUserInfo` | `returnType="object"`。 |
1163
+ | `useIdle` | `timeout=10000`、`events=["mousemove","mousedown","resize","keydown","touchstart","wheel"]`。 |
1164
+ | `useIsExistenceDuplicateSelection` | `message="存在重复项,请勿重复选择"`。 |
1165
+ | `useUrlQueryCriteria` | URL 状态初始值 `{ searchFormKeys: "", searchFormValues: "", paginationKeys: "", paginationValues: "" }`,`navigateMode="replace"`。 |
1166
+
1167
+ ### useTable
1168
+
1169
+ 引入:
1133
1170
 
1134
1171
  ```tsx
1135
1172
  import useTable from "zy-react-library/hooks/useTable";
@@ -1194,21 +1231,21 @@ useUploadFile("object"): { loading: boolean; uploadFile: UploadFileFunction }
1194
1231
 
1195
1232
  单文件上传参数:
1196
1233
 
1197
- | 参数 | 类型 | 必填 | 说明 |
1198
- | --- | --- | --- | --- |
1199
- | `files` | `UploadFile[]` | 是 | 待上传文件。 |
1200
- | `single` | `true` | 否 | 单文件上传标识。 |
1201
- | `params` | `SingleParams` | 是 | 上传参数。 |
1234
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
1235
+ | --- | --- | --- | --- | --- |
1236
+ | `files` | `UploadFile[]` | 是 | `[]` | 待上传文件;为空时直接返回空文件结果。 |
1237
+ | `single` | `true` | 否 | `true` | 单文件上传标识。 |
1238
+ | `params` | `SingleParams` | 是 | - | 上传参数。 |
1202
1239
 
1203
1240
  `SingleParams`:`type: number`、`corpinfoId?: string`、`foreignKey?: string`。
1204
1241
 
1205
1242
  多文件上传参数:
1206
1243
 
1207
- | 参数 | 类型 | 必填 | 说明 |
1208
- | --- | --- | --- | --- |
1209
- | `files` | `UploadFile[]` | 是 | 待上传文件。 |
1210
- | `single` | `false` | 是 | 多文件上传标识。 |
1211
- | `params` | `MultipleParams` | 是 | 上传参数。 |
1244
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
1245
+ | --- | --- | --- | --- | --- |
1246
+ | `files` | `UploadFile[]` | 是 | `[]` | 待上传文件;为空时直接返回原 `foreignKey`。 |
1247
+ | `single` | `false` | 是 | - | 多文件上传标识。 |
1248
+ | `params` | `MultipleParams` | 是 | - | 上传参数。 |
1212
1249
 
1213
1250
  `MultipleParams`:`type: number`、`corpinfoId?: string`、`foreignKey: string`。
1214
1251
 
@@ -1231,20 +1268,20 @@ useGetFile("object"): { loading: boolean; getFile: GetFileFunction }
1231
1268
 
1232
1269
  单文件获取参数:
1233
1270
 
1234
- | 参数 | 类型 | 必填 | 说明 |
1235
- | --- | --- | --- | --- |
1236
- | `eqType` | `number` | 是 | 文件类型。 |
1237
- | `eqForeignKey` | `string` | 是 | 外键 ID。 |
1238
- | `single` | `true` | 否 | 单文件获取标识。 |
1271
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
1272
+ | --- | --- | --- | --- | --- |
1273
+ | `eqType` | `number` | 是 | - | 文件类型。 |
1274
+ | `eqForeignKey` | `string` | 是 | - | 外键 ID。 |
1275
+ | `single` | `true` | 否 | `true` | 单文件获取标识。 |
1239
1276
 
1240
1277
  多文件获取参数:
1241
1278
 
1242
- | 参数 | 类型 | 必填 | 说明 |
1243
- | --- | --- | --- | --- |
1244
- | `eqType` | `number` | 是 | 文件类型。 |
1245
- | `foreignKey` | `string` | 是 | `dataSource` 中外键 ID 的字段名。 |
1246
- | `single` | `false` | 是 | 多文件获取标识。 |
1247
- | `dataSource` | `Record<string, any>[]` | 是 | 原始数据源。 |
1279
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
1280
+ | --- | --- | --- | --- | --- |
1281
+ | `eqType` | `number` | 是 | - | 文件类型。 |
1282
+ | `foreignKey` | `string` | 是 | - | `dataSource` 中外键 ID 的字段名。 |
1283
+ | `single` | `false` | 是 | - | 多文件获取标识。 |
1284
+ | `dataSource` | `Record<string, any>[]` | 是 | - | 原始数据源;空数组时直接返回空数组。 |
1248
1285
 
1249
1286
  `GetFileItem`:
1250
1287
 
@@ -1272,10 +1309,10 @@ useDeleteFile("array"): [boolean, DeleteFileFunction]
1272
1309
  useDeleteFile("object"): { loading: boolean; deleteFile: DeleteFileFunction }
1273
1310
  ```
1274
1311
 
1275
- | 参数 | 类型 | 必填 | 说明 |
1276
- | --- | --- | --- | --- |
1277
- | `files` | `DeleteFileItem[]` | 是 | 待删除文件。 |
1278
- | `single` | `boolean` | 否 | 是否按单文件删除。 |
1312
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
1313
+ | --- | --- | --- | --- | --- |
1314
+ | `files` | `DeleteFileItem[]` | 是 | `[]` | 待删除文件;为空时直接结束。 |
1315
+ | `single` | `boolean` | 否 | `true` | 是否按单文件删除。 |
1279
1316
 
1280
1317
  `DeleteFileItem`:`filePath?: string`、`id?: string`。
1281
1318
 
@@ -1296,11 +1333,11 @@ useImportFile("object"): { loading: boolean; importFile: ImportFileFunction }
1296
1333
 
1297
1334
  `importFile(url, options)` 参数:
1298
1335
 
1299
- | 参数 | 类型 | 必填 | 说明 |
1300
- | --- | --- | --- | --- |
1301
- | `url` | `string` | 是 | 导入接口地址。 |
1302
- | `options.files` | `UploadFile[]` | 是 | 上传文件数组。 |
1303
- | `options.params` | `Record<string, any>` | 否 | 额外提交参数。 |
1336
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
1337
+ | --- | --- | --- | --- | --- |
1338
+ | `url` | `string` | 是 | - | 导入接口地址。 |
1339
+ | `options.files` | `UploadFile[]` | 是 | `[]` | 上传文件数组。 |
1340
+ | `options.params` | `Record<string, any>` | 否 | `{}` | 额外提交参数。 |
1304
1341
 
1305
1342
  `UploadFile`:`originFileObj?: File`,并支持业务扩展字段。
1306
1343
 
@@ -1319,10 +1356,10 @@ useDownloadFile("array"): [boolean, DownloadFileFunction]
1319
1356
  useDownloadFile("object"): { loading: boolean; downloadFile: DownloadFileFunction }
1320
1357
  ```
1321
1358
 
1322
- | 参数 | 类型 | 必填 | 说明 |
1323
- | --- | --- | --- | --- |
1324
- | `url` | `string` | 是 | 下载地址。 |
1325
- | `name` | `string` | 否 | 下载文件名。 |
1359
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
1360
+ | --- | --- | --- | --- | --- |
1361
+ | `url` | `string` | 是 | - | 下载地址。 |
1362
+ | `name` | `string` | 否 | `url` 截取文件名 | 下载文件名;传入无后缀文件名时会尝试使用 `url` 后缀补齐。 |
1326
1363
 
1327
1364
  ### useDownloadBlob
1328
1365
 
@@ -1341,12 +1378,12 @@ useDownloadBlob("object"): { loading: boolean; downloadBlob: DownloadBlobFunctio
1341
1378
 
1342
1379
  `downloadBlob(url, options?)` 参数:
1343
1380
 
1344
- | 参数 | 类型 | 必填 | 说明 |
1345
- | --- | --- | --- | --- |
1346
- | `url` | `string` | 是 | 下载接口地址。 |
1347
- | `options.name` | `string` | 否 | 自定义文件名,不含后缀。 |
1348
- | `options.type` | `string` | 否 | Blob MIME 类型。 |
1349
- | `options.params` | `Record<string, any>` | 否 | 请求查询参数。 |
1381
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
1382
+ | --- | --- | --- | --- | --- |
1383
+ | `url` | `string` | 是 | - | 下载接口地址。 |
1384
+ | `options.name` | `string` | 否 | 当前时间 `YYYY-MM-DD HH:mm:ss` | 自定义文件名,不含后缀。 |
1385
+ | `options.type` | `string` | 否 | `"application/vnd.ms-excel"` | Blob MIME 类型。 |
1386
+ | `options.params` | `Record<string, any>` | 否 | `{}` | 请求查询参数。 |
1350
1387
 
1351
1388
  返回:`Promise<{ data: Blob }>`。
1352
1389
 
@@ -1365,12 +1402,12 @@ useDictionary("array"): [boolean, getDictionaryFunction]
1365
1402
  useDictionary("object"): { loading: boolean; getDictionary: getDictionaryFunction }
1366
1403
  ```
1367
1404
 
1368
- `getDictionary(options)` 参数:
1369
-
1370
- | 参数 | 类型 | 必填 | 说明 |
1371
- | --- | --- | --- | --- |
1372
- | `appKey` | `string` | 否 | 字典应用 key。 |
1373
- | `dictValue` | `string` | 是 | 字典类型值。 |
1405
+ `getDictionary(options)` 参数:
1406
+
1407
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
1408
+ | --- | --- | --- | --- | --- |
1409
+ | `appKey` | `string` | 否 | `DICTIONARY_APP_KEY_ENUM.DEFAULT` | 字典应用 key。 |
1410
+ | `dictValue` | `string` | 是 | - | 字典类型值。 |
1374
1411
 
1375
1412
  返回 `Promise<DictionaryItem[]>`。
1376
1413
 
@@ -1451,10 +1488,10 @@ import useIdle from "zy-react-library/hooks/useIdle";
1451
1488
 
1452
1489
  检测用户是否空闲。
1453
1490
 
1454
- | 参数 | 类型 | 必填 | 说明 |
1455
- | --- | --- | --- | --- |
1456
- | `timeout` | `number` | 否 | 空闲超时时间。 |
1457
- | `events` | `string[]` | 否 | 用于判断活跃状态的事件名列表。 |
1491
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
1492
+ | --- | --- | --- | --- | --- |
1493
+ | `timeout` | `number` | 否 | `10000` | 空闲超时时间,单位毫秒。 |
1494
+ | `events` | `string[]` | 否 | `["mousemove","mousedown","resize","keydown","touchstart","wheel"]` | 用于判断活跃状态的事件名列表。 |
1458
1495
 
1459
1496
  返回:`boolean`,表示是否处于空闲状态。
1460
1497
 
@@ -1470,11 +1507,11 @@ import useIsExistenceDuplicateSelection from "zy-react-library/hooks/useIsExiste
1470
1507
 
1471
1508
  `isExistenceDuplicateSelection(options)` 参数:
1472
1509
 
1473
- | 参数 | 类型 | 必填 | 说明 |
1474
- | --- | --- | --- | --- |
1475
- | `data` | `T[]` | 是 | 需要检查重复项的目标数组。 |
1476
- | `key` | `keyof T \| string` | 是 | 用于判断重复的对象属性名。 |
1477
- | `message` | `string` | 否 | 存在重复项时的错误提示。 |
1510
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
1511
+ | --- | --- | --- | --- | --- |
1512
+ | `data` | `T[]` | 是 | - | 需要检查重复项的目标数组。 |
1513
+ | `key` | `keyof T \| string` | 是 | - | 用于判断重复的对象属性名。 |
1514
+ | `message` | `string` | 否 | `"存在重复项,请勿重复选择"` | 存在重复项时的错误提示。 |
1478
1515
 
1479
1516
  返回:`Promise<void>`。
1480
1517
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zy-react-library",
3
3
  "private": false,
4
- "version": "2.0.9",
4
+ "version": "2.0.10",
5
5
  "type": "module",
6
6
  "description": "",
7
7
  "author": "LiuJiaNan",