xt-element-ui 2.1.72 → 2.2.1

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 (194) hide show
  1. package/lib/index.common.js +267 -61
  2. package/lib/index.css +1 -1
  3. package/lib/index.umd.js +267 -61
  4. package/lib/index.umd.min.js +1 -1
  5. package/lib/xt-badge/demo.html +10 -0
  6. package/lib/xt-badge/index.js +1 -0
  7. package/lib/xt-badge/xt-badge.common.js +335 -0
  8. package/lib/xt-badge/xt-badge.css +1 -0
  9. package/lib/xt-badge/xt-badge.umd.js +345 -0
  10. package/lib/xt-badge/xt-badge.umd.min.js +1 -0
  11. package/lib/xt-button/demo.html +10 -0
  12. package/lib/xt-button/index.js +1 -0
  13. package/lib/xt-button/xt-button.common.js +331 -0
  14. package/lib/xt-button/xt-button.css +1 -0
  15. package/lib/xt-button/xt-button.umd.js +341 -0
  16. package/lib/xt-button/xt-button.umd.min.js +1 -0
  17. package/lib/xt-card/demo.html +10 -0
  18. package/lib/xt-card/index.js +1 -0
  19. package/lib/xt-card/xt-card.common.js +325 -0
  20. package/lib/xt-card/xt-card.css +1 -0
  21. package/lib/xt-card/xt-card.umd.js +335 -0
  22. package/lib/xt-card/xt-card.umd.min.js +1 -0
  23. package/lib/xt-card-item/demo.html +10 -0
  24. package/lib/xt-card-item/index.js +1 -0
  25. package/lib/xt-card-item/xt-card-item.common.js +291 -0
  26. package/lib/xt-card-item/xt-card-item.css +1 -0
  27. package/lib/xt-card-item/xt-card-item.umd.js +301 -0
  28. package/lib/xt-card-item/xt-card-item.umd.min.js +1 -0
  29. package/lib/xt-chart/demo.html +10 -0
  30. package/lib/xt-chart/index.js +1 -0
  31. package/lib/xt-chart/xt-chart.common.js +109203 -0
  32. package/lib/xt-chart/xt-chart.css +1 -0
  33. package/lib/xt-chart/xt-chart.umd.js +109213 -0
  34. package/lib/xt-chart/xt-chart.umd.min.js +1 -0
  35. package/lib/xt-config-provider/demo.html +10 -0
  36. package/lib/xt-config-provider/index.js +1 -0
  37. package/lib/xt-config-provider/xt-config-provider.common.js +108388 -0
  38. package/lib/xt-config-provider/xt-config-provider.css +1 -0
  39. package/lib/xt-config-provider/xt-config-provider.umd.js +108398 -0
  40. package/lib/xt-config-provider/xt-config-provider.umd.min.js +1 -0
  41. package/lib/xt-date-picker/demo.html +10 -0
  42. package/lib/xt-date-picker/index.js +1 -0
  43. package/lib/xt-date-picker/xt-date-picker.common.js +768 -0
  44. package/lib/xt-date-picker/xt-date-picker.css +1 -0
  45. package/lib/xt-date-picker/xt-date-picker.umd.js +778 -0
  46. package/lib/xt-date-picker/xt-date-picker.umd.min.js +1 -0
  47. package/lib/xt-flex-box/demo.html +10 -0
  48. package/lib/xt-flex-box/index.js +1 -0
  49. package/lib/xt-flex-box/xt-flex-box.common.js +303 -0
  50. package/lib/xt-flex-box/xt-flex-box.css +1 -0
  51. package/lib/xt-flex-box/xt-flex-box.umd.js +313 -0
  52. package/lib/xt-flex-box/xt-flex-box.umd.min.js +1 -0
  53. package/lib/xt-form-schema/demo.html +10 -0
  54. package/lib/xt-form-schema/index.js +1 -0
  55. package/lib/xt-form-schema/xt-form-schema.common.js +510 -0
  56. package/lib/xt-form-schema/xt-form-schema.css +1 -0
  57. package/lib/xt-form-schema/xt-form-schema.umd.js +520 -0
  58. package/lib/xt-form-schema/xt-form-schema.umd.min.js +1 -0
  59. package/lib/xt-grid-box/demo.html +10 -0
  60. package/lib/xt-grid-box/index.js +1 -0
  61. package/lib/xt-grid-box/xt-grid-box.common.js +404 -0
  62. package/lib/xt-grid-box/xt-grid-box.css +1 -0
  63. package/lib/xt-grid-box/xt-grid-box.umd.js +414 -0
  64. package/lib/xt-grid-box/xt-grid-box.umd.min.js +1 -0
  65. package/lib/xt-grid-item/demo.html +10 -0
  66. package/lib/xt-grid-item/index.js +1 -0
  67. package/lib/xt-grid-item/xt-grid-item.common.js +381 -0
  68. package/lib/xt-grid-item/xt-grid-item.css +1 -0
  69. package/lib/xt-grid-item/xt-grid-item.umd.js +391 -0
  70. package/lib/xt-grid-item/xt-grid-item.umd.min.js +1 -0
  71. package/lib/xt-icon/demo.html +10 -0
  72. package/lib/xt-icon/index.js +1 -0
  73. package/lib/xt-icon/xt-icon.common.js +430 -0
  74. package/lib/xt-icon/xt-icon.css +1 -0
  75. package/lib/xt-icon/xt-icon.umd.js +440 -0
  76. package/lib/xt-icon/xt-icon.umd.min.js +1 -0
  77. package/lib/xt-input/demo.html +10 -0
  78. package/lib/xt-input/index.js +1 -0
  79. package/lib/xt-input/xt-input.common.js +584 -0
  80. package/lib/xt-input/xt-input.css +1 -0
  81. package/lib/xt-input/xt-input.umd.js +594 -0
  82. package/lib/xt-input/xt-input.umd.min.js +1 -0
  83. package/lib/xt-list/demo.html +10 -0
  84. package/lib/xt-list/index.js +1 -0
  85. package/lib/xt-list/xt-list.common.js +714 -0
  86. package/lib/xt-list/xt-list.css +1 -0
  87. package/lib/xt-list/xt-list.umd.js +724 -0
  88. package/lib/xt-list/xt-list.umd.min.js +1 -0
  89. package/lib/xt-map/demo.html +10 -0
  90. package/lib/xt-map/index.js +1 -0
  91. package/lib/xt-map/xt-map.common.js +1951 -0
  92. package/lib/xt-map/xt-map.css +1 -0
  93. package/lib/xt-map/xt-map.umd.js +1961 -0
  94. package/lib/xt-map/xt-map.umd.min.js +1 -0
  95. package/lib/xt-map-provider/demo.html +10 -0
  96. package/lib/xt-map-provider/index.js +1 -0
  97. package/lib/xt-map-provider/xt-map-provider.common.js +644 -0
  98. package/lib/xt-map-provider/xt-map-provider.css +1 -0
  99. package/lib/xt-map-provider/xt-map-provider.umd.js +654 -0
  100. package/lib/xt-map-provider/xt-map-provider.umd.min.js +1 -0
  101. package/lib/xt-page/demo.html +10 -0
  102. package/lib/xt-page/index.js +1 -0
  103. package/lib/xt-page/xt-page.common.js +353 -0
  104. package/lib/xt-page/xt-page.css +1 -0
  105. package/lib/xt-page/xt-page.umd.js +363 -0
  106. package/lib/xt-page/xt-page.umd.min.js +1 -0
  107. package/lib/xt-progress/demo.html +10 -0
  108. package/lib/xt-progress/index.js +1 -0
  109. package/lib/xt-progress/xt-progress.common.js +327 -0
  110. package/lib/xt-progress/xt-progress.css +1 -0
  111. package/lib/xt-progress/xt-progress.umd.js +337 -0
  112. package/lib/xt-progress/xt-progress.umd.min.js +1 -0
  113. package/lib/xt-scroll-arrow/demo.html +10 -0
  114. package/lib/xt-scroll-arrow/index.js +1 -0
  115. package/lib/xt-scroll-arrow/xt-scroll-arrow.common.js +495 -0
  116. package/lib/xt-scroll-arrow/xt-scroll-arrow.css +1 -0
  117. package/lib/xt-scroll-arrow/xt-scroll-arrow.umd.js +505 -0
  118. package/lib/xt-scroll-arrow/xt-scroll-arrow.umd.min.js +1 -0
  119. package/lib/xt-select-tree/demo.html +10 -0
  120. package/lib/xt-select-tree/index.js +1 -0
  121. package/lib/xt-select-tree/xt-select-tree.common.js +1791 -0
  122. package/lib/xt-select-tree/xt-select-tree.css +1 -0
  123. package/lib/xt-select-tree/xt-select-tree.umd.js +1801 -0
  124. package/lib/xt-select-tree/xt-select-tree.umd.min.js +1 -0
  125. package/lib/xt-step-price/demo.html +10 -0
  126. package/lib/xt-step-price/index.js +1 -0
  127. package/lib/xt-step-price/xt-step-price.common.js +800 -0
  128. package/lib/xt-step-price/xt-step-price.css +1 -0
  129. package/lib/xt-step-price/xt-step-price.umd.js +810 -0
  130. package/lib/xt-step-price/xt-step-price.umd.min.js +1 -0
  131. package/lib/xt-step-price-item/demo.html +10 -0
  132. package/lib/xt-step-price-item/index.js +1 -0
  133. package/lib/xt-step-price-item/xt-step-price-item.common.js +417 -0
  134. package/lib/xt-step-price-item/xt-step-price-item.umd.js +427 -0
  135. package/lib/xt-step-price-item/xt-step-price-item.umd.min.js +1 -0
  136. package/lib/xt-tab-pane/demo.html +10 -0
  137. package/lib/xt-tab-pane/index.js +1 -0
  138. package/lib/xt-tab-pane/xt-tab-pane.common.js +309 -0
  139. package/lib/xt-tab-pane/xt-tab-pane.umd.js +319 -0
  140. package/lib/xt-tab-pane/xt-tab-pane.umd.min.js +1 -0
  141. package/lib/xt-table/demo.html +10 -0
  142. package/lib/xt-table/index.js +1 -0
  143. package/lib/xt-table/xt-table.common.js +1027 -0
  144. package/lib/xt-table/xt-table.css +1 -0
  145. package/lib/xt-table/xt-table.umd.js +1037 -0
  146. package/lib/xt-table/xt-table.umd.min.js +1 -0
  147. package/lib/xt-tabs/demo.html +10 -0
  148. package/lib/xt-tabs/index.js +1 -0
  149. package/lib/xt-tabs/xt-tabs.common.js +463 -0
  150. package/lib/xt-tabs/xt-tabs.css +1 -0
  151. package/lib/xt-tabs/xt-tabs.umd.js +473 -0
  152. package/lib/xt-tabs/xt-tabs.umd.min.js +1 -0
  153. package/lib/xt-text/demo.html +10 -0
  154. package/lib/xt-text/index.js +1 -0
  155. package/lib/xt-text/xt-text.common.js +536 -0
  156. package/lib/xt-text/xt-text.css +1 -0
  157. package/lib/xt-text/xt-text.umd.js +546 -0
  158. package/lib/xt-text/xt-text.umd.min.js +1 -0
  159. package/lib/xt-time/demo.html +10 -0
  160. package/lib/xt-time/index.js +1 -0
  161. package/lib/xt-time/xt-time.common.js +555 -0
  162. package/lib/xt-time/xt-time.css +1 -0
  163. package/lib/xt-time/xt-time.umd.js +565 -0
  164. package/lib/xt-time/xt-time.umd.min.js +1 -0
  165. package/lib/xt-transfer-tree/demo.html +10 -0
  166. package/lib/xt-transfer-tree/index.js +1 -0
  167. package/lib/xt-transfer-tree/xt-transfer-tree.common.js +594 -0
  168. package/lib/xt-transfer-tree/xt-transfer-tree.css +1 -0
  169. package/lib/xt-transfer-tree/xt-transfer-tree.umd.js +604 -0
  170. package/lib/xt-transfer-tree/xt-transfer-tree.umd.min.js +1 -0
  171. package/lib/xt-upload/demo.html +10 -0
  172. package/lib/xt-upload/index.js +1 -0
  173. package/lib/xt-upload/xt-upload.common.js +1292 -0
  174. package/lib/xt-upload/xt-upload.css +1 -0
  175. package/lib/xt-upload/xt-upload.umd.js +1302 -0
  176. package/lib/xt-upload/xt-upload.umd.min.js +1 -0
  177. package/package.json +4 -2
  178. package/src/components/xt-badge/index.js +8 -7
  179. package/src/components/xt-button/index.js +1 -0
  180. package/src/components/xt-card/index.js +1 -0
  181. package/src/components/xt-card-item/index.js +1 -0
  182. package/src/components/xt-config-provider/index.js +1 -0
  183. package/src/components/xt-flex-box/index.js +1 -0
  184. package/src/components/xt-grid-box/index.js +1 -0
  185. package/src/components/xt-icon/index.js +1 -0
  186. package/src/components/xt-input/index.js +1 -0
  187. package/src/components/xt-map/index.js +1 -0
  188. package/src/components/xt-progress/index.js +8 -7
  189. package/src/components/xt-scroll-arrow/index.js +8 -7
  190. package/src/components/xt-step-price/index.js +1 -0
  191. package/src/components/xt-tabs/index.js +9 -8
  192. package/src/components/xt-text/index.js +1 -0
  193. package/src/components/xt-time/index.js +1 -0
  194. package/src/index.js +32 -2
