@liuzengwei/element-ui 2.15.5-xn.50 → 2.15.5-xn.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/lib/affix.js +2 -2
  2. package/lib/alert.js +2 -2
  3. package/lib/area-loading.js +2 -2
  4. package/lib/area-picker.js +4 -4
  5. package/lib/aside.js +2 -2
  6. package/lib/autocomplete.js +2 -2
  7. package/lib/avatar.js +2 -2
  8. package/lib/backtop.js +2 -2
  9. package/lib/badge.js +2 -2
  10. package/lib/breadcrumb-item.js +2 -2
  11. package/lib/breadcrumb.js +2 -2
  12. package/lib/button-group.js +2 -2
  13. package/lib/button.js +2 -2
  14. package/lib/calendar.js +2 -2
  15. package/lib/card.js +2 -2
  16. package/lib/carousel-item.js +2 -2
  17. package/lib/carousel.js +2 -2
  18. package/lib/cascader-panel.js +4 -4
  19. package/lib/cascader.js +11 -11
  20. package/lib/checkbox-button.js +9 -9
  21. package/lib/checkbox-group.js +9 -9
  22. package/lib/checkbox.js +9 -9
  23. package/lib/col.js +2 -2
  24. package/lib/collapse-item.js +2 -2
  25. package/lib/collapse.js +2 -2
  26. package/lib/color-picker.js +9 -9
  27. package/lib/container.js +2 -2
  28. package/lib/date-picker.js +69 -91
  29. package/lib/descriptions-item.js +2 -2
  30. package/lib/descriptions.js +2 -2
  31. package/lib/dialog.js +2 -2
  32. package/lib/divider.js +2 -2
  33. package/lib/drawer.js +2 -2
  34. package/lib/dropdown-item.js +2 -2
  35. package/lib/dropdown-menu.js +2 -2
  36. package/lib/dropdown.js +2 -2
  37. package/lib/element-ui.common.js +723 -28
  38. package/lib/empty.js +2 -2
  39. package/lib/file-preview.js +905 -0
  40. package/lib/footer.js +2 -2
  41. package/lib/form-item.js +4 -4
  42. package/lib/form.js +2 -2
  43. package/lib/header.js +2 -2
  44. package/lib/icon.js +2 -2
  45. package/lib/image.js +2 -2
  46. package/lib/index.js +1 -1
  47. package/lib/infinite-scroll.js +2 -2
  48. package/lib/input-number.js +2 -2
  49. package/lib/input.js +2 -2
  50. package/lib/lazy-load.js +2 -2
  51. package/lib/link.js +2 -2
  52. package/lib/loading.js +2 -2
  53. package/lib/main.js +2 -2
  54. package/lib/menu-item-group.js +2 -2
  55. package/lib/menu-item.js +2 -2
  56. package/lib/menu.js +2 -2
  57. package/lib/message-box.js +4 -4
  58. package/lib/message.js +2 -2
  59. package/lib/notification.js +9 -9
  60. package/lib/option-group.js +9 -9
  61. package/lib/option.js +2 -2
  62. package/lib/page-header.js +2 -2
  63. package/lib/pagination.js +6 -6
  64. package/lib/popconfirm.js +4 -4
  65. package/lib/popover.js +2 -2
  66. package/lib/progress.js +2 -2
  67. package/lib/radio-button.js +9 -9
  68. package/lib/radio-group.js +9 -9
  69. package/lib/radio.js +2 -2
  70. package/lib/rate.js +2 -2
  71. package/lib/result.js +2 -2
  72. package/lib/row.js +2 -2
  73. package/lib/scrollbar.js +9 -9
  74. package/lib/segmented.js +2 -2
  75. package/lib/select.js +2 -2
  76. package/lib/selectable-tag-group.js +2 -2
  77. package/lib/selectable-tag.js +2 -2
  78. package/lib/skeleton-item.js +2 -2
  79. package/lib/skeleton.js +2 -2
  80. package/lib/slider.js +4 -4
  81. package/lib/spinner.js +2 -2
  82. package/lib/statistic.js +2 -2
  83. package/lib/step.js +2 -2
  84. package/lib/steps.js +2 -2
  85. package/lib/submenu.js +2 -2
  86. package/lib/switch.js +23 -23
  87. package/lib/tab-pane.js +2 -2
  88. package/lib/table-column.js +2 -2
  89. package/lib/table.js +14 -6
  90. package/lib/tabs.js +2 -2
  91. package/lib/tag.js +2 -2
  92. package/lib/text.js +2 -2
  93. package/lib/theme-chalk/base.css +1 -1
  94. package/lib/theme-chalk/file-preview.css +1 -0
  95. package/lib/theme-chalk/fonts/iconfont.ttf +0 -0
  96. package/lib/theme-chalk/fonts/iconfont.woff +0 -0
  97. package/lib/theme-chalk/icon.css +1 -1
  98. package/lib/theme-chalk/index.css +1 -1
  99. package/lib/time-picker.js +2 -2
  100. package/lib/time-select.js +2 -2
  101. package/lib/timeline-item.js +2 -2
  102. package/lib/timeline.js +2 -2
  103. package/lib/tooltip.js +2 -2
  104. package/lib/transfer.js +2 -2
  105. package/lib/tree.js +2 -2
  106. package/lib/trigger.js +11 -11
  107. package/lib/upload.js +2 -2
  108. package/package.json +1 -1
  109. package/packages/file-preview/index.js +8 -0
  110. package/packages/file-preview/src/icons/audio.svg +1 -0
  111. package/packages/file-preview/src/icons/excel.svg +1 -0
  112. package/packages/file-preview/src/icons/image.svg +1 -0
  113. package/packages/file-preview/src/icons/pdf.svg +1 -0
  114. package/packages/file-preview/src/icons/ppt.svg +1 -0
  115. package/packages/file-preview/src/icons/video.svg +1 -0
  116. package/packages/file-preview/src/icons/word.svg +1 -0
  117. package/packages/file-preview/src/icons/zip.svg +1 -0
  118. package/packages/file-preview/src/main.vue +330 -0
  119. package/packages/theme-chalk/lib/base.css +1 -1
  120. package/packages/theme-chalk/lib/file-preview.css +1 -0
  121. package/packages/theme-chalk/lib/fonts/iconfont.ttf +0 -0
  122. package/packages/theme-chalk/lib/fonts/iconfont.woff +0 -0
  123. package/packages/theme-chalk/lib/icon.css +1 -1
  124. package/packages/theme-chalk/lib/index.css +1 -1
  125. package/packages/theme-chalk/src/file-preview.scss +138 -0
  126. package/packages/theme-chalk/src/fonts/iconfont.ttf +0 -0
  127. package/packages/theme-chalk/src/fonts/iconfont.woff +0 -0
  128. package/packages/theme-chalk/src/icon.scss +36 -0
  129. package/packages/theme-chalk/src/index.scss +1 -0
  130. package/src/index.js +5 -2
  131. package/types/element-ui.d.ts +4 -0
  132. package/types/file-preview.d.ts +32 -0
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 79);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 87);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -2494,7 +2494,7 @@ module.exports = require("vue");
2494
2494
 
