Skip to content

Commit

Permalink
✨ feat(ims-view-pc): add FileUpload FileViewer ExportWord
Browse files Browse the repository at this point in the history
  • Loading branch information
eternallycyf committed May 8, 2024
1 parent f38858f commit d1f3073
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 2 deletions.
18 changes: 16 additions & 2 deletions packages/ims-view-pc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,21 @@
"resize-observer-polyfill": "1.5.1",
"runes2": "^1.1.2",
"video.js": "^7.21.5",
"copy-to-clipboard": "^3.3.3"
"copy-to-clipboard": "^3.3.3",
"react-excel-renderer": "^1.1.0",
"docx-preview": "^0.3.1",
"react-syntax-highlighter": "^15.5.0",
"react-markdown": "^9.0.1",
"remark-gfm": "^4.0.0",
"file-saver": "^2.0.5",
"docx-preview": "^0.3.1",
"jszip": "^3.10.1",
"jszip-utils": "^0.1.0",
"open-docxtemplater-image-module": "^1.0.3",
"pizzip": "^3.1.7",
"react-excel-renderer": "^1.1.0",
"react-file-viewer": "^1.2.1",
"react-markdown": "^9.0.1"
},
"peerDependencies": {
"@ant-design/icons": "^5.2.6",
Expand All @@ -52,4 +66,4 @@
"access": "public",
"registry": "https://registry.npmjs.org"
}
}
}
14 changes: 14 additions & 0 deletions packages/ims-view-pc/src/components/ExportWord/index.md
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)
82 changes: 82 additions & 0 deletions packages/ims-view-pc/src/components/FileUpload/index.md
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,
}
}
```
14 changes: 14 additions & 0 deletions packages/ims-view-pc/src/components/FileViewer/index.md
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)

0 comments on commit d1f3073

Please sign in to comment.