index.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <!--
  2. * @Author: ChenYaJin
  3. * @Date: 2021-06-16 14:46:07
  4. * @LastEditors: LiZhiWei
  5. * @LastEditTime: 2025-04-15 15:37:16
  6. * @Description: 文件柜-预览其他
  7. -->
  8. <template>
  9. <div class="view-other">
  10. <el-image :src="viewOffImage" class="view-off-icon">
  11. <div slot="error" class="image-slot">
  12. <i class="el-icon-picture-outline"></i>
  13. </div>
  14. </el-image>
  15. <p>{{file.name}}.{{file.type}}<span class="size-item">{{getFileSize}}</span></p>
  16. <p><big><strong>该类型文件不支持在线预览,请下载后查看。</strong></big></p>
  17. </div>
  18. </template>
  19. <script>
  20. import commJs from '@/comm_js/index'
  21. import viewOffImage from '../../../assets/view_off.svg'
  22. export default {
  23. name: 'ViewOtherComponent',
  24. props: {
  25. file: {
  26. type: Object,
  27. default: () => {
  28. return {}
  29. }
  30. }
  31. },
  32. data () {
  33. return {
  34. viewOffImage
  35. }
  36. },
  37. computed: {
  38. getFileSize () {
  39. return commJs.fileSizeFormat(this.file.size, 'KB')
  40. }
  41. },
  42. methods: {
  43. },
  44. mounted () {
  45. }
  46. }
  47. </script>
  48. <style lang="less" scoped>
  49. .view-other {
  50. display: flex;
  51. flex-direction: column;
  52. align-items: center;
  53. justify-content: center;
  54. height: 100%;
  55. .size-item {
  56. margin-left: 10px;
  57. }
  58. }
  59. </style>