@@ -0,0 +1,1027 @@
1
+ module.exports =
2
+ /******/ (function(modules) { // webpackBootstrap
3
+ /******/ // The module cache
4
+ /******/ var installedModules = {};
5
+ /******/
6
+ /******/ // The require function
7
+ /******/ function __webpack_require__(moduleId) {
8
+ /******/
9
+ /******/ // Check if module is in cache
10
+ /******/ if(installedModules[moduleId]) {
11
+ /******/ return installedModules[moduleId].exports;
12
+ /******/ }
13
+ /******/ // Create a new module (and put it into the cache)
14
+ /******/ var module = installedModules[moduleId] = {
15
+ /******/ i: moduleId,
16
+ /******/ l: false,
17
+ /******/ exports: {}
18
+ /******/ };
19
+ /******/
20
+ /******/ // Execute the module function
21
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
+ /******/
23
+ /******/ // Flag the module as loaded
24
+ /******/ module.l = true;
25
+ /******/
26
+ /******/ // Return the exports of the module
27
+ /******/ return module.exports;
28
+ /******/ }
29
+ /******/
30
+ /******/
31
+ /******/ // expose the modules object (__webpack_modules__)
32
+ /******/ __webpack_require__.m = modules;
33
+ /******/
34
+ /******/ // expose the module cache
35
+ /******/ __webpack_require__.c = installedModules;
36
+ /******/
37
+ /******/ // define getter function for harmony exports
38
+ /******/ __webpack_require__.d = function(exports, name, getter) {
39
+ /******/ if(!__webpack_require__.o(exports, name)) {
40
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
41
+ /******/ }
42
+ /******/ };
43
+ /******/
44
+ /******/ // define __esModule on exports
45
+ /******/ __webpack_require__.r = function(exports) {
46
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48
+ /******/ }
49
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
50
+ /******/ };
51
+ /******/
52
+ /******/ // create a fake namespace object
53
+ /******/ // mode & 1: value is a module id, require it
54
+ /******/ // mode & 2: merge all properties of value into the ns
55
+ /******/ // mode & 4: return value when already ns object
56
+ /******/ // mode & 8|1: behave like require
57
+ /******/ __webpack_require__.t = function(value, mode) {
58
+ /******/ if(mode & 1) value = __webpack_require__(value);
59
+ /******/ if(mode & 8) return value;
60
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
61
+ /******/ var ns = Object.create(null);
62
+ /******/ __webpack_require__.r(ns);
63
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
64
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
65
+ /******/ return ns;
66
+ /******/ };
67
+ /******/
68
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
69
+ /******/ __webpack_require__.n = function(module) {
70
+ /******/ var getter = module && module.__esModule ?
71
+ /******/ function getDefault() { return module['default']; } :
72
+ /******/ function getModuleExports() { return module; };
73
+ /******/ __webpack_require__.d(getter, 'a', getter);
74
+ /******/ return getter;
75
+ /******/ };
76
+ /******/
77
+ /******/ // Object.prototype.hasOwnProperty.call
78
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
79
+ /******/
80
+ /******/ // __webpack_public_path__
81
+ /******/ __webpack_require__.p = "";
82
+ /******/
83
+ /******/
84
+ /******/ // Load entry module and return exports
85
+ /******/ return __webpack_require__(__webpack_require__.s = "fb15");
86
+ /******/ })
87
+ /************************************************************************/
88
+ /******/ ({
89
+
90
+ /***/ "0ba2":
91
+ /***/ (function(module, exports, __webpack_require__) {
92
+
93
+ // extracted by mini-css-extract-plugin
94
+
95
+ /***/ }),
96
+
97
+ /***/ "26be":
98
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
99
+
100
+ "use strict";
101
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_VirtualElTable_vue_vue_type_style_index_0_id_01f7dcee_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("0ba2");
102
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_VirtualElTable_vue_vue_type_style_index_0_id_01f7dcee_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_VirtualElTable_vue_vue_type_style_index_0_id_01f7dcee_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__);
103
+ /* unused harmony reexport * */
104
+
105
+
106
+ /***/ }),
107
+
108
+ /***/ "9940":
109
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
110
+
111
+ "use strict";
112
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_39458c28_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("f3c2");
113
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_39458c28_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_39458c28_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__);
114
+ /* unused harmony reexport * */
115
+
116
+
117
+ /***/ }),
118
+
119
+ /***/ "f3c2":
120
+ /***/ (function(module, exports, __webpack_require__) {
121
+
122
+ // extracted by mini-css-extract-plugin
123
+
124
+ /***/ }),
125
+
126
+ /***/ "fb15":
127
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
128
+
129
+ "use strict";
130
+ // ESM COMPAT FLAG
131
+ __webpack_require__.r(__webpack_exports__);
132
+
133
+ // EXPORTS
134
+ __webpack_require__.d(__webpack_exports__, "XtTable", function() { return /* reexport */ xt_table; });
135
+
136
+ // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
137
+ // This file is imported into lib/wc client bundles.
138
+
139
+ if (typeof window !== 'undefined') {
140
+ var currentScript = window.document.currentScript
141
+ if (false) { var getCurrentScript; }
142
+
143
+ var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
144
+ if (src) {
145
+ __webpack_require__.p = src[1] // eslint-disable-line
146
+ }
147
+ }
148
+
149
+ // Indicate to webpack that this file can be concatenated
150
+ /* harmony default export */ var setPublicPath = (null);
151
+
152
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"b8cd9b04-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-table/index.vue?vue&type=template&id=39458c28&scoped=true
153
+ var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:"xt-table-wrapper"},[(_vm.title || _vm.$slots.toolbar)?_c('div',{staticClass:"xt-table-header"},[(_vm.title)?_c('span',{staticClass:"xt-table-title"},[_vm._v(_vm._s(_vm.title))]):_vm._e(),_c('div',{staticClass:"xt-table-toolbar"},[_vm._t("toolbar")],2)]):_vm._e(),_c('div',{staticClass:"xt-table-body"},[_c('VirtualElTable',_vm._g(_vm._b({ref:"table",staticClass:"xt-table",attrs:{"data":_vm.processedTableData,"height":_vm.computedHeight,"max-height":_vm.computedMaxHeight,"virtual-scroll":_vm.virtualScroll,"row-height":_vm.rowInitHeight,"buffer-size":_vm.bufferSize,"span-method":_vm.groupColumns.length ? _vm.handleSpanMethod : undefined,"row-class-name":_vm.getRowClassName},on:{"selection-change":_vm.handleSelectionChange,"sort-change":_vm.handleSortChange}},'VirtualElTable',_vm.$attrs,false),_vm.$listeners),[(_vm.selection)?_c('el-table-column',{attrs:{"type":"selection","width":"55","fixed":_vm.selectionFixed}}):_vm._e(),(_vm.showIndex)?_c('el-table-column',{attrs:{"type":"index","width":"60","label":"#","fixed":_vm.indexFixed,"index":_vm.indexMethod}}):_vm._e(),_vm._l((_vm.flattenedColumns),function(col){return [(col.children && col.children.length)?_c('el-table-column',_vm._b({key:col._key},'el-table-column',_vm.getColumnProps(col),false),[_vm._l((col.children),function(child){return [_c('el-table-column',_vm._b({key:child._key,scopedSlots:_vm._u([(child.render)?{key:"default",fn:function(scope){return [_c('XtTableCell',{attrs:{"row":scope.row,"index":scope.$index,"render":child.render,"column":child}})]}}:(child.slot)?{key:"default",fn:function(scope){return [_vm._t(child.slot,null,{"row":scope.row,"index":scope.$index,"column":child})]}}:null],null,true)},'el-table-column',_vm.getColumnProps(child),false))]})],2):_c('el-table-column',_vm._b({key:col._key,scopedSlots:_vm._u([(col.render)?{key:"default",fn:function(scope){return [_c('XtTableCell',{attrs:{"row":scope.row,"index":scope.$index,"render":col.render,"column":col}})]}}:(col.slot)?{key:"default",fn:function(scope){return [_vm._t(col.slot,null,{"row":scope.row,"index":scope.$index,"column":col})]}}:null],null,true)},'el-table-column',_vm.getColumnProps(col),false))]})],2)],1),(_vm.showPagination)?_c('div',{staticClass:"xt-table-footer"},[_c('el-pagination',{attrs:{"current-page":_vm.pagination.pageNum,"page-size":_vm.pagination.pageSize,"total":_vm.total,"page-sizes":_vm.pagination.pageSizes || [10, 20, 50, 100],"layout":"total, sizes, prev, pager, next, jumper"},on:{"size-change":_vm.handleSizeChange,"current-change":_vm.handleCurrentChange}})],1):_vm._e()])
154
+ }
155
+ var staticRenderFns = []
156
+
157
+
158
+ // CONCATENATED MODULE: ./src/components/xt-table/index.vue?vue&type=template&id=39458c28&scoped=true
159
+
160
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-table/XtTableCell.vue?vue&type=script&lang=js
161
+
162
+ /* harmony default export */ var XtTableCellvue_type_script_lang_js = ({
163
+ name: 'XtTableCell',
164
+ functional: true,
165
+ props: {
166
+ row: Object,
167
+ index: Number,
168
+ render: Function,
169
+ column: { type: Object, default: null }
170
+ },
171
+ render: (h, ctx) => {
172
+ const params = {
173
+ row: ctx.props.row,
174
+ index: ctx.props.index
175
+ }
176
+ if (ctx.props.column) params.column = ctx.props.column
177
+ const isVnode = (it) => it !== null && it !== undefined && typeof it === 'object' && it.hasOwnProperty('componentOptions')
178
+ const renderNode = ctx.props.render(h, params)
179
+ if (renderNode === null || renderNode === undefined || renderNode === '') return h('span', '')
180
+ return isVnode(renderNode) ? renderNode : h('span', String(renderNode))
181
+ }
182
+ });
183
+
184
+ // CONCATENATED MODULE: ./src/components/xt-table/XtTableCell.vue?vue&type=script&lang=js
185
+ /* harmony default export */ var xt_table_XtTableCellvue_type_script_lang_js = (XtTableCellvue_type_script_lang_js);
186
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
187
+ /* globals __VUE_SSR_CONTEXT__ */
188
+
189
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
190
+ // This module is a runtime utility for cleaner component module output and will
191
+ // be included in the final webpack user bundle.
192
+
193
+ function normalizeComponent(
194
+ scriptExports,
195
+ render,
196
+ staticRenderFns,
197
+ functionalTemplate,
198
+ injectStyles,
199
+ scopeId,
200
+ moduleIdentifier /* server only */,
201
+ shadowMode /* vue-cli only */
202
+ ) {
203
+ // Vue.extend constructor export interop
204
+ var options =
205
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
206
+
207
+ // render functions
208
+ if (render) {
209
+ options.render = render
210
+ options.staticRenderFns = staticRenderFns
211
+ options._compiled = true
212
+ }
213
+
214
+ // functional template
215
+ if (functionalTemplate) {
216
+ options.functional = true
217
+ }
218
+
219
+ // scopedId
220
+ if (scopeId) {
221
+ options._scopeId = 'data-v-' + scopeId
222
+ }
223
+
224
+ var hook
225
+ if (moduleIdentifier) {
226
+ // server build
227
+ hook = function (context) {
228
+ // 2.3 injection
229
+ context =
230
+ context || // cached call
231
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
232
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
233
+ // 2.2 with runInNewContext: true
234
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
235
+ context = __VUE_SSR_CONTEXT__
236
+ }
237
+ // inject component styles
238
+ if (injectStyles) {
239
+ injectStyles.call(this, context)
240
+ }
241
+ // register component module identifier for async chunk inferrence
242
+ if (context && context._registeredComponents) {
243
+ context._registeredComponents.add(moduleIdentifier)
244
+ }
245
+ }
246
+ // used by ssr in case component is cached and beforeCreate
247
+ // never gets called
248
+ options._ssrRegister = hook
249
+ } else if (injectStyles) {
250
+ hook = shadowMode
251
+ ? function () {
252
+ injectStyles.call(
253
+ this,
254
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
255
+ )
256
+ }
257
+ : injectStyles
258
+ }
259
+
260
+ if (hook) {
261
+ if (options.functional) {
262
+ // for template-only hot-reload because in that case the render fn doesn't
263
+ // go through the normalizer
264
+ options._injectStyles = hook
265
+ // register for functional component in vue file
266
+ var originalRender = options.render
267
+ options.render = function renderWithStyleInjection(h, context) {
268
+ hook.call(context)
269
+ return originalRender(h, context)
270
+ }
271
+ } else {
272
+ // inject component registration as beforeCreate hook
273
+ var existing = options.beforeCreate
274
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
275
+ }
276
+ }
277
+
278
+ return {
279
+ exports: scriptExports,
280
+ options: options
281
+ }
282
+ }
283
+
284
+ // CONCATENATED MODULE: ./src/components/xt-table/XtTableCell.vue
285
+ var XtTableCell_render, XtTableCell_staticRenderFns
286
+
287
+
288
+
289
+
290
+ /* normalize component */
291
+
292
+ var component = normalizeComponent(
293
+ xt_table_XtTableCellvue_type_script_lang_js,
294
+ XtTableCell_render,
295
+ XtTableCell_staticRenderFns,
296
+ false,
297
+ null,
298
+ null,
299
+ null
300
+
301
+ )
302
+
303
+ /* harmony default export */ var XtTableCell = (component.exports);
304
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"b8cd9b04-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-table/VirtualElTable.vue?vue&type=template&id=01f7dcee&scoped=true
305
+ var VirtualElTablevue_type_template_id_01f7dcee_scoped_true_render = function render(){var _vm=this,_c=_vm._self._c;return _c('el-table',_vm._g(_vm._b({ref:"innerTable",attrs:{"data":_vm.renderList}},'el-table',_vm.$attrs,false),_vm.$listeners),[_vm._t("default")],2)
306
+ }
307
+ var VirtualElTablevue_type_template_id_01f7dcee_scoped_true_staticRenderFns = []
308
+
309
+
310
+ // CONCATENATED MODULE: ./src/components/xt-table/VirtualElTable.vue?vue&type=template&id=01f7dcee&scoped=true
311
+
312
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-table/VirtualElTable.vue?vue&type=script&lang=js
313
+
314
+ /* harmony default export */ var VirtualElTablevue_type_script_lang_js = ({
315
+ name: 'VirtualElTable',
316
+ inheritAttrs: false,
317
+
318
+ props: {
319
+ virtualScroll: {
320
+ type: Boolean,
321
+ default: false
322
+ },
323
+ rowHeight: {
324
+ type: Number,
325
+ default: 48
326
+ },
327
+ bufferSize: {
328
+ type: Number,
329
+ default: 5
330
+ }
331
+ },
332
+
333
+ data() {
334
+ return {
335
+ scrollWrap: null,
336
+ phantomDom: null,
337
+ scrollTop: 0,
338
+ // 根据数据量与容器高度预先估算一个合理的 endIndex,避免首屏只渲染 0 行
339
+ startIndex: 0,
340
+ endIndex: 20,
341
+ rafId: null,
342
+ unwatchPhantom: null,
343
+ layoutTimer: null,
344
+ retryTimers: []
345
+ }
346
+ },
347
+
348
+ computed: {
349
+ originData() {
350
+ return this.$attrs.data || []
351
+ },
352
+ renderList() {
353
+ if (!this.virtualScroll) return this.originData
354
+ const start = Math.max(0, this.startIndex - this.bufferSize)
355
+ const end = Math.min(this.originData.length, this.endIndex + this.bufferSize)
356
+ return this.originData.slice(start, end)
357
+ },
358
+ totalListHeight() {
359
+ return this.originData.length * this.rowHeight
360
+ },
361
+ contentOffsetY() {
362
+ return Math.max(0, this.startIndex - this.bufferSize) * this.rowHeight
363
+ }
364
+ },
365
+
366
+ watch: {
367
+ renderList() {
368
+ this.scheduleLayout()
369
+ },
370
+ originData: {
371
+ handler(val) {
372
+ if (!this.virtualScroll) return
373
+ if (val && val.length) {
374
+ this.$nextTick(() => {
375
+ this.calcVisibleRange()
376
+ })
377
+ }
378
+ }
379
+ }
380
+ },
381
+
382
+ mounted() {
383
+ this.$nextTick(() => {
384
+ this.initVirtualScroll()
385
+ })
386
+ },
387
+
388
+ beforeDestroy() {
389
+ this.unbindScrollEvent()
390
+ if (this.rafId) {
391
+ cancelAnimationFrame(this.rafId)
392
+ this.rafId = null
393
+ }
394
+ if (this.unwatchPhantom) {
395
+ this.unwatchPhantom()
396
+ this.unwatchPhantom = null
397
+ }
398
+ if (this.layoutTimer) {
399
+ clearTimeout(this.layoutTimer)
400
+ this.layoutTimer = null
401
+ }
402
+ this.retryTimers.forEach(t => clearTimeout(t))
403
+ this.retryTimers = []
404
+ },
405
+
406
+ methods: {
407
+ initVirtualScroll() {
408
+ if (!this.virtualScroll) return
409
+ this.scrollWrap = this.$refs.innerTable.$el.querySelector('.el-table__body-wrapper')
410
+ if (!this.scrollWrap) {
411
+ console.warn('[VirtualElTable] 无法找到滚动容器,虚拟滚动功能已禁用')
412
+ this.virtualScroll = false
413
+ return
414
+ }
415
+
416
+ this.scrollWrap.style.overflowY = 'auto'
417
+ this.scrollWrap.style.overflowX = 'auto'
418
+
419
+ this.wrapTableBody()
420
+ this.scrollWrap.addEventListener('scroll', this.onScroll, { passive: true })
421
+
422
+ // 首次可见范围计算 + 多次重试:
423
+ // ElementUI 的 el-table 在 mounted 后仍会异步完成列宽/高度布局,
424
+ // 单次 $nextTick 可能拿到 clientHeight=0,导致计算失败且无法恢复。
425
+ // 以递增延迟多次调用,直到 scrollWrap.clientHeight 获得稳定值。
426
+ this.calcVisibleRange()
427
+ const delays = [100, 300, 600, 1000]
428
+ delays.forEach(ms => {
429
+ const timer = setTimeout(() => {
430
+ this.calcVisibleRange()
431
+ }, ms)
432
+ this.retryTimers.push(timer)
433
+ })
434
+ },
435
+
436
+ wrapTableBody() {
437
+ const bodyDom = this.scrollWrap.querySelector('.el-table__body')
438
+ if (!bodyDom || bodyDom.querySelector('.vs-phantom')) return
439
+
440
+ // phantom 采用标准 block 布局:
441
+ // - height = 总数据高度,确保撑开 body-wrapper 的滚动条
442
+ // - padding-top = 可见区域偏移量,将 table 推到正确位置
443
+ // - min-width: 100%(不设 width),允许 table 自然撑开,保证列宽生效
444
+ const phantom = document.createElement('div')
445
+ phantom.className = 'vs-phantom'
446
+ phantom.style.position = 'relative'
447
+ phantom.style.minWidth = '100%'
448
+ phantom.style.boxSizing = 'border-box'
449
+ phantom.style.zIndex = '1'
450
+ this.phantomDom = phantom
451
+
452
+ const table = bodyDom.querySelector('table')
453
+ phantom.appendChild(table)
454
+ bodyDom.appendChild(phantom)
455
+
456
+ this.unwatchPhantom = this.$watch(
457
+ ['totalListHeight', 'contentOffsetY'],
458
+ () => {
459
+ if (this.phantomDom) {
460
+ this.phantomDom.style.height = `${this.totalListHeight}px`
461
+ this.phantomDom.style.paddingTop = `${this.contentOffsetY}px`
462
+ }
463
+ },
464
+ { immediate: true }
465
+ )
466
+ },
467
+
468
+ onScroll() {
469
+ this.scrollTop = this.scrollWrap.scrollTop
470
+ if (this.rafId) return
471
+ this.rafId = requestAnimationFrame(() => {
472
+ this.calcVisibleRange()
473
+ this.rafId = null
474
+ })
475
+ },
476
+
477
+ calcVisibleRange() {
478
+ if (!this.scrollWrap) return
479
+ let viewHeight = this.scrollWrap.clientHeight
480
+
481
+ // 关键兜底:ElementUI 异步布局尚未完成时,clientHeight 可能为 0,
482
+ // 此时用组件接收到的 height / max-height 作为估算值,确保至少能渲染正确数量的行。
483
+ if (!viewHeight) {
484
+ const h = this.$attrs.height || this.$attrs.maxHeight
485
+ if (h) {
486
+ viewHeight = typeof h === 'number' ? h : parseInt(String(h), 10)
487
+ }
488
+ }
489
+ if (!viewHeight || viewHeight <= 0) return
490
+
491
+ const visibleRowCount = Math.ceil(viewHeight / this.rowHeight)
492
+ const newStart = Math.floor(this.scrollTop / this.rowHeight)
493
+ const newEnd = Math.min(this.originData.length, newStart + visibleRowCount)
494
+
495
+ if (newStart !== this.startIndex || newEnd !== this.endIndex) {
496
+ this.startIndex = newStart
497
+ this.endIndex = newEnd
498
+ }
499
+ },
500
+
501
+ unbindScrollEvent() {
502
+ if (this.scrollWrap) {
503
+ this.scrollWrap.removeEventListener('scroll', this.onScroll)
504
+ }
505
+ },
506
+
507
+ scheduleLayout() {
508
+ if (this.layoutTimer) return
509
+ this.layoutTimer = setTimeout(() => {
510
+ if (this.$refs.innerTable) {
511
+ this.$refs.innerTable.doLayout()
512
+ }
513
+ this.layoutTimer = null
514
+ }, 0)
515
+ },
516
+
517
+ clearSelection() {
518
+ return this.$refs.innerTable.clearSelection()
519
+ },
520
+ toggleRowSelection() {
521
+ return this.$refs.innerTable.toggleRowSelection()
522
+ },
523
+ doLayout() {
524
+ return this.$refs.innerTable.doLayout()
525
+ }
526
+ }
527
+ });
528
+
529
+ // CONCATENATED MODULE: ./src/components/xt-table/VirtualElTable.vue?vue&type=script&lang=js
530
+ /* harmony default export */ var xt_table_VirtualElTablevue_type_script_lang_js = (VirtualElTablevue_type_script_lang_js);
531
+ // EXTERNAL MODULE: ./src/components/xt-table/VirtualElTable.vue?vue&type=style&index=0&id=01f7dcee&prod&scoped=true&lang=css
532
+ var VirtualElTablevue_type_style_index_0_id_01f7dcee_prod_scoped_true_lang_css = __webpack_require__("26be");
533
+
534
+ // CONCATENATED MODULE: ./src/components/xt-table/VirtualElTable.vue
535
+
536
+
537
+
538
+
539
+
540
+
541
+ /* normalize component */
542
+
543
+ var VirtualElTable_component = normalizeComponent(
544
+ xt_table_VirtualElTablevue_type_script_lang_js,
545
+ VirtualElTablevue_type_template_id_01f7dcee_scoped_true_render,
546
+ VirtualElTablevue_type_template_id_01f7dcee_scoped_true_staticRenderFns,
547
+ false,
548
+ null,
549
+ "01f7dcee",
550
+ null
551
+
552
+ )
553
+
554
+ /* harmony default export */ var VirtualElTable = (VirtualElTable_component.exports);
555
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-table/index.vue?vue&type=script&lang=js
556
+
557
+
558
+
559
+
560
+ /* harmony default export */ var xt_tablevue_type_script_lang_js = ({
561
+ name: 'XtTable',
562
+ inheritAttrs: false,
563
+ components: { XtTableCell: XtTableCell, VirtualElTable: VirtualElTable },
564
+
565
+ props: {
566
+ tableData: { type: Array, default: () => [] },
567
+ columns: { type: Array, default: () => [] },
568
+ groupColumns: { type: Array, default: () => [] },
569
+ // 排序配置
570
+ sortGroup: { type: Boolean, default: false },
571
+ defaultSort: { type: Object, default: null },
572
+ // 过滤配置
573
+ filterMethod: { type: Function, default: null },
574
+ title: { type: String, default: '' },
575
+ height: { type: [Number, String], default: null },
576
+ maxHeight: { type: [Number, String], default: null },
577
+ virtualScroll: { type: Boolean, default: false },
578
+ rowInitHeight: { type: Number, default: 48 },
579
+ bufferSize: { type: Number, default: 5 },
580
+ pagination: { type: Object, default: null },
581
+ total: { type: Number, default: 0 },
582
+ showIndex: { type: Boolean, default: false },
583
+ selection: { type: Boolean, default: false },
584
+ selectionFixed: { type: [String, Boolean], default: false },
585
+ indexFixed: { type: [String, Boolean], default: false },
586
+ loading: { type: Boolean, default: false },
587
+ emptyText: { type: String, default: '暂无数据' },
588
+ subtotalConfig: { type: Object, default: () => ({ enabled: false }) },
589
+ totalConfig: { type: Object, default: () => ({ enabled: false }) }
590
+ },
591
+
592
+ data() {
593
+ return {
594
+ spanCache: {},
595
+ flattenedColumnsCache: [],
596
+ selectedRows: [],
597
+ // 排序状态
598
+ sortProp: null,
599
+ sortOrder: null
600
+ }
601
+ },
602
+
603
+ computed: {
604
+ showPagination() {
605
+ return this.pagination && this.total > 0
606
+ },
607
+ computedHeight() {
608
+ return this.height || undefined
609
+ },
610
+ computedMaxHeight() {
611
+ return this.height ? undefined : this.maxHeight || undefined
612
+ },
613
+
614
+ // 排序后的数据
615
+ sortedTableData() {
616
+ if (!this.tableData.length) return []
617
+
618
+ let data = [...this.tableData]
619
+
620
+ if (typeof this.filterMethod === 'function') {
621
+ data = data.filter(this.filterMethod)
622
+ }
623
+
624
+ if (!this.sortProp || !this.sortOrder) return data
625
+
626
+ const order = this.sortOrder === 'ascending' ? 1 : -1
627
+ const sortFn = this.resolveSortMethod(this.sortProp)
628
+
629
+ if (this.sortGroup && this.groupColumns.length) {
630
+ return this.groupSort(data, sortFn, order)
631
+ }
632
+ return data.sort((a, b) => sortFn(a, b) * order)
633
+ },
634
+
635
+ // 处理小计、总计后的最终数据
636
+ processedTableData() {
637
+ if (!this.sortedTableData.length) return []
638
+ let data = [...this.sortedTableData]
639
+ const hasSubtotal = this.subtotalConfig && this.subtotalConfig.enabled
640
+ const hasTotal = this.totalConfig && this.totalConfig.enabled
641
+
642
+ if (!hasSubtotal && !hasTotal) return data
643
+
644
+ const labelColumn = this.findLabelColumn()
645
+ let result = []
646
+
647
+ if (hasSubtotal && this.subtotalConfig.groupBy && this.subtotalConfig.groupBy.length) {
648
+ const groups = this.groupData(data, this.subtotalConfig.groupBy)
649
+ groups.forEach((groupRows) => {
650
+ result.push(...groupRows)
651
+ const subtotalRow = this.createSubtotalRow(groupRows)
652
+ result.push(subtotalRow)
653
+ })
654
+ } else {
655
+ result = data
656
+ }
657
+
658
+ if (hasTotal) {
659
+ const totalRow = this.createTotalRow(data)
660
+ result.push(totalRow)
661
+ }
662
+ return result
663
+ },
664
+
665
+ // 扁平化列配置,添加唯一 key
666
+ flattenedColumns() {
667
+ if (this.flattenedColumnsCache.length) return this.flattenedColumnsCache
668
+ const assignKeys = (cols, parentPath = '') => {
669
+ return cols.map((col, index) => {
670
+ const path = parentPath ? `${parentPath}_${index}` : String(index)
671
+ const key = col.prop || col.slot || col.label || path
672
+ const item = { ...col, _key: key }
673
+ if (col.children && col.children.length) {
674
+ item.children = assignKeys(col.children, path)
675
+ }
676
+ return item
677
+ })
678
+ }
679
+ this.flattenedColumnsCache = assignKeys(this.columns)
680
+ return this.flattenedColumnsCache
681
+ }
682
+ },
683
+
684
+ watch: {
685
+ tableData() {
686
+ this.spanCache = {}
687
+ this.flattenedColumnsCache = []
688
+ },
689
+ columns: {
690
+ handler() {
691
+ this.flattenedColumnsCache = []
692
+ this.spanCache = {}
693
+ },
694
+ deep: true
695
+ },
696
+ groupColumns: {
697
+ handler() {
698
+ this.spanCache = {}
699
+ },
700
+ deep: true
701
+ },
702
+ defaultSort: {
703
+ handler(val) {
704
+ if (val && val.prop) {
705
+ this.sortProp = val.prop
706
+ this.sortOrder = val.order || 'ascending'
707
+ }
708
+ },
709
+ immediate: false
710
+ },
711
+ sortProp() {
712
+ this.spanCache = {}
713
+ }
714
+ },
715
+
716
+ created() {
717
+ if (this.defaultSort && this.defaultSort.prop) {
718
+ this.sortProp = this.defaultSort.prop
719
+ this.sortOrder = this.defaultSort.order || 'ascending'
720
+ }
721
+ },
722
+
723
+ mounted() {
724
+ this.$nextTick(() => {
725
+ window.addEventListener('resize', this.handleResize)
726
+ })
727
+ },
728
+
729
+ beforeDestroy() {
730
+ window.removeEventListener('resize', this.handleResize)
731
+ },
732
+
733
+ methods: {
734
+ // ========== 排序逻辑 ==========
735
+ resolveSortMethod(prop) {
736
+ const col = this.findColumnByProp(prop)
737
+ if (col && typeof col.sortMethod === 'function') {
738
+ return col.sortMethod
739
+ }
740
+ return (a, b) => {
741
+ const va = a[prop]
742
+ const vb = b[prop]
743
+ if (va == null && vb == null) return 0
744
+ if (va == null) return -1
745
+ if (vb == null) return 1
746
+ if (typeof va === 'number' && typeof vb === 'number') return va - vb
747
+ return String(va).localeCompare(String(vb), undefined, { numeric: true })
748
+ }
749
+ },
750
+
751
+ findColumnByProp(prop) {
752
+ for (const col of this.columns) {
753
+ if (col.children && col.children.length) {
754
+ for (const child of col.children) {
755
+ if (child.prop === prop) return child
756
+ }
757
+ } else if (col.prop === prop) {
758
+ return col
759
+ }
760
+ }
761
+ return null
762
+ },
763
+
764
+ groupSort(data, sortFn, order) {
765
+ const groups = {}
766
+ data.forEach(row => {
767
+ const key = this.groupColumns.map(f => row[f] == null ? '' : String(row[f])).join('|||')
768
+ if (!groups[key]) groups[key] = []
769
+ groups[key].push(row)
770
+ })
771
+ const result = []
772
+ Object.keys(groups).sort().forEach(key => {
773
+ const groupRows = groups[key]
774
+ groupRows.sort((a, b) => sortFn(a, b) * order)
775
+ result.push(...groupRows)
776
+ })
777
+ return result
778
+ },
779
+
780
+ handleResize() {
781
+ this.$nextTick(() => {
782
+ this.$refs.table && this.$refs.table.doLayout()
783
+ })
784
+ },
785
+
786
+ // ========== 小计 / 总计 相关 ==========
787
+ findLabelColumn() {
788
+ for (const col of this.columns) {
789
+ if (col.children && col.children.length) {
790
+ for (const child of col.children) {
791
+ if (child.prop) return { prop: child.prop, label: child.label }
792
+ }
793
+ } else if (col.prop) {
794
+ return { prop: col.prop, label: col.label }
795
+ }
796
+ }
797
+ return { prop: '', label: '' }
798
+ },
799
+
800
+ groupData(data, groupBy) {
801
+ const map = new Map()
802
+ data.forEach(row => {
803
+ const key = groupBy.map(f => row[f]).join('|||')
804
+ if (!map.has(key)) map.set(key, [])
805
+ map.get(key).push(row)
806
+ })
807
+ return map
808
+ },
809
+
810
+ _calcValue(rows, calc) {
811
+ if (typeof calc === 'function') return calc(rows)
812
+ const prop = calc.prop
813
+ const type = calc.type || 'sum'
814
+ const vals = prop ? rows.map(r => parseFloat(r[prop]) || 0) : []
815
+ switch (type) {
816
+ case 'sum': return vals.reduce((s, v) => s + v, 0)
817
+ case 'avg':
818
+ case 'average': return vals.length ? vals.reduce((s, v) => s + v, 0) / vals.length : 0
819
+ case 'count': return rows.length
820
+ case 'min': return vals.length ? Math.min(...vals) : 0
821
+ case 'max': return vals.length ? Math.max(...vals) : 0
822
+ default: return ''
823
+ }
824
+ },
825
+
826
+ createSubtotalRow(groupRows) {
827
+ const config = this.subtotalConfig
828
+ const rawLabelProp = this.findLabelColumn()
829
+ const labelField = config.groupBy ? config.groupBy[0] : ''
830
+ const groupValue = groupRows[0] ? groupRows[0][labelField] : ''
831
+ const labelText = config.labelText || `${groupValue} 小计`
832
+
833
+ const row = { _rowType: 'subtotal' }
834
+ row[rawLabelProp.prop] = labelText
835
+
836
+ if (config.columns) {
837
+ Object.keys(config.columns).forEach(prop => {
838
+ const calc = config.columns[prop]
839
+ row[prop] = typeof calc === 'string'
840
+ ? this._calcValue(groupRows, { prop, type: calc })
841
+ : this._calcValue(groupRows, calc)
842
+ })
843
+ }
844
+ return row
845
+ },
846
+
847
+ createTotalRow(allRows) {
848
+ const config = this.totalConfig
849
+ const rawLabelProp = this.findLabelColumn()
850
+ const labelText = config.labelText || '总计'
851
+
852
+ const row = { _rowType: 'total' }
853
+ row[rawLabelProp.prop] = labelText
854
+
855
+ if (config.columns) {
856
+ Object.keys(config.columns).forEach(prop => {
857
+ const calc = config.columns[prop]
858
+ row[prop] = typeof calc === 'string'
859
+ ? this._calcValue(allRows, { prop, type: calc })
860
+ : this._calcValue(allRows, calc)
861
+ })
862
+ }
863
+ return row
864
+ },
865
+
866
+ getRowClassName({ row }) {
867
+ if (row._rowType === 'subtotal') return 'xt-table-row-subtotal'
868
+ if (row._rowType === 'total') return 'xt-table-row-total'
869
+ return ''
870
+ },
871
+
872
+ // ========== 列处理 ==========
873
+ getColumnProps(col) {
874
+ const { _key, children, render, slot, sortMethod, ...props } = col
875
+ return props
876
+ },
877
+
878
+ indexMethod(index) {
879
+ return index + 1
880
+ },
881
+
882
+ // ========== 合并单元格 ==========
883
+ handleSpanMethod({ row, column, rowIndex }) {
884
+ if (row._rowType === 'subtotal' || row._rowType === 'total') {
885
+ return { rowspan: 1, colspan: 1 }
886
+ }
887
+ if (!this.groupColumns.length) return { rowspan: 1, colspan: 1 }
888
+
889
+ const data = this.processedTableData
890
+ const prop = column.property
891
+ const groupIndex = this.groupColumns.indexOf(prop)
892
+ if (groupIndex === -1) return { rowspan: 1, colspan: 1 }
893
+
894
+ const cacheKey = `${rowIndex}_${prop}`
895
+ if (this.spanCache[cacheKey]) return this.spanCache[cacheKey]
896
+
897
+ if (rowIndex > 0) {
898
+ const prevRow = data[rowIndex - 1]
899
+ let isSame = true
900
+ for (let i = 0; i <= groupIndex; i++) {
901
+ const gp = this.groupColumns[i]
902
+ if (prevRow[gp] !== row[gp]) {
903
+ isSame = false
904
+ break
905
+ }
906
+ }
907
+ if (isSame) {
908
+ const res = { rowspan: 0, colspan: 1 }
909
+ this.spanCache[cacheKey] = res
910
+ return res
911
+ }
912
+ }
913
+
914
+ let count = 1
915
+ for (let i = rowIndex + 1; i < data.length; i++) {
916
+ const nextRow = data[i]
917
+ let same = true
918
+ for (let j = 0; j <= groupIndex; j++) {
919
+ const gp = this.groupColumns[j]
920
+ if (nextRow[gp] !== row[gp]) {
921
+ same = false
922
+ break
923
+ }
924
+ }
925
+ if (same) count++
926
+ else break
927
+ }
928
+
929
+ const res = { rowspan: count > 1 ? count : 1, colspan: 1 }
930
+ this.spanCache[cacheKey] = res
931
+ return res
932
+ },
933
+
934
+ // ========== 选择、排序、分页 ==========
935
+ handleSelectionChange(rows) {
936
+ this.selectedRows = rows.filter(r => !r._rowType)
937
+ this.$emit('selection-change', this.selectedRows)
938
+ },
939
+ handleSortChange(info) {
940
+ this.sortProp = info.prop
941
+ this.sortOrder = info.order
942
+ this.$emit('sort-change', info)
943
+ },
944
+ handleSizeChange(size) {
945
+ this.$emit('size-change', size)
946
+ },
947
+ handleCurrentChange(page) {
948
+ this.$emit('page-change', page)
949
+ },
950
+
951
+ // ========== 对外暴露方法 ==========
952
+ getSelection() {
953
+ return this.selectedRows
954
+ },
955
+ clearSelection() {
956
+ this.$refs.table && this.$refs.table.clearSelection()
957
+ this.selectedRows = []
958
+ },
959
+ clearSort() {
960
+ this.sortProp = null
961
+ this.sortOrder = null
962
+ this.$nextTick(() => {
963
+ if (this.$refs.table && this.$refs.table.$refs.innerTable) {
964
+ this.$refs.table.$refs.innerTable.clearSort()
965
+ }
966
+ })
967
+ },
968
+ toggleRowSelection(row, selected) {
969
+ this.$refs.table && this.$refs.table.toggleRowSelection(row, selected)
970
+ },
971
+ toggleRowsSelection(rows, selected) {
972
+ if (!rows || !rows.length) return
973
+ rows.forEach(row => {
974
+ this.$refs.table && this.$refs.table.toggleRowSelection(row, selected)
975
+ })
976
+ },
977
+ doLayout() {
978
+ this.$refs.table && this.$refs.table.doLayout()
979
+ }
980
+ }
981
+ });
982
+
983
+ // CONCATENATED MODULE: ./src/components/xt-table/index.vue?vue&type=script&lang=js
984
+ /* harmony default export */ var components_xt_tablevue_type_script_lang_js = (xt_tablevue_type_script_lang_js);
985
+ // EXTERNAL MODULE: ./src/components/xt-table/index.vue?vue&type=style&index=0&id=39458c28&prod&scoped=true&lang=css
986
+ var xt_tablevue_type_style_index_0_id_39458c28_prod_scoped_true_lang_css = __webpack_require__("9940");
987
+
988
+ // CONCATENATED MODULE: ./src/components/xt-table/index.vue
989
+
990
+
991
+
992
+
993
+
994
+
995
+ /* normalize component */
996
+
997
+ var xt_table_component = normalizeComponent(
998
+ components_xt_tablevue_type_script_lang_js,
999
+ render,
1000
+ staticRenderFns,
1001
+ false,
1002
+ null,
1003
+ "39458c28",
1004
+ null
1005
+
1006
+ )
1007
+
1008
+ /* harmony default export */ var xt_table = (xt_table_component.exports);
1009
+ // CONCATENATED MODULE: ./src/components/xt-table/index.js
1010
+
1011
+
1012
+ xt_table.install = function (Vue) {
1013
+ Vue.component(xt_table.name, xt_table)
1014
+ }
1015
+
1016
+ /* harmony default export */ var components_xt_table = (xt_table);
1017
+
1018
+ // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
1019
+
1020
+
1021
+ /* harmony default export */ var entry_lib = __webpack_exports__["default"] = (components_xt_table);
1022
+
1023
+
1024
+
1025
+ /***/ })
1026
+
1027
+ /******/ });