@web-utils/component 3.0.6 → 3.1.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 (172) hide show
  1. package/address-input/index.mjs +20 -57
  2. package/affix/index.mjs +26 -47
  3. package/aside-menu/index.mjs +18 -43
  4. package/avatar/index.mjs +27 -49
  5. package/awesome-button/index.mjs +35 -43
  6. package/capsule-tab/index.mjs +16 -34
  7. package/card/index.mjs +21 -76
  8. package/carousel/index.mjs +14 -49
  9. package/chat/index.mjs +104 -414
  10. package/chunk-file-uploader/index.mjs +21 -38
  11. package/chunks/FormTemp.aa57efb4.mjs +125 -0
  12. package/code-mirror-editor/index.mjs +69 -79
  13. package/color-picker/index.mjs +29 -60
  14. package/comment/index.mjs +17 -48
  15. package/confirm-button/index.mjs +11 -19
  16. package/confirmable/index.mjs +12 -20
  17. package/context-menu/index.mjs +42 -144
  18. package/count-up/index.mjs +18 -25
  19. package/custom-scrollbar/index.mjs +13 -22
  20. package/data-box/index.mjs +15 -66
  21. package/data-card/index.mjs +16 -65
  22. package/data-cardtext/index.mjs +16 -52
  23. package/data-display/index.mjs +18 -62
  24. package/data-icons/index.mjs +16 -68
  25. package/data-imgtext/index.mjs +18 -79
  26. package/data-operatext/index.mjs +18 -75
  27. package/data-panel/index.mjs +16 -63
  28. package/data-pay/index.mjs +20 -122
  29. package/data-price/index.mjs +18 -60
  30. package/data-progress/index.mjs +16 -67
  31. package/data-rotate/index.mjs +16 -66
  32. package/data-table-picker/index.mjs +25 -88
  33. package/data-tabs/index.mjs +16 -64
  34. package/dialog-form/index.mjs +48 -94
  35. package/dynamic-table/index.mjs +43 -127
  36. package/e-charts/index.mjs +21 -34
  37. package/easy-popup/index.mjs +35 -61
  38. package/editable-progress/index.mjs +22 -77
  39. package/editable-tree/index.mjs +235 -546
  40. package/egd-collapse/index.mjs +13 -26
  41. package/egd-collapse-item/index.mjs +27 -87
  42. package/element-dialog/index.mjs +69 -133
  43. package/empty-view/index.mjs +13 -33
  44. package/error-view/index.mjs +14 -34
  45. package/flex-column/index.mjs +15 -23
  46. package/flex-item/index.mjs +18 -26
  47. package/flex-row/index.mjs +23 -31
  48. package/flex-scroller/index.mjs +16 -27
  49. package/flow/index.mjs +70 -110
  50. package/flow-designer/index.mjs +1215 -4804
  51. package/flow-node/index.mjs +15 -51
  52. package/flow-viewer/index.mjs +64 -89
  53. package/form-block/index.mjs +43 -62
  54. package/form-button/index.mjs +10 -18
  55. package/form-cascader/index.mjs +49 -100
  56. package/form-checkbox-group/index.mjs +43 -110
  57. package/form-date-picker/index.mjs +51 -97
  58. package/form-holder/index.mjs +25 -42
  59. package/form-input/index.mjs +40 -90
  60. package/form-input-email/index.mjs +35 -79
  61. package/form-input-id-card/index.mjs +40 -87
  62. package/form-input-number/index.mjs +42 -102
  63. package/form-input-phone-number/index.mjs +34 -75
  64. package/form-input-tag/index.mjs +31 -73
  65. package/form-input-time/index.mjs +42 -87
  66. package/form-item/index.mjs +70 -89
  67. package/form-item-config-provider/index.mjs +12 -20
  68. package/form-item-group/index.mjs +46 -65
  69. package/form-radio-group/index.mjs +50 -108
  70. package/form-select/index.mjs +44 -95
  71. package/form-switch/index.mjs +38 -85
  72. package/form-textarea/index.mjs +31 -75
  73. package/form-view/index.mjs +112 -260
  74. package/fy-array/index.mjs +35 -121
  75. package/fy-article/index.mjs +12 -43
  76. package/fy-cascader/index.mjs +26 -67
  77. package/fy-checkbox/index.mjs +27 -77
  78. package/fy-code/index.mjs +19 -33
  79. package/fy-curd/index.mjs +810 -2017
  80. package/fy-date/index.mjs +18 -59
  81. package/fy-draggable/index.mjs +81 -140
  82. package/fy-dynamic/index.mjs +85 -204
  83. package/fy-empty/index.mjs +14 -35
  84. package/fy-form/index.mjs +254 -571
  85. package/fy-form-design/index.mjs +1489 -6084
  86. package/fy-form-design/style.css +1 -1
  87. package/fy-input/index.mjs +34 -104
  88. package/fy-input-color/index.mjs +22 -67
  89. package/fy-input-icon/index.mjs +37 -122
  90. package/fy-input-map/index.mjs +57 -149
  91. package/fy-input-number/index.mjs +18 -53
  92. package/fy-input-table/index.mjs +36 -102
  93. package/fy-input-tree/index.mjs +51 -138
  94. package/fy-progress/index.mjs +12 -31
  95. package/fy-radio/index.mjs +20 -51
  96. package/fy-rate/index.mjs +18 -51
  97. package/fy-select/index.mjs +49 -134
  98. package/fy-slider/index.mjs +19 -52
  99. package/fy-switch/index.mjs +18 -48
  100. package/fy-tabs/index.mjs +19 -51
  101. package/fy-time/index.mjs +22 -62
  102. package/fy-title/index.mjs +14 -25
  103. package/fy-tree/index.mjs +74 -216
  104. package/fy-u-editor/index.mjs +50 -64
  105. package/fy-upload/index.mjs +167 -338
  106. package/guide-steps/index.mjs +33 -53
  107. package/highlight-j-s/index.mjs +13 -27
  108. package/icon-card/index.mjs +12 -36
  109. package/icon-temp/index.mjs +12 -34
  110. package/iframe-window/index.mjs +13 -40
  111. package/image-cropper/index.mjs +46 -171
  112. package/image-preview/index.mjs +54 -168
  113. package/image-viewer/index.mjs +24 -50
  114. package/index.css +1 -0
  115. package/index.mjs +3973 -501
  116. package/input-number/index.mjs +84 -173
  117. package/input-number-range/index.mjs +20 -70
  118. package/j-s-x-component/index.mjs +3 -3
  119. package/keep-view-alive/index.mjs +47 -55
  120. package/keyboard/index.mjs +100 -113
  121. package/license/index.mjs +34 -51
  122. package/loading-view/index.mjs +14 -34
  123. package/login/index.mjs +33 -161
  124. package/monaco-editor/index.mjs +13 -21
  125. package/name-avatar/index.mjs +13 -32
  126. package/nav-bar/index.mjs +12 -31
  127. package/not-implement/index.mjs +14 -25
  128. package/notice/index.mjs +32 -80
  129. package/package.json +1 -1
  130. package/page/index.mjs +11 -23
  131. package/page-header/index.mjs +16 -37
  132. package/page-index/index.mjs +42 -93
  133. package/page-index-top/index.mjs +42 -84
  134. package/page-skeleton/index.mjs +24 -39
  135. package/page-skeleton-new/index.mjs +21 -68
  136. package/pageable-table/index.mjs +105 -227
  137. package/pageable-view/index.mjs +30 -83
  138. package/photo-swipe/index.mjs +62 -87
  139. package/present-view/index.mjs +114 -267
  140. package/queue/index.mjs +14 -29
  141. package/record-video/index.mjs +29 -66
  142. package/resize-observer/index.mjs +18 -30
  143. package/search/index.mjs +47 -81
  144. package/search-popover/index.mjs +57 -329
  145. package/sign/index.mjs +43 -60
  146. package/sign-panel/index.mjs +40 -151
  147. package/skeleton/index.mjs +18 -44
  148. package/split-pane/index.mjs +45 -129
  149. package/stateful/index.mjs +18 -26
  150. package/static-pageable-table/index.mjs +18 -44
  151. package/swiper/index.mjs +53 -94
  152. package/tab/index.mjs +13 -39
  153. package/tab-item/index.mjs +23 -37
  154. package/table-column/index.mjs +27 -35
  155. package/table-view/index.mjs +89 -209
  156. package/tag-render/index.mjs +34 -69
  157. package/text-ellipsis/index.mjs +22 -47
  158. package/tinymce-editor/index.mjs +174 -285
  159. package/toolbar/index.mjs +21 -42
  160. package/toolbar-button/index.mjs +25 -54
  161. package/verify/index.mjs +16 -29
  162. package/vue-cron/index.mjs +272 -1089
  163. package/vue-qr-code/index.mjs +19 -27
  164. package/vue-quill-editor/index.mjs +15 -27
  165. package/vue-tags-input/index.mjs +104 -224
  166. package/vue-tree-select/index.mjs +595 -742
  167. package/vue-video-player/index.mjs +42 -57
  168. package/watermark/index.mjs +27 -35
  169. package/web-types.json +1 -1
  170. package/x-input-tag/index.mjs +50 -112
  171. package/chunks/FormTemp.7f91629d.mjs +0 -165
  172. /package/chunks/{vueComponentNormalizer.446f5dc4.mjs → _plugin-vue2_normalizer.446f5dc4.mjs} +0 -0
