| | |
| | | <div class="card-main flex-1 my-5 relative"> |
| | | <div class="main-content absolute top-0 bottom-0 left-0 right-0"> |
| | | <el-table :data="fileList" height="100%"> |
| | | <el-table-column label="文件名称" align="center"> |
| | | <el-table-column label="文件名称"> |
| | | <template #default="scope"> |
| | | <div class="row-info"> |
| | | <div class="icon"> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="pdf-container"> |
| | | <PDFViewer :pdfUrl="'/helloworld.pdf'"></PDFViewer> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { ref } from 'vue'; |
| | | import NormalHeader from '@/components/NormalHeader/index.vue'; |
| | | import { Search } from '@element-plus/icons-vue'; |
| | | import { getFileList } from '@/api/modules/file.js'; |
| | | |
| | | import PDFViewer from '@/components/PDFViewer/index.vue'; |
| | | |
| | | const fileType = { |
| | | 'img': { |
| | |
| | | iconPath: '/static/icons/file_type_video.png', |
| | | handle: (item) => { |
| | | console.log(item); |
| | | |
| | | } |
| | | }, |
| | | 'pdf': { |
| | | iconPath: '/static/icons/file_type_image.png', |
| | | handle: (item) => { |
| | | console.log(item); |
| | | |
| | | } |
| | | }, |
| | | }; |
| | |
| | | fileType[item.type] && fileType[item.type].handle(item); |
| | | }; |
| | | |
| | | const getData = () => { |
| | | getFileList().then(res => { |
| | | |
| | | }); |
| | | }; |
| | | getData(); |
| | | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | |
| | | margin-right: 20px; |
| | | } |
| | | } |
| | | |
| | | .pdf-container { |
| | | width: 800px; |
| | | height: 800px; |
| | | position: absolute; |
| | | z-index: 2; |
| | | top: 50%; |
| | | left: 50%; |
| | | transform: translate(-50%, -50%); |
| | | } |
| | | </style> |