generated from eternallycyf/ims-monorepo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat(ims-view-pc): add FileUpload FileViewer ExportWord
- Loading branch information
1 parent
f38858f
commit d1f3073
Showing
4 changed files
with
126 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: ExportWord | ||
description: 导出word | ||
toc: content | ||
group: | ||
title: 文件 | ||
order: 5 | ||
demo: | ||
cols: 2 | ||
--- | ||
|
||
## ExportWord 导出 word | ||
|
||
[ExportWord](https://github.com/eternallycyf/Antd-CustomComponent/blob/main/src/pages/ExportWord/index.tsx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
title: FileUpload | ||
description: 上传文件 | ||
toc: content | ||
group: | ||
title: 文件 | ||
order: 5 | ||
demo: | ||
cols: 2 | ||
--- | ||
|
||
## FileUpload 上传文件 | ||
|
||
[FileUpload](https://github.com/eternallycyf/Antd-CustomComponent/blob/main/src/components/File/FileUpload/index.tsx) | ||
|
||
## 单独使用 | ||
|
||
```tsx | pure | ||
<Form.Item name="xxx"> | ||
<FileUpload | ||
attachment={{ | ||
label: 'xxx', | ||
name: 'name', | ||
isRequired: true, | ||
extraRecord: { | ||
busiType: 'XXX', | ||
}, | ||
extra: [ | ||
{ | ||
text: '自定义按钮', | ||
type: 'primary', | ||
className: styles['btn-primary'], | ||
}, | ||
], | ||
}} | ||
actionUrl={'xxx'} | ||
isDetail={false} | ||
colNumber={8} | ||
/> | ||
</Form.Item> | ||
``` | ||
|
||
## 公共组件中使用 | ||
|
||
```tsx | pure | ||
{ | ||
name: 'file', | ||
label: '附件上传', | ||
type: 'fileUpload', | ||
itemProps: { | ||
rules: [ | ||
{ | ||
validator: (_:any, fileList) => { | ||
if(fileList && fileList.length > 0) return Promise.resolve() | ||
return Promise.reject('请上传附件') | ||
} | ||
} | ||
] | ||
}, | ||
col: 24, | ||
controlProps: { | ||
attachment: { | ||
label: '附件上传', | ||
name: 'name', | ||
isRequired: true, | ||
extraRecord: { | ||
busiType: 'XXX', | ||
}, | ||
extra: [ | ||
{ | ||
text: '自定义按钮', | ||
type: 'primary', | ||
className: styles['btn-primary'], | ||
}, | ||
], | ||
}, | ||
actionUrl: 'xxx', | ||
isDetail: false, | ||
colNumber: 8, | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: FileViewer | ||
description: 文件预览 | ||
toc: content | ||
group: | ||
title: 文件 | ||
order: 5 | ||
demo: | ||
cols: 2 | ||
--- | ||
|
||
## FileViewer 文件预览 | ||
|
||
[FileViewer](https://github.com/eternallycyf/Antd-CustomComponent/blob/main/src/pages/FileViewer/index.tsx) |