@web-utils/form-ui 1.0.0-beta47 → 1.0.0-beta48

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 (118) hide show
  1. package/chunks/{C9dGL28n.mjs → 6yfBZFOB.mjs} +2 -2
  2. package/chunks/B-zqRAXo.mjs +69 -0
  3. package/chunks/{CXvGoZKJ.mjs → B1IPSTA6.mjs} +2 -2
  4. package/chunks/B3pkJUCx2.mjs +146 -0
  5. package/chunks/{Ct5bDJ50.mjs → B9gA65rt2.mjs} +3 -3
  6. package/chunks/{C1AgOUe_.mjs → BA2KEptL.mjs} +2 -2
  7. package/chunks/BRRcYOud.mjs +613 -0
  8. package/chunks/{Bm5eiSmT.mjs → BUGCiCnl.mjs} +11 -7
  9. package/chunks/{DiJyms_r.mjs → BbSPWDDZ.mjs} +2 -2
  10. package/chunks/{BH_JJ8Xh.mjs → BfxDxIg0.mjs} +2 -2
  11. package/chunks/{C3Uo82-I.mjs → BqWvBF14.mjs} +3 -3
  12. package/chunks/BsZgAJX_2.mjs +81 -0
  13. package/chunks/{DXYgAmil.mjs → BtcjAHE6.mjs} +2 -2
  14. package/chunks/{DhtHh0jk.mjs → ByHz4mmh.mjs} +2 -2
  15. package/chunks/C-D7jeLT2.mjs +568 -0
  16. package/chunks/{BufIRDd0.mjs → C2zgFLYO.mjs} +1 -1
  17. package/chunks/{XCGWTz41.mjs → CAd1zK9Q.mjs} +2 -2
  18. package/chunks/{CSyJ-vEx.mjs → CJdkjadi.mjs} +1 -1
  19. package/chunks/{CFOGMFgo.mjs → CabldOLo.mjs} +17 -10
  20. package/chunks/{Bd1UFJic.mjs → Cln3RBAD.mjs} +21 -21
  21. package/chunks/{CTKmEf2M.mjs → CqoVAnxC2.mjs} +2 -2
  22. package/chunks/{DF9fJMQS.mjs → CuAoMR3n.mjs} +3 -3
  23. package/chunks/{XqRTtFfp.mjs → CxTg0r4n.mjs} +1 -1
  24. package/chunks/{pdwFQpA8.mjs → D0Zg2CV0.mjs} +3 -3
  25. package/chunks/{BsCS7SB5.mjs → DA7oGHSX.mjs} +2 -2
  26. package/chunks/DOZRzqlo.mjs +37 -0
  27. package/chunks/{Cj59E77g.mjs → D_qiRmiE.mjs} +5 -5
  28. package/chunks/{cmuHpsX6.mjs → DcTVYqeJ.mjs} +29 -25
  29. package/chunks/{B3ajWLh3.mjs → Dkd5BC98.mjs} +2 -2
  30. package/chunks/{ChmDDqoZ2.mjs → GI8krYU82.mjs} +1 -1
  31. package/chunks/{D8UVq1t1.mjs → V2p-PCpL.mjs} +6 -6
  32. package/chunks/{taicx2sd.mjs → bFbPPcdq.mjs} +2 -2
  33. package/chunks/{TvNHGVAP.mjs → eae6huQB.mjs} +2 -2
  34. package/chunks/gCeDFHo1.mjs +32 -0
  35. package/chunks/{BvA0aMEE.mjs → gLPy4Sus.mjs} +1 -1
  36. package/chunks/{o6VhYAN52.mjs → hzaYr6Ud2.mjs} +2 -2
  37. package/chunks/{CqTcEefA.mjs → pIzhYsBe.mjs} +2 -2
  38. package/chunks/{CWfUPCtS.mjs → vXQf89tS.mjs} +274 -273
  39. package/chunks/{BWBHzD5N.mjs → wXeqV-_7.mjs} +2 -2
  40. package/confirm-button/index.d.ts +2 -0
  41. package/confirm-button/index.mjs +1 -1
  42. package/confirmable/index.d.ts +2 -0
  43. package/confirmable/index.mjs +1 -1
  44. package/dict-render/index.d.ts +28 -0
  45. package/dict-render/index.mjs +2 -0
  46. package/editable-tree/index.mjs +1 -1
  47. package/element-dialog/index.d.ts +2 -2
  48. package/element-dialog/index.mjs +1 -1
  49. package/{resize-observer → element-resize-observer}/index.mjs +3 -3
  50. package/form-button/index.d.ts +2 -0
  51. package/form-cascader/index.d.ts +3 -3
  52. package/form-cascader/index.mjs +1 -1
  53. package/form-checkbox/index.mjs +1 -1
  54. package/form-checkbox-group/index.mjs +2 -0
  55. package/form-date-picker/index.mjs +1 -1
  56. package/form-holder/index.mjs +1 -1
  57. package/form-image/index.mjs +1 -1
  58. package/form-input/index.mjs +1 -1
  59. package/form-input-cron-expression/index.mjs +1 -1
  60. package/form-input-email/index.mjs +1 -1
  61. package/form-input-id-card/index.mjs +1 -1
  62. package/form-input-number/index.mjs +1 -1
  63. package/form-input-phone-number/index.mjs +1 -1
  64. package/form-input-tag/index.mjs +1 -1
  65. package/form-input-time/index.mjs +1 -1
  66. package/form-item-group/index.mjs +1 -1
  67. package/form-item-x/index.mjs +1 -1
  68. package/form-radio-group/index.d.ts +1 -1
  69. package/form-radio-group/index.mjs +1 -1
  70. package/form-rate/index.mjs +1 -1
  71. package/form-row/index.mjs +1 -1
  72. package/form-select/index.d.ts +1 -1
  73. package/form-select/index.mjs +1 -1
  74. package/form-slider/index.mjs +1 -1
  75. package/form-switch/index.mjs +1 -1
  76. package/form-table/index.d.ts +269 -0
  77. package/form-table/index.mjs +2 -0
  78. package/form-table-plus/index.d.ts +266 -0
  79. package/form-table-plus/index.mjs +2 -0
  80. package/form-text/index.mjs +1 -1
  81. package/form-textarea/index.mjs +1 -1
  82. package/form-time-select/index.mjs +1 -1
  83. package/helper/dictionary.mjs +7 -7
  84. package/iframe-window/index.mjs +1 -1
  85. package/index.css +1 -1
  86. package/index.d.ts +8 -3
  87. package/index.mjs +55 -50
  88. package/package.json +1 -1
  89. package/pageable-table/index.d.ts +7 -7
  90. package/pageable-table/index.mjs +1 -1
  91. package/sub-table/index.d.ts +100 -0
  92. package/sub-table/index.mjs +472 -0
  93. package/sub-table/style.css +1 -0
  94. package/sub-table-plus/index.d.ts +97 -0
  95. package/sub-table-plus/index.mjs +2 -0
  96. package/sub-table-plus/style.css +1 -0
  97. package/table-column/index.mjs +1 -1
  98. package/table-column-def/index.d.ts +18 -8
  99. package/table-column-def/index.mjs +1 -1
  100. package/table-view/index.mjs +107 -106
  101. package/toolbar/index.mjs +1 -1
  102. package/toolbar-button/index.d.ts +2 -2
  103. package/toolbar-button/index.mjs +1 -1
  104. package/vue-cron/index.mjs +1 -1
  105. package/web-types.json +1 -1
  106. package/x-input-tag/index.mjs +52 -51
  107. package/year-calendar/index.mjs +1 -1
  108. package/chunks/CLPSCSsy.mjs +0 -603
  109. package/chunks/CuG2Q-PM.mjs +0 -100
  110. package/form-check-box-group/index.mjs +0 -2
  111. package/chunks/{Ds_Tpa_M.mjs → BBERmTup.mjs} +0 -0
  112. package/chunks/{B1MSrc6f.mjs → CkOD-_VV.mjs} +0 -0
  113. package/chunks/{DDmQcNm6.mjs → DOP3aBxf.mjs} +0 -0
  114. package/chunks/{DJe97Fgi.mjs → hlha6Bhc.mjs} +0 -0
  115. package/{resize-observer → element-resize-observer}/index.d.ts +0 -0
  116. package/{resize-observer → element-resize-observer}/style.css +0 -0
  117. package/{form-check-box-group → form-checkbox-group}/index.d.ts +1 -1
  118. /package/{form-check-box-group → form-checkbox-group}/style.css +0 -0