2495
2495
  /***/ }),
2496
2496
 
2497
- /***/ 79:
2497
+ /***/ 87:
2498
2498
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2499
2499
 
2500
2500
  "use strict";
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 78);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 86);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -1412,7 +1412,7 @@ module.exports = require("vue");
1412
1412
 
1413
1413
  /***/ }),
1414
1414
 
1415
- /***/ 78:
1415
+ /***/ 86:
1416
1416
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1417
1417
 
1418
1418
  "use strict";
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 124);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 132);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -189,7 +189,7 @@ function normalizeComponent (
189
189
 
190
190
  /***/ }),
191
191
 
192
- /***/ 124:
192
+ /***/ 132:
193
193
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
194
194
 
195
195
  "use strict";
package/lib/timeline.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 145);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 154);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -189,7 +189,7 @@ function normalizeComponent (
189
189
 
190
190
  /***/ }),
191
191
 
192
- /***/ 145:
192
+ /***/ 154:
193
193
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
194
194
 
195
195
  "use strict";
package/lib/tooltip.js CHANGED
@@ -82,12 +82,12 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 149);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 158);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
89
89
 
90
- /***/ 149:
90
+ /***/ 158:
91
91
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
92
92
 
93
93
  "use strict";
package/lib/transfer.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 68);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 76);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -238,7 +238,7 @@ module.exports = require("@liuzengwei/element-ui/lib/mixins/locale");
238
238
 
239
239
  /***/ }),
240
240
 
241
- /***/ 68:
241
+ /***/ 76:
242
242
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
243
243
 
244
244
  "use strict";
package/lib/tree.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 62);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 70);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -231,7 +231,7 @@ module.exports = require("@liuzengwei/element-ui/lib/mixins/emitter");
231
231
 
232
232
  /***/ }),
233
233
 
234
- /***/ 62:
234
+ /***/ 70:
235
235
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
236
236
 
237
237
  "use strict";
package/lib/trigger.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 138);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 146);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -189,7 +189,14 @@ function normalizeComponent (
189
189
 
190
190
  /***/ }),
191
191
 
192
- /***/ 138:
192
+ /***/ 14:
193
+ /***/ (function(module, exports) {
194
+
195
+ module.exports = require("@liuzengwei/element-ui/lib/utils/popup");
196
+
197
+ /***/ }),
198
+
199
+ /***/ 146:
193
200
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
194
201
 
195
202
  "use strict";
@@ -305,7 +312,7 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
305
312
 
306
313
 
307
314
 
308
- var PopperJS = external_vue_default.a.prototype.$isServer ? function () {} : __webpack_require__(56);
315
+ var PopperJS = external_vue_default.a.prototype.$isServer ? function () {} : __webpack_require__(64);
309
316
  var stop = function stop(e) {
310
317
  return e.stopPropagation();
311
318
  };
@@ -886,13 +893,6 @@ main.install = function (Vue) {
886
893
 
887
894
  /***/ }),
888
895
 
889
- /***/ 14:
890
- /***/ (function(module, exports) {
891
-
892
- module.exports = require("@liuzengwei/element-ui/lib/utils/popup");
893
-
894
- /***/ }),
895
-
896
896
  /***/ 2:
897
897
  /***/ (function(module, exports) {
898
898
 
@@ -907,7 +907,7 @@ module.exports = require("@liuzengwei/element-ui/lib/utils/vue-popper");
907
907
 
908
908
  /***/ }),
909
909
 
910
- /***/ 56:
910
+ /***/ 64:
911
911
  /***/ (function(module, exports) {
912
912
 
913
913
  module.exports = require("@liuzengwei/element-ui/lib/utils/popper");
package/lib/upload.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 61);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 69);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -217,7 +217,7 @@ module.exports = require("@liuzengwei/element-ui/lib/mixins/locale");
217
217
 
218
218
  /***/ }),
219
219
 
220
- /***/ 61:
220
+ /***/ 69:
221
221
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
222
222
 
223
223
  "use strict";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liuzengwei/element-ui",
3
- "version": "2.15.5-xn.50",
3
+ "version": "2.15.5-xn.51",
4
4
  "description": "A Component Library for Vue.js (Fork of Element UI).",
5
5
  "main": "lib/element-ui.common.js",
