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