@@ -1,193 +1,54 @@
1
- var v = Object.defineProperty, $ = Object.defineProperties;
2
- var w = Object.getOwnPropertyDescriptors;
1
+ var T = Object.defineProperty, $ = Object.defineProperties;
2
+ var v = Object.getOwnPropertyDescriptors;
3
3
  var p = Object.getOwnPropertySymbols;
4
4
  var f = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
5
- var g = (e, a, t) => a in e ? v(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t, c = (e, a) => {
6
- for (var t in a || (a = {}))
7
- f.call(a, t) && g(e, t, a[t]);
5
+ var g = (t, e, a) => e in t ? T(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a, c = (t, e) => {
6
+ for (var a in e || (e = {}))
7
+ f.call(e, a) && g(t, a, e[a]);
8
8
  if (p)
9
- for (var t of p(a))
10
- b.call(a, t) && g(e, t, a[t]);
11
- return e;
12
- }, m = (e, a) => $(e, w(a));
13
- var y = (e, a) => {
14
- var t = {};
15
- for (var s in e)
16
- f.call(e, s) && a.indexOf(s) < 0 && (t[s] = e[s]);
17
- if (e != null && p)
18
- for (var s of p(e))
19
- a.indexOf(s) < 0 && b.call(e, s) && (t[s] = e[s]);
9
+ for (var a of p(e))
10
+ b.call(e, a) && g(t, a, e[a]);
20
11
  return t;
12
+ }, m = (t, e) => $(t, v(e));
13
+ var y = (t, e) => {
14
+ var a = {};
15
+ for (var s in t)
16
+ f.call(t, s) && e.indexOf(s) < 0 && (a[s] = t[s]);
17
+ if (t != null && p)
18
+ for (var s of p(t))
19
+ e.indexOf(s) < 0 && b.call(t, s) && (a[s] = t[s]);
20
+ return a;
21
21
  };
22
- var h = (e, a, t) => new Promise((s, l) => {
22
+ var h = (t, e, a) => new Promise((s, l) => {
23
23
  var u = (r) => {
24
24
  try {
25
- i(t.next(r));
25
+ i(a.next(r));
26
26
  } catch (d) {
27
27
  l(d);
28
28
  }
29
29
  }, n = (r) => {
30
30
  try {
31
- i(t.throw(r));
31
+ i(a.throw(r));
32
32
  } catch (d) {
33
33
  l(d);
34
34
  }
35
35
  }, i = (r) => r.done ? s(r.value) : Promise.resolve(r.value).then(u, n);
36
- i((t = t.apply(e, a)).next());
36
+ i((a = a.apply(t, e)).next());
37
37
  });
38
- import { hasOwn as C } from "@web-utils/core";
39
- import { cloneDeep as _, merge as k } from "@web-utils/integrations/lodash";
40
- import { f as S, h as x, i as P } from "../chunks/index.57f871af.mjs";
41
- import { n as B } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
42
- var E = function() {
43
- var e = this, a = e.$createElement, t = e._self._c || a;
44
- return t("div", {
45
- class: ["pageable-table", {
46
- "auto-height": e.autoHeight
47
- }]
48
- }, [t("div", {
49
- staticClass: "pageable-table-wrapper"
50
- }, [e._t("toolbar"), t("ElTable", e._g(e._b({
51
- ref: "table",
52
- class: ["flex-item", {
53
- "header-bold": e.headerBold
54
- }],
55
- attrs: {
56
- data: e.records,
57
- border: e.border
58
- },
59
- on: {
60
- "hook:updated": e.updateTableScrollPosition,
61
- "sort-change": e.onSortChange,
62
- "row-dblclick": e.rowDbClick,
63
- "current-change": e.onCurrentChange
64
- },
65
- scopedSlots: e._u([{
66
- key: "empty",
67
- fn: function() {
68
- return [e._t("empty", function() {
69
- return [e.tableStatus === e.TABLE_STATUS.loading ? [t("span", {
70
- staticClass: "pageable-table-loading"
71
- }, [t("i", {
72
- staticClass: "table-status-icon el-icon-loading"
73
- }), e._v(" 加载中...")])] : e.tableStatus === e.TABLE_STATUS.error ? [t("ElButton", {
74
- staticClass: "pageable-table-error",
75
- attrs: {
76
- icon: "table-status-icon fa fa-frown-o"
77
- },
78
- on: {
79
- click: e.refresh
80
- }
81
- }, [e._v(" 加载失败,点击重试! ")])] : [e._v(" 暂无数据 ")]];
82
- })];
83
- },
84
- proxy: !0
85
- }, {
86
- key: "append",
87
- fn: function() {
88
- return [e._t("append")];
89
- },
90
- proxy: !0
91
- }], null, !0)
92
- }, "ElTable", e.filterTableProperties(e.mergeAttrs), !1), e.filterTableEvents(e.$listeners)), [e.multiple && e.selection ? t("TableColumn", {
93
- key: "multiple",
94
- attrs: {
95
- type: "selection",
96
- width: "45",
97
- align: "center"
98
- }
99
- }) : e._e(), !e.multiple && e.selection ? t("TableColumn", {
100
- key: "single",
101
- attrs: {
102
- type: "single-selection",
103
- "class-name": "single-select-column",
104
- width: "45",
105
- align: "center"
106
- },
107
- scopedSlots: e._u([{
108
- key: "header",
109
- fn: function() {
110
- return [t("ElRadio", {
111
- attrs: {
112
- value: !!e.currentRow,
113
- label: !0
114
- }
115
- }, [t("span")])];
116
- },
117
- proxy: !0
118
- }, {
119
- key: "default",
120
- fn: function(s) {
121
- var l = s.row;
122
- return [t("ElRadio", {
123
- attrs: {
124
- label: !0,
125
- value: e.currentRow && e.currentRow[e.$attrs["row-key"] || "id"] === l[e.$attrs["row-key"] || "id"]
126
- }
127
- }, [t("span")])];
128
- }
129
- }], null, !1, 307797321)
130
- }) : e._e(), e.index ? t("TableColumn", {
131
- key: "order",
132
- attrs: {
133
- type: "index",
134
- label: "序号",
135
- width: e.indexWidth,
136
- align: "center"
137
- },
138
- scopedSlots: e._u([{
139
- key: "default",
140
- fn: function(s) {
141
- var l = s.$index;
142
- return [e._v(" " + e._s((e.page.page - 1) * e.page.limit + l + 1 || l + 1) + " ")];
143
- }
144
- }], null, !1, 4238275121)
145
- }) : e._e(), e._t("default", function() {
146
- return [e.columns && e.columns.length ? e._l(e.headers, function(s, l) {
147
- return t("TableColumn", e._b({
148
- key: `${s.prop}-${l}`
149
- }, "TableColumn", s, !1));
150
- }) : t("TableColumn", {
151
- attrs: {
152
- label: "点击表格行复制模板"
153
- },
154
- scopedSlots: e._u([{
155
- key: "default",
156
- fn: function(s) {
157
- var l = s.row;
158
- return [t("pre", {
159
- staticClass: "pointer"
160
- }, [e._v(e._s(JSON.stringify(l, null, " ")))])];
161
- }
162
- }])
163
- })];
164
- })], 2), t("ElPagination", {
165
- staticClass: "flex-not-shrink",
166
- attrs: {
167
- "current-page": e.page.page,
168
- "hide-on-single-page": e.hideOnSinglePage,
169
- "page-size": e.page.limit,
170
- total: e.page.total,
171
- background: "",
172
- layout: "total, prev, pager, next, jumper"
173
- },
174
- on: {
175
- "current-change": function(s) {
176
- e.page.page = s;
177
- }
178
- }
179
- })], 2)]);
180
- }, A = [];
38
+ import { hasOwn as w } from "@web-utils/core";
39
+ import { cloneDeep as _, merge as C } from "@web-utils/integrations/lodash";
40
+ import { f as S, h as k, i as P } from "../chunks/index.57f871af.mjs";
41
+ import { n as B } from "../chunks/_plugin-vue2_normalizer.446f5dc4.mjs";
181
42
  const o = {
182
43
  loading: 1,
183
44
  error: -1,
184
45
  empty: 2,
185
46
  success: 0
186
- }, R = {
47
+ }, x = {
187
48
  name: "PageableTable",
188
49
  bus: {
189
- reloadTableView(e) {
190
- e === this.viewId && this.getPage();
50
+ reloadTableView(t) {
51
+ t === this.viewId && this.getPage();
191
52
  }
192
53
  },
193
54
  inheritAttrs: !1,
@@ -259,11 +120,11 @@ const o = {
259
120
  }
260
121
  },
261
122
  data() {
262
- let e = { rules: [] };
263
- this.rules && this.rules.length > 0 && (e.rules = this.rules), this.filters && (e = this.filters), this.filter && (e = Object.assign({}, e, this.filter));
264
- let a = {};
265
- this.model && (a = _(this.model));
266
- const t = this.pageSize;
123
+ let t = { rules: [] };
124
+ this.rules && this.rules.length > 0 && (t.rules = this.rules), this.filters && (t = this.filters), this.filter && (t = Object.assign({}, t, this.filter));
125
+ let e = {};
126
+ this.model && (e = _(this.model));
127
+ const a = this.pageSize;
267
128
  return {
268
129
  TABLE_STATUS: Object.freeze(o),
269
130
  tableStatus: o.empty,
@@ -272,11 +133,11 @@ const o = {
272
133
  page: {
273
134
  total: 0,
274
135
  page: 1,
275
- limit: t,
136
+ limit: a,
276
137
  ascs: this.ascs,
277
138
  descs: this.descs,
278
- model: a,
279
- filters: e
139
+ model: e,
140
+ filters: t
280
141
  }
281
142
  };
282
143
  },
@@ -299,15 +160,15 @@ const o = {
299
160
  return this.httpGet ? this.httpGet : this.httpPost;
300
161
  },
301
162
  indexWidth() {
302
- const e = `${(this.page.page - 1) * this.page.limit + this.records.length}`;
303
- return e.length > 3 ? 50 + (e.length - 3) * 10 : 50;
163
+ const t = `${(this.page.page - 1) * this.page.limit + this.records.length}`;
164
+ return t.length > 3 ? 50 + (t.length - 3) * 10 : 50;
304
165
  },
305
166
  mergeAttrs() {
306
- return k({}, this.$attrs, { height: this.autoHeight ? null : "auto" });
167
+ return C({}, this.$attrs, { height: this.autoHeight ? null : "auto" });
307
168
  },
308
169
  headers() {
309
- var e;
310
- return ((e = this.columns) == null ? void 0 : e.map(S)) || [];
170
+ var t;
171
+ return ((t = this.columns) == null ? void 0 : t.map(S)) || [];
311
172
  }
312
173
  },
313
174
  watch: {
@@ -318,8 +179,8 @@ const o = {
318
179
  },
319
180
  model: {
320
181
  deep: !0,
321
- handler(e) {
322
- this.setModel(e);
182
+ handler(t) {
183
+ this.setModel(t);
323
184
  }
324
185
  }
325
186
  },
@@ -336,61 +197,61 @@ const o = {
336
197
  this.$refs.table.bodyWrapper.removeEventListener("scroll", this.onTableScroll);
337
198
  },
338
199
  methods: {
339
- rowDbClick(...e) {
340
- var t;
341
- const a = this.$refs.table.$children.find((s) => {
200
+ rowDbClick(...t) {
201
+ var a;
202
+ const e = this.$refs.table.$children.find((s) => {
342
203
  var l;
343
204
  return ((l = s.$options) == null ? void 0 : l.name) === "ElTableBody";
344
205
  });
345
- a && ((t = a.$refs.tooltip) == null || t.hide()), this.$emit("row-dblclick", ...e);
206
+ e && ((a = e.$refs.tooltip) == null || a.hide()), this.$emit("row-dblclick", ...t);
346
207
  },
347
208
  updateTableScrollPosition() {
348
209
  return h(this, null, function* () {
349
210
  this.$refs.table.bodyWrapper && this.scrollTo(this.tableScrollTop, this.tableScrollLeft);
350
211
  });
351
212
  },
352
- filterTableProperties: x,
213
+ filterTableProperties: k,
353
214
  filterTableEvents: P,
354
215
  filterTableColumnProperties: S,
355
216
  onTableScroll() {
356
217
  this.tableScrollTop = this.$refs.table.bodyWrapper.scrollTop, this.tableScrollLeft = this.$refs.table.bodyWrapper.scrollLeft;
357
218
  },
358
- onSortChange({ prop: e, order: a }) {
359
- this.page.ascs = a === "ascending" ? e : "", this.page.descs = a === "descending" ? e : "";
219
+ onSortChange({ prop: t, order: e }) {
220
+ this.page.ascs = e === "ascending" ? t : "", this.page.descs = e === "descending" ? t : "";
360
221
  },
361
- onCurrentChange(e) {
362
- this.currentRow = e;
222
+ onCurrentChange(t) {
223
+ this.currentRow = t;
363
224
  },
364
225
  /**
365
226
  *
366
227
  * @param {FilterRule} rule
367
228
  */
368
- addRule(e) {
369
- this.removeRule(e.field), this.page.filters.rules.push(e);
229
+ addRule(t) {
230
+ this.removeRule(t.field), this.page.filters.rules.push(t);
370
231
  },
371
- addRules(e) {
372
- e.forEach((a) => this.addRule(a));
232
+ addRules(t) {
233
+ t.forEach((e) => this.addRule(e));
373
234
  },
374
- setModelField(e, a) {
375
- this.$set(this.page.model, e, a);
235
+ setModelField(t, e) {
236
+ this.$set(this.page.model, t, e);
376
237
  },
377
- setModel(e) {
378
- this.page.page = 1, this.page.model = _(e);
238
+ setModel(t) {
239
+ this.page.page = 1, this.page.model = _(t);
379
240
  },
380
- deleteModelField(e) {
381
- delete this.page.model[e];
241
+ deleteModelField(t) {
242
+ delete this.page.model[t];
382
243
  },
383
- removeRule(e) {
384
- const a = this.page.filters.rules, t = a.findIndex((s) => s.field === e);
385
- t > -1 && a.splice(t, 1);
244
+ removeRule(t) {
245
+ const e = this.page.filters.rules, a = e.findIndex((s) => s.field === t);
246
+ a > -1 && e.splice(a, 1);
386
247
  },
387
- addFilter({ field: e, op: a, value: t }) {
248
+ addFilter({ field: t, op: e, value: a }) {
388
249
  this.page.filters = Object.assign({}, this.page.filters, {
389
250
  rules: [
390
251
  {
391
- field: e,
392
- op: a,
393
- value: t
252
+ field: t,
253
+ op: e,
254
+ value: a
394
255
  }
395
256
  ],
396
257
  op: "and"
@@ -408,17 +269,17 @@ const o = {
408
269
  getPage() {
409
270
  return h(this, null, function* () {
410
271
  var r;
411
- if (C(this.$attrs, "data")) {
272
+ if (w(this.$attrs, "data")) {
412
273
  this.records = this.$attrs.data, this.page.page = 1, this.page.total = this.records.length, this.page.limit = this.page.total;
413
274
  return;
414
275
  }
415
276
  this.records = [];
416
- let e;
417
- const i = this.page, { filters: a } = i, t = y(i, ["filters"]), s = c({}, t);
418
- if ((r = a == null ? void 0 : a.rules) != null && r.length && (s.filters = { rules: a.rules }), this.api || this.url) {
277
+ let t;
278
+ const i = this.page, { filters: e } = i, a = y(i, ["filters"]), s = c({}, a);
279
+ if ((r = e == null ? void 0 : e.rules) != null && r.length && (s.filters = { rules: e.rules }), this.api || this.url) {
419
280
  this.tableStatus = o.loading;
420
281
  try {
421
- this.api && (e = yield this.api(s)), this.url && (e = yield this.method(this.url, s));
282
+ this.api && (t = yield this.api(s)), this.url && (t = yield this.method(this.url, s));
422
283
  } catch (d) {
423
284
  this.tableStatus = o.error, console.error(d);
424
285
  return;
@@ -430,7 +291,7 @@ const o = {
430
291
  });
431
292
  return;
432
293
  }
433
- const { data: l } = e || {}, { total: u, records: n } = l || {};
294
+ const { data: l } = t || {}, { total: u, records: n } = l || {};
434
295
  this.page.total = Number(u), this.records = n, !n || !n.length ? this.tableStatus = o.empty : this.tableStatus = o.success, this.$refs.table.doLayout(), this.$emit("page-loaded", l);
435
296
  });
436
297
  },
@@ -446,28 +307,45 @@ const o = {
446
307
  });
447
308
  });
448
309
  },
449
- scrollTo(e, a) {
450
- e && (this.$refs.table.bodyWrapper.scrollTop = e), a && (this.$refs.table.bodyWrapper.scrollLeft = a);
310
+ scrollTo(t, e) {
311
+ t && (this.$refs.table.bodyWrapper.scrollTop = t), e && (this.$refs.table.bodyWrapper.scrollLeft = e);
451
312
  }
452
313
  }
453
- }, T = {};
454
- var O = /* @__PURE__ */ B(
455
- R,
314
+ };
315
+ var E = function() {
316
+ var e = this, a = e._self._c;
317
+ return a("div", { class: ["pageable-table", { "auto-height": e.autoHeight }] }, [a("div", { staticClass: "pageable-table-wrapper" }, [e._t("toolbar"), a("ElTable", e._g(e._b({ ref: "table", class: ["flex-item", { "header-bold": e.headerBold }], attrs: { data: e.records, border: e.border }, on: { "hook:updated": e.updateTableScrollPosition, "sort-change": e.onSortChange, "row-dblclick": e.rowDbClick, "current-change": e.onCurrentChange }, scopedSlots: e._u([{ key: "empty", fn: function() {
318
+ return [e._t("empty", function() {
319
+ return [e.tableStatus === e.TABLE_STATUS.loading ? [a("span", { staticClass: "pageable-table-loading" }, [a("i", { staticClass: "table-status-icon el-icon-loading" }), e._v(" 加载中...")])] : e.tableStatus === e.TABLE_STATUS.error ? [a("ElButton", { staticClass: "pageable-table-error", attrs: { icon: "table-status-icon fa fa-frown-o" }, on: { click: e.refresh } }, [e._v(" 加载失败,点击重试! ")])] : [e._v(" 暂无数据 ")]];
320
+ })];
321
+ }, proxy: !0 }, { key: "append", fn: function() {
322
+ return [e._t("append")];
323
+ }, proxy: !0 }], null, !0) }, "ElTable", e.filterTableProperties(e.mergeAttrs), !1), e.filterTableEvents(e.$listeners)), [e.multiple && e.selection ? a("TableColumn", { key: "multiple", attrs: { type: "selection", width: "45", align: "center" } }) : e._e(), !e.multiple && e.selection ? a("TableColumn", { key: "single", attrs: { type: "single-selection", "class-name": "single-select-column", width: "45", align: "center" }, scopedSlots: e._u([{ key: "header", fn: function() {
324
+ return [a("ElRadio", { attrs: { value: !!e.currentRow, label: !0 } }, [a("span")])];
325
+ }, proxy: !0 }, { key: "default", fn: function({ row: s }) {
326
+ return [a("ElRadio", { attrs: { label: !0, value: e.currentRow && e.currentRow[e.$attrs["row-key"] || "id"] === s[e.$attrs["row-key"] || "id"] } }, [a("span")])];
327
+ } }], null, !1, 307797321) }) : e._e(), e.index ? a("TableColumn", { key: "order", attrs: { type: "index", label: "序号", width: e.indexWidth, align: "center" }, scopedSlots: e._u([{ key: "default", fn: function({ $index: s }) {
328
+ return [e._v(" " + e._s((e.page.page - 1) * e.page.limit + s + 1 || s + 1) + " ")];
329
+ } }], null, !1, 4238275121) }) : e._e(), e._t("default", function() {
330
+ return [e.columns && e.columns.length ? e._l(e.headers, function(s, l) {
331
+ return a("TableColumn", e._b({ key: `${s.prop}-${l}` }, "TableColumn", s, !1));
332
+ }) : a("TableColumn", { attrs: { label: "点击表格行复制模板" }, scopedSlots: e._u([{ key: "default", fn: function({ row: s }) {
333
+ return [a("pre", { staticClass: "pointer" }, [e._v(e._s(JSON.stringify(s, null, " ")))])];
334
+ } }]) })];
335
+ })], 2), a("ElPagination", { staticClass: "flex-not-shrink", attrs: { "current-page": e.page.page, "hide-on-single-page": e.hideOnSinglePage, "page-size": e.page.limit, total: e.page.total, background: "", layout: "total, prev, pager, next, jumper" }, on: { "current-change": (s) => {
336
+ e.page.page = s;
337
+ } } })], 2)]);
338
+ }, A = [], R = /* @__PURE__ */ B(
339
+ x,
456
340
  E,
457
341
  A,
458
342
  !1,
459
- L,
343
+ null,
460
344
  null,
461
345
  null,
462
346
  null
463
347
  );
464
- function L(e) {
465
- for (let a in T)
466
- this[a] = T[a];
467
- }
468
- const D = /* @__PURE__ */ function() {
469
- return O.exports;
470
- }();
348
+ const M = R.exports;
471
349
  export {
472
- D as default
350
+ M as default
473
351
  };
@@ -1,15 +1,15 @@
1
- var $ = Object.defineProperty, T = Object.defineProperties;
2
- var w = Object.getOwnPropertyDescriptors;
1
+ var v = Object.defineProperty, $ = Object.defineProperties;
2
+ var T = Object.getOwnPropertyDescriptors;
3
3
  var d = Object.getOwnPropertySymbols;
4
4
  var f = Object.prototype.hasOwnProperty, m = Object.prototype.propertyIsEnumerable;
5
- var u = (e, t, s) => t in e ? $(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, p = (e, t) => {
5
+ var u = (e, t, s) => t in e ? v(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, p = (e, t) => {
6
6
  for (var s in t || (t = {}))
7
7
  f.call(t, s) && u(e, s, t[s]);
8
8
  if (d)
9
9
  for (var s of d(t))
10
10
  m.call(t, s) && u(e, s, t[s]);
11
11
  return e;
12
- }, b = (e, t) => T(e, w(t));
12
+ }, b = (e, t) => $(e, T(t));
13
13
  var y = (e, t) => {
14
14
  var s = {};
15
15
  for (var l in e)
@@ -35,64 +35,10 @@ var h = (e, t, s) => new Promise((l, r) => {
35
35
  }, a = (i) => i.done ? l(i.value) : Promise.resolve(i.value).then(g, o);
36
36
  a((s = s.apply(e, t)).next());
37
37
  });
38
- import { cloneDeep as S, merge as P } from "@web-utils/integrations/lodash";
39
- import { copy as x, hasOwn as C } from "@web-utils/core";
40
- import { f as v, h as O, i as E } from "../chunks/index.57f871af.mjs";
41
- import { n as M } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
42
- var R = function() {
43
- var e = this, t = e.$createElement, s = e._self._c || t;
44
- return s("div", {
45
- staticClass: "work",
46
- staticStyle: {
47
- height: "100%",
48
- "background-color": "#fff"
49
- }
50
- }, [s("div", {
51
- staticClass: "flex-column list-content",
52
- staticStyle: {
53
- height: "100%"
54
- }
55
- }, [s("div", {
56
- directives: [{
57
- name: "loading",
58
- rawName: "v-loading",
59
- value: e.loading,
60
- expression: "loading"
61
- }],
62
- staticClass: "flex-item-relative",
63
- attrs: {
64
- "element-loading-text": "加载中...",
65
- "element-loading-background": "#fff"
66
- }
67
- }, [s("div", {
68
- ref: "scroller",
69
- staticClass: "scroll-wrapper"
70
- }, [s("div", {
71
- staticClass: "cards-block"
72
- }, [e._t("prepend"), e._l(e.records, function(l) {
73
- return [e._t("default", null, {
74
- item: l
75
- })];
76
- }), e._t("append")], 2)])]), s("ElPagination", {
77
- staticClass: "flex-not-shrink",
78
- staticStyle: {
79
- "border-top": "1px solid #ebeef5"
80
- },
81
- attrs: {
82
- "current-page": e.page.page,
83
- "hide-on-single-page": e.hideOnSinglePage,
84
- "page-size": e.page.limit,
85
- total: e.page.total,
86
- background: "",
87
- layout: "total, prev, pager, next, jumper"
88
- },
89
- on: {
90
- "current-change": function(l) {
91
- e.page.page = l;
92
- }
93
- }
94
- })], 1)]);
95
- }, j = [];
38
+ import { cloneDeep as S, merge as w } from "@web-utils/integrations/lodash";
39
+ import { copy as P, hasOwn as x } from "@web-utils/core";
40
+ import { f as _, h as C, i as O } from "../chunks/index.57f871af.mjs";
41
+ import { n as R } from "../chunks/_plugin-vue2_normalizer.446f5dc4.mjs";
96
42
  function k(e) {
97
43
  let t = "";
98
44
  for (const s in e)
@@ -105,7 +51,7 @@ const c = {
105
51
  error: -1,
106
52
  empty: 2,
107
53
  success: 0
108
- }, F = {
54
+ }, E = {
109
55
  name: "PageableView",
110
56
  bus: {
111
57
  reloadTableView(e) {
@@ -209,11 +155,11 @@ const c = {
209
155
  return e.length > 3 ? 50 + (e.length - 3) * 10 : 50;
210
156
  },
211
157
  mergeAttrs() {
212
- return P({}, this.$attrs, { height: this.autoHeight ? null : "auto" });
158
+ return w({}, this.$attrs, { height: this.autoHeight ? null : "auto" });
213
159
  },
214
160
  headers() {
215
161
  var e;
216
- return ((e = this.columns) == null ? void 0 : e.map(v)) || [];
162
+ return ((e = this.columns) == null ? void 0 : e.map(_)) || [];
217
163
  }
218
164
  },
219
165
  watch: {
@@ -248,13 +194,13 @@ const c = {
248
194
  this.$refs.scroller && this.scrollTo(this.tableScrollTop, this.tableScrollLeft);
249
195
  });
250
196
  },
251
- filterTableProperties: O,
252
- filterTableEvents: E,
253
- filterTableColumnProperties: v,
197
+ filterTableProperties: C,
198
+ filterTableEvents: O,
199
+ filterTableColumnProperties: _,
254
200
  onTableScroll() {
255
201
  this.tableScrollTop = this.$refs.scroller.scrollTop, this.tableScrollLeft = this.$refs.scroller.scrollLeft;
256
202
  },
257
- copy: (e) => x(k(e)),
203
+ copy: (e) => P(k(e)),
258
204
  onSortChange({ prop: e, order: t }) {
259
205
  this.page.ascs = t === "ascending" ? e : "", this.page.descs = t === "descending" ? e : "";
260
206
  },
@@ -308,7 +254,7 @@ const c = {
308
254
  getPage() {
309
255
  return h(this, null, function* () {
310
256
  var i;
311
- if (C(this.$attrs, "data")) {
257
+ if (x(this.$attrs, "data")) {
312
258
  this.records = this.$attrs.data, this.page.page = 1, this.page.total = this.records.length, this.page.limit = this.page.total;
313
259
  return;
314
260
  }
@@ -350,24 +296,25 @@ const c = {
350
296
  e && (this.$refs.scroller.scrollTop = e), t && (this.$refs.scroller.scrollLeft = t);
351
297
  }
352
298
  }
353
- }, _ = {};
354
- var L = /* @__PURE__ */ M(
299
+ };
300
+ var F = function() {
301
+ var t = this, s = t._self._c;
302
+ return s("div", { staticClass: "work", staticStyle: { height: "100%", "background-color": "#fff" } }, [s("div", { staticClass: "flex-column list-content", staticStyle: { height: "100%" } }, [s("div", { directives: [{ name: "loading", rawName: "v-loading", value: t.loading, expression: "loading" }], staticClass: "flex-item-relative", attrs: { "element-loading-text": "加载中...", "element-loading-background": "#fff" } }, [s("div", { ref: "scroller", staticClass: "scroll-wrapper" }, [s("div", { staticClass: "cards-block" }, [t._t("prepend"), t._l(t.records, function(l) {
303
+ return [t._t("default", null, { item: l })];
304
+ }), t._t("append")], 2)])]), s("ElPagination", { staticClass: "flex-not-shrink", staticStyle: { "border-top": "1px solid #ebeef5" }, attrs: { "current-page": t.page.page, "hide-on-single-page": t.hideOnSinglePage, "page-size": t.page.limit, total: t.page.total, background: "", layout: "total, prev, pager, next, jumper" }, on: { "current-change": (l) => {
305
+ t.page.page = l;
306
+ } } })], 1)]);
307
+ }, L = [], M = /* @__PURE__ */ R(
308
+ E,
355
309
  F,
356
- R,
357
- j,
310
+ L,
358
311
  !1,
359
- A,
312
+ null,
360
313
  null,
361
314
  null,
362
315
  null
363
316
  );
364
- function A(e) {
365
- for (let t in _)
366
- this[t] = _[t];
367
- }
368
- const N = /* @__PURE__ */ function() {
369
- return L.exports;
370
- }();
317
+ const G = M.exports;
371
318
  export {
372
- N as default
319
+ G as default
373
320
  };