6
6
  "files": [
@@ -0,0 +1,8 @@
1
+ import FilePreview from './src/main';
2
+
3
+ /* istanbul ignore next */
4
+ FilePreview.install = function(Vue) {
5
+ Vue.component(FilePreview.name, FilePreview);
6
+ };
7
+
8
+ export default FilePreview;
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1766659914560" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2633" width="128" height="128" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M1024 228.992v518.432H0v-518.4A228.992 228.992 0 0 1 228.992 0h566.016A229.024 229.024 0 0 1 1024 228.992z" fill="#FFF8F7" p-id="2634"></path><path d="M419.008 480.512V242.688c0-10.112 8.384-18.272 18.72-18.272h205.824c10.368 0 18.72 8.16 18.72 18.24v219.52l-0.032 1.44 0.032 3.648v22.272c0 35.36-29.312 64-65.472 64h-18.72c-36.16 0-65.504-28.64-65.504-64 0-35.328 29.312-64 65.504-64h41.504c1.888 0 3.616 0.032 5.28 0.128v-91.52h-168.416v210.24c0 35.36-29.344 64-65.504 64h-18.72c-36.16 0-65.504-28.64-65.504-64 0-35.328 29.312-64 65.504-64h41.504c1.92 0 3.648 0.064 5.28 0.128zM1024 747.424v47.584A228.992 228.992 0 0 1 795.008 1024H228.992A228.992 228.992 0 0 1 0 795.008v-47.584h1024z" fill="#F04D58" p-id="2635"></path><path d="M320 802.688v137.088h20.928v-97.92h0.768l42.048 97.92h18.048l42.048-97.92h0.768v97.92h20.928v-137.088h-24.768l-47.616 109.824h-0.576l-47.808-109.824zM492.416 802.688v137.088h20.928V886.4h35.52c32.832 0 49.344-14.016 49.344-42.048 0-27.84-16.32-41.664-48.96-41.664h-56.832z m20.928 17.856h34.176c10.176 0 17.664 1.92 22.464 5.76 4.8 3.456 7.296 9.6 7.296 18.048 0 8.448-2.496 14.592-7.104 18.432-4.8 3.84-12.288 5.76-22.656 5.76h-34.176v-48zM663.104 800c-13.44 0-24.384 3.648-32.832 11.328-9.024 7.68-14.016 18.24-15.168 31.872h20.544c0.768-8.448 3.648-14.784 8.256-19.008 4.608-4.224 11.136-6.336 19.392-6.336 8.064 0 14.4 1.728 18.624 5.568 3.84 3.648 5.952 8.832 5.952 15.744 0 6.912-2.304 12.288-6.528 15.936-4.224 3.648-10.56 5.568-19.008 5.568h-9.792v15.744h9.984c9.024 0 15.936 1.92 20.544 5.76 4.992 3.84 7.488 9.792 7.488 17.856 0 6.912-2.496 12.48-7.104 17.088-5.376 4.992-12.48 7.68-21.312 7.68-8.064 0-14.592-2.304-19.584-6.912-5.76-4.992-8.64-12.096-9.024-21.312h-21.12c1.152 15.36 6.528 27.072 16.128 35.136 8.448 7.104 19.776 10.752 33.792 10.752 14.592 0 26.688-4.224 35.904-12.288 8.64-8.064 13.056-18.432 13.056-31.104a29.056 29.056 0 0 0-6.912-19.968 38.336 38.336 0 0 0-18.432-11.328c14.976-4.992 22.656-15.168 22.656-30.144 0-11.712-4.224-20.928-12.288-27.648-8.448-6.72-19.392-9.984-33.216-9.984z" fill="#FFFFFF" p-id="2636"></path></svg>
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1766659939017" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3402" width="128" height="128" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M1024 228.992v518.432H0v-518.4A228.992 228.992 0 0 1 228.992 0h566.016A229.024 229.024 0 0 1 1024 228.992z" fill="#E1FCE5" p-id="3403"></path><path d="M1024 747.424v47.584A228.992 228.992 0 0 1 795.008 1024H228.992A228.992 228.992 0 0 1 0 795.008v-47.584h1024z" fill="#44B058" p-id="3404"></path><path d="M259.2 799.84v147.776h109.728v-19.232H281.76v-47.008h78.656v-19.232H281.76v-43.072h83.648v-19.232zM383.2 840.608l37.056 50.08-41.824 56.96h25.888l28.16-40.8 27.936 40.768h25.664l-41.6-56.928 37.056-50.08h-25.664l-23.392 33.92-23.616-33.92zM547.136 837.696c-16.544 0-29.376 5.6-38.72 16.768-8.672 10.368-13.024 23.616-13.024 39.744 0 16.576 4.352 29.824 13.248 40.16 9.12 10.784 21.76 16.16 38.08 16.16 13.664 0 24.864-3.52 33.12-10.336 8.32-7.04 13.888-17.824 16.384-32.096h-21.76c-2.048 16.128-11.168 24.416-27.52 24.416-9.536 0-16.576-3.52-21.312-10.144-5.184-6.816-7.68-16.32-7.68-28.352 0-12 2.496-21.536 7.872-28.16 5.184-6.816 12.224-10.144 21.312-10.144 7.456 0 13.44 1.664 18.016 5.184 4.576 3.296 7.456 8.704 8.896 15.936h21.76c-2.08-13.248-7.456-23.168-15.744-29.824-8.288-6.208-19.264-9.28-32.928-9.28zM660.384 837.696c-15.744 0-28.352 5.408-37.472 16.352-9.536 10.784-14.08 24-14.08 39.968 0 17.6 4.96 31.456 14.912 41.824 9.12 9.728 21.76 14.688 37.44 14.688 14.304 0 26.112-4.16 35.424-12.224 7.456-6.624 12.224-15.104 14.72-25.024h-21.952c-2.912 6.208-6.016 10.944-9.728 13.856-4.8 3.52-10.976 5.376-18.656 5.376-8.672 0-15.52-2.88-20.48-8.288-4.96-5.568-7.68-13.664-8.48-24h81.152c-0.224-19.04-4.576-33.92-12.864-44.704-9.088-12-22.56-17.824-39.936-17.824z m0.64 18.016c17.376 0 27.104 9.312 29.152 27.968h-57.728c1.216-9.12 4.32-15.968 8.896-20.704 4.96-4.992 11.392-7.264 19.648-7.264zM734.272 796.928v150.72h21.952v-150.72z" fill="#FFFFFF" p-id="3405"></path><path d="M640.064 563.552h-51.136l-57.152-103.008a618.88 618.88 0 0 1-19.456-38.88c-8.64 11.68-19.2 24.096-31.68 37.216l-98.24 104.672H320l168.064-177.92-99.648-174.08h51.872l45.376 79.712c12.032 20.992 18.88 33.216 20.672 36.736 4.16 7.84 8.704 17.216 13.664 28.096 11.84-16 30.176-37.056 55.008-63.136l77.312-81.408h61.44l-170.24 181.76 96.544 170.24z" fill="#44B058" p-id="3406"></path></svg>
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1766659905208" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2172" width="128" height="128" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M136.896 0A137.024 137.024 0 0 0 0 136.896v750.208A137.024 137.024 0 0 0 136.896 1024h750.208A137.024 137.024 0 0 0 1024 887.104V136.896A137.024 137.024 0 0 0 887.104 0H136.896z" fill="#2CCE4A" p-id="2173"></path><path d="M819.2 505.6a64.32 64.32 0 0 0-76.8 0l-161.728 121.28-213.632-262.656-2.656-2.944a63.936 63.936 0 0 0-88.288-2.048L76.8 578.88V200.896C76.8 134.08 135.328 76.8 200.896 76.8h622.208c73.408 0 124.096 61.28 124.096 124.096V601.6l-128-96z" fill="#E1FCE5" p-id="2174"></path><path d="M748.8 211.2a64 64 0 1 0 0 128 64 64 0 0 0 0-128" fill="#2CCE4A" p-id="2175"></path></svg>
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1766659910242" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2402" width="128" height="128" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M1024 228.992v518.432H0v-518.4A228.992 228.992 0 0 1 228.992 0h566.016A229.024 229.024 0 0 1 1024 228.992z" fill="#FFF8F7" p-id="2403"></path><path d="M1024 747.424v47.584A228.992 228.992 0 0 1 795.008 1024H228.992A228.992 228.992 0 0 1 0 795.008v-47.584h1024z" fill="#F04D58" p-id="2404"></path><path d="M329.664 956.064v-132.8h50.08c8.832 0 15.584 0.416 20.224 1.28 6.496 1.088 11.968 3.136 16.384 6.208 4.416 3.04 7.968 7.328 10.656 12.8 2.688 5.504 4.032 11.52 4.032 18.112 0 11.296-3.616 20.864-10.784 28.672-7.2 7.84-20.16 11.744-38.944 11.744H347.2v53.984h-17.568z m17.6-69.664h34.304c11.36 0 19.424-2.112 24.192-6.336 4.768-4.224 7.168-10.176 7.168-17.856a24 24 0 0 0-4.224-14.272 19.616 19.616 0 0 0-11.104-7.808c-2.944-0.8-8.416-1.184-16.384-1.184H347.2V886.4z m113.568 69.664v-132.8h45.76c10.304 0 18.176 0.64 23.616 1.92 7.616 1.728 14.08 4.896 19.488 9.504 7.008 5.92 12.256 13.472 15.68 22.688 3.52 9.184 5.248 19.712 5.248 31.552 0 10.08-1.184 19.04-3.52 26.816a65.184 65.184 0 0 1-9.088 19.328c-3.68 5.12-7.68 9.12-12.096 12.064a49.056 49.056 0 0 1-15.84 6.656 90.24 90.24 0 0 1-21.344 2.24h-47.904z m17.568-15.68h28.352c8.768 0 15.616-0.8 20.608-2.432a29.6 29.6 0 0 0 11.904-6.88c4.16-4.16 7.424-9.792 9.76-16.8 2.304-7.04 3.488-15.584 3.488-25.6 0-13.888-2.304-24.576-6.848-32.032-4.544-7.456-10.112-12.48-16.64-14.976-4.704-1.824-12.256-2.72-22.72-2.72h-27.872v101.44h-0.032z m124.736 15.68v-132.8h89.6v15.68h-72v41.12h62.304v15.68h-62.336v60.32h-17.6z" fill="#FFFFFF" p-id="2405"></path><path d="M496 341.632a432.32 432.32 0 0 1-28.608 69.28c-5.632 10.944-11.84 21.344-14.144 30.016l3.136-1.184a526.176 526.176 0 0 1 94.464-26.816 97.92 97.92 0 0 1-11.584-9.248c-16.96-14.72-31.68-36.064-43.296-62.048z m183.296 109.952c-4.8 5.472-13.312 8.64-25.76 8.64-21.504 0-56.576-6.624-84.864-21.344-48.64 5.504-84.864 12.16-113.984 21.664-1.44 0.576-3.136 1.152-5.12 2.016-35.04 61.152-61.088 88.576-84 88.576a25.024 25.024 0 0 1-12.448-3.168l-13.568-8.96-0.864-1.44a26.688 26.688 0 0 1-1.408-15.584c3.104-15.264 19.2-39.52 53.184-61.184 5.376-4.032 13.856-8.64 25.152-14.112 8.512-15.04 17.536-32.64 27.2-51.968 14.4-29.728 23.456-59.168 30.528-84.544v-0.32c-10.464-34.88-16.704-55.936-6.24-94.336 2.56-10.976 11.904-22.24 22.368-22.24h6.784c6.528 0 12.736 2.304 17.28 6.944 18.656 19.04 9.888 65.504 0.544 103.872-0.576 1.76-0.864 3.2-1.12 4.064 11.296 32.576 27.424 58.88 45.248 73.856 7.36 5.76 15.584 11.52 24.64 16.768a321.28 321.28 0 0 1 36.48-2.048c35.072 0 56.288 6.368 64.48 19.904a23.616 23.616 0 0 1 3.392 15.904 28.256 28.256 0 0 1-7.904 19.04z m-11.616-20.48c-2.816-2.88-14.144-10.112-53.76-10.112-1.952 0-3.936 0-6.496 2.88 20.672 9.248 40.736 14.72 53.76 14.72 1.984 0 3.68-0.288 5.376-0.576h1.12c1.44-0.576 2.272-0.864 2.56-3.744-0.576-0.864-1.12-2.016-2.56-3.2z m-259.392 42.144a114.752 114.752 0 0 0-13.568 8.96c-20.096 18.72-32.832 37.76-34.24 48.736 12.736-4.32 29.44-23.36 47.808-57.696z m85.44-199.424l1.408-1.184c1.984-9.216 2.816-17.28 4.512-23.648l0.864-4.608c2.816-16.448 2.24-24.8-2.56-31.744L493.76 211.2a36.16 36.16 0 0 0-1.984 3.456c-4.8 12.128-4.544 33.184 1.984 59.168z" fill="#F04D58" p-id="2406"></path></svg>
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1766659920408" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2825" width="128" height="128" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M1024 228.992v518.432H0v-518.4A228.992 228.992 0 0 1 228.992 0h566.016A229.024 229.024 0 0 1 1024 228.992z" fill="#FFF8F7" p-id="2826"></path><path d="M413.184 192v384h58.624v-149.504h99.52c91.936 0 138.208-39.264 138.208-117.76C709.536 230.72 663.776 192 572.384 192h-159.2z m58.624 50.016h95.744c28.48 0 49.472 5.376 62.912 16.128 13.44 9.696 20.448 26.88 20.448 50.56 0 23.68-7.008 40.864-19.904 51.648-13.44 10.752-34.432 16.128-63.456 16.128h-95.744V242.016zM1024 747.424v47.584A228.992 228.992 0 0 1 795.008 1024H228.992A228.992 228.992 0 0 1 0 795.008v-47.584h1024z" fill="#E34221" p-id="2827"></path><path d="M352 800v137.088h20.928v-53.376h35.52c32.832 0 49.344-14.016 49.344-42.048 0-27.84-16.32-41.664-48.96-41.664H352z m20.928 17.856h34.176c10.176 0 17.664 1.92 22.464 5.76 4.8 3.456 7.296 9.6 7.296 18.048 0 8.448-2.496 14.592-7.104 18.432-4.8 3.84-12.288 5.76-22.656 5.76h-34.176v-48zM477.184 800v137.088h20.928v-53.376h35.52c32.832 0 49.344-14.016 49.344-42.048 0-27.84-16.32-41.664-48.96-41.664h-56.832z m20.928 17.856h34.176c10.176 0 17.664 1.92 22.464 5.76 4.8 3.456 7.296 9.6 7.296 18.048 0 8.448-2.496 14.592-7.104 18.432-4.8 3.84-12.288 5.76-22.656 5.76h-34.176v-48zM591.808 800v17.856h45.888v119.232h20.736v-119.232h45.696V800z" fill="#FFFFFF" p-id="2828"></path></svg>
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1766659928845" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3017" width="128" height="128" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M1024 228.992v518.432H0v-518.4A228.992 228.992 0 0 1 228.992 0h566.016A229.024 229.024 0 0 1 1024 228.992z" fill="#F5EDFF" p-id="3018"></path><path d="M464.64 259.264a9.44 9.44 0 0 0-10.656-2.56 9.6 9.6 0 0 0-5.984 9.28v268.032a9.6 9.6 0 0 0 5.984 9.28c3.712 1.536 8 0.512 10.656-2.56l204.64-134.272a9.664 9.664 0 0 0 0-13.44l-204.64-133.76zM1024 747.424v47.584A228.992 228.992 0 0 1 795.008 1024H228.992A228.992 228.992 0 0 1 0 795.008v-47.584h1024z" fill="#722ED1" p-id="3019"></path><path d="M256 802.688l49.152 137.088h25.344l49.152-137.088h-22.656l-38.784 113.664h-0.576l-38.976-113.664zM406.528 800.768a13.312 13.312 0 0 0-9.984 3.84 12.736 12.736 0 0 0-4.032 9.792c0 3.84 1.344 7.296 4.032 9.984a14.08 14.08 0 0 0 9.984 3.84 14.4 14.4 0 0 0 9.984-3.84 13.632 13.632 0 0 0 4.224-9.984 12.736 12.736 0 0 0-4.032-9.792 13.76 13.76 0 0 0-10.176-3.84z m-10.176 39.744v99.264h20.352v-99.264h-20.352zM515.584 800v55.296c-8.064-11.712-18.24-17.472-30.336-17.472-14.208 0-25.536 5.184-33.6 15.552-7.68 9.6-11.328 21.696-11.328 36.288 0 15.168 3.84 27.648 11.52 37.248 8.256 10.368 19.776 15.552 34.368 15.552 13.44 0 23.808-4.992 30.72-14.592v11.904h19.008V800h-20.352z m-25.728 54.336c7.488 0 13.632 2.88 18.624 9.024 4.992 6.528 7.68 15.168 7.68 25.92v1.728c0 9.984-2.112 18.048-6.336 24.384a24 24 0 0 1-20.544 10.56c-9.984 0-17.472-3.648-22.08-10.752-4.032-6.144-5.952-14.592-5.952-25.536s2.112-19.392 6.336-25.152c4.8-6.912 12.288-10.176 22.272-10.176zM601.024 837.824c-14.592 0-26.304 4.992-34.752 15.168-8.832 9.984-13.056 22.272-13.056 37.056 0 16.32 4.608 29.184 13.824 38.784 8.448 9.024 20.16 13.632 34.752 13.632 13.248 0 24.192-3.84 32.832-11.328a44.8 44.8 0 0 0 13.632-23.232h-20.352c-2.688 5.76-5.568 10.176-9.024 12.864a28.384 28.384 0 0 1-17.28 4.992c-8.064 0-14.4-2.688-19.008-7.68-4.608-5.184-7.104-12.672-7.872-22.272h75.264c-0.192-17.664-4.224-31.488-11.904-41.472-8.448-11.136-20.928-16.512-37.056-16.512z m0.576 16.704c16.128 0 25.152 8.64 27.072 25.92h-53.568c1.152-8.448 4.032-14.784 8.256-19.2 4.608-4.608 10.56-6.72 18.24-6.72zM712.96 837.824c-14.976 0-27.072 4.992-36.096 14.976-9.024 9.792-13.44 22.272-13.44 37.44 0 14.976 4.416 27.456 13.248 37.056 9.216 9.984 21.312 15.168 36.288 15.168 14.976 0 27.072-5.184 36.288-15.168 8.832-9.6 13.248-22.08 13.248-37.056 0-15.168-4.608-27.648-13.44-37.44-9.024-9.984-21.12-14.976-36.096-14.976z m0 16.704a25.6 25.6 0 0 1 22.08 11.136c4.608 6.336 6.912 14.592 6.912 24.576 0 9.792-2.304 17.856-6.912 24.384a26.016 26.016 0 0 1-22.08 11.136 25.44 25.44 0 0 1-21.888-11.136c-4.608-6.336-6.72-14.4-6.72-24.384s2.112-18.24 6.72-24.576a25.024 25.024 0 0 1 21.888-11.136z" fill="#FFFFFF" p-id="3020"></path></svg>
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1766659935032" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3209" width="128" height="128" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M1024 228.992v518.432H0v-518.4A228.992 228.992 0 0 1 228.992 0h566.016A229.024 229.024 0 0 1 1024 228.992z" fill="#EBF2FF" p-id="3210"></path><path d="M1024 747.424v47.584A228.992 228.992 0 0 1 795.008 1024H228.992A228.992 228.992 0 0 1 0 795.008v-47.584h1024z" fill="#327BFF" p-id="3211"></path><path d="M256 802.88l42.432 147.84h24.224l30.016-114.08h0.832l30.016 114.048h24l42.656-147.776h-25.472l-28.768 115.072h-0.832l-30.208-115.072h-23.616l-30.208 115.072h-0.832l-28.8-115.072zM512.896 840.768c-16.16 0-29.184 5.408-38.912 16.16-9.728 10.56-14.496 24-14.496 40.352 0 16.16 4.768 29.6 14.272 39.968 9.92 10.752 22.976 16.352 39.136 16.352 16.16 0 29.184-5.6 39.136-16.352 9.504-10.368 14.272-23.808 14.272-39.968 0-16.32-4.96-29.792-14.496-40.352-9.728-10.752-22.752-16.16-38.912-16.16z m0 18.016c10.144 0 18.016 3.936 23.808 12 4.96 6.848 7.456 15.744 7.456 26.496 0 10.56-2.496 19.264-7.456 26.304a28.064 28.064 0 0 1-23.808 12 27.456 27.456 0 0 1-23.584-12c-4.992-6.816-7.264-15.52-7.264-26.304 0-10.752 2.272-19.648 7.264-26.496a26.976 26.976 0 0 1 23.584-12zM636.896 840.768a26.144 26.144 0 0 0-17.376 6.016 31.904 31.904 0 0 0-10.368 13.056v-16.16h-21.952v107.008h21.952v-56.704c0-9.312 2.688-16.96 8.288-22.784a24.16 24.16 0 0 1 17.792-8.064c4.96 0 10.144 0.64 15.52 2.272v-21.952a31.296 31.296 0 0 0-13.856-2.688zM741.216 800v59.616c-8.672-12.64-19.648-18.848-32.704-18.848-15.296 0-27.52 5.6-36.224 16.768-8.288 10.368-12.224 23.392-12.224 39.136 0 16.352 4.16 29.824 12.448 40.16 8.896 11.2 21.312 16.768 37.056 16.768 14.464 0 25.664-5.376 33.12-15.744v12.832h20.48V800h-21.952z m-27.744 58.56c8.096 0 14.72 3.136 20.096 9.76 5.376 7.04 8.288 16.32 8.288 27.936v1.856c0 10.784-2.272 19.456-6.848 26.304a25.856 25.856 0 0 1-22.144 11.392c-10.752 0-18.848-3.936-23.808-11.616-4.352-6.624-6.4-15.712-6.4-27.52s2.24-20.896 6.816-27.104c5.184-7.456 13.248-10.976 24-10.976z" fill="#FFFFFF" p-id="3212"></path><path d="M658.144 542.336c16.96 18.56 47.84 6.56 47.84-18.56V231.328h-55.04v221.504l-109.376-119.808a27.52 27.52 0 0 0-40.64 0l-109.376 119.808V231.36h-55.04v292.448c0 25.12 30.912 37.12 47.84 18.56l136.896-149.952 136.896 149.952z" fill="#327BFF" p-id="3213"></path></svg>
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1766659894050" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1981" width="128" height="128" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M435.424 649.088h147.36v72h-147.36z" fill="#FFA439" p-id="1982"></path><path d="M995.904 28.096A95.936 95.936 0 0 0 928.032 0h-308.544v73.088h-109.76v70.88h109.76v73.088h-109.76v70.88h109.76v73.088h-109.76v70.88h109.76v325.12c0 9.728-3.808 18.24-11.392 25.312-7.616 7.104-16 10.72-25.12 10.72h-147.552a33.12 33.12 0 0 1-25.12-10.72 35.2 35.2 0 0 1-10.272-25.28v-251.968h109.664V432h-109.664v-70.88h109.664V288.032h-109.664V217.152h109.664V144h-109.664V73.088h109.664V0H96A96 96 0 0 0 0 96v832a95.936 95.936 0 0 0 96 96h832a95.936 95.936 0 0 0 96-96V96c0-25.408-10.112-49.92-28.096-67.904z" fill="#F6B824" p-id="1983"></path></svg>
@@ -0,0 +1,330 @@
1
+ <template>
2
+ <div class="el-file-preview">
3
+ <div class="el-file-preview__list">
4
+ <template v-for="(item, index) in fileList">
5
+ <!-- 图片预览 -->
6
+ <div
7
+ v-if="isImage(item)"
8
+ :key="`image-${index}`"
9
+ class="el-file-preview__item el-file-preview__item--image"
10
+ >
11
+ <el-image
12
+ :src="getFileUrl(item)"
13
+ :preview-src-list="previewEnabled ? imageList : []"
14
+ fit="cover"
15
+ class="el-file-preview__image"
16
+ >
17
+ <div slot="error" class="el-file-preview__error">
18
+ <i class="el-icon-picture-outline"></i>
19
+ </div>
20
+ </el-image>
21
+ </div>
22
+
23
+ <!-- 视频预览 -->
24
+ <div
25
+ v-else-if="isVideo(item)"
26
+ :key="`video-${index}`"
27
+ class="el-file-preview__item el-file-preview__item--video"
28
+ @click="handlePlayVideo(item)"
29
+ >
30
+ <el-image
31
+ :src="getVideoSnapshot(item)"
32
+ fit="cover"
33
+ class="el-file-preview__image"
34
+ >
35
+ <div slot="error" class="el-file-preview__error">
36
+ <i class="el-icon-video-camera"></i>
37
+ </div>
38
+ </el-image>
39
+ <div class="el-file-preview__play-icon">
40
+ <i class="el-icon-video-play"></i>
41
+ </div>
42
+ </div>
43
+
44
+ <!-- 音频文件 -->
45
+ <div
46
+ v-else-if="isAudio(item)"
47
+ :key="`audio-${index}`"
48
+ class="el-file-preview__item el-file-preview__item--file"
49
+ @click="handleDownload(item)"
50
+ >
51
+ <img :src="audioIcon" class="el-file-preview__icon" />
52
+ <p class="el-file-preview__name" :title="getFileName(item)">
53
+ <span class="el-file-preview__name-main">{{ getFileBaseName(item) }}</span>
54
+ <span class="el-file-preview__name-ext">{{ getFileExt(item) }}</span>
55
+ </p>
56
+ </div>
57
+
58
+ <!-- 其他文件 -->
59
+ <div
60
+ v-else
61
+ :key="`file-${index}`"
62
+ class="el-file-preview__item el-file-preview__item--file"
63
+ @click="handleDownload(item)"
64
+ >
65
+ <img :src="getFileIcon(item)" class="el-file-preview__icon" />
66
+ <p class="el-file-preview__name" :title="getFileName(item)">
67
+ <span class="el-file-preview__name-main">{{ getFileBaseName(item) }}</span>
68
+ <span class="el-file-preview__name-ext">{{ getFileExt(item) }}</span>
69
+ </p>
70
+ </div>
71
+ </template>
72
+ </div>
73
+
74
+ <!-- 视频播放对话框 -->
75
+ <el-dialog
76
+ :title="videoDialogTitle"
77
+ :visible.sync="videoDialogVisible"
78
+ width="640px"
79
+ :before-close="handleCloseVideo"
80
+ append-to-body
81
+ >
82
+ <div class="el-file-preview__video-wrapper">
83
+ <video
84
+ ref="videoPlayer"
85
+ class="el-file-preview__video"
86
+ controls
87
+ :src="currentVideoUrl"
88
+ ></video>
89
+ </div>
90
+ <div slot="footer">
91
+ <el-button @click="handleCloseVideo">关 闭</el-button>
92
+ </div>
93
+ </el-dialog>
94
+ </div>
95
+ </template>
96
+
97
+ <script>
98
+ import wordIcon from './icons/word.svg';
99
+ import excelIcon from './icons/excel.svg';
100
+ import pptIcon from './icons/ppt.svg';
101
+ import pdfIcon from './icons/pdf.svg';
102
+ import zipIcon from './icons/zip.svg';
103
+ import audioIcon from './icons/audio.svg';
104
+ import videoIcon from './icons/video.svg';
105
+ import imageIcon from './icons/image.svg';
106
+
107
+ export default {
108
+ name: 'ElFilePreview',
109
+
110
+ componentName: 'ElFilePreview',
111
+
112
+ props: {
113
+ // 文件列表
114
+ fileList: {
115
+ type: Array,
116
+ default() {
117
+ return [];
118
+ }
119
+ },
120
+ // URL 字段名
121
+ urlKey: {
122
+ type: String,
123
+ default: 'url'
124
+ },
125
+ // 文件名字段名
126
+ nameKey: {
127
+ type: String,
128
+ default: 'name'
129
+ },
130
+ // 是否启用图片预览
131
+ previewEnabled: {
132
+ type: Boolean,
133
+ default: true
134
+ },
135
+ // 视频快照处理函数(用于生成视频封面)
136
+ videoSnapshotHandler: {
137
+ type: Function,
138
+ default: null
139
+ },
140
+ // 视频对话框标题
141
+ videoDialogTitle: {
142
+ type: String,
143
+ default: '视频预览'
144
+ }
145
+ },
146
+
147
+ data() {
148
+ return {
149
+ videoDialogVisible: false,
150
+ currentVideoUrl: '',
151
+ audioIcon
152
+ };
153
+ },
154
+
155
+ computed: {
156
+ // 获取所有图片 URL 列表(用于预览)
157
+ imageList() {
158
+ return this.fileList
159
+ .filter(item => this.isImage(item))
160
+ .map(item => this.getFileUrl(item));
161
+ }
162
+ },
163
+
164
+ watch: {
165
+ videoDialogVisible(val) {
166
+ if (!val) {
167
+ this.pauseVideo();
168
+ }
169
+ }
170
+ },
171
+
172
+ methods: {
173
+ // 获取文件 URL
174
+ getFileUrl(file) {
175
+ if (typeof file === 'string') {
176
+ return file;
177
+ }
178
+ return file[this.urlKey] || '';
179
+ },
180
+
181
+ // 获取文件名
182
+ getFileName(file) {
183
+ if (typeof file === 'string') {
184
+ return file.split('/').pop();
185
+ }
186
+ return file[this.nameKey] || '';
187
+ },
188
+
189
+ // 判断是否为图片
190
+ isImage(file) {
191
+ const url = this.getFileUrl(file);
192
+ const imageExts = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg'];
193
+ const ext = this.getExtFromUrl(url);
194
+ return imageExts.includes(ext);
195
+ },
196
+
197
+ // 判断是否为视频
198
+ isVideo(file) {
199
+ const url = this.getFileUrl(file);
200
+ const videoExts = ['mp4', 'avi', 'mkv', 'mov', 'wmv', 'flv', 'webm'];
201
+ const ext = this.getExtFromUrl(url);
202
+ return videoExts.includes(ext);
203
+ },
204
+
205
+ // 判断是否为音频
206
+ isAudio(file) {
207
+ const url = this.getFileUrl(file);
208
+ const audioExts = ['mp3', 'wav', 'flac', 'aac', 'm4a', 'ogg'];
209
+ const ext = this.getExtFromUrl(url);
210
+ return audioExts.includes(ext);
211
+ },
212
+
213
+ // 从 URL 获取扩展名
214
+ getExtFromUrl(url) {
215
+ if (!url) return '';
216
+ const fileName = url.split('?')[0].split('#')[0];
217
+ const ext = fileName.toLowerCase().split('.').pop();
218
+ return ext;
219
+ },
220
+
221
+ // 获取文件扩展名(带点)
222
+ getFileExt(file) {
223
+ const fileName = this.getFileName(file);
224
+ if (!fileName) return '';
225
+ const lastDotIndex = fileName.lastIndexOf('.');
226
+ if (lastDotIndex === -1) return '';
227
+ return fileName.substring(lastDotIndex);
228
+ },
229
+
230
+ // 获取文件基础名(不带扩展名)
231
+ getFileBaseName(file) {
232
+ const fileName = this.getFileName(file);
233
+ if (!fileName) return '';
234
+ const lastDotIndex = fileName.lastIndexOf('.');
235
+ if (lastDotIndex === -1) return fileName;
236
+ return fileName.substring(0, lastDotIndex);
237
+ },
238
+
239
+ // 获取文件图标
240
+ getFileIcon(file) {
241
+ const ext = this.getExtFromUrl(this.getFileUrl(file));
242
+
243
+ // Word 文档
244
+ if (['doc', 'docx'].includes(ext)) {
245
+ return wordIcon;
246
+ }
247
+ // Excel 表格
248
+ if (['xls', 'xlsx', 'csv'].includes(ext)) {
249
+ return excelIcon;
250
+ }
251
+ // PPT 演示文稿
252
+ if (['ppt', 'pptx'].includes(ext)) {
253
+ return pptIcon;
254
+ }
255
+ // PDF
256
+ if (ext === 'pdf') {
257
+ return pdfIcon;
258
+ }
259
+ // 压缩文件
260
+ if (['zip', 'rar', '7z', 'tar', 'gz'].includes(ext)) {
261
+ return zipIcon;
262
+ }
263
+ // 音频文件
264
+ if (['mp3', 'wav', 'flac', 'aac', 'm4a', 'ogg'].includes(ext)) {
265
+ return audioIcon;
266
+ }
267
+ // 视频文件
268
+ if (['mp4', 'avi', 'mkv', 'mov', 'wmv', 'flv', 'webm'].includes(ext)) {
269
+ return videoIcon;
270
+ }
271
+ // 图片文件
272
+ if (['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg'].includes(ext)) {
273
+ return imageIcon;
274
+ }
275
+
276
+ // 默认图标
277
+ return zipIcon;
278
+ },
279
+
280
+ // 获取视频快照
281
+ getVideoSnapshot(file) {
282
+ const url = this.getFileUrl(file);
283
+ if (this.videoSnapshotHandler) {
284
+ return this.videoSnapshotHandler(url);
285
+ }
286
+ // 默认使用 OSS 视频截帧(适用于阿里云 OSS)
287
+ return `${url}?x-oss-process=video/snapshot,t_0,f_jpg,w_0,h_0,m_fast,ar_auto`;
288
+ },
289
+
290
+ // 播放视频
291
+ handlePlayVideo(file) {
292
+ this.currentVideoUrl = this.getFileUrl(file);
293
+ this.videoDialogVisible = true;
294
+ this.$emit('video-play', file);
295
+ },
296
+
297
+ // 关闭视频
298
+ handleCloseVideo() {
299
+ this.videoDialogVisible = false;
300
+ this.$emit('video-close');
301
+ },
302
+
303
+ // 暂停视频
304
+ pauseVideo() {
305
+ if (this.$refs.videoPlayer) {
306
+ this.$refs.videoPlayer.pause();
307
+ }
308
+ },
309
+
310
+ // 下载文件
311
+ handleDownload(file) {
312
+ const url = this.getFileUrl(file);
313
+ const fileName = this.getFileName(file);
314
+
315
+ // 触发下载事件
316
+ this.$emit('download', file);
317
+
318
+ // 执行下载
319
+ const link = document.createElement('a');
320
+ link.href = url;
321
+ link.download = fileName;
322
+ link.style.display = 'none';
323
+ link.target = '_blank';
324
+ document.body.appendChild(link);
325
+ link.click();
326
+ document.body.removeChild(link);
327
+ }
328
+ }
329
+ };
330
+ </script>