@@ -1,603 +0,0 @@
1
- import { n as e, u as t } from "./cmuHpsX6.mjs";
2
- import { getDictLabel as n } from "../helper/dictionary.mjs";
3
- import { pageableTableContextKey as r } from "../constants/index.mjs";
4
- import i from "../resize-observer/index.mjs";
5
- import { t as a } from "./CuG2Q-PM.mjs";
6
- import { useVisibilityChange as o } from "../hook/useVisibilityChange.mjs";
7
- import { hasOwn as s } from "@web-utils/core";
8
- import { Fragment as c, computed as l, createBlock as u, createTextVNode as d, createVNode as f, inject as p, mergeModels as m, mergeProps as h, nextTick as ee, onBeforeUpdate as te, onUpdated as g, openBlock as _, provide as ne, reactive as v, ref as y, toDisplayString as b, useModel as x, watch as S, withCtx as C } from "vue";
9
- import { ElMessage as re } from "element-plus";
10
- import { ElButton as ie, ElCheckbox as w, ElDrawer as T, ElEmpty as ae, ElPagination as E, ElRadio as D, ElTable as O, ElTableColumn as k } from "element-plus/es";
11
- import { useEventBus as A } from "@web-utils/vue/hooks/useEventBus";
12
- //#region src/components/table/components/TableColumnFilter.vue
13
- var j = {
14
- __name: "TableColumnFilter",
15
- props: /* @__PURE__ */ m({ columns: {
16
- type: Array,
17
- default: () => []
18
- } }, {
19
- modelValue: {
20
- type: Boolean,
21
- default: !1
22
- },
23
- modelModifiers: {}
24
- }),
25
- emits: ["update:modelValue"],
26
- setup(e, { expose: t }) {
27
- let n = x(e, "modelValue"), r = v({}), i = v({}), a = v({}), o = v({}), s = (e, t, n) => {
28
- n === "hide" ? r[t.prop] = e : n === "fixed" ? i[t.prop] = e : n === "filterable" ? a[t.prop] = e : n === "sortable" && (o[t.prop] = e);
29
- };
30
- return t({
31
- hideProps: r,
32
- fixedProps: i,
33
- filterableProps: a,
34
- sortableProps: o
35
- }), (t, r) => {
36
- let i = k, a = w, o = O, c = T;
37
- return _(), u(c, {
38
- modelValue: n.value,
39
- "onUpdate:modelValue": r[0] || (r[0] = (e) => n.value = e),
40
- class: "table-column-filter",
41
- title: "表格设置",
42
- "append-to-body": ""
43
- }, {
44
- default: C(() => [f(o, {
45
- data: e.columns,
46
- border: ""
47
- }, {
48
- default: C(() => [
49
- f(i, { label: "列名" }, {
50
- default: C(({ row: e }) => [d(b(e.label), 1)]),
51
- _: 1
52
- }),
53
- f(i, {
54
- label: "隐藏",
55
- align: "center"
56
- }, {
57
- default: C(({ row: e }) => [f(a, { onChange: (t) => s(t, e, "hide") }, null, 8, ["onChange"])]),
58
- _: 1
59
- }),
60
- f(i, {
61
- label: "冻结",
62
- align: "center"
63
- }, {
64
- default: C(({ row: e }) => [f(a, { onChange: (t) => s(t, e, "fixed") }, null, 8, ["onChange"])]),
65
- _: 1
66
- }),
67
- f(i, {
68
- label: "过滤",
69
- align: "center"
70
- }, {
71
- default: C(({ row: e }) => [f(a, { onChange: (t) => s(t, e, "filterable") }, null, 8, ["onChange"])]),
72
- _: 1
73
- }),
74
- f(i, {
75
- label: "排序",
76
- align: "center"
77
- }, {
78
- default: C(({ row: e }) => [f(a, {
79
- title: e.allowSort ? null : "该列不支持排序!",
80
- disabled: !e.allowSort,
81
- onChange: (t) => s(t, e, "sortable")
82
- }, null, 8, [
83
- "title",
84
- "disabled",
85
- "onChange"
86
- ])]),
87
- _: 1
88
- })
89
- ]),
90
- _: 1
91
- }, 8, ["data"])]),
92
- _: 1
93
- }, 8, ["modelValue"]);
94
- };
95
- }
96
- }, M = {
97
- props: {
98
- filterable: Boolean,
99
- prop: String
100
- },
101
- setup(e, { attrs: t, slots: n }) {
102
- let i = p(r, null), o = l(() => {
103
- if (e.filterable && i) return (e, t, n) => t[n.property] === e;
104
- }), s = l(() => {
105
- if (e.filterable && i) return [...new Set(i.records.value.map((t) => t[e.prop]).filter((e) => e))].map((e) => ({
106
- text: e,
107
- value: e
108
- }));
109
- });
110
- return () => f(a, h(t, {
111
- prop: e.prop,
112
- filterable: e.filterable,
113
- filterMethod: o.value,
114
- filters: s.value
115
- }), { default: t.default || n.default });
116
- }
117
- }, N = {
118
- data: {
119
- type: Array,
120
- default: () => []
121
- },
122
- height: [String, Number],
123
- maxHeight: [String, Number],
124
- stripe: {
125
- type: Boolean,
126
- default: !1
127
- },
128
- border: {
129
- type: Boolean,
130
- default: !0
131
- },
132
- size: String,
133
- fit: {
134
- type: Boolean,
135
- default: !0
136
- },
137
- showHeader: {
138
- type: Boolean,
139
- default: !0
140
- },
141
- highlightCurrentRow: {
142
- type: Boolean,
143
- default: !1
144
- },
145
- currentRowKey: [String, Number],
146
- rowClassName: [Function, String],
147
- rowStyle: [Function, Object],
148
- cellClassName: [Function, String],
149
- cellStyle: [Function, Object],
150
- headerRowClassName: [Function, String],
151
- headerRowStyle: [Function, Object],
152
- headerCellClassName: [Function, String],
153
- headerCellStyle: [Function, Object],
154
- rowKey: {
155
- type: [Function, String],
156
- default: "id"
157
- },
158
- emptyText: {
159
- type: String,
160
- default: "No Data"
161
- },
162
- defaultExpandAll: {
163
- type: Boolean,
164
- default: !1
165
- },
166
- expandRowKeys: {
167
- type: Array,
168
- default: () => []
169
- },
170
- defaultSort: Object,
171
- tooltipEffect: {
172
- type: String,
173
- default: "dark"
174
- },
175
- tooltipOptions: {
176
- type: Object,
177
- default: () => ({})
178
- },
179
- appendFilterPanelTo: String,
180
- showSummary: {
181
- type: Boolean,
182
- default: !1
183
- },
184
- sumText: {
185
- type: String,
186
- default: "Sum"
187
- },
188
- summaryMethod: Function,
189
- spanMethod: Function,
190
- selectOnIndeterminate: {
191
- type: Boolean,
192
- default: !0
193
- },
194
- indent: {
195
- type: Number,
196
- default: 16
197
- },
198
- lazy: {
199
- type: Boolean,
200
- default: !1
201
- },
202
- load: Function,
203
- treeProps: {
204
- type: Object,
205
- default: () => ({})
206
- },
207
- tableLayout: {
208
- type: String,
209
- default: "fixed"
210
- },
211
- scrollbarAlwaysOn: {
212
- type: Boolean,
213
- default: !1
214
- },
215
- showOverflowTooltip: [Boolean, Object],
216
- flexible: {
217
- type: Boolean,
218
- default: !1
219
- },
220
- scrollbarTabindex: [String, Number],
221
- allowDragLastColumn: {
222
- type: Boolean,
223
- default: !0
224
- },
225
- tooltipFormatter: Function,
226
- preserveExpandedContent: {
227
- type: Boolean,
228
- default: !1
229
- },
230
- nativeScrollbar: {
231
- type: Boolean,
232
- default: !1
233
- },
234
- rowExpandable: Function,
235
- selectionWidth: {
236
- type: String,
237
- default: "45"
238
- },
239
- viewId: String,
240
- url: String,
241
- hideOnSinglePage: Boolean,
242
- api: Function,
243
- model: Object,
244
- ascs: {
245
- type: Array,
246
- default: () => []
247
- },
248
- descs: {
249
- type: Array,
250
- default: () => []
251
- },
252
- headerBold: Boolean,
253
- autoHeight: Boolean,
254
- immediate: {
255
- type: Boolean,
256
- default: !0
257
- },
258
- index: {
259
- type: Boolean,
260
- default: !0
261
- },
262
- multiple: {
263
- type: Boolean,
264
- default: !0
265
- },
266
- selection: {
267
- type: Boolean,
268
- default: !0
269
- },
270
- reloadOnModelChange: {
271
- type: Boolean,
272
- default: !1
273
- },
274
- columns: Array,
275
- pageSize: {
276
- type: Number,
277
- default: 25
278
- },
279
- dicOptions: {
280
- type: Array,
281
- default: () => []
282
- },
283
- paging: {
284
- type: Boolean,
285
- default: !0
286
- },
287
- clickRowSelect: Boolean,
288
- payloadStyle: String,
289
- disabledRowKeys: Array,
290
- selectExport: Boolean,
291
- useVisibilityChange: Boolean
292
- }, P = { data: !0 }, oe = (e) => P[e] !== !0;
293
- //#endregion
294
- //#region src/components/table/PageableTable.vue?vue&type=script&lang.jsx
295
- function se(e) {
296
- let t = "";
297
- for (let n in e) t += `<TableColumn prop="${n}" label="${n}"/>\n`;
298
- return t;
299
- }
300
- var F = {
301
- loading: 1,
302
- error: -1,
303
- empty: 2,
304
- success: 0
305
- }, I = {
306
- name: "PageableTable",
307
- emits: { "page-loaded": null },
308
- inheritAttrs: !1,
309
- props: { ...N },
310
- setup(a, { emit: u, attrs: p, slots: m, expose: _ }) {
311
- let v = y(), b = y(), x = y(1), C = y(F.empty), w = y([]), T = y(null), N = y(!1), P = y([]), I = y({
312
- total: 0,
313
- page: 1,
314
- limit: a.pageSize,
315
- ascs: a.ascs,
316
- descs: a.descs
317
- }), L = y(0), R = y(0), z = l(() => a.reloadOnModelChange ? {
318
- asc: I.value.ascs,
319
- desc: I.value.descs,
320
- page: I.value.page,
321
- limit: I.value.limit,
322
- model: a.model
323
- } : {
324
- asc: I.value.ascs,
325
- desc: I.value.descs,
326
- page: I.value.page,
327
- limit: I.value.limit
328
- }), B = l(() => {
329
- var e;
330
- let t = `${(I.value.page - 1) * I.value.limit + (((e = w.value) == null ? void 0 : e.length) ?? 0)}`;
331
- return t.length > 3 ? 60 + (t.length - 3) * 10 : 60;
332
- }), V = () => {
333
- U();
334
- }, H = (e, t, n) => {
335
- if (a.clickRowSelect && $(e)) {
336
- var r;
337
- if (P.value.find((t) => t[a.rowKey] === e[a.rowKey])) {
338
- var i;
339
- (i = v.value) == null || i.toggleRowSelection(e, !1);
340
- return;
341
- }
342
- (r = v.value) == null || r.toggleRowSelection(e);
343
- }
344
- }, U = () => {
345
- var e, t;
346
- let n = (e = v.value) == null || (e = e.$children) == null ? void 0 : e.find((e) => {
347
- var t;
348
- return ((t = e.$options) == null ? void 0 : t.name) === "ElTableBody";
349
- });
350
- n == null || (t = n.$refs) == null || (t = t.tooltip) == null || t.hide();
351
- }, W = ({ scrollLeft: e, scrollTop: t }) => {
352
- L.value = t, R.value = e;
353
- }, G = () => {
354
- pe(L.value, R.value);
355
- }, ce = (t) => e(se(t)), le = ({ prop: e, order: t }) => {
356
- a.payloadStyle === "body" ? (I.value.ascs = t === "ascending" ? [e] : a.ascs, I.value.descs = t === "descending" ? [e] : a.descs) : (I.value.ascs = t === "ascending" ? e : "", I.value.descs = t === "descending" ? e : "");
357
- }, ue = (e) => {
358
- $(e) && (T.value = e);
359
- }, de = (e) => {
360
- P.value = e;
361
- }, K = () => {
362
- var e;
363
- (e = v.value) == null || e.clearSelection();
364
- }, fe = () => {
365
- let e;
366
- return e = a.payloadStyle === "body" ? {
367
- page: {
368
- ...I.value,
369
- current: I.value.page,
370
- size: I.value.limit
371
- },
372
- example: a.model || {}
373
- } : {
374
- ...I.value,
375
- current: I.value.page,
376
- size: I.value.limit,
377
- ...a.model || {}
378
- }, a.selectExport && (a.rowKey ? e.exportKeys = P.value.map((e) => e[a.rowKey]) : e.exportKeys = P.value.map((e) => w.value.indexOf(e))), e;
379
- }, q = async (e = !0) => {
380
- if (s(p, "data") && p.data !== !1) {
381
- var t;
382
- w.value = p.data, I.value.page = 1, I.value.total = (t = w.value) == null ? void 0 : t.length, I.value.limit = I.value.total;
383
- return;
384
- }
385
- e !== !1 && (w.value = []);
386
- let n, r = fe();
387
- if (a.api) {
388
- e !== !1 && (C.value = F.loading);
389
- try {
390
- a.api && (n = await a.api(r));
391
- } catch {
392
- C.value = F.error;
393
- return;
394
- }
395
- } else if (a.data) n = { data: { data: {
396
- total: a.data.length,
397
- records: a.data
398
- } } };
399
- else {
400
- re.warning({
401
- title: "开发提示!",
402
- message: "PageableTable api(Function) 属性"
403
- });
404
- return;
405
- }
406
- let { data: { data: i } = {} } = n || {}, { total: o, records: c } = i || {};
407
- I.value.total = Number(o), w.value = await me(c), !c || !c.length ? C.value = F.empty : C.value = F.success, J(), u("page-loaded", i);
408
- }, J = () => {
409
- ee(() => {
410
- var e;
411
- (e = v.value) == null || e.doLayout();
412
- });
413
- }, Y = async (e) => {
414
- await q(e);
415
- }, X = () => {
416
- I.value = {
417
- total: 0,
418
- page: 1,
419
- limit: a.pageSize,
420
- ascs: a.ascs,
421
- descs: a.descs
422
- };
423
- }, pe = (e, t) => {
424
- v.value.setScrollTop(e), v.value.setScrollLeft(t);
425
- }, Z = (e, t) => {
426
- var n;
427
- (n = v.value) == null || n.toggleRowSelection(e, t);
428
- }, me = async (e) => {
429
- if (!e) return [];
430
- let t = [...e];
431
- for (let e of t) for (let t of a.dicOptions) if (e[`$${t.prop}`] = e[t.prop], t.dicData) {
432
- var r;
433
- e[t.prop] = ((r = t.dicData.find((n) => n.modelValue === e[t.prop])) == null ? void 0 : r.label) || e[t.prop];
434
- } else e[t.prop] = await n(t.dicType, e[t.prop]);
435
- return t;
436
- }, Q = () => {
437
- N.value = !N.value;
438
- }, $ = (e) => {
439
- var t;
440
- return !(e != null && e.disabled) && !((t = a.disabledRowKeys) != null && t.includes(e == null ? void 0 : e[a.rowKey]));
441
- };
442
- a.useVisibilityChange && o({ onPageVisible: () => {
443
- Y(!1);
444
- } }), A("reloadTableView", (e) => {
445
- e === a.viewId && q();
446
- }), S(() => a.url, X), S(() => a.api, X), S(() => p.data, q), S(() => z.value, q, {
447
- deep: !0,
448
- immediate: a.immediate
449
- }), g(() => {
450
- G();
451
- }), te(() => {
452
- x.value++;
453
- }), _({
454
- records: w,
455
- getPage: q,
456
- refresh: Y,
457
- reload: X,
458
- doLayout: J,
459
- clearSelection: K,
460
- toggleRowSelection: Z,
461
- toggleSettings: Q
462
- }), ne(r, {
463
- records: w,
464
- getPage: q,
465
- refresh: Y,
466
- reload: X,
467
- doLayout: J,
468
- clearSelection: K,
469
- toggleRowSelection: Z,
470
- toggleSettings: Q
471
- });
472
- let { autoBindProps: he, listeners: ge } = t(a, { predicate: oe });
473
- return () => {
474
- var e;
475
- let t = T.value && T.value[p["row-key"] || a.rowKey || "id"] === (T.value && a.rowKey ? T.value[a.rowKey] : (e = T.value) == null ? void 0 : e.id), n = [];
476
- if (m.default) {
477
- var r;
478
- let e = (r = m.default) == null ? void 0 : r.call(m);
479
- (e.length === 1 ? e[0].children : e).forEach(({ props: e, children: t }) => {
480
- if (e) {
481
- var r, i, a, o;
482
- n.push({
483
- ...e,
484
- allowSort: e.sortable !== !1,
485
- hide: (r = b.value) == null ? void 0 : r.hideProps[e.prop],
486
- filterable: (i = b.value) == null ? void 0 : i.filterableProps[e.prop],
487
- sortable: ((a = b.value) == null ? void 0 : a.sortableProps[e.prop]) === !0,
488
- fixed: e.fixed || ((o = b.value) == null ? void 0 : o.fixedProps[e.prop]),
489
- header: t == null ? void 0 : t.header,
490
- default: t == null ? void 0 : t.default
491
- });
492
- }
493
- });
494
- } else a.columns && a.columns.forEach((e) => {
495
- var t, r, i, a;
496
- n.push({
497
- ...e,
498
- allowSort: e.sortable !== !1,
499
- hide: (t = b.value) == null ? void 0 : t.hideProps[e.prop],
500
- filterable: (r = b.value) == null ? void 0 : r.filterableProps[e.prop],
501
- sortable: ((i = b.value) == null ? void 0 : i.sortableProps[e.prop]) === !0,
502
- fixed: e.fixed || ((a = b.value) == null ? void 0 : a.fixedProps[e.prop])
503
- });
504
- });
505
- return f("div", { class: ["pageable-table", { "auto-height": a.autoHeight }] }, [f("div", { class: "pageable-table-wrapper" }, [
506
- m.toolbar && m.toolbar({ selectedRows: P.value }),
507
- f(O, h(ge.value, he.value, {
508
- ref: v,
509
- data: w.value,
510
- class: ["flex-item", { "header-bold": a.headerBold }],
511
- border: a.border,
512
- stripe: !0,
513
- size: "default",
514
- height: a.autoHeight ? null : "auto",
515
- onScroll: W,
516
- onSortChange: le,
517
- onRowDblclick: V,
518
- onRowClick: H,
519
- onCellClick: U,
520
- onCurrentChange: ue,
521
- onSelectionChange: de
522
- }), {
523
- default: () => {
524
- let e = [];
525
- if (a.multiple && a.selection && e.push(f(k, {
526
- type: "selection",
527
- selectable: $,
528
- width: a.selectionWidth,
529
- align: "center"
530
- }, null)), !a.multiple && a.selection && e.push(f(k, {
531
- type: "single-selection",
532
- "class-name": "single-select-column",
533
- width: a.selectionWidth,
534
- align: "center"
535
- }, {
536
- header: () => f(D, {
537
- modelValue: !!T.value,
538
- label: !0
539
- }, { default: () => [f("span", null, null)] }),
540
- default: ({ row: e }) => f(D, {
541
- label: !0,
542
- disabled: !$(e),
543
- modelValue: t
544
- }, { default: () => [f("span", null, null)] })
545
- })), a.index && e.push(f(k, {
546
- type: "index",
547
- label: "序号",
548
- width: B.value,
549
- align: "center"
550
- }, { default: ({ $index: e }) => (I.value.page - 1) * I.value.limit + e + 1 || e + 1 })), n.length > 0) for (let t = 0; t < n.length; t++) {
551
- let r = n[t];
552
- if (r.hide) continue;
553
- let i = r.prop;
554
- e.push(f(M, r, { default: m[i] ? ({ row: e }) => m[i]({ row: e }) : void 0 }));
555
- }
556
- else e.push(f(k, { label: "点击表格行复制模板" }, { default: ({ row: e }) => f("pre", {
557
- class: "pointer",
558
- onClick: () => ce(e)
559
- }, [JSON.stringify(e, null, " ")]) }));
560
- return e;
561
- },
562
- empty: () => m.empty ? m.empty() : f(c, null, [
563
- C.value === F.loading && f("span", { class: "pageable-table-loading" }, [f("i", { class: "table-status-icon el-icon-loading" }, null), d("加载中...")]),
564
- C.value === F.error && f(ie, {
565
- class: "pageable-table-error",
566
- onClick: Y
567
- }, { default: () => [f("i", { class: "table-status-icon el-icon-error" }, null), d("加载失败,点击重试!")] }),
568
- C.value !== F.loading && C.value !== F.error && f(ae, null, null)
569
- ]),
570
- append: m.append
571
- }),
572
- a.paging && f(E, {
573
- "current-page": I.value.page,
574
- "onUpdate:current-page": (e) => I.value.page = e,
575
- "hide-on-single-page": a.hideOnSinglePage,
576
- "page-size": I.value.limit,
577
- "onUpdate:page-size": (e) => I.value.limit = e,
578
- total: I.value.total,
579
- "page-sizes": [
580
- 10,
581
- 25,
582
- 50,
583
- 100,
584
- 500,
585
- 1e3,
586
- 2e3
587
- ],
588
- class: "flex-not-shrink",
589
- background: !0,
590
- layout: "total, sizes, prev, pager, next, jumper"
591
- }, null),
592
- f(j, {
593
- ref: b,
594
- modelValue: N.value,
595
- "onUpdate:modelValue": (e) => N.value = e,
596
- columns: n
597
- }, null)
598
- ]), f(i, { onNotify: J }, null)]);
599
- };
600
- }
601
- };
602
- //#endregion
603
- export { I as t };
@@ -1,100 +0,0 @@
1
- import { i as e } from "./cmuHpsX6.mjs";
2
- import { getDictLabel as t } from "../helper/dictionary.mjs";
3
- import { tableViewContextKey as n } from "../constants/index.mjs";
4
- import { t as r } from "./Ds_Tpa_M.mjs";
5
- import { computed as i, createVNode as a, inject as o, mergeProps as s, ref as c, watchEffect as l } from "vue";
6
- import { ElTableColumn as u } from "element-plus/es";
7
- //#endregion
8
- //#region src/components/table/components/DictRender.vue
9
- var d = {
10
- name: "DictRender",
11
- inheritAttrs: !1,
12
- props: {
13
- row: Object,
14
- column: Object,
15
- dictType: String,
16
- options: Array,
17
- treeDict: Boolean,
18
- idAsValue: {
19
- type: Boolean,
20
- default: !0
21
- },
22
- labelAsValue: Boolean
23
- },
24
- setup(e, { attrs: n }) {
25
- let r = c(null), o = i(() => e.row[e.column.property]);
26
- return l(async () => {
27
- if (e.dictType) r.value = await t(e.dictType, o.value, !0, {
28
- options: !0,
29
- treeDict: e.treeDict,
30
- idAsValue: e.idAsValue,
31
- labelAsValue: e.labelAsValue
32
- });
33
- else {
34
- var n;
35
- r.value = ((n = e.options) == null || (n = n.find((e) => `${e.modelValue}` == `${e.value}`)) == null ? void 0 : n.label) ?? `${o.value}`;
36
- }
37
- }), () => a("span", n, [r.value]);
38
- }
39
- }, f = {
40
- selection: !0,
41
- "single-selection": !0,
42
- index: !0,
43
- expand: !0
44
- }, p = (e, t, n, r, i) => {
45
- var a;
46
- let o = (e == null || (a = e.$parent) == null ? void 0 : a.rowDbClick) || (e == null ? void 0 : e.rowDbClick);
47
- o == null || o(t, n, r, i);
48
- }, m = (e) => {
49
- let t = e.target;
50
- for (; t && t.tagName.toUpperCase() !== "HTML";) {
51
- if (t.tagName.toUpperCase() === "TD") return t;
52
- t = t.parentNode;
53
- }
54
- return null;
55
- }, h = () => {}, g = (t) => !e(t).length, _ = {
56
- name: "TableColumn",
57
- props: { ...r },
58
- setup(e, { slots: t, attrs: r }) {
59
- let i = o(n, null);
60
- return () => {
61
- let { clickable: n, cellClick: o, ...c } = e, l, _ = f[e.type];
62
- if (!_) {
63
- let s = n || r.onClick || o;
64
- (s || e.dictType || e.options) && (l = (n) => {
65
- var c;
66
- let { row: l, column: u } = n, f = s ? (e) => {
67
- let t = m(e);
68
- if (r.onClick || o) {
69
- var n;
70
- (n = r.onClick) == null || n.call(r, l, u, l, u, t, e), o == null || o(l, u, l, u, t, e);
71
- } else p(i, l, u, t, e);
72
- } : h, _ = t == null || (c = t.default) == null ? void 0 : c.call(t, n);
73
- return g(_) && (_ = null), (e.dictType || e.options) && !_ ? a(d, {
74
- class: { "is-clickable": s },
75
- onClick: f,
76
- row: l,
77
- column: u,
78
- dictType: e.dictType,
79
- treeDict: e.treeDict,
80
- idAsValue: e.idAsValue,
81
- labelAsValue: e.labelAsValue,
82
- options: e.options
83
- }, null) : s ? a("span", {
84
- class: "is-clickable",
85
- onClick: f
86
- }, [_ || (l == null ? void 0 : l[u == null ? void 0 : u.property])]) : _;
87
- });
88
- }
89
- return a(u, s(c, {
90
- key: r.filterable,
91
- showOverflowTooltip: _ ? !1 : c.showOverflowTooltip
92
- }), {
93
- ...t,
94
- default: l || t.default
95
- });
96
- };
97
- }
98
- };
99
- //#endregion
100
- export { _ as t };
@@ -1,2 +0,0 @@
1
- import { t as e } from "../chunks/D8UVq1t1.mjs";
2
- export { e as default };
File without changes
File without changes
File without changes
File without changes