星火管控前端
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

fileConfig.js 1.9KB

před 9 měsíci
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. //文件上传格式
  2. export const ACCEPT_CONFIG = {
  3. image: [".png", ".jpg", ".jpeg"], // ".gif", ".bmp"
  4. client: [".exe"],
  5. app: [".apk"],
  6. audio: [".mp3", ".wav"],
  7. video: [".mp4", ".flv"],
  8. document: [".doc", ".docx", ".ppt", ".pptx", ".pdf"],
  9. // ".class", ".dsc",
  10. documentClass: [".doc", ".docx", ".ppt", ".pptx", ".pdf"],
  11. zipFile: [".zip", ".rar"],
  12. getPreview() {
  13. return [...this.document, ...this.image, ...this.audio, ...this.video];
  14. },
  15. getAll() {
  16. return [
  17. ...this.image,
  18. ...this.video,
  19. ...this.document,
  20. ...this.audio,
  21. ...this.documentClass,
  22. ...this.zipFile
  23. ];
  24. },
  25. getClient() {
  26. return [...this.client];
  27. },
  28. getApp() {
  29. return [...this.app];
  30. },
  31. getImg() {
  32. return [...this.image];
  33. },
  34. getAudio() {
  35. return [...this.audio];
  36. },
  37. getVideo() {
  38. return [...this.video];
  39. },
  40. getDocument() {
  41. return [...this.document];
  42. },
  43. getDocumentClass() {
  44. return [...this.documentClass];
  45. },
  46. getZipFile() {
  47. return [...this.zipFile];
  48. }
  49. };
  50. //定义分片大小
  51. export const CHUNK_SIZE = {
  52. chunkSize: 5 * 1024 * 1024,
  53. getSize() {
  54. return this.chunkSize;
  55. }
  56. };
  57. export const CONFIG_SUFFIX = {
  58. image: ["png", "jpg", "jpeg"], // "gif", "bmp"
  59. audio: ["mp3", "wav"],
  60. app: ["apk"],
  61. video: ["mp4", "flv"],
  62. document: ["doc", "docx", "ppt", "pptx", "pdf"],
  63. documentClass: ["class", "dsc", "doc", "docx", "ppt", "pptx", "pdf"],
  64. zipFile: ["zip", "rar"],
  65. getApp() {
  66. return [...this.app];
  67. },
  68. getImg() {
  69. return [...this.image];
  70. },
  71. getAudio() {
  72. return [...this.audio];
  73. },
  74. getVideo() {
  75. return [...this.video];
  76. },
  77. getDocument() {
  78. return [...this.document];
  79. },
  80. getDocumentClass() {
  81. return [...this.documentClass];
  82. },
  83. getZipFile() {
  84. return [...this.zipFile];
  85. }
  86. };
  87. //教材上传封面格式
  88. export const MATERIAL_IMG_SUFFIX = {
  89. image: ["png", "jpg", "jpeg"],
  90. getImg() {
  91. return [...this.image];
  92. }
  93. };