element-ui-pro-components-test 1.5.0

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 (53) hide show
  1. package/CHANGELOG.md +0 -0
  2. package/LICENSE +21 -0
  3. package/README.md +0 -0
  4. package/lib/dialog-form.js +1175 -0
  5. package/lib/editable-pro-table.js +2080 -0
  6. package/lib/element-ui-pro-components.common.js +193 -0
  7. package/lib/index.js +1 -0
  8. package/lib/locale/index.js +44 -0
  9. package/lib/locale/lang/en.js +46 -0
  10. package/lib/locale/lang/zh-CN.js +46 -0
  11. package/lib/pro-form.js +1036 -0
  12. package/lib/pro-table.js +2779 -0
  13. package/lib/theme-chalk/editable-pro-table.css +1 -0
  14. package/lib/theme-chalk/index.css +1 -0
  15. package/lib/theme-chalk/pro-table.css +1 -0
  16. package/lib/umd/locale/en.js +67 -0
  17. package/lib/umd/locale/zh-CN.js +67 -0
  18. package/lib/utils/breakpoints.js +68 -0
  19. package/lib/utils/debounce.js +20 -0
  20. package/lib/utils/form.js +108 -0
  21. package/package.json +78 -0
  22. package/packages/dialog-form/index.js +9 -0
  23. package/packages/dialog-form/src/components/Submitter.vue +47 -0
  24. package/packages/dialog-form/src/index.vue +404 -0
  25. package/packages/editable-pro-table/index.js +9 -0
  26. package/packages/editable-pro-table/src/components/Editable.vue +203 -0
  27. package/packages/editable-pro-table/src/components/FormItem.vue +193 -0
  28. package/packages/editable-pro-table/src/components/RecordCreator.vue +43 -0
  29. package/packages/editable-pro-table/src/components/RenderCell.vue +181 -0
  30. package/packages/editable-pro-table/src/index.vue +805 -0
  31. package/packages/pro-form/index.js +9 -0
  32. package/packages/pro-form/src/components/Submitter.vue +47 -0
  33. package/packages/pro-form/src/index.vue +309 -0
  34. package/packages/pro-table/index.js +9 -0
  35. package/packages/pro-table/src/components/ColumnAlignSettings.vue +77 -0
  36. package/packages/pro-table/src/components/ColumnSettings.vue +172 -0
  37. package/packages/pro-table/src/components/ColumnSettingsItem.vue +401 -0
  38. package/packages/pro-table/src/components/svg/ArrowIcon.vue +16 -0
  39. package/packages/pro-table/src/components/svg/HolderIcon.vue +17 -0
  40. package/packages/pro-table/src/components/svg/SettingIcon.vue +20 -0
  41. package/packages/pro-table/src/components/svg/VerticalAlginBottomIcon.vue +17 -0
  42. package/packages/pro-table/src/components/svg/VerticalAlginMiddleIcon.vue +17 -0
  43. package/packages/pro-table/src/components/svg/VerticalAlignTopIcon.vue +17 -0
  44. package/packages/pro-table/src/index.vue +934 -0
  45. package/src/components/custom-render/index.vue +16 -0
  46. package/src/components/pro-form-item/index.vue +129 -0
  47. package/src/index.js +57 -0
  48. package/src/locale/index.js +47 -0
  49. package/src/locale/lang/en.js +46 -0
  50. package/src/locale/lang/zh-CN.js +46 -0
  51. package/src/utils/breakpoints.js +61 -0
  52. package/src/utils/debounce.js +22 -0
  53. package/src/utils/form.js +94 -0
