config.ts 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. import type { ModuleConfig } from "/@/cool";
  2. export default (): ModuleConfig => {
  3. return {
  4. label: "文件上传",
  5. description: "基于 el-upload 封装的文件上传组件",
  6. author: "COOL",
  7. version: "1.1.3",
  8. updateTime: "2024-03-13",
  9. demo: [
  10. {
  11. name: "基础用法",
  12. component: () => import("./demo/base.vue")
  13. },
  14. {
  15. name: "多图上传",
  16. component: () => import("./demo/multiple.vue")
  17. },
  18. {
  19. name: "文件上传",
  20. component: () => import("./demo/file.vue")
  21. },
  22. {
  23. name: "可拖拽",
  24. component: () => import("./demo/drag.vue")
  25. },
  26. {
  27. name: "自定义内容",
  28. component: () => import("./demo/custom.vue")
  29. },
  30. {
  31. name: "上传校验",
  32. component: () => import("./demo/check.vue")
  33. },
  34. {
  35. name: "文件空间",
  36. component: () => import("./demo/space.vue")
  37. }
  38. ],
  39. // 参数
  40. options: {
  41. // 尺寸
  42. size: 120,
  43. // 限制
  44. limit: {
  45. // 上传最大数量
  46. upload: 9,
  47. // 上传大小限制
  48. size: 100
  49. },
  50. // 云端上传路径前缀
  51. prefixPath: "app/base",
  52. // 规则
  53. rules: [
  54. {
  55. name: "图片",
  56. type: "image",
  57. color: "#67C23A",
  58. exts: ["bmp", "jpg", "jpeg", "png", "tif", "gif", "svg", "webp"]
  59. },
  60. {
  61. name: "视频",
  62. type: "video",
  63. color: "#826aec",
  64. exts: ["avi", "wmv", "mpg", "mpeg", "mov", "rm", "ram", "swf", "flv", "mp4"]
  65. },
  66. {
  67. name: "音频",
  68. type: "audio",
  69. color: "#826aec",
  70. exts: ["mp3", "wav", "wma", "mp2", "flac", "midi", "ra", "ape", "aac", "cda"]
  71. },
  72. {
  73. name: "文档",
  74. type: "word",
  75. color: "#53B7F4",
  76. exts: ["doc", "dot", "wps", "wpt", "docx", "dotx", "docm", "dotm"]
  77. },
  78. {
  79. name: "表格",
  80. type: "excel",
  81. color: "#53D39C",
  82. exts: ["xls", "xlt", "et", "xlsx", "xltx", "xlsm", "xltm"]
  83. },
  84. {
  85. name: "演示",
  86. type: "ppt",
  87. color: "#F56C6C",
  88. exts: [
  89. "ppt",
  90. "pptx",
  91. "pptm",
  92. "ppsx",
  93. "ppsm",
  94. "pps",
  95. "potx",
  96. "potm",
  97. "dpt",
  98. "dps"
  99. ]
  100. },
  101. {
  102. name: "PDF",
  103. type: "pdf",
  104. exts: ["pdf"],
  105. color: "#8f3500"
  106. },
  107. {
  108. name: "压缩文件夹",
  109. type: "rar",
  110. color: "#FFC757",
  111. exts: ["rar", "zip"]
  112. },
  113. {
  114. name: "文件",
  115. type: "file",
  116. color: "#909399",
  117. exts: []
  118. }
  119. ]
  120. },
  121. components: [
  122. () => import("./components/upload.vue"),
  123. () => import("./components/upload-item/index.vue")
  124. ]
  125. };
  126. };