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