@@ -0,0 +1,2779 @@
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 = 9);
86
+ /******/ })
87
+ /************************************************************************/
88
+ /******/ ([
89
+ /* 0 */
90
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
91
+
92
+ "use strict";
93
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
94
+ /* globals __VUE_SSR_CONTEXT__ */
95
+
96
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
97
+ // This module is a runtime utility for cleaner component module output and will
98
+ // be included in the final webpack user bundle.
99
+
100
+ function normalizeComponent(
101
+ scriptExports,
102
+ render,
103
+ staticRenderFns,
104
+ functionalTemplate,
105
+ injectStyles,
106
+ scopeId,
107
+ moduleIdentifier /* server only */,
108
+ shadowMode /* vue-cli only */
109
+ ) {
110
+ // Vue.extend constructor export interop
111
+ var options =
112
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
113
+
114
+ // render functions
115
+ if (render) {
116
+ options.render = render
117
+ options.staticRenderFns = staticRenderFns
118
+ options._compiled = true
119
+ }
120
+
121
+ // functional template
122
+ if (functionalTemplate) {
123
+ options.functional = true
124
+ }
125
+
126
+ // scopedId
127
+ if (scopeId) {
128
+ options._scopeId = 'data-v-' + scopeId
129
+ }
130
+
131
+ var hook
132
+ if (moduleIdentifier) {
133
+ // server build
134
+ hook = function (context) {
135
+ // 2.3 injection
136
+ context =
137
+ context || // cached call
138
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
139
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
140
+ // 2.2 with runInNewContext: true
141
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
142
+ context = __VUE_SSR_CONTEXT__
143
+ }
144
+ // inject component styles
145
+ if (injectStyles) {
146
+ injectStyles.call(this, context)
147
+ }
148
+ // register component module identifier for async chunk inferrence
149
+ if (context && context._registeredComponents) {
150
+ context._registeredComponents.add(moduleIdentifier)
151
+ }
152
+ }
153
+ // used by ssr in case component is cached and beforeCreate
154
+ // never gets called
155
+ options._ssrRegister = hook
156
+ } else if (injectStyles) {
157
+ hook = shadowMode
158
+ ? function () {
159
+ injectStyles.call(
160
+ this,
161
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
162
+ )
163
+ }
164
+ : injectStyles
165
+ }
166
+
167
+ if (hook) {
168
+ if (options.functional) {
169
+ // for template-only hot-reload because in that case the render fn doesn't
170
+ // go through the normalizer
171
+ options._injectStyles = hook
172
+ // register for functional component in vue file
173
+ var originalRender = options.render
174
+ options.render = function renderWithStyleInjection(h, context) {
175
+ hook.call(context)
176
+ return originalRender(h, context)
177
+ }
178
+ } else {
179
+ // inject component registration as beforeCreate hook
180
+ var existing = options.beforeCreate
181
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
182
+ }
183
+ }
184
+
185
+ return {
186
+ exports: scriptExports,
187
+ options: options
188
+ }
189
+ }
190
+
191
+
192
+ /***/ }),
193
+ /* 1 */
194
+ /***/ (function(module, exports) {
195
+
196
+ module.exports = require("element-ui-pro-components/lib/locale");
197
+
198
+ /***/ }),
199
+ /* 2 */
200
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
201
+
202
+ "use strict";
203
+
204
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/custom-render/index.vue?vue&type=script&lang=js
205
+ /* harmony default export */ var custom_rendervue_type_script_lang_js = ({
206
+ name: 'CustomRender',
207
+ props: {
208
+ render: {
209
+ type: Function,
210
+ required: true
211
+ }
212
+ },
213
+ render: function (h) {
214
+ return h("Fragment", [this.render()]);
215
+ }
216
+ });
217
+ // CONCATENATED MODULE: ./src/components/custom-render/index.vue?vue&type=script&lang=js
218
+ /* harmony default export */ var components_custom_rendervue_type_script_lang_js = (custom_rendervue_type_script_lang_js);
219
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
220
+ var componentNormalizer = __webpack_require__(0);
221
+
222
+ // CONCATENATED MODULE: ./src/components/custom-render/index.vue
223
+ var render, staticRenderFns
224
+
225
+
226
+
227
+
228
+ /* normalize component */
229
+
230
+ var component = Object(componentNormalizer["a" /* default */])(
231
+ components_custom_rendervue_type_script_lang_js,
232
+ render,
233
+ staticRenderFns,
234
+ false,
235
+ null,
236
+ null,
237
+ null
238
+
239
+ )
240
+
241
+ /* harmony default export */ var custom_render = __webpack_exports__["a"] = (component.exports);
242
+
243
+ /***/ }),
244
+ /* 3 */
245
+ /***/ (function(module, exports) {
246
+
247
+ module.exports = require("element-ui-pro-components/lib/utils/form");
248
+
249
+ /***/ }),
250
+ /* 4 */
251
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
252
+
253
+ "use strict";
254
+
255
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/pro-form-item/index.vue?vue&type=template&id=8611eff6
256
+ var render = function render() {
257
+ var _vm = this,
258
+ _c = _vm._self._c
259
+ return _c(
260
+ "el-form-item",
261
+ _vm._b(
262
+ {
263
+ scopedSlots: _vm._u(
264
+ [
265
+ _vm.formItem.renderLabel
266
+ ? {
267
+ key: "label",
268
+ fn: function () {
269
+ return [
270
+ _c("CustomRender", {
271
+ attrs: { render: _vm.formItem.renderLabel },
272
+ }),
273
+ ]
274
+ },
275
+ proxy: true,
276
+ }
277
+ : null,
278
+ ],
279
+ null,
280
+ true
281
+ ),
282
+ },
283
+ "el-form-item",
284
+ _vm.normalizedFormItem,
285
+ false
286
+ ),
287
+ [
288
+ _vm.formItem.renderField
289
+ ? _c("CustomRender", {
290
+ attrs: {
291
+ render: () =>
292
+ _vm.formItem.renderField({
293
+ form: _vm.form,
294
+ formItem: _vm.formItem,
295
+ }),
296
+ },
297
+ })
298
+ : _vm.formItem.valueType === "slot"
299
+ ? _vm._t(_vm.formItem.prop)
300
+ : _c(
301
+ `el-${_vm.formItem.valueType}`,
302
+ _vm._g(
303
+ _vm._b(
304
+ {
305
+ tag: "component",
306
+ model: {
307
+ value: _vm.form[_vm.formItem.prop],
308
+ callback: function ($$v) {
309
+ _vm.$set(_vm.form, _vm.formItem.prop, $$v)
310
+ },
311
+ expression: "form[formItem.prop]",
312
+ },
313
+ },
314
+ "component",
315
+ _vm.formItem.fieldProps,
316
+ false
317
+ ),
318
+ _vm.formItem.fieldEvents
319
+ ),
320
+ [
321
+ _vm.formItem.valueType === "select"
322
+ ? [
323
+ _vm.isOptionGroup
324
+ ? _vm._l(_vm.formItem.options, function (group) {
325
+ return _c(
326
+ "el-option-group",
327
+ _vm._b(
328
+ { key: group.label },
329
+ "el-option-group",
330
+ group,
331
+ false
332
+ ),
333
+ _vm._l(group.options, function (option) {
334
+ return _c(
335
+ "el-option",
336
+ _vm._b(
337
+ { key: option.value },
338
+ "el-option",
339
+ option,
340
+ false
341
+ )
342
+ )
343
+ }),
344
+ 1
345
+ )
346
+ })
347
+ : _vm._l(_vm.formItem.options, function (option) {
348
+ return _c(
349
+ "el-option",
350
+ _vm._b(
351
+ { key: option.value },
352
+ "el-option",
353
+ option,
354
+ false
355
+ )
356
+ )
357
+ }),
358
+ ]
359
+ : _vm.groups.includes(_vm.formItem.valueType)
360
+ ? _vm._l(_vm.formItem.options, function (option) {
361
+ return _c(
362
+ _vm.selection[_vm.formItem.valueType],
363
+ {
364
+ key: option.value,
365
+ tag: "component",
366
+ attrs: { label: option.value },
367
+ },
368
+ [_vm._v("\n " + _vm._s(option.label) + "\n ")]
369
+ )
370
+ })
371
+ : _vm._e(),
372
+ ],
373
+ 2
374
+ ),
375
+ ],
376
+ 2
377
+ )
378
+ }
379
+ var staticRenderFns = []
380
+ render._withStripped = true
381
+
382
+
383
+ // CONCATENATED MODULE: ./src/components/pro-form-item/index.vue?vue&type=template&id=8611eff6
384
+
385
+ // EXTERNAL MODULE: ./src/components/custom-render/index.vue + 2 modules
386
+ var custom_render = __webpack_require__(2);
387
+
388
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/pro-form-item/index.vue?vue&type=script&lang=js
389
+
390
+ /* harmony default export */ var pro_form_itemvue_type_script_lang_js = ({
391
+ name: 'ProFormItem',
392
+ components: {
393
+ CustomRender: custom_render["a" /* default */]
394
+ },
395
+ props: {
396
+ // formItem 项
397
+ formItem: {
398
+ type: Object,
399
+ required: true
400
+ },
401
+ // 表单数据
402
+ form: {
403
+ type: Object,
404
+ required: true
405
+ }
406
+ },
407
+ computed: {
408
+ // 过滤 el-form-item 的属性
409
+ normalizedFormItem() {
410
+ const {
411
+ renderLabel,
412
+ valueType,
413
+ renderField,
414
+ fieldProps,
415
+ fieldEvents,
416
+ options,
417
+ valueEnum,
418
+ optionLoader,
419
+ initialValue,
420
+ colProps,
421
+ ...keys
422
+ } = this.formItem;
423
+ return keys;
424
+ },
425
+ isOptionGroup() {
426
+ var _this$formItem$option, _this$formItem$option2;
427
+ return (_this$formItem$option = this.formItem.options) === null || _this$formItem$option === void 0 ? void 0 : (_this$formItem$option2 = _this$formItem$option[0]) === null || _this$formItem$option2 === void 0 ? void 0 : _this$formItem$option2.options;
428
+ }
429
+ },
430
+ data() {
431
+ return {
432
+ groups: ['radio-group', 'checkbox-group'],
433
+ // valueType
434
+ selection: {
435
+ // 选项组对应的组件
436
+ 'radio-group': 'el-radio',
437
+ 'checkbox-group': 'el-checkbox'
438
+ }
439
+ };
440
+ }
441
+ });
442
+ // CONCATENATED MODULE: ./src/components/pro-form-item/index.vue?vue&type=script&lang=js
443
+ /* harmony default export */ var components_pro_form_itemvue_type_script_lang_js = (pro_form_itemvue_type_script_lang_js);
444
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
445
+ var componentNormalizer = __webpack_require__(0);
446
+
447
+ // CONCATENATED MODULE: ./src/components/pro-form-item/index.vue
448
+
449
+
450
+
451
+
452
+
453
+ /* normalize component */
454
+
455
+ var component = Object(componentNormalizer["a" /* default */])(
456
+ components_pro_form_itemvue_type_script_lang_js,
457
+ render,
458
+ staticRenderFns,
459
+ false,
460
+ null,
461
+ null,
462
+ null
463
+
464
+ )
465
+
466
+ /* harmony default export */ var pro_form_item = __webpack_exports__["a"] = (component.exports);
467
+
468
+ /***/ }),
469
+ /* 5 */
470
+ /***/ (function(module, exports) {
471
+
472
+ module.exports = require("element-ui-pro-components/lib/utils/breakpoints");
473
+
474
+ /***/ }),
475
+ /* 6 */,
476
+ /* 7 */
477
+ /***/ (function(module, exports) {
478
+
479
+ module.exports = require("element-ui-pro-components/lib/utils/debounce");
480
+
481
+ /***/ }),
482
+ /* 8 */,
483
+ /* 9 */
484
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
485
+
486
+ "use strict";
487
+ // ESM COMPAT FLAG
488
+ __webpack_require__.r(__webpack_exports__);
489
+
490
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/pro-table/src/index.vue?vue&type=template&id=0d0329af&scoped=true
491
+ var render = function render() {
492
+ var _vm = this,
493
+ _c = _vm._self._c
494
+ return _c(
495
+ "div",
496
+ { staticClass: "pro-table" },
497
+ [
498
+ _vm.search
499
+ ? [
500
+ _c(
501
+ "el-form",
502
+ {
503
+ staticClass: "pro-table__form",
504
+ class: _vm.searchProps.className,
505
+ attrs: {
506
+ "label-width": _vm.searchProps.labelWidth,
507
+ "label-position": _vm.searchProps.labelPosition,
508
+ model: _vm.form,
509
+ size: _vm.defaultSize,
510
+ },
511
+ },
512
+ [
513
+ _c(
514
+ "el-row",
515
+ _vm._b({}, "el-row", _vm.searchProps.rowProps, false),
516
+ [
517
+ _vm._l(_vm.formItems, function (formItem, index) {
518
+ return _c(
519
+ "el-col",
520
+ _vm._b(
521
+ {
522
+ key: formItem.prop || formItem.key,
523
+ style: {
524
+ display: index >= _vm.searchCount ? "none" : "",
525
+ },
526
+ },
527
+ "el-col",
528
+ _vm.searchProps.colProps,
529
+ false
530
+ ),
531
+ [
532
+ _c("ProFormItem", {
533
+ attrs: { form: _vm.form, formItem: formItem },
534
+ scopedSlots: _vm._u(
535
+ [
536
+ {
537
+ key: formItem.prop,
538
+ fn: function () {
539
+ return [
540
+ _vm._t(formItem.prop, null, null, {
541
+ form: _vm.form,
542
+ formItem,
543
+ }),
544
+ ]
545
+ },
546
+ proxy: true,
547
+ },
548
+ ],
549
+ null,
550
+ true
551
+ ),
552
+ }),
553
+ ],
554
+ 1
555
+ )
556
+ }),
557
+ _c(
558
+ "el-col",
559
+ _vm._b(
560
+ { key: "search", staticClass: "search-wrapper" },
561
+ "el-col",
562
+ _vm.searchColConfig,
563
+ false
564
+ ),
565
+ [
566
+ _c(
567
+ "el-button",
568
+ {
569
+ attrs: {
570
+ icon: "el-icon-refresh",
571
+ size: _vm.defaultSize,
572
+ },
573
+ on: { click: _vm.handleReset },
574
+ },
575
+ [_vm._v(_vm._s(_vm.searchProps.resetText))]
576
+ ),
577
+ _c(
578
+ "el-button",
579
+ {
580
+ attrs: {
581
+ type: "primary",
582
+ icon: "el-icon-search",
583
+ loading: _vm.loading,
584
+ size: _vm.defaultSize,
585
+ },
586
+ on: { click: _vm.handleSearch },
587
+ },
588
+ [_vm._v(_vm._s(_vm.searchProps.searchText))]
589
+ ),
590
+ _vm.showExpandToggle
591
+ ? [
592
+ _c(
593
+ "el-button",
594
+ {
595
+ staticClass: "btn-collapse",
596
+ attrs: {
597
+ type: "text",
598
+ size: _vm.defaultSize,
599
+ },
600
+ on: { click: _vm.handleCollapse },
601
+ },
602
+ [
603
+ _vm._v(
604
+ "\n " +
605
+ _vm._s(
606
+ _vm.collapsed
607
+ ? _vm.t(
608
+ "elProComponents.proTable.expand"
609
+ )
610
+ : _vm.t(
611
+ "elProComponents.proTable.collapse"
612
+ )
613
+ ) +
614
+ "\n "
615
+ ),
616
+ _c("ArrowIcon", {
617
+ staticStyle: { transition: "0.3s" },
618
+ style: {
619
+ transform: `rotate(${
620
+ _vm.collapsed ? 0 : 0.5
621
+ }turn)`,
622
+ },
623
+ }),
624
+ ],
625
+ 1
626
+ ),
627
+ ]
628
+ : _vm._e(),
629
+ ],
630
+ 2
631
+ ),
632
+ ],
633
+ 2
634
+ ),
635
+ ],
636
+ 1
637
+ ),
638
+ ]
639
+ : _vm._e(),
640
+ _vm.$slots.default || _vm.columnSettings
641
+ ? _c(
642
+ "div",
643
+ { staticClass: "pro-table__toolbar" },
644
+ [
645
+ _vm._t("default"),
646
+ _vm.columnSettings
647
+ ? _c(
648
+ "div",
649
+ { staticClass: "pro-table__toolbar-items" },
650
+ [
651
+ _c("ColumnSettings", {
652
+ attrs: {
653
+ columns: _vm.settingColumns,
654
+ columnSettings: _vm.initializedColumnSettings,
655
+ },
656
+ }),
657
+ ],
658
+ 1
659
+ )
660
+ : _vm._e(),
661
+ ],
662
+ 2
663
+ )
664
+ : _vm._e(),
665
+ _c(
666
+ "el-table",
667
+ _vm._g(
668
+ _vm._b(
669
+ {
670
+ directives: [
671
+ {
672
+ name: "loading",
673
+ rawName: "v-loading",
674
+ value: _vm.loading,
675
+ expression: "loading",
676
+ },
677
+ ],
678
+ key: _vm.tableKey,
679
+ ref: "tableRef",
680
+ staticClass: "pro-table__table",
681
+ class: _vm.className,
682
+ attrs: { data: _vm.dataSource },
683
+ },
684
+ "el-table",
685
+ _vm.initializedTableProps,
686
+ false
687
+ ),
688
+ _vm.initializedTableEvents
689
+ ),
690
+ _vm._l(_vm.normalizedColumns, function (column) {
691
+ return _c(
692
+ "el-table-column",
693
+ _vm._b(
694
+ {
695
+ key:
696
+ column.prop ||
697
+ column.nonElColumnProps.key ||
698
+ `${column.type}-col`,
699
+ scopedSlots: _vm._u(
700
+ [
701
+ column.nonElColumnProps.renderCellHeader
702
+ ? {
703
+ key: "header",
704
+ fn: function (scope) {
705
+ return [
706
+ _c("CustomRender", {
707
+ attrs: {
708
+ render: () =>
709
+ column.nonElColumnProps.renderCellHeader(
710
+ scope
711
+ ),
712
+ },
713
+ }),
714
+ ]
715
+ },
716
+ }
717
+ : null,
718
+ column.nonElColumnProps.renderCell
719
+ ? {
720
+ key: "default",
721
+ fn: function (scope) {
722
+ return [
723
+ _c("CustomRender", {
724
+ attrs: {
725
+ render: () =>
726
+ column.nonElColumnProps.renderCell(scope),
727
+ },
728
+ }),
729
+ ]
730
+ },
731
+ }
732
+ : column.nonElColumnProps.valueEnum
733
+ ? {
734
+ key: "default",
735
+ fn: function (scope) {
736
+ return [
737
+ _c("span", [
738
+ _vm._v(
739
+ "\n " +
740
+ _vm._s(_vm.getOptionLabel(column, scope)) +
741
+ "\n "
742
+ ),
743
+ ]),
744
+ ]
745
+ },
746
+ }
747
+ : null,
748
+ ],
749
+ null,
750
+ true
751
+ ),
752
+ },
753
+ "el-table-column",
754
+ {
755
+ ...column,
756
+ nonElColumnProps: undefined,
757
+ },
758
+ false
759
+ )
760
+ )
761
+ }),
762
+ 1
763
+ ),
764
+ _c(
765
+ "el-pagination",
766
+ _vm._b(
767
+ {
768
+ staticClass: "pro-table__pagination",
769
+ on: {
770
+ "current-change": _vm.handleCurrentChange,
771
+ "size-change": _vm.handleSizeChange,
772
+ },
773
+ },
774
+ "el-pagination",
775
+ _vm.initializedPaginationProps,
776
+ false
777
+ )
778
+ ),
779
+ ],
780
+ 2
781
+ )
782
+ }
783
+ var staticRenderFns = []
784
+ render._withStripped = true
785
+
786
+
787
+ // CONCATENATED MODULE: ./packages/pro-table/src/index.vue?vue&type=template&id=0d0329af&scoped=true
788
+
789
+ // EXTERNAL MODULE: external "element-ui-pro-components/lib/utils/form"
790
+ var form_ = __webpack_require__(3);
791
+
792
+ // EXTERNAL MODULE: external "element-ui-pro-components/lib/utils/breakpoints"
793
+ var breakpoints_ = __webpack_require__(5);
794
+
795
+ // EXTERNAL MODULE: external "element-ui-pro-components/lib/utils/debounce"
796
+ var debounce_ = __webpack_require__(7);
797
+
798
+ // EXTERNAL MODULE: ./src/components/pro-form-item/index.vue + 4 modules
799
+ var pro_form_item = __webpack_require__(4);
800
+
801
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/pro-table/src/components/svg/ArrowIcon.vue?vue&type=template&id=03c6aa2a&scoped=true
802
+ var ArrowIconvue_type_template_id_03c6aa2a_scoped_true_render = function render() {
803
+ var _vm = this,
804
+ _c = _vm._self._c
805
+ return _c(
806
+ "svg",
807
+ {
808
+ attrs: {
809
+ viewBox: "64 64 896 896",
810
+ focusable: "false",
811
+ "data-icon": "down",
812
+ width: "1em",
813
+ height: "1em",
814
+ fill: "currentColor",
815
+ "aria-hidden": "true",
816
+ xmlns: "http://www.w3.org/2000/svg",
817
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
818
+ },
819
+ },
820
+ [
821
+ _c("path", {
822
+ attrs: {
823
+ d: "M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z",
824
+ },
825
+ }),
826
+ ]
827
+ )
828
+ }
829
+ var ArrowIconvue_type_template_id_03c6aa2a_scoped_true_staticRenderFns = []
830
+ ArrowIconvue_type_template_id_03c6aa2a_scoped_true_render._withStripped = true
831
+
832
+
833
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/svg/ArrowIcon.vue?vue&type=template&id=03c6aa2a&scoped=true
834
+
835
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/pro-table/src/components/svg/ArrowIcon.vue?vue&type=script&lang=js
836
+ /* harmony default export */ var ArrowIconvue_type_script_lang_js = ({
837
+ name: 'ArrowIcon'
838
+ });
839
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/svg/ArrowIcon.vue?vue&type=script&lang=js
840
+ /* harmony default export */ var svg_ArrowIconvue_type_script_lang_js = (ArrowIconvue_type_script_lang_js);
841
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
842
+ var componentNormalizer = __webpack_require__(0);
843
+
844
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/svg/ArrowIcon.vue
845
+
846
+
847
+
848
+
849
+
850
+ /* normalize component */
851
+
852
+ var component = Object(componentNormalizer["a" /* default */])(
853
+ svg_ArrowIconvue_type_script_lang_js,
854
+ ArrowIconvue_type_template_id_03c6aa2a_scoped_true_render,
855
+ ArrowIconvue_type_template_id_03c6aa2a_scoped_true_staticRenderFns,
856
+ false,
857
+ null,
858
+ "03c6aa2a",
859
+ null
860
+
861
+ )
862
+
863
+ /* harmony default export */ var ArrowIcon = (component.exports);
864
+ // EXTERNAL MODULE: ./src/components/custom-render/index.vue + 2 modules
865
+ var custom_render = __webpack_require__(2);
866
+
867
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/pro-table/src/components/ColumnSettings.vue?vue&type=template&id=1789e606&scoped=true
868
+ var ColumnSettingsvue_type_template_id_1789e606_scoped_true_render = function render() {
869
+ var _vm = this,
870
+ _c = _vm._self._c
871
+ return _c(
872
+ "el-popover",
873
+ {
874
+ attrs: {
875
+ "popper-class": "column-settings-popover",
876
+ placement: "bottom-end",
877
+ trigger: "click",
878
+ },
879
+ },
880
+ [
881
+ _c(
882
+ "div",
883
+ {
884
+ staticClass: "pro-table__toolbar-item",
885
+ attrs: { slot: "reference" },
886
+ slot: "reference",
887
+ },
888
+ [
889
+ _c(
890
+ "el-tooltip",
891
+ {
892
+ attrs: {
893
+ content: _vm.columnSettings.columnSetting,
894
+ placement: "top",
895
+ },
896
+ },
897
+ [_c("SettingIcon")],
898
+ 1
899
+ ),
900
+ ],
901
+ 1
902
+ ),
903
+ _c(
904
+ "div",
905
+ { staticClass: "popover-header" },
906
+ [
907
+ _vm.columnSettings.checkable
908
+ ? _c(
909
+ "el-checkbox",
910
+ {
911
+ attrs: {
912
+ value: _vm.checkAll,
913
+ indeterminate: _vm.isIndeterminate,
914
+ },
915
+ on: { change: _vm.handleChange },
916
+ },
917
+ [
918
+ _vm._v(
919
+ "\n " +
920
+ _vm._s(_vm.columnSettings.columnDisplay) +
921
+ "\n "
922
+ ),
923
+ ]
924
+ )
925
+ : _c("span", { staticClass: "column-display" }, [
926
+ _vm._v(_vm._s(_vm.columnSettings.columnDisplay)),
927
+ ]),
928
+ _c(
929
+ "a",
930
+ {
931
+ staticClass: "btn-reset",
932
+ attrs: { type: "text" },
933
+ on: { click: _vm.handleReset },
934
+ },
935
+ [_vm._v(_vm._s(_vm.columnSettings.resetText))]
936
+ ),
937
+ ],
938
+ 1
939
+ ),
940
+ _c(
941
+ "div",
942
+ { staticClass: "popover-content" },
943
+ [
944
+ _c("ColumnSettingsItem", {
945
+ attrs: {
946
+ columns: _vm.leftFixedColumns,
947
+ columnSettings: _vm.columnSettings,
948
+ },
949
+ }),
950
+ _c("ColumnSettingsItem", {
951
+ attrs: {
952
+ columns: _vm.noFixedColumns,
953
+ columnSettings: _vm.columnSettings,
954
+ },
955
+ }),
956
+ _c("ColumnSettingsItem", {
957
+ attrs: {
958
+ columns: _vm.rightFixedColumns,
959
+ columnSettings: _vm.columnSettings,
960
+ },
961
+ }),
962
+ ],
963
+ 1
964
+ ),
965
+ ]
966
+ )
967
+ }
968
+ var ColumnSettingsvue_type_template_id_1789e606_scoped_true_staticRenderFns = []
969
+ ColumnSettingsvue_type_template_id_1789e606_scoped_true_render._withStripped = true
970
+
971
+
972
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/ColumnSettings.vue?vue&type=template&id=1789e606&scoped=true
973
+
974
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/pro-table/src/components/svg/SettingIcon.vue?vue&type=template&id=5f121054&scoped=true
975
+ var SettingIconvue_type_template_id_5f121054_scoped_true_render = function render() {
976
+ var _vm = this,
977
+ _c = _vm._self._c
978
+ return _c(
979
+ "svg",
980
+ {
981
+ staticClass: "icon",
982
+ attrs: {
983
+ t: "1768525838046",
984
+ viewBox: "0 0 1024 1024",
985
+ version: "1.1",
986
+ xmlns: "http://www.w3.org/2000/svg",
987
+ "p-id": "10889",
988
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
989
+ width: "1em",
990
+ height: "1em",
991
+ fill: "currentColor",
992
+ },
993
+ },
994
+ [
995
+ _c("path", {
996
+ attrs: {
997
+ d: "M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56c10.1-8.6 13.8-22.6 9.3-35.2l-0.9-2.6c-18.1-50.5-44.9-96.9-79.7-137.9l-1.8-2.1c-8.6-10.1-22.5-13.9-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85c-2.4-13.1-12.7-23.3-25.8-25.7l-2.7-0.5c-52.1-9.4-106.9-9.4-159 0l-2.7 0.5c-13.1 2.4-23.4 12.6-25.8 25.7l-15.8 85.4c-35.9 13.6-69.2 32.9-99 57.4l-81.9-29.1c-12.5-4.4-26.5-0.7-35.1 9.5l-1.8 2.1c-34.8 41.1-61.6 87.5-79.7 137.9l-0.9 2.6c-4.5 12.5-0.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5c-10.1 8.6-13.8 22.6-9.3 35.2l0.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1c8.6 10.1 22.5 13.9 35.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4c2.4 13.1 12.7 23.3 25.8 25.7l2.7 0.5c26.1 4.7 52.8 7.1 79.5 7.1 26.7 0 53.5-2.4 79.5-7.1l2.7-0.5c13.1-2.4 23.4-12.6 25.8-25.7l15.7-85c36.2-13.6 69.7-32.9 99.7-57.6l81.3 28.9c12.5 4.4 26.5 0.7 35.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l0.9-2.6c4.5-12.3 0.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9c-11.3 26.1-25.6 50.7-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97c-28.1 3.2-56.8 3.2-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9z",
998
+ "p-id": "10890",
999
+ },
1000
+ }),
1001
+ _c("path", {
1002
+ attrs: {
1003
+ d: "M512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176z m79.2 255.2C570 602.3 541.9 614 512 614c-29.9 0-58-11.7-79.2-32.8C411.7 560 400 531.9 400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8C612.3 444 624 472.1 624 502c0 29.9-11.7 58-32.8 79.2z",
1004
+ "p-id": "10891",
1005
+ },
1006
+ }),
1007
+ ]
1008
+ )
1009
+ }
1010
+ var SettingIconvue_type_template_id_5f121054_scoped_true_staticRenderFns = []
1011
+ SettingIconvue_type_template_id_5f121054_scoped_true_render._withStripped = true
1012
+
1013
+
1014
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/svg/SettingIcon.vue?vue&type=template&id=5f121054&scoped=true
1015
+
1016
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/pro-table/src/components/svg/SettingIcon.vue?vue&type=script&lang=js
1017
+ /* harmony default export */ var SettingIconvue_type_script_lang_js = ({
1018
+ name: 'SettingIcon'
1019
+ });
1020
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/svg/SettingIcon.vue?vue&type=script&lang=js
1021
+ /* harmony default export */ var svg_SettingIconvue_type_script_lang_js = (SettingIconvue_type_script_lang_js);
1022
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/svg/SettingIcon.vue
1023
+
1024
+
1025
+
1026
+
1027
+
1028
+ /* normalize component */
1029
+
1030
+ var SettingIcon_component = Object(componentNormalizer["a" /* default */])(
1031
+ svg_SettingIconvue_type_script_lang_js,
1032
+ SettingIconvue_type_template_id_5f121054_scoped_true_render,
1033
+ SettingIconvue_type_template_id_5f121054_scoped_true_staticRenderFns,
1034
+ false,
1035
+ null,
1036
+ "5f121054",
1037
+ null
1038
+
1039
+ )
1040
+
1041
+ /* harmony default export */ var SettingIcon = (SettingIcon_component.exports);
1042
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/pro-table/src/components/ColumnSettingsItem.vue?vue&type=template&id=754a43f6&scoped=true
1043
+ var ColumnSettingsItemvue_type_template_id_754a43f6_scoped_true_render = function render() {
1044
+ var _vm = this,
1045
+ _c = _vm._self._c
1046
+ return _vm.columns.length
1047
+ ? _c("div", { staticClass: "column-settings-item-list" }, [
1048
+ _c("div", { staticClass: "title" }, [_vm._v(_vm._s(_vm.title))]),
1049
+ _c(
1050
+ "div",
1051
+ { ref: "dragDropZoneRef", staticClass: "drag-drop-zone" },
1052
+ _vm._l(_vm.columns, function (column, index) {
1053
+ return _c(
1054
+ "div",
1055
+ {
1056
+ key: column.prop,
1057
+ staticClass: "column-settings-item",
1058
+ class: {
1059
+ draggable: _vm.draggable,
1060
+ dragging: _vm.dragIndex === index,
1061
+ },
1062
+ attrs: { draggable: _vm.draggable },
1063
+ on: {
1064
+ dragstart: (e) => _vm.onDragstart(e, index),
1065
+ dragenter: function ($event) {
1066
+ $event.preventDefault()
1067
+ return _vm.onDragenter.apply(null, arguments)
1068
+ },
1069
+ dragover: function ($event) {
1070
+ $event.preventDefault()
1071
+ return ((e) => _vm.onDragover(e, index)).apply(
1072
+ null,
1073
+ arguments
1074
+ )
1075
+ },
1076
+ dragleave: _vm.onDragleave,
1077
+ drop: (e) => _vm.onDrop(e, index),
1078
+ dragend: _vm.onDragend,
1079
+ },
1080
+ },
1081
+ [
1082
+ _vm.draggable
1083
+ ? _c(
1084
+ "span",
1085
+ { staticClass: "icon icon-holder" },
1086
+ [_c("HolderIcon")],
1087
+ 1
1088
+ )
1089
+ : _vm._e(),
1090
+ _c("span", { staticClass: "switcher" }),
1091
+ _c(
1092
+ _vm.dynamicComponent,
1093
+ _vm._g(
1094
+ _vm._b(
1095
+ { tag: "component" },
1096
+ "component",
1097
+ _vm.dynamicComponent === "el-checkbox"
1098
+ ? { value: column.checkable, disabled: column.disabled }
1099
+ : { class: "text-wrapper" },
1100
+ false
1101
+ ),
1102
+ _vm.dynamicComponent === "el-checkbox"
1103
+ ? {
1104
+ change: (checked) =>
1105
+ _vm.handleChange(checked, column.prop),
1106
+ }
1107
+ : {}
1108
+ ),
1109
+ [
1110
+ _c("span", { staticClass: "label" }, [
1111
+ _vm._v(_vm._s(column.label)),
1112
+ ]),
1113
+ _c("ColumnAlignSettings", { attrs: { column: column } }),
1114
+ index === 0 && _vm.dropIndex === index
1115
+ ? _c("div", { staticClass: "indicator head-indicator" })
1116
+ : _vm.dropIndex === index + 1
1117
+ ? _c("div", { staticClass: "indicator tail-indicator" })
1118
+ : _vm._e(),
1119
+ ],
1120
+ 1
1121
+ ),
1122
+ ],
1123
+ 1
1124
+ )
1125
+ }),
1126
+ 0
1127
+ ),
1128
+ ])
1129
+ : _vm._e()
1130
+ }
1131
+ var ColumnSettingsItemvue_type_template_id_754a43f6_scoped_true_staticRenderFns = []
1132
+ ColumnSettingsItemvue_type_template_id_754a43f6_scoped_true_render._withStripped = true
1133
+
1134
+
1135
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/ColumnSettingsItem.vue?vue&type=template&id=754a43f6&scoped=true
1136
+
1137
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/pro-table/src/components/svg/HolderIcon.vue?vue&type=template&id=4567deaf&scoped=true
1138
+ var HolderIconvue_type_template_id_4567deaf_scoped_true_render = function render() {
1139
+ var _vm = this,
1140
+ _c = _vm._self._c
1141
+ return _c(
1142
+ "svg",
1143
+ {
1144
+ staticClass: "icon",
1145
+ attrs: {
1146
+ t: "1768466031154",
1147
+ viewBox: "0 0 1024 1024",
1148
+ version: "1.1",
1149
+ xmlns: "http://www.w3.org/2000/svg",
1150
+ "p-id": "4754",
1151
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
1152
+ width: "1em",
1153
+ height: "1em",
1154
+ fill: "currentColor",
1155
+ },
1156
+ },
1157
+ [
1158
+ _c("path", {
1159
+ attrs: {
1160
+ d: "M300 276.497a56 56 0 1 0 56-96.994 56 56 0 0 0-56 96.994z m0 284a56 56 0 1 0 56-96.994 56 56 0 0 0-56 96.994zM640 228a56 56 0 1 0 112 0 56 56 0 0 0-112 0z m0 284a56 56 0 1 0 112 0 56 56 0 0 0-112 0zM300 844.497a56 56 0 1 0 56-96.994 56 56 0 0 0-56 96.994zM640 796a56 56 0 1 0 112 0 56 56 0 0 0-112 0z",
1161
+ "p-id": "4755",
1162
+ },
1163
+ }),
1164
+ ]
1165
+ )
1166
+ }
1167
+ var HolderIconvue_type_template_id_4567deaf_scoped_true_staticRenderFns = []
1168
+ HolderIconvue_type_template_id_4567deaf_scoped_true_render._withStripped = true
1169
+
1170
+
1171
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/svg/HolderIcon.vue?vue&type=template&id=4567deaf&scoped=true
1172
+
1173
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/pro-table/src/components/svg/HolderIcon.vue?vue&type=script&lang=js
1174
+ /* harmony default export */ var HolderIconvue_type_script_lang_js = ({
1175
+ name: 'HolderIcon'
1176
+ });
1177
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/svg/HolderIcon.vue?vue&type=script&lang=js
1178
+ /* harmony default export */ var svg_HolderIconvue_type_script_lang_js = (HolderIconvue_type_script_lang_js);
1179
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/svg/HolderIcon.vue
1180
+
1181
+
1182
+
1183
+
1184
+
1185
+ /* normalize component */
1186
+
1187
+ var HolderIcon_component = Object(componentNormalizer["a" /* default */])(
1188
+ svg_HolderIconvue_type_script_lang_js,
1189
+ HolderIconvue_type_template_id_4567deaf_scoped_true_render,
1190
+ HolderIconvue_type_template_id_4567deaf_scoped_true_staticRenderFns,
1191
+ false,
1192
+ null,
1193
+ "4567deaf",
1194
+ null
1195
+
1196
+ )
1197
+
1198
+ /* harmony default export */ var HolderIcon = (HolderIcon_component.exports);
1199
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/pro-table/src/components/ColumnAlignSettings.vue?vue&type=template&id=5f8a700e&scoped=true
1200
+ var ColumnAlignSettingsvue_type_template_id_5f8a700e_scoped_true_render = function render() {
1201
+ var _vm = this,
1202
+ _c = _vm._self._c
1203
+ return _c(
1204
+ "span",
1205
+ { staticClass: "icon-algin-group" },
1206
+ [
1207
+ _vm.column.fixed !== "left"
1208
+ ? [
1209
+ _c(
1210
+ "el-tooltip",
1211
+ {
1212
+ attrs: {
1213
+ content: _vm.t("elProComponents.tableToolBar.leftPin"),
1214
+ placement: "top",
1215
+ },
1216
+ },
1217
+ [
1218
+ _c("VerticalAlignTopIcon", {
1219
+ nativeOn: {
1220
+ click: function ($event) {
1221
+ $event.stopPropagation()
1222
+ $event.preventDefault()
1223
+ return _vm.handleAlgin("left")
1224
+ },
1225
+ },
1226
+ }),
1227
+ ],
1228
+ 1
1229
+ ),
1230
+ ]
1231
+ : _vm._e(),
1232
+ _vm.column.fixed === "left" || _vm.column.fixed === "right"
1233
+ ? [
1234
+ _c(
1235
+ "el-tooltip",
1236
+ {
1237
+ attrs: {
1238
+ content: _vm.t("elProComponents.tableToolBar.noPin"),
1239
+ placement: "top",
1240
+ },
1241
+ },
1242
+ [
1243
+ _c("VerticalAlginMiddleIcon", {
1244
+ nativeOn: {
1245
+ click: function ($event) {
1246
+ $event.stopPropagation()
1247
+ $event.preventDefault()
1248
+ return _vm.handleAlgin()
1249
+ },
1250
+ },
1251
+ }),
1252
+ ],
1253
+ 1
1254
+ ),
1255
+ ]
1256
+ : _vm._e(),
1257
+ _vm.column.fixed !== "right"
1258
+ ? [
1259
+ _c(
1260
+ "el-tooltip",
1261
+ {
1262
+ attrs: {
1263
+ content: _vm.t("elProComponents.tableToolBar.rightPin"),
1264
+ placement: "top",
1265
+ },
1266
+ },
1267
+ [
1268
+ _c("VerticalAlginBottomIcon", {
1269
+ nativeOn: {
1270
+ click: function ($event) {
1271
+ $event.stopPropagation()
1272
+ $event.preventDefault()
1273
+ return _vm.handleAlgin("right")
1274
+ },
1275
+ },
1276
+ }),
1277
+ ],
1278
+ 1
1279
+ ),
1280
+ ]
1281
+ : _vm._e(),
1282
+ ],
1283
+ 2
1284
+ )
1285
+ }
1286
+ var ColumnAlignSettingsvue_type_template_id_5f8a700e_scoped_true_staticRenderFns = []
1287
+ ColumnAlignSettingsvue_type_template_id_5f8a700e_scoped_true_render._withStripped = true
1288
+
1289
+
1290
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/ColumnAlignSettings.vue?vue&type=template&id=5f8a700e&scoped=true
1291
+
1292
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/pro-table/src/components/svg/VerticalAlignTopIcon.vue?vue&type=template&id=157c15ff&scoped=true
1293
+ var VerticalAlignTopIconvue_type_template_id_157c15ff_scoped_true_render = function render() {
1294
+ var _vm = this,
1295
+ _c = _vm._self._c
1296
+ return _c(
1297
+ "svg",
1298
+ {
1299
+ staticClass: "icon",
1300
+ attrs: {
1301
+ t: "1768466090113",
1302
+ viewBox: "0 0 1024 1024",
1303
+ version: "1.1",
1304
+ xmlns: "http://www.w3.org/2000/svg",
1305
+ "p-id": "5827",
1306
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
1307
+ width: "1em",
1308
+ height: "1em",
1309
+ },
1310
+ },
1311
+ [
1312
+ _c("path", {
1313
+ attrs: {
1314
+ d: "M955.968 100.864v66.944h-864V100.864h864zM528.064 215.616l150.784 150.784H565.76V928H490.24l0.128-561.6H377.216L528 215.68z",
1315
+ fill: "currentColor",
1316
+ "p-id": "5828",
1317
+ },
1318
+ }),
1319
+ ]
1320
+ )
1321
+ }
1322
+ var VerticalAlignTopIconvue_type_template_id_157c15ff_scoped_true_staticRenderFns = []
1323
+ VerticalAlignTopIconvue_type_template_id_157c15ff_scoped_true_render._withStripped = true
1324
+
1325
+
1326
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/svg/VerticalAlignTopIcon.vue?vue&type=template&id=157c15ff&scoped=true
1327
+
1328
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/pro-table/src/components/svg/VerticalAlignTopIcon.vue?vue&type=script&lang=js
1329
+ /* harmony default export */ var VerticalAlignTopIconvue_type_script_lang_js = ({
1330
+ name: 'VerticalAlignTopIcon'
1331
+ });
1332
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/svg/VerticalAlignTopIcon.vue?vue&type=script&lang=js
1333
+ /* harmony default export */ var svg_VerticalAlignTopIconvue_type_script_lang_js = (VerticalAlignTopIconvue_type_script_lang_js);
1334
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/svg/VerticalAlignTopIcon.vue
1335
+
1336
+
1337
+
1338
+
1339
+
1340
+ /* normalize component */
1341
+
1342
+ var VerticalAlignTopIcon_component = Object(componentNormalizer["a" /* default */])(
1343
+ svg_VerticalAlignTopIconvue_type_script_lang_js,
1344
+ VerticalAlignTopIconvue_type_template_id_157c15ff_scoped_true_render,
1345
+ VerticalAlignTopIconvue_type_template_id_157c15ff_scoped_true_staticRenderFns,
1346
+ false,
1347
+ null,
1348
+ "157c15ff",
1349
+ null
1350
+
1351
+ )
1352
+
1353
+ /* harmony default export */ var VerticalAlignTopIcon = (VerticalAlignTopIcon_component.exports);
1354
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/pro-table/src/components/svg/VerticalAlginBottomIcon.vue?vue&type=template&id=5f3f60a5&scoped=true
1355
+ var VerticalAlginBottomIconvue_type_template_id_5f3f60a5_scoped_true_render = function render() {
1356
+ var _vm = this,
1357
+ _c = _vm._self._c
1358
+ return _c(
1359
+ "svg",
1360
+ {
1361
+ staticClass: "icon",
1362
+ attrs: {
1363
+ t: "1768466105119",
1364
+ viewBox: "0 0 1024 1024",
1365
+ version: "1.1",
1366
+ xmlns: "http://www.w3.org/2000/svg",
1367
+ "p-id": "6880",
1368
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
1369
+ width: "1em",
1370
+ height: "1em",
1371
+ },
1372
+ },
1373
+ [
1374
+ _c("path", {
1375
+ attrs: {
1376
+ d: "M955.968 928v-66.944h-864V928h864z m-427.904-114.752l150.784-150.784H565.76V100.864H490.24l0.128 561.6H377.216l150.848 150.784z",
1377
+ fill: "currentColor",
1378
+ "p-id": "6881",
1379
+ },
1380
+ }),
1381
+ ]
1382
+ )
1383
+ }
1384
+ var VerticalAlginBottomIconvue_type_template_id_5f3f60a5_scoped_true_staticRenderFns = []
1385
+ VerticalAlginBottomIconvue_type_template_id_5f3f60a5_scoped_true_render._withStripped = true
1386
+
1387
+
1388
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/svg/VerticalAlginBottomIcon.vue?vue&type=template&id=5f3f60a5&scoped=true
1389
+
1390
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/pro-table/src/components/svg/VerticalAlginBottomIcon.vue?vue&type=script&lang=js
1391
+ /* harmony default export */ var VerticalAlginBottomIconvue_type_script_lang_js = ({
1392
+ name: 'VerticalAlignBottomIcon'
1393
+ });
1394
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/svg/VerticalAlginBottomIcon.vue?vue&type=script&lang=js
1395
+ /* harmony default export */ var svg_VerticalAlginBottomIconvue_type_script_lang_js = (VerticalAlginBottomIconvue_type_script_lang_js);
1396
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/svg/VerticalAlginBottomIcon.vue
1397
+
1398
+
1399
+
1400
+
1401
+
1402
+ /* normalize component */
1403
+
1404
+ var VerticalAlginBottomIcon_component = Object(componentNormalizer["a" /* default */])(
1405
+ svg_VerticalAlginBottomIconvue_type_script_lang_js,
1406
+ VerticalAlginBottomIconvue_type_template_id_5f3f60a5_scoped_true_render,
1407
+ VerticalAlginBottomIconvue_type_template_id_5f3f60a5_scoped_true_staticRenderFns,
1408
+ false,
1409
+ null,
1410
+ "5f3f60a5",
1411
+ null
1412
+
1413
+ )
1414
+
1415
+ /* harmony default export */ var VerticalAlginBottomIcon = (VerticalAlginBottomIcon_component.exports);
1416
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/pro-table/src/components/svg/VerticalAlginMiddleIcon.vue?vue&type=template&id=5047af18&scoped=true
1417
+ var VerticalAlginMiddleIconvue_type_template_id_5047af18_scoped_true_render = function render() {
1418
+ var _vm = this,
1419
+ _c = _vm._self._c
1420
+ return _c(
1421
+ "svg",
1422
+ {
1423
+ staticClass: "icon",
1424
+ attrs: {
1425
+ t: "1768466311335",
1426
+ viewBox: "0 0 1024 1024",
1427
+ version: "1.1",
1428
+ xmlns: "http://www.w3.org/2000/svg",
1429
+ "p-id": "9722",
1430
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
1431
+ width: "1em",
1432
+ height: "1em",
1433
+ fill: "currentColor",
1434
+ },
1435
+ },
1436
+ [
1437
+ _c("path", {
1438
+ attrs: {
1439
+ d: "M512 614.4l-153.6 153.6 102.4 0 0 204.8 102.4 0 0-204.8 102.4 0L512 614.4zM665.6 256l-102.4 0L563.2 51.2 460.8 51.2l0 204.8L358.4 256l153.6 153.6L665.6 256zM921.6 512c0-28.3136-2.4576-51.2-30.72-51.2L133.12 460.8C104.8576 460.8 102.4 483.6864 102.4 512c0 28.2112 2.4576 51.2 30.72 51.2L890.88 563.2C919.1424 563.2 921.6 540.2112 921.6 512z",
1440
+ "p-id": "9723",
1441
+ },
1442
+ }),
1443
+ ]
1444
+ )
1445
+ }
1446
+ var VerticalAlginMiddleIconvue_type_template_id_5047af18_scoped_true_staticRenderFns = []
1447
+ VerticalAlginMiddleIconvue_type_template_id_5047af18_scoped_true_render._withStripped = true
1448
+
1449
+
1450
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/svg/VerticalAlginMiddleIcon.vue?vue&type=template&id=5047af18&scoped=true
1451
+
1452
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/pro-table/src/components/svg/VerticalAlginMiddleIcon.vue?vue&type=script&lang=js
1453
+ /* harmony default export */ var VerticalAlginMiddleIconvue_type_script_lang_js = ({
1454
+ name: 'VerticalAlignMiddleIcon'
1455
+ });
1456
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/svg/VerticalAlginMiddleIcon.vue?vue&type=script&lang=js
1457
+ /* harmony default export */ var svg_VerticalAlginMiddleIconvue_type_script_lang_js = (VerticalAlginMiddleIconvue_type_script_lang_js);
1458
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/svg/VerticalAlginMiddleIcon.vue
1459
+
1460
+
1461
+
1462
+
1463
+
1464
+ /* normalize component */
1465
+
1466
+ var VerticalAlginMiddleIcon_component = Object(componentNormalizer["a" /* default */])(
1467
+ svg_VerticalAlginMiddleIconvue_type_script_lang_js,
1468
+ VerticalAlginMiddleIconvue_type_template_id_5047af18_scoped_true_render,
1469
+ VerticalAlginMiddleIconvue_type_template_id_5047af18_scoped_true_staticRenderFns,
1470
+ false,
1471
+ null,
1472
+ "5047af18",
1473
+ null
1474
+
1475
+ )
1476
+
1477
+ /* harmony default export */ var VerticalAlginMiddleIcon = (VerticalAlginMiddleIcon_component.exports);
1478
+ // EXTERNAL MODULE: external "element-ui-pro-components/lib/locale"
1479
+ var locale_ = __webpack_require__(1);
1480
+
1481
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/pro-table/src/components/ColumnAlignSettings.vue?vue&type=script&lang=js
1482
+
1483
+
1484
+
1485
+
1486
+ /* harmony default export */ var ColumnAlignSettingsvue_type_script_lang_js = ({
1487
+ name: "ColumnAlginSettings",
1488
+ inject: ["onColumnSettingsChange"],
1489
+ components: {
1490
+ VerticalAlignTopIcon: VerticalAlignTopIcon,
1491
+ VerticalAlginMiddleIcon: VerticalAlginMiddleIcon,
1492
+ VerticalAlginBottomIcon: VerticalAlginBottomIcon
1493
+ },
1494
+ props: {
1495
+ // 单个列表项
1496
+ column: {
1497
+ type: Object,
1498
+ default: () => ({})
1499
+ }
1500
+ },
1501
+ methods: {
1502
+ /**
1503
+ * @desc 支持国际化
1504
+ * @param key
1505
+ */
1506
+ t(key) {
1507
+ return Object(locale_["t"])(key);
1508
+ },
1509
+ /**
1510
+ * @desc 监听修改
1511
+ * @param {string | undefined} fixed 固定位置
1512
+ */
1513
+ handleAlgin(fixed) {
1514
+ const {
1515
+ prop
1516
+ } = this.column;
1517
+ // ProTable provide 提供
1518
+ this.onColumnSettingsChange({
1519
+ event: "align",
1520
+ prop,
1521
+ fixed
1522
+ });
1523
+ }
1524
+ }
1525
+ });
1526
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/ColumnAlignSettings.vue?vue&type=script&lang=js
1527
+ /* harmony default export */ var components_ColumnAlignSettingsvue_type_script_lang_js = (ColumnAlignSettingsvue_type_script_lang_js);
1528
+ // CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/less-loader/dist/cjs.js!./node_modules/vue-loader/lib??vue-loader-options!./packages/pro-table/src/components/ColumnAlignSettings.vue?vue&type=style&index=0&id=5f8a700e&prod&scoped=true&lang=css
1529
+ // extracted by mini-css-extract-plugin
1530
+
1531
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/ColumnAlignSettings.vue?vue&type=style&index=0&id=5f8a700e&prod&scoped=true&lang=css
1532
+
1533
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/ColumnAlignSettings.vue
1534
+
1535
+
1536
+
1537
+
1538
+
1539
+
1540
+ /* normalize component */
1541
+
1542
+ var ColumnAlignSettings_component = Object(componentNormalizer["a" /* default */])(
1543
+ components_ColumnAlignSettingsvue_type_script_lang_js,
1544
+ ColumnAlignSettingsvue_type_template_id_5f8a700e_scoped_true_render,
1545
+ ColumnAlignSettingsvue_type_template_id_5f8a700e_scoped_true_staticRenderFns,
1546
+ false,
1547
+ null,
1548
+ "5f8a700e",
1549
+ null
1550
+
1551
+ )
1552
+
1553
+ /* harmony default export */ var ColumnAlignSettings = (ColumnAlignSettings_component.exports);
1554
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/pro-table/src/components/ColumnSettingsItem.vue?vue&type=script&lang=js
1555
+
1556
+
1557
+
1558
+ /* harmony default export */ var ColumnSettingsItemvue_type_script_lang_js = ({
1559
+ name: 'ColumnSettingsItem',
1560
+ components: {
1561
+ HolderIcon: HolderIcon,
1562
+ ColumnAlignSettings: ColumnAlignSettings
1563
+ },
1564
+ inject: ["onColumnSettingsChange"],
1565
+ props: {
1566
+ // 列表项
1567
+ columns: {
1568
+ type: Array,
1569
+ required: true,
1570
+ default: () => []
1571
+ },
1572
+ // 列设置
1573
+ columnSettings: {
1574
+ type: Object
1575
+ }
1576
+ },
1577
+ computed: {
1578
+ // 列类型
1579
+ title() {
1580
+ const {
1581
+ columns
1582
+ } = this;
1583
+ if (Array.isArray(columns) && columns.length) {
1584
+ const fixed = columns[0].fixed;
1585
+ return fixed === "left" ? Object(locale_["t"])('elProComponents.tableToolBar.leftFixedTitle') : fixed === "right" ? Object(locale_["t"])('elProComponents.tableToolBar.rightFixedTitle') : Object(locale_["t"])('elProComponents.tableToolBar.noFixedTitle');
1586
+ }
1587
+ return "";
1588
+ },
1589
+ // 是否支持拖动
1590
+ draggable() {
1591
+ var _this$columns;
1592
+ return this.columnSettings.draggable && ((_this$columns = this.columns) === null || _this$columns === void 0 ? void 0 : _this$columns.length) > 1;
1593
+ },
1594
+ // 动态组件
1595
+ dynamicComponent() {
1596
+ return this.columnSettings.checkable ? 'el-checkbox' : 'span';
1597
+ }
1598
+ },
1599
+ data() {
1600
+ return {
1601
+ dragIndex: -1,
1602
+ // 开始拖动目标的下标
1603
+ dropIndex: -1 // 可释放目标的下标
1604
+ };
1605
+ },
1606
+ methods: {
1607
+ /**
1608
+ * @desc 监听修改
1609
+ * @param {Boolean} checked 状态
1610
+ * @param {String} prop 属性
1611
+ */
1612
+ handleChange(checked, prop) {
1613
+ // ProTable provide 提供
1614
+ this.onColumnSettingsChange({
1615
+ event: "check",
1616
+ checked,
1617
+ prop
1618
+ });
1619
+ },
1620
+ /**
1621
+ * @desc 获取光标位置
1622
+ * @param {Object} e
1623
+ * @returns {String} top | bottom
1624
+ */
1625
+ getCursorPos(e) {
1626
+ // 1. 获取元素的位置和尺寸
1627
+ const rect = e.target.getBoundingClientRect();
1628
+
1629
+ // 2. 获取鼠标相对于元素的位置
1630
+ const relativeY = e.clientY - rect.top;
1631
+
1632
+ // 3. 判断光标在释放目标位置的上半还是下半
1633
+ const cursorPos = relativeY < rect.height / 2 ? "top" : "bottom";
1634
+ return cursorPos;
1635
+ },
1636
+ /**
1637
+ * @desc 获取释放位置下标
1638
+ * @param {Object} e
1639
+ * @param {Number} dropIndex 释放目标的下标
1640
+ */
1641
+ getDropIndex(e, dropIndex) {
1642
+ // 获取光标位置
1643
+ const cursorPos = this.getCursorPos(e);
1644
+
1645
+ // 光标在释放目标位置上半 则在释放目标位置上方插入
1646
+ // 光标在释放目标位置下半 则在释放目标位置下方插入
1647
+ const targetDropIndex = cursorPos === 'top' ? dropIndex : dropIndex + 1;
1648
+
1649
+ // 当前拖拽的方向
1650
+ const dragDirection = this.dragIndex < dropIndex ? "down" : "up";
1651
+
1652
+ // 释放位置 = 开始拖拽位置
1653
+ if (targetDropIndex === this.dragIndex) {
1654
+ return -1;
1655
+ }
1656
+
1657
+ // 拖拽方向:down && 相邻 则说明位置不变
1658
+ const isNear = Math.abs(targetDropIndex - this.dragIndex) === 1;
1659
+ if (isNear && dragDirection === 'down') {
1660
+ return -1;
1661
+ }
1662
+ return targetDropIndex;
1663
+ },
1664
+ /**
1665
+ * @desc 开始拖动
1666
+ * @param {Object} e 拖拽元素对象
1667
+ * @param {Number} index 下标
1668
+ */
1669
+ onDragstart(e, index) {
1670
+ e.dataTransfer.effectAllowed = "move";
1671
+ e.dataTransfer.dropEffect = "move";
1672
+ this.dragIndex = index;
1673
+ },
1674
+ /**
1675
+ * @desc 拖入到释放目标
1676
+ * @param {Object} e 拖拽元素对象
1677
+ */
1678
+ onDragenter(e) {
1679
+ if (this.dragIndex === -1) {
1680
+ // 其它拖拽区域
1681
+ e.dataTransfer.dropEffect = 'none';
1682
+ } else {
1683
+ e.dataTransfer.dropEffect = 'move';
1684
+ }
1685
+ },
1686
+ /**
1687
+ * @desc 拖拽到释放目标上
1688
+ * @param {Object} e 释放目标对象
1689
+ * @param {Number} dropIndex 下标
1690
+ */
1691
+ onDragover(e, dropIndex) {
1692
+ // ***参数是在事件绑定时确定的 而不是在事件触发时***
1693
+
1694
+ // 如果拖动到其它列
1695
+ if (this.dragIndex < 0) {
1696
+ e.dataTransfer.dropEffect = 'none';
1697
+ return;
1698
+ }
1699
+
1700
+ // 释放目标是开始拖动目标 则退出
1701
+ if (this.dragIndex === dropIndex) {
1702
+ this.dropIndex = -1;
1703
+ return;
1704
+ }
1705
+
1706
+ // 获取释放位置下标
1707
+ this.dropIndex = this.getDropIndex(e, dropIndex);
1708
+ },
1709
+ /**
1710
+ * @desc 离开可释放目标
1711
+ */
1712
+ onDragleave(e) {
1713
+ const dragDropZoneRef = this.$refs.dragDropZoneRef;
1714
+ // 是否在列表区域内
1715
+ if (dragDropZoneRef.contains(e.relatedTarget)) {
1716
+ return;
1717
+ }
1718
+ this.dropIndex = -1;
1719
+ },
1720
+ /**
1721
+ * @desc 释放目标停止拖拽
1722
+ * @param {Object} e 释放目标对象
1723
+ * @param {Number} dropIndex 释放的下标
1724
+ */
1725
+ onDrop(e, dropIndex) {
1726
+ if (this.dragIndex === dropIndex) {
1727
+ this.dropIndex = -1;
1728
+ return;
1729
+ }
1730
+
1731
+ // 获取释放位置下标
1732
+ const index = this.getDropIndex(e, dropIndex);
1733
+ if (index > -1) {
1734
+ const {
1735
+ columns
1736
+ } = this;
1737
+ const fromProp = columns[this.dragIndex].prop;
1738
+ // 是否拖拽到最后一列
1739
+ const isAfter = index === this.columns.length;
1740
+ const toProp = isAfter ? columns[index - 1].prop : columns[index].prop;
1741
+ // ProTable provide 提供
1742
+ this.onColumnSettingsChange({
1743
+ event: 'drop',
1744
+ fromProp,
1745
+ toProp,
1746
+ isAfter
1747
+ });
1748
+ }
1749
+ },
1750
+ /**
1751
+ * @desc 结束拖拽
1752
+ */
1753
+ onDragend() {
1754
+ // 重置
1755
+ this.dragIndex = -1;
1756
+ this.dropIndex = -1;
1757
+ }
1758
+ }
1759
+ });
1760
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/ColumnSettingsItem.vue?vue&type=script&lang=js
1761
+ /* harmony default export */ var components_ColumnSettingsItemvue_type_script_lang_js = (ColumnSettingsItemvue_type_script_lang_js);
1762
+ // CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/less-loader/dist/cjs.js!./node_modules/vue-loader/lib??vue-loader-options!./packages/pro-table/src/components/ColumnSettingsItem.vue?vue&type=style&index=0&id=754a43f6&prod&lang=less&scoped=true
1763
+ // extracted by mini-css-extract-plugin
1764
+
1765
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/ColumnSettingsItem.vue?vue&type=style&index=0&id=754a43f6&prod&lang=less&scoped=true
1766
+
1767
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/ColumnSettingsItem.vue
1768
+
1769
+
1770
+
1771
+
1772
+
1773
+
1774
+ /* normalize component */
1775
+
1776
+ var ColumnSettingsItem_component = Object(componentNormalizer["a" /* default */])(
1777
+ components_ColumnSettingsItemvue_type_script_lang_js,
1778
+ ColumnSettingsItemvue_type_template_id_754a43f6_scoped_true_render,
1779
+ ColumnSettingsItemvue_type_template_id_754a43f6_scoped_true_staticRenderFns,
1780
+ false,
1781
+ null,
1782
+ "754a43f6",
1783
+ null
1784
+
1785
+ )
1786
+
1787
+ /* harmony default export */ var ColumnSettingsItem = (ColumnSettingsItem_component.exports);
1788
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/pro-table/src/components/ColumnSettings.vue?vue&type=script&lang=js
1789
+
1790
+
1791
+ /* harmony default export */ var ColumnSettingsvue_type_script_lang_js = ({
1792
+ name: 'ColumnSettings',
1793
+ components: {
1794
+ SettingIcon: SettingIcon,
1795
+ ColumnSettingsItem: ColumnSettingsItem
1796
+ },
1797
+ inject: ["onColumnSettingsChange"],
1798
+ props: {
1799
+ // 列表项
1800
+ columns: {
1801
+ type: Array,
1802
+ required: true
1803
+ },
1804
+ // 列设置
1805
+ columnSettings: {
1806
+ type: Object
1807
+ }
1808
+ },
1809
+ computed: {
1810
+ // 固定在左侧列
1811
+ leftFixedColumns() {
1812
+ return this.columns.filter(item => item.fixed === "left");
1813
+ },
1814
+ // 不固定列
1815
+ noFixedColumns() {
1816
+ return this.columns.filter(item => item.fixed !== "left" && item.fixed !== "right");
1817
+ },
1818
+ // 固定在右侧列
1819
+ rightFixedColumns() {
1820
+ return this.columns.filter(item => item.fixed === "right");
1821
+ },
1822
+ // 列展示勾选状态
1823
+ checkAll() {
1824
+ return this.columns.length === this.columns.filter(item => item.checkable).length;
1825
+ },
1826
+ // 表示 checkbox 的不确定状态
1827
+ isIndeterminate() {
1828
+ return !this.checkAll && this.columns.filter(item => !item.disabled && item.checkable).length > 0;
1829
+ }
1830
+ },
1831
+ data() {
1832
+ return {};
1833
+ },
1834
+ methods: {
1835
+ /**
1836
+ * @desc 监听修改
1837
+ * @param {Boolean} checked 状态
1838
+ */
1839
+ handleChange(checked) {
1840
+ // ProTable provide 提供
1841
+ this.onColumnSettingsChange({
1842
+ event: "checkAll",
1843
+ checked
1844
+ });
1845
+ },
1846
+ /**
1847
+ * @desc 重置
1848
+ */
1849
+ handleReset() {
1850
+ // ProTable provide 提供
1851
+ this.onColumnSettingsChange({
1852
+ event: "reset"
1853
+ });
1854
+ }
1855
+ }
1856
+ });
1857
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/ColumnSettings.vue?vue&type=script&lang=js
1858
+ /* harmony default export */ var components_ColumnSettingsvue_type_script_lang_js = (ColumnSettingsvue_type_script_lang_js);
1859
+ // CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/less-loader/dist/cjs.js!./node_modules/vue-loader/lib??vue-loader-options!./packages/pro-table/src/components/ColumnSettings.vue?vue&type=style&index=0&id=1789e606&prod&lang=less&scoped=true
1860
+ // extracted by mini-css-extract-plugin
1861
+
1862
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/ColumnSettings.vue?vue&type=style&index=0&id=1789e606&prod&lang=less&scoped=true
1863
+
1864
+ // CONCATENATED MODULE: ./packages/pro-table/src/components/ColumnSettings.vue
1865
+
1866
+
1867
+
1868
+
1869
+
1870
+
1871
+ /* normalize component */
1872
+
1873
+ var ColumnSettings_component = Object(componentNormalizer["a" /* default */])(
1874
+ components_ColumnSettingsvue_type_script_lang_js,
1875
+ ColumnSettingsvue_type_template_id_1789e606_scoped_true_render,
1876
+ ColumnSettingsvue_type_template_id_1789e606_scoped_true_staticRenderFns,
1877
+ false,
1878
+ null,
1879
+ "1789e606",
1880
+ null
1881
+
1882
+ )
1883
+
1884
+ /* harmony default export */ var ColumnSettings = (ColumnSettings_component.exports);
1885
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/pro-table/src/index.vue?vue&type=script&lang=js
1886
+
1887
+
1888
+
1889
+
1890
+
1891
+
1892
+
1893
+
1894
+ /* harmony default export */ var srcvue_type_script_lang_js = ({
1895
+ name: 'ProTable',
1896
+ components: {
1897
+ ProFormItem: pro_form_item["a" /* default */],
1898
+ CustomRender: custom_render["a" /* default */],
1899
+ ArrowIcon: ArrowIcon,
1900
+ ColumnSettings: ColumnSettings
1901
+ },
1902
+ provide() {
1903
+ if (!this.columnSettings) {
1904
+ return;
1905
+ }
1906
+ return {
1907
+ // 监听列设置修改
1908
+ onColumnSettingsChange: this.onColumnSettingsChange
1909
+ };
1910
+ },
1911
+ props: {
1912
+ // 搜索表单
1913
+ search: {
1914
+ type: [Boolean, Object],
1915
+ default: true
1916
+ },
1917
+ // el-table 的类名
1918
+ className: {
1919
+ type: String
1920
+ },
1921
+ // el-table 的数据
1922
+ dataSource: {
1923
+ type: Array
1924
+ },
1925
+ // 表格数据请求加载状态
1926
+ loading: {
1927
+ type: Boolean
1928
+ },
1929
+ // 数据总条数
1930
+ total: {
1931
+ type: Number,
1932
+ default: 0
1933
+ },
1934
+ // el-table attributes 的配置
1935
+ tableProps: {
1936
+ type: Object,
1937
+ default: () => ({})
1938
+ },
1939
+ // el-table events 的配置
1940
+ tableEvents: {
1941
+ type: Object,
1942
+ default: () => ({})
1943
+ },
1944
+ // 列定义
1945
+ columns: {
1946
+ type: Array,
1947
+ required: true,
1948
+ default: () => []
1949
+ },
1950
+ // el-pagination attributes 的配置
1951
+ paginationProps: {
1952
+ type: Object,
1953
+ default: () => ({})
1954
+ },
1955
+ // 分页参数字段映射配置
1956
+ paginationMapping: {
1957
+ type: Object,
1958
+ default: () => ({})
1959
+ },
1960
+ // 表单默认值
1961
+ initialValues: {
1962
+ type: Object,
1963
+ default: () => ({})
1964
+ },
1965
+ // 默认的 size
1966
+ defaultSize: {
1967
+ type: String,
1968
+ validator: function (value) {
1969
+ return ['medium', 'small', 'mini'].includes(value);
1970
+ }
1971
+ },
1972
+ // 是否需要手动触发首次请求
1973
+ manualRequest: {
1974
+ type: Boolean,
1975
+ default: false
1976
+ },
1977
+ // 列设置
1978
+ columnSettings: {
1979
+ type: [Boolean, Object],
1980
+ default: true
1981
+ }
1982
+ },
1983
+ computed: {
1984
+ // search 初始化
1985
+ searchProps() {
1986
+ const {
1987
+ search
1988
+ } = this;
1989
+ if (search) {
1990
+ const defaultSearch = {
1991
+ searchText: Object(locale_["t"])('elProComponents.proTable.search'),
1992
+ resetText: Object(locale_["t"])('elProComponents.proTable.reset'),
1993
+ labelWidth: "80px",
1994
+ rowProps: {
1995
+ gutter: 8
1996
+ },
1997
+ colProps: breakpoints_["defaultColConfig"],
1998
+ collapsed: true,
1999
+ // 默认收起
2000
+ defaultExpandedRows: 2
2001
+ };
2002
+ if (typeof search === "object") {
2003
+ var _ref, _search$collapsed;
2004
+ return {
2005
+ ...defaultSearch,
2006
+ ...this.search,
2007
+ collapsed: (_ref = (_search$collapsed = search.collapsed) !== null && _search$collapsed !== void 0 ? _search$collapsed : search.defaultCollapsed) !== null && _ref !== void 0 ? _ref : defaultSearch.collapsed
2008
+ };
2009
+ }
2010
+ return {
2011
+ ...defaultSearch
2012
+ };
2013
+ }
2014
+ return false;
2015
+ },
2016
+ // 表单项
2017
+ formItems() {
2018
+ const {
2019
+ columns
2020
+ } = this;
2021
+ return columns
2022
+ // 过滤 隐藏的 & 无表单类型的
2023
+ .filter(item => !item.hideInSearch && (!!item.valueType || item.renderField))
2024
+ // 权重大排序在前
2025
+ .sort((a, b) => b.order - a.order)
2026
+ // 筛选
2027
+ .map(col => {
2028
+ const {
2029
+ label,
2030
+ prop,
2031
+ formItemProps = {},
2032
+ renderLabel,
2033
+ valueType,
2034
+ renderField,
2035
+ fieldProps = {},
2036
+ fieldEvents,
2037
+ initialValue
2038
+ } = col;
2039
+ // 设置 el-form-item
2040
+ formItemProps.label = formItemProps.label || label;
2041
+ formItemProps.prop = formItemProps.prop || prop;
2042
+
2043
+ // 设置 placeholder
2044
+ Object(form_["setPlaceholder"])(fieldProps, valueType);
2045
+
2046
+ // 设置 select options
2047
+ Object(form_["setSelectOptions"])(col, this.cachedOptions);
2048
+
2049
+ // 设置 cascader options
2050
+ Object(form_["setCascaderOptions"])(fieldProps, col, this.cachedOptions);
2051
+ return {
2052
+ ...formItemProps,
2053
+ renderLabel,
2054
+ valueType,
2055
+ renderField,
2056
+ fieldProps,
2057
+ fieldEvents,
2058
+ options: col.options,
2059
+ initialValue
2060
+ };
2061
+ });
2062
+ },
2063
+ // 表单项总个数
2064
+ totalSearchCount() {
2065
+ return this.formItems.length;
2066
+ },
2067
+ // 标准化列定义配置
2068
+ normalizedColumns() {
2069
+ const {
2070
+ columns,
2071
+ initializedColumnSettings,
2072
+ columnSettingsRule
2073
+ } = this;
2074
+ let normalizedColumns = columns
2075
+ // 筛选隐藏项
2076
+ .filter(item => !item.hideInTable).map(col => {
2077
+ // 筛选 el-column 属性
2078
+ const {
2079
+ formItemProps,
2080
+ renderLabel,
2081
+ valueType,
2082
+ renderField,
2083
+ fieldProps,
2084
+ fieldEvents,
2085
+ options,
2086
+ valueEnum,
2087
+ optionLoader,
2088
+ initialValue,
2089
+ order,
2090
+ hideInSearch,
2091
+ renderCellHeader,
2092
+ renderCell,
2093
+ disabled,
2094
+ key,
2095
+ ...keys
2096
+ } = col;
2097
+ return {
2098
+ ...keys,
2099
+ nonElColumnProps: {
2100
+ valueEnum,
2101
+ renderCellHeader,
2102
+ renderCell,
2103
+ key,
2104
+ disabled
2105
+ }
2106
+ };
2107
+ });
2108
+
2109
+ // 合并列设置规则
2110
+ if (initializedColumnSettings && columnSettingsRule !== null && columnSettingsRule !== void 0 && columnSettingsRule.length) {
2111
+ normalizedColumns = normalizedColumns.map(col => {
2112
+ const rule = columnSettingsRule.find(item => (col.prop || col.nonElColumnProps.key) === item.prop);
2113
+ if (rule) {
2114
+ const {
2115
+ checkable,
2116
+ fixed,
2117
+ index
2118
+ } = rule;
2119
+ col.nonElColumnProps = {
2120
+ ...col.nonElColumnProps,
2121
+ checkable,
2122
+ index
2123
+ };
2124
+ return {
2125
+ ...col,
2126
+ fixed
2127
+ };
2128
+ }
2129
+ return col;
2130
+ });
2131
+ }
2132
+
2133
+ // 列设置处理
2134
+ const {
2135
+ draggable,
2136
+ checkable
2137
+ } = initializedColumnSettings;
2138
+
2139
+ // 支持拖拽排序
2140
+ if (draggable) {
2141
+ normalizedColumns.sort((a, b) => a.nonElColumnProps.index - b.nonElColumnProps.index);
2142
+ }
2143
+
2144
+ // 支持显示/隐藏列
2145
+ if (checkable) {
2146
+ normalizedColumns = normalizedColumns.filter(item => item.nonElColumnProps.checkable || !!item.type);
2147
+ }
2148
+ return normalizedColumns;
2149
+ },
2150
+ // 列设置的列表项
2151
+ settingColumns() {
2152
+ const {
2153
+ columnSettings
2154
+ } = this;
2155
+ if (!columnSettings) {
2156
+ return [];
2157
+ }
2158
+ const {
2159
+ columnSettingsRule,
2160
+ columns
2161
+ } = this;
2162
+ return columnSettingsRule.map(rule => {
2163
+ const col = columns.find(item => rule.prop === (item.prop || item.key));
2164
+ if (col) {
2165
+ const {
2166
+ label,
2167
+ disabled
2168
+ } = col;
2169
+ return {
2170
+ ...rule,
2171
+ label,
2172
+ disabled
2173
+ };
2174
+ }
2175
+ return rule;
2176
+ });
2177
+ },
2178
+ // columnSettings 初始化
2179
+ initializedColumnSettings() {
2180
+ const {
2181
+ columnSettings
2182
+ } = this;
2183
+ if (columnSettings) {
2184
+ const defaultColumnSettings = {
2185
+ columnSetting: Object(locale_["t"])('elProComponents.tableToolBar.columnSetting'),
2186
+ columnDisplay: Object(locale_["t"])('elProComponents.tableToolBar.columnDisplay'),
2187
+ resetText: Object(locale_["t"])('elProComponents.tableToolBar.reset'),
2188
+ draggable: true,
2189
+ checkable: true
2190
+ };
2191
+
2192
+ // 如果不是对象,返回默认值
2193
+ if (typeof columnSettings === 'object') {
2194
+ // 合并基本设置
2195
+ return {
2196
+ ...defaultColumnSettings,
2197
+ ...columnSettings
2198
+ };
2199
+ }
2200
+ return defaultColumnSettings;
2201
+ }
2202
+ return false;
2203
+ },
2204
+ // tableProps 初始化
2205
+ initializedTableProps() {
2206
+ const {
2207
+ tableProps,
2208
+ defaultSize
2209
+ } = this;
2210
+ return {
2211
+ size: defaultSize,
2212
+ ...tableProps
2213
+ };
2214
+ },
2215
+ // tableEvents 初始化
2216
+ initializedTableEvents() {
2217
+ return {
2218
+ 'sort-change': this.sortChange,
2219
+ // 排序
2220
+ ...this.tableEvents
2221
+ };
2222
+ },
2223
+ // paginationProps 初始化
2224
+ initializedPaginationProps() {
2225
+ return {
2226
+ "page-sizes": [10, 20, 30, 50],
2227
+ layout: "total, sizes, prev, pager, next, jumper",
2228
+ "hide-on-single-page": true,
2229
+ ...this.paginationProps,
2230
+ "current-page": this.pageNum,
2231
+ "page-size": this.pageSize,
2232
+ total: this.total
2233
+ };
2234
+ }
2235
+ },
2236
+ data() {
2237
+ return {
2238
+ cachedOptions: {},
2239
+ // 下拉数据 { [prop]: data }
2240
+ form: this.initForm(),
2241
+ // 表单数据
2242
+ showExpandToggle: false,
2243
+ // 是否显示展开、收起
2244
+ searchColConfig: breakpoints_["defaultColConfig"],
2245
+ // search Col 配置
2246
+ collapsed: true,
2247
+ // 展开、收起
2248
+ searchCount: 0,
2249
+ // 收起展示的表单个数收起展示的表单个数
2250
+ tableKey: 1,
2251
+ // table key
2252
+ pageNum: 1,
2253
+ // 页码
2254
+ pageSize: this.paginationProps["page-size"] || 10,
2255
+ // 页数
2256
+ columnSettingsRule: [] // 列设置规则
2257
+ };
2258
+ },
2259
+ watch: {
2260
+ // 监听表单项总个数
2261
+ totalSearchCount() {
2262
+ this.calculateSearchLayout();
2263
+ },
2264
+ // 监听 search.collapsed
2265
+ "search.collapsed": function (newValue) {
2266
+ if (newValue !== this.collapsed) {
2267
+ this.handleCollapse();
2268
+ }
2269
+ }
2270
+ },
2271
+ created() {
2272
+ // 获取异步数据
2273
+ this.getOptions();
2274
+ // 是否手动执行
2275
+ if (!this.manualRequest) {
2276
+ this.handleSearch();
2277
+ }
2278
+ // 开启列设置
2279
+ if (this.columnSettings) {
2280
+ this.columnSettingsRule = this.initializeColumnSettingsRule();
2281
+ }
2282
+ },
2283
+ mounted() {
2284
+ // 是否支持响应式
2285
+ const isResponsive = this.isResponsive();
2286
+ // 计算是否需要展开、收起以及位置
2287
+ this.calculateSearchLayout(isResponsive);
2288
+
2289
+ // 监听 window 宽度变化
2290
+ if (isResponsive) {
2291
+ // window 宽度变化防抖
2292
+ this.debounceResize = Object(debounce_["debounce"])(this.resize);
2293
+ // 监听 window resize
2294
+ window.addEventListener("resize", this.debounceResize);
2295
+ }
2296
+ },
2297
+ methods: {
2298
+ /**
2299
+ * @desc 多语言支持
2300
+ */
2301
+ t(key) {
2302
+ return Object(locale_["t"])(key);
2303
+ },
2304
+ /**
2305
+ * @desc 获取异步下拉数据
2306
+ */
2307
+ getOptions() {
2308
+ const {
2309
+ columns
2310
+ } = this;
2311
+ for (const column of columns) {
2312
+ const {
2313
+ prop,
2314
+ fieldProps = {},
2315
+ optionLoader
2316
+ } = column;
2317
+ if (optionLoader && typeof optionLoader === "function") {
2318
+ optionLoader().then(res => {
2319
+ const key = fieldProps.prop || prop;
2320
+ this.cachedOptions = {
2321
+ ...this.cachedOptions,
2322
+ [key]: res
2323
+ };
2324
+ });
2325
+ }
2326
+ }
2327
+ },
2328
+ /**
2329
+ * @desc 初始化表单数据
2330
+ */
2331
+ initForm() {
2332
+ const {
2333
+ columns
2334
+ } = this;
2335
+ // 兼容
2336
+ if (!columns.length) {
2337
+ return {};
2338
+ }
2339
+ const data = columns
2340
+ // 筛选表单类型
2341
+ .filter(item => !!item.valueType).reduce((accu, cur) => {
2342
+ const {
2343
+ prop,
2344
+ fieldProps = {},
2345
+ initialValue
2346
+ } = cur;
2347
+ const key = fieldProps.prop || prop;
2348
+ if (!key) {
2349
+ return accu;
2350
+ }
2351
+ return {
2352
+ ...accu,
2353
+ [key]: initialValue
2354
+ };
2355
+ }, {});
2356
+ return {
2357
+ ...this.initialValues,
2358
+ ...data
2359
+ };
2360
+ },
2361
+ /**
2362
+ * @desc 是否需要支持响应式
2363
+ * @returns {boolean}
2364
+ */
2365
+ isResponsive() {
2366
+ const {
2367
+ searchProps: {
2368
+ colProps
2369
+ }
2370
+ } = this;
2371
+ const keys = Object.keys(colProps);
2372
+ return keys.some(key => breakpoints_["BREAKPOINT_ORDER"].includes(key));
2373
+ },
2374
+ /**
2375
+ * @desc 计算搜索区域的布局配置(展开/收起状态)
2376
+ * @param {boolean} isResponsive 是否是响应式
2377
+ */
2378
+ calculateSearchLayout(isResponsive = false) {
2379
+ const {
2380
+ searchProps: {
2381
+ colProps,
2382
+ defaultExpandedRows
2383
+ },
2384
+ totalSearchCount
2385
+ } = this;
2386
+
2387
+ // 1. 计算每个表单项所占的栅格跨度
2388
+ this.cachedSpanPerField = isResponsive ? Object(breakpoints_["calculateCurrentSpan"])(colProps) : colProps.span || 8;
2389
+
2390
+ // 2. 计算最大可展示的表单项数量
2391
+ this.maxVisibleFields = Math.floor(breakpoints_["GRID_COLUMNS"] / this.cachedSpanPerField * defaultExpandedRows) - 1;
2392
+
2393
+ // 3. 判断是否需要显示展开/收起按钮
2394
+ this.showExpandToggle = totalSearchCount > this.maxVisibleFields;
2395
+ if (this.showExpandToggle) {
2396
+ this.collapsed = this.searchProps.collapsed;
2397
+ }
2398
+
2399
+ // 4. 更新布局配置
2400
+ this.updateSearchLayout();
2401
+ },
2402
+ /**
2403
+ * @desc 更新搜索按钮的位置
2404
+ */
2405
+ updateSearchLayout() {
2406
+ const {
2407
+ searchProps: {
2408
+ colProps
2409
+ },
2410
+ cachedSpanPerField
2411
+ } = this;
2412
+
2413
+ // 1. 计算可见的表单项数量
2414
+ this.searchCount = this.showExpandToggle && this.collapsed ? this.maxVisibleFields : this.totalSearchCount;
2415
+
2416
+ // 2. 计算搜索按钮的位置
2417
+ const restSpan = breakpoints_["GRID_COLUMNS"] - cachedSpanPerField * this.searchCount % breakpoints_["GRID_COLUMNS"];
2418
+
2419
+ // 3. 计算偏差值 offset
2420
+ const offset = restSpan - cachedSpanPerField;
2421
+ this.searchColConfig = {
2422
+ ...colProps,
2423
+ offset
2424
+ };
2425
+ },
2426
+ /**
2427
+ * @desc 宽度变化
2428
+ * @param {Array} entries 监听元素数据
2429
+ */
2430
+ resize() {
2431
+ // 重新计算
2432
+ this.calculateSearchLayout(true);
2433
+ },
2434
+ /**
2435
+ * @desc 点击展开、收起
2436
+ */
2437
+ handleCollapse() {
2438
+ this.collapsed = !this.collapsed;
2439
+ this.$emit("onCollapse", this.collapsed);
2440
+ if (this.showExpandToggle) {
2441
+ // 更新展开、收起的位置
2442
+ this.updateSearchLayout();
2443
+ }
2444
+ },
2445
+ /**s
2446
+ * @desc 获取选择器枚举标签
2447
+ * @param {Object} column 列数据
2448
+ * @param {Object} row 行数据
2449
+ */
2450
+ getOptionLabel(column, scope) {
2451
+ var _scope$row, _scope$row2;
2452
+ return column.nonElColumnProps.valueEnum instanceof Map ? column.nonElColumnProps.valueEnum.get((_scope$row = scope.row) === null || _scope$row === void 0 ? void 0 : _scope$row[column.prop]) : column.nonElColumnProps.valueEnum[(_scope$row2 = scope.row) === null || _scope$row2 === void 0 ? void 0 : _scope$row2[column.prop]];
2453
+ },
2454
+ /**s
2455
+ * @desc 表单请求参数(分页)
2456
+ */
2457
+ getParams() {
2458
+ const {
2459
+ pageNum,
2460
+ pageSize,
2461
+ paginationMapping: {
2462
+ pageKey,
2463
+ sizeKey
2464
+ }
2465
+ } = this;
2466
+ return {
2467
+ ...this.form,
2468
+ [pageKey || "pageNum"]: pageNum,
2469
+ [sizeKey || "pageSize"]: pageSize
2470
+ };
2471
+ },
2472
+ /**
2473
+ * @desc 重置
2474
+ */
2475
+ handleReset() {
2476
+ this.form = this.initForm();
2477
+ // 重置第一页
2478
+ this.pageNum = 1;
2479
+ this.$emit("onParams", this.getParams());
2480
+ this.$emit("onReset");
2481
+ },
2482
+ /**
2483
+ * @desc 查询
2484
+ */
2485
+ handleSearch() {
2486
+ // 重置第一页
2487
+ this.pageNum = 1;
2488
+ const params = this.getParams();
2489
+ this.$emit("onParams", params);
2490
+ this.$emit("onSubmit", params);
2491
+ },
2492
+ /**
2493
+ * @desc 刷新
2494
+ * @param {boolean} resetPageIndex 是否重置页码
2495
+ */
2496
+ reload(resetPageIndex = true) {
2497
+ if (resetPageIndex) {
2498
+ this.pageNum = 1;
2499
+ }
2500
+ this.$emit("onParams", this.getParams());
2501
+ },
2502
+ /**
2503
+ * @desc 排序
2504
+ * @param {String} prop 属性
2505
+ * @param {String} order 升序: ASC 倒序: DESC
2506
+ */
2507
+ sortChange({
2508
+ prop,
2509
+ order
2510
+ }) {
2511
+ // 重置第一页
2512
+ this.pageNum = 1;
2513
+ this.$emit("onParams", {
2514
+ ...this.getParams(),
2515
+ prop,
2516
+ order
2517
+ });
2518
+ },
2519
+ /**
2520
+ * @desc 监听页码修改
2521
+ * @param {Number} page 页码
2522
+ */
2523
+ handleCurrentChange(page) {
2524
+ this.pageNum = page;
2525
+ this.$emit("onParams", this.getParams());
2526
+ },
2527
+ /**
2528
+ * @desc 监听页数修改
2529
+ * @param {Number} pageSize 页数
2530
+ */
2531
+ handleSizeChange(pageSize) {
2532
+ this.pageSize = pageSize;
2533
+ // 重置页码(防止分页组件自动计算页码)
2534
+ this.pageNum = 1;
2535
+ this.$emit("onParams", this.getParams());
2536
+ },
2537
+ /**
2538
+ * @desc 获取 table ref
2539
+ */
2540
+ getTableRef() {
2541
+ return this.$refs.tableRef;
2542
+ },
2543
+ /**
2544
+ * @desc 初始化列设置
2545
+ */
2546
+ initializeColumnSettingsRule() {
2547
+ return this.columns
2548
+ // 过滤隐藏的 && (columnConfig.prop || columnConfig.key)
2549
+ .filter(item => !item.hideInTable && (item.prop || item.key)).map((col, index) => {
2550
+ const {
2551
+ prop,
2552
+ key,
2553
+ fixed
2554
+ } = col;
2555
+ return {
2556
+ prop: prop || key,
2557
+ fixed,
2558
+ checkable: true,
2559
+ index
2560
+ };
2561
+ });
2562
+ },
2563
+ /**
2564
+ * @desc 全选、取消全选
2565
+ * @param {Boolean} checked 勾选状态
2566
+ */
2567
+ checkAllRule(checked) {
2568
+ this.columnSettingsRule = this.columnSettingsRule.map(rule => {
2569
+ const col = this.columns.find(item => (item.prop || item.key) === rule.prop);
2570
+ if (col) {
2571
+ return {
2572
+ ...rule,
2573
+ checkable: !col.disabled ? checked : rule.checkable
2574
+ };
2575
+ }
2576
+ return rule;
2577
+ });
2578
+ },
2579
+ /**
2580
+ * @desc 单个勾选、取消勾选
2581
+ * @param {String} prop 标识
2582
+ * @param {Boolean} checked 勾选状态
2583
+ */
2584
+ checkRule(prop, checked) {
2585
+ const {
2586
+ columnSettingsRule
2587
+ } = this;
2588
+ const index = columnSettingsRule.findIndex(item => item.prop === prop);
2589
+ if (index !== -1) {
2590
+ columnSettingsRule.splice(index, 1, {
2591
+ ...columnSettingsRule[index],
2592
+ checkable: checked
2593
+ });
2594
+ }
2595
+ },
2596
+ /**
2597
+ * @desc 固定位置修改
2598
+ * @param {String} prop 属性
2599
+ * @param {String | undefined} fixed 固定位置
2600
+ */
2601
+ handleAlignRule(prop, fixed) {
2602
+ const {
2603
+ columnSettingsRule
2604
+ } = this;
2605
+ const index = columnSettingsRule.findIndex(item => item.prop === prop);
2606
+ if (index !== -1) {
2607
+ const rule = columnSettingsRule[index];
2608
+ columnSettingsRule.splice(index, 1, {
2609
+ ...rule,
2610
+ fixed
2611
+ });
2612
+ }
2613
+ },
2614
+ /**
2615
+ * @desc 重置列设置规则
2616
+ */
2617
+ handleResetRule() {
2618
+ this.columnSettingsRule = this.initializeColumnSettingsRule();
2619
+ },
2620
+ /**
2621
+ * @desc 拖拽更新
2622
+ * @param {String} fromProp 拖拽开始列
2623
+ * @param {String} toProp 释放目标列
2624
+ * @param {Boolean} isAfter 是否拖拽到分组的最后一列
2625
+ */
2626
+ handleDropRule(fromProp, toProp, isAfter = false) {
2627
+ const {
2628
+ columnSettingsRule
2629
+ } = this;
2630
+ const fromIndex = columnSettingsRule.findIndex(item => (item.prop || item.key) === fromProp);
2631
+ if (fromIndex === -1) {
2632
+ return;
2633
+ }
2634
+ const toIndex = columnSettingsRule.findIndex(item => (item.prop || item.key) === toProp);
2635
+ if (toIndex === -1) {
2636
+ return;
2637
+ }
2638
+ // 向上拖拽
2639
+ const isUp = fromIndex > toIndex;
2640
+ // 开始移动下标
2641
+ const startIndex = isUp ? toIndex : fromIndex + 1;
2642
+ // 结束移动下标
2643
+ const endIndex = isUp ? fromIndex : isAfter ? toIndex + 1 : toIndex;
2644
+ // 移动
2645
+ for (let i = startIndex; i < endIndex; ++i) {
2646
+ const column = columnSettingsRule[i];
2647
+ columnSettingsRule.splice(i, 1, {
2648
+ ...column,
2649
+ index: isUp ? column.index + 1 : column.index - 1
2650
+ });
2651
+ }
2652
+ const fromColumn = columnSettingsRule[fromIndex];
2653
+ if (isUp) {
2654
+ // 先删除 后插入
2655
+ columnSettingsRule.splice(fromIndex, 1);
2656
+ columnSettingsRule.splice(toIndex, 0, {
2657
+ ...fromColumn,
2658
+ index: toIndex
2659
+ });
2660
+ } else {
2661
+ // 先插入 后删除
2662
+ columnSettingsRule.splice(endIndex, 0, {
2663
+ ...fromColumn,
2664
+ index: endIndex - 1
2665
+ });
2666
+ columnSettingsRule.splice(fromIndex, 1);
2667
+ }
2668
+ },
2669
+ /**
2670
+ * @desc el-table 列的数量发生变化时需要重新布局
2671
+ */
2672
+ doLayout() {
2673
+ this.$nextTick(() => {
2674
+ var _this$$refs$tableRef;
2675
+ // 对 Table 进行重新布局
2676
+ (_this$$refs$tableRef = this.$refs.tableRef) === null || _this$$refs$tableRef === void 0 ? void 0 : _this$$refs$tableRef.doLayout();
2677
+ });
2678
+ },
2679
+ /**
2680
+ * @desc el-table 重新渲染
2681
+ */
2682
+ updateTableKey() {
2683
+ this.tableKey = Math.random().toString().slice(2, 8);
2684
+ this.$nextTick(() => {
2685
+ this.$emit('onKeyChange');
2686
+ });
2687
+ },
2688
+ /**
2689
+ * @desc 监听列设置修改
2690
+ * @param { Object } data 数据
2691
+ * @param {String} data.event 事件类型
2692
+ */
2693
+ onColumnSettingsChange(data) {
2694
+ const {
2695
+ event,
2696
+ prop,
2697
+ checked,
2698
+ fixed,
2699
+ fromProp,
2700
+ toProp,
2701
+ isAfter
2702
+ } = data;
2703
+ // 勾选或取消勾选
2704
+ switch (event) {
2705
+ case "checkAll":
2706
+ this.checkAllRule(checked);
2707
+ this.doLayout();
2708
+ break;
2709
+ case "check":
2710
+ this.checkRule(prop, checked);
2711
+ this.doLayout();
2712
+ break;
2713
+ case "align":
2714
+ this.handleAlignRule(prop, fixed);
2715
+ break;
2716
+ case "reset":
2717
+ this.handleResetRule();
2718
+ // 更新 table key
2719
+ this.updateTableKey();
2720
+ break;
2721
+ case 'drop':
2722
+ this.handleDropRule(fromProp, toProp, isAfter);
2723
+ // 更新 table key
2724
+ this.updateTableKey();
2725
+ break;
2726
+ default:
2727
+ break;
2728
+ }
2729
+ }
2730
+ },
2731
+ beforeDestroy() {
2732
+ var _this$debounceResize;
2733
+ // 清除 resize
2734
+ window.removeEventListener("resize", this.resize);
2735
+ // 取消防抖
2736
+ (_this$debounceResize = this.debounceResize) === null || _this$debounceResize === void 0 ? void 0 : _this$debounceResize.cancel();
2737
+ }
2738
+ });
2739
+ // CONCATENATED MODULE: ./packages/pro-table/src/index.vue?vue&type=script&lang=js
2740
+ /* harmony default export */ var pro_table_srcvue_type_script_lang_js = (srcvue_type_script_lang_js);
2741
+ // CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/less-loader/dist/cjs.js!./node_modules/vue-loader/lib??vue-loader-options!./packages/pro-table/src/index.vue?vue&type=style&index=0&id=0d0329af&prod&lang=less&scoped=true
2742
+ // extracted by mini-css-extract-plugin
2743
+
2744
+ // CONCATENATED MODULE: ./packages/pro-table/src/index.vue?vue&type=style&index=0&id=0d0329af&prod&lang=less&scoped=true
2745
+
2746
+ // CONCATENATED MODULE: ./packages/pro-table/src/index.vue
2747
+
2748
+
2749
+
2750
+
2751
+
2752
+
2753
+ /* normalize component */
2754
+
2755
+ var src_component = Object(componentNormalizer["a" /* default */])(
2756
+ pro_table_srcvue_type_script_lang_js,
2757
+ render,
2758
+ staticRenderFns,
2759
+ false,
2760
+ null,
2761
+ "0d0329af",
2762
+ null
2763
+
2764
+ )
2765
+
2766
+ /* harmony default export */ var src = (src_component.exports);
2767
+ // CONCATENATED MODULE: ./packages/pro-table/index.js
2768
+
2769
+
2770
+ // 为组件提供 install 方法
2771
+ src.install = function (Vue) {
2772
+ Vue.component(src.name, src);
2773
+ };
2774
+
2775
+ // 默认导出组件
2776
+ /* harmony default export */ var pro_table = __webpack_exports__["default"] = (src);
2777
+
2778
+ /***/ })
2779
+ /******/ ]);